/* ============================================================
   GUNPLA ARCHIVE — personal build log
   Mecha hangar / technical dossier visual system
   ============================================================ */

:root {
  --bg: #060a0f;
  --bg-deep: #04070a;
  --panel: #0a121b;
  --panel-2: #0d1823;
  --panel-3: #101f2c;
  --ink: #e8eff7;
  --ink-strong: #f7fbff;
  --muted: #8594a5;
  --dim: #5b6a7a;
  --line: rgba(160, 186, 211, .14);
  --line-strong: rgba(160, 186, 211, .27);
  --accent: #4c9eff;
  --accent-rgb: 76, 158, 255;
  --accent-2: #ffc857;
  --accent-ink: #04121f;
  --ok: #45e0b6;
  --warn: #ffc857;
  --danger: #ff6170;
  --danger-rgb: 255, 97, 112;
  --steel: #9fb1c4;
  --cut: 16px;
  --media-ratio: 4 / 5;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Avenir Next Condensed", "DIN Condensed", "Roboto Condensed", "Arial Narrow", "PingFang SC", sans-serif;
  --font-mono: "SFMono-Regular", "Roboto Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
  color-scheme: dark;
}

html[data-ratio="square"] { --media-ratio: 1 / 1; }
html[data-ratio="wide"] { --media-ratio: 4 / 3; }

