/* ============ Tokens ============ */
:root {
  color-scheme: dark;
  /* Skin colours. skins.js overwrites these on load; the values here are the
     "经典" skin so the page still looks right if scripts are blocked. */
  --base-top: #0a0f1d;
  --base-mid: #070a14;
  --base-low: #05070e;
  --glow-top: #18233f;
  --glow-low: transparent;
  --orb-a: rgb(56 132 255 / 0.55);
  --orb-b: rgb(139 92 246 / 0.48);
  --orb-c: rgb(14 165 233 / 0.36);
  --orb-d: rgb(236 72 153 / 0.22);
  --orb-e: transparent;
  --tint: 230 94% 82%;
  --tint-2: 199 95% 74%;
  --accent-1: #7dd3fc;
  --accent-2: #a5b4fc;
  --accent-3: #f0abfc;
  --accent-soft: #e0e7ff;
  --ink: #0d1328;
  --pop-bg: rgb(15 20 40 / 0.78);
  --card-solid: rgb(22 28 48 / 0.94);
  --theme-color: #070a14;
  --text: #f7f8fb;
  --muted: rgba(255, 255, 255, 0.68);
  --faint: rgba(255, 255, 255, 0.44);
  --hair: rgba(255, 255, 255, 0.12);
  --hair-strong: rgba(255, 255, 255, 0.22);
  --glass-a: rgba(255, 255, 255, 0.105);
  --glass-b: rgba(255, 255, 255, 0.035);
  --good: #86efac;
  --warn: #fcd34d;
  --bad: #fda4af;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--base-low);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
  overflow-x: hidden;
}

svg { width: 1em; height: 1em; flex: none; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }

/* ============ Backdrop ============ */
/* One colour family per skin: bright at the top, deep at the bottom, tinted all the way down. */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background:
  radial-gradient(130% 62% at 18% -12%, var(--glow-top) 0%, transparent 64%),
  radial-gradient(130% 55% at 60% 116%, var(--glow-low) 0%, transparent 64%),
  linear-gradient(180deg, var(--base-top) 0%, var(--base-mid) 42%, var(--base-low) 100%); }
@supports (height: 100lvh) {
  /* Stay behind the collapsing browser toolbar on phones. */
  .backdrop { bottom: auto; height: 100lvh; }
}
.orb { position: absolute; display: block; border-radius: 50%; will-change: transform; }
.orb-a { width: 70vmax; height: 70vmax; left: calc(10% - 35vmax); top: calc(4% - 35vmax);
  background: radial-gradient(circle at center, var(--orb-a), transparent 62%); }
.orb-b { width: 62vmax; height: 62vmax; left: calc(96% - 31vmax); top: calc(30% - 31vmax);
  background: radial-gradient(circle at center, var(--orb-b), transparent 62%); }
.orb-c { width: 62vmax; height: 62vmax; left: calc(4% - 31vmax); top: calc(62% - 31vmax);
  background: radial-gradient(circle at center, var(--orb-c), transparent 62%); }
.orb-d { width: 58vmax; height: 58vmax; left: calc(94% - 29vmax); top: calc(88% - 29vmax);
  background: radial-gradient(circle at center, var(--orb-d), transparent 62%); }
.orb-e { width: 66vmax; height: 66vmax; left: calc(38% - 33vmax); top: calc(104% - 33vmax);
  background: radial-gradient(circle at center, var(--orb-e), transparent 62%); }
/* Soft diagonal light, like sun through a window. */
.beams { position: absolute; inset: -20%; pointer-events: none; background:
  linear-gradient(118deg, transparent 24%, hsl(var(--tint) / 0.1) 36%, transparent 47%,
    transparent 56%, hsl(var(--tint) / 0.06) 66%, transparent 78%); }
