/* SwiftLife Clock. Its own look, not the marketing site's: six themes, all
   colours as tokens on the root so the canvases (js/core.js S.colors())
   read the same values the page uses. */

/* ---------- themes ---------- */
:root, [data-theme="midnight"] {
  --bg: #060a13; --bg2: #0b1222;
  --panel: rgba(255,255,255,.045); --panel2: rgba(255,255,255,.08); --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.16);
  --text: #eaeef6; --muted: #8f9ab0; --faint: #5d677c;
  --accent: #d9b46a; --accent-ink: #1b1406; --accent2: #ff5d57; --good: #46d39a; --bad: #ff6b6b;
  --glow: rgba(217,180,106,.45); --aur1: rgba(217,180,106,.15); --aur2: rgba(70,110,255,.17); --aur3: rgba(150,80,255,.12);
  --dial: #0a1426; --dial2: #1c2d4d; --case1: #f4e2b4; --case2: #8c6b2f; --hand1: #fbeccb; --hand2: #b88f45; --lume: #d9ffe8; --index: #f0d9a0;
  --seg-off: rgba(217,180,106,.08); --flip1: #1d2638; --flip2: #111827;
  --mapocean: #070e1c; --mapday: #ffd27a; --mapnight: #33476e; --maptwi: #8a6fd1;
  --day1: rgba(255,214,140,.16); --day2: rgba(120,170,255,.10); --night1: rgba(20,30,70,.5);
  --stars: 1;
  color-scheme: dark;
}
[data-theme="aurora"] {
  --bg: #031018; --bg2: #06202a;
  --text: #e8f6f4; --muted: #86a7a6; --faint: #557271;
  --accent: #3ee0c5; --accent-ink: #022019; --accent2: #ff6fae;
  --glow: rgba(62,224,197,.45); --aur1: rgba(62,224,197,.2); --aur2: rgba(70,140,255,.16); --aur3: rgba(255,111,174,.12);
  --dial: #04222a; --dial2: #0b4450; --case1: #eef6f5; --case2: #6a8789; --hand1: #f2fbfa; --hand2: #9fb8b9; --lume: #b6ffe9; --index: #e3faf6;
  --seg-off: rgba(62,224,197,.08); --flip1: #0f2f37; --flip2: #082027;
  --mapocean: #041319; --mapday: #7ef2dd; --mapnight: #2a4a63; --maptwi: #6f6fd8;
}
[data-theme="emerald"] {
  --bg: #03130d; --bg2: #062016;
  --text: #ecf3ee; --muted: #8fa89a; --faint: #5a7365;
  --accent: #d6b36a; --accent-ink: #1a1306; --accent2: #ff6a4d;
  --glow: rgba(214,179,106,.42); --aur1: rgba(214,179,106,.13); --aur2: rgba(40,180,120,.16); --aur3: rgba(20,110,80,.2);
  --dial: #06281c; --dial2: #10503a; --case1: #f3e1b0; --case2: #876728; --hand1: #fbedc6; --hand2: #b38d40; --lume: #e6ffe9; --index: #f2dca2;
  --seg-off: rgba(214,179,106,.08); --flip1: #0d3326; --flip2: #072318;
  --mapocean: #04140e; --mapday: #ffe08a; --mapnight: #23503f; --maptwi: #9c7a3c;
}
[data-theme="synth"] {
  --bg: #0d0420; --bg2: #1a0838;
  --text: #f7ecff; --muted: #b29bd0; --faint: #7a649a;
  --accent: #ff4fd8; --accent-ink: #26001f; --accent2: #36e6ff;
  --glow: rgba(255,79,216,.5); --aur1: rgba(255,79,216,.2); --aur2: rgba(54,230,255,.14); --aur3: rgba(140,60,255,.22);
  --dial: #14062e; --dial2: #301061; --case1: #ece6ff; --case2: #6a5aa8; --hand1: #fdf2ff; --hand2: #c39ae6; --lume: #9ff7ff; --index: #ffd0f6;
  --seg-off: rgba(255,79,216,.09); --flip1: #2a0f4f; --flip2: #19083a;
  --mapocean: #0c0420; --mapday: #ff9be9; --mapnight: #3c2a78; --maptwi: #9d4dff;
}
[data-theme="mono"] {
  --bg: #0f0f0f; --bg2: #171717;
  --text: #f2f2f2; --muted: #9a9a9a; --faint: #666;
  --accent: #f2f2f2; --accent-ink: #111; --accent2: #ff3b30;
  --glow: rgba(255,255,255,.3); --aur1: rgba(255,255,255,.05); --aur2: rgba(255,59,48,.07); --aur3: rgba(255,255,255,.04);
  --dial: #161616; --dial2: #232323; --case1: #e6e6e6; --case2: #6b6b6b; --hand1: #ffffff; --hand2: #c4c4c4; --lume: #ffffff; --index: #ffffff;
  --seg-off: rgba(255,255,255,.06); --flip1: #262626; --flip2: #161616;
  --mapocean: #0d0d0d; --mapday: #f5f5f5; --mapnight: #3a3a3a; --maptwi: #8a8a8a;
}
[data-theme="ivory"] {
  --bg: #f3ede2; --bg2: #fbf8f2;
  --panel: rgba(255,255,255,.62); --panel2: rgba(255,255,255,.9); --line: rgba(60,40,10,.11); --line2: rgba(60,40,10,.22);
  --text: #1d1a14; --muted: #6c6353; --faint: #726958;
  --accent: #9a6b22; --accent-ink: #fffaf0; --accent2: #c8102e; --good: #1f8a5b; --bad: #c8102e;
  --glow: rgba(154,107,34,.3); --aur1: rgba(214,170,90,.18); --aur2: rgba(110,150,255,.10); --aur3: rgba(255,170,120,.14);
  --dial: #f8f2e4; --dial2: #ffffff; --case1: #f0dca8; --case2: #a07a35; --hand1: #4a4f5c; --hand2: #15181f; --lume: #e3f2da; --index: #d9b46a;
  --seg-off: rgba(154,107,34,.08); --flip1: #2a2620; --flip2: #1b1813;
  --mapocean: #e6dccb; --mapday: #d98a1c; --mapnight: #7d8aa8; --maptwi: #b07cc0;
  --day1: rgba(255,190,90,.22); --day2: rgba(120,170,255,.14); --night1: rgba(40,50,90,.16);
  --stars: 0;
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background: var(--bg); color: var(--text);
  font: 400 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.i.tiny { width: .85em; height: .85em; margin-left: .35em; color: var(--accent); }
[hidden] { display: none !important; }
.reg { font-size: .45em; vertical-align: super; line-height: 0; margin-left: .05em; font-weight: 500; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }

/* ---------- the sky behind everything ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(1200px 700px at 15% -10%, var(--bg2), transparent 70%), var(--bg); }
.backdrop canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: calc(var(--stars) * .85); }
.aurora { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.a1 { width: 60vw; height: 50vw; left: -10vw; top: -20vw; background: var(--aur1); animation: drift1 38s ease-in-out infinite alternate; }
.a2 { width: 55vw; height: 45vw; right: -15vw; top: 10vh; background: var(--aur2); animation: drift2 46s ease-in-out infinite alternate; }
.a3 { width: 50vw; height: 40vw; left: 20vw; bottom: -25vw; background: var(--aur3); animation: drift3 52s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(12vw, 8vw) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-10vw, 12vw) scale(.9); } }
@keyframes drift3 { to { transform: translate(8vw, -10vw) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .aurora { animation: none; } }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, env(safe-area-inset-left)) 10px max(16px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .bar { background: rgba(6,10,19,.8); } [data-theme="ivory"] .bar { background: rgba(243,237,226,.85); } }
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .bar-fill { background: var(--accent); }
  td.b-w, .k-work { background: var(--glow); }
  .cd-card.fixed { background: var(--panel2); border-color: var(--line2); }
  .pl-list li.b-w { border-color: var(--good); }
  .btn.danger { border-color: var(--bad); }
}
/* The SL mark and the name as the home page draws them (placeholder.css):
   the mark a shade quieter than the name, the logo's own grey on the light
   theme. Each theme's colours otherwise. */
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none !important; flex: none; }
.mark { width: 37px; height: 22px; flex: none; color: var(--text); opacity: .86; }
[data-theme="ivory"] .mark { color: #6d6e70; opacity: 1; }
.brand-name { font: 650 19px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif; letter-spacing: -.012em; }
.brand-name .reg { font-size: .5em; vertical-align: baseline; position: relative; top: -.78em; margin-left: .04em; letter-spacing: 0; }
.brand:hover .brand-name { color: var(--accent); }
.brand-name em { font: italic 400 15px/1 "Inter", sans-serif; color: var(--muted); letter-spacing: 0; margin-left: .25em; }
.nav { display: flex; gap: 2px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); padding: 7px 11px; border-radius: 999px; font-size: 13.5px; font-weight: 500; white-space: nowrap; text-decoration: none; transition: color .2s, background .2s; }
.nav a:hover { color: var(--text); background: var(--panel2); }
.actions { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
.nav + .actions { margin-left: 0; }
.ib {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  transition: background .2s, border-color .2s, transform .15s;
}
.ib:hover { background: var(--panel2); border-color: var(--line2); }
.ib:active { transform: scale(.94); }
.ib.sm { width: 30px; height: 30px; }
.ib.sm .i { width: 15px; height: 15px; }
.txt-ib { width: auto; padding: 0 10px; border-radius: 999px; font: 600 12.5px/1 "Inter", sans-serif; letter-spacing: .02em; }
.ib[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.sync-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.sync-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.sync-pill.ok .dot { background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: ping 2.4s infinite; }
.sync-pill.busy .dot { background: var(--accent); animation: blink 1s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(70,211,154,.6); } 80%, 100% { box-shadow: 0 0 0 8px rgba(70,211,154,0); } }
@keyframes blink { 50% { opacity: .3; } }
@media (max-width: 1100px) { .nav { display: none; } .nav + .actions { margin-left: auto; } }
@media (max-width: 560px) {
  .bar { gap: 8px; }
  .brand-name em { display: none; }
  .brand { gap: 9px; }
  .mark { width: 30px; height: 18px; }
  .brand-name { font-size: 17px; }
  .sync-pill .txt { display: none; }
  .sync-pill { padding: 0 11px; height: 34px; }
  .actions { gap: 4px; }
  .ib { width: 34px; height: 34px; }
  #btnTheme { display: none; }
  .txt-ib { width: auto; padding: 0 9px; }
}
@media (max-width: 359px) { .mark { display: none; } }

/* ---------- layout ---------- */
main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)) 40px max(16px, env(safe-area-inset-right)); }
.sec { padding-top: 56px; }
.sec-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.sec-h h2 { font: 700 clamp(26px, 3.4vw, 38px)/1.1 "Cinzel", serif; letter-spacing: .01em; }
.sec-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card {
  position: relative; border-radius: 22px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 50px -30px rgba(0,0,0,.6);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.hint { color: var(--muted); font-size: 13px; }
.sel { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; color: var(--muted); }
.sel select, .sel input { border: 0; background: transparent; height: 38px; padding: 0 8px 0 0; color: var(--text); font-weight: 500; min-width: 0; outline: none; }
.sel:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--glow); }
.sel select option { background: var(--bg2); color: var(--text); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px; white-space: nowrap;
  box-shadow: 0 8px 24px -12px var(--glow); transition: transform .15s, filter .2s, background .2s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; filter: none; transform: none; }
.btn.ghost { background: var(--panel); color: var(--text); border-color: var(--line2); box-shadow: none; }
.btn.ghost:hover { background: var(--panel2); }
.btn.big { height: 52px; padding: 0 30px; font-size: 16px; min-width: 150px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.stop { background: var(--accent2); color: #fff; box-shadow: 0 8px 24px -12px var(--accent2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-btns.center { justify-content: center; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.linkish:hover { text-decoration: underline; }
.badge { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--accent); border: 1px solid currentColor; vertical-align: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chips button {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: 13px; font-weight: 500; transition: all .2s;
}
.chips button:hover { color: var(--text); border-color: var(--line2); }
.chips button[aria-checked="true"], .chips .chip-btn[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); box-shadow: 0 6px 18px -10px var(--glow); }
.chips.small button { height: 30px; padding: 0 12px; font-size: 12.5px; }
.chip-btn { font-family: "JetBrains Mono", monospace !important; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(300px, 560px) minmax(0, 1fr); gap: 40px 56px; align-items: center;
  min-height: calc(100vh - 60px); padding: 32px 0 24px;
}
.watch-col { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; }
.watch { position: relative; width: 100%; aspect-ratio: 1 / 1; display: grid; place-items: center; }
.watch::before {
  content: ""; position: absolute; inset: 4%; border-radius: 50%;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.75), 0 0 120px -20px var(--glow);
}
[data-theme="ivory"] .watch::before { box-shadow: 0 40px 70px -24px rgba(60,40,10,.45), 0 0 90px -30px var(--glow); }
.watch canvas { position: relative; display: block; cursor: zoom-in; }
.readout { min-width: 0; display: flex; flex-direction: column; gap: 14px; container-type: inline-size; }
.place {
  align-self: flex-start; display: inline-flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 6px 14px 6px 10px; margin-left: -10px; border-radius: 14px; border: 1px solid transparent; background: none; text-align: left;
  transition: background .2s, border-color .2s;
}
.place:hover { background: var(--panel); border-color: var(--line); }
.place .i { color: var(--accent); align-self: center; }
.place-city { font: 700 clamp(24px, 3vw, 34px)/1.1 "Cinzel", serif; }
.place-country { color: var(--muted); font-size: 15px; }
.place-chg { font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.zone { color: var(--muted); font-size: 14px; }
.date { font-size: clamp(17px, 1.6vw, 20px); font-weight: 500; }
.facts { color: var(--muted); font-size: 14px; margin-top: -8px; }
.readout .chips { justify-content: flex-start; }
.note { color: var(--muted); font-size: 13px; }
.note:empty { display: none; }
#syncNote::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 8px; vertical-align: 1px; }

/* digital: elegant */
/* --dsz sizes every digital style; it follows the readout's own width where
   container units exist (see the @supports block after the media queries). */
.digital { --dsz: clamp(48px, 7.6vw, 116px); min-height: 1em; max-width: 100%; }
.dg-el { display: flex; align-items: baseline; flex-wrap: nowrap; white-space: nowrap; font: 200 var(--dsz)/1 "Inter", sans-serif; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.dg-el .dg-c1, .dg-el .dg-c2 { margin: 0 .02em; transform: translateY(-.06em); color: var(--accent); transition: opacity .25s; }
.digital.tick .dg-c1, .digital.tick .dg-c2 { opacity: .35; }
.dg-el .dg-ss { color: var(--text); }
.dg-el .dg-ms { font-size: .36em; font-weight: 300; color: var(--accent); margin-left: .08em; letter-spacing: 0; min-width: 2.3em; }
.dg-el .dg-ap { font-size: .22em; font-weight: 600; letter-spacing: .12em; color: var(--muted); margin-left: .6em; }
[data-theme="synth"] .dg-el { text-shadow: 0 0 24px rgba(255,79,216,.45); }

/* digital: flip */
.dg-flip { --fh: calc(var(--dsz) * .95); display: flex; align-items: center; gap: 10px; perspective: 700px; }
.fc { position: relative; width: calc(var(--fh) * 1.22); height: var(--fh); font: 600 calc(var(--fh) * .7)/1 "Inter", sans-serif; color: #f4f1ea; letter-spacing: -.02em; }
.fc > div { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; background: linear-gradient(180deg, var(--flip1), var(--flip2)); }
.fc-top, .fc-ftop { top: 0; border-radius: 14px 14px 0 0; }
.fc-bot, .fc-fbot { bottom: 0; border-radius: 0 0 14px 14px; }
.fc span { display: block; height: var(--fh); line-height: var(--fh); text-align: center; }
.fc-bot span, .fc-fbot span { transform: translateY(-50%); }
.fc-ftop { transform-origin: 50% 100%; z-index: 2; backface-visibility: hidden; }
.fc-fbot { transform-origin: 50% 0; z-index: 2; transform: rotateX(90deg); backface-visibility: hidden; }
.fc.flip .fc-ftop { animation: flipTop .28s ease-in forwards; }
.fc.flip .fc-fbot { animation: flipBot .28s .28s ease-out forwards; }
.fc::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: rgba(0,0,0,.55); z-index: 3; }
.fc::before { content: ""; position: absolute; inset: 0; border-radius: 14px; box-shadow: 0 18px 30px -16px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.06) inset; z-index: 4; pointer-events: none; }
@keyframes flipTop { from { transform: rotateX(0); } to { transform: rotateX(-90deg); } }
@keyframes flipBot { from { transform: rotateX(90deg); } to { transform: rotateX(0); } }
.fsep { font: 300 calc(var(--fh) * .6)/1 "Inter", sans-serif; color: var(--accent); margin-top: -.1em; }
.fside { display: flex; flex-direction: column; justify-content: space-between; align-self: stretch; padding: 4px 0 2px 4px; }
.fap { font-weight: 700; letter-spacing: .12em; color: var(--muted); font-size: 13px; }
.fms { font: 400 calc(var(--fh) * .26)/1 "JetBrains Mono", monospace; color: var(--accent); }

/* digital: LED */
.dg-led { display: flex; align-items: flex-end; gap: clamp(4px, .7vw, 9px); transform: skewX(-6deg); filter: drop-shadow(0 0 10px var(--glow)); }
.led-d { height: calc(var(--dsz) * .92); width: auto; }
.led-d.small { height: calc(var(--dsz) * .4); }
.led-col { height: calc(var(--dsz) * .92); width: auto; }
.led-dot { height: calc(var(--dsz) * .4); width: auto; }
.led-ms { display: inline-flex; align-items: flex-end; gap: 3px; margin-left: 4px; }
.seg { fill: var(--seg-off); transition: fill .08s; }
.seg.on { fill: var(--accent); }
.led-ap { font: 700 13px/1 "JetBrains Mono", monospace; color: var(--accent); margin-left: 8px; letter-spacing: .1em; align-self: flex-start; }

/* progress bars */
.bars { display: grid; gap: 9px; margin-top: 4px; max-width: 620px; }
.bar-row { display: grid; grid-template-columns: 54px minmax(60px, 1fr) 112px; grid-template-areas: "n t p" ". l l"; align-items: center; column-gap: 12px; row-gap: 0; }
.bar-name { grid-area: n; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bar-track { grid-area: t; height: 6px; border-radius: 99px; background: var(--panel2); overflow: hidden; box-shadow: 0 0 0 1px var(--line) inset; }
.bar-fill { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent)); box-shadow: 0 0 12px var(--glow); }
.bar-pct { grid-area: p; font: 500 13px/1 "JetBrains Mono", monospace; text-align: right; color: var(--text); }
.bar-left { grid-area: l; font-size: 11.5px; color: var(--faint); margin-top: 2px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 22px; gap: 26px; }
  .watch-col { max-width: min(480px, 100%); margin: 0 auto; }
  .readout { align-items: center; text-align: center; }
  .place { align-self: center; margin-left: 0; justify-content: center; }
  .readout .chips { justify-content: center; }
  .digital { display: flex; justify-content: center; max-width: 100%; }
  .bars { width: 100%; margin-left: auto; margin-right: auto; text-align: left; }
}
@media (max-width: 560px) {
  .digital { --dsz: clamp(36px, 13.5vw, 64px); }
  .dg-flip { gap: 5px; }
  .fside { padding-left: 2px; }
  .fms { font-size: 12px; }
  .bar-row { grid-template-columns: 48px minmax(40px, 1fr) 96px; column-gap: 8px; }
  .bar-pct { font-size: 11.5px; }
}
@supports (width: 1cqi) {
  .digital { --dsz: min(116px, 15.5cqi); }
  .digital[data-style="flip"] { --dsz: min(124px, 15cqi); }
  .digital[data-style="led"] { --dsz: min(116px, 14.5cqi); }
}

