/* Supply archive: the shared industrial grid with a compact data workspace. */
body[data-route="apex"] {
  --apex-bg: var(--ark-bg,#171b1d); --apex-panel: var(--ark-panel,#202528); --apex-paper: var(--ark-paper,#252b2d);
  --apex-input: var(--ark-input,#1b2022); --apex-text: var(--ark-text,#e8ece8); --apex-muted: var(--ark-muted,#a1aaa7);
  --apex-line: var(--ark-line,#424b4b); --apex-soft: var(--ark-soft,#303739); --apex-red: var(--ark-accent,#d5e85e);
  --apex-button: var(--ark-yellow,#d5e85e); --apex-ink: var(--ark-ink,#182021);
  --text:var(--apex-text); --muted:var(--apex-muted); --muted-strong:var(--apex-text); --accent:var(--apex-red); --line:var(--apex-line); --line-soft:var(--apex-line);
  color:var(--apex-text); background:var(--apex-bg); font-family:"Noto Sans SC","Microsoft YaHei",sans-serif;
}
html[data-theme="light"] body[data-route="apex"] { --apex-bg:var(--ark-bg,#e8ece7); --apex-panel:var(--ark-panel,#f2f4ee); --apex-paper:var(--ark-paper,#fcfdf8); --apex-input:var(--ark-input,#e9ede6); --apex-text:var(--ark-text,#252e2d); --apex-muted:var(--ark-muted,#606d67); --apex-line:var(--ark-line,#b8c1b8); --apex-soft:var(--ark-soft,#dfe5dc); --apex-red:var(--ark-accent,#526027); background:var(--apex-bg); }
body[data-route="apex"] ::selection { color:var(--apex-ink); background:var(--apex-button); }
body[data-route="apex"] .site-nav { background:var(--apex-bg); border-bottom-color:var(--apex-line); backdrop-filter:none; }
body[data-route="apex"] :focus-visible { outline:2px solid var(--apex-red); outline-offset:4px; }
.apex-page { width:min(1280px,calc(100% - 64px)); margin:0 auto; padding:110px 0 28px; }
.apex-page *,body[data-route="apex"] .apex-auth-card * { box-sizing:border-box; text-shadow:none; }
.apex-page h1,.apex-page h2,.apex-page h3,.apex-page p { margin:0; }
.apex-page h2 { font-size:14px; font-weight:500; line-height:1.6; }
.apex-page button,.apex-page input { font-family:inherit; }
.apex-page button { cursor:pointer; }
.apex-page-heading { display:grid; grid-template-columns:minmax(0,1fr) 230px; gap:40px; padding-bottom:27px; border-bottom:2px solid var(--apex-text); }
.apex-eyebrow { display:flex; align-items:center; gap:9px; color:var(--apex-muted); font:400 10px/1.6 "IBM Plex Mono",monospace; letter-spacing:.06em; }
.apex-section-code { display:grid; place-items:center; width:25px; height:22px; color:var(--apex-ink); background:var(--apex-button); font:500 12px "IBM Plex Mono",monospace; }
.apex-title-group { display:flex; align-items:baseline; gap:26px; margin:17px 0 10px; }
.apex-page h1 { flex-shrink:0; font-size:30px; line-height:1.5; font-weight:500; letter-spacing:.08em; }
.apex-word { color:var(--apex-text); font:600 clamp(38px,5.2vw,67px)/1 "Barlow Condensed","Arial Narrow",sans-serif; letter-spacing:-.015em; }
.apex-word>span { margin-left:5px; color:var(--apex-red); font-weight:500; }
.apex-page .apex-page-description { color:var(--apex-muted); font-size:12px; line-height:1.8; letter-spacing:.06em; }
.apex-masthead-index { display:flex; flex-direction:column; justify-content:space-between; padding:5px 0 0 25px; border-left:1px solid var(--apex-line); }
.apex-index-label { color:var(--apex-muted); font:400 9px/1.6 "IBM Plex Mono","Noto Sans SC",sans-serif; }
.apex-game-icon { display:flex; align-items:center; gap:9px; margin:12px 0; color:var(--apex-text); }
.apex-game-icon svg { width:29px; height:31px; fill:currentColor; }
.apex-game-icon b { font:600 16px/.92 "Barlow Condensed",sans-serif; letter-spacing:.09em; }
.apex-page .sync-pill { display:inline-flex; align-items:center; gap:7px; padding:0; color:var(--apex-muted); background:transparent; border:0; border-radius:0; font:400 10px/1.5 "Noto Sans SC",sans-serif; }
.apex-page .sync-pill span { display:inline; }
.apex-page .sync-pill i { width:5px; height:5px; background:var(--apex-muted); border-radius:0; box-shadow:none; }
.apex-page .sync-pill:is(.connected,.working) i { background:var(--apex-red); }
.apex-barcode { height:13px; margin-top:13px; color:var(--apex-muted); opacity:.55; background:repeating-linear-gradient(90deg,currentColor 0 1px,transparent 1px 4px,currentColor 4px 6px,transparent 6px 9px,currentColor 9px 10px,transparent 10px 15px); }
.apex-section-line { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:13px 0; color:var(--apex-text); font:400 9px/1.6 "IBM Plex Mono",monospace; }
.apex-section-line b { margin-left:9px; color:var(--apex-muted); font:400 10px "Noto Sans SC",sans-serif; }
.apex-section-line>span:last-child { color:var(--apex-muted); }
.apex-section-line i { margin-left:12px; color:var(--apex-red); font-style:normal; }
.apex-surface { border:1px solid var(--apex-line); border-radius:0; background:var(--apex-panel); box-shadow:none; }
.cycle-overview { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:35px; padding:26px 30px; margin-bottom:8px; }
.cycle-main { min-width:0; }
.cycle-heading { display:flex; justify-content:space-between; align-items:center; gap:15px; }
.cycle-heading>span { padding:4px 8px; border:1px solid var(--apex-line); color:var(--apex-muted); font-size:10px; }
.cycle-amount { display:flex; align-items:baseline; flex-wrap:wrap; gap:11px; margin:17px 0 19px; }
.cycle-amount>strong { font:500 69px/.95 "Barlow Condensed",sans-serif; font-variant-numeric:tabular-nums; }
.cycle-amount>span { color:var(--apex-muted); font:400 16px/1.5 "IBM Plex Mono","Noto Sans SC",monospace; }
.cycle-amount small { font-size:11px; }
.cycle-amount .cycle-remaining { margin-left:auto; font:400 11px/1.8 "Noto Sans SC",sans-serif; }
.cycle-remaining b { color:var(--apex-text); font-weight:500; }
.cycle-track { height:10px; overflow:hidden; border:1px solid var(--apex-line); background:var(--apex-input); }
.cycle-track>span { display:block; width:0; height:100%; background:var(--apex-button); transition:width .35s ease; }
.cycle-scale { display:flex; justify-content:space-between; margin-top:9px; color:var(--apex-muted); font:400 9px/1.5 "IBM Plex Mono",monospace; }
.cycle-summary { display:grid; grid-template-columns:1fr 1fr; align-content:center; gap:19px 30px; margin:0; padding-left:30px; border-left:1px solid var(--apex-line); }
.cycle-summary dt { color:var(--apex-muted); font-size:10px; line-height:1.6; }
.cycle-summary dd { margin:7px 0 0; }
.cycle-summary dd>strong { font:500 38px/1 "Barlow Condensed",sans-serif; font-variant-numeric:tabular-nums; }
.cycle-summary dd>span { margin-left:6px; color:var(--apex-muted); font-size:10px; }
.cycle-summary .last-entry { grid-column:1/-1; display:flex; justify-content:space-between; align-items:center; gap:10px; padding-top:13px; border-top:1px solid var(--apex-line); }
.last-entry dd { margin:0; color:var(--apex-muted); font:400 10px/1.5 "IBM Plex Mono","Noto Sans SC",sans-serif; }
.apex-page .apex-workspace { display:grid; grid-template-columns:320px minmax(0,1fr); align-items:stretch; gap:0; margin-bottom:15px; border:1px solid var(--apex-line); }
.apex-workspace .apex-surface { border:0; }
.entry-panel { padding:24px; border-right:1px solid var(--apex-line)!important; }
.entry-heading { display:flex; justify-content:space-between; align-items:center; }
.entry-plus { color:var(--apex-muted); font:400 18px "IBM Plex Mono",monospace; }
.apex-page .entry-description { margin:8px 0 24px; color:var(--apex-muted); font:400 9px/1.8 "IBM Plex Mono","Noto Sans SC",sans-serif; }
.entry-field { margin-bottom:20px; }
.entry-field label { display:block; color:var(--apex-text); font-size:11px; font-weight:400; line-height:1.6; }
.field-label { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.today-button { padding:2px 0 2px 8px; color:var(--apex-red); background:transparent; font-size:10px; }
.entry-field input { width:100%; min-width:0; height:41px; padding:0 11px; border:1px solid var(--apex-line); border-radius:0; outline:0; color:var(--apex-text); background:var(--apex-input); font:400 12px/1.5 "IBM Plex Mono","Noto Sans SC",monospace; }
.entry-field input:focus { border-color:var(--apex-red); box-shadow:none; }
.pack-stepper { display:grid; grid-template-columns:37px minmax(0,1fr) 20px 37px; align-items:center; gap:3px; margin-top:8px; padding:3px; border:1px solid var(--apex-line); background:var(--apex-input); }
.pack-stepper input { height:33px; padding:0; border:0; text-align:center; background:transparent; font-size:18px; appearance:textfield; -moz-appearance:textfield; }
.pack-stepper input::-webkit-inner-spin-button,.pack-stepper input::-webkit-outer-spin-button { appearance:none; margin:0; }
.pack-stepper:focus-within { border-color:var(--apex-red); }
.pack-stepper>span { color:var(--apex-muted); font-size:10px; }
.pack-stepper>button { height:33px; border:0; border-radius:0; color:var(--apex-muted); background:transparent; font-size:18px; }
.pack-stepper>button:hover { color:var(--apex-text); background:var(--apex-soft); }
.pack-stepper>button:disabled { cursor:default; opacity:.3; background:transparent; }
.pack-presets { display:grid; grid-template-columns:repeat(4,1fr); gap:7px; margin-top:9px; }
.pack-presets button { padding:7px 2px; border:1px solid var(--apex-line); border-radius:0; color:var(--apex-muted); background:transparent; font-size:10px; }
.pack-presets button:hover { color:var(--apex-text); background:var(--apex-soft); }
.pack-presets button[aria-pressed="true"] { color:var(--apex-ink); border-color:var(--apex-button); background:var(--apex-button); }
.apex-page .field-help { margin-top:8px; color:var(--apex-muted); font-size:9px; line-height:1.8; }
.save-entry { display:flex; justify-content:space-between; align-items:center; gap:10px; width:100%; min-height:41px; padding:0 14px; border:1px solid var(--apex-button); border-radius:0; color:var(--apex-ink); background:var(--apex-button); font-size:12px; font-weight:500; }
.save-entry:hover { background:#e2f278; border-color:#e2f278; }
.save-entry svg,.history-bottom svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.5; }
.apex-page .entry-footnote { margin-top:11px; color:var(--apex-muted); font-size:9px; line-height:1.8; }
.apex-page .history-panel { display:flex; flex-direction:column; min-width:0; padding:0; overflow:hidden; background:var(--apex-paper); }
.apex-page .history-heading { display:flex; justify-content:space-between; align-items:center; gap:15px; margin:0; padding:22px 27px; border-bottom:1px solid var(--apex-line); background:var(--apex-panel); }
.history-heading h2 { display:flex; align-items:center; gap:10px; }
.history-heading h2>span { color:var(--apex-muted); font:400 11px "IBM Plex Mono",monospace; }
.history-heading>span { color:var(--apex-muted); font-size:10px; }
.apex-page .empty-state { display:flex; flex:1; flex-direction:column; align-items:center; justify-content:center; min-height:278px; margin:0; padding:35px 20px; border:0; border-radius:0; background:transparent; }
.empty-package { display:grid; place-items:center; width:53px; height:53px; margin-bottom:18px; color:var(--apex-muted); }
.empty-package svg { width:45px; height:45px; fill:none; stroke:currentColor; stroke-width:1; stroke-linejoin:miter; }
.apex-page .empty-state h3 { color:var(--apex-text); font-size:17px; line-height:1.7; font-weight:400; }
.apex-page .empty-state p { max-width:300px; margin:9px 0 21px; color:var(--apex-muted); font-size:11px; line-height:1.9; }
.empty-start { display:inline-flex; align-items:center; gap:20px; padding:9px 12px; border:1px solid var(--apex-line); border-radius:0; color:var(--apex-muted); background:transparent; font-size:10px; }
.empty-start:hover { color:var(--apex-text); background:var(--apex-soft); }
.record-columns,.record-row { display:grid; grid-template-columns:minmax(0,1fr) 110px 33px; align-items:center; gap:20px; }
.record-columns { padding:11px 27px; color:var(--apex-muted); background:var(--apex-panel); font-size:9px; border-bottom:1px solid var(--apex-line); }
.record-columns[hidden] { display:none; }
.apex-page .records-list { display:block; max-height:350px; overflow-y:auto; margin:0; padding:0; list-style:none; scrollbar-width:thin; scrollbar-color:var(--apex-line) transparent; }
.record-row { min-height:72px; margin:0; padding:16px 27px; border-bottom:1px solid var(--apex-line); }
.record-row:hover { background:var(--apex-panel); }
.record-date { font:400 11px/1.5 "IBM Plex Mono","Noto Sans SC",sans-serif; font-variant-numeric:tabular-nums; }
.record-date small { display:block; margin-top:5px; color:var(--apex-muted); font:400 9px "Noto Sans SC",sans-serif; }
.record-quantity { font:500 27px/1 "Barlow Condensed",sans-serif; font-variant-numeric:tabular-nums; }
.record-quantity small { margin-left:6px; color:var(--apex-muted); font:400 9px "Noto Sans SC",sans-serif; }
.apex-page .record-delete { position:static; display:grid; place-items:center; width:32px; height:32px; padding:0; border:1px solid transparent; border-radius:0; color:var(--apex-muted); background:transparent; opacity:1; }
.record-delete svg { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.5; }
.apex-page .record-delete:hover { color:var(--apex-text); border-color:var(--apex-line); background:var(--apex-soft); }
.history-bottom { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:auto; padding:12px 27px; border-top:1px solid var(--apex-line); color:var(--apex-muted); background:var(--apex-panel); font-size:9px; }
.history-bottom svg { width:12px; height:12px; }
.calculation-note { margin-bottom:29px; color:var(--apex-muted); font-size:10px; line-height:1.9; }
.calculation-note summary { width:fit-content; cursor:pointer; }
.calculation-note p { max-width:750px; padding:12px 0 0; font-size:11px; line-height:1.9; }
.apex-page .apex-footer { display:flex; justify-content:space-between; align-items:center; gap:20px; margin:0; padding:18px 0 0; border-top:1px solid var(--apex-line); color:var(--apex-muted); font:400 9px/1.8 "IBM Plex Mono","Noto Sans SC",sans-serif; }
.apex-footer a { color:inherit; text-decoration:none; }
.apex-footer a:hover { color:var(--apex-text); }
.apex-footer b { margin:0 15px; color:var(--apex-red); font-weight:400; }
/* Authentication uses the same archive surface; the shared script retains its flow. */
body[data-route="apex"] .apex-auth-card { max-width:410px; padding:30px; border:1px solid var(--apex-line); border-radius:0; color:var(--apex-text); background:var(--apex-panel); box-shadow:12px 12px 0 rgba(0,0,0,.15); }
body[data-route="apex"] .apex-auth-card h2 { margin:12px 0; font-size:24px; font-weight:500; line-height:1.5; }
body[data-route="apex"] .apex-auth-kicker { margin-top:18px; color:var(--apex-muted); opacity:1; font:400 10px "IBM Plex Mono",monospace; }
body[data-route="apex"] .apex-auth-copy { color:var(--apex-muted); font-size:12px; line-height:1.9; opacity:1; }
body[data-route="apex"] .apex-auth-lock { border-radius:0; color:var(--apex-ink); background:var(--apex-button); }
body[data-route="apex"] .apex-auth-card label { font-size:11px; font-weight:400; }
body[data-route="apex"] .apex-auth-card input { color:var(--apex-text); background:var(--apex-input); border-color:var(--apex-line); border-radius:0; font-size:16px; }
body[data-route="apex"] .apex-auth-card input:focus { border-color:var(--apex-red); }
body[data-route="apex"] .apex-auth-submit { color:var(--apex-ink); background:var(--apex-button); border:0; border-radius:0; font-size:12px; }
@media(max-width:1100px) { .apex-page { width:calc(100% - 40px); }.cycle-overview { grid-template-columns:minmax(0,1fr) 240px; gap:25px; padding:25px; }.cycle-summary { padding-left:25px; gap:20px; }.cycle-amount .cycle-remaining { flex-basis:100%; margin:0; }.apex-page .apex-workspace { grid-template-columns:290px minmax(0,1fr); }.record-columns,.record-row { grid-template-columns:minmax(0,1fr) 65px 30px; gap:10px; } }
@media(max-width:720px) {
  .apex-page { width:calc(100% - 32px); padding-top:27px; }
  .apex-page-heading { grid-template-columns:minmax(0,1fr) 100px; gap:15px; padding-bottom:23px; }
  .apex-eyebrow { font-size:8px; gap:6px; }.apex-section-code { width:21px; height:19px; font-size:10px; }
  .apex-title-group { flex-wrap:wrap; gap:6px; margin:15px 0 9px; }.apex-page h1 { font-size:25px; }.apex-word { flex-basis:100%; font-size:47px; }
  .apex-page .apex-page-description { font-size:11px; letter-spacing:normal; }.apex-masthead-index { padding-left:15px; justify-content:flex-start; }.apex-index-label { font-size:8px; }.apex-game-icon { margin:19px 0; gap:6px; }.apex-game-icon svg { width:20px; }.apex-game-icon b { font-size:12px; }.apex-page .sync-pill { font-size:9px; gap:6px; }.apex-barcode { margin-top:auto; }
  .apex-section-line { font-size:7px; }.apex-section-line b { margin-left:4px; font-size:9px; }.apex-section-line i { margin-left:5px; }
  .cycle-overview { grid-template-columns:1fr; gap:22px; padding:22px; margin-bottom:7px; }.cycle-amount>strong { font-size:62px; }.cycle-amount .cycle-remaining { flex-basis:auto; margin-left:auto; font-size:10px; }
  .cycle-summary { grid-template-columns:1fr 1fr; padding:20px 0 0; border-left:0; border-top:1px solid var(--apex-line); gap:18px 25px; }.cycle-summary dd>strong { font-size:35px; }.cycle-summary .last-entry { padding-top:13px; }
  .apex-page .apex-workspace { grid-template-columns:1fr; }.entry-panel { padding:23px; border-right:0!important; border-bottom:1px solid var(--apex-line)!important; }
  .entry-field input[type="date"] { font-size:16px; }.apex-page .entry-description { margin-bottom:21px; }.pack-presets button { padding:9px 3px; }.save-entry { min-height:43px; }
  .apex-page .history-heading { padding:20px 23px; }.apex-page .history-heading>span { font-size:9px; }.apex-page .empty-state { min-height:280px; }.apex-page .records-list { max-height:460px; }.record-columns,.record-row { grid-template-columns:minmax(0,1fr) 65px 30px; padding-right:23px; padding-left:23px; }.record-row { min-height:73px; }.history-bottom { padding-right:23px; padding-left:23px; }
  .calculation-note { margin-bottom:23px; }.apex-page .apex-footer { align-items:flex-start; flex-direction:column; gap:12px; font-size:8px; }
}
@media(max-width:380px) { .apex-page { width:calc(100% - 24px); }.apex-page-heading { grid-template-columns:minmax(0,1fr) 84px; gap:10px; }.apex-index-label { font-size:7px; }.apex-masthead-index { padding-left:11px; }.apex-section-line { font-size:6px; }.apex-section-line b { font-size:8px; }.cycle-overview { padding:20px; }.cycle-amount .cycle-remaining { flex-basis:100%; margin:0; } }
@media(prefers-reduced-motion:reduce) { .cycle-track>span { transition:none; } }
.apex-data-tools{display:flex;flex-wrap:wrap;gap:8px;margin-top:13px;}.apex-data-tools button{padding:6px 8px;border:1px solid var(--apex-line);border-radius:0;color:var(--apex-muted);background:transparent;font-size:10px;cursor:pointer;}.apex-data-tools button:hover{border-color:var(--apex-red);color:var(--apex-text);}

.apex-page h1{letter-spacing:0;font-weight:600;}
.apex-page-description{font-size:13px;line-height:2;letter-spacing:0;}
