/* ==========================================================================
   Command Deck — dark tactical theme, committed (no light mode).
   Series colours are the validated categorical palette; status colours are
   reserved and always ship beside a written label.
   ========================================================================== */
:root {
  color-scheme: dark;

  /* Pulled off the game's own UI: the navy of the ALLIANCE POWER header bar,
     the gold of a rank-1 banner, the lime that marks your own alliance, and the
     sky blue of its buttons. */
  --bg:            #0b0f18;
  --surface-1:     #141b28;   /* chart surface — the series palette is validated here */
  --surface-2:     #1b2433;
  --surface-3:     #24303f;
  --line:          #2f3f55;
  --line-soft:     #1f2a3a;

  --text:          #e8eef7;
  --text-2:        #9fb0c6;
  --text-3:        #6d7f96;

  --series-1:#3987e5; --series-2:#d95926; --series-3:#199e70; --series-4:#c98500;
  --series-5:#d55181; --series-6:#008300; --series-7:#9085e9; --series-8:#e66767;

  --ok:#7ed957; --warn:#e8a33d; --hot:#ea7a3c; --bad:#f2564d; --neutral:#8092a8;

  --accent:        #f5c542;   /* rank-1 gold */
  --accent-deep:   #c8921a;
  --accent-ink:    #1a1405;
  --tech:          #4db8f0;   /* the game's blue */

  --radius:        10px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Saira Condensed", "Oswald", "Arial Narrow", system-ui, sans-serif;
}

* { box-sizing: border-box; }
/* Setting display on elements defeats the browser's own [hidden] rule, so a
   hidden button still shows. Restate it with enough weight to win. */
[hidden] { display: none !important; }
html, body {
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 60px;

  /* Four drawn layers, no images fetched: a radar sweep with contacts on it,
     the contour lines of the desert, the sector grid every base in this app
     carries an x:y from, and the haze over the top. Fixed, so the map stays
     put and the panels slide over it. */
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='760' height='760' viewBox='0 0 760 760'><g fill='none' stroke='%234db8f0' stroke-opacity='.24'><circle cx='380' cy='380' r='112'/><circle cx='380' cy='380' r='202'/><circle cx='380' cy='380' r='292'/><circle cx='380' cy='380' r='370' stroke-dasharray='3 10'/></g><g stroke='%234db8f0' stroke-opacity='.12'><path d='M380 10v740M10 380h740'/></g><path d='M380 380 L380 88 A292 292 0 0 1 586 173 Z' fill='%234db8f0' fill-opacity='.075'/><g fill='%2360d0f0' fill-opacity='.5'><circle cx='470' cy='266' r='3'/><circle cx='299' cy='455' r='2.4'/><circle cx='523' cy='432' r='2'/><circle cx='262' cy='300' r='1.8'/></g></svg>"),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='940' height='520' viewBox='0 0 940 520'><g fill='none' stroke='%23f5c542' stroke-opacity='.11' stroke-width='1.2'><path d='M-30 470 C 140 416, 250 496, 380 440 S 620 388, 760 454 S 900 412, 960 374'/><path d='M-30 424 C 140 370, 250 450, 380 394 S 620 342, 760 408 S 900 366, 960 328'/><path d='M-30 378 C 140 324, 250 404, 380 348 S 620 296, 760 362 S 900 320, 960 282'/><path d='M-30 332 C 140 278, 250 358, 380 302 S 620 250, 760 316 S 900 274, 960 236'/><path d='M-30 286 C 140 232, 250 312, 380 256 S 620 204, 760 270 S 900 228, 960 190'/><path d='M-30 240 C 140 186, 250 266, 380 210 S 620 158, 760 224 S 900 182, 960 144'/><path d='M-30 194 C 140 140, 250 220, 380 164 S 620 112, 760 178 S 900 136, 960 98'/></g></svg>"),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><g fill='none' stroke='%234a6a94'><path d='M32 0v160M64 0v160M96 0v160M128 0v160M0 32h160M0 64h160M0 96h160M0 128h160' stroke-opacity='.17'/><path d='M.5 0v160M0 .5h160' stroke-opacity='.36'/></g><g fill='%2360d0f0' fill-opacity='.34'><rect x='0' y='0' width='7' height='1.4'/><rect x='0' y='0' width='1.4' height='7'/></g></svg>"),
    radial-gradient(1100px 680px at 50% -12%, rgba(77,184,240,.08), transparent 62%),
    linear-gradient(178deg, #121c2c 0%, #0b0f18 46%, #070a11 100%);
  background-repeat: no-repeat, no-repeat, repeat, no-repeat, no-repeat;
  background-position: right -200px top -170px, left -160px bottom -40px, 0 0, 0 0, 0 0;
  background-attachment: fixed, fixed, fixed, fixed, fixed;
}
a { color: var(--series-1); }
h1,h2,h3,h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-family: var(--display); letter-spacing: .02em; }
.dim { color: var(--text-3); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ chrome */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background:
    linear-gradient(180deg, rgba(31,44,66,.97) 0%, rgba(17,25,39,.95) 62%, rgba(13,19,30,.94) 100%);
  border-bottom: 1px solid var(--accent-deep);
  box-shadow: 0 10px 26px rgba(0,0,0,.45);
  backdrop-filter: blur(9px);
}
/* Hazard stripe under the header — the one piece of military dressing that
   earns its place, because it marks where the chrome ends and the data starts. */
