/* ═══════════════════════════════════════════════════════════════════════════
   BURDOCK OS  ·  TERMINAL
   Green-phosphor text UI: monospace, panels with titles in the border,
   inverse-video selection, [x] toggles, block bars, scanlines.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  color-scheme: dark;
  --bg: #040604;
  --surface: #040604;          /* panels are "drawn" on the screen, not raised */
  --surface-2: #0d170e;        /* inputs, hover, tooltips */
  --surface-3: #16291a;
  --line: rgba(110, 255, 140, .28);
  --line-2: rgba(110, 255, 140, .50);
  --text: #dcfde1;
  --text-2: #a9e8b2;
  --muted: #7fbf88;
  --dim: #467d4e;
  --accent: #41e46e;
  --brand: #c77dff;            /* burdock flower purple – platform identity */
  --brand-soft: rgba(199,125,255,.12);
  --accent-2: #41e46e;
  --accent-ink: #021405;
  --accent-soft: rgba(65, 228, 110, .12);
  --good: #41e46e;
  --good-soft: rgba(65, 228, 110, .10);
  --bad: #ff6159;
  --bad-soft: rgba(255, 97, 89, .10);
  --warn: #ffbd2e;
  --warn-soft: rgba(255, 189, 46, .10);
  --amber: #ffb000;
  /* chart series (validated for colour-blind separation on this surface) */
  --s-rev: #23a84e;
  --s-card: #2f8fd0;
  --s-cash: #c98500;
  --s-prev: #3d5e42;
  --s-fc: #d55181;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
  --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767;
  --grid: rgba(110, 255, 140, .10);
  --font: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  --brand-font: "VT323", "IBM Plex Mono", ui-monospace, monospace;
  --nav-h: 58px;
  --topbar-h: 50px;          /* real sticky-header height; everything sticky hangs off this */
  --status-h: 26px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }   /* no double-tap zoom */
/* phones: the keyboard is open → the bottom bar steps aside (it would float in the middle otherwise) */
body.kb-open .bottom-nav { display: none !important; }
@media (max-width: 760px) {
  input, textarea, select { font-size: 16px !important; }       /* under 16 px an iPhone zooms in when you tap a field */
}
body {
  font-family: var(--font); color: var(--text); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; min-height: 100vh; letter-spacing: 0;
}
/* CRT: scanlines + soft vignette (pure decoration, never blocks clicks) */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 65;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.10) 0 1px, transparent 1px 4px);
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 64;
  background: radial-gradient(ellipse at center, transparent 70%, rgba(0,0,0,.35) 100%);
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; }
input, select, textarea { caret-color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.strong { font-weight: 700; }
::selection { background: var(--accent); color: var(--accent-ink); }
* { scrollbar-width: thin; scrollbar-color: var(--dim) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--dim); }
::-webkit-scrollbar-track { background: transparent; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }

/* ── Shell ─────────────────────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px dashed var(--line-2); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--brand); color: var(--brand);
  font-family: var(--brand-font); font-size: 1.6rem; line-height: 1;
}
.brand-name { color: var(--brand); font-family: var(--brand-font); font-size: 2rem; letter-spacing: 3px; text-transform: uppercase; line-height: 1; }
.tabs { display: flex; gap: 2px; margin-left: 10px; }
.tab {
  display: flex; align-items: center; gap: 7px; padding: 6px 12px; color: var(--text-2); font-weight: 600;
  font-size: .88rem; text-transform: uppercase; letter-spacing: .06em;
}
.tab .key { color: var(--muted); font-weight: 500; }
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.on { background: var(--accent); color: var(--accent-ink); }
.tab.on .key { color: var(--accent-ink); opacity: .7; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; color: var(--text-2); border: 1px solid var(--line);
}
.icon-btn:hover { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.spin svg { animation: spin 1s steps(8) infinite; }

.bottom-nav { display: none; }
main { max-width: 1240px; margin: 0 auto; padding: 22px 20px calc(60px + var(--status-h)); }
.page { display: none; animation: fade .25s steps(4); }
.page.on { display: block; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-family: var(--brand-font); font-weight: 400; font-size: 2.7rem; text-transform: uppercase; letter-spacing: 2px; line-height: .95; }
.page-title::before { content: var(--mod-path, "C:\\BURDOCK\\ARTCAFFE\\"); color: var(--muted); font-size: .7em; letter-spacing: 1px; }
.page-title::after { content: ">_"; color: var(--accent); animation: blink 1.05s steps(1) infinite; margin-left: 4px; }
.page-sub { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.page-sub::before { content: "// "; color: var(--dim); }

/* ── Panels: title sits in the top border, like a DOS/TUI window ───────── */
.grid { display: grid; gap: 22px 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.span2 { grid-column: span 2; }
.stack > * + * { margin-top: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--line-2); padding: 20px 18px 16px; min-width: 0; position: relative;
}
.card.flat { border-color: var(--line); }
.card-h { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; min-height: 6px; }
.card-t { font-size: .84rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.card-t .sub { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); margin-left: 4px; }
.card > .card-h > .card-t {
  position: absolute; top: -.8em; left: 12px; background: var(--bg); padding: 0 8px; max-width: calc(100% - 24px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card > .card-h > .card-t::before { content: "[ "; color: var(--muted); }
.card > .card-h > .card-t::after { content: " ]"; color: var(--muted); }
.card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.loading-dim { opacity: .45; pointer-events: none; }

/* ── KPI tiles ─────────────────────────────────────────────────────────── */
.kpi { display: flex; flex-direction: column; gap: 4px; padding-top: 18px; }
.kpi > .lbl {
  position: absolute; top: -.8em; left: 12px; background: var(--bg); padding: 0 8px;
  font-size: .8rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.kpi .val { font-family: var(--brand-font); font-size: 2.3rem; line-height: 1; letter-spacing: .5px; white-space: nowrap; }
.kpi .val small { font-family: var(--font); font-size: .86rem; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.kpi .foot { font-size: .86rem; color: var(--text-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hero { border: 3px double var(--accent); }
.hero > .lbl { color: var(--accent); }
.hero .val { font-size: clamp(3rem, 5.4vw, 5.4rem); color: var(--accent); margin: 4px 0 6px; overflow: hidden; }
.dot { width: 8px; height: 8px; display: inline-block; flex: none; }

.delta {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; font-size: .82rem; font-weight: 700; white-space: nowrap;
  border: 1px solid currentColor; font-variant-numeric: tabular-nums;
}
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--muted); }
.delta .lbl2 { font-weight: 500; opacity: .85; }
.kpi .foot .delta { white-space: normal; display: inline-block; }
.grid.g4 .kpi .val { font-size: clamp(1.4rem, 2.2vw, 2.3rem); overflow: hidden; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Controls ──────────────────────────────────────────────────────────── */
.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button { padding: 5px 11px; font-size: .84rem; font-weight: 600; color: var(--text-2); white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--text); background: var(--surface-2); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg.sm button { padding: 3px 8px; font-size: .8rem; }
.toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line);
  font-size: .82rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em;
}
.toggle::before { content: "[ ]"; color: var(--muted); }
.toggle.on::before { content: "[x]"; color: var(--accent); }
.toggle:hover { border-color: var(--line-2); color: var(--text); }
.toggle.on { color: var(--text); border-color: var(--line-2); }
.toggle .sw { width: 12px; height: 3px; order: 2; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px;
  font-weight: 700; font-size: .86rem; border: 1px solid var(--line-2); text-transform: uppercase; letter-spacing: .06em; color: var(--text);
}
.btn:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary::before { content: "["; }
.btn.primary::after { content: "]"; }
.btn.primary:hover { background: var(--text); border-color: var(--text); }
.btn.ghost { border-color: transparent; color: var(--text-2); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #140202; border-color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: .8rem; }
.btn svg { width: 14px; height: 14px; }
.input, select.input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line); padding: 8px 12px; outline: none;
}
.input::placeholder { color: var(--dim); }
.input:focus { border-color: var(--accent); }
select.input { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2358945f' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
select.input option { background: #0b120b; }
input[type=date].input::-webkit-calendar-picker-indicator { filter: invert(70%) sepia(60%) saturate(500%) hue-rotate(80deg); }
.search { position: relative; }
.search svg { z-index: 2; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search .input { padding-left: 34px; }
label.field { display: block; }
label.field > span:not(.tcaret-wrap) { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
label.field > span:not(.tcaret-wrap)::before { content: "> "; color: var(--accent); }

/* ── Period bar ────────────────────────────────────────────────────────── */
.period-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 24px;
  position: sticky; top: var(--topbar-h); z-index: 30; padding: 10px 0; background: var(--bg); border-bottom: 1px dashed var(--line);
}
.period-bar > .seg, .chart-controls .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.period-bar > .seg::-webkit-scrollbar { display: none; }
.period-nav { display: inline-flex; align-items: center; border: 1px solid var(--line); }
.period-nav button { width: 30px; height: 28px; display: grid; place-items: center; color: var(--text-2); }
.period-nav button:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
.period-nav button:disabled { opacity: .25; cursor: default; }
.period-nav button svg { width: 14px; height: 14px; }
.period-nav .plabel { min-width: 170px; text-align: center; font-weight: 700; font-size: .86rem; padding: 0 8px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.custom-range { display: inline-flex; gap: 6px; align-items: center; }
.custom-range .input { width: auto; padding: 4px 8px; font-size: .86rem; }

/* ── Charts ────────────────────────────────────────────────────────────── */
.chart-box { position: relative; height: 290px; }
.chart-box.tall { height: 360px; }
.chart-box.short { height: 190px; }
.chart-box.mini { height: 120px; }
.chart-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chart-controls .sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .84rem; color: var(--text-2); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; display: inline-block; }
.legend i.box { height: 10px; width: 10px; }

/* ── Tables ────────────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700;
  padding: 7px 10px; border-bottom: 1px dashed var(--line-2); white-space: nowrap; position: sticky; top: 0; background: var(--bg); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid rgba(110,255,140,.12); font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .r { text-align: right; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.click:hover { background: var(--accent); color: var(--accent-ink); }
.tbl tbody tr.click:hover * { color: var(--accent-ink) !important; }
.tbl .strong { font-weight: 700; }

/* ── Lists ─────────────────────────────────────────────────────────────── */
.rowlist > .row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid rgba(110,255,140,.12); }
.rowlist > .row:last-child { border-bottom: none; }
.rowlist > .row[style*="cursor"]:hover { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: .82rem; color: var(--muted); }
.row .val { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 0 6px; border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }

/* block bars: █████░░░ */
.barlist { display: flex; flex-direction: column; gap: 11px; }
.barlist .bl-row { display: grid; grid-template-columns: minmax(120px, 1.3fr) 2fr auto; gap: 12px; align-items: center; }
.barlist .bl-row.click { cursor: pointer; }
.barlist .bl-row.click:hover .bl-name { color: var(--accent); }
.barlist .bl-row.click:hover .bl-name::before { content: "> "; }
.bl-name { font-size: .88rem; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-name small { display: block; font-size: .8rem; color: var(--muted); font-weight: 500; }
.bl-track {
  height: 12px; position: relative;
  background: repeating-linear-gradient(90deg, var(--surface-3) 0 9px, transparent 9px 11px);
}
.bl-fill, .progress > div {
  height: 100%; transition: width .5s steps(12);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 11px);
          mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 11px);
}
.bl-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); }
.bl-val { font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; text-align: right; min-width: 72px; }
.bl-val small { display: block; font-weight: 700; font-size: .8rem; }

.progress { height: 14px; background: repeating-linear-gradient(90deg, var(--surface-3) 0 9px, transparent 9px 11px); }
.progress > div { background: var(--accent); }

/* forecast strip */
.fc-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.fc-day { border: 1px solid var(--line); padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 3px; align-items: center; }
.fc-day.today { border: 3px double var(--accent); }
.fc-day .d { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.fc-day.today .d { color: var(--accent); }
.fc-day .e { font-size: 1.3rem; line-height: 1.2; }
.fc-day .t { font-size: .8rem; color: var(--text-2); }
.fc-day .v { font-family: var(--brand-font); font-size: 1.5rem; line-height: 1; }
.fc-day .k { margin-top: 3px; font-size: .74rem; padding: 1px 6px; border: 1px solid var(--line-2); color: var(--muted); font-weight: 700; text-transform: uppercase; }
.fc-day .k::before { content: "[ ] "; }
.fc-day .k.on { color: var(--accent); border-color: var(--accent); }
.fc-day .k.on::before { content: "[x] "; }

/* calendar heatmap */
.cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 20px; }
.cal-m h4 { font-size: .82rem; font-weight: 700; margin-bottom: 8px; color: var(--text); display: flex; justify-content: space-between; text-transform: uppercase; letter-spacing: .06em; }
.cal-m h4 span { color: var(--muted); font-weight: 600; }
.cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-g .wd { font-size: .74rem; color: var(--muted); text-align: center; font-weight: 700; }
.cal-c { aspect-ratio: 1; font-size: .76rem; display: grid; place-items: center; color: var(--text-2); background: var(--surface-2); cursor: pointer; font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.cal-c.empty { background: transparent; cursor: default; }
.cal-c.nodata { opacity: .4; cursor: default; }
.cal-c:hover:not(.empty):not(.nodata) { border-color: var(--text); }
.cal-c.today { border-color: var(--accent); }
.cal-scale { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin-top: 12px; }
.cal-scale i { width: 16px; height: 10px; display: inline-block; }

/* sparkline */
svg.spark { width: 84px; height: 24px; display: block; }
svg.spark path.l { fill: none; stroke: var(--text-2); stroke-width: 1.4; stroke-linejoin: miter; }
svg.spark path.a { fill: var(--accent); opacity: .08; }
svg.spark circle { fill: var(--accent); }

/* item rows */
.item-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 90px 90px 110px 84px; gap: 12px; align-items: center; padding: 8px; border-bottom: 1px solid rgba(110,255,140,.12); cursor: pointer; }
.item-row:hover { background: var(--surface-2); }
.item-row:hover .nm::before { content: "> "; color: var(--accent); }
.item-row:last-child { border-bottom: none; }
.item-row .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-row .ct { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.item-row .q, .item-row .rv { text-align: right; font-variant-numeric: tabular-nums; }
.item-row .rv { font-weight: 700; }
.item-row .dl { text-align: right; }
.item-head { display: grid; grid-template-columns: 30px minmax(0, 1fr) 90px 90px 110px 84px; gap: 12px; padding: 0 8px 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; border-bottom: 1px dashed var(--line-2); }
.item-head .r { text-align: right; }
.item-head button { text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--muted); font-size: .78rem; }
.item-head button.on { color: var(--accent); }
.item-head button.on::after { content: " ▼"; }
.chk { font-size: .86rem; color: var(--muted); width: 28px; display: inline-block; text-align: left; flex: none; }
.chk::before { content: "[ ]"; }
.chk.on { color: var(--accent); }
.chk.on::before { content: "[x]"; }
.chk svg { display: none; }

/* ── Dialogs ───────────────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(2, 5, 2, .82); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .12s steps(3); }
.sheet { background: var(--bg); border: 3px double var(--accent); width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.sheet.wide { width: min(1100px, 100%); }
.sheet.narrow { width: min(460px, 100%); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; position: sticky; top: 0; background: var(--accent); color: var(--accent-ink); z-index: 2; }
.sheet-h h3 { font-size: .92rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.sheet-h .sub { font-size: .84rem; opacity: .75; }
.sheet-h .icon-btn { color: var(--accent-ink); border-color: var(--accent-ink); }
.sheet-h .icon-btn:hover { background: var(--accent-ink); color: var(--accent); }
.sheet-b { padding: 24px 18px 18px; }
.sheet-f { display: flex; gap: 8px; justify-content: flex-end; padding: 0 18px 18px; }

.fullscreen { position: fixed; inset: 0; z-index: 300; background: var(--bg); display: flex; flex-direction: column; padding: 14px 18px; }
.fullscreen .fs-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; text-transform: uppercase; letter-spacing: .06em; }
.fullscreen .fs-body { flex: 1; position: relative; min-height: 0; }

.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); padding: 10px 16px; font-weight: 700; font-size: .9rem; z-index: 1200; max-width: calc(100% - 32px); text-align: center; text-transform: uppercase; letter-spacing: .05em; }
.toast::before { content: "» "; }
.toast.err { background: var(--bad); color: #160202; }
.toast.err::before { content: "[ERR] "; }

.menu-list { display: flex; flex-direction: column; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 12px; padding: 11px 12px; text-decoration: none; font-weight: 700; text-align: left; width: 100%; text-transform: uppercase; letter-spacing: .06em; font-size: .88rem; }
.menu-list a:hover, .menu-list button:hover { background: var(--accent); color: var(--accent-ink); }
.menu-list a:hover svg, .menu-list button:hover svg { color: var(--accent-ink); }
.menu-list svg { width: 18px; height: 18px; color: var(--muted); }
.menu-list .key { margin-left: auto; color: var(--muted); font-weight: 500; }

.empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: .92rem; }
.empty::before { content: "-- "; } .empty::after { content: " --"; }
.err-box { border: 1px solid var(--bad); color: var(--bad); padding: 12px 14px; font-size: .9rem; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.err-box::before { content: "[ERR]"; font-weight: 700; }
.skeleton { background: transparent !important; border: 1px dashed var(--line) !important; color: transparent !important; position: relative; overflow: hidden; min-height: 40px; }
.skeleton::after { content: "LOADING ▌"; position: absolute; left: 14px; top: 12px; color: var(--muted); font-size: .86rem; letter-spacing: .06em; animation: blink 1s steps(1) infinite; }
.muted { color: var(--muted); }
.t2 { color: var(--text-2); }
.small { font-size: .86rem; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 22px; }

/* ── Status line (desktop) ─────────────────────────────────────────────── */
.statusbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--status-h); z-index: 60; background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; overflow: hidden;
}
.statusbar > span { padding: 0 12px; border-right: 1px solid rgba(2,20,5,.35); white-space: nowrap; height: 100%; display: flex; align-items: center; }
.statusbar .grow { flex: 1; border-right: none; }
.statusbar .blip { animation: blink 1s steps(1) infinite; }

