/* Pi-hole dashboard · direction A "Monolith". 800×480 base, 1280×400 reflow. */
@font-face { font-family: "Inter"; src: url(fonts/inter-latin-var.woff2) format("woff2"); font-weight: 100 900; font-display: block; }
@font-face { font-family: "Inter Tight"; src: url(fonts/inter-tight-latin-var.woff2) format("woff2"); font-weight: 100 900; font-display: block; }

:root, [data-theme="monolith"] {
  --bg: #0E0D0C;          /* warm off-black */
  --line: #2A2724;
  --text: #F3EFE8;
  --muted: #9A938A;
  --faint: #5E5852;
  --accent: #FF6A3D;      /* signal orange */
  --ok: #7BD88F;
  --warn: #F5C451;        /* paused / not blocking */
  --bad: #E5675A;         /* offline */
  --panel: #151311;       /* sheet / tiles */
  --press: #1a1816;       /* row pressed */
  --font-ui: Inter, system-ui, sans-serif;
  --font-num: "Inter Tight", Inter, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { background: var(--bg); height: 100%; overflow: hidden; }
body { font-family: var(--font-ui); color: var(--text); -webkit-font-smoothing: antialiased;
  cursor: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* --screen-scale is set by theme.js (SCREEN_TOP): optional inset for a case bezel that covers the top of the screen */
.stage { transform: scale(var(--screen-scale, 1)); transform-origin: 50% 100%;
  width: 100vw; height: 100vh; position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) 272px; grid-template-rows: 64px minmax(0, 1fr); }

header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 14px; font-weight: 600; font-size: 22px; letter-spacing: .02em; }
.pill { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 500; color: var(--muted); --dot: var(--faint); }
.pill::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 4px color-mix(in srgb, var(--dot) 18%, transparent); }
.pill.ok { color: var(--ok); --dot: var(--ok); }
.pill.warn { color: var(--warn); --dot: var(--warn); }
.pill.bad { color: var(--bad); --dot: var(--bad); }
.vitals { display: flex; gap: 28px; font-size: 22px; color: var(--muted); }
.vitals b { color: var(--text); font-weight: 500; }

.hero { padding: 30px 28px 28px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; transition: opacity .4s; }
.label { font-size: 22px; color: var(--muted); font-weight: 500; }
.big { font-size: 168px; line-height: .86; font-weight: 700; letter-spacing: -0.045em; margin-top: 10px; white-space: nowrap; }
/* app.js fitText() shrinks .big and .rate below these sizes only when the number is too wide for its box */
.rate { display: flex; align-items: baseline; gap: .54em; font-size: 26px; color: var(--muted); white-space: nowrap; }
.rate .pct { font-size: 1.7em; font-weight: 600; color: var(--accent); letter-spacing: -0.02em; }
.bar { height: 8px; background: var(--line); border-radius: 4px; margin-top: 16px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 1s ease; }

