/* Taylor's — desk dashboard.
   Palette comes from the leaf logo: leaf green + the sky blue of its original background.
   Light = morning sky. Dark = night garden (deep blue-green, never neutral black). */

:root {
  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  --gap: 0.9rem;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --dim: 0.55;
}

html { font-size: calc(10px + 0.9vmin); -webkit-text-size-adjust: 100%; }

html[data-theme="light"] {
  color-scheme: light;
  --bg-a: #e9f3f9;
  --bg-b: #cfe3f1;
  --glow: rgba(255, 255, 255, 0.9);
  --ink: #0f2a1e;
  --muted: #4a675a;
  --glass: rgba(255, 255, 255, 0.58);
  --paper: #fbfcf7;
  --line: rgba(15, 42, 30, 0.12);
  --shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 14px 34px -18px rgba(15, 60, 80, 0.35);
  --on-accent: #ffffff;
  --warn: #b3261e;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg-a: #0b1c24;
  --bg-b: #0d2b2d;
  --glow: rgba(70, 150, 130, 0.22);
  --ink: #e9f4ee;
  --muted: #94b0a5;
  --glass: rgba(255, 255, 255, 0.065);
  --paper: rgba(255, 255, 255, 0.07);
  --line: rgba(233, 244, 238, 0.12);
  --shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 16px 40px -20px rgba(0, 0, 0, 0.7);
  --on-accent: #06201a;
  --warn: #ff9a90;
}
html[data-theme="light"][data-accent="leaf"]  { --accent: #008540; }
html[data-theme="dark"][data-accent="leaf"]   { --accent: #3fcb7f; }
html[data-theme="light"][data-accent="sky"]   { --accent: #1b74ad; }
html[data-theme="dark"][data-accent="sky"]    { --accent: #8ccbf2; }
html[data-theme="light"][data-accent="berry"] { --accent: #ab3568; }
html[data-theme="dark"][data-accent="berry"]  { --accent: #f391bb; }
html[data-theme="light"][data-accent="sun"]   { --accent: #a86400; }
html[data-theme="dark"][data-accent="sun"]    { --accent: #f4b740; }

:root { --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent); --accent-mid: color-mix(in srgb, var(--accent) 34%, transparent); }

* { box-sizing: border-box; }
html, body {
  height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none;
  font-family: var(--font); color: var(--ink);
  background: radial-gradient(90rem 50rem at 8% -12%, var(--glow), transparent 62%), linear-gradient(165deg, var(--bg-a), var(--bg-b));
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
  font-variant-numeric: lining-nums tabular-nums;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
h2 { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
svg { display: block; }

/* ---------- layout ---------- */
.app {
  height: 100%; display: grid; gap: var(--gap);
  grid-template-columns: 1.08fr 1.2fr 1fr;
  padding: calc(var(--safe-t) + 0.9rem) calc(var(--safe-r) + 1rem) calc(var(--safe-b) + 0.9rem) calc(var(--safe-l) + 1rem);
  transition: opacity 1.2s ease, filter 1.2s ease;
}
.col { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }

/* ---------- logo mark (tinted by accent via mask) ---------- */
.logo-mark {
  display: inline-block; width: 1.7rem; height: 2.15rem; background: var(--accent);
  -webkit-mask: url(/img/logo.png) center / contain no-repeat; mask: url(/img/logo.png) center / contain no-repeat;
}
.logo-mark.big { width: 7rem; height: 8.9rem; }

#splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: linear-gradient(165deg, var(--bg-a), var(--bg-b)); transition: opacity .7s ease .15s; }
#splash.gone { opacity: 0; pointer-events: none; }

/* ---------- clock (the one big gesture; sits on the sky, not in a card) ---------- */
.clock { flex: 0 0 auto; padding: 0.2rem 0.5rem 0.2rem 0.4rem; }
.clock-top { display: flex; justify-content: space-between; align-items: center; min-height: 2.4rem; }
.icon-btn { width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.icon-btn:active { background: var(--accent-soft); }
.icon-btn svg { width: 1.45rem; height: 1.45rem; }
.time { display: flex; align-items: baseline; white-space: nowrap; margin-top: -0.1rem; }
#clockTime { font-size: 5.1rem; font-weight: 700; line-height: 1; letter-spacing: -0.035em; }
.secs { font-size: 1.9rem; font-weight: 700; color: var(--muted); margin-left: .35rem; letter-spacing: 0; }
.ampm { font-size: 1.35rem; font-weight: 700; color: var(--accent); margin-left: 0.45rem; letter-spacing: 0; }
.date { font-size: 1.4rem; font-weight: 600; color: var(--muted); margin-top: 0.35rem; }
.note-btn {
  display: inline-flex; align-items: center; gap: 0.55rem; margin-top: 0.9rem; padding: 0.7rem 1.15rem 0.7rem 0.95rem;
  border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 1.05rem;
}
.note-btn:active { transform: scale(0.97); }
.note-ico { width: 1.25rem; height: 1.25rem; display: block; }
.note-ico svg { width: 100%; height: 100%; }

/* ---------- shared panel bits ---------- */
.ph { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: 0 0.2rem 0.5rem; }
.ph-meta { color: var(--muted); font-size: 0.95rem; font-weight: 600; }
.card-glass {
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
}
.pill { padding: 0.6rem 1.1rem; border-radius: 999px; font-weight: 700; background: var(--accent-soft); color: var(--ink); }
.pill.solid { background: var(--accent); color: var(--on-accent); }
.pill:active { transform: scale(.97); }
.empty { color: var(--muted); padding: 1.2rem 0.4rem; font-size: 1.05rem; line-height: 1.4; }
.connect-card { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; padding: 1rem .4rem; color: var(--muted); font-size: 1.05rem; line-height: 1.4; }

/* ---------- calendar (open list on the background, divided by day) ---------- */
.calendar { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; padding-top: 0.4rem; }
.cal-scroll { position: relative; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 1rem; }
.cal-scroll::-webkit-scrollbar { display: none; }
.day-h { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.55rem 0.2rem 0.3rem; margin-top: 0.5rem; font-weight: 700; font-size: 1.05rem;
  background: color-mix(in srgb, var(--bg-a) 93%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: .7rem; }
.day-h small { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.allday { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 .2rem .4rem; }
.allday span { background: var(--accent-soft); border-radius: 999px; padding: .25rem .7rem; font-size: .95rem; font-weight: 600; }
.ev { display: grid; grid-template-columns: 4.1rem 1fr; gap: 0.6rem; padding: 0.65rem 0.7rem 0.65rem 0.5rem; border-radius: 1rem; position: relative; }
.ev + .ev { margin-top: 0.1rem; }
.ev .when { font-size: 1rem; font-weight: 700; line-height: 1.25; padding-top: 0.05rem; }
.ev .when small { display: block; color: var(--muted); font-weight: 600; font-size: .85rem; }
.ev .what { font-size: 1.12rem; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.ev .where { color: var(--muted); font-size: .92rem; margin-top: .15rem; font-weight: 500; }
.ev .tag { display: inline-block; margin-top: .3rem; font-size: .85rem; font-weight: 700; color: var(--accent); }
.ev.past { opacity: 0.45; }
.ev.now { background: var(--accent); color: var(--on-accent); }
.ev.now .when small, .ev.now .where, .ev.now .tag { color: inherit; opacity: .85; }
.ev.next { background: var(--paper); box-shadow: inset 0.28rem 0 0 var(--accent), var(--shadow); }
.ev.tentative .what { font-style: italic; }

/* ---------- weather ---------- */
.weather { flex: 1; min-height: 0; border-radius: 2rem; display: flex; flex-direction: column; overflow: hidden; }
.wx-head { padding: 0.9rem 1.4rem 0.1rem; display: grid; grid-template-columns: 1fr auto; row-gap: .15rem; align-items: center; }
.wx-loc { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.loc-btn { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: 1.1rem; padding: .2rem .5rem .2rem 0; }
.loc-btn svg { width: 1.05rem; height: 1.05rem; color: var(--accent); }
.wx-upd { color: var(--muted); font-size: .85rem; font-weight: 600; }
.wx-temp { font-size: 4.4rem; font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
.wx-ico { font-size: 3.3rem; line-height: 1; text-align: right; }
.wx-cond { grid-column: 1 / -1; font-size: 1.3rem; font-weight: 650; margin-top: .1rem; }
.wx-sub { grid-column: 1 / -1; color: var(--muted); font-size: 1rem; font-weight: 600; margin-top: .1rem; }
.wx-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.wx-chips span { background: var(--accent-soft); border-radius: 999px; padding: .25rem .65rem; font-size: .88rem; font-weight: 650; white-space: nowrap; }
.wx-banners { padding: 0 1.2rem; display: flex; flex-direction: column; gap: .45rem; }
.wx-banners:not(:empty) { padding-top: .7rem; }
.banner { display: flex; align-items: center; gap: .7rem; text-align: left; width: 100%; padding: .65rem .9rem; border-radius: 1rem; font-weight: 650; font-size: 1rem; line-height: 1.25; background: var(--paper); border: 1px solid var(--line); }
.banner .b-ico { font-size: 1.3rem; }
.banner small { display: block; font-weight: 600; color: var(--muted); font-size: .85rem; }
.banner.alert { background: color-mix(in srgb, #d93a2f 16%, var(--paper)); border-color: color-mix(in srgb, #d93a2f 45%, transparent); }
.banner.alert.mod { background: color-mix(in srgb, #e69b12 18%, var(--paper)); border-color: color-mix(in srgb, #e69b12 50%, transparent); }
.banner.rain { background: color-mix(in srgb, #3d8fd1 15%, var(--paper)); border-color: color-mix(in srgb, #3d8fd1 40%, transparent); }
.banner.calm { background: transparent; border-color: transparent; color: var(--muted); padding: .1rem .2rem; font-weight: 600; }

.wx-tabs { display: flex; gap: .3rem; margin: .7rem 1.2rem .55rem; padding: .25rem; background: var(--accent-soft); border-radius: 999px; }
.wx-tabs button { flex: 1; padding: .55rem .2rem; border-radius: 999px; font-weight: 700; font-size: .98rem; color: var(--muted); white-space: nowrap; }
.wx-tabs button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
html[data-theme="dark"] .wx-tabs button.on { background: var(--accent); color: var(--on-accent); }

.wx-slides { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.wx-slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; overflow-y: auto; padding: 0 1.2rem 1.1rem; scrollbar-width: none; position: relative; }
.slide::-webkit-scrollbar { display: none; }

.hours { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.hr { text-align: center; padding: .4rem .2rem .45rem; border-radius: 1rem; background: var(--paper); border: 1px solid var(--line); }
.hr.first { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.hr .t { font-size: .88rem; font-weight: 700; color: var(--muted); }
.hr.first .t { color: inherit; opacity: .85; }
.hr .ic { font-size: 1.45rem; line-height: 1.35; }
.hr .deg { font-size: 1.2rem; font-weight: 700; }
.hr .pp { font-size: .82rem; font-weight: 700; color: #3d8fd1; min-height: 1.1em; }
html[data-theme="dark"] .hr .pp { color: #7fc0f2; }
.hr.first .pp { color: inherit; opacity: .9; }

.days { display: flex; flex-direction: column; gap: .35rem; }
.dayrow { display: grid; grid-template-columns: 3.4rem 2.2rem 2.6rem 1fr; align-items: center; gap: .5rem; padding: .55rem .8rem; border-radius: 1rem; background: var(--paper); border: 1px solid var(--line); }
.dayrow .dn { font-weight: 700; font-size: 1.05rem; }
.dayrow .di { font-size: 1.6rem; line-height: 1; text-align: center; }
.dayrow .dp { font-size: .88rem; font-weight: 700; color: #3d8fd1; }
html[data-theme="dark"] .dayrow .dp { color: #7fc0f2; }
.dayrow .rng { display: grid; grid-template-columns: 2.4rem 1fr 2.4rem; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.02rem; }
.dayrow .rng .lo { color: var(--muted); text-align: right; }
.bar { height: .5rem; border-radius: 999px; background: var(--accent-soft); position: relative; }
.bar i { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, #5aa9e6, var(--accent) 55%, #f0a43a); }
.dayrow .dd { grid-column: 1 / -1; color: var(--muted); font-size: .92rem; font-weight: 600; margin-top: -.1rem; }
.days.big .dayrow { padding: .8rem .9rem; }
.days.big .dn { font-size: 1.2rem; }
.days.big .di { font-size: 2.1rem; }
.days.compact .dayrow { padding: .4rem .8rem; }
.days.compact .di { font-size: 1.35rem; }

/* radar */
.radar-slide { padding: 0 1.2rem 1.1rem; }
#radarMap { position: absolute; left: 1.2rem; right: 1.2rem; top: 0; bottom: 4.1rem; border-radius: 1.3rem; overflow: hidden; background: var(--paper); border: 1px solid var(--line); }
.radar-bar { position: absolute; left: 1.2rem; right: 1.2rem; bottom: 1.1rem; height: 2.7rem; display: flex; align-items: center; gap: .5rem; }
.chip { height: 2.4rem; min-width: 2.4rem; padding: 0 .75rem; border-radius: 999px; background: var(--accent-soft); font-weight: 700; font-size: .92rem; display: inline-grid; place-items: center; white-space: nowrap; }
.chip:active { background: var(--accent-mid); }
.chip.on { background: var(--accent); color: var(--on-accent); }
.chip svg { width: 1.1rem; height: 1.1rem; }
.radar-time { flex: 1; min-width: 0; font-weight: 650; color: var(--muted); font-size: .88rem; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zoom { display: flex; gap: .3rem; }
.leaflet-container { font-family: var(--font); background: var(--paper); }
.leaflet-control-attribution { font-size: .62rem; background: color-mix(in srgb, var(--paper) 80%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--muted); }
.leaflet-tile-pane .leaflet-layer { transition: opacity .3s linear; }
.leaflet-container.locked { cursor: default; }

/* ---------- Spotify tile ---------- */
.spotify { flex: 0 0 auto; position: relative; border-radius: 2rem; overflow: hidden; color: #fff; isolation: isolate;
  background: linear-gradient(140deg, #0e4a30, #0b2f3a); box-shadow: var(--shadow); }
.sp-bg { position: absolute; inset: -2rem; z-index: -2; background-size: cover; background-position: center; filter: blur(30px) saturate(1.4); opacity: 0; transition: opacity .8s ease; }
.sp-bg.on { opacity: 1; }
.spotify::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.52)); }
.sp-body { padding: 1.1rem 1.2rem 1rem; }
.sp-row { display: flex; gap: 1rem; align-items: center; }
.sp-art { flex: 0 0 auto; width: 6.9rem; height: 6.9rem; border-radius: 1.1rem; background: rgba(255,255,255,.12) center / cover; box-shadow: 0 10px 24px -10px rgba(0,0,0,.6); }
.sp-meta { min-width: 0; flex: 1; }
.sp-title { font-size: 1.3rem; font-weight: 750; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-artist { font-size: 1.02rem; font-weight: 600; opacity: .8; margin-top: .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-dev { font-size: .85rem; font-weight: 650; opacity: .62; margin-top: .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-prog { display: flex; align-items: center; gap: .6rem; margin-top: .85rem; font-size: .82rem; font-weight: 700; opacity: .9; }
.sp-track { flex: 1; height: 1.6rem; display: flex; align-items: center; touch-action: manipulation; }
.sp-track div { width: 100%; height: .38rem; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; }
.sp-track i { display: block; height: 100%; width: 0; background: #fff; border-radius: 999px; }
.sp-ctl { display: flex; align-items: center; justify-content: space-between; margin-top: .35rem; }
.sp-btns { display: flex; align-items: center; gap: .5rem; }
.sp-btn { width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.sp-btn svg { width: 1.6rem; height: 1.6rem; }
.sp-btn:active { background: rgba(255,255,255,.2); }
.sp-btn.play { width: 3.6rem; height: 3.6rem; background: #fff; color: #0b2f3a; }
.sp-btn.play svg { width: 1.7rem; height: 1.7rem; }
.sp-vol { display: flex; align-items: center; gap: .4rem; width: 38%; opacity: .95; }
.sp-vol svg { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 1.8rem; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: .38rem; border-radius: 999px; background: rgba(255,255,255,.28); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: #fff; margin-top: -.48rem; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.sp-empty { padding: .4rem 0; }
.sp-empty b { display: block; font-size: 1.25rem; margin-bottom: .3rem; }
.sp-empty p { margin: 0 0 .9rem; opacity: .8; font-size: 1rem; line-height: 1.35; }
.sp-empty .pill { background: #fff; color: #0b2f3a; }

@media (max-width: 1100px) { .sp-art { width: 5.6rem; height: 5.6rem; } }

/* ---------- mail ---------- */
.mail { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 1.4rem; box-shadow: var(--shadow); padding: 1rem 1rem 0.2rem; }
.mail-tabs { display: flex; gap: .25rem; background: var(--accent-soft); padding: .22rem; border-radius: 999px; }
.mail-tabs button { padding: .4rem .8rem; border-radius: 999px; font-weight: 700; font-size: .95rem; color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; }
.mail-tabs button.on { background: var(--accent); color: var(--on-accent); }
.badge { background: #d93a2f; color: #fff; border-radius: 999px; font-size: .78rem; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; display: inline-grid; place-items: center; font-weight: 800; }
.mail-who { color: var(--muted); font-size: .88rem; font-weight: 600; padding: 0 .3rem .4rem; min-height: 1.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -.4rem; padding: 0 .4rem .6rem; }
.mail-list::-webkit-scrollbar { display: none; }
.msg { display: block; width: 100%; text-align: left; padding: .65rem .3rem .65rem 1.1rem; border-top: 1px solid var(--line); position: relative; }
.msg:first-child { border-top: 0; }
.msg .l1 { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.msg .from { font-size: 1.02rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg .stamp { font-size: .85rem; color: var(--muted); font-weight: 600; white-space: nowrap; margin: 0; display: block; }
.msg .subj { display: block; font-size: .98rem; color: var(--muted); margin-top: .12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.msg.unread .from { font-weight: 800; }
.msg.unread .subj { color: var(--ink); font-weight: 650; }
.msg.unread::before { content: ""; position: absolute; left: .2rem; top: 1.05rem; width: .6rem; height: .6rem; border-radius: 50%; background: var(--accent); }
.msg .more { display: none; margin-top: .5rem; font-size: .95rem; line-height: 1.4; color: var(--ink); white-space: normal; font-weight: 500; }
.msg .more a { display: inline-block; margin-top: .5rem; color: var(--accent); font-weight: 800; }
.msg.open .subj { white-space: normal; color: var(--ink); }
.msg.open .more { display: block; }

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(8, 22, 20, .5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: calc(var(--safe-t) + 1.2rem) 1.5rem calc(var(--safe-b) + 1.2rem); }
.sheet-card { width: min(46rem, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--bg-a); color: var(--ink); border-radius: 1.8rem; border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); overflow: hidden; }
html[data-theme="dark"] .sheet-card { background: #10272b; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.4rem .6rem; }
.sheet-head h2 { font-size: 1.5rem; }
.sheet-body { overflow-y: auto; padding: 0 1.4rem 1.6rem; -webkit-overflow-scrolling: touch; }
.sec { margin-top: 1.3rem; }
.sec > h3 { margin: 0 0 .5rem; font-size: 1.05rem; font-weight: 750; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); min-height: 3.4rem; }
.row:first-of-type { border-top: 0; }
.row.col { flex-direction: column; align-items: flex-start; gap: .6rem; }
.row .lbl { font-weight: 650; font-size: 1.02rem; }
.row .lbl small { display: block; font-weight: 500; color: var(--muted); font-size: .88rem; margin-top: .1rem; }
.seg { display: inline-flex; gap: .2rem; padding: .2rem; background: var(--accent-soft); border-radius: 999px; flex-wrap: wrap; }
.seg button { padding: .5rem .95rem; border-radius: 999px; font-weight: 700; font-size: .98rem; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.swatches { display: flex; gap: .7rem; }
.sw { width: 2.7rem; height: 2.7rem; border-radius: 50%; border: 3px solid transparent; box-shadow: 0 0 0 1px var(--line); }
.sw.on { border-color: var(--bg-a); box-shadow: 0 0 0 3px var(--ink); }
html[data-theme="dark"] .sw.on { border-color: #10272b; }
.field { width: 100%; padding: .75rem 1rem; border-radius: .9rem; border: 1px solid var(--line); background: var(--paper); font-size: 1.05rem; -webkit-user-select: text; user-select: text; }
.field:focus { outline: 2px solid var(--accent); }
.results { display: flex; flex-direction: column; margin-top: .4rem; }
.results button { text-align: left; padding: .7rem .4rem; border-top: 1px solid var(--line); font-weight: 650; }
.results small { color: var(--muted); font-weight: 500; }
.stack { display: block; }
.status-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; margin-right: .5rem; background: var(--muted); }
.status-dot.ok { background: var(--accent); }
.note { color: var(--muted); font-size: .9rem; line-height: 1.4; margin: .3rem 0 0; }
.warn { color: var(--warn); }

/* ---------- toast, rotate ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 1.6rem); transform: translate(-50%, 2rem); opacity: 0; pointer-events: none; z-index: 60;
  background: var(--ink); color: var(--bg-a); padding: .8rem 1.3rem; border-radius: 999px; font-weight: 700; max-width: 80vw; transition: opacity .25s, transform .25s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.rotate { display: none; position: fixed; inset: 0; z-index: 70; background: linear-gradient(165deg, var(--bg-a), var(--bg-b)); flex-direction: column; align-items: center; justify-content: center; gap: 1.4rem; text-align: center; font-weight: 700; font-size: 1.3rem; padding: 2rem; }
.rotate p { margin: 0; }
@media (orientation: portrait) { .rotate { display: flex; } }

/* ---------- idle: dim everything except the clock; first tap only wakes ---------- */
html.idle .col-mid, html.idle .col-right, html.idle .calendar { opacity: calc(1 - var(--dim)); filter: saturate(0.7); }
html.idle[data-idle="clock"] .col-mid, html.idle[data-idle="clock"] .col-right, html.idle[data-idle="clock"] .calendar { opacity: 0.07; }
html.idle .note-btn, html.idle .icon-btn { opacity: .35; }
.col-mid, .col-right, .calendar, .note-btn, .icon-btn { transition: opacity 1.4s ease, filter 1.4s ease; }

@media (prefers-reduced-motion: reduce) { * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }

/* sliders inside sheets use the accent (the Spotify tile styles its own, white) */
.sheet input[type=range]::-webkit-slider-runnable-track { background: var(--accent-mid); }
.sheet input[type=range]::-webkit-slider-thumb { background: var(--accent); }
