/* ONE Production Performance System — one stylesheet for phone, desktop and TV.
   Status is always shown as words + colour (SR-06). Fonts include common Burmese faces. */
:root {
  --font: system-ui, "Noto Sans", "Noto Sans Myanmar", "Myanmar Text", "Pyidaungsu", "Padauk", Arial, sans-serif;
  --bg: #f3f4f6; --surface: #fff; --surface-2: #f9fafb; --line: #d1d5db; --line-2: #e5e7eb;
  --ink: #111827; --ink-2: #4b5563; --ink-3: #6b7280;
  --brand: #0f172a; --accent: #2563eb; --accent-ink: #fff;
  --run: #15803d; --run-bg: #dcfce7;
  --idle: #1d4ed8; --idle-bg: #dbeafe;
  --pause: #a16207; --pause-bg: #fef3c7;
  --maint: #b91c1c; --maint-bg: #fee2e2;
  --off: #374151; --off-bg: #e5e7eb;
  --warn: #b45309; --warn-bg: #fffbeb; --bad: #b91c1c; --bad-bg: #fef2f2; --ok: #15803d;
  --radius: 10px; --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 1px 3px rgb(0 0 0 / .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --surface: #111827; --surface-2: #0f172a; --line: #374151; --line-2: #1f2937;
    --ink: #f3f4f6; --ink-2: #cbd5e1; --ink-3: #94a3b8; --accent: #3b82f6;
    --run: #4ade80; --run-bg: #052e16; --idle: #93c5fd; --idle-bg: #172554; --pause: #fcd34d; --pause-bg: #422006;
    --maint: #fca5a5; --maint-bg: #450a0a; --off: #d1d5db; --off-bg: #1f2937;
    --warn: #fcd34d; --warn-bg: #422006; --bad: #fca5a5; --bad-bg: #450a0a; --ok: #4ade80;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120; --surface: #111827; --surface-2: #0f172a; --line: #374151; --line-2: #1f2937;
  --ink: #f3f4f6; --ink-2: #cbd5e1; --ink-3: #94a3b8; --accent: #3b82f6;
  --run: #4ade80; --run-bg: #052e16; --idle: #93c5fd; --idle-bg: #172554; --pause: #fcd34d; --pause-bg: #422006;
  --maint: #fca5a5; --maint-bg: #450a0a; --off: #d1d5db; --off-bg: #1f2937;
  --warn: #fcd34d; --warn-bg: #422006; --bad: #fca5a5; --bad-bg: #450a0a; --ok: #4ade80;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; }
body { min-height: 100vh; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.boot { padding: 40px; text-align: center; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* ---------- top bar */
.top { position: sticky; top: 0; z-index: 10; background: var(--brand); color: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); flex-wrap: wrap; }
.top .brand { font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.top nav a { color: #cbd5e1; text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; white-space: nowrap; }
.top nav a.on { background: rgb(255 255 255 / .14); color: #fff; }
.top .who { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: #cbd5e1; }
.top .who button { background: transparent; border: 1px solid rgb(255 255 255 / .3); color: #fff; border-radius: 8px; padding: 4px 10px; cursor: pointer; }

main { max-width: 1200px; margin: 0 auto; padding: 16px; }
main.wide { max-width: none; }
h1 { font-size: 1.35rem; margin: 4px 0 12px; }
h2 { font-size: 1.1rem; margin: 20px 0 8px; }
h3 { font-size: 1rem; margin: 14px 0 6px; }

/* ---------- connection banner */
.conn { position: sticky; top: 0; z-index: 20; padding: 8px 16px; text-align: center; font-weight: 600; background: var(--bad); color: #fff; }
.conn.warn { background: var(--warn); }

/* ---------- cards / panels */
.panel { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stack > * + * { margin-top: 10px; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: .9rem; }
.btn.big { min-height: 64px; font-size: 1.15rem; border-radius: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.sel { outline: 3px solid var(--accent); outline-offset: 1px; }

/* ---------- forms */
label.f { display: block; font-size: .9rem; color: var(--ink-2); font-weight: 600; }
label.f > input, label.f > select, label.f > textarea { display: block; width: 100%; margin-top: 4px; }
input, select, textarea { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.err { color: var(--bad); font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.check input { min-height: 0; width: 20px; height: 20px; }

/* ---------- status pills (text + colour) */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: .85rem; border: 1px solid transparent; white-space: nowrap; }
.pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pill.Running { color: var(--run); background: var(--run-bg); }
.pill.Idle { color: var(--idle); background: var(--idle-bg); }
.pill.Paused { color: var(--pause); background: var(--pause-bg); }
.pill.Maintenance { color: var(--maint); background: var(--maint-bg); }
.pill.OFF { color: var(--off); background: var(--off-bg); }
.pill.none { color: var(--ink-3); background: transparent; border: 1px dashed var(--line); }
.pill.none::before { display: none; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .8rem; font-weight: 700; }
.tag.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid currentColor; }
.tag.bad { background: var(--bad-bg); color: var(--bad); border: 1px solid currentColor; }
.tag.ok { color: var(--ok); border: 1px solid currentColor; }
.tag.info { color: var(--ink-2); border: 1px solid var(--line); }

/* ---------- machine card (office board) */
.mcard { background: var(--surface); border: 1px solid var(--line-2); border-left: 8px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.mcard.Running { border-left-color: var(--run); } .mcard.Idle { border-left-color: var(--idle); }
.mcard.Paused { border-left-color: var(--pause); } .mcard.Maintenance { border-left-color: var(--maint); }
.mcard.OFF { border-left-color: var(--off); } .mcard.none { border-left-style: dashed; }
.mcard .name { font-weight: 700; font-size: 1.05rem; }
.mcard .power { font-weight: 800; letter-spacing: .5px; }
.mcard .meta { font-size: .82rem; color: var(--ink-3); }
.mcard .note { font-size: .9rem; color: var(--ink-2); overflow-wrap: anywhere; }
.mcard .src { font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); }

/* ---------- operator machine screen */
.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toggle .btn { min-height: 76px; font-size: 1.4rem; letter-spacing: 1px; }
.toggle .on.sel { background: var(--run); border-color: var(--run); color: #fff; outline: none; }
.toggle .off.sel { background: var(--off); border-color: var(--off); color: var(--surface); outline: none; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acts .btn { min-height: 64px; font-size: 1.1rem; }
.acts .btn.sel.Running { background: var(--run-bg); color: var(--run); border-color: var(--run); outline-color: var(--run); }
.acts .btn.sel.Idle { background: var(--idle-bg); color: var(--idle); border-color: var(--idle); outline-color: var(--idle); }
.acts .btn.sel.Paused { background: var(--pause-bg); color: var(--pause); border-color: var(--pause); outline-color: var(--pause); }
.acts .btn.sel.Maintenance { background: var(--maint-bg); color: var(--maint); border-color: var(--maint); outline-color: var(--maint); }
.savestate { font-weight: 700; padding: 8px 12px; border-radius: 8px; }
.savestate.pending { background: var(--warn-bg); color: var(--warn); }
.savestate.failed { background: var(--bad-bg); color: var(--bad); }
.savestate.saved { color: var(--ok); }

/* ---------- list rows */
.mrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); text-decoration: none; color: var(--ink); min-height: 64px; }
.mrow + .mrow { margin-top: 8px; }
.mrow .t { font-weight: 700; }

/* ---------- tables */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; color: var(--ink-2); white-space: nowrap; position: sticky; top: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 800; background: var(--surface-2); }
tr.void td { text-decoration: line-through; color: var(--ink-3); }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }

/* ---------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 14px; flex-wrap: wrap; }
.tabs button { background: none; border: none; padding: 10px 14px; border-bottom: 3px solid transparent; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.tabs button.on { border-bottom-color: var(--accent); color: var(--ink); }

/* ---------- output line editor */
.line { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px; background: var(--surface-2); }
.line + .line { margin-top: 10px; }
.calc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.calc div { background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; }
.calc b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.calc span { font-size: .8rem; color: var(--ink-3); }

/* ---------- login */
.login { max-width: 520px; margin: 24px auto; }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.names .btn { min-height: 58px; flex-direction: column; gap: 2px; padding-block: 10px; }
.names .btn .nm { line-height: 1.25; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); vertical-align: middle; }
.avatar.ini { background: #475569; color: #fff; font-weight: 700; letter-spacing: .5px; }
.top .who .me { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 2px 6px 2px 2px; border-radius: 999px; color: inherit; font: inherit; }
.top .who .me:hover { background: rgb(255 255 255 / .12); }
.top .who .me .avatar.ini { background: rgb(255 255 255 / .2); }
.photo-pick { width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick.round { width: 160px; height: 160px; aspect-ratio: 1; border-radius: 50%; margin-inline: auto; }
.names .btn small { font-weight: 400; color: var(--ink-3); font-size: .75rem; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 320px; margin: 12px auto 0; }
.pinpad .btn { min-height: 64px; font-size: 1.4rem; }
.pindots { text-align: center; font-size: 2rem; letter-spacing: 10px; min-height: 48px; }

/* ---------- dialog */
dialog { border: none; border-radius: 14px; padding: 0; max-width: min(520px, 94vw); width: 100%; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / .35); }
dialog::backdrop { background: rgb(15 23 42 / .55); }
dialog .dh { padding: 16px 18px 0; font-weight: 800; font-size: 1.1rem; }
dialog .db { padding: 12px 18px; }
dialog .df { padding: 0 18px 16px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- toasts */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(440px, 92vw); }
.toast { background: var(--brand); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 600; }
.toast.bad { background: var(--bad); }

/* ---------- TV mode */
body.tv { font-size: 20px; }
body.tv .top nav, body.tv .top .who button { display: none; }
body.tv .grid.cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
body.tv .mcard .name { font-size: 1.3rem; }
body.tv main { max-width: none; }

@media (max-width: 640px) {
  main { padding: 12px; }
  .top { position: static; gap: 6px; padding: 8px 12px; }
  .top .brand { flex: 1; }
  .top nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .top nav a { padding: 8px 10px; font-size: .9rem; }
  .hide-sm { display: none; }
}
@media print {
  .top, .conn, .noprint, .toasts { display: none !important; }
  body { background: #fff; }
  .panel, .tablewrap { box-shadow: none; border-color: #ccc; }
}

/* language switch */
.top .langbtn { background: transparent; border: 1px solid rgb(255 255 255 / .35); color: #fff; border-radius: 8px; padding: 4px 10px; min-height: 32px; cursor: pointer; font: 600 .9rem "Noto Sans Myanmar", "Myanmar Text", "Pyidaungsu", var(--font); white-space: nowrap; }
.top .langbtn:hover { background: rgb(255 255 255 / .12); }
html[lang="my"] body { line-height: 1.75; }
html[lang="my"] .btn, html[lang="my"] .pill, html[lang="my"] .tag, html[lang="my"] th { line-height: 1.6; }
html[lang="my"] h1 { font-family: "Noto Sans Myanmar", "Myanmar Text", "Pyidaungsu", var(--font); font-size: 1.35rem; }
.top > .langbtn { margin-left: auto; }

/* logo */
:root { --logo-light: block; --logo-dark: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --logo-light: none; --logo-dark: block; } }
:root[data-theme="dark"] { --logo-light: none; --logo-dark: block; }
.top .brand { display: inline-flex; align-items: center; gap: 6px; }
.top .brand .brand-mark { height: 30px; width: auto; margin-right: 4px; }
.login-logo { display: flex; justify-content: center; padding-block: 8px 4px; }
.login-logo img { width: 150px; max-width: 45vw; height: auto; }
.login-logo .logo-light { display: var(--logo-light); }
.login-logo .logo-dark { display: var(--logo-dark); }
@media (max-width: 640px) { .top .brand .brand-mark { height: 26px; } .login-logo img { width: 120px; } }
.top .brand b { color: #e8c77a; }

/* ---------- signage project cards */
.pill.stage::before { display: none; }
.pill.stage.queued { color: var(--off); background: var(--off-bg); }
.pill.stage.in-progress { color: var(--idle); background: var(--idle-bg); }
.pill.stage.ready { color: var(--run); background: var(--run-bg); }
.pill.stage.on-hold { color: var(--pause); background: var(--pause-bg); }
.pill.stage.completed { color: var(--ink-2); background: transparent; border-color: var(--line); }
button.chip { cursor: pointer; border: 1px solid transparent; font: inherit; font-weight: 700; }
button.chip.sel { outline: 2px solid currentColor; outline-offset: 1px; }
.grid.pcards { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.pcard { background: var(--surface); border: 1px solid var(--line-2); border-top: 5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; cursor: pointer; min-width: 0; }
.pcard:hover, .pcard:focus-visible { border-color: var(--ink-3); outline: none; }
.pcard.queued { border-top-color: var(--off); } .pcard.in-progress { border-top-color: var(--idle); }
.pcard.ready { border-top-color: var(--run); } .pcard.on-hold { border-top-color: var(--pause); }
.pcard.overdue { box-shadow: inset 0 0 0 2px var(--bad), var(--shadow); }
.pcard .pid { font-family: var(--display, inherit); font-weight: 700; color: var(--ink-3); letter-spacing: .4px; font-variant-numeric: tabular-nums; }
.pcard .pname { font-family: var(--display, inherit); font-weight: 700; font-size: 1.15rem; line-height: 1.25; overflow-wrap: anywhere; }
.pcard .pmeta { font-size: .9rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pcard .lbl { color: var(--ink-3); font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }
.pcard .pprog { font-size: .92rem; color: var(--ink-2); border-left: 3px solid var(--line); padding-left: 8px; overflow-wrap: anywhere; }
.pcard .pfoot { font-size: .78rem; color: var(--ink-3); margin-top: auto; }
.filters { align-items: flex-end; }
.filters .grow { flex: 1 1 200px; }
.f.ro span { display: block; font-size: .9rem; color: var(--ink-2); font-weight: 600; }
.f.ro div { padding: 6px 0; overflow-wrap: anywhere; }
dialog.pdialog { max-width: min(620px, 94vw); }
ul.hist { margin: 6px 0 0; padding-left: 18px; font-size: .88rem; max-height: 220px; overflow: auto; }
ul.hist li + li { margin-top: 4px; }
.warnbox { border-color: var(--warn); background: var(--warn-bg); margin: 0; }

/* ---------- project photos */
.pcover { position: relative; margin: -12px -14px 4px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px 6px 0 0; background: var(--surface-2); }
.pcover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcover .pcount { position: absolute; right: 8px; bottom: 8px; background: rgb(0 0 0 / .65); color: #fff; font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.photos .pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photos figure { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.photos .pthumb { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-2); cursor: zoom-in; }
.photos .pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos figcaption { font-size: .78rem; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.photos .row input, .pfiles .row input { flex: 1 1 200px; }
.pfiles .flist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pfiles .flist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); flex-wrap: wrap; }
.pfiles .fext { flex: none; min-width: 42px; height: 42px; padding: 0 4px; border-radius: 6px; background: #f97316; color: #fff; font: 700 .78rem/42px var(--font); text-align: center; }
.pfiles .finfo { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; }
.pfiles .fname { font-weight: 600; overflow-wrap: anywhere; color: inherit; }
.pcard .fbadge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #f97316; color: #fff; font-size: .75rem; font-weight: 700; }
dialog.lightbox { max-width: min(1100px, 96vw); background: var(--surface); }
dialog.lightbox .lb-img { background: #111; display: flex; justify-content: center; align-items: center; }
dialog.lightbox .lb-img img { max-width: 100%; max-height: 75vh; object-fit: contain; display: block; }
dialog.lightbox .df { align-items: center; padding-top: 12px; }
dialog.lightbox .lb-cap { flex: 1 1 200px; font-size: .9rem; overflow-wrap: anywhere; }
dialog { max-height: 92vh; overflow-y: auto; }
dialog.lightbox { overflow: hidden auto; }

/* ---------- charts (validated categorical palette; light and dark selected separately) */
:root { --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948; --viz-surface: var(--surface); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767; } }
:root[data-theme="dark"] { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767; }
.viz { position: relative; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px 16px 10px; box-shadow: var(--shadow); min-width: 0; }
.viz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.viz-title { font-weight: 700; font-size: 1.02rem; }
.viz-sub { font-size: .82rem; color: var(--ink-3); }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--ink-2); margin: 8px 0 2px; }
.viz-legend i, .viz-tip i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.viz-plot { width: 100%; min-height: 240px; touch-action: pan-y; }
.viz-plot svg { display: block; overflow: visible; }
.viz-grid { stroke: var(--line-2); stroke-width: 1; }
.viz-base { stroke: var(--line); stroke-width: 1; }
.viz-axis { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-end { fill: var(--ink-2); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-empty { fill: var(--ink-3); font-size: 13px; }
.viz-cross { stroke: var(--ink-3); stroke-width: 1; }
.viz-tip { position: absolute; top: 64px; transform: translateX(-50%); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: .82rem; box-shadow: var(--shadow); pointer-events: none; white-space: nowrap; z-index: 2; font-variant-numeric: tabular-nums; }
.viz-tip b { display: block; margin-bottom: 2px; }
.viz-note { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
.viz-table { margin-top: 8px; max-height: 320px; overflow: auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 8px; }
.tile { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.tile-label { font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.tile-value { font-family: var(--display, inherit); font-size: 2.1rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile-delta { font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tile-delta.up { color: var(--ok); } .tile-delta.down { color: var(--bad); }
/* ---------- machine photo */
.mcard .mphoto, .mphoto-big { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.mcard .mphoto { margin: -2px 0 2px; cursor: zoom-in; }
.mrow .mthumb, td .mthumb { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; flex: none; }
.mrow > div:first-child { display: flex; gap: 10px; align-items: center; min-width: 0; }

[hidden] { display: none !important; }
.mgroup { margin-top: 18px; }
.mgroup .gh { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--line); padding-bottom: 6px; margin-bottom: 10px; }
.mgroup .gh h2, .ghead { margin: 0; font-size: 1.15rem; }
.ghead { margin: 16px 0 8px; }
.lgroup + .lgroup { margin-top: 14px; }
.lgroup h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); margin: 0 0 8px; font-weight: 700; }
/* requests */
.nbadge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.rcard { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rcard.ink { border-left-color: #8b5cf6; } .rcard.vinyl { border-left-color: #0ea5e9; } .rcard.other { border-left-color: #64748b; }
.rcard.urgent { box-shadow: 0 0 0 2px #ef4444 inset; }
.rkind { font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: #fff; background: #64748b; }
.rkind.ink { background: #7c3aed; } .rkind.vinyl { background: #0284c7; }
.rtitle { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.rdesc { white-space: pre-wrap; overflow-wrap: anywhere; }
.rcard .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); }
.rphotos { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rphotos .pthumb { width: 76px; height: 76px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; position: relative; }
.rphotos .pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rphotos .pick { cursor: default; }
.rphotos .pick .x { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgb(0 0 0 / .6); color: #fff; cursor: pointer; line-height: 20px; padding: 0; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }

