/* The plotting page (/plot), in OnTarget's organiser style: its fonts (Michroma headings, Satoshi text),
   navy bar and cards, orange actions, three text sizes (18 px title, 14 px body, 12 px labels), 16 px fields. */
@font-face { font-family: "Michroma"; src: url(fonts/michroma-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url(fonts/satoshi-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url(fonts/satoshi-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url(fonts/satoshi-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --navy: #011E50; --navy-900: #000c2e; --navy-950: #00061a; --navy-border: #0a2566;
  --orange: #FD5902; --orange-600: #d44400; --orange-50: #fff4ee; --orange-200: #ffc499;
  --green: #059669; --green-50: #ecfdf5; --green-200: #a7f3d0; --green-700: #047857;
  --amber: #b45309; --amber-50: #fffbeb; --amber-200: #fde68a;
  --red: #dc2626; --red-50: #fef2f2; --red-200: #fecaca; --red-700: #b91c1c;
  --page: #f1f5f9; --card: #ffffff; --line: #e2e8f0; --line-strong: #cbd5e1;
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --dark-ink: #e8edf5; --dark-muted: #94a3b8;
  --heading: "Michroma", ui-sans-serif, system-ui, sans-serif;
  --sans: "Satoshi", ui-sans-serif, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-text-size-adjust: 100%; }
a { color: var(--orange-600); }
.hide { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
small, .note { font-size: 12px; color: var(--muted); }

/* The bar: OnTarget's public nav (PublicNav.tsx + BrandLogo.tsx), measure for measure: 56 px, base-900 with a
   base-700 rule; the badge on a neutral-100 chip, overhanging the bar at twice the size on sm+; the wordmark in
   Michroma, 0.2em apart, primary-500, its N and ARGET at 0.8em, ".live" in emerald-400 pulsing every 3 s. */
.bar { position: sticky; top: 0; z-index: 40; background: #000c2e; border-bottom: 1px solid #011E50; }
.bar-in { max-width: 1280px; margin: 0 auto; height: 56px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-chip { background: #f1f5f9; border-radius: 8px; display: flex; align-items: center; margin-left: -8px; z-index: 50; transform-origin: top left;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); }
.brand-chip img { height: 40px; width: auto; border-radius: 8px; display: block; }
.brand-word { font: 14px/20px var(--heading); letter-spacing: .2em; color: #FD5902; white-space: nowrap; }
.brand-word .s { font-size: .8em; }
.brand-word .a { margin-left: -.2em; }
.brand-word .live { color: #34d399; animation: pulse 3s cubic-bezier(.4, 0, .6, 1) infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.bar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav-link { flex-shrink: 0; border-radius: 8px; padding: 6px 10px; font: 500 14px/20px var(--sans); color: #8fa4d1; text-decoration: none; transition: color .15s, background-color .15s; }
.nav-link:hover, .nav-link.on { background: rgb(255 255 255 / .1); color: #fff; }
@media (min-width: 640px) {
  .bar-in { padding: 0 24px; }
  .brand-chip { margin-left: 0; margin-right: 48px; padding: 4px; transform: translateY(4px) scale(2); }
}
@media (min-width: 1024px) { .bar-in { padding: 0 32px; } }

/* The page head: title and tabs */
.head { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 56px; z-index: 20; }
.head-in { max-width: 1280px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.head h1 { font: 18px var(--heading); margin: 0; letter-spacing: .02em; flex: 1 1 auto; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--page); border-radius: 12px; }
.tab { border: 0; background: none; font: 600 13px var(--sans); color: var(--muted); padding: 6px 14px; border-radius: 8px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); }
.tab.on { background: var(--orange); color: #fff; }
.tab .count { font-size: 11px; background: rgb(0 0 0 / .12); border-radius: 999px; padding: 0 6px; }
.tab.alert:not(.on) .count { background: var(--red); color: #fff; }

main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; }
.section { margin-bottom: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); margin: 0; }
.intro { color: var(--muted); margin: 0 0 12px; max-width: 70ch; }

/* Cards: light (tables, the sheet) and dark (controls, forms), as OnTarget's */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgb(15 23 42 / .04); }
.card-pad { padding: 16px; }
.dark { background: var(--navy-900); border: 1px solid var(--navy-border); border-radius: 16px; color: var(--dark-ink); padding: 16px 18px; }
.dark .note, .dark small { color: var(--dark-muted); }
.dark a { color: #fd7c33; }

/* Fields */
.fields { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.f { display: block; min-width: 0; }
.f-xs { width: 90px; } .f-sm { width: 140px; } .f-md { width: 190px; } .f-lg { width: 300px; max-width: 100%; } .f-grow { flex: 1 1 220px; }
.label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.dark .label { color: var(--dark-muted); }
input, select, textarea { font: 16px var(--sans); width: 100%; min-width: 0; border-radius: 8px; padding: 6px 10px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); }
textarea { resize: vertical; }
.dark input, .dark select, .dark textarea { background: var(--navy-950); border-color: var(--navy-border); color: var(--dark-ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 2px rgb(253 89 2 / .2); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: auto; margin-top: 3px; }

/* Buttons: OnTarget's pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; padding: 7px 16px; font: 700 13px var(--sans); white-space: nowrap; cursor: pointer; border: 1px solid transparent; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--orange); color: #fff; } .btn-primary:hover:not(:disabled) { background: var(--orange-600); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-2); } .btn-ghost:hover { border-color: var(--faint); color: var(--ink); }
.dark .btn-ghost { border-color: var(--navy-border); color: var(--dark-muted); } .dark .btn-ghost:hover { color: var(--dark-ink); border-color: #475569; }
.btn-danger { background: transparent; border-color: var(--red-200); color: var(--red-700); } .btn-danger:hover { background: var(--red-50); }
.dark .btn-danger { border-color: #7f1d1d; color: #f87171; } .dark .btn-danger:hover { background: #450a0a; }
.btn-sm { padding: 4px 11px; font-size: 12px; }
.link { background: none; border: 0; padding: 0; font: 700 12px var(--sans); color: var(--orange-600); cursor: pointer; }
.dark .link { color: #fd7c33; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; border: 1px solid; padding: 1px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-ok { color: var(--green-700); background: var(--green-50); border-color: var(--green-200); }
.b-warn { color: var(--amber); background: var(--amber-50); border-color: var(--amber-200); }
.b-bad { color: var(--red-700); background: var(--red-50); border-color: var(--red-200); }
.b-off { color: var(--muted); background: var(--page); border-color: var(--line); }
.b-info { color: var(--orange-600); background: var(--orange-50); border-color: var(--orange-200); }
.bar .badge { background: transparent; }
.bar .b-ok { color: #34d399; border-color: #065f46; } .bar .b-bad { color: #f87171; border-color: #7f1d1d; } .bar .b-warn { color: #fbbf24; border-color: #78350f; } .bar .b-off { color: var(--dark-muted); border-color: var(--navy-border); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #f8fafc; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f8fafc; }
tr.sighter td { color: var(--muted); }
tr.flag td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.cell-main { font-weight: 700; }
/* On a phone the tables scroll sideways rather than squeezing every time onto three lines. */
.table-wrap table { min-width: 720px; }
td.num { white-space: nowrap; }
.empty { padding: 28px 16px; text-align: center; color: var(--faint); border: 1px dashed var(--line-strong); border-radius: 14px; background: #fff; }

/* Live: the card bar, the sheet beside a summary, the shots */
.cardbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; align-items: start; margin-bottom: 16px; }
.cardbar h2 { font: 17px var(--heading); margin: 2px 0 6px; letter-spacing: .02em; overflow-wrap: anywhere; }
.cardbar .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.cardbar .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.cardbar .fields { margin-top: 14px; grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--navy-border); }
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
#sheet { position: relative; padding: 10px; }
#sheet img { display: block; width: 100%; height: auto; }
#sheet svg { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); }
.summary { display: grid; gap: 12px; }
.total { display: flex; align-items: baseline; gap: 10px; }
.total b { font: 34px var(--heading); letter-spacing: .02em; }
.stat-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.stat-row:last-child { border-bottom: 0; }
.stat-row span:first-child { color: var(--muted); }
.flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.flags li { font-size: 13px; padding: 6px 10px; border-radius: 8px; background: var(--amber-50); border: 1px solid var(--amber-200); color: #78350f; }
.flags li b { color: var(--ink); }
.view-opts { display: grid; gap: 6px; }
.score-pill { display: inline-block; min-width: 26px; text-align: center; font-weight: 700; border-radius: 6px; padding: 0 6px; background: var(--page); }
.score-pill.v { background: var(--navy); color: #fff; }
.from { font-size: 11px; color: var(--faint); margin-left: 4px; }

/* Targets: every tablet's card, two to a row, the plain sheet */
.target-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.target { cursor: pointer; overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.target:hover { border-color: var(--orange-200); box-shadow: 0 6px 18px -10px rgb(253 89 2 / .45); }
.target-head { display: flex; align-items: baseline; gap: 8px 12px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.target-head b { font: 15px var(--heading); letter-spacing: .02em; }
.target-head .who { font-weight: 600; }
.target-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.target-sheet { position: relative; padding: 8px; }
.target-sheet img { display: block; width: 100%; height: auto; }
.target-sheet svg { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
.target-empty { padding: 48px 16px; text-align: center; color: var(--faint); }
@media (max-width: 900px) { .target-grid { grid-template-columns: 1fr; } }

/* Tablets */
.tablets { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.tablet h3 { font: 15px var(--heading); margin: 0; letter-spacing: .02em; }
.tablet-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.tablet .sub { font-size: 12px; color: var(--dark-muted); margin-top: 2px; overflow-wrap: anywhere; }
.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.gauge { background: var(--navy-950); border: 1px solid var(--navy-border); border-radius: 10px; padding: 8px 10px; }
.gauge .label { margin: 0; font-size: 11px; }
.gauge b { font-size: 16px; }
.meter { height: 5px; border-radius: 3px; background: var(--navy-border); margin-top: 5px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--green); }
.meter i.low { background: #f59e0b; } .meter i.crit { background: #ef4444; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; }
.kv span:nth-child(odd) { color: var(--dark-muted); }
.warns { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.warns li { font-size: 13px; border-radius: 8px; padding: 6px 10px; }
.warns .bad { background: #450a0a; color: #fecaca; border: 1px solid #7f1d1d; }
.warns .warn { background: #451a03; color: #fde68a; border: 1px solid #78350f; }
.tablet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--navy-border); }

.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.msg { font-size: 13px; margin-top: 10px; }
.msg.ok { color: #34d399; } .msg.bad { color: #f87171; }
.card .msg.ok { color: var(--green-700); } .card .msg.bad { color: var(--red-700); }
.firers { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.firers li { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; border-radius: 8px; background: var(--navy-950); border: 1px solid var(--navy-border); }
.firers li .n { color: var(--dark-muted); font-weight: 700; width: 1.4em; }
.firers li .t { margin-left: auto; font-size: 12px; color: var(--dark-muted); }
details > summary { cursor: pointer; font-weight: 600; }

/* The page head's title clears the badge hanging into it on sm+ (OnTarget's .page-header-body: 8rem). */
@media (min-width: 640px) { .head .head-in { padding-left: 128px; } }
/* The bar's tablets badge: in full, or short on a phone. */
.bar .short { display: none; }
@media (max-width: 560px) { .bar .long { display: none; } .bar .short { display: inline; } }
/* On a phone the links between the pages stay; the wordmark beside the badge gives way to them. */
@media (max-width: 480px) { .brand-word { display: none; } .nav-link { padding: 6px 8px; } .bar-right { gap: 6px; } }

@media (max-width: 900px) {
  .live-grid { grid-template-columns: 1fr; }
  .cardbar { grid-template-columns: 1fr; }
  .cardbar .actions { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .head { position: static; }
  .two { grid-template-columns: 1fr; }
  .tablets { grid-template-columns: 1fr; }
}