.topbar::after {
  content: ''; display: block; height: 3px;
  background: repeating-linear-gradient(135deg,
    rgba(245,197,66,.34) 0 9px, rgba(11,15,24,0) 9px 18px);
}
.topbar-in {
  max-width: 1320px; margin: 0 auto;
  padding: 10px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
/* Shaped like the alliance banners on the in-game leaderboard. */
.brand .sid {
  font-family: var(--display); font-size: 15px; font-weight: 700;
  color: var(--accent-ink);
  background: linear-gradient(180deg, #ffd964 0%, var(--accent) 55%, var(--accent-deep) 100%);
  padding: 4px 11px 11px; letter-spacing: .06em; align-self: flex-start;
  clip-path: polygon(0 0, 100% 0, 100% 66%, 50% 100%, 0 66%);
}
.brand .title { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.brand .sub { font-size: 12px; color: var(--text-3); }
.spacer { flex: 1 1 auto; }

nav.tabs {
  max-width: 1320px; margin: 0 auto;
  padding: 0 12px;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a {
  font-family: var(--display); text-transform: uppercase; letter-spacing: .08em;
  padding: 10px 14px; font-size: 14.5px; font-weight: 600;
  color: var(--text-2); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
nav.tabs a:hover { color: var(--text); background: var(--surface-1); }
nav.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); text-shadow: 0 0 18px rgba(245,197,66,.45); }

main { max-width: 1320px; margin: 0 auto; padding: 22px 20px; }

/* ------------------------------------------------------------- notices */
.banner {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid rgba(245,197,66,.34); color: #f7dd9c;
  background: linear-gradient(180deg, rgba(245,197,66,.10), rgba(245,197,66,.04));
  font-size: 13.5px; margin-bottom: 16px;
  border-left-width: 3px;
}
.banner b { color: var(--accent); }
.banner.info {
  border-color: rgba(77,184,240,.32); color: #bcdcf5;
  background: linear-gradient(180deg, rgba(77,184,240,.10), rgba(77,184,240,.03));
}
.banner.info b { color: var(--tech); }

/* --------------------------------------------------------------- panels */
.grid { display: grid; gap: 14px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.span-2 { grid-column: span 2; }

.panel {
  background: linear-gradient(180deg, rgba(47,63,85,.30) 0%, transparent 42px), rgba(20, 27, 40, .90);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset;
}
.panel > header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: -2px 0 14px;
}
.panel > header h3 { font-family: var(--display); font-size: 15px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-2); font-weight: 600; }
.panel .hint { font-size: 12px; color: var(--text-3); }

/* stat tile — a number, not a chart */
.tile { position: relative; }
.tile .k { font-family: var(--display); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 600; }
.tile .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 30px; font-weight: 650; line-height: 1.15; margin-top: 6px; }
.tile .d { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.tile.alert { border-color: rgba(242,86,77,.45); }
.tile.alert .v { color: var(--bad); }
.tile.warn { border-color: rgba(232,163,61,.42); }
.tile.warn .v { color: var(--warn); }

/* --------------------------------------------------------------- charts */
.bars { display: grid; gap: 10px; }
.bar-row.clickable { cursor: pointer; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; }
.bar-label { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight: 560; }
.bar-value { font-family: var(--mono); color: var(--text-2); font-size: 12.5px; }
.bar-track { height: 9px; background: var(--surface-3); border-radius: 0 5px 5px 0; margin-top: 5px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 0 4px 4px 0; transition: width .35s ease; }
.bar-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

.strip { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.strip-seg { min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item b { font-family: var(--mono); color: var(--text); font-weight: 600; }

.histo { display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.histo-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.histo-bar { width: 100%; background: var(--series-1); border-radius: 4px 4px 0 0; }
.histo-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-top: 6px; }

svg.series { width: 100%; height: auto; max-height: 260px; display: block; }
svg.series .grid { stroke: var(--line-soft); stroke-width: 1; }
svg.series .tick { fill: var(--text-3); font-size: 11px; font-family: var(--mono); }
svg.series .series-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.series .series-area { fill: var(--series-1); opacity: .12; }
svg.series .series-dot { fill: var(--series-1); stroke: var(--surface-1); stroke-width: 2; }
svg.series .series-area { fill: var(--series-1); }
svg.series .hit { fill: transparent; }
svg.series .crosshair { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }

.heat-scroll { overflow-x: auto; }
.heat { display: grid; gap: 2px; min-width: max-content; }
.heat-corner, .heat-colhead, .heat-rowhead, .heat-cell {
  font-size: 11.5px; display: flex; align-items: center;
}
.heat-colhead { justify-content: center; text-align: center; color: var(--text-3); font-family: var(--mono); padding-bottom: 4px; }
.heat-colhead span { line-height: 1.15; }
.heat-rowhead { color: var(--text-2); padding-right: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat-cell {
  justify-content: center; height: 26px; border-radius: 4px;
  background: var(--surface-2); color: var(--text-2);
  font-family: var(--mono); font-size: 10.5px;
}
.heat-cell.on-light { color: #071120; font-weight: 600; }
.heat-cell.missing { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, var(--surface-1) 4px, var(--surface-1) 8px); color: var(--text-3); }
.ramp-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 11px; }
.ramp-legend i { width: 20px; height: 9px; border-radius: 2px; }

.viz-tip {
  position: fixed; z-index: 90; pointer-events: none;
  background: #070c15; border: 1px solid var(--line);
  border-radius: 7px; padding: 7px 10px;
  font-size: 12.5px; line-height: 1.45; color: var(--text);
  box-shadow: 0 8px 28px rgba(0,0,0,.6); max-width: 260px;
}

/* --------------------------------------------------------------- tables */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(20, 27, 40, .90);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); text-align: left;
  font-family: var(--display); font-size: 13px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-3); font-weight: 650;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--text); }
thead th .arrow { color: var(--accent); }
tbody td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 5px;
  background: var(--surface-3); color: var(--text);
}
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  border: 1px solid currentColor;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.active { color: var(--ok); }
.pill.slipping { color: var(--warn); }
.pill.idle { color: var(--hot); }
.pill.abandoned { color: var(--bad); }
.pill.protected { color: var(--neutral); }
.namecell { display: flex; flex-direction: column; gap: 1px; }
.namecell b { font-weight: 600; }
.namecell small { color: var(--text-3); font-size: 11px; font-family: var(--mono); }

/* --------------------------------------------------------------- controls */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
input, select, textarea, button { font: inherit; color: var(--text); }
input[type=text], input[type=number], input[type=date], input[type=time], select, textarea {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--series-1); outline-offset: -1px; border-color: transparent; }
button:focus-visible, .btn:focus-visible, nav.tabs a:focus-visible, th.sortable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { width: 100%; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; resize: vertical; }
label.field { display: grid; gap: 5px; font-size: 12px; color: var(--text-2); }
label.field > span { font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--text-3); }

button, .btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 13px;
  font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
}
button:hover, .btn:hover { background: #2b3a4e; border-color: #3e526d; }
button.primary {
  background: linear-gradient(180deg, #ffd964, var(--accent));
  color: var(--accent-ink); border-color: var(--accent-deep); font-weight: 700;
}
button.primary:hover { background: linear-gradient(180deg, #ffe38a, #ffd05a); }
button.ghost { background: transparent; }
button.danger { color: var(--bad); border-color: rgba(242,86,77,.45); }
button.danger:hover { background: rgba(242,86,77,.12); }
button.sm { padding: 4px 9px; font-size: 12px; }
button:disabled { opacity: .45; cursor: not-allowed; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: none; border-radius: 0; background: transparent; padding: 6px 11px; font-size: 12.5px; }
.seg button.on { background: var(--surface-3); color: var(--accent); }

.empty { color: var(--text-3); font-size: 13px; padding: 10px 0; margin: 0; }

/* ---------------------------------------------------------------- modal */
.modal-back {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(4,7,9,.72); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.modal {
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: 14px; width: min(720px, 100%);
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
}
.modal > header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.modal > header h3 { font-size: 15px; }
.modal .body { padding: 18px; display: grid; gap: 14px; }
.modal > footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 18px; border-top: 1px solid var(--line);
}
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 95; background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 16px; font-size: 13.5px;
  box-shadow: 0 10px 34px rgba(0,0,0,.55);
}
.toast.bad { border-color: #5d2220; color: #ffb4b0; }

/* ------------------------------------------------------------- calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-family: var(--display); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); text-align: center; padding: 4px 0; }
.cal .day {
  min-height: 88px; background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: 8px; padding: 5px 6px; display: flex; flex-direction: column; gap: 3px;
}
.cal .day.out { opacity: .38; }
.cal .day.today { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(245,197,66,.25) inset; }
.cal .daynum { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.cal .day.today .daynum { color: var(--accent); font-weight: 700; }
.cal .ev {
  font-size: 10.5px; line-height: 1.3; border-radius: 4px; padding: 2px 5px;
  border-left: 3px solid var(--series-1); background: var(--surface-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default;
}
.cal .ev.generated { opacity: .82; border-left-style: dashed; }

.upnext { display: grid; gap: 8px; }
.upnext .row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 11px; background: var(--surface-2); border-radius: 8px;
  border-left: 3px solid var(--series-1);
}
.upnext .when { font-family: var(--mono); font-size: 12px; color: var(--text-2); text-align: right; min-width: 88px; }
.upnext .cd { font-family: var(--mono); font-size: 12.5px; color: var(--accent); font-weight: 650; min-width: 72px; text-align: right; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  /* iOS handles background-attachment:fixed badly — it sizes the layer to the
     whole document and stutters on scroll. On a phone the map scrolls with the
     page and the big radar sits this one out. */
  body {
    background-attachment: scroll, scroll, scroll, scroll, scroll;
    background-size: 0 0, 640px 360px, 120px 120px, auto, auto;
  }
  main { padding: 16px 14px; }
  .topbar-in { padding: 10px 14px; gap: 10px; }
  .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .tile .v { font-size: 25px; }
  .cal { gap: 2px; }
  .cal .day { min-height: 58px; padding: 3px; }
  .cal .ev { font-size: 9px; padding: 1px 3px; }
  table { font-size: 12.5px; }
  tbody td, thead th { padding: 7px 9px; }
  .hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  body { background: #fff; color: #000; }
  .topbar, nav.tabs, .toolbar, button { display: none !important; }
  .panel { border-color: #ccc; background: #fff; }
}


/* ------------------------------------------------------- cloud additions */
.conn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-1); font-size: 12px; line-height: 1.25;
}
.conn .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.conn.clickable { cursor: pointer; }
.conn.clickable:hover { border-color: var(--accent); background: var(--surface-2); }
.conn.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.conn b { font-weight: 600; }
.conn small { color: var(--text-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; font-size: 13px; }
dl.kv dt {
  font-family: var(--display); text-transform: uppercase; letter-spacing: .08em;
  font-size: 12px; color: var(--text-3);
}
dl.kv dd { margin: 0; }
code {
  font-family: var(--mono); font-size: 12px;
  background: var(--surface-3); padding: 1px 5px; border-radius: 4px;
}

.codebox {
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px; text-align: center;
}
.codebox code {
  background: none; font-size: 22px; letter-spacing: .1em;
  color: var(--accent); user-select: all;
}

.upload-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px;
}
.upload-row:last-child { border-bottom: none; }

.shot-box {
  background: #070c15; border: 1px solid var(--line); border-radius: 8px;
  max-height: 58vh; overflow: auto; display: flex; justify-content: center;
}
.shot-box img { max-width: 100%; height: auto; display: block; }

input[type=file] {
  background: var(--surface-2); border: 1px dashed var(--line);
  border-radius: 8px; padding: 9px 10px; width: 100%; font-size: 12.5px;
}
input[type=file]::file-selector-button {
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 11px; margin-right: 10px;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}

@media (max-width: 720px) {
  .conn { padding: 4px 8px; }
  .conn small { display: none; }
  dl.kv { grid-template-columns: 1fr; gap: 2px 0; }
  dl.kv dd { margin-bottom: 8px; }
}
