/* LIFE OS — 90s anime cyberpunk dashboard
   Sections: tokens · base · frame chrome · panels · controls · meters · home (drive + disks) · modules · sheets · effects */

/* ---------- Tokens ---------- */
:root {
  --bg: #030509;
  --panel: #0a0f16;
  --panel-2: #0e1520;
  --inset: #05080d;
  --edge: #1d2a37;
  --edge-hi: #35495b;
  --text: #d6e8ef;
  --dim: #7590a0;
  --faint: #3b4f5d;
  --cyan: #3ee6ff;
  --green: #5cff8f;
  --amber: #ffb43a;
  --red: #ff5d5d;
  --violet: #b685ff;
  --pink: #ff4fa8;
  --teal: #2de0c0;
  --a: var(--cyan);      /* module accent */
  --a2: var(--green);    /* module secondary */
  --mono: "Share Tech Mono", ui-monospace, monospace;
  --head: "Oxanium", "Share Tech Mono", sans-serif;
  --fast: 160ms;
  --mid: 220ms;
  --cut: 12px;
}
body[data-mod="home"] { --a: var(--pink); --a2: var(--cyan); }
body[data-mod="goals"] { --a: var(--cyan); --a2: var(--green); }
body[data-mod="finances"] { --a: var(--green); --a2: var(--violet); }
body[data-mod="collect"] { --a: var(--pink); --a2: var(--cyan); }
body[data-mod="notes"] { --a: var(--teal); --a2: var(--amber); }
body[data-mod="system"] { --a: var(--amber); --a2: var(--cyan); }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--mono); font-size: 15px; line-height: 1.35; min-height: 100dvh;
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse 90% 40% at 50% 0%, color-mix(in srgb, var(--a) 7%, transparent), transparent 70%),
    var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.a-t { color: var(--a); } .a2-t { color: var(--a2); }
.pos { color: var(--green); } .neg { color: var(--pink); } .vio { color: var(--violet); } .cyan-t { color: var(--cyan); } .amber-t { color: var(--amber); }
.glow-t { text-shadow: 0 0 10px color-mix(in srgb, currentColor 55%, transparent); }

/* ---------- Frame chrome: the device bezel ---------- */
.shell {
  position: relative; max-width: 560px; margin: 0 auto; min-height: 100dvh;
  padding: max(8px, env(safe-area-inset-top)) 14px calc(90px + env(safe-area-inset-bottom));
}
/* Side rails with little status ticks, like the hardware frames in the references */
.shell::before, .shell::after {
  content: ""; position: fixed; top: 0; bottom: 0; width: 5px; pointer-events: none; z-index: 1;
  background:
    repeating-linear-gradient(180deg, transparent 0 46px, color-mix(in srgb, var(--a) 55%, transparent) 46px 49px, transparent 49px 60px),
    linear-gradient(90deg, #0d141c, #070b10);
  border-left: 1px solid var(--edge); border-right: 1px solid var(--edge);
}
.shell::before { left: max(0px, calc(50% - 280px)); }
.shell::after { right: max(0px, calc(50% - 280px)); }

/* Status strip across the top */
.status {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 6px 2px 10px; font-size: 12px; letter-spacing: 0.12em; color: var(--a);
}
.status .sig { display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bars i { width: 3px; background: var(--a); box-shadow: 0 0 6px var(--a); }
.bars i:nth-child(1) { height: 35%; } .bars i:nth-child(2) { height: 55%; } .bars i:nth-child(3) { height: 78%; } .bars i:nth-child(4) { height: 100%; }
.status .time { text-align: center; color: var(--text); line-height: 1.1; }
.status .time b { display: block; font-weight: 400; font-size: 17px; letter-spacing: 0.1em; }
.status .time span { font-size: 10px; color: var(--dim); }
.status .batt { justify-self: end; display: flex; align-items: center; gap: 6px; color: var(--green); white-space: nowrap; }
.batt-icon { width: 26px; height: 12px; border: 1px solid var(--green); border-radius: 2px; padding: 1px; position: relative; }
.batt-icon::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; background: var(--green); }
.batt-icon i { display: block; height: 100%; background: var(--green); box-shadow: 0 0 6px var(--green); }

/* Footer readout at the bottom of each module */
.footer {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 14px;
  padding: 8px 10px; background: var(--inset); border: 1px solid var(--edge); font-size: 10.5px; letter-spacing: 0.12em; color: var(--dim);
}
.footer svg { width: 20px; height: 20px; color: var(--a); }
.footer .mid { text-align: center; }
.barcode { height: 18px; width: 90px; background: repeating-linear-gradient(90deg, var(--a) 0 2px, transparent 2px 3px, var(--a) 3px 4px, transparent 4px 7px, var(--a) 7px 10px, transparent 10px 11px); opacity: 0.8; }

/* ---------- Panels: cut-corner metal frames ---------- */
.panel { position: relative; isolation: isolate; padding: 12px; margin-bottom: 12px; }
.panel::before, .panel::after { content: ""; position: absolute; z-index: -1; }
.panel::before {
  inset: 0; background: linear-gradient(180deg, var(--edge-hi), var(--edge) 60%, #121c26);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.panel::after {
  inset: 1px; background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5);
  clip-path: polygon(calc(var(--cut) - 0.5px) 0, 100% 0, 100% calc(100% - var(--cut) + 0.5px), calc(100% - var(--cut) + 0.5px) 100%, 0 100%, 0 calc(var(--cut) - 0.5px));
}
.panel.lit::before { background: linear-gradient(180deg, color-mix(in srgb, var(--pa, var(--a)) 85%, #fff 0%), color-mix(in srgb, var(--pa, var(--a)) 35%, var(--edge))); }
.panel.lit { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--pa, var(--a)) 30%, transparent)); }
.panel.a2 { --pa: var(--a2); }
.inset { background: var(--inset); border: 1px solid var(--edge); padding: 8px 10px; }

.ph { display: flex; align-items: center; gap: 8px; margin: -2px 0 10px; }
.ph h2, .ph h3 { margin: 0; font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; line-height: 1; }
.ph h2 { font-size: 20px; color: var(--pa, var(--a)); }
.ph h3 { font-size: 15px; color: var(--text); }
.ph .ico { width: 22px; height: 22px; color: var(--pa, var(--a)); flex: none; }
.ph .meta { margin-left: auto; font-size: 11.5px; letter-spacing: 0.12em; color: var(--pa, var(--a)); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pa, var(--a)); box-shadow: 0 0 8px var(--pa, var(--a)); flex: none; }
.label { font-size: 10.5px; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }
.sub { font-size: 12px; color: var(--dim); }