.side { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ticker { flex: 1; min-height: 0; padding: 24px 24px 0; overflow: hidden; position: relative; transition: opacity .4s; }
.ticker::after { content: ""; position: absolute; inset: auto 0 0 0; height: 70px; background: linear-gradient(transparent, var(--bg)); }
.ticker ol { list-style: none; margin-top: 14px; }
.ticker li { padding: 10px 0; border-top: 1px solid var(--line); }
.ticker .d { font-size: 22px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker .t { font-size: 18px; color: var(--faint); margin-top: 2px; }
.ticker li.fresh .d { color: var(--accent); }
.ticker li.new { animation: drop .6s ease-out; }
.ticker .empty { font-size: 22px; color: var(--faint); margin-top: 18px; }
@keyframes drop { from { opacity: 0; transform: translateY(-12px); } }

.pause { margin: 0 24px 24px; height: 80px; flex: none; border-radius: 16px; border: 2px solid var(--text); background: transparent;
  color: var(--text); font: 600 26px var(--font-ui); display: flex; align-items: center; justify-content: center; gap: 14px; cursor: none; }
.pause:active { background: var(--text); color: var(--bg); }
.pause svg { width: 26px; height: 26px; flex: none; }
.pause.resume { background: var(--warn); border-color: var(--warn); color: var(--bg); }
.pause:disabled { opacity: .35; }
.pause.busy { opacity: .6; }

/* paused: hero dims, label turns amber */
body.is-paused .hero .big, body.is-paused .rate .pct { color: var(--muted); }
body.is-paused .bar i { background: var(--muted); }
body.is-paused #heroLabel { color: var(--warn); }
#heroLabel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#heroLabel.alert { color: var(--bad); }
body.is-stale .hero > div:first-child .big, body.is-stale .hero > div:last-child, body.is-stale .ticker { opacity: .45; }

/* stale / offline: keep last numbers, dim them; the hero label carries the message */
/* needs setup / auth failed: calm full-screen card */
.overlay { position: absolute; inset: 64px 0 0 0; background: var(--bg); display: grid; place-items: center; padding: 28px; }
.overlay-card { max-width: 640px; }
.overlay-title { font: 700 44px/1.1 var(--font-num); letter-spacing: -0.02em; }
.overlay-body { margin-top: 18px; font-size: 24px; line-height: 1.4; color: var(--muted); }
.overlay-body code { font-family: var(--font-num); color: var(--text); }

.status { display: none; }

/* wide panel (e.g. 1280×400): hero | feed | status + pause */
@media (min-aspect-ratio: 5/2) {
  .stage { grid-template-columns: minmax(0, 1fr) 380px 300px; }
  .big { font-size: 156px; }
  header .vitals { display: none; }
  .side .pause { display: none; }
  .status { display: flex; flex-direction: column; justify-content: space-between; border-left: 1px solid var(--line); padding: 24px; min-height: 0; }
  .status dl { display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; font-size: 22px; }
  .status dt { color: var(--muted); }
  .status dd { text-align: right; font-weight: 500; }
  .status .pause { margin: 0; }
}

/* ===================== domain actions ===================== */
header .right { display: flex; align-items: center; gap: 22px; }
.allowed-btn { height: 48px; padding: 0 16px; border-radius: 24px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); font: 500 20px var(--font-ui); display: inline-flex; align-items: center; gap: 10px; cursor: none; }
.allowed-btn b { color: var(--text); font-weight: 600; }
.allowed-btn:active { background: var(--line); }

.ticker li[data-domain] { position: relative; padding-right: 26px; }
.ticker li[data-domain]::after { content: "›"; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); font-size: 28px; color: var(--faint); }
.ticker li[data-domain]:active { background: var(--press); }

/* sheet */
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 5; }
.sheet { position: absolute; top: 0; right: 0; bottom: 0; width: 560px; background: var(--panel); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); z-index: 6; display: flex; flex-direction: column; padding: 12px 24px 20px; }
body.sheet-open .scrim { opacity: 1; pointer-events: auto; }
body.sheet-open .sheet { transform: none; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; height: 48px; }
.eyebrow { font-size: 20px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 10px; }
.chip { font-size: 18px; padding: 4px 12px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); font-weight: 600; }
.chip.allowed { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.icon-btn { width: 56px; height: 56px; margin-right: -12px; border: 0; background: transparent; color: var(--muted); font-size: 34px; line-height: 1; border-radius: 28px; cursor: none; }
.icon-btn:active { background: var(--line); }
.dom { margin-top: 4px; font: 600 28px/1.18 var(--font-num); letter-spacing: -0.01em; word-break: break-all; }
.dom .sub { color: var(--muted); font-weight: 500; }
.dom .reg { white-space: nowrap; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 14px; }
.stats .v { font: 600 30px/1 var(--font-num); font-variant-numeric: tabular-nums; }
.stats .k { font-size: 18px; color: var(--muted); margin-top: 4px; }
.why { margin-top: 14px; padding-left: 14px; border-left: 3px solid var(--line); font-size: 19px; line-height: 1.35; color: var(--muted); }
.why b { color: var(--text); font-weight: 600; }
.why.special { border-left-color: var(--warn); }
.actions { margin-top: auto; padding-top: 14px; display: grid; gap: 10px; }

/* press-and-hold buttons */
.hold { position: relative; overflow: hidden; height: 64px; border-radius: 16px; border: 2px solid var(--text); background: transparent;
  color: var(--text); font: 600 24px var(--font-ui); display: flex; align-items: center; justify-content: center; gap: 12px; touch-action: none; cursor: none; }
.hold .fill { position: absolute; inset: 0; width: 0; background: var(--text); }
.hold .lbl { position: relative; mix-blend-mode: difference; color: #fff; }
.hold.primary { background: var(--text); color: var(--bg); }
.hold.primary .fill { background: var(--accent); }
.hold.primary .lbl { mix-blend-mode: normal; color: var(--bg); }
.hold.danger { border-color: var(--bad); color: var(--bad); }
.hold.danger .fill { background: var(--bad); }
.hold.holding .fill { width: 100%; transition: width 1200ms linear; }
.hold .meta { position: relative; font-size: 18px; font-weight: 500; opacity: .7; }
.hold.holding .meta, .hold.hinting .meta { display: none; }
.hold:disabled { opacity: .4; }
.hold.busy { opacity: .6; pointer-events: none; }
@keyframes nudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.hold.nudge { animation: nudge .25s ease 2; }

.error { display: none; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px 10px 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--bad) 14%, var(--bg)); border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); font-size: 19px; line-height: 1.3; }
.error.show { display: flex; }
.error button { flex: none; height: 52px; padding: 0 20px; border-radius: 12px; border: 0; background: var(--text); color: var(--bg); font: 600 20px var(--font-ui); cursor: none; }