/* ── Boot screen ───────────────────────────────────────────────────────── */
.boot { position: fixed; inset: 0; z-index: 2000; background: var(--bg); padding: 28px; font-size: .88rem; color: var(--text); cursor: pointer; overflow: hidden; }
.boot pre { font-family: var(--font); color: var(--accent); font-size: clamp(.45rem, 1.6vw, .95rem); line-height: 1.1; margin-bottom: 18px; }
.boot .ln { white-space: pre-wrap; }
.boot .ok { color: var(--accent); }
.boot .hint { color: var(--muted); margin-top: 18px; font-size: .84rem; }
.boot .cursor { animation: blink 1s steps(1) infinite; color: var(--accent); }

/* ── Schedule (Raspored) ───────────────────────────────────────────────── */
.sched-tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.sched-tbl th { padding: 8px 6px; text-align: center; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px dashed var(--line-2); white-space: nowrap; font-weight: 700; }
.sched-tbl th.left, .sched-tbl td.left { text-align: left; padding-left: 10px; }
.sched-tbl td { padding: 5px 4px; text-align: center; border-bottom: 1px solid rgba(110,255,140,.12); }
.sched-tbl td.name { font-weight: 700; white-space: nowrap; text-align: left; padding-left: 10px; }
.shift { display: inline-block; padding: 3px 7px; font-size: .84rem; font-weight: 700; min-width: 50px; text-align: center; font-variant-numeric: tabular-nums; border: 1px solid currentColor; }
.sh-m { color: var(--accent); }
.sh-e { color: var(--c7); }
.sh-sl { color: var(--dim); border-color: transparent; }
.sh-rd { color: var(--bad); }
.sh-sd { color: var(--c1); }
.sh-cx { color: var(--amber); }
.cov-row td { background: var(--surface-2); }
.cov-lbl { font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; text-align: left !important; padding-left: 10px !important; }
.cov { display: inline-block; padding: 2px 9px; font-size: .82rem; font-weight: 700; }
.pref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.pref-card { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 6px 8px; }
.pref-card .nm { font-weight: 700; flex: 1; font-size: .9rem; }
.pref-card select { width: auto; padding: 4px 26px 4px 8px; font-size: .84rem; }
.hol { width: 34px; height: 30px; border: 1px solid var(--line); display: grid; place-items: center; opacity: .35; }
.hol.on { opacity: 1; border-color: var(--amber); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g3 { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
}
@media (max-width: 760px) {
  body { font-size: 13px; --topbar-h: 48px; }
  .toast { bottom: calc(var(--nav-h) + var(--safe-b) + 14px); }
  .tabs, .statusbar { display: none; }
  .topbar-in { padding: 8px 14px; }
  .brand-name { font-size: 1.7rem; }
  main { padding: 16px 12px calc(var(--nav-h) + 30px + var(--safe-b)); }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px 12px 12px; }
  .page-title { font-size: 2.1rem; }
  .page-title::before { content: "C:\\"; }
  .bottom-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0;
    height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); z-index: 60;
    background: var(--bg); border-top: 3px double var(--accent);
  }
  .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .74rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
  .bottom-nav button svg { width: 20px; height: 20px; }
  .bottom-nav button.on { background: var(--accent); color: var(--accent-ink); }
  .bottom-nav button { min-width: 0; padding: 0 2px; }
  .bottom-nav button span, .bottom-nav button { overflow: hidden; }
  /* 6 items (owner): keep labels legible by letting them wrap instead of shrinking to 0.6rem */
  .bottom-nav:has(> button:nth-child(6)) { font-size: .66rem; }
  .bottom-nav:has(> button:nth-child(6)) button { letter-spacing: 0; line-height: 1.02; white-space: normal; }
  .period-nav .plabel { min-width: 130px; }
  .item-row, .item-head { grid-template-columns: 28px minmax(0, 1fr) 70px 70px; gap: 8px; }
  .item-row .sp, .item-head .sp, .item-row .q, .item-head .q { display: none; }
  .fc-strip { grid-template-columns: repeat(7, minmax(70px, 1fr)); overflow-x: auto; }
  .chart-box { height: 240px; }
  .sheet { max-height: 94vh; width: 100% !important; align-self: flex-end; border-left: none; border-right: none; border-bottom: none; }
  .scrim { padding: 0; align-items: flex-end; }
  .barlist .bl-row { grid-template-columns: minmax(80px, 1fr) 1.3fr auto; gap: 8px; }
  .kpi .val { font-size: 2rem; }
  .hero .val { font-size: 3.6rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── BURDOCK platform shell ───────────────────────────────────────────── */
.crumb { font-family: var(--brand-font); font-size: 1.6rem; line-height: 1; color: var(--accent); text-decoration: none; letter-spacing: 1px; white-space: nowrap; }
.crumb:hover { color: var(--text); }
.boot pre.brand-logo { color: var(--brand); }
.statusbar .sb-brand { background: var(--brand); color: #12031f; font-weight: 700; }
.menu-sep { padding: 12px 12px 4px; color: var(--dim); font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; }
.menu-sep::before { content: "── "; }
.menu-list a.on { background: var(--accent-soft); }
.menu-list a.on::after { content: "◄"; color: var(--accent); margin-left: 8px; }

/* hub (home screen) */
.hub-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end; margin-bottom: 26px; }
.hub-logo { color: var(--brand); font-family: var(--font); font-size: clamp(.36rem, 1.55vw, .92rem); line-height: 1.08; overflow: hidden; white-space: pre; }
.hub-tag { color: var(--muted); font-size: .86rem; margin-top: 10px; letter-spacing: .04em; }
.hub-tag b { color: var(--brand); font-weight: 600; }
.hub-clock { text-align: right; }
.hub-clock .t { font-family: var(--brand-font); font-size: 3.4rem; line-height: .9; color: var(--text); }
.hub-clock .d { color: var(--muted); font-size: .84rem; text-transform: uppercase; letter-spacing: .08em; }
.hub-prompt { color: var(--text-2); margin-bottom: 22px; font-size: .95rem; }
.hub-prompt .p { color: var(--accent); font-weight: 700; }
.hub-prompt .cursor { color: var(--accent); animation: blink 1s steps(1) infinite; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mod { position: relative; border: 1px solid var(--line-2); padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.mod.live { border: 3px double var(--accent); }
.mod.live:hover { background: var(--surface-2); }
.mod .slot { position: absolute; top: -10px; left: 12px; background: var(--bg); padding: 0 6px; color: var(--muted); font-size: .76rem; letter-spacing: .1em; }
.mod .mhead { display: flex; align-items: center; gap: 10px; }
.mod .mhead svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.mod .mname { font-family: var(--brand-font); font-size: 2.1rem; line-height: .9; text-transform: uppercase; letter-spacing: 1px; }
.mod .mstat { margin-left: auto; font-size: .74rem; font-weight: 700; letter-spacing: .1em; color: var(--accent); white-space: nowrap; }
.mod .mstat::before { content: "● "; animation: blink 1.4s steps(1) infinite; }
.mod .mtag { color: var(--muted); font-size: .82rem; }
.mod .kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; }
.mod .kv .k { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.mod .kv .v { font-weight: 700; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod .links { display: flex; flex-wrap: wrap; gap: 6px; }
.mod .links a { border: 1px solid var(--line); padding: 3px 8px; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); text-decoration: none; }
.mod .links a:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.mod.free { border-style: dashed; border-color: var(--line); color: var(--dim); justify-content: center; align-items: center; min-height: 170px; text-align: center; }
.mod.free .big { font-family: var(--brand-font); font-size: 2rem; color: var(--dim); }
.mod.free .small { font-size: .78rem; letter-spacing: .06em; }
.hub-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; margin-top: 26px; }
.syslist { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px 14px; font-size: .86rem; align-items: baseline; }
.syslist .k { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }
.syslist .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.syslist .s { font-weight: 700; font-size: .78rem; }
.syslist .s.ok { color: var(--good); } .syslist .s.warn { color: var(--warn); } .syslist .s.bad { color: var(--bad); }
.logbox { font-size: .76rem; color: var(--text-2); white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow: auto; line-height: 1.5; }
.logbox .w { color: var(--warn); } .logbox .e { color: var(--bad); }
@media (max-width: 760px) {
  .hub-hero { grid-template-columns: minmax(0, 1fr); }
  .hub-clock { text-align: left; }
  .hub-cols { grid-template-columns: minmax(0, 1fr); }
  .crumb { font-size: 1.35rem; }
}
@media (min-width: 900px) { .mod.live { grid-column: span 2; } }
.mod .mhead { flex-wrap: wrap; }
.mod .kv .k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .mod.free { min-height: 84px; flex-direction: row; gap: 12px; } .mod.free .small + .small { display: none; } }
@media (max-width: 760px) {
  .topbar-in { gap: 10px; }
  .brand-name { font-size: 1.55rem; letter-spacing: 2px; }
  .crumb { font-size: 1.25rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

/* ── module 02 · HUB ───────────────────────────────────────────────────── */
body[data-mod="hub"] .page-title::before { content: "C:\\BURDOCK\\HUB\\"; }
@media (max-width: 760px) { body[data-mod="hub"] .page-title::before { content: "C:\\"; } }
.mt8 { margin-top: 8px; }
.mono { font-family: var(--font); }
.hub-proj { min-width: 220px; }
.hub-proj select { min-width: 0; }
.hb { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; font-weight: 700; border: 1px solid currentColor; font-size: .9rem; }
.hb-A, .c-A { color: var(--good); } .hb-M, .c-M { color: var(--warn); } .hb-D, .c-D { color: var(--bad); }
.hb-ok { color: var(--good); width: 30px; height: 30px; }
.vc { font-size: .8rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vk { font-size: .68rem; font-weight: 700; letter-spacing: .08em; padding: 1px 5px; border: 1px solid var(--line-2); color: var(--muted); }
.vk-manual { color: var(--accent); border-color: var(--accent); }
.vk-restore { color: var(--brand); border-color: var(--brand); }
.vk-safety { color: var(--warn); border-color: var(--warn); }
.vlabel { margin-left: 8px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; background: var(--brand); color: #12031f; padding: 1px 6px; text-transform: uppercase; }
.vmeta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: .84rem; color: var(--text-2); }
.vlist { display: flex; flex-direction: column; }
.vrow { display: flex; align-items: center; gap: 14px; padding: 10px 6px; border-bottom: 1px solid rgba(110,255,140,.12); cursor: pointer; position: relative; }
.vrow:last-child { border-bottom: none; }
.vrow:hover { background: var(--surface-2); }
.vrow .grow { flex: 1; min-width: 0; }
.vrow .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vrow .meta { font-size: .8rem; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.vnum { font-family: var(--brand-font); font-size: 1.9rem; line-height: 1; color: var(--accent); min-width: 58px; }
.vnum.sm { font-size: 1.4rem; min-width: 44px; }
.ok-line { display: flex; gap: 14px; align-items: center; }
.save-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.save-row .btn { height: 42px; }
.sheet-f.wrap { flex-wrap: wrap; justify-content: flex-start; padding-top: 14px; border-top: 1px dashed var(--line); margin-top: 6px; }

.files-grid { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 14px; align-items: start; }
.tree { max-height: 70vh; overflow: auto; margin-top: 10px; font-size: .86rem; }
.tn { display: flex; align-items: center; gap: 6px; padding: 4px 6px; cursor: pointer; white-space: nowrap; }
.tn:hover { background: var(--surface-2); }
.tn.on { background: var(--accent); color: var(--accent-ink); }
.tn.on svg, .tn.on .tsz { color: var(--accent-ink); }
.tn svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.tn.dir { color: var(--text-2); font-weight: 600; }
.tn .grow { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tw { width: 12px; color: var(--muted); flex: none; }
.tsz { margin-left: auto; color: var(--dim); font-size: .74rem; padding-left: 8px; }
.fview { min-height: 300px; }
.fbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.fbar .grow { flex: 1; }
.code, .diff { font-size: .8rem; line-height: 1.5; overflow: auto; max-height: 72vh; border: 1px solid var(--line); background: #020402; }
.cl, .dl { display: flex; min-width: max-content; }
.cl .na, .dl .na, .dl .nb { flex: none; width: 46px; text-align: right; padding-right: 10px; color: var(--dim); user-select: none; border-right: 1px solid var(--line); }
.dl .nb { margin-right: 0; }
.cl code, .dl code { white-space: pre; padding-left: 10px; font-family: var(--font); color: var(--text); }
.dl.d-add { background: rgba(65, 228, 110, .13); } .dl.d-add code { color: #b8ffc9; }
.dl.d-del { background: rgba(255, 97, 89, .13); } .dl.d-del code { color: #ffc2bd; }
.dl.d-at { background: var(--surface-2); } .dl.d-at code { color: var(--muted); }
.cmp-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.cmp-bar label.field { flex: 1 1 220px; min-width: 0; }
.cmp-bar .btn { height: 42px; }
.acc-h { cursor: pointer; }
.acc-h:hover { background: var(--surface-2); }
.acc-h.open .tw { transform: rotate(90deg); display: inline-block; }
.acc-b { display: none; margin: 4px 0 12px; }
.acc-b.on { display: block; }
@media (max-width: 760px) {
  .files-grid { grid-template-columns: minmax(0, 1fr); }
  .tree { max-height: 45vh; }
  .hub-proj { min-width: 0; width: 100%; }
  .vnum { font-size: 1.5rem; min-width: 44px; }
  .cl .na, .dl .na, .dl .nb { width: 34px; padding-right: 6px; }
}
body[data-mod="hub"] .sheet-h h3 { text-transform: none; letter-spacing: 0; }
.acc-h { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid rgba(110,255,140,.12); }
.acc-h .grow { flex: 1; min-width: 0; }
.acc-h .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* comparison bars: colour = which day, faded = whole day */
.barlist .bl-row.full .bl-fill { opacity: .45; }
.barlist .bl-row.full .bl-name small { opacity: .85; }
.bl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 16px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .76rem; color: var(--muted); }
.bl-key { display: inline-flex; align-items: center; gap: 6px; }
.bl-key i { width: 10px; height: 10px; display: inline-block; }
.bl-note { flex-basis: 100%; color: var(--muted); }

/* ── keyboard navigation (arrows + Space) ──────────────────────────────── */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input:focus-visible, select.input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.btn:focus-visible, .tab:focus-visible, .seg button:focus-visible, .icon-btn:focus-visible,
.menu-list a:focus-visible, .bottom-nav button:focus-visible, .mod .links a:focus-visible {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent); outline: 2px solid var(--text); outline-offset: 1px;
}
.btn:focus-visible svg, .tab:focus-visible svg, .icon-btn:focus-visible svg, .menu-list a:focus-visible svg { color: var(--accent-ink); }
.btn.danger:focus-visible { background: var(--bad); border-color: var(--bad); color: #140202; }
.clk:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--accent-soft); }
.rowlist > .row.clk:focus-visible .name::before, .vrow:focus-visible .name::before, .acc-h:focus-visible .name::before,
.bl-row.clk:focus-visible .bl-name::before { content: "▶ "; color: var(--accent); }
.brand:focus-visible, .crumb:focus-visible { outline-offset: 4px; }
/* module tiles on the home screen */
.mod.live:focus-visible { outline: none; border-color: var(--brand); background: var(--brand-soft); }
.mod.live:focus-visible .slot { background: var(--brand); color: #12031f; }
.mod.live:focus-visible .mname::after { content: " ◄"; color: var(--brand); animation: blink 1s steps(1) infinite; }
.kbd-hint { margin-top: 8px; font-size: .78rem; color: var(--muted); }
.kbd-hint b { color: var(--text-2); font-weight: 600; }
.statusbar .sb-keys { opacity: .8; font-size: .9em; }
@media (hover: none) { .kbd-hint { display: none; } }
.mod .mstat.off { color: var(--bad); }

/* home: log in plain words (explain.py); click = technical details */
.lg { padding: 8px 6px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.lg:last-child { border-bottom: none; }
.lg:hover { background: var(--surface-2); }
.lg-top { display: flex; gap: 10px; align-items: center; font-size: .72rem; }
.lg-t { color: var(--muted); }
.lg-b { font-weight: 700; letter-spacing: .08em; padding: 0 5px; }
.lg-warn .lg-b { background: var(--warn); color: #1a1200; }
.lg-error .lg-b { background: var(--bad); color: #140202; }
.lg-info .lg-b { background: var(--line-2); color: var(--bg); }
.lg-n { color: var(--muted); }
.lg-txt { margin-top: 4px; font-size: .86rem; color: var(--text); white-space: normal; word-break: normal; }
.lg-hint { margin-top: 2px; font-size: .78rem; color: var(--muted); white-space: normal; word-break: normal; }
.lg-raw { display: none; margin-top: 6px; font-size: .72rem; color: var(--dim); word-break: break-all; }
.lg.open .lg-raw { display: block; }
.logbox { max-height: 320px; }

/* versions: vMAIN.STEP – main versions stand out */
.vmajor { display: flex; align-items: baseline; gap: 12px; margin: 14px 0 4px; padding-bottom: 4px; border-bottom: 1px solid var(--brand); }
.vmajor:first-child { margin-top: 0; }
.vmajor span:first-child { font-family: var(--brand-font); font-size: 1.7rem; line-height: 1; color: var(--brand); }
.vmajor-sub { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.vnum { min-width: 70px; }
.vnum.major { color: var(--brand); }
.vrow.is-major .name { color: var(--brand); }
.seg.ver-kind button.on { background: var(--brand); color: #12031f; }
.seg.ver-kind button { text-transform: none; letter-spacing: .02em; }
.chart-note { margin-top: 10px; font-size: .84rem; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.chart-note:empty { display: none; }
.chart-note .warn-t { color: var(--warn); }

/* ── the pet (pet.js) – sizes and position are set by pet.js ─────────── */
.pet { position: absolute; left: 0; top: 0; z-index: 45; pointer-events: none; will-change: transform; }
.pet.fixed { position: fixed; }
.pet canvas { width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; display: block; pointer-events: none;
  filter: drop-shadow(0 0 3px rgba(199, 125, 255, .55)) drop-shadow(0 0 10px rgba(93, 255, 138, .18)); }
.pet-hit { position: absolute; pointer-events: auto; cursor: grab; touch-action: none; border-radius: 45% 45% 20% 20%; }
body.pet-dragging, body.pet-dragging * { cursor: grabbing !important; user-select: none !important; }
.pet-say { position: absolute; left: 50%; transform: translateX(-50%); font-family: var(--brand-font); font-size: 1.3rem; line-height: 1;
  color: var(--text); background: var(--bg); border: 2px solid var(--brand); padding: 2px 7px 1px; white-space: nowrap; opacity: 0;
  transition: opacity .15s steps(2); pointer-events: none; box-shadow: 3px 3px 0 rgba(199, 125, 255, .35); }
.pet-say::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 6px; height: 6px; background: var(--bg);
  border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: translateX(-50%) rotate(45deg); }
.pet-say.on { opacity: 1; }
@media print { .pet { display: none; } }
.cal-c.empty { padding: 0; } .cal-c.empty::before, .cal-c.empty::after { content: none; }
.seg.ver-kind { display: flex; flex-wrap: wrap; max-width: 100%; } .seg.ver-kind button { white-space: normal; text-align: left; }

/* ── module 03 · Kalkulacije ───────────────────────────────────────────── */
body[data-mod="calc"] .page-title::before { content: "C:\\BURDOCK\\KALKULACIJE\\"; }
body[data-mod="admin"] .page-title::before { content: "C:\\BURDOCK\\KORISNICI\\"; }
@media (max-width: 760px) { body[data-mod="calc"] .page-title::before, body[data-mod="admin"] .page-title::before { content: "C:\\"; } }
.calc-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.calc-card { border: 1px solid var(--line-2); padding: 12px 14px; cursor: pointer; }
.calc-card:hover { background: var(--surface-2); }
.calc-card.on { border: 3px double var(--accent); }
.calc-card.bad { border-color: var(--bad); }
.calc-name { font-weight: 700; margin-bottom: 4px; }
.calc-steps { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; border: 1px dashed var(--line); padding: 12px; }
.step .grow { flex: 1; min-width: 0; }
.step-n { font-family: var(--brand-font); font-size: 2rem; line-height: .8; color: var(--brand); }
.drop { margin-top: 8px; border: 2px dashed var(--line-2); padding: 18px 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--muted); min-width: 0; }
.drop svg { width: 18px; height: 18px; transform: rotate(180deg); flex: none; }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.drop.has { border-style: solid; border-color: var(--accent); color: var(--text); }
.drop-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-err { border: 1px solid var(--bad); padding: 12px 14px; }
.calc-err .strong { color: var(--bad); }
.calc-err ul { margin: 8px 0 8px 18px; font-size: .88rem; }
.calc-err li { margin: 3px 0; }
.calc-ok { border: 3px double var(--accent); padding: 12px 14px; }
.calc-ok > .strong { color: var(--accent); }
.kvs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; margin-top: 10px; }
.kvs .k { display: block; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kvs .v { font-size: 1.15rem; font-weight: 700; }
@media (max-width: 760px) { .calc-steps { grid-template-columns: minmax(0, 1fr); } }

/* ── Korisnici ─────────────────────────────────────────────────────────── */
.user-row { align-items: flex-start !important; }
.user-state { margin-left: 10px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; border: 1px solid; padding: 0 5px; }
.user-scopes { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 4px; }
.chip-s { font-size: .74rem; border: 1px solid var(--line-2); padding: 1px 7px; color: var(--text-2); }
.lbl-like { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.lbl-like::before { content: "> "; color: var(--accent); }
.access { display: flex; flex-direction: column; gap: 10px; }
.access-mod { border: 1px dashed var(--line); padding: 10px; }
.access-parts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 18px; }
.access-parts .toggle:disabled { opacity: .55; }
.pw-show { font-family: var(--font); font-size: 1.5rem; font-weight: 700; color: var(--accent); border: 3px double var(--accent); padding: 12px; text-align: center; letter-spacing: 1px; margin-top: 12px; user-select: all; word-break: break-all; }
.audit-t { font-size: .78rem; color: var(--muted); min-width: 92px; }
.audit-a { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; min-width: 130px; }
.audit-ok .audit-a { color: var(--good); } .audit-warn .audit-a { color: var(--warn); } .audit-bad .audit-a { color: var(--bad); }
@media (max-width: 760px) { .audit-a { min-width: 0; } .audit-t { min-width: 0; } .rowlist > .row.audit-ok, .rowlist > .row.audit-bad, .rowlist > .row.audit-warn, .rowlist > .row.audit-x { flex-wrap: wrap; } }
.calc-rules { margin: 8px 0 0 20px; font-size: .9rem; line-height: 1.6; } .calc-rules li::marker { color: var(--brand); }

/* ── Kalkulacije: drawing of the required Excel layout ───────────────── */
.xl-scroll { overflow-x: auto; margin-top: 8px; }
.xl { border-collapse: collapse; font-size: .82rem; min-width: 560px; }
.xl th, .xl td { border: 1px solid rgba(110, 255, 140, .18); padding: 5px 9px; white-space: nowrap; }
.xl .xl-corner { background: var(--surface-2); width: 30px; }
.xl .xl-col { background: var(--surface-2); color: var(--muted); font-weight: 700; text-align: center; min-width: 110px; }
.xl .xl-row { background: var(--surface-2); color: var(--muted); font-weight: 700; text-align: right; width: 30px; }
.xl .xl-grp { color: var(--brand); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; text-align: center; border-bottom: 2px solid var(--brand); }
.xl .xl-grp.none, .xl .xl-side-h, .xl .xl-side.none { border: none; background: transparent; }
.xl td.k-price { background: rgba(255, 189, 46, .22); color: #ffe7a8; font-weight: 700; }
.xl td.k-school { background: rgba(199, 125, 255, .20); color: #e8ccff; font-weight: 700; }
.xl td.k-kid { background: rgba(65, 228, 110, .10); color: var(--text); }
.xl td.k-km { background: rgba(57, 135, 229, .16); color: #bcd9ff; text-align: right; }
.xl td.k-last { background: rgba(57, 135, 229, .38); color: #fff; text-align: right; font-weight: 700; }
.xl td.k-empty { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(110, 255, 140, .07) 6px 12px); }
.xl td.k-dots { color: var(--dim); text-align: center; }
.xl .xl-side { border: none; border-left: 3px solid var(--accent); padding-left: 10px; vertical-align: middle; color: var(--accent); font-weight: 700; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }
.xl .xl-side.s-prazan { border-left-style: dashed; color: var(--muted); }
.xl .xl-side.s-cijena { border-left-color: var(--warn); color: var(--warn); }
.xl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: .78rem; color: var(--text-2); }
.xl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.xl-legend i { width: 14px; height: 12px; display: inline-block; border: 1px solid rgba(110, 255, 140, .25); }
.xl-legend i.k-price { background: rgba(255, 189, 46, .5); } .xl-legend i.k-school { background: rgba(199, 125, 255, .5); }
.xl-legend i.k-kid { background: rgba(65, 228, 110, .3); } .xl-legend i.k-km { background: rgba(57, 135, 229, .35); }
.xl-legend i.k-last { background: rgba(57, 135, 229, .8); } .xl-legend i.k-empty { background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(110, 255, 140, .3) 3px 6px); }
.xl-tips { margin: 10px 0 0 18px; font-size: .84rem; color: var(--text-2); line-height: 1.6; }

/* ── plain look (people with limited access) + the simple calculation page ── */
body.simple .page-title::before, body.simple .page-title::after { content: none; }
body.simple main { padding-bottom: 60px; }
.calc-simple { max-width: 760px; margin: 0 auto; }
.calc-title { font-family: var(--brand-font); font-weight: 400; font-size: 2.6rem; line-height: 1; margin: 6px 0 18px; }
.big-card { border: 1px solid var(--line-2); padding: 16px 18px; margin-bottom: 18px; }
.big-card.good { border: 3px double var(--accent); }
.big-card.bad { border: 2px solid var(--bad); }
.big-h { font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; }
.big-card.good .big-h { color: var(--accent); } .big-card.bad .big-h { color: var(--bad); }
.big-card p { margin-top: 8px; font-size: 1rem; }
.simple-list { margin: 0 0 0 20px; font-size: 1rem; line-height: 1.6; }
.big-num { font-family: var(--brand-font); font-size: 3rem; line-height: 1; color: var(--text); }
.big-num small { display: block; font-family: var(--font); font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.big-steps { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.big-btn { display: flex; align-items: center; gap: 16px; width: 100%; padding: 18px 20px; font-size: 1.15rem; font-weight: 700;
  border: 2px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer; text-align: left; }
.big-btn b { font-family: var(--brand-font); font-size: 2.2rem; line-height: .8; color: var(--brand); min-width: 26px; }
.big-btn:hover:not(:disabled), .big-btn:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.big-btn:disabled { opacity: .45; cursor: default; }
.big-btn.go:not(:disabled) { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.big-btn.go:not(:disabled) b { color: var(--accent-ink); }
.big-btn.drop { border-style: dashed; }
.big-btn.drop.has { border-style: solid; border-color: var(--accent); }
.big-btn.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.big-btn .drop-name { white-space: normal; }
.calc-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.calc-pick .calc-card { font-weight: 700; color: var(--text); background: transparent; }
.xl .xl-col small { display: block; font-weight: 500; font-size: .72rem; text-transform: lowercase; color: var(--text-2); }
.xl { min-width: 0; font-size: .95rem; }
.xl .xl-col { min-width: 120px; }
.xl-tips { margin-top: 12px; font-size: .95rem; color: var(--text); }
.xl-tips p { margin: 4px 0; }
.xl .xl-side span { display: inline-block; white-space: normal; min-width: 5.5em; }
@media (max-width: 520px) { .xl .xl-side { font-size: .66rem; letter-spacing: .03em; padding-left: 6px; } .xl .xl-side span { min-width: 4.5em; } }
@media (max-width: 520px) { .xl { min-width: 0; width: 100%; } .xl .xl-col { min-width: 0; } .xl th, .xl td { padding: 5px 6px; } .xl .xl-side span { min-width: 0; } .xl .xl-side { width: 5.2em; } }

/* ── module 04 · Assets ──────────────────────────────────────────────── */
.checker { background-color: #1a221b; background-image: linear-gradient(45deg, #111812 25%, transparent 25%, transparent 75%, #111812 75%), linear-gradient(45deg, #111812 25%, transparent 25%, transparent 75%, #111812 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.a-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.a-tools .a-seg { flex-wrap: wrap; }
.a-search { max-width: 220px; flex: 1 1 160px; }
.a-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.a-empty { grid-column: 1 / -1; text-align: center; padding: 32px 16px; }
.a-card { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; min-width: 0; }
.a-card:hover, .a-card:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 1px var(--accent); }
.a-card.is-new { border-color: var(--brand); }
.a-thumb { position: relative; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.a-thumb, .a-stage, .a-flip, .a-side figure, .a-diff canvas { background-color: #1a221b; background-image: linear-gradient(45deg, #111812 25%, transparent 25%, transparent 75%, #111812 75%), linear-gradient(45deg, #111812 25%, transparent 25%, transparent 75%, #111812 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.a-thumb img, .a-thumb video { width: 100%; height: 100%; object-fit: contain; }
img.px, canvas.px { image-rendering: pixelated; image-rendering: crisp-edges; }
.a-badge { position: absolute; top: 6px; left: 6px; background: var(--brand); color: #12001f; font-size: .66rem; font-weight: 700; letter-spacing: .1em; padding: 2px 6px; }
.a-meta { padding: 8px 10px 10px; border-top: 1px solid var(--line); min-width: 0; }
.a-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .74rem; color: var(--muted); margin-top: 4px; }
.a-sub svg { width: 12px; height: 12px; vertical-align: -2px; }
.a-st { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: .66rem; padding: 1px 5px; border: 1px solid currentColor; }
.a-st.st-wip { color: var(--warn); } .a-st.st-fix { color: var(--bad); } .a-st.st-ok { color: var(--good); }
.a-noprev { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-weight: 700; letter-spacing: .1em; min-height: 120px; width: 100%; }
.a-noprev small { font-weight: 400; letter-spacing: 0; font-size: .72rem; }
#page-galerija { position: relative; min-height: 60vh; }
#page-galerija.a-drop::after { content: 'Pustite datoteke ovdje'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border: 3px dashed var(--brand); background: rgba(199,125,255,.10); color: var(--brand); font-size: 1.3rem; font-weight: 700; z-index: 5; pointer-events: none; }

.a-view .a-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; }
.a-stage { display: flex; align-items: center; justify-content: center; min-height: 260px; max-height: 60vh; border: 1px solid var(--line); overflow: hidden; }
.a-stage img, .a-stage video { width: 100%; height: 100%; max-height: 60vh; object-fit: contain; }
.a-cap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .8rem; margin: 6px 0 10px; }
.a-files { display: flex; flex-direction: column; gap: 4px; }
.a-file { display: flex; align-items: center; gap: 8px; padding: 2px 4px; border: 1px solid transparent; }
.a-file.on { border-color: var(--line-2); background: var(--surface-2); }
.a-file-n { flex: 1; min-width: 0; text-align: left; background: none; border: none; color: var(--text); font: inherit; cursor: pointer; padding: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn.sm { width: 28px; height: 28px; } .icon-btn.sm svg { width: 15px; height: 15px; }
.a-h { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); margin: 18px 0 8px; }
.a-right .a-h:first-child { margin-top: 0; }
.a-status { flex-wrap: wrap; }
.a-comments { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow: auto; margin-bottom: 8px; }
.a-com { border-left: 2px solid var(--line-2); padding: 2px 0 2px 10px; font-size: .88rem; white-space: pre-wrap; word-break: break-word; }
.a-com-h { font-size: .74rem; margin-bottom: 2px; }
.a-com-in { width: 100%; resize: vertical; font: inherit; }
.a-cmp-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.a-cmp-bar .field { flex: 1 1 200px; }
.a-cmp-out { min-height: 60px; }
.a-side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.a-side figure { margin: 0; border: 1px solid var(--line); display: flex; flex-direction: column; }
.a-side img { width: 100%; max-height: 50vh; object-fit: contain; flex: 1; }
.a-side figcaption { font-size: .72rem; text-align: center; padding: 4px; color: var(--muted); background: var(--bg); border-top: 1px solid var(--line); }
.a-flip { position: relative; height: min(55vh, 520px); border: 1px solid var(--line); cursor: pointer; user-select: none; }
.a-flip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.a-flip-lab { position: absolute; top: 8px; left: 8px; background: var(--brand); color: #12001f; font-size: .7rem; font-weight: 700; letter-spacing: .1em; padding: 2px 8px; }
.a-diff canvas { display: block; width: 100%; max-height: 55vh; object-fit: contain; border: 1px solid var(--line); }
.a-ver { font-weight: 700; color: var(--brand); min-width: 48px; }
.a-hist .meta { white-space: normal; }
.a-step { margin-bottom: 14px; }
.a-step-h { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; margin-bottom: 10px; }
.a-step-h b { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border: 2px solid var(--brand); color: var(--brand); }
.a-val { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.a-val .muted { min-width: 60px; }
.a-val code, .a-steps code { background: var(--surface-2); border: 1px solid var(--line); padding: 3px 7px; word-break: break-all; color: var(--text); }
.a-val code { flex: 1 1 240px; font-size: .9rem; }
.a-steps { margin: 6px 0 0 20px; line-height: 1.75; font-size: .92rem; }
.a-steps li { margin-bottom: 6px; }
.a-steps li::marker { color: var(--brand); font-weight: 700; }
.a-steps ul { margin: 4px 0 4px 18px; }
@media (max-width: 760px) {
  .a-view .a-top { grid-template-columns: 1fr; }
  .a-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .a-side { grid-template-columns: 1fr; }
  .a-search { max-width: none; }
}

/* ── period: day / month pickers + "compare with" ───────────────────── */
.period-pick { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.period-pick .btn.sm.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.input.sm { height: 30px; padding: 2px 8px; font-size: .84rem; width: auto; }
.period-cmp { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.period-cmp .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
/* five-week strip on the day view */
.daystrip { display: grid; grid-template-columns: repeat(35, 1fr); gap: 2px; align-items: end; height: 120px; margin-bottom: 6px; }
.ds-bar { height: 100%; display: flex; align-items: flex-end; padding: 0; background: none; border: none; cursor: pointer; }
.ds-bar i { display: block; width: 100%; background: var(--dim); }
.ds-bar.same i { background: var(--c7); }
.ds-bar.on i { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.ds-bar:hover i, .ds-bar:focus-visible i { background: var(--text); }

/* "Burdock se ažurira" banner (server restarting – the gatekeeper answers meanwhile) */
.maint-banner { position: fixed; left: 50%; top: calc(var(--topbar-h) + 8px); transform: translateX(-50%); z-index: 9999; max-width: calc(100% - 32px);
  background: var(--bg); color: var(--warn); border: 2px solid var(--warn); padding: 8px 14px; font-size: .86rem;
  box-shadow: 0 0 18px rgba(255, 189, 46, .25); animation: maint-blink 1.6s steps(2) infinite; }
.maint-banner b { letter-spacing: .06em; text-transform: uppercase; }
@keyframes maint-blink { 50% { border-color: rgba(255, 189, 46, .35); } }

/* ── Art'affe · Raspored (raspored.js) ───────────────────────────────── */
kbd { display: inline-block; min-width: 1.5em; padding: 0 4px; border: 1px solid var(--line-2); border-bottom-width: 2px; font: 700 .72rem/1.5 var(--font, inherit); color: var(--text); text-align: center; background: var(--surface-2); }
.rd-status { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; }
.rd-chip { font-size: .68rem; font-weight: 700; letter-spacing: .1em; padding: 2px 8px; border: 1px solid currentColor; }
.rd-chip.ok { color: var(--good); } .rd-chip.warn { color: var(--warn); } .rd-chip.muted { color: var(--muted); } .rd-chip.x { color: var(--text-2); }
.rd-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 14px; }
.rd-actions .grow { flex: 1; }
.rd-go { font-size: .95rem; padding: 0 18px; height: 42px; }
.rd-go.busy { animation: rd-busy .6s steps(2) infinite; }
@keyframes rd-busy { 50% { filter: brightness(1.5); } }
.rd-card { padding: 0; overflow: hidden; }
.rd-scroll { overflow-x: auto; }
.rd-grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 820px; }
.rd-grid th, .rd-grid td { padding: 4px; border-bottom: 1px solid rgba(110, 255, 140, .12); vertical-align: middle; }
.rd-corner, .rd-sh { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 8px 10px !important; }
.rd-name { position: sticky; left: 0; z-index: 2; background: var(--bg); text-align: left; padding: 6px 10px !important; min-width: 110px; border-right: 1px solid var(--line); }
.rd-name span { display: block; font-weight: 700; white-space: nowrap; }
.rd-name small { display: block; font-size: .68rem; color: var(--brand); font-weight: 600; letter-spacing: .04em; }
.rd-corner { position: sticky; left: 0; z-index: 3; background: var(--bg); border-right: 1px solid var(--line); }
.rd-dh { min-width: 92px; }
.rd-dh.today .rd-day { box-shadow: inset 0 -3px 0 var(--accent); }
.rd-day { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer; text-align: left; position: relative; }
.rd-day:hover, .rd-day:focus-visible { border-color: var(--accent); outline: none; }
.rd-day.custom { border-color: var(--brand); }
.rd-day.bad { border-color: var(--bad); }
.rd-dn { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .82rem; }
.rd-dd { font-size: .72rem; color: var(--muted); }
.rd-slots { display: flex; flex-direction: column; font-size: .66rem; color: var(--text-2); margin-top: 2px; }
.rd-slots i { font-style: normal; white-space: nowrap; }
.rd-custom { position: absolute; top: -7px; right: 4px; font-size: .56rem; letter-spacing: .08em; text-transform: uppercase; background: var(--brand); color: #12001f; padding: 0 4px; font-weight: 700; }
.rd-cell { width: 100%; height: 42px; display: flex; align-items: center; justify-content: center; font: 700 .86rem var(--font, inherit); font-variant-numeric: tabular-nums;
  border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; position: relative; letter-spacing: .02em; }
.rd-cell.c-empty { color: var(--dim); border-style: dashed; }
.rd-cell.c-first { background: rgba(65, 228, 110, .14); border-color: rgba(65, 228, 110, .55); color: #b8ffc9; }
.rd-cell.c-second { background: rgba(199, 125, 255, .16); border-color: rgba(199, 125, 255, .6); color: #ecd4ff; }
.rd-cell.c-off { color: var(--muted); background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(110, 255, 140, .06) 6px 12px); }
.rd-cell.c-abs { color: var(--warn); border-color: rgba(255, 189, 46, .55); background: rgba(255, 189, 46, .08); }
.rd-cell.wish { border-style: dashed; opacity: .85; }
.rd-cell.locked::before { content: ""; position: absolute; top: 0; left: 0; border-top: 9px solid var(--brand); border-right: 9px solid transparent; }
.rd-cell.rest::after { content: "12h"; position: absolute; right: 3px; bottom: 1px; font-size: .52rem; letter-spacing: .04em; color: var(--warn); font-weight: 700; }
.rd-cell.rest { border-style: dotted; border-color: var(--warn); }
.rd-cell.bad { border-color: var(--bad) !important; box-shadow: inset 0 0 0 1px var(--bad); color: #ffd0cd; }
.rd-cell:hover { filter: brightness(1.25); }
.rd-cell:focus-visible, .rd-cell:focus { outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: 0 0 12px rgba(65, 228, 110, .45); z-index: 1; }
.rd-cell.flash, .rd-day.flash { animation: rd-flash .3s steps(2) 4; }
@keyframes rd-flash { 50% { background: var(--bad); color: #fff; } }
.rd-stat { white-space: nowrap; font-size: .78rem; padding: 4px 10px !important; }
.rd-stat small { display: block; font-size: .72rem; font-weight: 700; }
.rd-cov td { text-align: center; }
.rd-cov .rd-name span { font-size: .72rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.rd-covn { font-size: .76rem; font-weight: 700; }
.rd-covn.ok { color: var(--good); } .rd-covn.low { color: var(--bad); } .rd-covn.hi { color: var(--warn); }
.rd-print-h { display: none; }
.rd-hint { margin-top: 8px; font-size: .76rem; color: var(--muted); line-height: 1.9; }
@media (hover: none) { .rd-hint { display: none; } }
.rd-issues { display: flex; flex-direction: column; gap: 4px; }
.rd-issue { display: flex; gap: 10px; align-items: baseline; text-align: left; background: none; border: 1px solid transparent; color: var(--text); font: inherit; font-size: .88rem; padding: 5px 8px; cursor: pointer; }
.rd-issue:hover, .rd-issue:focus-visible { border-color: var(--line-2); outline: none; background: var(--surface-2); }
.rd-issue b { width: 16px; flex: none; text-align: center; }
.rd-issue.bad b { color: var(--bad); } .rd-issue.warn b { color: var(--warn); } .rd-issue.info b { color: var(--muted); } .rd-issue.info { color: var(--text-2); }
.rd-allok { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--good); background: var(--good-soft); }
.rd-allok b { color: var(--good); }
.rd-allok span { font-size: .84rem; color: var(--text-2); }
.rd-note { padding: 8px 12px; border: 1px solid var(--warn); color: var(--warn); font-size: .86rem; margin-bottom: 8px; }
.rd-opts { display: flex; flex-direction: column; gap: 6px; }
.rd-opt { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.rd-opt:hover, .rd-opt:focus-visible { border-color: var(--accent); outline: none; background: var(--surface-2); }
.rd-opt.on { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.rd-opt.c-first span { color: #b8ffc9; } .rd-opt.c-second span { color: #ecd4ff; } .rd-opt.c-abs span { color: var(--warn); } .rd-opt.c-off span { color: var(--muted); }
.rd-shifts { display: flex; flex-direction: column; gap: 8px; }
.rd-shift { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rd-shift .input.sm { width: 64px; text-align: center; }
.rd-prow { flex-wrap: wrap; gap: 8px !important; }
.rd-tpl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.rd-tday { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: .84rem; text-align: left; cursor: pointer; }
.rd-tday:hover, .rd-tday:focus-visible { border-color: var(--accent); outline: none; }
.rd-tday b { color: var(--brand); min-width: 32px; }
@media (max-width: 760px) {
  .rd-actions .grow { display: none; }
  .rd-name { min-width: 84px; }
  .rd-status { margin-left: 0; }
}
.rd-gap td { height: 8px; border: none !important; padding: 0 !important; }
.rd-codes th, .rd-codes td { border-bottom: none !important; padding: 2px 4px !important; }
.rd-codes .rd-name span { color: var(--muted); font-size: .8rem; }
.rd-code { width: 100%; height: 30px; background: none; border: 1px dashed var(--line); color: var(--text-2); font: 700 .86rem var(--font, inherit); cursor: pointer; }
.rd-code:hover, .rd-code:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.rd-code.none { color: var(--bad); border-color: rgba(255, 97, 89, .5); }
.rd-code.locked { border-style: solid; border-color: var(--brand); color: var(--text); }
.rd-code.away { color: var(--warn); }
.rd-stat { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.rd-sh { text-align: center !important; }

/* the printed schedule: the same dark sheet as the picture, filling a landscape page */
.rd-sheet { display: none; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  body.rd-printing > *:not(#rd-sheet) { display: none !important; }
  body.rd-printing::before, body.rd-printing::after { display: none !important; }
  body.rd-printing, body.rd-printing .rd-sheet { background: #060906 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.rd-printing .rd-sheet { display: flex; align-items: center; justify-content: center; width: 100vw; height: 100vh; margin: 0; padding: 6mm; box-sizing: border-box; }
  body.rd-printing .rd-sheet img { max-width: 100%; max-height: 100%; display: block; }
}
}
}

/* Raspored · Zahtjevi */
.rd-z { position: absolute; top: 1px; right: 3px; font-style: normal; font-size: .56rem; font-weight: 700; color: var(--brand); letter-spacing: 0; }
.rd-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; background: var(--brand); color: #12001f; font-size: .7rem; text-align: center; }
.rd-req-add { border-color: var(--brand); color: var(--brand); }
.rd-form { display: flex; flex-direction: column; gap: 14px; }
.rd-form .seg { flex-wrap: wrap; }
.rd-reqw { margin-bottom: 16px; }
.rd-reqw-h { display: flex; justify-content: space-between; align-items: center; padding: 4px 0 6px; border-bottom: 1px dashed var(--line); margin-bottom: 4px; }
.rd-reqw-h b { color: var(--brand); letter-spacing: .06em; }
.rd-reqd { min-width: 78px; font-weight: 700; font-size: .84rem; color: var(--text-2); }

/* ── Phone-first: give every control a real thumb-sized hit area ───────── */
@media (pointer: coarse) {
  .btn.sm { padding: 9px 14px; font-size: .84rem; }
  .seg button { padding: 9px 13px; }
  .seg.sm button { padding: 8px 11px; font-size: .82rem; }
  .period-nav button { width: 44px; height: 42px; }
  .period-nav button svg { width: 16px; height: 16px; }
  .icon-btn { width: 42px; height: 42px; }
  .icon-btn.sm { width: 40px; height: 40px; }
  .icon-btn svg, .icon-btn.sm svg { width: 18px; height: 18px; }
  .chk { min-height: 40px; display: inline-flex; align-items: center; }
  .tab { padding: 10px 12px; }
  .toggle { padding: 6px 0; }
}
.boot-skip { position: fixed; left: 0; right: 0; bottom: calc(20px + var(--safe-b)); text-align: center; color: var(--muted); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; animation: blink 1.4s steps(1) infinite; }

/* Options sheet (Prihodi "Prikaz") + inline count badge */
.opt-list { display: flex; flex-direction: column; gap: 10px; }
.opt-list .toggle { width: 100%; justify-content: flex-start; padding: 12px 14px; font-size: .95rem; }
.opt-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px; margin-left: 6px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; line-height: 1; }

/* Danas — foldable secondary cards */
.card.foldable > .card-h.fold-h { cursor: pointer; }
.card.foldable.folded > :not(.card-h) { display: none; }
.card.foldable.folded { padding-bottom: 0; }
.card.foldable.folded > .card-h { margin-bottom: 0; }
.fold-btn svg { transition: transform .15s ease; }
.fold-btn.folded svg { transform: rotate(-90deg); }
