/* Klusais režģis. Melnbalts, tievas līnijas, sistēmas burti. Vērtības no atsaucēm: fons, apmales, stūri 8 px. */
:root {
  color-scheme: light;
  --bg: #ffffff; --fg: #09090b; --muted: #71717a; --border: #e4e4e7; --border-2: #d4d4d8; --dim: #f4f4f5; --dot: #a1a1aa;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --r: 8px; --ease: cubic-bezier(0.32, 0.72, 0, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; --bg: #09090b; --fg: #f4f4f5; --muted: #8e8e96; --border: #27272a; --border-2: #3f3f46; --dim: #18181b; --dot: #8e8e96; }
}
:root[data-theme="dark"] { color-scheme: dark; --bg: #09090b; --fg: #f4f4f5; --muted: #8e8e96; --border: #27272a; --border-2: #3f3f46; --dim: #18181b; --dot: #8e8e96; }

html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, .btn { font: inherit; }
button:focus-visible, a:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Fons: pikseļu lauks pa visu ekrānu zem visa; saturs virs tā. Vārds laukā aizstāj mazo zīmi augšā. */
#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0.55; }
.top, .col { position: relative; z-index: 1; }
html.field .mark { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { max-width: 1360px; margin: 0 auto; padding: 28px 24px 18px; display: flex; align-items: center; justify-content: space-between; }
.mark { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }

.col { max-width: 1360px; margin: 0 auto; padding: 0 24px 48px; min-height: calc(100vh - 140px); min-height: calc(100dvh - 140px); display: flex; flex-direction: column; justify-content: center; }

/* Sliede: sešas kartītes rindā, viens taisns vads cauri visām */
.rail { position: relative; display: flex; gap: 12px; }
.rail .wire { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; overflow: visible; }
#wireBase { fill: none; stroke: var(--border-2); stroke-width: 1; }
#wireLit { fill: none; stroke: var(--fg); stroke-width: 1; }
#pulse { fill: var(--fg); }

.card { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 16px 16px; display: flex; flex-direction: column; overflow: hidden; transition: opacity 600ms var(--ease), border-color 600ms var(--ease); }
.step[data-state="dormant"] { opacity: 0.3; }
.card[data-state="dormant"] { opacity: 1; }
.card[data-state="dormant"] > * { opacity: 0.3; }
.step[data-state="dormant"] .btn, .step[data-state="dormant"] .skip, .step[data-state="dormant"] .sw { pointer-events: none; }
.step[data-state="awake"] { border-color: var(--border-2); }

/* Modulis sēž uz vada kā pērle */
.mod { height: 136px; display: flex; align-items: center; justify-content: center; position: relative; margin: 0 0 14px; }
.mod > * { position: relative; z-index: 2; }

.card h2 { font-size: 14px; font-weight: 600; margin: 0 0 3px; letter-spacing: -0.01em; }
.card .lead { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }
.sig { margin: 0 0 6px; }
.t { font-size: 11.5px; color: var(--muted); margin: 0; }

.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-2); border-radius: 6px; padding: 3px 8px; font-size: 12px; line-height: 1.4; background: var(--bg); color: var(--fg); white-space: nowrap; }
.chip .w { color: var(--muted); }
.chip b { font-weight: 600; font-family: var(--mono); }
.addrchip { font-size: 12.5px; padding: 6px 10px; }