/* ---------- world clock ---------- */
.cities { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.city {
  position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center;
  padding: 16px 16px 16px 16px; border-radius: 20px; border: 1px solid var(--line); overflow: hidden;
  background: linear-gradient(160deg, var(--panel2), var(--panel)); transition: border-color .25s, transform .25s, background .6s;
}
.city::before { content: ""; position: absolute; inset: 0; opacity: .9; z-index: 0; pointer-events: none; transition: background .8s; }
.city > * { position: relative; z-index: 1; }
.city:hover { border-color: var(--line2); transform: translateY(-2px); }
.city.sky-day::before { background: linear-gradient(160deg, rgba(120,180,255,.20), rgba(255,220,150,.10) 70%); }
.city.sky-gold::before { background: linear-gradient(160deg, rgba(255,170,90,.28), rgba(255,110,90,.10) 70%); }
.city.sky-twi::before { background: linear-gradient(160deg, rgba(160,110,220,.24), rgba(255,140,110,.10) 75%); }
.city.sky-dusk::before { background: linear-gradient(160deg, rgba(60,70,160,.30), rgba(120,80,170,.10) 75%); }
.city.sky-night::before { background: linear-gradient(160deg, rgba(10,16,48,.55), rgba(30,40,90,.15) 75%); }
[data-theme="ivory"] .city.sky-night::before { background: linear-gradient(160deg, rgba(40,50,110,.16), rgba(40,50,110,.04) 75%); }
.city-face { width: 64px; height: 64px; display: block; }
.city-info { min-width: 0; }
.city-name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 58px; }
.city-country { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-time { font: 300 30px/1.15 "Inter", sans-serif; letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; }
.city-time .t-sec { font-size: .55em; color: var(--muted); margin-left: 1px; }
.city-time .t-ap { font-size: .4em; font-weight: 600; letter-spacing: .1em; color: var(--muted); margin-left: 6px; }
.city-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-meta .badge { font-size: 9.5px; margin-left: 6px; }
.city-acts { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; opacity: .55; transition: opacity .2s; }
.city:hover .city-acts, .city:focus-within .city-acts { opacity: 1; }
@media (hover: none) { .city-acts { opacity: 1; } }
.city-grip { position: absolute !important; left: 4px; top: 50%; transform: translateY(-50%); color: var(--faint); opacity: 0; cursor: grab; transition: opacity .2s; }
.city:hover .city-grip { opacity: .8; }
.city[draggable="true"] { cursor: grab; }
.city.dragging { opacity: .45; }
.city.drop { border-color: var(--accent); box-shadow: 0 0 0 2px var(--glow); }
.add-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 102px; border: 1.5px dashed var(--line2); background: transparent; color: var(--muted); font-weight: 600; grid-template-columns: none; }
.add-tile:hover { color: var(--accent); border-color: var(--accent); }
.add-tile .i { width: 22px; height: 22px; }