.grain { position: absolute; inset: -50%; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

@media (prefers-reduced-motion: no-preference) {
  .orb-a { animation: drift-a 28s var(--ease) infinite alternate; }
  .orb-b { animation: drift-b 34s var(--ease) infinite alternate; }
  .orb-c { animation: drift-c 40s var(--ease) infinite alternate; }
  .orb-d { animation: drift-d 30s var(--ease) infinite alternate; }
  .orb-e { animation: drift-e 36s var(--ease) infinite alternate; }
}
@keyframes drift-a { to { transform: translate3d(8vmax, 6vmax, 0) scale(1.08); } }
@keyframes drift-b { to { transform: translate3d(-10vmax, 8vmax, 0) scale(0.94); } }
@keyframes drift-c { to { transform: translate3d(9vmax, -7vmax, 0) scale(1.1); } }
@keyframes drift-d { to { transform: translate3d(-7vmax, -9vmax, 0) scale(1.12); } }
@keyframes drift-e { to { transform: translate3d(10vmax, -6vmax, 0) scale(0.95); } }

/* ---- "经典" skin: the original look, kept exactly as it first shipped ---- */
[data-skin="aurora"] { --text: #f5f7fc; --muted: rgba(226, 232, 255, 0.66); --faint: rgba(226, 232, 255, 0.42); }
[data-skin="aurora"] .backdrop { background:
  radial-gradient(120% 80% at 50% -20%, #18233f 0%, transparent 60%),
  linear-gradient(180deg, #0a0f1d 0%, #070a14 55%, #05070e 100%); }
[data-skin="aurora"] .orb-a { width: 70vmax; height: 70vmax; left: -22vmax; top: -26vmax; }
[data-skin="aurora"] .orb-b { width: 62vmax; height: 62vmax; left: auto; right: -24vmax; top: 4vmax; }
[data-skin="aurora"] .orb-c { width: 58vmax; height: 58vmax; left: 6vmax; top: auto; bottom: -30vmax; }
[data-skin="aurora"] .orb-d { width: 34vmax; height: 34vmax; left: auto; right: 8vmax; top: auto; bottom: 6vmax; }
[data-skin="aurora"] .orb-e, [data-skin="aurora"] .beams { display: none; }
[data-skin="aurora"] .hero-card { background: linear-gradient(150deg, var(--glass-a), var(--glass-b)); border-color: var(--hair); }
[data-skin="aurora"] .period .figure b { color: #fff; text-shadow: 0 0 28px rgba(165, 180, 252, 0.45); }
[data-skin="aurora"] .privacy { color: #d9f99d; background: rgba(134, 239, 172, 0.08); border-color: rgba(134, 239, 172, 0.2); }
[data-skin="aurora"] .brand-mark { background: linear-gradient(145deg, rgba(125, 211, 252, 0.28), rgba(167, 139, 250, 0.28)); }
[data-skin="aurora"] .art .glyph {
  background: linear-gradient(145deg, rgba(125, 211, 252, 0.22), rgba(167, 139, 250, 0.22));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 30px 60px -24px rgba(99, 102, 241, 0.6);
}
[data-skin="aurora"] .drop-icon { background: linear-gradient(145deg, #f8fafc, #c7d2fe); }
[data-skin="aurora"] .chip[aria-pressed="true"] .dot { background: linear-gradient(145deg, #bae6fd, #c4b5fd); }

/* ============ Glass ============ */
.glass {
  position: relative;
  background: linear-gradient(150deg, var(--glass-a), var(--glass-b));
  border: 1px solid var(--hair);
  border-radius: var(--radius-xl);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 24px 60px -28px rgba(0, 0, 0, 0.75);
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 38%);
  mix-blend-mode: soft-light;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--card-solid); }
}

/* ============ Layout ============ */
.topbar {
  width: min(1080px, 100%); margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 20px 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -0.01em; font-size: 16px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, hsl(var(--tint-2) / 0.28), hsl(var(--tint) / 0.28));
  border: 1px solid var(--hair-strong); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-size: 17px; color: var(--accent-soft);
}

main { width: min(1080px, 100%); margin: 0 auto; padding: 8px 16px 24px; }
.view { animation: rise 0.6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.pill-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--hair); border-radius: 999px; padding: 8px 14px;
  background: rgba(255, 255, 255, 0.08); font-size: 14px; cursor: pointer;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  transition: background 0.2s, transform 0.2s var(--ease);
}
.pill-btn:hover { background: rgba(255, 255, 255, 0.14); }
a.pill-btn { color: inherit; text-decoration: none; }
.pill-btn { white-space: nowrap; }
.lang-switch { padding: 8px 12px; font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em; }

/* ---- skin picker ---- */
.top-actions { display: flex; align-items: center; gap: 8px; }
.skin { position: relative; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--hair); background: rgba(255, 255, 255, 0.08); font-size: 19px;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  transition: background 0.2s, transform 0.2s var(--ease);
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.16); }
.icon-btn:active { transform: scale(0.94); }
.skin-pop {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 20; width: min(300px, calc(100vw - 32px));
  padding: 14px; border-radius: 22px; background: var(--pop-bg); border: 1px solid var(--hair-strong);
  -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  animation: pop 0.22s var(--ease) both; transform-origin: top right;
}
@keyframes pop { from { opacity: 0; transform: scale(0.94) translateY(-6px); } to { opacity: 1; transform: none; } }
.skin-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 12px; font-size: 14px; }
.skin-head span { color: var(--muted); font-size: 13px; }
.skin-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.swatch {
  position: relative; aspect-ratio: 1; width: 100%; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.2s var(--ease);
}
.swatch:hover { transform: scale(1.1); }
.swatch[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid #fff;
}
.skin-random {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px;
  padding: 10px 12px; border-radius: 14px; cursor: pointer; font-size: 14px; color: var(--muted);
  border: 1px solid var(--hair); background: rgba(255, 255, 255, 0.06); transition: background 0.2s, color 0.2s;
}
.skin-random svg { font-size: 17px; }
.skin-random[aria-pressed="true"] { background: rgba(255, 255, 255, 0.92); color: var(--ink); border-color: transparent; font-weight: 600; }
.pill-btn:active { transform: scale(0.97); }
.pill-btn.subtle { color: var(--muted); }

.eyebrow { margin: 0; color: var(--faint); font-size: 12.5px; letter-spacing: 0.06em; }
.label { margin: 0; color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.note { text-align: center; color: var(--faint); font-size: 13px; margin: 18px 0 0; }
.grad {
  background: linear-gradient(100deg, var(--accent-1), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============ Intro ============ */
.intro { max-width: 560px; margin: 0 auto; }
.hero { padding: 26px 4px 22px; }
.hero h1 { margin: 12px 0 14px; font-size: clamp(34px, 9vw, 52px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 720; }
.lead { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.6; }
.privacy {
  display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0;
  padding: 7px 12px 7px 10px; border-radius: 999px; font-size: 13px; color: var(--accent-soft);
  background: hsl(var(--tint) / 0.1); border: 1px solid hsl(var(--tint) / 0.24);
}
.privacy svg { font-size: 15px; }

.drop {
  display: flex; align-items: center; gap: 16px; padding: 18px 18px 18px 18px;
  border-radius: 26px; cursor: pointer; overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.drop:hover { transform: translateY(-2px); border-color: var(--hair-strong); }
.drop:active { transform: scale(0.99); }
.drop.over { border-color: hsl(var(--tint) / 0.7); box-shadow: 0 0 0 4px hsl(var(--tint) / 0.16), 0 24px 60px -28px rgba(0, 0, 0, 0.75); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop-icon {
  width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, #f8fafc, var(--accent-2)); color: var(--ink); font-size: 24px;
  box-shadow: 0 10px 24px -10px hsl(var(--tint) / 0.8), inset 0 1px 0 #fff;
}
.drop-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.drop-title { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.drop-sub { color: var(--muted); font-size: 13.5px; }
.drop-chev { color: var(--faint); font-size: 20px; }
.desktop-only { display: none; }
@media (hover: hover) and (pointer: fine) { .desktop-only { display: inline; } }

.alert {
  margin-top: 12px; padding: 14px 16px; border-radius: var(--radius-md);
  background: rgba(244, 63, 94, 0.12); border: 1px solid rgba(253, 164, 175, 0.3);
  display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.55;
}
.alert b { color: #fecdd3; font-size: 15px; }
.alert span { color: rgba(255, 228, 230, 0.82); }

.steps { list-style: none; margin: 14px 0 0; padding: 6px 18px; border-radius: 26px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; }
.steps li + li { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.steps .num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: var(--accent-soft);
  background: hsl(var(--tint) / 0.16); border: 1px solid hsl(var(--tint) / 0.3);
}
.steps div { display: flex; flex-direction: column; gap: 3px; padding-top: 3px; }
.steps b { font-weight: 600; font-size: 15.5px; line-height: 1.45; }
.steps div span { color: var(--faint); font-size: 13.5px; line-height: 1.5; }

.faq { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.faq details { border-radius: var(--radius-lg); padding: 0 18px; }
.faq summary {
  list-style: none; cursor: pointer; padding: 15px 0; font-size: 15px; font-weight: 550;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--faint); font-size: 20px; font-weight: 300; transition: transform 0.25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.65; }

/* ============ Busy ============ */
.busy { max-width: 420px; margin: 0 auto; padding-top: 7vh; }
.busy-card { padding: 34px 26px 26px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.ring { position: relative; width: 148px; height: 148px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-track { stroke: rgba(255, 255, 255, 0.08); }
.ring-fill { stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 0.4s var(--ease); filter: drop-shadow(0 0 8px hsl(var(--tint) / 0.55)); }
.ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 2px; }
.ring-label b { font-size: 38px; font-weight: 680; letter-spacing: -0.04em; }
.ring-label span { color: var(--muted); font-size: 16px; margin-top: 10px; }
.busy-card h2 { margin: 22px 0 6px; font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.busy-card p { margin: 0 0 20px; font-size: 14px; min-height: 1.5em; }

/* ============ Dashboard ============ */
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin: 0 -2px;
  scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
  mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px;
  border-radius: 999px; border: 1px solid var(--hair); cursor: pointer; text-align: left;
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  transition: background 0.25s, border-color 0.25s, transform 0.2s var(--ease);
}
.chip:active { transform: scale(0.97); }
.chip .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: rgba(255, 255, 255, 0.1); color: var(--muted); }
.chip b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
.chip small { display: block; color: var(--faint); font-size: 12px; margin-top: 1px; }
.chip[aria-pressed="true"] { background: rgba(255, 255, 255, 0.92); border-color: transparent; color: var(--ink); }
.chip[aria-pressed="true"] small { color: hsl(0 0% 0% / 0.55); }
.chip[aria-pressed="true"] .dot { background: linear-gradient(145deg, var(--accent-1), var(--accent-3)); color: var(--ink); }

.dash-grid { display: grid; gap: 14px; }
.main-col, .side { display: grid; gap: 14px; align-content: start; min-width: 0; }

/* ---- insight panels: calendar and time of day ---- */
.panel { padding: 18px 18px 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.panel-head span { color: var(--faint); font-size: 12.5px; text-align: right; }

.cal svg { display: block; width: 100%; height: 100%; overflow: visible; touch-action: pan-y; }
.cal-label { fill: rgba(255, 255, 255, 0.44); font-size: 10px; }
.cell { fill: rgba(255, 255, 255, 0.07); transition: fill 0.2s; }
.cell.l1 { fill: hsl(var(--tint) / 0.26); }
.cell.l2 { fill: hsl(var(--tint) / 0.46); }
.cell.l3 { fill: hsl(var(--tint) / 0.7); }
.cell.l4 { fill: hsl(var(--tint) / 0.96); }
.cell.on { stroke: #fff; stroke-width: 1.5; }
.cal-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 13px; min-height: 18px; }
.cal-legend { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--faint); font-size: 11.5px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; display: block; background: rgba(255, 255, 255, 0.07); }
.cal-legend .l1 { background: hsl(var(--tint) / 0.26); }
.cal-legend .l2 { background: hsl(var(--tint) / 0.46); }
.cal-legend .l3 { background: hsl(var(--tint) / 0.7); }
.cal-legend .l4 { background: hsl(var(--tint) / 0.96); }

.clock-wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 14px; }
.clock svg { display: block; width: 100%; height: auto; overflow: visible; }
.clock-face { fill: rgba(255, 255, 255, 0.05); stroke: rgba(255, 255, 255, 0.1); }
.clock-mark { fill: rgba(255, 255, 255, 0.5); font-size: 10.5px; }
.spoke {
  stroke: hsl(var(--tint)); stroke-width: 7; stroke-linecap: round; opacity: var(--o, 1);
  animation: spoke-in 0.6s var(--ease) both;
}
.spoke.peak { stroke: #fff; opacity: 1; filter: drop-shadow(0 0 5px hsl(var(--tint) / 0.9)); }
@keyframes spoke-in { from { opacity: 0; } }
.clock-side .figure b { color: var(--accent-soft); }
.clock-side .sub { margin-top: 8px; font-size: 13.5px; }
.clock-side .sub + .sub { margin-top: 2px; color: var(--faint); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px; }
.weekday { text-align: center; color: var(--faint); font-size: 11.5px; }
.weekday i { display: block; height: 30px; border-radius: 9px; margin-bottom: 5px; background: hsl(var(--tint) / var(--o, 0.1)); }
.weekday.top { color: var(--text); }
.weekday.top i { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.85); }

.hero-card {
  padding: 20px 18px 18px; overflow: hidden;
  background: linear-gradient(160deg, hsl(var(--tint) / 0.2), hsl(var(--tint) / 0.05) 70%);
  border-color: hsl(var(--tint) / 0.22);
}
.device-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.device-head .model { margin: 5px 0 0; color: var(--muted); font-size: 14.5px; letter-spacing: 0.01em; }
.device-head h2 { margin: 10px 0 0; font-size: 24px; letter-spacing: -0.02em; font-weight: 680; line-height: 1.2; word-break: break-word; }
.tag {
  flex: none; font-size: 12px; padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--hair); color: var(--muted);
}
.tag.good { color: var(--good); border-color: rgba(134, 239, 172, 0.3); background: rgba(134, 239, 172, 0.08); }
.tag.warn { color: var(--warn); border-color: rgba(252, 211, 77, 0.3); background: rgba(252, 211, 77, 0.08); }
.tag.bad { color: var(--bad); border-color: rgba(253, 164, 175, 0.32); background: rgba(253, 164, 175, 0.09); }

.art { position: relative; margin: 10px -18px 6px; height: 200px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.art img {
  display: block; height: 92%; max-height: 92%; width: auto; max-width: 86%; object-fit: contain;
  filter: drop-shadow(0 22px 26px rgba(0, 0, 0, 0.34));
}
.art .glyph {
  width: 132px; height: 132px; border-radius: 40px; display: grid; place-items: center; font-size: 62px; color: var(--accent-soft);
  background: linear-gradient(145deg, hsl(var(--tint-2) / 0.22), hsl(var(--tint) / 0.22));
  border: 1px solid var(--hair-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 30px 60px -24px hsl(var(--tint) / 0.4);
}

.segmented {
  position: relative; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 4px; border-radius: 999px; margin-top: 10px;
  background: rgba(0, 0, 0, 0.24); border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.segmented button {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer;
  padding: 8px 0; border-radius: 999px; font-size: 14px; color: var(--muted);
  transition: color 0.3s var(--ease);
}
.segmented button[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.segmented .thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 5);
  border-radius: 999px; background: linear-gradient(180deg, #ffffff, #e6e9f5);
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.5), inset 0 1px 0 #fff;
  transition: transform 0.4s var(--ease), opacity 0.25s;
}
.segmented.custom .thumb { opacity: 0; }

.range { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--faint); font-size: 13px; }
.range input {
  flex: 1; min-width: 0; appearance: none; -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.05); color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px;
  padding: 9px 12px; font: inherit; font-size: 14px; text-align: center;
}
.range input::-webkit-calendar-picker-indicator { filter: invert(0.8); opacity: 0.6; }
.range input::-webkit-date-and-time-value { text-align: center; }

.period { margin-top: 20px; }
.figure { display: flex; align-items: baseline; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.figure b { font-size: 54px; line-height: 1; font-weight: 700; letter-spacing: -0.045em; }
.figure span { font-size: 17px; color: var(--muted); font-weight: 550; margin-right: 8px; }
.period .figure b { color: var(--accent-soft); text-shadow: 0 0 28px hsl(var(--tint) / 0.35); }
.figure.small b { font-size: 36px; }
.figure.small span { font-size: 15px; }
.up { color: var(--good); }
.down { color: var(--bad); }

.chart { position: relative; margin-top: 18px; padding-top: 4px; }
.chart-top { display: flex; justify-content: space-between; color: var(--faint); font-size: 12px; margin-bottom: 8px; }
/* Listening time as a flowing line over a gradient fill (charts.js). */
.bars { height: 128px; touch-action: pan-y; }
.bars svg { display: block; width: 100%; height: 100%; overflow: visible; }
.area-grid { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.area-fill { animation: area-rise 0.9s var(--ease) both; }
.area-glow { fill: none; stroke-width: 6; opacity: 0.75; stroke-linecap: round; stroke-linejoin: round; animation: area-rise 1.2s var(--ease) both; }
.area-line {
  fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 0; animation: area-draw 1.1s var(--ease) both;
}
.area-peak { fill: #fff; animation: area-rise 1.4s var(--ease) both; }
.area-peak-halo { fill: #fff; opacity: 0.2; animation: area-rise 1.4s var(--ease) both; }
.area-guide { stroke: rgba(255, 255, 255, 0.4); stroke-width: 1; stroke-dasharray: 2 4; }
.area-dot { fill: #fff; stroke: hsl(var(--tint)); stroke-width: 2.5; filter: drop-shadow(0 0 6px hsl(var(--tint) / 0.9)); }
@keyframes area-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes area-rise { from { opacity: 0; } }
.axis { display: flex; justify-content: space-between; color: var(--faint); font-size: 12px; margin-top: 8px; }
.tip {
  position: absolute; top: 14px; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  padding: 7px 11px; border-radius: 12px; font-size: 12.5px; line-height: 1.4; text-align: center;
  background: var(--pop-bg); border: 1px solid var(--hair-strong);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.8);
}
.tip b { display: block; font-size: 14px; }
.tip span { color: var(--muted); }

.life {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 16px 18px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  transition: border-color 0.25s, transform 0.2s var(--ease);
}
.life:hover { border-color: var(--hair-strong); }
.life:active { transform: scale(0.99); }
.life-text { display: flex; flex-direction: column; min-width: 0; }
.life .sub { margin-top: 4px; font-size: 13px; color: var(--faint); }
.life-go { flex: none; display: inline-flex; align-items: center; gap: 2px; font-size: 13.5px; color: var(--accent-2); white-space: nowrap; }
.life-go svg { font-size: 16px; }
#showAll { margin-top: 12px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { padding: 15px 15px 13px; border-radius: var(--radius-lg); }
.tile .k { color: var(--muted); font-size: 13px; }
.tile .v { margin-top: 10px; font-size: 24px; font-weight: 680; letter-spacing: -0.03em; line-height: 1.1; }
.tile .v small { font-size: 14px; color: var(--muted); font-weight: 550; margin: 0 3px 0 1px; letter-spacing: 0; }
.tile .s { margin-top: 5px; color: var(--faint); font-size: 12px; }

.volume { padding: 18px 18px 16px; }
.volume-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.meter { position: relative; height: 10px; margin: 18px 4px 0; }
.meter-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(90deg, #5eead4, #86efac 38%, #fde68a 64%, #fdba74 78%, #fb7185);
  opacity: 0.85; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.meter-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: rgba(255, 255, 255, 0.55); }
.meter-dot {
  position: absolute; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18), 0 4px 12px rgba(0, 0, 0, 0.5);
  left: 0; transition: left 0.6s var(--ease);
}
.meter-scale { position: relative; height: 16px; margin: 10px 4px 0; color: var(--faint); font-size: 11.5px; }
.meter-scale span { position: absolute; top: 0; }
.meter-scale span:nth-child(1) { left: 0; }
.meter-scale span:nth-child(2) { left: 66.67%; transform: translateX(-50%); white-space: nowrap; }
.meter-scale span:nth-child(3) { right: 0; }

.footer { width: min(1080px, 100%); margin: 0 auto; padding: 8px 20px max(28px, env(safe-area-inset-bottom)); text-align: center; color: var(--faint); font-size: 12px; line-height: 1.7; }
.footer p { margin: 0; }
.footer p + p { margin-top: 10px; }
.footer-lang { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* ============ Wide screens ============ */
/* ---- listening persona ---- */
.persona-body { display: grid; gap: 20px; }
.persona-code {
  display: block; font-size: clamp(64px, 20vw, 96px); line-height: 0.95; font-weight: 800; letter-spacing: -0.03em;
  text-shadow: 0 0 44px hsl(var(--tint) / 0.6);
}
.persona-name { margin: 10px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.persona .sub { margin-top: 6px; font-size: 15px; }
.persona-main .pill-btn { margin-top: 16px; }
.pill-btn.primary {
  border-color: transparent; color: var(--ink); font-weight: 650;
  background: linear-gradient(100deg, var(--accent-1), var(--accent-2) 55%, var(--accent-3));
}
.pill-btn.primary:hover { background: linear-gradient(100deg, var(--accent-1), var(--accent-2) 55%, var(--accent-3)); filter: brightness(1.08); }
.traits { display: grid; gap: 14px; align-content: center; }
.trait { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; }
.trait-label { color: var(--muted); font-size: 13.5px; }
.trait-value { font-weight: 650; font-size: 15px; }
.trait-bar { grid-column: 1 / -1; position: relative; height: 6px; margin: 8px 7px 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); }
.trait-bar::before { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: rgba(255, 255, 255, 0.35); }
.trait-bar i { position: absolute; top: 50%; left: var(--at, 50%); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px hsl(var(--tint) / 0.9); }
.trait-poles { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--faint); font-size: 11.5px; }
.trait-poles .on { color: var(--text); font-weight: 600; }
@media (min-width: 620px) { .persona-body { grid-template-columns: 1fr 1fr; align-items: center; gap: 28px; } }

/* ---- share panel ---- */
body.modal-open { overflow: hidden; }
.share {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  overflow-y: auto; overscroll-behavior: contain; background: rgba(4, 6, 14, 0.7);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.share-box {
  width: min(860px, 100%); padding: 18px; border-radius: 26px; background: var(--pop-bg); border: 1px solid var(--hair-strong);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  animation: pop 0.22s var(--ease) both;
}
.share-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.share-head h3 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.share-body { display: grid; gap: 18px; }
.share-preview { display: grid; place-items: center; min-height: 180px; }
.share-preview img { display: block; max-width: 100%; max-height: min(52vh, 480px); border-radius: 16px; box-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.7); }
.share-side { display: grid; gap: 14px; align-content: start; min-width: 0; }
.opt .label { display: block; margin-bottom: 8px; color: var(--faint); font-size: 12.5px; }
.opt-row, .share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-row .pill-btn[aria-pressed="true"] { background: rgba(255, 255, 255, 0.24); border-color: var(--hair-strong); font-weight: 600; }
.share-actions { padding-top: 4px; }
.share-side .sub { margin: 0; font-size: 13px; }
.share-side .share-note { color: var(--faint); }
@media (min-width: 760px) {
  .share-body { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); align-items: start; gap: 24px; }
  .share-preview img { max-height: min(72vh, 620px); }
}

@media (min-width: 900px) {
  main { padding: 18px 24px 32px; }
  .topbar { padding: 20px 24px 6px; }
  .hero { padding-top: 7vh; text-align: center; }
  .privacy { margin-left: auto; margin-right: auto; }
  .dash-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: start; }
  .hero-card { padding: 26px 26px 22px; }
  .art { margin: 12px -26px 6px; height: 240px; }
  .bars { height: 150px; }
  .side { position: sticky; top: 18px; }
  .chip b { max-width: 260px; }
}

@media (max-width: 360px) {
  .figure b { font-size: 44px; }
  .segmented button { font-size: 13px; }
  .tile .v { font-size: 21px; }
}

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

/* On a phone the dashboard's top bar has no room for the language button; the footer link stays. */
@media (max-width: 480px) {
  body[data-view="dash"] .lang-switch { display: none; }
}
