/* Current Navigator: the chart room of a research ship. Scene drawn by art.js (colors from the --cn-* properties below). */
html {
  --cn-sea1: #cfe6ef; --cn-sea2: #a9d0df; --cn-wave: #8dbccd; --cn-land1: #e3d6ad; --cn-land2: #c9b98a; --cn-coast: #7d6b3e;
  --cn-lat: #5f8797; --cn-ink: #102a33; --cn-ribbon: #3f7f96; --cn-sel: #f2b418; --cn-trace: #0b4a63; --cn-target: #c2410c;
  --cn-warm: #d9482b; --cn-cold: #2f6fd6; --cn-wind: #5b6470;
  --cn-wall: #e4ecef; --cn-frame: #7d8a92; --cn-tank1: #e9f5fb; --cn-tank2: #b6dbea; --cn-tank3: #5d9fbe; --cn-unset: #c7d2d6;
  --cn-wood1: #b98a56; --cn-wood2: #8a6236;
  --cn-accent: #1b5e7a; --cn-ok: #13704a; --cn-bad: #b3261e;
  --cn-panel-bg1: #f5f9fa; --cn-panel-bg2: #e3eef2; --cn-panel-ink: #102a33;
  --cn-btn: #ffffff; --cn-btn-line: #86a3ae; --cn-on: #1b5e7a; --cn-on-ink: #ffffff;
  --cn-card: #fffdf3; --cn-card-ink: #2a2414; --cn-card-line: #b59a5e; --cn-halo: #eaf4f8;
}
html[data-theme="dark"] {
  --cn-sea1: #18384a; --cn-sea2: #0f2633; --cn-wave: #24506a; --cn-land1: #4a4432; --cn-land2: #383224; --cn-coast: #a69468;
  --cn-lat: #7ea6b6; --cn-ink: #e6f2f6; --cn-ribbon: #5fa6c0; --cn-sel: #ffcd45; --cn-trace: #b8ecff; --cn-target: #ff9e6b;
  --cn-warm: #ff7a5c; --cn-cold: #7fb0ff; --cn-wind: #b9c2cc;
  --cn-wall: #16232a; --cn-frame: #4d5a62; --cn-tank1: #2d4f60; --cn-tank2: #1f3d4d; --cn-tank3: #0f2532; --cn-unset: #5a676d;
  --cn-wood1: #6b4f31; --cn-wood2: #4b371f;
  --cn-accent: #7cc6dc; --cn-ok: #4fd08c; --cn-bad: #ff8a80;
  --cn-panel-bg1: #1b272b; --cn-panel-bg2: #152024; --cn-panel-ink: #e8f2f5;
  --cn-btn: #10191c; --cn-btn-line: #4f6a73; --cn-on: #7cc6dc; --cn-on-ink: #0b1c22;
  --cn-card: #2c2820; --cn-card-ink: #f4efe3; --cn-card-line: #9c845a; --cn-halo: #0f2633;
}

/* ── layout ── */
.cn { position: absolute; inset: 0; display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 12px; padding: 10px;
  color: var(--tlg-text); font-size: 16px; }
.cn input, .cn button { font: inherit; }
.cn-controls { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; padding: 10px 12px;
  background: linear-gradient(var(--cn-panel-bg1), var(--cn-panel-bg2)); color: var(--cn-panel-ink); border: 3px solid var(--cn-accent);
  border-radius: 14px; box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.cn-right { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }
.cn-kicker { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--cn-accent); }