/* undo toast */
.toast { position: absolute; left: 50%; bottom: 20px; transform: translate(-50%, 140%); z-index: 9; width: min(720px, calc(100% - 40px));
  display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 20px; border-radius: 16px; background: var(--text); color: var(--bg);
  box-shadow: 0 10px 40px rgba(0,0,0,.5); transition: transform .3s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
.toast.show { transform: translate(-50%, 0); }
.toast .msg { flex: 1; min-width: 0; font-size: 20px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast .msg b { font-weight: 700; }
.toast button { flex: none; height: 56px; padding: 0 24px; border-radius: 12px; border: 2px solid var(--bg); background: transparent; color: var(--bg); font: 700 22px var(--font-ui); cursor: none; }
.toast button[hidden] { display: none; }
.toast .timer { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--accent); transform-origin: left; }
.toast.show .timer { animation: drain 8s linear forwards; }
@keyframes drain { to { transform: scaleX(0); } }

/* recently allowed page */
.page { position: absolute; inset: 0; background: var(--bg); z-index: 4; display: none; flex-direction: column; }
body.page-allowed #page, body.page-style #stylePage { display: flex; }
.page header { flex: none; height: 64px; }
.back { height: 48px; padding: 0 16px 0 8px; margin-left: -8px; border: 0; background: transparent; color: var(--text); font: 600 22px var(--font-ui);
  display: inline-flex; align-items: center; gap: 6px; border-radius: 24px; cursor: none; }
.back .chev { font-size: 30px; line-height: 1; }
.back:active { background: var(--line); }
.rows { flex: 1; overflow: hidden; padding: 6px 28px 0; }
.rows li { list-style: none; display: grid; grid-template-columns: 52px minmax(0,1fr) 168px; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rows .empty { display: block; border: 0; font-size: 22px; color: var(--faint); padding-top: 24px; }
.ring { width: 48px; height: 48px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .t { stroke: var(--line); } .ring .a { stroke: var(--ok); stroke-linecap: round; }
.always { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); font-size: 24px; font-weight: 700; }
.rows .d { font-size: 22px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .s { font-size: 18px; color: var(--muted); margin-top: 2px; }
.rows .s .num { color: var(--text); }
.row-btn { height: 56px; font-size: 20px; border-radius: 14px; }
.page-foot { flex: none; padding: 10px 28px 16px; font-size: 18px; color: var(--faint); }

@media (min-aspect-ratio: 5/2) {
  .sheet { width: 620px; }
  .actions { grid-template-columns: 1fr 1fr; }
  .actions .error, .actions .solo { grid-column: 1 / -1; }
  .hold .meta { display: none; }
  .rows li { grid-template-columns: 52px minmax(0,1fr) 200px; }
}

/* screen asleep (pihole-presence): swallow the tap that wakes the screen so it can't press anything */
.wake-shield { position: absolute; inset: 0; z-index: 20; background: transparent; }

/* ===================== designs: shared-UI tokens =====================
   Each design (skins.js + skins.css) also re-colours the shared parts (domain sheet, toast, Allowed page, Style page)
   through these tokens. Every block sets the full list so a [data-theme] preview tile can sit inside any design. */
[data-theme="swiss"] {
  --bg: #F2F2EE; --line: #CFCFCA; --text: #111111; --muted: #555555; --faint: #999999;
  --accent: #E30613; --ok: #1A7F37; --warn: #C77700; --bad: #E30613; --panel: #FFFFFF; --press: #E6E6E1;
  --font-ui: Inter, system-ui, sans-serif; --font-num: "Inter Tight", Inter, sans-serif;
}
[data-theme="bauhaus"] {
  --bg: #EEE6D3; --line: #CFC4AC; --text: #141414; --muted: #5A5246; --faint: #9A9080;
  --accent: #D52B1E; --ok: #1D4F9B; --warn: #B98C00; --bad: #D52B1E; --panel: #F6F0E2; --press: #E2D8C2;
  --font-ui: Inter, system-ui, sans-serif; --font-num: "Inter Tight", Inter, sans-serif;
}
[data-theme="arcade"] {
  --bg: #0B0E2A; --line: #2A2F66; --text: #F4F4F4; --muted: #9AA0D0; --faint: #555A8A;
  --accent: #FF4F8B; --ok: #4BE36B; --warn: #FFD23F; --bad: #FF4F4F; --panel: #12164A; --press: #1B2060;
  --font-ui: "DejaVu Sans Mono", Menlo, ui-monospace, monospace; --font-num: "DejaVu Sans Mono", Menlo, ui-monospace, monospace;
}
[data-theme="flow"] {
  --bg: #0C0F14; --line: #1E2530; --text: #E8EEF5; --muted: #8A96A8; --faint: #4C5666;
  --accent: #FF5A4E; --ok: #5ED3C5; --warn: #F2B544; --bad: #FF5A4E; --panel: #121822; --press: #19212D;
  --font-ui: Inter, system-ui, sans-serif; --font-num: "Inter Tight", Inter, sans-serif;
}
[data-theme="terminal"] {
  --bg: #050805; --line: #123D1D; --text: #3CFF7A; --muted: #22A651; --faint: #146B33;
  --accent: #3CFF7A; --ok: #3CFF7A; --warn: #E8F55A; --bad: #FF5F56; --panel: #0A120B; --press: #0F1F12;
  --font-ui: "DejaVu Sans Mono", Menlo, ui-monospace, monospace; --font-num: "DejaVu Sans Mono", Menlo, ui-monospace, monospace;
}

/* ===================== style picker ===================== */
.style-btn { width: 48px; height: 48px; border-radius: 24px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  display: inline-grid; place-items: center; cursor: none; flex: none; }
.style-btn svg { width: 24px; height: 24px; }
.style-btn:active { background: var(--line); }
/* Scrollbars: a thin floating pill in the design's text colour, no track. It's only an indicator on the
   touchscreen (scrolling is by swipe), so it stays narrow. */
::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text, #888) 28%, transparent); background-clip: padding-box;
  border: 3px solid transparent; border-radius: 999px; min-height: 40px; }
::-webkit-scrollbar-button { display: none; }
.styles { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 150px; gap: 12px; padding: 12px 24px 20px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.swatch { position: relative; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); color: var(--text); padding: 10px 10px 10px;
  display: flex; flex-direction: column; text-align: left; cursor: none; min-width: 0; overflow: hidden; font-family: var(--font-ui); }
.swatch:active { transform: scale(.98); }
.swatch .nm { font: 600 19px var(--font-ui); margin-top: 8px; }
.swatch .ds { font-size: 14px; color: var(--muted); margin-top: 1px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swatch svg { display: block; width: 100%; flex: 1; min-height: 0; border-radius: 8px; }
.swatch.on { border-color: var(--accent); }
.swatch.on::after { content: "✓"; position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--bg);
  font: 700 18px/30px var(--font-ui); text-align: center; }
@media (min-aspect-ratio: 5/2) { .styles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* header room for the Style button: tighter gaps, never wraps */
.stage > header { gap: 16px; }
header .right { gap: 14px; }
.vitals { gap: 22px; }
.allowed-btn { padding: 0 14px; }
.style-btn { width: 44px; height: 44px; }

.brand, .pill, .vitals span { white-space: nowrap; }

/* Demo mode (?demo, see demo.js): the kiosk hides the cursor for touch. In a browser demo the mouse becomes a
   fingertip: a soft ring that shrinks and fills while pressed. */
html.demo, html.demo * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='12.5' fill='none' stroke='rgba(0,0,0,.35)' stroke-width='1'/%3E%3Ccircle cx='16' cy='16' r='11' fill='rgba(255,255,255,0.28)' stroke='rgba(255,255,255,.9)' stroke-width='1.5'/%3E%3C/svg%3E") 16 16, pointer !important; }
html.demo :active, html.demo :active * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='10.0' fill='none' stroke='rgba(0,0,0,.35)' stroke-width='1'/%3E%3Ccircle cx='16' cy='16' r='8.5' fill='rgba(255,255,255,0.6)' stroke='rgba(255,255,255,.9)' stroke-width='1.5'/%3E%3C/svg%3E") 16 16, pointer !important; }
