
@font-face {
  font-family: "Archivo"; 
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: block;
  src: url("/static/fonts/archivo.woff2") format("woff2");
}

:root {
  --table: #18201f;
  --table-hi: #212b29;
  --paper: #e9e6db;
  --ink: #d7ddd5;
  --ink-soft: #8f9c95;
  --pencil: #ef5b3c;
  --pad: clamp(14px, 2.6vw, 32px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  overflow-x: clip;
  background: radial-gradient(ellipse at 40% 40%, var(--table-hi), var(--table) 70%);
  color: var(--ink);
  font: 500 15px/1.45 "Archivo", system-ui, sans-serif;
  font-stretch: 88%;
  -webkit-font-smoothing: antialiased;
}
h1, p, ol, figure, pre { margin: 0; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--pencil); outline-offset: 3px; }

.bearing {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 1rem;
  min-height: 100svh;
  padding: var(--pad);
}
.top { display: flex; justify-content: space-between; color: var(--ink-soft); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.back { color: inherit; text-decoration: none; }
.back:hover { color: var(--ink); }

.table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: start;
}
@media (max-width: 860px) { .table { grid-template-columns: minmax(0, 1fr); } }



.sheet {
  position: relative;
  width: 100%;
  max-height: calc(100svh - 6rem);
  aspect-ratio: 1000 / 700;
  margin-inline: auto;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 24px 50px -20px rgb(0 0 0 / 0.7);
}
.relief, .plot { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.relief { image-rendering: auto; }
.plot { touch-action: none; user-select: none; -webkit-user-select: none; }

.contours .c { fill: none; stroke: rgb(215 221 213 / 0.18); stroke-width: 0.8; }
.contours .index { stroke: rgb(215 221 213 / 0.34); stroke-width: 1.1; }
.contours .coast { fill: none; stroke: #b9c9c4; stroke-width: 1.6; }
.grid line { stroke: rgb(215 221 213 / 0.14); stroke-width: 1; }
.grid .gl { fill: var(--ink-soft); font-size: 12px; text-anchor: middle; }
.margin line { stroke: var(--ink-soft); stroke-width: 1.2; }
.margin .mn { stroke: var(--pencil); }
.margin .star { fill: var(--ink-soft); }
.margin .scale { stroke-width: 3; stroke: var(--ink); }
.margin .ml { fill: var(--ink-soft); font-size: 12px; letter-spacing: 0.04em; }

.places circle { fill: var(--ink); }
.places text { fill: var(--ink); font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; paint-order: stroke; stroke: rgb(24 32 31 / 0.7); stroke-width: 3px; }

.stations .tick { stroke: var(--ink-soft); stroke-width: 1; }
.stations .tri { fill: var(--ink); }
.stations .sname { fill: var(--ink); font-size: 13px; font-weight: 800; letter-spacing: 0.12em; paint-order: stroke; stroke: rgb(24 32 31 / 0.75); stroke-width: 3px; }
.stations .knob {
  fill: rgb(239 91 60 / 0.2);
  stroke: var(--pencil);
  stroke-width: 2;
  cursor: grab;
  outline: none;
}
.stations .knob:focus-visible { fill: rgb(239 91 60 / 0.55); }
.plot.dragging, .plot.dragging .knob { cursor: grabbing; }

.lines .pencil {
  stroke: var(--pencil);
  stroke-width: 2.2;
  stroke-linecap: round;
  opacity: 0.92;
  filter: drop-shadow(0 0 1px rgb(239 91 60 / 0.6));
}
.fixmark { fill: none; stroke: var(--pencil); stroke-width: 2; stroke-dasharray: 3 3; }
.plot.fixed .fixmark { animation: ring 1.6s ease-in-out infinite; }
@keyframes ring { 50% { stroke-width: 3.2; } }
.plot.solved .lines .pencil { stroke: #f3d36b; filter: none; }



.panel { display: grid; gap: 1.1rem; }


.slip {
  padding: 1rem 1.1rem 1.1rem;
  border-radius: 2px;
  background:
    radial-gradient(circle at 6px 10px, var(--table) 2.5px, transparent 3px) 0 0 / 100% 16px repeat-y,
    var(--paper);
  color: #2a2d28;
  font: 600 0.95rem/1.55 "Archivo", sans-serif;
  font-stretch: 70%;
  letter-spacing: 0.16em;
  white-space: pre;
  padding-left: 1.6rem;
  box-shadow: 0 10px 24px -14px rgb(0 0 0 / 0.8);
  rotate: -0.8deg;
}

.readouts { display: grid; gap: 0.5rem; padding: 0; list-style: none; }
.readouts li {
  display: grid;
  grid-template-columns: 1fr auto 5.2rem auto;
  align-items: center;
  gap: 0.4rem;
  font-variant-numeric: tabular-nums;
}
.readouts .r-name { color: var(--ink-soft); letter-spacing: 0.1em; font-size: 0.9rem; }
.readouts output { text-align: center; color: var(--pencil); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.04em; }
.readouts button {
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid rgb(215 221 213 / 0.25);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.readouts button:hover { border-color: var(--pencil); color: var(--pencil); }
.spread { min-height: 1.45em; color: var(--ink-soft); font-size: 0.9rem; }

.fix { display: grid; gap: 0.6rem; }
.fix input {
  padding: 0.55rem 0.2rem;
  border: 0;
  border-bottom: 1.5px solid var(--ink-soft);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.fix input::placeholder { letter-spacing: 0.06em; text-transform: none; color: var(--ink-soft); opacity: 0.7; }
.fix input:focus { outline: none; border-bottom-color: var(--pencil); }
.confirm {
  position: relative;
  min-height: 2.8rem;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--pencil);
  border-radius: 3px;
  background: transparent;
  color: var(--pencil);
  font: inherit;
  letter-spacing: 0.06em;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.confirm .fill { position: absolute; inset: 0; background: var(--pencil); opacity: 0.22; transform: scaleX(var(--p, 0)); transform-origin: left; }
.confirm .label { position: relative; }
.confirm:disabled { opacity: 0.45; cursor: default; }
.is-busy .confirm { cursor: progress; }
.no-js .fix { display: none; }
.status { min-height: 1.45em; }

.verdict { list-style: none; padding: 0; letter-spacing: 0.05em; }
.verdict li { opacity: 0; animation: line-in 0.8s ease forwards; animation-delay: calc(var(--i) * 0.9s + 0.2s); }
.verdict li:first-child { color: #f3d36b; font-weight: 700; }
@keyframes line-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .plot.fixed .fixmark { animation: none; }
  .verdict li { animation-duration: 0.01s; }
}