/* Module hero header */
.hero { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.hero .glyph { width: 46px; height: 46px; color: var(--a); filter: drop-shadow(0 0 6px var(--a)); }
.hero h1 { margin: 0; font-family: var(--head); font-weight: 700; font-size: clamp(26px, 8vw, 38px); letter-spacing: 0.04em; line-height: 0.92; color: var(--a); text-shadow: 0 0 16px color-mix(in srgb, var(--a) 50%, transparent); text-transform: uppercase; }
.hero p { margin: 5px 0 0; font-size: 11px; letter-spacing: 0.16em; color: var(--text); opacity: 0.85; text-transform: uppercase; }
.hero p.alt { color: var(--a2); opacity: 1; }
@media (max-width: 440px) { .hero { grid-template-columns: auto 1fr; } .hero .chip-file { grid-column: 2; justify-self: start; } }
.log-ico { width: 34px; height: 34px; color: var(--a); flex: none; filter: drop-shadow(0 0 6px var(--a)); }
.chip-file { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--inset); border: 1px solid var(--edge-hi); font-size: 10.5px; letter-spacing: 0.1em; color: var(--dim); white-space: nowrap; }
.chip-file svg { width: 22px; height: 22px; color: var(--a2); }
.chip-file b { display: block; font-weight: 400; color: var(--text); font-size: 12px; }
.idline { display: flex; gap: 0; margin-bottom: 12px; border: 1px solid var(--edge); background: var(--inset); font-size: 10.5px; letter-spacing: 0.12em; color: var(--dim); }
.idline span { flex: 1; padding: 7px 9px; border-left: 1px solid var(--edge); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idline span:first-child { border-left: 0; }
.idline b { color: var(--text); font-weight: 400; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 14px;
  background: linear-gradient(180deg, #131d28, #0a1118); border: 1px solid var(--edge-hi); border-radius: 4px;
  color: var(--text); font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 2px 0 #000;
  transition: transform var(--fast), box-shadow var(--fast), border-color var(--fast), color var(--fast);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { border-color: var(--a); color: var(--a); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 2px 6px #000; }
.btn:focus-visible, .tab:focus-visible, .disk:focus-visible, .eject:focus-visible { outline: 1px solid var(--a); outline-offset: 2px; }
.btn.on, .btn.accent { border-color: var(--a); color: var(--a); background: linear-gradient(180deg, color-mix(in srgb, var(--a) 16%, #0b131b), #08101a); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--a) 25%, transparent), 0 2px 0 #000, 0 0 10px color-mix(in srgb, var(--a) 30%, transparent); }
.btn.a2 { border-color: var(--a2); color: var(--a2); }
.btn.go { border-color: var(--green); color: var(--green); background: linear-gradient(180deg, #10261a, #091710); box-shadow: inset 0 1px 0 rgba(92, 255, 143, 0.2), 0 2px 0 #000, 0 0 10px rgba(92, 255, 143, 0.3); }
.btn.danger { border-color: #5a2626; color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.small { min-height: 34px; padding: 0 10px; font-size: 11px; }
.btn.block { width: 100%; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 10px;
  background: var(--inset); border: 1px solid var(--edge); border-radius: 3px; color: var(--dim); cursor: pointer;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; transition: color var(--fast), border-color var(--fast), box-shadow var(--fast);
}
.tab svg { width: 16px; height: 16px; }
.tab:active { transform: translateY(1px); }
.tab.on { color: var(--a); border-color: var(--a); box-shadow: inset 0 0 14px color-mix(in srgb, var(--a) 18%, transparent), 0 0 8px color-mix(in srgb, var(--a) 25%, transparent); }

.search { width: 100%; min-height: 42px; padding: 0 12px; background: var(--inset); border: 1px solid var(--edge-hi); color: var(--text); letter-spacing: 0.06em; font-size: 16px; }
.search::placeholder { color: var(--faint); }
.search:focus { outline: none; border-color: var(--a); }
.select-mini { background: var(--inset); border: 1px solid var(--edge-hi); color: var(--a); font-size: 11.5px; letter-spacing: 0.12em; padding: 6px 8px; }

.tag { display: inline-block; padding: 2px 6px; border: 1px solid currentColor; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.tag.income { color: var(--green); background: rgba(92, 255, 143, 0.08); }
.tag.expense { color: var(--pink); background: rgba(255, 79, 168, 0.08); }
.tag.transfer { color: var(--violet); background: rgba(182, 133, 255, 0.08); }
.tag.info { color: var(--cyan); } .tag.warn { color: var(--amber); } .tag.note { color: var(--teal); }
.tag.plain { color: var(--dim); border-color: var(--edge-hi); }

.led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.led.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.led.a { background: var(--a); box-shadow: 0 0 8px var(--a); }

.empty { padding: 22px 12px; text-align: center; color: var(--dim); font-size: 13px; letter-spacing: 0.08em; border: 1px dashed var(--edge-hi); background: var(--inset); }
.empty b { display: block; color: var(--text); font-weight: 400; letter-spacing: 0.16em; margin-bottom: 6px; }

/* ---------- Meters ---------- */
.energy { position: relative; height: 16px; background: var(--inset); border: 1px solid var(--edge-hi); overflow: hidden; }
.energy > i {
  position: absolute; inset: 2px auto 2px 2px; width: var(--p, 0%); max-width: calc(100% - 4px);
  background: var(--bar, var(--a)); box-shadow: 0 0 10px var(--bar, var(--a));
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 7px);
          mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 7px);
  transition: width var(--mid) ease;
}
.energy.big { height: 22px; }
.energy.g { --bar: var(--green); } .energy.c { --bar: var(--cyan); } .energy.a2 { --bar: var(--a2); }

.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gauge { position: relative; padding: 10px 4px 8px; text-align: center; min-width: 0; background: var(--inset); border: 1px solid var(--edge); }
.gauge .label { font-size: 9.5px; color: var(--text); }
.gauge .val { font-size: clamp(14px, 4.4vw, 20px); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gauge svg { width: 100%; height: auto; display: block; margin-top: 2px; }
.gauge .note { font-size: 10px; letter-spacing: 0.14em; color: var(--text); }
.big-num { font-size: 32px; letter-spacing: 0.02em; line-height: 1.05; }
.spark { width: 100%; height: 56px; display: block; }

/* ---------- Home: drive + floating disks ---------- */
.screen.on.home { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.drive-unit { position: relative; padding: 14px; margin-bottom: 14px; --cut: 16px; }
.drive-face { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; }
.drive-id { font-size: 13px; letter-spacing: 0.12em; color: var(--a); line-height: 1.5; text-shadow: 0 0 8px color-mix(in srgb, var(--a) 50%, transparent); }
.drive-state { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid var(--edge-hi); background: var(--inset); font-size: 11px; letter-spacing: 0.16em; color: var(--text); }
.drive-state .dot { width: 7px; height: 7px; }
.hub {
  width: clamp(84px, 24vw, 112px); aspect-ratio: 1; border-radius: 50%; position: relative;
  background:
    radial-gradient(circle, #1b2430 0 12%, #070a0e 12% 16%, #2a3542 16% 19%, #0b0f15 19% 33%, #222c38 33% 35%, #0b1016 35% 52%, #1f2934 52% 54%, #0a0e14 54% 70%, #273240 70% 72%, #0b0f15 72%);
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.08), inset 0 -6px 12px #000, 0 0 0 4px #0d131a, 0 0 0 5px var(--edge-hi);
}
.hub::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 80%, rgba(255, 255, 255, 0.07) 88%, transparent 96%); }
.drive-unit.reading .hub::after { animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.led-bar { width: 16px; height: clamp(74px, 20vw, 96px); border: 1px solid var(--edge-hi); background: #07090d; padding: 3px; display: flex; }
.led-bar i { flex: 1; background: var(--a); box-shadow: 0 0 12px var(--a); opacity: 0.85; }
.drive-unit.reading .led-bar i { animation: flicker 0.18s steps(1) infinite; }
@keyframes flicker { 50% { opacity: 0.25; } }
.slot-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.slot { position: relative; flex: 1; height: 14px; background: #000; border: 1px solid #000; box-shadow: inset 0 3px 5px #000, 0 1px 0 rgba(255, 255, 255, 0.08); }
.slot::after { content: ""; position: absolute; left: 10%; right: 10%; top: 50%; height: 1px; background: color-mix(in srgb, var(--a) 70%, transparent); box-shadow: 0 0 6px var(--a); opacity: 0.6; }
.slot-label { font-size: 10px; letter-spacing: 0.16em; color: var(--dim); white-space: nowrap; }
.screw { width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #8a96a3, #3a444f 60%, #1a2027); position: absolute; box-shadow: 0 1px 1px #000; }
.screw::after { content: ""; position: absolute; left: 1px; right: 1px; top: 4px; height: 1px; background: #0b0f14; transform: rotate(35deg); }

.bay-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 2px 2px 6px; }
.bay-title h1 { margin: 0; font-family: var(--head); font-weight: 700; font-size: clamp(24px, 7vw, 32px); letter-spacing: 0.04em; color: #e9dcef; text-transform: uppercase; }
.bay-title span { font-size: 11px; letter-spacing: 0.16em; color: var(--a); white-space: nowrap; }
.bay-rule { height: 2px; margin: 0 2px 4px; background: linear-gradient(90deg, var(--a) 0 50%, transparent 50% 56%, var(--a) 56% 60%, transparent 60%); opacity: 0.7; }

/* A floppy: the user's disk artwork (labels are hand-written into the art) */
.floppy { position: relative; aspect-ratio: 520 / 773; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.75)); }
.floppy img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 3.5%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
/* Fallback label for a module that has no artwork yet: pencil handwriting on the blank's label */
.floppy .lbl { position: absolute; left: 12%; top: 9%; width: 76%; height: 38%; display: grid; place-items: center; container-type: inline-size; }
.floppy .lbl span { font-family: "Architects Daughter", cursive; text-transform: uppercase; color: #1d1d1f; opacity: 0.85; white-space: nowrap; font-size: min(18cqw, calc(150cqw / var(--len, 8))); }
.home-foot { margin-top: auto; padding-top: 12px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.home-foot .os { font-family: var(--head); font-weight: 700; font-size: 15px; letter-spacing: 0.1em; color: #e9dcef; line-height: 1.2; }
.home-foot .os span { display: block; font-family: var(--mono); font-weight: 400; font-size: 10px; letter-spacing: 0.18em; color: var(--a); }

/* The disk while it travels into / out of the drive */
.flying { position: fixed; z-index: 45; pointer-events: none; margin: 0; }

/* The disk wheel: a 3D drum; JS places each disk around it and handles the physics */
.bay {
  position: relative; flex: 1; min-height: 150px; margin: 0 -14px; overflow: hidden;
  perspective: 1100px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.bay:active { cursor: grabbing; }
.wheel { position: absolute; left: 50%; top: 47%; width: 0; height: 0; transform-style: preserve-3d; }
.wdisk { all: unset; position: absolute; left: 0; top: 0; width: var(--dw, 200px); cursor: pointer; backface-visibility: hidden; -webkit-tap-highlight-color: transparent; }
.wdisk:focus-visible { outline: 1px solid var(--a); outline-offset: 4px; }
.bay .floor { position: absolute; left: 50%; top: calc(47% + var(--dw, 200px) / 1.345 + 2px); width: calc(var(--dw, 200px) * 0.9); height: 14px; margin: 0; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--a) 45%, transparent), transparent 70%); filter: blur(5px); }

/* Home never scrolls or zooms: it is sized to the screen */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
html.lock, html.lock body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.lock .shell { height: 100dvh; min-height: 0; display: flex; flex-direction: column; padding-bottom: max(10px, env(safe-area-inset-bottom)); }

/* ---------- Module screens ---------- */
.screen { display: none; }
.screen.on { display: block; animation: screen-in var(--mid) ease both; }
/* opacity only: a transform here would trap the docked tab bar inside the screen */
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }
.mod-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.eject {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
  background: var(--inset); border: 1px solid var(--a); color: var(--a); cursor: pointer; font-size: 12px; letter-spacing: 0.16em;
  box-shadow: 0 0 10px color-mix(in srgb, var(--a) 25%, transparent), 0 2px 0 #000;
}
.eject:active { transform: translateY(2px); box-shadow: inset 0 2px 5px #000; }
.eject svg { width: 18px; height: 18px; }
.mod-bar .disk-id { margin-left: auto; font-size: 11px; letter-spacing: 0.14em; color: var(--dim); text-align: right; line-height: 1.3; }
.mod-bar .disk-id b { display: block; color: var(--a); font-weight: 400; }
.fab { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); width: min(532px, calc(100% - 28px)); }
.fab .btn { width: 100%; min-height: 50px; font-size: 13.5px; background: linear-gradient(180deg, color-mix(in srgb, var(--a) 22%, #0b131b), #071017); border-color: var(--a); color: var(--a); box-shadow: 0 0 16px color-mix(in srgb, var(--a) 35%, transparent), 0 3px 0 #000, inset 0 1px 0 color-mix(in srgb, var(--a) 30%, transparent); }

/* Goals */
.goal { display: grid; grid-template-columns: 1fr 88px; gap: 10px; }
.goal .top { display: grid; grid-template-columns: 30px 1fr; gap: 2px 10px; align-items: start; }
.goal .gi { width: 30px; height: 30px; color: var(--pa, var(--a)); filter: drop-shadow(0 0 5px var(--pa, var(--a))); }
.goal .title { font-family: var(--head); font-weight: 600; font-size: 18px; letter-spacing: 0.03em; line-height: 1.1; color: var(--pa, var(--a)); text-shadow: 0 0 10px color-mix(in srgb, var(--pa, var(--a)) 45%, transparent); }
.goal .tagline { font-size: 11px; letter-spacing: 0.12em; color: var(--pa, var(--a)); opacity: 0.85; text-transform: uppercase; margin-top: 3px; }
.goal .desc { grid-column: 1 / -1; font-size: 12.5px; color: var(--text); opacity: 0.85; margin-top: 6px; }
.goal .prog { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 10px; }
.goal .prog .pct { font-size: 20px; color: var(--pa, var(--a)); text-align: right; line-height: 1; text-shadow: 0 0 10px color-mix(in srgb, var(--pa, var(--a)) 50%, transparent); }
.goal .prog .pct small { display: block; font-size: 9px; letter-spacing: 0.12em; color: var(--pa, var(--a)); opacity: 0.85; margin-top: 3px; }
.goal .side { display: grid; gap: 8px; align-content: start; }
.goal .side .btn { min-height: 40px; padding: 0 6px; font-size: 11px; }
.goal .side .btn.lit { border-color: var(--pa, var(--a)); color: var(--pa, var(--a)); box-shadow: inset 0 0 12px color-mix(in srgb, var(--pa, var(--a)) 18%, transparent), 0 0 8px color-mix(in srgb, var(--pa, var(--a)) 30%, transparent); }
.goal .side .btn.star-on { color: var(--green); border-color: var(--green); }
.goal-tools { grid-column: 1 / -1; border-top: 1px solid var(--edge); padding-top: 10px; display: grid; gap: 8px; }
.range { width: 100%; accent-color: var(--pa, var(--a)); height: 28px; }
.goal.done .title { text-decoration: line-through; text-decoration-color: var(--green); }

/* Finances */
.flow { display: grid; grid-template-columns: 1.7fr 1fr; gap: 10px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.log { width: 100%; border-collapse: collapse; font-size: 11.5px; min-width: 470px; }
table.log th { font-weight: 400; color: var(--dim); text-align: left; letter-spacing: 0.1em; padding: 6px 5px; border-bottom: 1px solid var(--edge-hi); border-right: 1px solid var(--edge); white-space: nowrap; }
table.log td { padding: 7px 5px; border-bottom: 1px solid var(--edge); border-right: 1px solid var(--edge); white-space: nowrap; }
table.log th:last-child, table.log td:last-child { border-right: 0; text-align: right; }
table.log td.amt { text-align: right; }
table.log tr[data-id] { cursor: pointer; }
table.log tr[data-id]:active td { background: color-mix(in srgb, var(--a) 6%, transparent); }
table.log td.desc { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

/* Collectables */
.stats-strip { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 6px; padding: 8px 10px; background: var(--inset); border: 1px solid var(--edge); font-size: 11.5px; letter-spacing: 0.08em; margin-bottom: 12px; }
.stats-strip b { color: var(--text); font-weight: 400; }
.stats-strip span { color: var(--dim); white-space: nowrap; }
.c-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.c-list { display: grid; gap: 10px; }
.card { --cut: 10px; padding: 0; cursor: pointer; margin: 0; }
.card .in { display: grid; grid-template-columns: 1fr; }
.card .img { position: relative; aspect-ratio: 1; background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--a) 12%, transparent), transparent 70%), var(--inset); }
.card .img img { width: 100%; height: 100%; object-fit: cover; }
.card .img .none { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }
.card .img .none svg { width: 38%; height: 38%; }
.card .cat { position: absolute; top: 6px; left: 6px; display: inline-flex; align-items: center; gap: 4px; font-size: 10px; letter-spacing: 0.12em; color: var(--a); background: rgba(3, 5, 9, 0.8); padding: 2px 6px; }
.card .cat svg { width: 11px; height: 11px; }
.card .fl { position: absolute; bottom: 6px; left: 6px; width: 18px; height: 18px; color: var(--text); opacity: 0.7; }
.card .meta { padding: 8px 10px 10px; display: grid; gap: 2px; min-width: 0; }
.card .nm { font-family: var(--head); font-weight: 700; font-size: 16px; line-height: 1.05; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .q { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .sm { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--edge); }
.card .details { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid var(--a); color: var(--a); font-size: 10.5px; letter-spacing: 0.1em; white-space: nowrap; }
.card .details svg { width: 12px; height: 12px; }
.c-list .card .in { grid-template-columns: 112px 1fr; }
.stars { color: var(--amber); letter-spacing: 1px; font-size: 12px; white-space: nowrap; }
.stars .off { color: var(--faint); }

/* Collectable detail: a worn hardware frame */
.viewer { position: fixed; inset: 0; z-index: 35; overflow: auto; background: rgba(2, 3, 6, 0.92); padding: max(10px, env(safe-area-inset-top)) 10px calc(14px + env(safe-area-inset-bottom)); opacity: 0; pointer-events: none; transition: opacity var(--mid); }
.viewer.on { opacity: 1; pointer-events: auto; }
.case {
  position: relative; max-width: 540px; margin: 0 auto; padding: 16px 14px 14px; border-radius: 10px;
  background:
    radial-gradient(ellipse 30% 20% at 15% 85%, rgba(60, 40, 20, 0.35), transparent 70%),
    radial-gradient(ellipse 25% 15% at 85% 15%, rgba(40, 30, 20, 0.3), transparent 70%),
    linear-gradient(180deg, #bdb6a8, #8e887c);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.3), 0 20px 40px #000;
}
.case .screw { width: 14px; height: 14px; }
.case .screw:nth-of-type(1) { top: 8px; left: 8px; } .case .screw:nth-of-type(2) { top: 8px; right: 8px; }
.case .screw:nth-of-type(3) { bottom: 8px; left: 8px; } .case .screw:nth-of-type(4) { bottom: 8px; right: 8px; }
.nameplate { position: relative; background: linear-gradient(180deg, #1e2126, #121418); border: 2px solid #0a0b0d; padding: 12px 12px 10px; text-align: center; margin: 4px 10px 12px; box-shadow: inset 0 2px 4px #000; }
.nameplate .slotline { height: 8px; width: 60%; margin: 0 auto 10px; background: #050607; border-radius: 4px; box-shadow: inset 0 2px 3px #000; }
.nameplate h2 { margin: 0; font-family: var(--head); font-weight: 700; font-size: clamp(26px, 8vw, 40px); color: #f09ac8; text-shadow: 0 0 12px rgba(255, 79, 168, 0.5); line-height: 1; overflow-wrap: anywhere; }
.nameplate p { margin: 6px 0 0; font-size: 11px; letter-spacing: 0.16em; color: #a8acb3; }
.nameplate .edition { position: absolute; top: 8px; right: 8px; font-size: 9px; letter-spacing: 0.08em; color: var(--pink); border: 1px solid var(--pink); padding: 2px 5px; text-align: center; line-height: 1.3; }
.display { position: relative; background: radial-gradient(ellipse at 50% 80%, rgba(182, 79, 255, 0.28), transparent 60%), linear-gradient(180deg, #0d1020, #080a14); border: 3px solid #0a0b0d; box-shadow: inset 0 0 30px #000, 0 0 0 2px #2a2d33; padding: 10px; min-height: 260px; }
.display .main { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.display .main img { max-height: 100%; object-fit: contain; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6)); }
.display .main .none { color: #3a3550; } .display .main .none svg { width: 90px; height: 90px; }
.display .platform { position: absolute; left: 18%; right: 18%; bottom: 4%; height: 16%; border-radius: 50%; border: 2px solid rgba(214, 120, 255, 0.7); box-shadow: 0 0 20px rgba(214, 120, 255, 0.6), inset 0 0 20px rgba(214, 120, 255, 0.35); pointer-events: none; }
.hud-box { position: absolute; border: 1px solid rgba(255, 79, 168, 0.6); background: rgba(10, 8, 20, 0.75); padding: 5px 7px; font-size: 10px; letter-spacing: 0.1em; color: #f09ac8; line-height: 1.4; }
.hud-box b { display: block; font-weight: 400; color: #fff; font-size: 12px; }
.hud-box.tl { top: 10px; left: 10px; } .hud-box.tr { top: 10px; right: 10px; text-align: right; } .hud-box.br { bottom: 10px; right: 10px; text-align: right; } .hud-box.bl { bottom: 10px; left: 10px; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumbs button { flex: none; width: 56px; height: 56px; padding: 0; border: 1px solid #333; background: #0b0d12 center / cover; cursor: pointer; }
.thumbs button.on { border-color: var(--pink); box-shadow: 0 0 8px rgba(255, 79, 168, 0.6); }
.case-row { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 8px; margin-top: 12px; }
.case-panel { background: linear-gradient(180deg, #a8a296, #8b8579); border: 1px solid #5c574f; border-radius: 4px; padding: 8px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); color: #1b1c1f; font-size: 11px; letter-spacing: 0.08em; }
.case-panel.lcd { background: #101317; color: #d8d8e0; border-color: #000; box-shadow: inset 0 2px 4px #000; }
.case-panel .btn { min-height: 36px; padding: 0 8px; font-size: 10.5px; }
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.spec div { background: #101317; border: 1px solid #000; padding: 6px 8px; color: #d8d8e0; font-size: 10.5px; letter-spacing: 0.1em; min-width: 0; }
.spec b { display: block; font-weight: 400; font-size: 13px; color: #fff; overflow-wrap: anywhere; }
.case .notes { margin-top: 10px; background: #101317; border: 1px solid #000; padding: 8px 10px; color: #d8d8e0; font-size: 12.5px; white-space: pre-wrap; }
.case .copy { text-align: center; font-size: 10px; letter-spacing: 0.14em; color: #3a3833; margin-top: 10px; }

/* Notes */
.note-entry { padding: 10px 2px; border-top: 1px solid var(--edge); cursor: pointer; }
.note-entry:first-child { border-top: 0; }
.note-entry .ts { font-size: 11px; color: var(--dim); display: flex; gap: 8px; align-items: center; }
.note-entry .lt { font-size: 14.5px; margin-top: 5px; letter-spacing: 0.04em; }
.note-entry .lt::before { content: "> "; color: var(--a); }
.note-entry .lb { font-size: 13px; color: var(--dim); margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Sheets (forms) ---------- */
.scrim { position: fixed; inset: 0; z-index: 38; background: rgba(0, 3, 6, 0.72); opacity: 0; pointer-events: none; transition: opacity var(--mid); }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 39; left: 50%; bottom: 0; width: min(560px, 100%); max-height: 92dvh; overflow: auto;
  transform: translate(-50%, 104%); transition: transform var(--mid) cubic-bezier(.3, .8, .3, 1);
  background: linear-gradient(180deg, #0f1823, #090f16); border-top: 1px solid var(--a);
  padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6), 0 -1px 12px color-mix(in srgb, var(--a) 25%, transparent);
}
.sheet.on { transform: translate(-50%, 0); }
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; }
.field label { font-size: 10.5px; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; background: var(--inset); border: 1px solid var(--edge-hi);
  color: var(--text); letter-spacing: 0.04em; font-size: 16px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--a); box-shadow: 0 0 0 1px var(--a), 0 0 10px color-mix(in srgb, var(--a) 40%, transparent); }
.field.err input, .field.err select, .field.err textarea { border-color: var(--amber); }
.field .err-msg { font-size: 11.5px; color: var(--amber); letter-spacing: 0.08em; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.icon-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.icon-pick button { width: 42px; height: 42px; display: grid; place-items: center; background: var(--inset); border: 1px solid var(--edge-hi); color: var(--dim); cursor: pointer; }
.icon-pick button.on { color: var(--a); border-color: var(--a); box-shadow: 0 0 8px color-mix(in srgb, var(--a) 40%, transparent); }
.icon-pick svg { width: 20px; height: 20px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--edge); }
.switch:first-child { border-top: 0; }
.switch input { appearance: none; -webkit-appearance: none; width: 52px; height: 28px; border-radius: 14px; background: var(--inset); border: 1px solid var(--edge-hi); position: relative; cursor: pointer; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--dim); transition: transform var(--fast), background var(--fast); }
.switch input:checked { border-color: var(--green); background: #0c2015; }
.switch input:checked::after { transform: translateX(24px); background: var(--green); box-shadow: 0 0 8px var(--green); }

.toast { position: fixed; z-index: 50; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translate(-50%, -150%); padding: 9px 14px; background: #08131a; border: 1px solid var(--a); color: var(--a); font-size: 12.5px; letter-spacing: 0.12em; box-shadow: 0 0 12px color-mix(in srgb, var(--a) 40%, transparent); transition: transform var(--mid); white-space: nowrap; }
.toast.on { transform: translate(-50%, 0); }
.toast.warn { border-color: var(--amber); color: var(--amber); }

/* ---------- Effects ---------- */
.scanlines::after { content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, 0.14) 2px 3px); }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; } }

/* =====================================================================
   Module dashboards — terminal-database layout (header · status strip · system panel ·
   item cards · overall panel · tab bar). Shared by every module screen.
   ===================================================================== */
body:not([data-mod="home"]) {
  --a: #45e1ec; --a2: #5ff08c;
  --nv-c: #45e1ec; --nv-g: #5ff08c;
  --edge: #1b3236; --edge-hi: #2a4a4f;
  --ui: "Rajdhani", "Share Tech Mono", sans-serif;
  background: radial-gradient(ellipse 90% 40% at 50% 0%, rgba(69, 225, 236, 0.06), transparent 70%), #040a0b;
}
body:not([data-mod="home"]) .shell { padding-bottom: calc(118px + env(safe-area-inset-bottom)); }
body:not([data-mod="home"]) .status { display: none; }

.nv { font-family: var(--ui); color: #d7e9eb; padding-top: 4px; }

/* Header */
.nv-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; margin-bottom: 10px; }
.nv-eject { width: 40px; height: 40px; display: grid; place-items: center; background: #091315; border: 1px solid var(--nv-c); border-radius: 6px; color: var(--nv-c); cursor: pointer; box-shadow: 0 0 10px rgba(69, 225, 236, 0.25); }
.nv-eject:active { transform: translateY(1px); }
.nv-eject svg { width: 18px; height: 18px; }
.nv-db b { display: block; font-weight: 600; font-size: 19px; letter-spacing: 0.04em; line-height: 1.1; color: #e3f1f2; }
.nv-db span { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: #a9c4c7; margin-top: 3px; }
.nv-meta { text-align: right; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: #a9c4c7; line-height: 1.45; }
.nv-sec { display: inline-flex; align-items: center; gap: 8px; margin-top: 5px; padding: 4px 10px; border: 1px solid var(--nv-c); border-radius: 5px; color: var(--nv-c); font-family: var(--ui); font-weight: 600; font-size: 15px; letter-spacing: 0.06em; box-shadow: 0 0 8px rgba(69, 225, 236, 0.25); }
.nv-sec svg { width: 14px; height: 14px; }

/* Status strip */
.nv-status { display: grid; grid-template-columns: 1.25fr 1fr 1fr; border: 1px solid var(--edge-hi); border-radius: 6px; background: #071012; margin-bottom: 12px; }
.nv-status > div { padding: 8px 10px; min-width: 0; border-left: 1px solid var(--edge-hi); }
.nv-status > div:first-child { border-left: 0; }
.nv-status label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: #a9c4c7; margin-bottom: 4px; }
.nv-status .v { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; color: var(--nv-g); white-space: nowrap; }
.nv-status .v.c { color: var(--nv-c); }
.nv-status small { display: block; font-family: var(--mono); font-size: 10px; color: #a9c4c7; letter-spacing: 0.08em; }
.nv-status svg.ecg { width: 64px; height: 18px; flex: none; }
.nv-batt { width: 46px; height: 18px; border: 2px solid var(--nv-c); border-radius: 3px; padding: 2px; position: relative; flex: none; }
.nv-batt::after { content: ""; position: absolute; right: -5px; top: 4px; width: 3px; height: 6px; background: var(--nv-c); }
.nv-batt i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--nv-c) 0 6px, transparent 6px 8px); box-shadow: 0 0 6px var(--nv-c); }

/* System panel */
.nv-hero { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 14px; margin-bottom: 14px; border: 1px solid var(--edge-hi); border-radius: 6px; background: linear-gradient(180deg, #0b1719, #081113); }
.nv-hero::before, .nv-hero::after { content: ""; position: absolute; width: 12px; height: 12px; border-color: #6b8a8e; border-style: solid; }
.nv-hero::before { top: 5px; left: 5px; border-width: 1px 0 0 1px; }
.nv-hero::after { bottom: 5px; right: 5px; border-width: 0 1px 1px 0; }
.nv-emblem { width: clamp(84px, 24vw, 112px); aspect-ratio: 1; }
.nv-hero h1 { margin: 0; font-weight: 600; font-size: clamp(26px, 7.4vw, 34px); line-height: 1; letter-spacing: 0.01em; color: #e3f1f2; }
.nv-hero p { margin: 6px 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: #b9d2d5; }
.nv-hero .link { display: flex; align-items: center; gap: 7px; color: #b9d2d5; font-family: var(--ui); font-size: 14px; letter-spacing: 0.02em; margin-top: 8px; }
.nv-hero .link i { width: 8px; height: 8px; border-radius: 50%; background: var(--nv-c); box-shadow: 0 0 8px var(--nv-c); flex: none; }

/* Section label */
.nv-section { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 8px; }
.nv-section b { font-weight: 600; font-size: 20px; color: #e3f1f2; letter-spacing: 0.02em; }
.nv-section span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--nv-g); }
.nv-section em { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: #a9c4c7; }

/* Item cards */
.nv-card {
  --col: var(--nv-c);
  position: relative; display: grid; grid-template-columns: 1fr minmax(96px, 30%); gap: 12px; padding: 12px; margin-bottom: 10px;
  border: 1px solid var(--edge-hi); border-radius: 6px; background: linear-gradient(180deg, #0b171a, #071012);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.nv-card::after { content: ""; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-top: 1px solid #5d7b7f; border-right: 1px solid #5d7b7f; }
.nv-card.g { --col: var(--nv-g); }
.nv-card .t-row { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; }
.nv-card .ic { width: 34px; height: 34px; color: var(--col); filter: drop-shadow(0 0 4px var(--col)); }
.nv-card .thumb { width: 36px; height: 36px; border: 1px solid var(--col); border-radius: 4px; background: #050b0c center / cover; box-shadow: 0 0 6px color-mix(in srgb, var(--col) 40%, transparent); }
.nv-card .ttl { font-weight: 700; font-size: 20px; line-height: 1.08; color: var(--col); text-shadow: 0 0 10px color-mix(in srgb, var(--col) 35%, transparent); overflow-wrap: anywhere; }
.nv-card .sb { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--col); text-transform: uppercase; margin-top: 3px; }
.nv-card .ds { font-size: 14px; line-height: 1.3; color: #d7e9eb; margin-top: 7px; overflow-wrap: anywhere; }
.nv-card .ds.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nv-prog { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 10px; }
.nv-prog .pl { font-weight: 700; font-size: 15px; color: var(--col); line-height: 1; }
.nv-prog .pv { text-align: right; font-weight: 600; font-size: 21px; color: var(--col); line-height: 1; text-shadow: 0 0 8px color-mix(in srgb, var(--col) 40%, transparent); white-space: nowrap; }
.nv-prog .pv small { font-size: 13px; }
.nv-prog .pv span { display: block; font-family: var(--mono); font-weight: 400; font-size: 9.5px; letter-spacing: 0.08em; margin-top: 3px; text-shadow: none; }
.nv-bar { height: 16px; border: 1px solid #3c5a5e; background: #050c0d; padding: 2px; }
.nv-bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--col); box-shadow: 0 0 10px color-mix(in srgb, var(--col) 60%, transparent);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 5px); mask: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 5px); transition: width var(--mid) ease; }
.nv-side { display: grid; gap: 10px; align-content: start; }
.nv-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 8px;
  background: linear-gradient(180deg, #121c1e, #0b1315); border: 1px solid #3a4a4d; border-radius: 6px; cursor: pointer;
  color: #cfd8da; font-family: var(--ui); font-weight: 600; font-size: 16px; letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 0 #000; transition: transform var(--fast), box-shadow var(--fast);
}
.nv-btn svg { width: 20px; height: 20px; flex: none; }
.nv-btn:active { transform: translateY(2px); box-shadow: inset 0 2px 5px #000; }
.nv-btn.lit { border-color: var(--col); color: var(--col); background: linear-gradient(180deg, color-mix(in srgb, var(--col) 16%, #0b1416), color-mix(in srgb, var(--col) 6%, #081012)); box-shadow: 0 0 12px color-mix(in srgb, var(--col) 35%, transparent), inset 0 1px 0 color-mix(in srgb, var(--col) 25%, transparent); }
.nv-btn.on { color: var(--nv-g); border-color: #2f5a3d; }
.nv-btn.on svg path { fill: currentColor; }
.nv-tools { grid-column: 1 / -1; border-top: 1px solid var(--edge); padding-top: 10px; display: grid; gap: 8px; }
.nv-tools .range { accent-color: var(--col); }

/* Overall panel + report */
.nv-overall { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; margin: 4px 0 10px; }
.nv-box { border: 1px solid var(--edge-hi); border-radius: 6px; background: #071012; padding: 10px 12px; min-width: 0; }
.nv-box .lb { font-weight: 600; font-size: 15px; color: #e3f1f2; }
.nv-box .lb span { font-family: var(--mono); font-weight: 400; font-size: 10px; letter-spacing: 0.1em; color: var(--nv-c); margin-left: 6px; }
.nv-box .ov { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; margin-top: 6px; }
.nv-box .ov .spark { height: 44px; border: 1px solid var(--edge); }
.nv-box .big { font-weight: 600; font-size: 30px; line-height: 1; color: var(--nv-c); text-align: right; text-shadow: 0 0 10px rgba(69, 225, 236, 0.4); white-space: nowrap; }
.nv-box .big small { font-size: 16px; }
.nv-box .big span { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; margin-top: 4px; text-shadow: none; }
.nv-report { min-height: 100%; font-size: 17px; }
.nv-report svg { width: 24px; height: 24px; color: #cfd8da; }
.nv-search { width: 100%; min-height: 44px; margin-bottom: 10px; padding: 0 12px; background: #071012; border: 1px solid var(--edge-hi); border-radius: 6px; color: #d7e9eb; font-size: 16px; font-family: var(--ui); }
.nv-search:focus { outline: none; border-color: var(--nv-c); }
.nv-panel { border: 1px solid var(--edge-hi); border-radius: 6px; background: linear-gradient(180deg, #0b171a, #071012); padding: 12px; margin-bottom: 10px; }
.nv-panel h3 { margin: 0 0 10px; font-weight: 600; font-size: 18px; color: #e3f1f2; }
.nv-panel h3 span { font-family: var(--mono); font-weight: 400; font-size: 10.5px; letter-spacing: 0.12em; color: var(--nv-g); margin-left: 8px; }
.nv-stat { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--edge); --col: var(--nv-c); }
.nv-stat:first-of-type { border-top: 0; }
.nv-stat b { font-weight: 600; font-size: 16px; }
.nv-stat em { font-style: normal; font-weight: 600; font-size: 18px; color: var(--col); }
.nv-stat .nv-bar { grid-column: 1 / -1; height: 12px; }
.nv-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 2px; border-top: 1px solid var(--edge); cursor: pointer; }
.nv-row:first-child { border-top: 0; }
.nv-row .d { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-row .amt { font-weight: 600; font-size: 16px; text-align: right; white-space: nowrap; }
.nv-row .m { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-family: var(--mono); font-size: 10.5px; color: #a9c4c7; }

/* Bottom: tab bar + footer, docked */
.nv-dock { position: fixed; z-index: 20; left: 50%; bottom: 0; transform: translateX(-50%); width: min(560px, 100%); padding: 8px 10px calc(6px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(4, 10, 11, 0.9), #040a0b 30%); border-top: 1px solid var(--edge-hi); }
.nv-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.nv-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 64px; padding: 4px 2px; background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; color: #9db3b6; font-family: var(--ui); font-weight: 600; font-size: 13px; line-height: 1.05; text-align: center; }
.nv-tab svg { width: 24px; height: 24px; }
.nv-tab small { font-family: var(--mono); font-weight: 400; font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.nv-tab.on { color: var(--nv-g); border-color: var(--nv-g); background: rgba(95, 240, 140, 0.08); box-shadow: 0 0 12px rgba(95, 240, 140, 0.25), inset 0 0 12px rgba(95, 240, 140, 0.08); }
.nv-tab:active { transform: translateY(1px); }
.nv-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; color: #8aa3a6; white-space: nowrap; overflow: hidden; }
.nv-foot span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .nv-card { grid-template-columns: 1fr 88px; } .nv-btn { font-size: 14px; gap: 5px; } .nv-meta { font-size: 9.5px; } }

/* No CRT lines over the disk artwork on the home screen */
body[data-mod="home"].scanlines::after { display: none; }

/* The drive unit (user's artwork): closed image, with the open door faded in over the slot area */
.drive2 { position: relative; aspect-ratio: 1200 / 514; margin: 2px 0 12px; border-radius: 6px; overflow: hidden; container-type: inline-size;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65), 0 0 0 1px #000; }
.drive2 img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.drive2 .door { opacity: 0; transition: opacity 200ms ease; clip-path: inset(28.5% 3% 42.5% 44%); }
.drive2.open .door { opacity: 1; }
/* Glowing text in the two black windows */
.drive2 .lcd { position: absolute; left: 4.8%; width: 36.4%; display: flex; align-items: center; padding: 0 3cqw; overflow: hidden; white-space: nowrap;
  font-family: "VT323", var(--mono); font-size: 4.4cqw; letter-spacing: 0.06em; color: #ffb347; text-shadow: 0 0 6px rgba(255, 179, 71, 0.85); }
.drive2 .l1 { top: 28.3%; height: 13%; }
.drive2 .l2 { top: 48.7%; height: 13.3%; color: #7dffb0; text-shadow: 0 0 6px rgba(125, 255, 176, 0.85); }
.drive2 .cur { font-style: normal; margin-left: 2px; animation: blink 1s steps(1) infinite; }
.drive2 .pwr { position: absolute; left: 49.4%; top: 63%; width: 1.6%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: #6dff9c; box-shadow: 0 0 6px 2px rgba(109, 255, 156, 0.7); }
.drive2.reading .pwr { background: #ffb347; box-shadow: 0 0 8px 3px rgba(255, 179, 71, 0.85); animation: flicker 0.16s steps(1) infinite; }
.drive2 .mini { position: absolute; left: 84.7%; top: 72.8%; width: 8.4%; height: 9.7%; display: grid; place-items: center;
  font-family: "VT323", var(--mono); font-size: 3.6cqw; color: #7dffb0; text-shadow: 0 0 5px rgba(125, 255, 176, 0.8); }
.drive2 .slot { position: absolute; left: 47.9%; top: 36.7%; width: 45%; height: 16.6%; pointer-events: none; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes flicker { 50% { opacity: 0.3; } }
.drive2 .lbar { flex: 1; height: 46%; border: 1px solid currentColor; padding: 1px; box-shadow: 0 0 5px rgba(125, 255, 176, 0.5); }
.drive2 .lbar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, currentColor 0 1.6cqw, transparent 1.6cqw 2.1cqw); }
.drive2 .lpct { width: 7cqw; text-align: right; margin-left: 1.5cqw; }
.drive2 .slot { background: none; border: 0; box-shadow: none; height: 16.6%; flex: none; }
.drive2 .slot::after { display: none; }