/* request card */
.cn-card { display: grid; gap: 2px; padding: 8px 12px; border-radius: 10px; background: var(--cn-card); color: var(--cn-card-ink);
  border: 2px dashed var(--cn-card-line); box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.cn-card p { margin: 0; }
.cn-card-l { font-size: 16px; font-weight: 700; opacity: .85; }
.cn-card-v { font-size: 21px; font-weight: 800; line-height: 1.25; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cn-card-n { font-size: 16px; font-weight: 600; line-height: 1.3; }
.cn-arrow { opacity: .7; font-weight: 600; }
.cn-mk { display: inline-block; width: 16px; height: 16px; border-radius: 50%; }
.cn-mk--buoy { background: radial-gradient(circle at 35% 30%, #ffe7a8, #f29b1d 45%, #a65a06); border: 2px solid #6d3a03; }
.cn-mk--port { border: 3px dashed var(--cn-target); }

/* connection log */
.cn-log { padding: 6px 10px; border-radius: 10px; border: 2px solid var(--cn-btn-line); background: var(--cn-btn); }
.cn-log-h { margin: 0 0 2px; font-size: 16px; font-weight: 800; }
.cn-log ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 1px; }
.cn-log li { font-size: 16px; line-height: 1.3; }

/* steps */
.cn-step { display: grid; gap: 5px; }
.cn-step-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; font-weight: 700; line-height: 1.2; }
.cn-n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--cn-accent);
  color: #fff; font-size: 16px; font-weight: 800; }
html[data-theme="dark"] .cn-n { color: #0b1c22; }
.cn-step-h.is-done .cn-n { background: var(--cn-ok); }

/* radio cards */
.cn-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 6px; }
.cn-heat { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cn-heat .cn-cards-b { padding: 4px 16px 4px 8px; }
.cn-path, .cn-pos { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cn-path { grid-template-columns: 1.5fr 1fr 1fr; }
.cn-circ .cn-cards-b { padding: 4px 8px; gap: 6px; }
.cn.is-deep .cn-svg { background: var(--cn-wall); }
.cn-cards .cn-cards-b, .cn-chips-b { display: flex; align-items: center; gap: 8px; text-align: left; min-height: 44px; padding: 5px 10px;
  border-radius: 10px; border: 2px solid var(--cn-btn-line); background: var(--cn-btn); color: var(--cn-panel-ink); font-size: 16px;
  line-height: 1.2; cursor: pointer; touch-action: manipulation; }
.cn-cards-b.is-on, .cn-chips-b.is-on { background: var(--cn-on); color: var(--cn-on-ink); border-color: var(--cn-on); box-shadow: 0 0 0 3px var(--cn-sel); font-weight: 700; }
.cn-cards-b { position: relative; padding-right: 20px !important; }
.cn-cards-b.is-on::after { content: '✓'; position: absolute; top: 3px; right: 6px; font-weight: 900; line-height: 1; }
.cn-ic { font-size: 22px; line-height: 1; }
.cn-letter { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid currentColor; font-weight: 900; }
.cn-cards-b:focus-visible, .cn-chips-b:focus-visible, .cn-step-b:focus-visible, .cn-leg-tag:focus-visible, .cn-num:focus-visible, .cn-range:focus-visible {
  outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.cn-cards-b:disabled, .cn-chips-b:disabled, .cn-step-b:disabled, .cn-leg-tag:disabled { cursor: default; opacity: 1; }
.cn.is-locked .cn-cards-b:not(.is-on), .cn.is-locked .cn-chips-b:not(.is-on) { opacity: .6; }

/* route console under the chart: leg slots + the gyre's four currents */
.cn-console { flex: none; display: grid; gap: 5px; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--cn-btn-line);
  background: linear-gradient(var(--cn-panel-bg1), var(--cn-panel-bg2)); color: var(--cn-panel-ink); }
.cn-console--deep { gap: 6px; }
.cn-route-c { display: grid; gap: 6px; }
.cn-slots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.cn-slot { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 3px 10px; text-align: left; border-radius: 10px;
  border: 2px dashed var(--cn-btn-line); background: transparent; color: var(--cn-panel-ink); font-size: 16px; line-height: 1.15; cursor: pointer; touch-action: manipulation; }
.cn-slot-n { flex: none; font-weight: 800; }
.cn-slot-v { font-weight: 600; }
.cn-slot.is-set { border-style: solid; background: var(--cn-btn); }
.cn-slot.is-set .cn-slot-v { font-weight: 800; }
.cn-slot.is-active { border: 3px solid var(--cn-sel); box-shadow: 0 0 0 2px rgba(242,180,24,.35); }
.cn-slot.is-active .cn-slot-n::after { content: ' ▸'; }
.cn-palette { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cn-chip { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 3px 8px; border-radius: 22px;
  border: 2px solid var(--cn-ribbon); background: var(--cn-btn); color: var(--cn-panel-ink); font-size: 16px; font-weight: 700; line-height: 1.15;
  cursor: pointer; touch-action: manipulation; }
.cn-chip.is-on { background: var(--cn-on); color: var(--cn-on-ink); border-color: var(--cn-on); }
.cn-slot:focus-visible, .cn-chip:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.cn-slot:disabled, .cn-chip:disabled { cursor: default; opacity: 1; }
.cn.is-locked .cn-chip { opacity: .6; }

/* temperature / salinity dials */
.cn-sl { display: grid; gap: 2px; }
.cn-sl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cn-sl-l { font-size: 16px; font-weight: 700; }
.cn-sl-out { font-size: 18px; font-weight: 800; }
.cn-sl-out.is-unset { font-weight: 600; opacity: .75; font-style: italic; }
.cn-sl-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 6px; align-items: center; }
.cn-step-b { min-height: 44px; border-radius: 10px; border: 2px solid var(--cn-btn-line); background: var(--cn-btn); color: var(--cn-panel-ink);
  font-size: 22px; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.cn-range { width: 100%; height: 36px; margin: 0; accent-color: var(--cn-accent); cursor: pointer; }
.cn-temp .cn-range { background: linear-gradient(90deg, #2f6fd6, #e0603a) center / 100% 8px no-repeat; border-radius: 6px; }
.cn-sal .cn-range { background: linear-gradient(90deg, #d7e9f2, #5a7f8f) center / 100% 8px no-repeat; border-radius: 6px; }
.cn-sl-ends { display: flex; justify-content: space-between; font-size: 16px; opacity: .8; padding: 0 50px; }
.cn-meter { margin: 0; display: grid; grid-template-columns: 1fr; gap: 0; padding: 6px 10px; border-radius: 10px;
  background: #0f2229; color: #bff5d0; font-family: ui-monospace, Menlo, Consolas, monospace; border: 2px solid #3d5a62; }
.cn-meter-l { font-size: 16px; color: #e2eef1; font-family: var(--tlg-font, Arial, sans-serif); font-weight: 700; }
.cn-meter-v { font-size: 22px; font-weight: 800; }
.cn-meter-ref { font-size: 16px; color: #a9c3cb; }

/* AP equation */
.cn-ap { display: grid; gap: 4px; }
.cn-eq { margin: 0; padding: 4px 8px; border-radius: 8px; background: var(--cn-card); color: var(--cn-card-ink); border: 1px solid var(--cn-card-line); font-size: 16px; font-weight: 600; }
.cn-ap-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; }
.cn-ap-l { grid-column: 1 / -1; }
.cn-ap-l, .cn-ap-u { font-size: 16px; font-weight: 700; }
.cn-num { width: 100%; min-height: 44px; font-size: 20px; font-weight: 700; padding: 4px 10px; border: 2px solid var(--cn-btn-line); border-radius: 8px;
  background: var(--cn-btn); color: var(--cn-panel-ink); }
.cn-num:disabled { opacity: 1; }

/* scene */
.cn-scene { flex: 1 1 auto; min-height: 150px; display: flex; }
.cn-svg { display: block; width: 100%; height: 100%; border-radius: 14px; border: 3px solid var(--cn-coast);
  box-shadow: 0 3px 8px rgba(0,0,0,.16); font-family: var(--tlg-font, Arial, sans-serif); background: var(--cn-sea2); }
.cn-svg text { paint-order: stroke; stroke: var(--cn-halo); stroke-width: 4px; stroke-linejoin: round; fill: var(--cn-ink); }
.cn-lat { stroke: var(--cn-lat); stroke-width: 1.5; stroke-dasharray: 6 6; }
.cn-lat.is-eq { stroke-width: 2.5; stroke-dasharray: none; }
.cn-lat-t { font-size: 17px; font-weight: 700; }
.cn-land-t { font-size: 18px; font-weight: 800; letter-spacing: .02em; }
.cn-ribbon-hit { fill: none; stroke: transparent; stroke-width: 34; cursor: pointer; pointer-events: stroke; }
.cn-ribbon { fill: none; stroke: var(--cn-ribbon); stroke-width: 14; stroke-linecap: round; opacity: .75; }
.cn-edge--w .cn-ribbon, .cn-edge--e .cn-ribbon { stroke-width: 14; }
.cn-ribbon-sel { fill: none; stroke: var(--cn-sel); stroke-width: 22; stroke-linecap: round; opacity: 0; }
.cn-ribbon-trace { fill: none; stroke: var(--cn-trace); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 12 8; opacity: 0; }
.cn-edge.is-sel .cn-ribbon-sel { opacity: .55; }
.cn-edge.is-trace .cn-ribbon-trace { opacity: 1; }
.cn-edge:hover .cn-ribbon { opacity: 1; }
.cn.is-locked .cn-ribbon-hit { cursor: default; }
.cn-edge-t { font-size: 18px; font-weight: 800; pointer-events: none; }
.cn-badge circle { fill: var(--cn-sel); stroke: #6b4f00; stroke-width: 2; }
.cn-badge text { font-size: 17px; font-weight: 900; fill: #1d1600; stroke: none; }
.cn-badge { pointer-events: none; transition: opacity .2s; }
.cn-node-c { fill: var(--cn-btn); stroke: var(--cn-ink); stroke-width: 3; }
.cn-node-t { font-size: 17px; font-weight: 700; }
.cn-compass circle { fill: var(--cn-halo); stroke: var(--cn-ink); stroke-width: 2; }
.cn-compass path { fill: var(--cn-target); }
.cn-compass text { font-size: 17px; font-weight: 900; }
.cn-model-t { font-size: 18px; font-style: italic; opacity: .85; }
.cn-wind { fill: none; stroke: var(--cn-wind); stroke-width: 4; stroke-dasharray: 10 6; }
.cn-wind-t { font-size: 17px; font-weight: 700; }
.cn-spin-p { fill: none; stroke: var(--cn-trace); stroke-width: 5; }
.cn-spin-t { font-size: 20px; font-weight: 900; }
.cn-winds, .cn-spin, .cn-conv { transition: opacity .5s; }
.cn-svg.is-revealed .cn-winds, .cn-svg.is-revealed .cn-spin { opacity: 1; }
.cn-svg.is-revealed .cn-edge--w .cn-ribbon { stroke: var(--cn-warm); opacity: .95; }
.cn-svg.is-revealed .cn-edge--e .cn-ribbon { stroke: var(--cn-cold); opacity: .9; }
.cn-buoy { transition: none; }
.cn-stamp rect { stroke-width: 3; fill: #fff; }
.cn-stamp text { font-size: 20px; font-weight: 900; stroke: none; }
.cn-stamp.is-ok rect { stroke: var(--cn-ok); } .cn-stamp.is-ok text { fill: var(--cn-ok); }
.cn-stamp.is-bad rect { stroke: var(--cn-bad); } .cn-stamp.is-bad text { fill: var(--cn-bad); }
html[data-theme="dark"] .cn-stamp rect { fill: #11191c; }
.cn-stamp { transition: opacity .25s; }

/* density lab */
.cn-tank-t { font-size: 18px; font-weight: 700; opacity: .9; }
.cn-ref { stroke: var(--cn-ink); stroke-width: 2.5; stroke-dasharray: 10 6; }
.cn-ref-t { font-size: 18px; font-weight: 800; }
.cn-ref-t2 { font-size: 18px; font-weight: 600; }
.cn-head-t { font-size: 18px; font-weight: 800; }
.cn-parcel-e { stroke: var(--cn-ink); stroke-width: 2.5; }
.cn-salt circle { fill: #ffffff; stroke: #4d5f66; stroke-width: 1; }
.cn-parcel-t { font-size: 18px; font-weight: 800; }
.cn-map-t { font-size: 18px; font-weight: 700; font-style: italic; }
.cn-route-p { fill: none; stroke: var(--cn-ink); stroke-width: 3; stroke-dasharray: 8 6; opacity: .55; }
.cn-route[data-route="deep-south"] .cn-route-p { stroke: var(--cn-cold); }
.cn-route-b circle { fill: var(--cn-btn); stroke: var(--cn-ink); stroke-width: 2; }
.cn-route-b text { font-size: 18px; font-weight: 900; stroke: none; }
.cn-route.is-sel .cn-route-p { opacity: 1; stroke-width: 5; }
.cn-route.is-sel .cn-route-b circle { fill: var(--cn-sel); }
.cn-route.is-go .cn-route-p { stroke-dasharray: 600; stroke-dashoffset: 600; animation: cn-draw 1.2s ease-out forwards; }
@keyframes cn-draw { to { stroke-dashoffset: 0; } }
.cn-sink circle { fill: var(--cn-cold); stroke: var(--cn-ink); stroke-width: 2; }
.cn-sink path { stroke: #fff; }
.cn-sink-t { font-size: 18px; font-weight: 700; }
.cn-conv-warm { fill: none; stroke: var(--cn-warm); stroke-width: 5; }
.cn-conv-t { font-size: 18px; font-weight: 700; }
.cn-svg.is-still .cn-route.is-go .cn-route-p { animation: none; stroke-dashoffset: 0; stroke-dasharray: none; }

.cn-readout { flex: none; margin: 0; font-size: 16px; font-weight: 600; min-height: 1.3em; line-height: 1.3; }
.cn-model { flex: none; margin: 0; font-size: 16px; opacity: .85; font-style: italic; line-height: 1.25; }

/* Briefing example */
.cn-ex { border-collapse: collapse; width: 100%; font-size: 17px; }
.cn-ex caption { text-align: left; font-weight: 800; margin-bottom: 6px; }
.cn-ex th, .cn-ex td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--tlg-border, #ccc); }

@media (max-width: 900px) {
  .cn { position: static; grid-template-columns: 1fr; }
  .cn-controls { overflow: visible; }
  .cn-scene { display: block; }
  .cn-svg { height: auto; }
}
@media (max-width: 560px) {
  .cn-palette, .cn-path, .cn-pos { grid-template-columns: 1fr 1fr; }
  .cn-slots { grid-auto-flow: row; }
}
@media (prefers-reduced-motion: reduce) {
  .cn *, .cn-svg * { transition: none !important; animation: none !important; }
}