html[data-theme="zeon"] {
  --accent: #84d58b;
  --accent-rgb: 132, 213, 139;
  --accent-2: #ffb454;
  --accent-ink: #071b0c;
}
html[data-theme="titans"] {
  --accent: #b896ff;
  --accent-rgb: 184, 150, 255;
  --accent-2: #7ce4ff;
  --accent-ink: #130824;
}
html[data-theme="celestial"] {
  --accent: #57e6cf;
  --accent-rgb: 87, 230, 207;
  --accent-2: #d5ff6e;
  --accent-ink: #031817;
}
html[data-theme="unicorn"] {
  --accent: #ff6b79;
  --accent-rgb: 255, 107, 121;
  --accent-2: #ffd166;
  --accent-ink: #210408;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: rgba(var(--accent-rgb), .35); color: #fff; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg.crest { fill: initial; stroke: initial; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -80px; left: 20px; z-index: 200;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px;
  font-family: var(--font-mono); font-size: 12px; text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- background layers ---------- */
.fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: var(--bg); }
.fx-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(144, 173, 201, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(144, 173, 201, .045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 85% 65% at 50% 24%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 24%, #000 10%, transparent 78%);
}
.fx-glow {
  position: absolute; width: 1000px; height: 760px; left: 50%; top: -390px; transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), .18), transparent 64%);
  filter: blur(10px);
  transition: background .4s;
}
.fx-glow::after {
  content: ""; position: absolute; width: 700px; height: 700px; left: 640px; top: 440px;
  background: radial-gradient(ellipse, rgba(255, 200, 87, .045), transparent 67%);
}
.fx-noise {
  position: absolute; inset: 0; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.fx-rail {
  position: absolute; top: 0; bottom: 0; left: max(18px, calc((100vw - 1320px) / 2));
  width: 1px; background: linear-gradient(transparent, var(--line-strong) 15%, var(--line) 70%, transparent);
  opacity: .45;
}
.fx-rail::before, .fx-rail::after {
  content: ""; position: absolute; left: -3px; width: 7px; height: 7px;
  border: 1px solid var(--accent); background: var(--bg); transform: rotate(45deg);
}
.fx-rail::before { top: 21%; }
.fx-rail::after { top: 71%; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.crest { width: 100%; height: 100%; overflow: visible; }
.crest-shield { fill: rgba(7, 14, 22, .92); stroke: var(--accent); stroke-width: 1.4; }
.crest-inner { fill: none; stroke: var(--accent); stroke-opacity: .26; stroke-width: .8; }
.crest-fin { fill: var(--accent-2); }
.crest-head { fill: #e7eef6; }
.crest-visor { fill: #0b1420; }
.crest-eye { fill: var(--accent); }
.crest-chin { fill: var(--danger); }
.crest-detail { fill: none; stroke: #0b1420; stroke-width: 1; opacity: .55; }

/* ---------- top rail ---------- */
.top-rail {
  border-bottom: 1px solid var(--line);
  background: rgba(5, 9, 14, .64);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  color: var(--dim);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 5;
}
.top-rail-inner {
  max-width: 1320px; margin: 0 auto; padding: 0 36px;
  height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.rail-left, .rail-right { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.rail-center { color: var(--dim); opacity: .8; font-size: 8.5px; letter-spacing: .19em; }
.rail-center span { color: var(--accent); margin: 0 5px; }
.rail-dim { color: #465362; }
.rail-sep { color: var(--line-strong); }
.rail-dot {
  width: 5px; height: 5px; background: var(--ok); border-radius: 50%;
  box-shadow: 0 0 9px rgba(69, 224, 182, .8);
  animation: pulse 2.4s ease-in-out infinite;
}
#clock { color: var(--steel); letter-spacing: .08em; }

/* ---------- shell ---------- */
.site { max-width: 1320px; margin: 0 auto; padding: 0 36px 34px; position: relative; }

/* ---------- hero / masthead ---------- */
.masthead {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) 390px;
  gap: 64px; align-items: end;
  padding: 55px 0 38px;
  border-bottom: 1px solid var(--line);
}
.masthead::before, .masthead::after {
  content: ""; position: absolute; bottom: -1px; width: 42px; height: 5px; background: var(--accent);
}
.masthead::before { left: 0; }
.masthead::after { right: 0; width: 18px; background: var(--accent-2); }
.kicker {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em; color: var(--dim);
  margin-bottom: 20px;
}
.kicker-index { color: var(--accent); }
.kicker-line { height: 1px; width: 38px; background: var(--line-strong); }
.brand-lockup { display: flex; align-items: center; gap: 22px; }
.crest-wrap { position: relative; flex: none; width: 88px; height: 88px; }
.crest-wrap .crest { filter: drop-shadow(0 0 18px rgba(var(--accent-rgb), .18)); }
.crest-orbit {
  position: absolute; inset: -10px; border: 1px solid rgba(var(--accent-rgb), .13);
  border-radius: 50%; border-left-color: rgba(var(--accent-rgb), .48); border-bottom-color: transparent;
  animation: orbit 26s linear infinite;
}
.crest-orbit::before {
  content: ""; position: absolute; top: 3px; right: 8px; width: 4px; height: 4px;
  background: var(--accent); border-radius: 50%;
}
h1 { display: grid; gap: 5px; min-width: 0; }
.title-cn {
  font-size: clamp(42px, 5.7vw, 72px); line-height: .98; font-weight: 800;
  letter-spacing: .035em; color: var(--ink-strong);
  text-shadow: 0 10px 34px rgba(0, 0, 0, .4);
}
.title-en {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 16px; font-weight: 600;
  letter-spacing: .34em; color: var(--accent); text-transform: uppercase;
}
.title-en i { width: 24px; height: 1px; background: var(--accent); }
.title-en b { color: var(--dim); font-weight: 400; }
.lede { max-width: 36em; margin-top: 23px; color: var(--muted); font-size: 13.5px; letter-spacing: .02em; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.hero-tags span {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .12em; color: var(--dim);
  border: 1px solid var(--line); padding: 4px 8px; background: rgba(255, 255, 255, .015);
}
.tag-dot { width: 4px; height: 4px; background: var(--ok); border-radius: 50%; }

/* telemetry */
.telemetry {
  position: relative; padding: 18px 20px 15px;
  background:
    linear-gradient(140deg, rgba(var(--accent-rgb), .055), transparent 42%),
    linear-gradient(160deg, rgba(14, 25, 37, .94), rgba(7, 13, 20, .94));
  border: 1px solid var(--line-strong);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
}
.telemetry::before {
  content: ""; position: absolute; top: 0; left: 0; width: 74px; height: 2px; background: var(--accent);
}
.telemetry::after {
  content: ""; position: absolute; right: 0; bottom: 0; width: 26px; height: 26px;
  border-right: 1px solid var(--accent); border-bottom: 1px solid var(--accent); opacity: .55;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.telemetry-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .14em; color: var(--dim);
  padding-bottom: 13px; border-bottom: 1px solid var(--line);
}
.sys-live { display: flex; align-items: center; gap: 6px; color: var(--ok); font-size: 8px; }
.sys-live i { width: 4px; height: 4px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.tele-grid { display: grid; grid-template-columns: 1fr 1fr; }
.tele-item {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px;
  padding: 13px 0 12px; border-bottom: 1px solid var(--line);
}
.tele-item:nth-child(odd) { border-right: 1px solid var(--line); padding-right: 18px; }
.tele-item:nth-child(even) { padding-left: 18px; }
.tele-item strong {
  font-family: var(--font-display); font-size: 34px; line-height: 1; font-weight: 600;
  color: var(--ink-strong); font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
.tele-item > span { font-size: 10px; line-height: 1.35; color: var(--muted); display: grid; gap: 1px; }
.tele-item em { font-family: var(--font-mono); font-style: normal; font-size: 7.5px; color: var(--dim); letter-spacing: .1em; }
.ratio { padding-top: 13px; }
.ratio-label { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 8px; letter-spacing: .12em; color: var(--dim); }
.ratio-label b { color: var(--accent); font-weight: 500; }
.ratio-track { height: 3px; margin-top: 7px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.ratio-track i {
  display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(var(--accent-rgb), .55); transition: width .7s cubic-bezier(.2, .8, .2, 1);
}
.telemetry-foot {
  display: flex; justify-content: space-between; margin-top: 12px;
  font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .08em; color: var(--dim);
}
#lastSaved { color: var(--steel); }

/* ---------- command deck ---------- */
.command { padding: 24px 0 10px; }
.command-main { display: flex; gap: 10px; align-items: stretch; }
.search-box {
  flex: 1; position: relative; display: flex; align-items: center; gap: 11px;
  height: 48px; padding: 0 14px;
  border: 1px solid var(--line-strong); background: rgba(10, 18, 27, .75);
  transition: border-color .2s, box-shadow .2s, background .2s;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .14), inset 0 0 28px rgba(var(--accent-rgb), .035); background: rgba(12, 22, 33, .9); }
.search-box > svg { color: var(--accent); width: 17px; height: 17px; flex: none; }
.search-box input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  color: var(--ink); font-size: 13px; letter-spacing: .02em;
}
.search-box input::placeholder { color: var(--dim); }
.search-box input::-webkit-search-cancel-button { display: none; }
kbd {
  font-family: var(--font-mono); font-size: 9px; color: var(--dim); line-height: 1;
  border: 1px solid var(--line-strong); padding: 4px 6px; background: rgba(255, 255, 255, .02);
}
.search-clear {
  appearance: none; border: 0; background: transparent; cursor: pointer; padding: 4px; color: var(--muted);
  display: grid; place-items: center;
}
.search-clear:hover { color: var(--ink); }
.search-clear svg { width: 14px; height: 14px; }
.btn {
  appearance: none; border: 1px solid var(--line-strong); background: rgba(10, 18, 27, .7);
  color: var(--ink); font-size: 12px; font-weight: 500; letter-spacing: .03em;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 15px; cursor: pointer; text-decoration: none;
  transition: border-color .18s, background .18s, color .18s, transform .18s;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
.btn:hover { border-color: rgba(var(--accent-rgb), .6); background: rgba(var(--accent-rgb), .075); }
.btn svg { width: 15px; height: 15px; }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700;
  box-shadow: 0 0 24px rgba(var(--accent-rgb), .12);
}
.btn.primary:hover { background: #76b6ff; border-color: #76b6ff; filter: brightness(1.06); }
html[data-theme="zeon"] .btn.primary:hover { background: #9de2a2; border-color: #9de2a2; }
html[data-theme="titans"] .btn.primary:hover { background: #c9adff; border-color: #c9adff; }
html[data-theme="celestial"] .btn.primary:hover { background: #7aefdc; border-color: #7aefdc; }
html[data-theme="unicorn"] .btn.primary:hover { background: #ff8d98; border-color: #ff8d98; }
.btn.small { height: 32px; padding: 0 11px; font-size: 11px; }
.btn.danger { color: var(--danger); border-color: rgba(var(--danger-rgb), .35); background: rgba(var(--danger-rgb), .04); }
.btn.danger:hover { background: rgba(var(--danger-rgb), .1); border-color: var(--danger); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.add-btn { height: 48px; padding: 0 18px; flex: none; font-size: 13px; }
.add-btn kbd { color: rgba(4, 18, 31, .55); border-color: rgba(4, 18, 31, .25); margin-left: 4px; }
.add-btn:hover kbd { color: var(--accent-ink); }

.command-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 0 0; flex-wrap: wrap;
}
.status-tabs { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.status-tab {
  appearance: none; border: 1px solid transparent; background: transparent;
  color: var(--muted); font-size: 11.5px; letter-spacing: .03em;
  height: 32px; padding: 0 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: color .18s, background .18s, border-color .18s;
}
.status-tab:hover { color: var(--ink); background: rgba(255, 255, 255, .025); }
.status-tab.is-active { color: var(--ink-strong); border-color: var(--line-strong); background: rgba(var(--accent-rgb), .07); }
.status-tab b { font-family: var(--font-mono); font-size: 8.5px; font-weight: 500; color: var(--dim); }
.status-tab.is-active b { color: var(--accent); }
.st-dot { display: inline-block; width: 5px; height: 5px; flex: none; }
.st-dot.complete { background: var(--ok); box-shadow: 0 0 6px rgba(69, 224, 182, .5); }
.st-dot.building { background: var(--warn); box-shadow: 0 0 6px rgba(255, 200, 87, .5); }
.st-dot.backlog { background: #8393a5; }
.st-dot.sold { background: var(--danger); opacity: .75; }
.command-tools { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.select-wrap {
  position: relative; display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: rgba(10, 18, 27, .55);
  height: 34px; padding: 0 9px 0 10px;
}
.select-wrap > span { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .12em; color: var(--dim); }
.select-wrap select {
  appearance: none; border: 0; background: transparent; color: var(--ink);
  font-size: 11px; padding: 0 20px 0 0; outline: 0; cursor: pointer;
}
.select-wrap option { background: #0b141e; color: var(--ink); }
.select-wrap > svg { position: absolute; right: 7px; pointer-events: none; width: 12px; height: 12px; color: var(--dim); }
.icon-text { height: 34px; padding: 0 11px; font-size: 11px; }
.icon-text svg { width: 14px; height: 14px; color: var(--muted); }
.icon-text[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); background: rgba(var(--accent-rgb), .07); }
.icon-text[aria-expanded="true"] svg { color: var(--accent); }

.result-line {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 34px; margin-top: 7px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; color: var(--dim);
  border-top: 1px solid var(--line);
}
.result-line p { color: var(--muted); }
.result-line p b { color: var(--accent); font-weight: 500; }
.result-coord { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 8px; opacity: .7; }
.result-coord i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

/* ---------- style / backup panels ---------- */
.style-panel, .backup-panel {
  margin: 12px 0 4px; border: 1px solid var(--line-strong);
  background:
    linear-gradient(150deg, rgba(var(--accent-rgb), .04), transparent 32%),
    rgba(9, 17, 25, .94);
  padding: 16px 18px 18px;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  animation: panelIn .24s ease both;
}
.style-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .15em; color: var(--dim);
}
.style-head b { color: var(--ink); font-family: var(--font-body); font-size: 11.5px; letter-spacing: .08em; font-weight: 500; }
.mini-close {
  margin-left: auto; appearance: none; border: 0; background: transparent; color: var(--muted);
  padding: 3px; cursor: pointer; display: grid; place-items: center;
}
.mini-close:hover { color: var(--ink); }
.mini-close svg { width: 13px; height: 13px; }
.style-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 26px; }
.style-block { min-width: 0; }
.style-label { display: block; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .14em; color: var(--dim); margin-bottom: 9px; }
.theme-options { display: flex; gap: 6px; flex-wrap: wrap; }
.theme-option {
  appearance: none; cursor: pointer; text-align: left;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .015);
  padding: 7px 9px; display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; align-items: center;
  min-width: 86px; transition: border-color .18s, background .18s;
}
.theme-option:hover { border-color: var(--line-strong); }
.theme-option[aria-pressed="true"] { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.tri { grid-row: 1 / 3; display: flex; gap: 2px; }
.tri i { width: 4px; height: 19px; background: #4c9eff; display: block; }
.tri i:nth-child(2) { background: #ffc857; height: 14px; align-self: flex-end; }
.tri i:nth-child(3) { background: #e7eef6; height: 19px; }
.theme-option[data-theme-choice="zeon"] .tri i:first-child { background: #84d58b; }
.theme-option[data-theme-choice="zeon"] .tri i:nth-child(2) { background: #ffb454; }
.theme-option[data-theme-choice="titans"] .tri i:first-child { background: #b896ff; }
.theme-option[data-theme-choice="titans"] .tri i:nth-child(2) { background: #7ce4ff; }
.theme-option[data-theme-choice="celestial"] .tri i:first-child { background: #57e6cf; }
.theme-option[data-theme-choice="celestial"] .tri i:nth-child(2) { background: #d5ff6e; }
.theme-option[data-theme-choice="unicorn"] .tri i:first-child { background: #ff6b79; }
.theme-option[data-theme-choice="unicorn"] .tri i:nth-child(2) { background: #ffd166; }
.theme-option b { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .08em; font-weight: 500; color: var(--ink); line-height: 1.2; }
.theme-option small { font-size: 8.5px; color: var(--dim); line-height: 1.2; }
.segmented { display: flex; gap: 4px; flex-wrap: wrap; }
.segmented button {
  appearance: none; border: 1px solid var(--line); background: rgba(255, 255, 255, .015);
  color: var(--muted); font-size: 10.5px; height: 32px; padding: 0 10px; cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
}
.segmented button:hover { color: var(--ink); border-color: var(--line-strong); }
.segmented button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.backup-content { display: grid; gap: 13px; }
.backup-content p { font-size: 12px; line-height: 1.8; color: var(--muted); max-width: 64em; }
.backup-content p b { color: var(--ink); font-weight: 500; }
.backup-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.backup-last { margin-left: auto; font-family: var(--font-mono); font-size: 8.5px; color: var(--dim); letter-spacing: .04em; }

/* ---------- banners ---------- */
.demo-banner, .store-banner {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid rgba(255, 200, 87, .22);
  background: linear-gradient(90deg, rgba(255, 200, 87, .06), transparent 60%);
  padding: 9px 12px; margin: 3px 0 18px;
  font-size: 11px; color: var(--muted);
}
.demo-tag {
  flex: none; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .12em;
  color: var(--accent-2); border: 1px solid rgba(255, 200, 87, .38); padding: 3px 6px;
}
.demo-banner p { flex: 1; margin: 0; }
.demo-banner b { color: var(--ink); }
.demo-banner button {
  appearance: none; border: 0; background: none; color: var(--accent-2); font-size: 10.5px;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap;
}
.store-banner { border-color: rgba(var(--danger-rgb), .3); background: rgba(var(--danger-rgb), .06); }
.warn-mark {
  width: 20px; height: 20px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--danger); color: var(--danger); font-family: var(--font-mono); font-size: 11px;
}
.store-banner p { margin: 0; }

/* ---------- unit grid ---------- */
#archive { padding-top: 8px; }
.unit-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.unit-card {
  --i: 0;
  position: relative; display: flex; flex-direction: column;
  background:
    linear-gradient(155deg, rgba(var(--accent-rgb), .035), transparent 36%),
    linear-gradient(168deg, #0c1621, #080e16 74%);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  cursor: pointer; text-align: left;
  transition: border-color .22s, transform .22s, box-shadow .22s, background .22s;
  animation: cardIn .55s cubic-bezier(.2, .75, .25, 1) backwards;
  animation-delay: calc(var(--i) * 42ms);
  outline: none;
}
.unit-card::before {
  content: ""; position: absolute; left: 0; top: 0; z-index: 2;
  width: 52px; height: 2px; background: var(--accent); opacity: .9;
}
.unit-card::after {
  content: ""; position: absolute; right: 5px; bottom: 5px; width: 17px; height: 17px; z-index: 2;
  border-right: 1px solid rgba(var(--accent-rgb), .55); border-bottom: 1px solid rgba(var(--accent-rgb), .55);
  opacity: .6; pointer-events: none;
}
.unit-card:hover, .unit-card:focus-visible {
  border-color: rgba(var(--accent-rgb), .52);
  transform: translateY(-4px);
  box-shadow: 0 22px 46px rgba(0, 0, 0, .4), 0 0 0 1px rgba(var(--accent-rgb), .08);
}
.unit-card:hover .card-visual img { transform: scale(1.045); }
.unit-card:hover .card-access { opacity: 1; transform: translateY(0); }
.unit-card:hover .visual-scan { opacity: 1; animation-play-state: running; }
.card-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px 9px;
  font-family: var(--font-mono); font-size: 8px; letter-spacing: .12em; color: var(--dim);
}
.card-serial { display: flex; align-items: center; gap: 7px; }
.card-serial i { width: 5px; height: 5px; border: 1px solid var(--dim); transform: rotate(45deg); }
.card-status { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8.5px; }
.card-status .st-dot { width: 4px; height: 4px; }

.card-visual {
  position: relative; overflow: hidden; margin: 0 9px;
  aspect-ratio: var(--media-ratio); background: #060c12;
  border: 1px solid var(--line);
}
.card-visual img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s cubic-bezier(.2, .7, .2, 1), filter .3s;
  transform-origin: center;
}
.card-visual::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(rgba(150, 185, 215, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 185, 215, .06) 1px, transparent 1px);
  background-size: 38px 38px; opacity: .7;
  mask-image: linear-gradient(to top, #000, transparent 60%);
  -webkit-mask-image: linear-gradient(to top, #000, transparent 60%);
}
.card-visual::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(to top, rgba(3, 7, 11, .85), transparent 34%),
    linear-gradient(115deg, rgba(255, 255, 255, .035), transparent 24%);
}
.visual-scan {
  position: absolute; z-index: 3; left: 0; right: 0; top: -25%; height: 22%;
  background: linear-gradient(to bottom, transparent, rgba(var(--accent-rgb), .07), transparent);
  opacity: 0; animation: scan 4.6s linear infinite; animation-play-state: paused;
  pointer-events: none;
}
.grade-badge {
  position: absolute; z-index: 4; left: 0; top: 10px;
  background: rgba(4, 9, 14, .82); border-left: 2px solid var(--accent);
  color: var(--ink-strong); font-family: var(--font-mono); font-size: 9px; letter-spacing: .09em;
  padding: 4px 8px 4px 7px; backdrop-filter: blur(5px);
}
.scale-badge {
  position: absolute; z-index: 4; right: 9px; bottom: 8px;
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .08em; color: var(--steel);
  padding: 3px 6px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(4, 9, 14, .68);
  backdrop-filter: blur(4px);
}
.visual-reticle {
  position: absolute; z-index: 4; right: 9px; top: 9px; width: 19px; height: 19px;
  border: 1px solid rgba(var(--accent-rgb), .35); border-radius: 50%;
  opacity: .8;
}
.visual-reticle::before, .visual-reticle::after {
  content: ""; position: absolute; background: rgba(var(--accent-rgb), .6);
}
.visual-reticle::before { width: 7px; height: 1px; left: 5px; top: 8px; }
.visual-reticle::after { width: 1px; height: 7px; left: 8px; top: 5px; }
.card-access {
  position: absolute; z-index: 4; left: 10px; bottom: 9px;
  font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .13em; color: var(--accent);
  display: flex; align-items: center; gap: 4px; opacity: 0; transform: translateY(4px);
  transition: opacity .2s, transform .2s;
}
.card-access svg { width: 11px; height: 11px; }

.card-body { padding: 12px 13px 13px; display: flex; flex-direction: column; flex: 1; }
.unit-code {
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .1em; color: var(--accent);
  min-height: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.unit-name {
  margin-top: 3px; font-size: 17px; font-weight: 700; line-height: 1.35; letter-spacing: .01em;
  color: var(--ink-strong); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 1.35em;
}
.unit-series {
  margin-top: 3px; font-size: 10.5px; color: var(--muted); line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-height: 1.5em;
}
.card-foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
  margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line);
}
.card-date { display: grid; gap: 1px; font-family: var(--font-mono); font-size: 8px; letter-spacing: .04em; color: var(--dim); }
.card-date b { color: var(--steel); font-weight: 400; font-size: 9px; }
.card-rate { display: flex; gap: 2px; align-items: center; padding-bottom: 2px; }
.card-rate i {
  display: block; width: 4px; height: 9px; background: rgba(255, 255, 255, .12);
  transform: skewX(-12deg);
}
.card-rate i.on { background: var(--accent-2); box-shadow: 0 0 5px rgba(255, 200, 87, .22); }
.card-rate.empty { font-family: var(--font-mono); font-size: 7.5px; color: var(--dim); letter-spacing: .08em; }
.no-visual {
  display: grid; place-items: center; height: 100%;
  background:
    radial-gradient(circle at 50% 42%, rgba(var(--accent-rgb), .12), transparent 52%),
    repeating-linear-gradient(135deg, transparent 0 11px, rgba(255, 255, 255, .02) 11px 12px);
}
.no-visual svg { width: 70px; height: 70px; opacity: .5; }

/* frame variants */
html[data-frame="blueprint"] .unit-card {
  clip-path: none; background: rgba(7, 17, 26, .78);
  border-style: dashed; border-color: rgba(var(--accent-rgb), .25);
}
html[data-frame="blueprint"] .unit-card::before { width: 100%; height: 1px; opacity: .35; }
html[data-frame="blueprint"] .unit-card::after { display: none; }
html[data-frame="blueprint"] .card-visual { border-style: dashed; }
html[data-frame="blueprint"] .unit-name { font-weight: 600; }
html[data-frame="hangar"] .unit-card {
  border-left: 3px solid var(--accent-2);
  background:
    linear-gradient(90deg, rgba(255, 200, 87, .045), transparent 26%),
    linear-gradient(168deg, #0c1621, #080e16 74%);
}
html[data-frame="hangar"] .unit-card::before {
  width: 64px; height: 4px; background: repeating-linear-gradient(135deg, var(--accent-2) 0 6px, transparent 6px 12px);
}
html[data-frame="hangar"] .card-top { border-bottom: 1px solid var(--line); }

/* ---------- empty state ---------- */
.empty-state {
  display: grid; justify-items: center; text-align: center;
  border: 1px dashed var(--line-strong); padding: 54px 24px 50px; margin-top: 8px;
  background:
    radial-gradient(ellipse at 50% 34%, rgba(var(--accent-rgb), .07), transparent 44%),
    rgba(8, 15, 22, .45);
}
.empty-visual { position: relative; width: 108px; height: 108px; display: grid; place-items: center; margin-bottom: 17px; }
.empty-visual .crest { width: 54px; height: 54px; opacity: .75; position: relative; z-index: 2; }
.empty-ring { position: absolute; inset: 0; border: 1px solid rgba(var(--accent-rgb), .12); border-radius: 50%; }
.empty-ring.r2 { inset: 14px; border-style: dashed; border-color: rgba(var(--accent-rgb), .24); animation: orbit 32s linear infinite; }
.empty-ring.r3 { inset: -15px; border-color: rgba(var(--accent-rgb), .06); }
.empty-scan { position: absolute; left: -6px; right: -6px; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .6; }
.empty-kicker { font-family: var(--font-mono); font-size: 8px; color: var(--accent); letter-spacing: .18em; }
.empty-state h2 { margin-top: 8px; font-size: 25px; letter-spacing: .04em; color: var(--ink-strong); }
.empty-state p { margin-top: 7px; max-width: 34em; font-size: 12px; color: var(--muted); }
.empty-state .btn { margin-top: 20px; height: 40px; }

/* ---------- footer ---------- */
.footer {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-top: 46px; padding: 22px 0 0; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; color: var(--dim);
}
.footer-mark { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.footer-mark .crest { width: 22px; height: 22px; opacity: .65; }
.footer p { color: var(--muted); font-family: var(--font-body); font-size: 10.5px; letter-spacing: .03em; }
.footer p span { display: block; margin-top: 2px; color: var(--dim); font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .12em; }
.footer-meta { display: flex; gap: 17px; text-align: right; }

/* ---------- modal / editor ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(2, 5, 8, .8); backdrop-filter: blur(10px);
  animation: fadeIn .2s ease both;
}
.sheet {
  position: relative; width: 100%; max-width: 940px; max-height: calc(100dvh - 48px);
  overflow: auto; overscroll-behavior: contain;
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), .045), transparent 26%),
    #09121b;
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .65);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
  animation: sheetIn .32s cubic-bezier(.2, .75, .2, 1) both;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.sheet::-webkit-scrollbar { width: 8px; }
.sheet::-webkit-scrollbar-thumb { background: rgba(160, 186, 211, .22); }
.sheet-topline {
  height: 19px; display: flex; align-items: center; gap: 5px; padding: 0 16px;
  background: rgba(255, 255, 255, .025); border-bottom: 1px solid var(--line);
}
.sheet-topline i { width: 13px; height: 1px; background: var(--accent); opacity: .65; }
.sheet-topline span {
  margin-left: auto; font-family: var(--font-mono); font-size: 6.5px; letter-spacing: .16em;
  color: var(--dim);
}
.sheet-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 21px 24px 17px; border-bottom: 1px solid var(--line);
}
.sheet-kicker { display: block; font-family: var(--font-mono); font-size: 8px; letter-spacing: .16em; color: var(--accent); }
.sheet-head h2 { margin-top: 4px; font-size: 24px; line-height: 1.2; letter-spacing: .04em; color: var(--ink-strong); }
.close-btn {
  appearance: none; width: 32px; height: 32px; border: 1px solid var(--line); background: transparent;
  display: grid; place-items: center; color: var(--muted); cursor: pointer; flex: none;
}
.close-btn:hover { border-color: var(--accent); color: var(--accent); }
.close-btn svg { width: 15px; height: 15px; }
.sheet-body { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 28px; padding: 22px 24px 20px; }
.photo-col { min-width: 0; }
.photo-edit {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  border: 1px solid var(--line-strong); background:
    radial-gradient(circle at 50% 44%, rgba(var(--accent-rgb), .08), transparent 54%),
    #050b11;
  cursor: pointer; touch-action: none;
  outline: none;
}
.photo-edit:focus-visible { border-color: var(--accent); }
.photo-edit.has-photo { cursor: grab; }
.photo-edit.dragging { cursor: grabbing; }
.photo-edit.drag-over { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.photo-edit img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  user-select: none; -webkit-user-drag: none;
  transform-origin: center;
}
.photo-empty {
  position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px;
  text-align: center; padding: 20px;
}
.photo-empty .crest { width: 54px; height: 54px; opacity: .5; margin-bottom: 4px; }
.photo-empty b { font-family: var(--font-mono); font-size: 8px; letter-spacing: .18em; color: var(--accent); font-weight: 500; }
.photo-empty span { font-size: 9.5px; color: var(--dim); }
.photo-hud { position: absolute; inset: 0; pointer-events: none; }
.photo-hud .c { position: absolute; width: 13px; height: 13px; border-color: rgba(var(--accent-rgb), .65); border-style: solid; }
.photo-hud .tl { left: 7px; top: 7px; border-width: 1px 0 0 1px; }
.photo-hud .tr { right: 7px; top: 7px; border-width: 1px 1px 0 0; }
.photo-hud .bl { left: 7px; bottom: 7px; border-width: 0 0 1px 1px; }
.photo-hud .br { right: 7px; bottom: 7px; border-width: 0 1px 1px 0; }
.hud-label {
  position: absolute; left: 12px; bottom: 12px;
  font-family: var(--font-mono); font-size: 6.5px; letter-spacing: .1em; color: rgba(232, 239, 247, .55);
  background: rgba(3, 8, 12, .55); padding: 2px 4px;
}
.hud-reticle {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 50%;
}
.hud-reticle::before, .hud-reticle::after { content: ""; position: absolute; background: rgba(255, 255, 255, .2); }
.hud-reticle::before { width: 42px; height: 1px; left: -7px; top: 14px; }
.hud-reticle::after { height: 42px; width: 1px; top: -7px; left: 14px; }
.photo-demo {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  font-family: var(--font-mono); font-size: 7px; letter-spacing: .12em; color: var(--accent-2);
  border: 1px solid rgba(255, 200, 87, .35); background: rgba(3, 8, 12, .7); padding: 2px 5px;
}
.photo-actions { display: flex; gap: 6px; margin-top: 8px; }
.photo-actions .btn { flex: 1; }
.btn.ghost-danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn.ghost-danger:hover { border-color: rgba(var(--danger-rgb), .35); background: rgba(var(--danger-rgb), .06); }
.zoom-row {
  display: grid; grid-template-columns: auto 1fr 38px; align-items: center; gap: 8px;
  margin-top: 10px; font-family: var(--font-mono); font-size: 8px; color: var(--dim);
}
.zoom-row input { width: 100%; accent-color: var(--accent); height: 3px; }
.zoom-row output { text-align: right; color: var(--steel); font-size: 8px; }
.photo-hint { margin-top: 8px; font-size: 9px; line-height: 1.6; color: var(--dim); text-align: center; }

.form-col { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.form-section { display: grid; gap: 11px; }
.form-section + .form-section { border-top: 1px solid var(--line); padding-top: 17px; }
.form-section-label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .13em; color: var(--dim);
}
.form-section-label i {
  font-style: normal; color: var(--accent); border: 1px solid rgba(var(--accent-rgb), .3);
  padding: 1px 4px; font-size: 6.5px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.span-2 { grid-column: span 2; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span {
  display: flex; align-items: baseline; gap: 5px;
  font-size: 10.5px; color: var(--muted);
}
.field > span em { font-family: var(--font-mono); font-style: normal; font-size: 6.5px; letter-spacing: .1em; color: var(--dim); }
.field > span b { color: var(--danger); font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; border: 1px solid var(--line); background: rgba(5, 11, 17, .82);
  color: var(--ink); border-radius: 0; outline: 0; font-size: 12px; padding: 9px 10px;
  transition: border-color .18s, background .18s;
}
.field input, .field select { height: 38px; }
.field select {
  appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238594a5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
}
.field textarea { resize: vertical; min-height: 75px; line-height: 1.65; }
.field input::placeholder, .field textarea::placeholder { color: #4c5a69; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); background: rgba(var(--accent-rgb), .035); }
.field input[type="date"] { color-scheme: dark; font-family: var(--font-mono); font-size: 10.5px; }
.field input[type="date"]::-webkit-calendar-picker-indicator { opacity: .45; cursor: pointer; }
.status-choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; border: 0; margin: 0; padding: 0; }
.status-choices button {
  appearance: none; cursor: pointer; border: 1px solid var(--line); background: rgba(255, 255, 255, .015);
  padding: 7px 5px 6px; display: grid; justify-items: center; gap: 2px; color: var(--muted);
  transition: border-color .18s, background .18s, color .18s;
}
.status-choices button:hover { border-color: var(--line-strong); color: var(--ink); }
.status-choices button[aria-pressed="true"] { border-color: rgba(var(--accent-rgb), .65); background: rgba(var(--accent-rgb), .07); color: var(--ink); }
.status-choices .st-dot { width: 4px; height: 4px; margin-bottom: 2px; }
.status-choices span { font-size: 10.5px; }
.status-choices em { font-family: var(--font-mono); font-size: 6px; font-style: normal; letter-spacing: .08em; color: var(--dim); }
.date-grid { grid-template-columns: 1fr 1fr; }
.rating-field { grid-column: span 2; }
.rating-input { display: flex; align-items: center; gap: 5px; height: 38px; padding: 0 10px; border: 1px solid var(--line); background: rgba(5, 11, 17, .82); }
.rating-input button { appearance: none; border: 0; background: transparent; padding: 2px; cursor: pointer; display: grid; place-items: center; }
.rating-input button i {
  display: block; width: 7px; height: 17px; transform: skewX(-14deg);
  background: rgba(255, 255, 255, .11); transition: background .15s, box-shadow .15s;
}
.rating-input button:hover i, .rating-input button.on i { background: var(--accent-2); box-shadow: 0 0 8px rgba(255, 200, 87, .25); }
.rating-input output { margin-left: auto; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .08em; color: var(--dim); }
.notes-field { gap: 0; }
.char-count { text-align: right; font-family: var(--font-mono); font-size: 7px; color: var(--dim); margin-top: -7px; }
.form-error { min-height: 16px; font-size: 10.5px; color: var(--danger); letter-spacing: .02em; }
.sheet-foot {
  position: sticky; bottom: 0; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: 13px 24px; border-top: 1px solid var(--line);
  background: rgba(8, 16, 24, .96); backdrop-filter: blur(12px);
}
.foot-note { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 7px; letter-spacing: .1em; color: var(--dim); }
.foot-note i { width: 4px; height: 4px; border-radius: 50%; background: var(--ok); }
.foot-actions { margin-left: auto; display: flex; gap: 7px; }
.sheet-foot .btn { height: 38px; }
#deleteBtn { padding-inline: 11px; font-size: 10.5px; }
#deleteBtn.armed { background: rgba(var(--danger-rgb), .14); border-color: var(--danger); }

/* import */
.import-sheet { max-width: 480px; }
.import-body { padding: 22px 24px 26px; display: grid; gap: 16px; }
.import-copy { font-size: 12.5px; line-height: 1.9; color: var(--muted); }
.import-copy b { color: var(--ink); font-size: 16px; font-family: var(--font-display); }
.import-copy small { display: block; margin-top: 3px; font-size: 10px; color: var(--dim); }
.import-choices { display: grid; gap: 7px; }
.import-choices .btn { height: auto; padding: 11px 14px; justify-content: flex-start; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.import-choices .btn span { font-size: 12px; }
.import-choices .btn small { font-size: 9px; font-weight: 400; color: var(--dim); }
.import-choices .btn.primary small { color: rgba(4, 18, 31, .55); }
.import-choices .btn.danger small { color: rgba(255, 97, 112, .65); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 100;
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  background: var(--ink-strong); color: #071019;
  font-size: 11.5px; font-weight: 500; letter-spacing: .02em;
  padding: 9px 16px; max-width: calc(100vw - 32px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
  transition: opacity .22s, transform .22s;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .unit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .masthead { grid-template-columns: minmax(0, 1fr) 350px; gap: 38px; }
  .title-cn { font-size: clamp(42px, 6vw, 64px); }
  .style-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 18px; }
}
@media (max-width: 940px) {
  .site { padding-inline: 26px; }
  .top-rail-inner { padding-inline: 26px; }
  .rail-center { display: none; }
  .masthead { grid-template-columns: 1fr; gap: 30px; padding-top: 40px; align-items: start; }
  .telemetry { max-width: 520px; width: 100%; }
  .unit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
  .unit-name { font-size: 15.5px; }
  .sheet-body { grid-template-columns: 280px minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 760px) {
  .unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-sub { align-items: flex-start; flex-direction: column; gap: 10px; }
  .command-tools { width: 100%; }
  .select-wrap { flex: 1; min-width: 120px; }
  .select-wrap select { width: 100%; }
  .status-tabs { gap: 1px; width: 100%; }
  .status-tab { padding: 0 8px; font-size: 10.5px; }
  .style-grid { grid-template-columns: 1fr; gap: 18px; }
  .theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; overflow: visible; padding-bottom: 0; }
  .theme-option { min-width: 0; }
  .footer { flex-wrap: wrap; gap: 12px; }
  .footer p { order: 3; width: 100%; }
  .footer-meta { margin-left: auto; }
}
@media (max-width: 680px) {
  .site { padding: 0 18px 22px; }
  .top-rail-inner { padding-inline: 18px; height: 31px; font-size: 8px; }
  .rail-right .rail-dim { display: none; }
  .masthead { padding: 32px 0 27px; }
  .brand-lockup { gap: 14px; }
  .crest-wrap { width: 64px; height: 64px; }
  .crest-wrap .crest-orbit { inset: -6px; }
  .title-cn { font-size: clamp(38px, 11vw, 54px); }
  .title-en { font-size: 12px; letter-spacing: .26em; }
  .lede { margin-top: 17px; font-size: 12.5px; }
  .kicker { font-size: 8px; gap: 8px; margin-bottom: 15px; }
  .kicker-line { width: 22px; }
  .hero-tags { margin-top: 13px; }
  .command { padding-top: 17px; }
  .command-main { flex-direction: column; }
  .search-box { height: 44px; flex: none; }
  .add-btn { height: 44px; width: 100%; }
  .add-btn kbd { display: none; }
  .status-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .status-tabs::-webkit-scrollbar { display: none; }
  .command-tools { gap: 5px; }
  .select-wrap { padding-inline: 8px; }
  .select-wrap > span { display: none; }
  .select-wrap select { padding-right: 15px; }
  .icon-text span { display: none; }
  .icon-text { width: 40px; padding: 0; }
  .result-coord { display: none; }
  .result-line { font-size: 8px; }
  .demo-banner { align-items: flex-start; flex-wrap: wrap; gap: 7px 10px; }
  .demo-banner p { flex: 1 1 100%; order: 3; font-size: 10px; }
  .demo-banner button { margin-left: auto; }
  .unit-grid { gap: 10px; }
  .card-top { padding: 9px 9px 7px; font-size: 7px; }
  .card-visual { margin: 0 6px; }
  .grade-badge { top: 7px; font-size: 8px; padding: 3px 5px; }
  .scale-badge { right: 6px; bottom: 6px; font-size: 7px; }
  .visual-reticle { width: 15px; height: 15px; right: 6px; top: 6px; }
  .visual-reticle::before { width: 5px; left: 4px; top: 6px; }
  .visual-reticle::after { height: 5px; top: 4px; left: 6px; }
  .card-body { padding: 9px 9px 10px; }
  .unit-name { font-size: 13.5px; min-height: 2.7em; }
  .unit-code { font-size: 7px; }
  .unit-series { font-size: 9px; }
  .card-date { font-size: 7px; }
  .card-date b { font-size: 8px; }
  .card-rate i { width: 3px; height: 7px; }
  .card-access { display: none; }
  .modal { padding: 0; align-items: flex-end; }
  .sheet {
    max-height: 94dvh; width: 100%; max-width: none;
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
    border-left: 0; border-right: 0; border-bottom: 0;
    animation: sheetUp .3s cubic-bezier(.2, .75, .2, 1) both;
  }
  .sheet-head { padding: 17px 18px 14px; }
  .sheet-head h2 { font-size: 20px; }
  .sheet-body { grid-template-columns: 1fr; padding: 18px; gap: 22px; }
  .photo-col { display: grid; grid-template-columns: 1fr; max-width: 300px; width: 100%; justify-self: center; }
  .photo-edit { max-height: 330px; }
  .form-grid { gap: 9px; }
  .sheet-foot { padding: 11px 18px; flex-wrap: wrap; }
  .foot-note { display: none; }
  .sheet-foot .btn { height: 36px; }
  #deleteBtn { margin-right: auto; }
  .foot-actions { margin-left: auto; }
  .import-body { padding: 18px; }
  .empty-state { padding: 40px 18px 38px; }
  .empty-state h2 { font-size: 21px; }
  .footer { margin-top: 32px; }
  .hero-tags { display: none; }
  .masthead { gap: 22px; padding: 24px 0 20px; }
  .kicker { margin-bottom: 11px; }
  .brand-lockup { gap: 12px; }
  .crest-wrap { width: 56px; height: 56px; }
  .title-cn { font-size: clamp(34px, 10.5vw, 44px); }
  .title-en { font-size: 10.5px; letter-spacing: .22em; margin-top: 1px; }
  .title-en i { width: 15px; }
  .lede { margin-top: 12px; font-size: 11.5px; line-height: 1.65; }
  .telemetry { padding: 12px 14px 11px; }
  .telemetry-head { padding-bottom: 9px; }
  .tele-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tele-item, .tele-item:nth-child(odd), .tele-item:nth-child(even) {
    grid-template-columns: 1fr; gap: 3px; padding: 10px 7px 9px; text-align: center;
    border-bottom: 0; border-right: 1px solid var(--line);
  }
  .tele-item:first-child { padding-left: 0; }
  .tele-item:last-child { padding-right: 0; border-right: 0; }
  .tele-item strong { font-size: 24px; text-align: center; }
  .tele-item > span { font-size: 8.5px; line-height: 1.25; text-align: center; display: block; }
  .tele-item em { display: none; }
  .ratio { padding-top: 9px; }
  .ratio-track { margin-top: 5px; }
  .telemetry-foot { display: none; }
  .command { padding-top: 15px; }
  .command-main { gap: 7px; }
  .search-box { height: 42px; }
  .add-btn { height: 42px; }
  .command-tools { gap: 4px; }
  .select-wrap { height: 32px; }
  .icon-text { height: 32px; }
  .result-line { margin-top: 3px; }
  .empty-state { padding: 36px 16px; }
  .empty-visual { width: 92px; height: 92px; margin-bottom: 13px; }
  .empty-visual .crest { width: 46px; height: 46px; }
  .photo-col { grid-template-columns: 138px minmax(0, 1fr); grid-template-rows: auto auto 1fr; gap: 8px 10px; max-width: 100%; }
  .photo-edit { grid-column: 1; grid-row: 1 / span 3; aspect-ratio: 4 / 5; max-height: none; width: 100%; align-self: start; }
  .photo-actions { grid-column: 2; grid-row: 1; margin: 0; flex-direction: column; align-self: start; }
  .photo-actions .btn { width: 100%; height: 32px; padding-inline: 8px; }
  .photo-actions .btn svg { width: 13px; height: 13px; }
  .zoom-row { grid-column: 2; grid-row: 2; margin: 0; grid-template-columns: 1fr 34px; align-self: start; }
  .zoom-row > span { display: none; }
  .photo-hint { grid-column: 2; grid-row: 3; margin: 0; text-align: left; align-self: start; font-size: 8px; }
  .photo-empty { padding: 8px; }
  .photo-empty .crest { width: 36px; height: 36px; }
  .photo-empty b { font-size: 6.5px; letter-spacing: .1em; }
  .photo-empty span { font-size: 7px; line-height: 1.4; }
  .hud-label { left: 8px; bottom: 8px; font-size: 5.5px; }
  .photo-hud .c { width: 10px; height: 10px; }
  .photo-demo { right: 6px; bottom: 6px; font-size: 5.5px; }
  .hud-reticle { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
  .hud-reticle::before { width: 26px; left: -5px; top: 8px; }
  .hud-reticle::after { height: 26px; top: -5px; left: 8px; }
}
@media (max-width: 440px) {
  .unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .card-visual { aspect-ratio: 4 / 4.45; }
  .unit-name { font-size: 13.5px; line-height: 1.32; }
  .unit-code { font-size: 7px; }
  .unit-series { font-size: 8.5px; }
  .card-date { font-size: 6.5px; }
  .card-date b { font-size: 7.5px; }
  .card-rate { gap: 1.5px; }
  .card-rate i { width: 2.5px; height: 7px; }
  .title-cn { font-size: 36px; }
  .tele-item strong { font-size: 24px; }
  .form-grid, .date-grid { grid-template-columns: 1fr; }
  .span-2, .rating-field { grid-column: span 1; }
  .status-choices { grid-template-columns: repeat(2, 1fr); }
  .photo-col { grid-template-columns: 124px minmax(0, 1fr); }
}
@media (max-width: 350px) {
  .unit-grid { grid-template-columns: 1fr; }
  .unit-name { font-size: 16px; }
  .card-visual { aspect-ratio: 4 / 4.3; }
}

/* ---------- motion ---------- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes scan {
  from { transform: translateY(0); }
  to { transform: translateY(620%); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes panelIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .unit-card:hover { transform: none; }
  .visual-scan { display: none; }
}

/* ---------- NAS mode: login + public viewer ---------- */
.login-btn { height: 48px; flex: none; padding: 0 16px; font-size: 12px; }
.login-btn.admin-on { border-color: var(--accent); color: var(--accent); }
.admin-badge {
  align-self: center; font-family: var(--font-mono); font-size: 7px; letter-spacing: .12em;
  color: var(--accent); border: 1px solid rgba(var(--accent-rgb), .4); padding: 3px 6px;
}
.login-sheet { max-width: 430px; }
.login-body { padding: 22px 24px 26px; display: grid; gap: 15px; }
.login-body > p { margin: 0; font-size: 12px; line-height: 1.8; color: var(--muted); }
.login-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.login-actions .btn { min-width: 92px; }

.viewer-sheet { max-width: 900px; }
.viewer-body { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 26px; padding: 22px 24px 24px; }
.viewer-visual {
  position: relative; overflow: hidden; aspect-ratio: 4 / 5; background: #050b11;
  border: 1px solid var(--line-strong);
}
.viewer-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewer-visual .no-visual { position: absolute; inset: 0; }
.viewer-info { display: flex; flex-direction: column; min-width: 0; }
.viewer-series { font-size: 12px; color: var(--muted); }
.viewer-badges { display: flex; align-items: center; gap: 9px; margin-top: 12px; flex-wrap: wrap; }
.viewer-status {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); padding: 5px 9px; font-size: 11px; color: var(--ink);
}
.viewer-scale { font-family: var(--font-mono); font-size: 9px; color: var(--accent); letter-spacing: .08em; }
.viewer-notes-label {
  margin-top: 27px; padding-top: 15px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .14em; color: var(--dim);
}
.viewer-notes { margin: 10px 0 0; font-size: 12.5px; line-height: 1.9; color: var(--steel); white-space: pre-wrap; }
.viewer-foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-top: auto; padding-top: 22px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 9px; color: var(--dim);
}
.viewer-foot .card-rate i { width: 5px; height: 13px; }
@media (max-width: 680px) {
  .login-btn { width: 100%; height: 42px; }
  .viewer-body { grid-template-columns: 1fr; gap: 18px; padding: 18px; }
  .viewer-visual { max-width: 270px; width: 100%; justify-self: center; }
  .viewer-foot { margin-top: 0; }
  .admin-badge { display: none; }
}