/* Slēdzis */
.sw { width: 60px; height: 92px; padding: 5px; border: 1px solid var(--border-2); border-radius: 6px; background: var(--bg); cursor: pointer; display: grid; gap: 4px; transition: transform 300ms var(--ease); }
.sw:active { transform: scale(0.97); }
.sw span { display: grid; place-items: center; font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; background: var(--bg); transition: background 300ms var(--ease), color 300ms var(--ease), border-color 300ms var(--ease); }
.sw[aria-checked="true"] span.i { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.sw[aria-checked="false"] span.o { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* Lampa: koncentriski riņķi, pavedienu uzsprādziens aiz tās */
.burst { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.lamp { width: 88px; height: 88px; border-radius: 50%; border: 1px solid var(--border-2); background: var(--bg); display: grid; place-items: center; position: relative; transition: border-color 500ms var(--ease); }
.lamp::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 1px solid var(--border); transition: border-color 700ms var(--ease); }
.lamp i { display: block; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-2); background: var(--bg); transition: background 400ms var(--ease), border-color 400ms var(--ease); }
.lamp.on { border-color: var(--fg); }
.lamp.on::before { border-color: var(--border-2); }
.lamp.on i { background: var(--fg); border-color: var(--fg); }

/* Papīrs: mazs dokumenta logs */
.win { width: 100%; max-width: 180px; border: 1px solid var(--border-2); border-radius: 6px; background: var(--bg); padding: 22px 12px 10px; box-sizing: border-box; font-family: var(--mono); font-size: 11px; line-height: 1.6; color: var(--muted); position: relative; }
.win .dots { position: absolute; left: 9px; top: 7px; display: flex; gap: 4px; }
.win .dots i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--border-2); background: var(--dim); }
.win .line { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win b { color: var(--fg); font-weight: 600; }

/* Kalendārs: piecu dienu josla */
.days { display: flex; gap: 4px; width: 100%; max-width: 184px; }
.days span { flex: 1; text-align: center; border: 1px solid var(--border-2); border-radius: 6px; padding: 6px 0 5px; font-size: 10px; line-height: 1.2; color: var(--muted); background: var(--bg); }
.days span b { display: block; font-size: 14px; font-weight: 600; color: var(--fg); font-family: var(--mono); margin-top: 2px; }
.days span.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.days span.on b { color: var(--bg); }
.event .line { display: block; }
.event .line b { color: var(--fg); font-weight: 600; }

/* Telefons */
.qr { width: 120px; height: 120px; padding: 8px; box-sizing: border-box; background: #ffffff; border: 1px solid var(--border-2); border-radius: 6px; }
.qr svg { display: block; width: 100%; height: 100%; }
.url { font-size: 11px; color: var(--muted); margin: 0 0 10px; word-break: break-all; }
.phoneHand { border: 1px solid var(--border-2); border-radius: 6px; padding: 12px 14px; margin-top: 10px; }
.phoneHand .big { font-size: 13.5px; font-weight: 600; margin: 0; }
.phoneHand .acts { margin-top: 10px; }

/* Pogas un saites */
.acts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.btn { display: inline-block; border: 1px solid var(--border-2); background: var(--bg); color: var(--fg); border-radius: 6px; padding: 7px 12px; cursor: pointer; font-size: 13px; font-weight: 500; text-decoration: none; line-height: 1.3; transition: background 300ms var(--ease), transform 300ms var(--ease), border-color 300ms var(--ease); }
.btn:hover { background: var(--dim); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.primary:hover { opacity: 0.88; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.skip { font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.skip:hover { color: var(--fg); }
.addr { margin: 0 0 8px; font-size: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copied { font-size: 12px; color: var(--muted); }

/* Beigas: zem sliedes */
.end { padding: 40px 0 0; max-width: 46ch; transition: opacity 700ms var(--ease); }
.end .endline { font-size: clamp(22px, 2.4vw, 30px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 10px; text-wrap: balance; }
.end .who { margin: 0; font-size: 13px; color: var(--muted); }
.end .who .mono { color: var(--fg); }

.notice { background: var(--bg); border: 1px solid var(--border-2); border-radius: var(--r); padding: 16px 18px; margin: 0 0 20px; }
.notice .big { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.notice .sig { margin: 0; }
.col.received .rail .wire { display: none; }
.col.received .card { flex: 0 1 420px; }


/* Piezīme stūrī: kas te tiek darīts. Galdā apakšējā labajā stūrī, šaurāk zem visa. */
.foot { position: fixed; z-index: 1; right: 24px; bottom: 22px; text-align: right; font-size: 12px; line-height: 1.55; color: var(--muted); max-width: 72ch; }
.foot p { margin: 0; }

/* Šaurāk par 1200 px: sliede, ko var bīdīt, kartītes 264 px, gaismiņa pati aizved */
@media (max-width: 1199px) {
  .col { min-height: 0; justify-content: flex-start; padding-top: 8px; padding-bottom: 32px; }
  html.field .top { min-height: 150px; box-sizing: border-box; }
  .foot { position: relative; right: auto; bottom: auto; text-align: left; max-width: 1360px; margin: 0 auto; padding: 0 24px 40px; box-sizing: border-box; }
  .rail { overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 0 10px; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .card { flex: 0 0 264px; scroll-snap-align: center; }
}
@media (max-width: 480px) {
  .top { padding: 22px 16px 14px; }
  .col { padding: 8px 16px 28px; }
  .foot { padding: 0 16px 32px; }
  .card { flex-basis: 78vw; }
  .end .endline { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