/* ---------- map ---------- */
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg-day { background: var(--mapday); box-shadow: 0 0 8px var(--mapday); }
.lg-twi { background: var(--maptwi); }
.lg-night { background: var(--mapnight); }
.lg-sun { background: radial-gradient(circle, #fff6d8 20%, #ffb347 60%, transparent 70%); width: 14px !important; height: 14px !important; }
.lg-moon { background: #f2ead2; box-shadow: inset -3px 0 0 #0b1222; }
.map-wrap { overflow: hidden; aspect-ratio: 360 / 144; padding: 0; touch-action: pan-y; }
.map-wrap canvas { display: block; width: 100%; height: 100%; }
.map-pins { position: absolute; inset: 0; pointer-events: none; }
.pin { position: absolute; transform: translate(-50%, -50%); }
.sun-pin { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle, #fffbe8 0 18%, #ffd36b 30%, rgba(255,179,71,.55) 45%, rgba(255,179,71,0) 70%); animation: sunpulse 3.2s ease-in-out infinite; }
@keyframes sunpulse { 50% { transform: translate(-50%, -50%) scale(1.18); } }
.moon-pin canvas { width: 22px; height: 22px; display: block; filter: drop-shadow(0 0 6px rgba(255,244,214,.55)); }
.city-pin i { display: block; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.45), 0 0 10px rgba(255,255,255,.7); }
.city-pin.home i { width: 10px; height: 10px; background: var(--accent); box-shadow: 0 0 0 2px rgba(0,0,0,.45); }
.city-pin.home::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid var(--accent); animation: homering 2.4s ease-out infinite; }
@keyframes homering { from { transform: scale(1); opacity: .9; } to { transform: scale(3.4); opacity: 0; } }
.pin-label { position: absolute; top: 50%; white-space: nowrap; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: rgba(5,8,16,.72); color: #f4f6fb; transform: translateY(-50%); letter-spacing: .01em; }
.lbl-r { left: 9px; }
.lbl-l { right: 9px; }
.lbl-t { left: 50%; top: auto; bottom: 8px; transform: translateX(-50%); }
.lbl-b { left: 50%; top: 8px; transform: translateX(-50%); }
.city-pin.home .pin-label { background: var(--accent); color: var(--accent-ink); }
.map-tip { position: absolute; z-index: 5; min-width: 150px; padding: 9px 12px; border-radius: 12px; background: rgba(6,10,20,.92); color: #eef2fa; border: 1px solid rgba(255,255,255,.12); font-size: 12.5px; display: grid; gap: 2px; pointer-events: none; box-shadow: 0 12px 30px -10px rgba(0,0,0,.6); }
.map-tip strong { font-size: 13.5px; }
.map-tip span { color: #b8c2d6; }
.map-foot { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
@media (max-width: 700px) { .pin-label { font-size: 9.5px; padding: 1px 5px; } .sun-pin { width: 24px; height: 24px; } }

/* ---------- planner ---------- */
.pl-sel { margin-bottom: 14px; }
.pl-lead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 15px; margin-bottom: 10px; }
.pl-lead strong { color: var(--accent); }
.pl-lead .btn { margin-left: auto; }
.pl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pl-list li { display: inline-flex; gap: 8px; align-items: baseline; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; }
.pl-list .pl-c { font-weight: 600; }
.pl-list .pl-v { color: var(--muted); }
.pl-list li.b-w { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.pl-list li.b-n { opacity: .75; }
.planner { padding: 6px; overflow: hidden; }
.pl-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; position: relative; border-radius: 16px; }
.pl-table { border-collapse: separate; border-spacing: 3px; font-size: 12.5px; }
.pl-table th, .pl-table td { padding: 0; }
.pl-corner, .pl-city { position: sticky; left: 0; z-index: 2; text-align: left; background: var(--bg2); min-width: 150px; max-width: 170px; padding: 6px 12px !important; border-radius: 10px; }
.pl-corner span, .pl-name { display: flex; align-items: center; font-weight: 600; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-corner small, .pl-city small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; white-space: nowrap; }
.pl-h button { width: 100%; min-width: 46px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.pl-h button:hover { color: var(--text); background: var(--panel2); }
.pl-h.sel button { color: var(--accent-ink); background: var(--accent); }
.pl-table td { min-width: 46px; height: 46px; text-align: center; border-radius: 9px; cursor: pointer; transition: transform .12s, box-shadow .2s; vertical-align: middle; }
.pl-table td:hover { transform: scale(1.06); }
.pl-t { display: block; font-weight: 600; font-size: 12.5px; }
.pl-d { display: block; font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
td.b-n { background: rgba(20,30,70,.55); color: #93a2c8; }
td.b-e { background: rgba(120,110,200,.22); color: var(--text); }
td.b-w { background: color-mix(in srgb, var(--accent) 24%, transparent); color: var(--text); }
[data-theme="ivory"] td.b-n { background: rgba(40,50,100,.14); color: #4a5578; }
td.sel { box-shadow: 0 0 0 2px var(--accent), 0 0 18px -4px var(--glow); }
tr.home-row td { font-weight: 700; }
.pl-now { position: absolute; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; background: var(--accent2); box-shadow: 0 0 10px var(--accent2); pointer-events: none; z-index: 1; border-radius: 2px; }
.pl-now::before { content: "now"; position: absolute; top: -2px; left: 4px; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: var(--accent2); text-transform: uppercase; }
.pl-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 12px; }
.pl-key i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; }
.k-night { background: rgba(20,30,70,.8); }
.k-early { background: rgba(120,110,200,.45); }
.k-work { background: color-mix(in srgb, var(--accent) 45%, transparent); }
@media (max-width: 560px) { .pl-ctrl { width: 100%; } .pl-ctrl .sel { flex: 1 1 auto; } .pl-corner, .pl-city { min-width: 112px; max-width: 120px; } }

/* ---------- sun & moon ---------- */
.sky-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .sky-grid { grid-template-columns: 1fr; } }
.sky-grid .card { padding: 20px 22px 22px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-h h3 { display: inline-flex; align-items: center; gap: 9px; font: 700 20px/1 "Cinzel", serif; }
.card-h h3 .i { color: var(--accent); }
.live { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sun-arc { width: 100%; height: auto; display: block; margin-bottom: 14px; overflow: visible; }
.sun-arc .tw { fill: #7d6bd6; }
.sun-arc .grid { stroke: var(--line); stroke-width: 1; }
.sun-arc .lab { fill: var(--muted); font: 600 13px "Inter", sans-serif; }
.sun-arc .lab.end { text-anchor: end; }
.sun-arc .lab.mid { text-anchor: middle; fill: var(--text); }
.sun-arc .curve { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 0 6px var(--glow)); }
.sun-arc .horizon { stroke: var(--text); stroke-opacity: .55; stroke-width: 1.5; stroke-dasharray: 4 5; }
.sun-arc .rs { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.sun-arc .noon { stroke: var(--accent); stroke-opacity: .4; stroke-dasharray: 2 4; }
.sun-arc .nowline { stroke: var(--accent2); stroke-width: 1.5; stroke-opacity: .7; }
.sun-arc .sun-dot { fill: #fff5d6; stroke: #ffb347; stroke-width: 2; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 26px; margin: 0; }
@media (max-width: 560px) { .sun-arc .lab { font-size: 22px; } .times { gap: 0 16px; } .times .tv { font-size: 15px; } }
.t-row { padding: 9px 0; border-top: 1px solid var(--line); min-width: 0; }
.t-row.hi:first-child { grid-column: 1 / -1; }
.times dt { font-size: 12px; color: var(--muted); }
.times dd { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.times .tv { font-size: 16px; font-weight: 500; }
.times small { font-size: 11.5px; color: var(--faint); }
.times .hi .tv { color: var(--accent); font-weight: 600; }
.t-row.dim { opacity: .75; }
.moon-body { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
#moonCanvas { width: 160px; height: 160px; flex: none; }
.moon-info { flex: 1 1 180px; min-width: 0; }
.moon-name { font: 700 22px/1.2 "Cinzel", serif; margin-bottom: 8px; }
.moon-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 13.5px; }
.moon-dl dt { color: var(--muted); }
.moon-dl dd { margin: 0; font-weight: 500; }
.phases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.phases li { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.ph-ico { width: 28px; height: 28px; flex: none; }
.phases strong { display: block; font-size: 13px; }
.phases span, .phases small { display: block; font-size: 12px; color: var(--muted); }
.phases small { color: var(--faint); }
.sky-empty { padding: 24px; display: grid; gap: 14px; justify-items: start; }

/* ---------- tools ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"] { height: 36px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.tabs [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -10px var(--glow); }
.panes { padding: 26px; }
@media (max-width: 560px) {
  .panes { padding: 18px 14px; }
  .tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .tabs [role="tab"] { padding: 0 4px; font-size: 12.5px; }
  .sys.gps .sys-big { font-size: 21px; }
}
.sys.gps .sys-big { font-size: 22px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.dial { position: relative; width: min(300px, 78vw); aspect-ratio: 1; display: grid; place-items: center; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring .track { fill: none; stroke: var(--panel2); stroke-width: 6; }
.ring .prog { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--glow)); transition: stroke-dashoffset .1s linear; }
.ring .tk { stroke: var(--faint); stroke-width: 1; }
.ring .tk.big { stroke: var(--muted); stroke-width: 2; }
.read { position: relative; text-align: center; display: grid; gap: 6px; }
.read-line { display: flex; align-items: baseline; justify-content: center; }
.read-main { font: 200 clamp(40px, 9vw, 58px)/1 "Inter", sans-serif; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.read-ms { font: 300 clamp(18px, 4vw, 24px)/1 "JetBrains Mono", monospace; color: var(--accent); min-width: 2.6em; text-align: left; }
.read-ms:empty { display: none; }
.read-sub { font-size: 13px; color: var(--muted); }
.laps { list-style: none; margin: 0; padding: 0; width: min(520px, 100%); max-height: 300px; overflow-y: auto; }
.laps li { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 9px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.laps .lap-n { color: var(--muted); }
.laps .lap-t { text-align: center; font-weight: 600; }
.laps .lap-s { text-align: right; color: var(--muted); }
.laps li.best .lap-t { color: var(--good); }
.laps li.worst .lap-t { color: var(--bad); }
.tm-set { display: flex; gap: 10px; justify-content: center; }
.tm:not(.idle) .tm-set { display: none; }
.num { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.num input { width: 3.2ch; border: 0; background: transparent; font: 300 28px/1 "Inter", sans-serif; text-align: right; outline: none; -moz-appearance: textfield; }
.num input::-webkit-inner-spin-button, .num input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.num:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--glow); }
.num span { color: var(--muted); font-size: 13px; }
.presets { max-width: 620px; }
.tm.ringing .dial { animation: ringshake .5s infinite; }
.tm.ringing .ring .track { stroke: var(--accent2); }
@keyframes ringshake { 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .tm.ringing .dial { animation: none; } }
.al-add, .cd-add { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; width: 100%; }
.al-add input, .al-add select, .cd-add input {
  height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); color: var(--text); outline: none; min-width: 0;
}
.al-add input[type="time"] { font: 300 22px/1 "Inter", sans-serif; width: 150px; }
.al-add input[type="text"], .cd-add input[type="text"] { flex: 1 1 200px; max-width: 320px; }
.al-add input:focus, .cd-add input:focus, .al-add select:focus { border-color: var(--accent); }
.days { display: inline-flex; gap: 4px; }
.day { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line2); background: transparent; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.day[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.al-list { list-style: none; margin: 0; padding: 0; width: min(640px, 100%); display: grid; gap: 10px; }
.al-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
@media (max-width: 560px) { .al-list li { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 12px; } .al-info { grid-column: 1 / -1; grid-row: 2; } }
.al-list li.off { opacity: .55; }
.al-list li.empty { display: block; text-align: center; color: var(--muted); }
.al-time { font: 200 34px/1 "Inter", sans-serif; letter-spacing: -.02em; }
.al-info strong { display: block; }
.al-next { color: var(--muted); font-size: 12.5px; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.knob { position: absolute; inset: 0; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line2); transition: background .2s; }
.knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + .knob { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .knob::after { transform: translateX(20px); background: var(--accent-ink); }
.switch input:focus-visible + .knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool .hint { text-align: center; max-width: 620px; }
.cd-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cd-card { position: relative; padding: 18px 18px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); }
.cd-card.fixed { background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 16%, transparent), var(--panel)); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.cd-card h4 { font: 700 17px/1.2 "Cinzel", serif; padding-right: 34px; margin-bottom: 10px; }
.cd-big { display: flex; gap: 6px; flex-wrap: wrap; }
.cd-cell { display: grid; justify-items: center; min-width: 46px; padding: 6px 4px; border-radius: 10px; background: rgba(0,0,0,.18); }
[data-theme="ivory"] .cd-cell { background: rgba(60,40,10,.06); }
.cd-cell b { font: 300 22px/1 "Inter", sans-serif; font-variant-numeric: tabular-nums; }
.cd-cell:last-child b { font-family: "JetBrains Mono", monospace; font-size: 15px; color: var(--accent); padding-top: 4px; }
.cd-cell small { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.cd-when { margin-top: 10px; font-size: 13px; color: var(--muted); }
.cd-state { font-size: 12px; color: var(--faint); }
.cd-card.past .cd-big { opacity: .6; }
.cd-del { position: absolute; top: 12px; right: 12px; }

/* ---------- time systems ---------- */
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.sys { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sys h3 { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.sys-big { font: 300 26px/1.15 "JetBrains Mono", monospace; letter-spacing: -.02em; overflow-wrap: anywhere; }
.sys-sub { font-size: 12.5px; color: var(--text); opacity: .8; overflow-wrap: anywhere; }
.sys-about { font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 8px; }
.sys.rom .sys-big { font-family: "Cinzel", serif; font-weight: 500; font-size: 24px; letter-spacing: .04em; }
.sys.cal .sys-big { font-family: "Inter", sans-serif; }
.bin-grid { display: flex; gap: 8px; justify-content: center; margin: 6px 0 4px; }
.bin-col { display: grid; gap: 7px; }
.bin-col.odd { margin-right: 6px; }
.bin-col:last-child { margin-right: 0; }
.led { width: 20px; height: 20px; border-radius: 50%; background: var(--panel2); box-shadow: 0 0 0 1px var(--line) inset; transition: background .15s, box-shadow .15s; }
.led.on { background: var(--accent); box-shadow: 0 0 12px var(--glow), 0 0 0 1px rgba(255,255,255,.2) inset; }
.led.void { visibility: hidden; }
.binary .sys-sub { text-align: center; font-family: "JetBrains Mono", monospace; }
.word-grid { display: grid; grid-template-columns: repeat(11, 1fr); gap: 2px 0; font: 600 14px/1.5 "JetBrains Mono", monospace; text-align: center; color: var(--faint); margin: 4px 0; user-select: none; }
.word-grid span { opacity: .45; transition: color .4s, text-shadow .4s, opacity .4s; }
.word-grid span.on { color: var(--accent); opacity: 1; text-shadow: 0 0 10px var(--glow); }
.word-dots { display: flex; gap: 8px; justify-content: center; margin: 2px 0 6px; }
.word-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--panel2); }
.word-dots i.on { background: var(--accent); box-shadow: 0 0 8px var(--glow); }
.words .sys-sub { text-align: center; }

/* ---------- footer ---------- */
.foot { max-width: 1280px; margin: 40px auto 0; padding: 28px max(16px, env(safe-area-inset-left)) 40px; border-top: 1px solid var(--line); display: grid; gap: 8px; justify-items: center; text-align: center; color: var(--muted); font-size: 13.5px; }
.foot a { font-family: "Cinzel", serif; font-weight: 700; color: var(--text); }
/* The legal pages and the copyright and trademark lines, as on every
   SwiftLife page. */
.foot .legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; }
.foot .legal a { padding: 6px 0; font: inherit; color: var(--muted); }
.foot .legal a:hover { color: var(--text); }
.foot .own p { margin: 0; font-size: 12.5px; line-height: 1.6; }

/* ---------- dialogs ---------- */
dialog.dlg {
  width: min(560px, calc(100vw - 24px)); max-height: min(86vh, 760px); padding: 0; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--line2); background: var(--bg2); color: var(--text);
  box-shadow: 0 40px 100px -20px rgba(0,0,0,.7);
}
dialog.dlg.wide { width: min(880px, calc(100vw - 24px)); }
#dlgSearch { margin-top: min(10vh, 90px); height: min(640px, calc(100vh - min(10vh, 90px) - 24px)); }
#dlgSearch .dlg-in { height: 100%; }
#dlgSearch .search-list { flex: 1; max-height: none; }
dialog.dlg::backdrop { background: rgba(2,4,10,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog.dlg[open] { animation: pop .22s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.dlg-in { display: flex; flex-direction: column; max-height: inherit; min-height: 0; }
.dlg-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px 22px; border-bottom: 1px solid var(--line); }
.dlg-h h2 { font: 700 20px/1.2 "Cinzel", serif; }
.search-box { display: flex; align-items: center; gap: 10px; margin: 14px 18px 8px; padding: 0 14px; height: 48px; border-radius: 14px; border: 1px solid var(--line2); background: var(--panel); }
.search-box:focus-within { border-color: var(--accent); }
.search-box .i { color: var(--muted); }
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 16px; }
.search-list { list-style: none; margin: 0; padding: 4px 10px 14px; overflow-y: auto; min-height: 120px; max-height: 56vh; }
.search-list .opt { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.search-list .opt[aria-selected="true"] { background: var(--panel2); box-shadow: 0 0 0 1px var(--line2) inset; }
.opt-l, .opt-r { display: grid; min-width: 0; }
.opt-l strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-r { text-align: right; }
.opt-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.opt-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-list .taken { opacity: .55; }
.search-list .empty { padding: 18px 12px; color: var(--muted); font-size: 14px; }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; padding: 8px 22px 6px; overflow-y: auto; }
@media (max-width: 720px) { .set-grid { grid-template-columns: 1fr; } }
.set-grid fieldset { border: 0; margin: 0; padding: 14px 0; display: grid; gap: 10px; align-content: start; border-bottom: 1px solid var(--line); min-width: 0; }
.set-grid legend { padding: 0; margin-bottom: 4px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.set-grid .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.set-grid .row select, .set-grid .row input[type="range"] { height: 36px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel); padding: 0 10px; min-width: 0; max-width: 60%; }
.set-grid .row input[type="range"] { padding: 0; accent-color: var(--accent); border: 0; background: none; }
.set-grid .row select option { background: var(--bg2); }
.sw { display: flex; align-items: center; gap: 12px; font-size: 14px; cursor: pointer; }
.sw input { appearance: none; -webkit-appearance: none; width: 40px; height: 23px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line2); position: relative; flex: none; margin: 0; cursor: pointer; transition: background .2s; }
.sw input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.sw input:checked { background: var(--accent); border-color: var(--accent); }
.sw input:checked::after { transform: translateX(17px); background: var(--accent-ink); }
.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 4px; }
.swatch { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 12.5px; text-align: left; min-width: 0; }
.swatch-dot { width: 22px; height: 22px; border-radius: 50%; flex: none; background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%); box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset; }
.swatch-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swatch[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.dlg-f { display: flex; justify-content: space-between; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; padding: 18px 22px 24px; margin: 0; align-items: center; overflow-y: auto; min-height: 0; }
.keys dd { margin: 0; color: var(--muted); }
kbd { display: inline-grid; place-items: center; min-width: 30px; height: 28px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line2); border-bottom-width: 3px; background: var(--panel); font: 600 13px/1 "JetBrains Mono", monospace; }
dialog.ring { width: min(420px, calc(100vw - 24px)); text-align: center; }
dialog.ring .dlg-in { padding: 30px 24px 26px; gap: 10px; align-items: center; }
.ring-bell { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 0 var(--glow); animation: bellpulse 1.2s infinite; }
.ring-bell .i { width: 36px; height: 36px; animation: bellshake .6s infinite; }
@keyframes bellpulse { 70% { box-shadow: 0 0 0 26px rgba(0,0,0,0); } }
@keyframes bellshake { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
.ring-time { font: 200 54px/1 "Inter", sans-serif; letter-spacing: -.03em; margin-top: 8px; }
.ring-label { font-size: 17px; color: var(--muted); margin-bottom: 10px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 50; transform: translate(-50%, 140%);
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px;
  background: rgba(10,14,24,.94); color: #f1f4fa; border: 1px solid rgba(255,255,255,.12); font-size: 14px;
  box-shadow: 0 20px 50px -14px rgba(0,0,0,.7); transition: transform .3s cubic-bezier(.2,.9,.3,1.2), opacity .3s; opacity: 0; pointer-events: none;
}
.toast.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast-btn { border: 0; background: none; color: #ffd27a; font-weight: 700; padding: 4px 2px; }

/* ---------- full screen ---------- */
.focus-exit { display: none; }
body.focus { overflow: hidden; }
body.focus .bar, body.focus main > section:not(#clock), body.focus .foot { display: none; }
body.focus main { max-width: none; padding: 0; }
body.focus .hero { min-height: 100vh; height: 100vh; padding: 3vh 4vw; grid-template-columns: minmax(0, min(86vh, 48vw)) minmax(0, 1fr); gap: 4vw; }
body.focus .watch-col { max-width: none; }
body.focus .chips, body.focus .bars, body.focus .note, body.focus .place-chg { display: none; }
body.focus .digital { --dsz: clamp(56px, 8.5vw, 180px); }
@supports (width: 1cqi) {
  body.focus .digital { --dsz: min(190px, 15.5cqi); }
  body.focus .digital[data-style="flip"] { --dsz: min(190px, 15cqi); }
  body.focus .digital[data-style="led"] { --dsz: min(180px, 14.5cqi); }
}
body.focus .focus-exit { display: inline-flex; align-items: center; gap: 8px; position: fixed; top: 16px; right: 16px; z-index: 30; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel); color: var(--text); font-weight: 600; font-size: 13px; transition: opacity .4s; }
body.focus.idle { cursor: none; }
body.focus.idle .focus-exit { opacity: 0; }
@media (max-height: 500px) { body.focus { overflow-y: auto; } }
@media (orientation: portrait) {
  body.focus .hero { grid-template-columns: 1fr; height: auto; min-height: 100vh; align-content: center; }
  body.focus .watch-col { width: min(84vw, 56vh); margin: 0 auto; }
}

/* ---------- print: just the time ---------- */
@media print {
  .bar, .backdrop, .foot, .chips, .toast, main > section:not(#clock) { display: none !important; }
  body { background: #fff; color: #000; }
}
