/* style.css — one stylesheet for the whole desk
   ------------------------------------------------------------------
   1 tokens · 2 base · 3 nav · 4 home · 5 cards · 6 tools · 7 phone
   ------------------------------------------------------------------ */

/* 1 · tokens */
:root {
  --bg: #0b0b10;
  --panel: #17171f;
  --panel-2: #20202a;
  --line: rgba(255, 255, 255, 0.12);
  --line-2: rgba(255, 255, 255, 0.22);
  --hover: rgba(255, 255, 255, 0.07);
  --hover-2: rgba(255, 255, 255, 0.12);
  --ink: #f4f4f7;
  --ink-2: rgba(255, 255, 255, 0.86);
  --muted: rgba(255, 255, 255, 0.62);
  --muted-2: rgba(255, 255, 255, 0.42);
  --accent: #a78bfa;
  --accent-2: #67e8f9;
  /* these four are rewritten by theme.js when a wallpaper palette is applied */
  --glow-a: rgba(167, 139, 250, 0.16);
  --glow-b: rgba(103, 232, 249, 0.10);
  --nav-a: rgba(10, 10, 16, 0.94);
  --nav-b: rgba(10, 10, 16, 0.82);
  --nav-c: rgba(10, 10, 16, 0.42);
  --nav-d: rgba(10, 10, 16, 0);
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --shell: 74rem;
  --r: 16px;
  --elevation: 0 10px 28px rgba(0, 0, 0, 0.35);
  /* a mood is a colour as well as a face */
  --mood-1: #e5605c;
  --mood-2: #e8874a;
  --mood-3: #d9b23c;
  --mood-4: #7cc46a;
  --mood-5: #4cc38a;
  /* used only when a wallpaper is behind the page */
  --nav-glass: rgba(11, 11, 16, 0.78);
  --nav-glass-fade: rgba(11, 11, 16, 0.30);
  --panel-a: rgba(23, 23, 31, 0.55);
  --panel-2-a: rgba(32, 32, 42, 0.62);
  --r-sm: 10px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

/* 2 · base */
/* a chosen wallpaper joins the body background: scrim, photo, glows, colour */
/* text that sits straight on the picture gets a soft halo, so the veil can stay
   light enough to keep the colours */
html[data-wallpaper] .desk__greet,
html[data-wallpaper] .anchor__value,
html[data-wallpaper] .anchor__meta,
html[data-wallpaper] .affirm__line,
html[data-wallpaper] .affirm__cn,
html[data-wallpaper] .tool__head h1,
html[data-wallpaper] .tool__head p,
html[data-wallpaper] .nextup {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28), 0 0 14px rgba(0, 0, 0, 0.18);
}
html[data-theme="light"][data-wallpaper] .desk__greet,
html[data-theme="light"][data-wallpaper] .anchor__value,
html[data-theme="light"][data-wallpaper] .anchor__meta,
html[data-theme="light"][data-wallpaper] .affirm__line,
html[data-theme="light"][data-wallpaper] .tool__head h1,
html[data-theme="light"][data-wallpaper] .tool__head p,
html[data-theme="light"][data-wallpaper] .nextup {
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.75), 0 0 12px rgba(255, 255, 255, 0.55);
}

/* with a photo behind the page the panels turn into glass, so the picture
   reads through them instead of being hidden by a wall of cards */
/* the nav goes to glass as well: a solid band over a photo reads as a black bar */
html[data-wallpaper] .nav {
  /* fully transparent: the page-wide scrim already dims whatever is behind,
     so the bar does not need a band of its own */
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

html[data-wallpaper] .panel,
html[data-wallpaper] .rail__block,
html[data-wallpaper] .scard,
html[data-wallpaper] .metric,
html[data-wallpaper] .exam,
html[data-wallpaper] .subject,
html[data-wallpaper] .project,
html[data-wallpaper] .sync,
html[data-wallpaper] .cw,
html[data-wallpaper] .desk__rail > * {
  background: var(--panel-a);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}
html[data-wallpaper] .metric--primary { background: var(--panel-a); }
html[data-wallpaper] .metric__track,
html[data-wallpaper] .chart__bar { background: var(--panel-2-a); }

html[data-wallpaper] body {
  background:
    linear-gradient(180deg,
      rgba(0, 0, 0, calc(var(--wp-dim, 0.55) * 0.48)),
      rgba(0, 0, 0, calc(var(--wp-dim, 0.55) * 0.66))),
    var(--wallpaper-url) center / cover no-repeat fixed,
    radial-gradient(60rem 30rem at 15% -10%, var(--glow-a), transparent 60%),
    radial-gradient(50rem 26rem at 90% 0%, var(--glow-b), transparent 55%),
    var(--bg);
}
/* in light mode the same photo is dimmed with paper, not with black */
html[data-theme="light"][data-wallpaper] body {
  background:
    /* a bright picture behind a bright page has to lose most of its punch, or
       the whole screen reads as overexposed */
    linear-gradient(180deg,
      rgba(255, 255, 255, calc(0.30 + var(--wp-dim, 0.55) * 0.26)),
      rgba(255, 255, 255, calc(0.18 + var(--wp-dim, 0.55) * 0.30))),
    var(--wallpaper-url) center / cover no-repeat fixed,
    radial-gradient(60rem 30rem at 15% -10%, var(--glow-a), transparent 60%),
    radial-gradient(50rem 26rem at 90% 0%, var(--glow-b), transparent 55%),
    var(--bg);
}
html[data-theme="light"][data-wallpaper] .nav {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, calc(var(--wp-dim, 0.55) * 0.80)) 0%,
    rgba(255, 255, 255, calc(var(--wp-dim, 0.55) * 0.28)) 62%,
    transparent 100%);
}

html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60rem 30rem at 15% -10%, var(--glow-a), transparent 60%),
    radial-gradient(50rem 26rem at 90% 0%, var(--glow-b), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #c4b5fd; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); }
img, svg, canvas { display: block; max-width: 100%; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* 3 · nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 24px 22px;
  /* the bar fades into the page instead of stopping on a line — a hard
     border under a translucent band reads as a seam */
  background: linear-gradient(180deg,
    var(--nav-a) 0%,
    var(--nav-b) 38%,
    var(--nav-c) 72%,
    var(--nav-d) 100%);
  border-bottom: 0;
}
.nav__mode {
  margin-left: 6px; width: 34px; height: 34px; padding: 0; flex: none;
  align-self: center;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.nav__mode:hover { color: var(--ink); border-color: var(--line-2); background: var(--hover); }
.nav__mode svg { width: 16px; height: 16px; }

.nav__brand { font-weight: 700; letter-spacing: 0.01em; color: var(--ink); white-space: nowrap; }
.nav__brand span { color: var(--accent); }
.nav__links { position: relative; display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav__links a {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; height: 34px;
  font-size: 0.9rem; color: var(--muted); padding: 0 13px; border-radius: 999px;
  transition: color 0.18s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a[aria-current="page"] { color: var(--ink); }

/* the sliding highlight: frosted glass, one element, spring on the way over */
.nav__ink {
  position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none;
  border-radius: 999px; opacity: 0;
  background: linear-gradient(180deg, rgba(196, 181, 253, 0.22), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 6px 16px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              height 0.24s ease, opacity 0.25s ease;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav__ink { background: rgba(255, 255, 255, 0.16); }
}


/* 4 · home */
.hero { padding: 56px 0 8px; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--accent); }
/* the affirmation of the day */
.affirm {
  margin: 18px 0 0; padding-left: 18px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  display: grid; gap: 6px; max-width: 44rem;
}
.affirm__line {
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.45; letter-spacing: -0.01em; color: var(--ink);
}
.affirm__cn { font-size: 0.92rem; color: var(--muted); letter-spacing: 0.02em; }
.affirm__next {
  justify-self: start; margin-top: 2px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted-2);
  padding: 4px 11px; font-size: 0.74rem; cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.affirm__next:hover { color: var(--ink); border-color: var(--line-2); }
.hero p { margin-top: 14px; max-width: 44rem; color: var(--muted); font-size: 1.02rem; }

.strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  margin: 32px 0 8px;
}
.strip div {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px;
}
.strip dt { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.strip dd { margin: 4px 0 0; font-size: 1.05rem; font-weight: 600; }
/* the rolling clock on the home strip: one tile per digit */
.strip__clock { font-size: 1.6rem; line-height: 1; }

.tc { display: inline-flex; align-items: flex-start; gap: 3px; }
.tc__group { display: grid; justify-items: center; gap: 7px; }
.tc__tiles { display: inline-flex; gap: 4px; }
.tc__label {
  font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted-2); font-weight: 500;
}
.tc__sep {
  font-size: 1.15em; line-height: 1; color: var(--muted);
  padding: 0 1px; transform: translateY(0.02em);
}

.ct { display: inline-flex; align-items: flex-start; font-variant-numeric: tabular-nums; }
.ct__tile {
  display: inline-grid; place-items: center;
  padding: 0.5em 0.66em; border-radius: 13px;
  background: linear-gradient(180deg, #2b2b38, #1e1e27);
  border: 1px solid rgba(255, 255, 255, 0.17);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 12px rgba(0, 0, 0, 0.45);
  color: #f6f5fa;
}
.ct__col {
  position: relative; display: inline-block;
  width: 0.66em; height: 1.14em; overflow: hidden;
}
.ct__strip {
  position: absolute; left: 0; top: 0; width: 100%;
  display: flex; flex-direction: column;
  transition: transform 0.55s cubic-bezier(0.34, 1.28, 0.64, 1);
  will-change: transform;
}
.ct__digit { display: grid; place-items: center; height: 1.14em; line-height: 1; }
.ct__sep { display: inline-block; padding: 0 0.06em; color: var(--muted); }
.ct__sep.is-blink { animation: ct-blink 2s steps(1, end) infinite; }
@keyframes ct-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.25; } }

@media (prefers-reduced-motion: reduce) {
  .ct__strip { transition: none; }
  .ct__sep.is-blink { animation: none; }
}
.strip__tail { font-size: 0.85rem; font-weight: 500; color: var(--muted); }

/* 5 · cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 28px 0 64px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  min-height: 190px; padding: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink); text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1), border-color 0.25s ease, background-color 0.25s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-2); background: var(--panel-2); color: var(--ink); }
.card__icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.card__icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card h2 { font-size: 1.12rem; font-weight: 650; letter-spacing: -0.01em; }
.card p { font-size: 0.9rem; color: var(--muted); }
.card__meta { margin-top: auto; font-size: 0.78rem; color: var(--muted-2); font-family: var(--mono); }

/* 6 · tools */
.tool { position: relative; z-index: 1; padding: 8px 0 64px; }
/* the way back to the desk, on every tool page */
.back {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 14px; padding: 6px 13px 6px 11px;
  border-radius: 999px; border: 1px solid var(--line);
  font-size: 0.8rem; color: var(--muted);
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.back:hover {
  color: var(--ink);
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.05);
}
.tool__head { margin-bottom: 26px; }
/* the clock and the world clock share one grid: header, card and panel then
   line up on the same left edge instead of each centring itself */
.clock-layout {
  display: grid; gap: clamp(16px, 2vw, 26px);
  grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 1024px) {
  .clock-layout { grid-template-columns: minmax(0, 1fr); }
  .cw { margin: 0 auto; }
}
.tool__head h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -0.03em; }
.tool__head p { margin-top: 8px; color: var(--muted); max-width: 46rem; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, var(--elevation);
}
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 1.02rem; margin-bottom: 4px; }
.panel > p.hint { color: var(--muted); font-size: 0.88rem; margin-bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(255, 255, 255, 0.04); color: var(--ink);
  padding: 9px 16px; font-size: 0.9rem; cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}
.btn:hover { background: var(--hover-2); border-color: var(--line-2); }
.btn:active { transform: scale(0.98); }
/* a solid accent fill reads as a glare on a dark card: the primary action is
   now an accent outline with a light accent wash behind it */
.btn--primary {
  /* a saturated accent on a dark panel is louder than a button should be: the
     border keeps a hint of it, the label is the accent pulled towards the ink */
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line-2));
  color: color-mix(in srgb, var(--accent) 66%, var(--ink));
  font-weight: 600;
}
.btn--primary:hover {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent) 74%, var(--line-2));
  color: color-mix(in srgb, var(--accent) 74%, var(--ink));
}
.btn--ghost { background: transparent; }
.btn[disabled] { opacity: 0.45; cursor: default; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 0.8rem; color: var(--muted); }
.input {
  width: 100%; min-width: 0;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; color: var(--ink); font-size: 0.95rem;
  /* native popups (the date picker, the datalist suggestions, select menus)
     follow this, not our CSS — without it they open as a white sheet */
  color-scheme: dark;
}
select.input, input[list] { color-scheme: dark; }
html[data-theme="light"] .input,
html[data-theme="light"] select.input,
html[data-theme="light"] input[list] { color-scheme: light; }
.input::placeholder { color: var(--muted-2); }
.input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }

.qq { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.qq .input { flex: 1 1 16rem; max-width: 26rem; }
.qq-results { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 2px; }
.qq-results li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer;
  font-size: 0.94rem; color: var(--ink-2);
}
.qq-results li:hover, .qq-results li:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.qq-results li span:first-child { color: var(--muted-2); font-family: var(--mono); font-size: 0.8rem; width: 1.4rem; flex: none; }
.qq-results b { font-weight: 600; color: var(--ink); }
.qq-results span span { color: var(--muted); font-size: 0.86rem; }


/* ---------- what the desktop is playing ---------- */
/* .bridge sets its own display, which would beat the hidden attribute */
.bridge[hidden], .bridge-help[hidden] { display: none !important; }
.bridge { display: grid; gap: 12px; }
.bridge__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bridge__state {
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-2); padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line);
}
.bridge__state.is-live { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }

.bridge__now { display: flex; align-items: center; gap: 14px; }
.bridge__art {
  width: 54px; height: 54px; border-radius: 14px; flex: none;
  display: grid; place-items: center; font-size: 1.3rem; color: var(--accent);
  background: radial-gradient(circle at 30% 25%, var(--hover-2), var(--panel-2));
  border: 1px solid var(--line);
}
.bridge__meta { min-width: 0; flex: 1; }
.bridge__title {
  font-size: 1.12rem; font-weight: 650; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bridge__artist {
  font-size: 0.86rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bridge__controls { display: flex; align-items: center; gap: 8px; flex: none; }
.bridge__btn { padding: 8px 12px; font-size: 0.9rem; }

.bridge__bar { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bridge__bar i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1.9s linear;
}
.bridge__times {
  display: flex; justify-content: space-between;
  font-size: 0.74rem; color: var(--muted-2); font-variant-numeric: tabular-nums;
  margin-top: -6px;
}

@media (max-width: 680px) {
  .bridge__now { flex-wrap: wrap; }
  .bridge__controls { width: 100%; justify-content: flex-end; }
}

/* ---- music ---- */
.embed { width: 100%; min-height: 320px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); }

/* the QQ player is a single bar, not a page: a 320px frame leaves a white void */
.embed--player {
  /* a little slack: at exactly the content height any zoom made the frame
     grow a scrollbar, which showed as a dark strip with two arrows */
  height: 86px; min-height: 0;
  border-radius: 12px;
  background: #ffffff;
  color-scheme: light;
  overflow: hidden;
  scrollbar-width: none;
}
.embed-note { font-size: 0.85rem; color: var(--muted); margin-top: 10px; }

.linkset { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.linkset__label {
  width: 4.6rem; flex: none;
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted-2);
}
.btn--mail::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #0f6cbd; box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.18);
}

/* elastic slider (see elastic-slider.js) */
.es-row {
  display: grid; grid-template-columns: 4.6rem minmax(0, 24rem) 2.4rem minmax(0, 1fr);
  align-items: center; gap: 14px; margin: 18px 0 4px;
}
.es-row__value {
  font-size: 0.82rem; color: var(--muted);
  font-variant-numeric: tabular-nums; text-align: right;
}
.es-row__label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.es-row__note { line-height: 1.3; }

.es { display: flex; align-items: center; gap: 12px; }
.es__icon { color: var(--muted); display: grid; place-items: center; flex: none; }
.es__icon svg { width: 18px; height: 18px; }

.es__rail {
  position: relative; flex: 1; height: 26px; display: block;
  cursor: pointer; touch-action: none; outline: none;
}
.es__rail:focus-visible .es__track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }

.es__track, .es__fill {
  position: absolute; left: 0; top: 50%; height: 7px; border-radius: 999px;
  transform-origin: center; will-change: transform;
}
.es__track { right: 0; transform: translateY(-50%); background: var(--line); }
.es__fill {
  width: 0; transform: translateY(-50%);
  background: #0a84ff;
  transform-origin: left center;
}
.es__thumb {
  position: absolute; top: 50%; left: 0; width: 22px; height: 22px;
  border-radius: 999px; background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  will-change: transform;
}
.es__thumb::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  background: #0a84ff;
}
.es__icon--badge {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(10, 132, 255, 0.16); color: #4da3ff;
}
.es__icon--badge svg { width: 15px; height: 15px; }
.es--single { gap: 14px; }
.es__bubble {
  position: absolute; top: 50%; left: 0;
  padding: 2px 7px; border-radius: 6px;
  background: var(--ink); color: var(--bg);
  font-size: 0.7rem; font-variant-numeric: tabular-nums;
  opacity: 0; pointer-events: none; white-space: nowrap;
  transform: translate(-50%, -8px);
}

@media (max-width: 680px) {
  .es-row { grid-template-columns: 1fr; gap: 6px; }
  .es-row__note { display: none; }
}
/* ---- study ---- */
.subjects { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.subject {
  display: grid; gap: 7px; text-align: left;
  padding: 13px 15px; border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2);
  cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.subject:hover { border-color: var(--line-2); color: var(--ink); }
.subject[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--ink); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.subject__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.subject__head b { font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.subject__chevron { font-size: 0.7rem; color: var(--muted-2); }
.subject__meta { font-size: 0.74rem; color: var(--muted); }
.subject__track { display: block; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.subject__track i { display: block; height: 100%; background: var(--good); border-radius: 999px; transition: width 0.35s ease; }

.study-total { font-size: 0.85rem; color: var(--muted); text-align: right; }

.subject-note {
  margin-top: 16px; padding: 16px 18px;
  border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), color-mix(in srgb, var(--accent) 2%, transparent));
  display: grid; gap: 10px;
}
.subject-note[hidden] { display: none; }
.subject-note__title {
  font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.subject-note__lead { font-size: 0.92rem; color: var(--ink-2); }
.subject-note ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.subject-note li { font-size: 0.88rem; color: var(--muted); line-height: 1.5; }
.subject-note__link { font-size: 0.85rem; }

.project-form {
  display: grid; grid-template-columns: minmax(0, 1.6fr) 7rem 10rem auto;
  gap: 10px; align-items: end; margin-top: 6px;
}
.projects { display: grid; gap: 12px; margin-top: 18px; }
.project {
  padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--line);
  display: grid; gap: 10px;
}
.project__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project__head b { display: block; font-size: 0.98rem; color: var(--ink); }
.project__head span { font-size: 0.78rem; color: var(--muted-2); }
.project__actions { display: flex; gap: 6px; flex: none; }
.project__btn { padding: 6px 12px; font-size: 0.78rem; }
.project__bar { margin: 0; }

.plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.plan__row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 8px; border-radius: 8px; font-size: 0.86rem; color: var(--ink-2);
}
.plan__row:hover { background: var(--hover); }
.plan__row input { flex: none; width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.plan__row label { display: flex; gap: 10px; align-items: baseline; cursor: pointer; flex: 1; min-width: 0; }
.plan__date { flex: none; width: 4.4rem; font-family: var(--mono); font-size: 0.76rem; color: var(--muted-2); }
.plan__text { color: var(--ink-2); }
.plan__row.is-done .plan__text { color: var(--muted-2); text-decoration: line-through; }

@media (max-width: 680px) {
  .project-form { grid-template-columns: minmax(0, 1fr) 5.5rem; }
  .project-form .field:nth-child(3) { grid-column: 1 / -1; }
  .project-form button { grid-column: 1 / -1; }
  .project__head { flex-direction: column; }
}

.exams { display: grid; gap: 8px; margin-top: 14px; }
.exam {
  /* the code, the date and the countdown, in the narrow exam card: the name
     keeps its width, the date takes what is left, the countdown never wraps */
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--line);
}
.exam__name { font-size: 0.8rem; color: var(--ink-2); white-space: nowrap; }
.exam__input { width: 100%; min-width: 0; padding: 7px 9px; font-size: 0.84rem; }
.exam__when { font-size: 0.78rem; color: var(--muted-2); text-align: right; white-space: nowrap; }
.exam__when.is-soon { color: var(--warn); }
.exam__when.is-past { color: var(--muted-2); text-decoration: line-through; }

@media (max-width: 680px) {
  .exam { grid-template-columns: minmax(0, 1fr) 8.5rem; }
  .exam__when { grid-column: 1 / -1; text-align: left; }
}

.flash {
  position: relative; min-height: 15rem; width: 100%;
  display: grid; place-items: center; text-align: center;
  padding: 28px; border-radius: var(--r);
  background: var(--panel-2); border: 1px solid var(--line);
  cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease;
}
.flash:hover { border-color: var(--line-2); }
.flash__tag { position: absolute; top: 14px; left: 16px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }
.flash__q { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; max-width: 40rem; }
.flash__a { margin-top: 12px; font-size: 1rem; color: var(--accent-2); max-width: 40rem; }
.flash__a[hidden] { display: none; }

.progress { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin: 16px 0 8px; }
.progress i { display: block; height: 100%; width: 0; background: var(--good); transition: width 0.35s ease; }

/* ---- clock ---- */
/* the widget: a light frosted pane on the dark page, like a float from a phone */
.cw {
  position: relative; max-width: 24rem; padding: 14px 16px 62px;
  border-radius: 30px;
  /* The card is a surface of the page, not a separate object: the panel
     colours come straight from the theme, and the accent wash is a separate
     layer at low opacity rather than a color-mix(), which older browsers
     would drop — leaving the card with no background at all. */
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-2);
  box-shadow: var(--elevation);
  color: var(--ink);
  contain: paint;
}
.cw::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(120% 80% at 18% 0%, var(--accent), transparent 62%);
  opacity: 0.14; pointer-events: none; z-index: 0;
}
.cw > * { position: relative; z-index: 1; }

/* the dial reads in ink, the second hand in the palette's accent */
#ticks line { stroke: currentColor; }
#hourHand, #minHand, #hourDot, #minDot, #hub { stroke: var(--ink); fill: var(--ink); }
#hourHand, #minHand { fill: none; }
#secHand { stroke: var(--accent); }
#secDot, .sec-fill { fill: var(--accent); }
#hubPin { fill: var(--panel-2); }
.cw__num { fill: currentColor; opacity: 0.26; }

.cw__tabs {
  display: flex; justify-self: center; gap: 2px;
  width: fit-content; margin: 0 auto 6px; padding: 3px;
  border-radius: 999px; background: var(--hover);
}
.cw__tab {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 18px; border-radius: 999px;
  font-size: 0.86rem; font-weight: 500; color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.cw__tab:hover { color: var(--ink); }
.cw__tab[aria-selected="true"] {
  background: var(--panel); color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.cw__svg { width: 100%; height: auto; display: block; margin: 2px 0 4px; contain: paint; }
.cw__num {
  font-family: var(--sans); font-size: 38px; font-weight: 500;
  fill: currentColor; opacity: 0.26;
}

.cw__chips { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; justify-content: space-between; gap: 8px; }
.cw__chip {
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px;
  font-size: 0.9rem; font-weight: 500;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.cw__pane[hidden] { display: none; }
.cw__pane { text-align: center; }
.cw__mode {
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 10px;
}
.cw__count {
  font-family: var(--mono); font-size: clamp(3rem, 12vw, 4rem);
  font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  color: var(--ink); line-height: 1.05;
}
.cw__actions { display: flex; justify-content: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.cw__btn {
  border: 1px solid var(--line); background: var(--panel-2);
  color: var(--ink); border-radius: 999px; padding: 8px 16px;
  font-size: 0.88rem; font-weight: 500; cursor: pointer;
  transition: background-color 0.18s ease, transform 0.15s ease;
}
.cw__btn:hover { background: var(--hover-2); }
.cw__btn:active { transform: scale(0.97); }
.cw__btn--dark { background: var(--ink); border-color: transparent; color: var(--bg); }
.cw__btn--dark:hover { background: var(--ink-2); }
.cw__meta { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; }
.cw__rounds { font-size: 0.78rem; color: var(--muted); }
.cw__mini {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-size: 0.75rem; color: var(--muted-2);
  text-decoration: underline; text-underline-offset: 2px;
}
.cw__mini:hover { color: var(--ink); }

.worldclock { max-width: 40rem; margin: 18px auto 0; }
.watches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.watch {
  position: relative; display: grid; gap: 1px;
  padding: 12px 13px 11px; border-radius: 12px;
  background: linear-gradient(180deg, var(--hover), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line);
}
.watch--added { border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.watch__remove {
  position: absolute; top: 6px; right: 6px;
  width: 20px; height: 20px; padding: 0; line-height: 1;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); color: var(--muted-2);
  font-size: 0.9rem;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.watch__remove:hover { background: rgba(248, 113, 113, 0.18); color: var(--bad); }

/* our own suggestion list: the browser's datalist popup is a white sheet */
.city-add__field { position: relative; flex: 1; min-width: 0; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  z-index: 40; margin: 0; padding: 6px; list-style: none;
  max-height: 16rem; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.suggest__item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 0.86rem; color: var(--ink-2);
}
.suggest__item:hover, .suggest__item.is-active { background: var(--hover-2); color: var(--ink); }
.suggest__zone { font-size: 0.72rem; color: var(--muted-2); font-family: var(--mono, monospace); }

.city-add {
  display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
}
.city-add .input { flex: 1 1 18rem; max-width: 26rem; }
.watch b {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink-2);
}
.watch em {
  font-style: normal; font-family: var(--mono);
  font-size: 1.4rem; line-height: 1.15; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.watch span { font-size: 0.68rem; color: var(--muted-2); line-height: 1.3; }
.watch__day {
  position: absolute; top: 10px; right: 30px;
  font-style: normal; font-size: 0.6rem; letter-spacing: 0.03em;
  color: var(--warn);
}
@media (max-width: 680px) {
  .watches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cw__presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 16px; }
.cw__preset {
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); border-radius: 999px;
  padding: 5px 12px; font-size: 0.8rem; font-weight: 500; cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}
.cw__preset:hover { background: var(--hover); color: var(--ink); }
.cw__preset:active { transform: scale(0.97); }
.cw__preset[aria-pressed="true"] { background: var(--ink); border-color: transparent; color: var(--bg); }
/* weather */
.wx-now { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.wx-now__main { display: flex; align-items: center; gap: 18px; }
.wx-now__icon { color: var(--accent); display: grid; place-items: center; }
.wx-now__icon svg { width: 58px; height: 58px; }
.wx-now__temp {
  font-size: clamp(2.6rem, 6vw, 3.6rem); font-weight: 700; line-height: 1;
  letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.wx-now__temp small { font-size: 0.34em; font-weight: 500; color: var(--muted); margin-left: 6px; }
.wx-now__cond { margin-top: 6px; font-size: 0.95rem; color: var(--muted); }

.wx-now__facts { display: grid; grid-template-columns: repeat(2, minmax(6rem, 1fr)); gap: 12px 26px; }
.wx-now__facts dt { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.wx-now__facts dd { margin: 2px 0 0; font-size: 1rem; font-variant-numeric: tabular-nums; }

.wx-hours { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(3.6rem, 1fr); gap: 6px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
.wx-hour { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px solid var(--line); }
.wx-hour__time { font-size: 0.72rem; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.wx-hour__icon { color: var(--ink-2); }
.wx-hour__icon svg { width: 22px; height: 22px; }
.wx-hour__temp { font-size: 0.92rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.wx-days { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.wx-day {
  display: grid; grid-template-columns: 4rem 1.8rem 2.6rem minmax(0, 1fr) 2.6rem;
  align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm); font-size: 0.9rem; color: var(--ink-2);
}
.wx-day.is-today { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--ink); }
.wx-day__name { font-size: 0.82rem; color: var(--muted); }
.wx-day.is-today .wx-day__name { color: var(--accent); font-weight: 600; }
.wx-day__icon { color: var(--ink-2); display: grid; place-items: center; }
.wx-day__icon svg { width: 18px; height: 18px; }
.wx-day__edge { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--muted); }
.wx-day__edge:last-child { color: var(--ink); font-weight: 600; }
.wx-day__track { position: relative; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.wx-day__track i { position: absolute; top: 0; height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

@media (max-width: 680px) {
  .wx-now__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wx-day { grid-template-columns: 3.4rem 1.6rem 2.2rem minmax(0, 1fr) 2.2rem; gap: 6px; }
}
/* ---- ledger ---- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.stat dt { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.stat dd { margin: 4px 0 0; font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.balance { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.balance.is-negative { color: var(--bad); }

.entryform { display: grid; grid-template-columns: 150px 130px minmax(0, 1fr) 130px auto; gap: 10px; align-items: end; }
table { width: 100%; border-collapse: collapse; margin-top: 14px; }
thead th { text-align: left; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); padding: 0 8px 8px; }
tbody td { padding: 11px 8px; border-top: 1px solid var(--line); font-size: 0.92rem; color: var(--ink-2); }
tbody tr:hover { background: var(--hover); }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num.pos { color: var(--good); }
td.num.neg { color: var(--muted); }
.del { background: none; border: 0; color: var(--muted-2); cursor: pointer; font-size: 0.82rem; padding: 2px; }
.del:hover { color: var(--bad); }

#sky {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}


/* ---------- light ----------
   Same variable names, different values, so no component has to know which
   mode is on. Text colours are chosen for AA contrast on paper. */
[data-theme="light"] {
  --bg: #f7f6f3;
  --panel: #ffffff;
  --panel-2: #f2f1ee;
  --line: rgba(16, 18, 27, 0.10);
  --line-2: rgba(16, 18, 27, 0.18);
  --hover: rgba(16, 18, 27, 0.04);
  --hover-2: rgba(16, 18, 27, 0.07);
  --ink: #14161d;
  --ink-2: rgba(20, 22, 29, 0.78);
  --muted: rgba(20, 22, 29, 0.58);
  --muted-2: rgba(20, 22, 29, 0.50);
  --accent: #6d3ff2;
  --accent-2: #0d7f96;
  --good: #15803d;
  --warn: #a16207;
  --bad: #b91c1c;
  --glow-a: rgba(109, 63, 242, 0.10);
  --glow-b: rgba(13, 127, 150, 0.07);
  --nav-a: rgba(247, 246, 243, 0.96);
  --nav-b: rgba(247, 246, 243, 0.86);
  --nav-c: rgba(247, 246, 243, 0.46);
  --nav-d: rgba(247, 246, 243, 0);
  --elevation: 0 8px 22px rgba(16, 18, 27, 0.07);
  --mood-1: #c53a36;
  --mood-2: #bf5f22;
  --mood-3: #9c7a12;
  --mood-4: #4b8f38;
  --mood-5: #2c8a5a;
  --nav-glass: rgba(247, 246, 243, 0.86);
  --nav-glass-fade: rgba(247, 246, 243, 0.42);
  --panel-a: rgba(255, 255, 255, 0.80);
  --panel-2-a: rgba(246, 245, 242, 0.80);
}

[data-theme="light"] .nav__ink {
  background: linear-gradient(180deg, rgba(16, 18, 27, 0.10), rgba(16, 18, 27, 0.04));
  border-color: rgba(16, 18, 27, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 8px rgba(16, 18, 27, 0.06);
}

/* every surface changes mode with the same timing */
body, .nav, .panel, .card, .metric, .rail__block, .watch, .stat,
.subject, .project, .swatch, .btn, .input, select, .flash, .cw {
  transition: background-color 0.28s ease, border-color 0.28s ease, color 0.28s ease;
}

@media (prefers-reduced-motion: reduce) {
  body, .nav, .panel, .card, .metric, .rail__block, .watch, .stat,
  .subject, .project, .swatch, .btn, .input, select, .flash, .cw {
    transition: none;
  }
}


/* ---------- home: asymmetric dashboard ----------
   One huge number anchors the page, supporting figures sit in a compact
   three-cell grid, and everything else lives in a narrow rail on the right.
   The rail is a separate column, not a card row, so the eye reads down it. */
.desk {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(18rem, 1fr);
  gap: clamp(20px, 3vw, 44px);
  padding: clamp(28px, 4vw, 56px) 0 72px;
  align-items: start;
}
.desk__main { display: grid; gap: clamp(20px, 2.4vw, 34px); min-width: 0; max-width: 78rem; }
.desk__rail { display: grid; gap: 16px; align-content: start; }

.desk__greet {
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted-2); margin: 0;
}

/* the anchor: the clock, at a size nothing else competes with */
.anchor { display: grid; gap: 8px; }
.anchor__value {
  display: flex; align-items: baseline;
  /* a lock-screen clock: large, rounded, tight — the numbers are the first
     thing the eye lands on, so their shape carries the page */
  font-family: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  font-size: clamp(3.6rem, 9.6vw, 7.2rem); line-height: 0.9;
  font-weight: 800; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  /* the clock wears the colour the reader picked, softened towards the page:
     at full strength a saturated accent is louder than the time deserves */
  color: var(--accent);
  color: color-mix(in srgb, var(--accent) 58%, var(--bg));
  /* frosted glass, the way the reader asked for it: the inside of each digit is
     see-through — the wallpaper shows straight through — and what carries the
     shape is a pale, cool rim of the theme colour, softened at the edges */
  color: color-mix(in srgb, var(--accent) 12%, transparent);
  -webkit-text-stroke: 0;
  filter: blur(0.35px);
  text-shadow:
    0 0 1px color-mix(in srgb, var(--accent) 24%, transparent),
    0 6px 18px rgba(0, 0, 0, 0.18);
  transition: opacity 260ms var(--ease-out-soft, ease);
}
/* the glyph itself can carry a gradient when the clip sits on the cell rather
   than on the container: each digit is painted by its own span, so the rolling
   strips no longer swallow it */
.anchor__value .ct__digit {
  /* frosted glass with nothing sampled inside it: a specular streak, a lit top
     and a shaded foot, and the theme colour held low — the wallpaper no longer
     shows through the letters */
  background-image:
    linear-gradient(115deg,
      rgba(255, 255, 255, 0) 24%,
      rgba(255, 255, 255, 0.36) 40%,
      rgba(255, 255, 255, 0.07) 52%,
      rgba(255, 255, 255, 0) 63%),
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.48) 0%,
      rgba(255, 255, 255, 0.16) 34%,
      rgba(10, 10, 16, 0.24) 70%,
      rgba(10, 10, 16, 0.44) 100%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--digit, var(--accent)) 58%, transparent) 0%,
      color-mix(in srgb, var(--digit, var(--accent)) 34%, transparent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
/* ---------- the numbers borrow the wallpaper's own colours ----------
   Each column carries one stop of a gradient taken from the picture, and the
   glass is hollow: a pale rim of that stop, and the picture through the middle. */
.anchor__value .ct__col {
  --digit: var(--accent);
  color: color-mix(in srgb, var(--digit) 13%, transparent);
  -webkit-text-stroke: 0;
  text-shadow: 0 0 1px color-mix(in srgb, var(--digit) 26%, transparent);
  transition: color 320ms var(--ease-out-soft, ease), -webkit-text-stroke-color 320ms var(--ease-out-soft, ease);
}
html[data-theme="light"] .anchor__value .ct__col {
  -webkit-text-stroke: 0;
  color: color-mix(in srgb, var(--digit) 9%, transparent);
}
/* on a light page the same pale rim disappears: the glass needs a darker edge
   there, while its inside still shows the paper through */
html[data-theme="light"] .anchor__value {
  -webkit-text-stroke: 0;
  color: color-mix(in srgb, var(--accent) 8%, transparent);
  text-shadow: 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}
.anchor__value .ct__col { width: 0.58em; height: 1.14em; }
/* the colon is two dots of our own: a font glyph sits on the baseline and
   reads as two dots hanging under the digits */
.anchor__value .ct__sep {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.19em; align-self: center; font-size: 1em; line-height: 1;
  padding: 0 0.07em;
  color: var(--accent);
  color: color-mix(in srgb, var(--accent) 58%, var(--bg));
  transform: translateY(0.03em);
}
/* hours, minutes and seconds are one size; the seconds only sit a shade
   quieter so the eye still lands on the time first */
.anchor__sec {
  /* the same ink as the rest of the clock: a dimmed pair of digits read as a
     rendering fault once a photo sat behind them */
  font-size: 1em; color: inherit; margin-left: 0.02em;
}

.anchor__value .ct__sep i {
  width: 0.105em; height: 0.105em; border-radius: 50%;
  background: currentColor; opacity: 0.8;
}
.anchor__meta {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-size: 0.95rem; color: var(--muted);
}
.anchor__meta b { color: var(--ink-2); font-weight: 600; }
.anchor__meta .dot { color: var(--muted-2); }

/* supporting figures: three tight cells, number first */
.metrics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.metric {
  display: grid; gap: 6px; align-content: start;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, var(--elevation);
  padding: 14px 16px 16px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.metric:hover { border-color: var(--line-2); background: var(--panel-2); color: var(--ink); }
.metric__label {
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-2);
}
.metric__value {
  font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 650;
  letter-spacing: -0.02em; line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.metric__note { font-size: 0.74rem; color: var(--muted); }
.metric__meta { font-size: 0.74rem; color: var(--muted); }

/* the study figure leads the row: accent edge, bigger number */
.metric--primary {
  border-color: var(--accent);
  background: var(--panel);
  position: relative; overflow: hidden;
}
.metric--primary::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--accent); opacity: 0.10;
}
.metric--primary > * { position: relative; z-index: 1; }
.metric--primary .metric__label { color: var(--accent); }
.metric--primary .metric__value { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.metric--primary .metric__track { height: 4px; }
.metric__track {
  height: 3px; border-radius: 999px; background: var(--line);
  overflow: hidden; margin-top: 2px;
}
.metric__track i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.nextup {
  font-size: 0.86rem; color: var(--muted);
  padding-top: 2px; border-top: 1px solid var(--line);
  margin-top: 2px;
}

/* the rail */
.rail__block {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 16px 14px;
}
.rail__block h2 {
  font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 10px; font-weight: 600;
}
.rail__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rail__list a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 8px; border-radius: 9px;
  color: var(--ink-2); font-size: 0.9rem;
}
.rail__list a:hover { background: var(--hover); color: var(--ink); }
.rail__list a span#railMusic {
  max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rail__list a span { margin-left: auto; font-size: 0.72rem; color: var(--muted-2); }

.modeswitch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.modeswitch button {
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 10px; border-radius: 999px; font-size: 0.8rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.modeswitch button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.modeswitch svg { width: 14px; height: 14px; }

.rail__note { font-size: 0.74rem; color: var(--muted-2); line-height: 1.45; }

@media (max-width: 1180px) {
  .desk__rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .desk__rail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .desk { grid-template-columns: minmax(0, 1fr); }
  .desk__rail { order: 2; }
}
@media (max-width: 680px) {
  .metrics { grid-template-columns: minmax(0, 1fr); }
  .anchor__value { font-size: clamp(3rem, 16vw, 4.6rem); }
}

/* ---- tarot ---- */
.tarot-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.spread { display: grid; grid-template-columns: repeat(3, 11.5rem); gap: 16px; justify-content: center; }
.spread figure { margin: 0; display: grid; gap: 10px; }
.cardface {
  position: relative; display: grid; grid-template-rows: auto 1fr auto;
  gap: 8px; padding: 14px 10px 12px;
  aspect-ratio: 5 / 8; border-radius: 12px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(139, 118, 255, 0.16), transparent 62%),
    linear-gradient(165deg, #1c1738 0%, #100d1a 58%, #1a1330 100%);
  border: 1px solid rgba(196, 181, 253, 0.3);
  color: #e9e4ff; cursor: pointer; overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.3, 0.64, 1), border-color 0.25s ease, box-shadow 0.3s ease;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}
.cardface::before {
  content: ""; position: absolute; inset: 6px; border-radius: 8px;
  border: 1px solid rgba(196, 181, 253, 0.16); pointer-events: none;
}
.cardface:hover {
  transform: translateY(-5px);
  border-color: rgba(233, 213, 168, 0.55);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.55);
}
.cardface:focus-visible { outline: 2px solid rgba(196, 181, 253, 0.8); outline-offset: 3px; }

.cardface__top {
  text-align: center; font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.2em; color: rgba(233, 213, 168, 0.8);
}
.cardface__seal {
  align-self: center; justify-self: center;
  width: 66%; aspect-ratio: 1; display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(196, 181, 253, 0.24);
  box-shadow: 0 0 26px rgba(139, 118, 255, 0.14) inset;
  color: #d6cdff;
}
.cardface__seal svg {
  width: 60%; height: 60%;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.cardface__bottom { display: grid; gap: 3px; text-align: center; }
.cardface__name {
  font-family: "Cormorant Garamond", Georgia, serif;
  /* the card is only ~96 px wide on a phone, so the title has to scale with it */
  font-size: clamp(0.7rem, 9.4cqw, 1rem);
  font-weight: 600; line-height: 1.12;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: rgba(246, 242, 255, 0.94);
  overflow-wrap: break-word;
}
.cardface__key {
  font-size: clamp(0.46rem, 5.6cqw, 0.62rem);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(196, 181, 253, 0.6);
}

/* the face-down side: a dark card with a small eclipse and a scatter of stars */
.cardface__back {
  position: absolute; inset: 0; display: grid; place-items: center;
}
.cardface__back::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 22% 18%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 68% 12%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 40% 38%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 78% 62%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 30% 76%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 56% 88%, rgba(255, 255, 255, 0.25), transparent);
}
.cardface__eclipse {
  width: 40%; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(196, 181, 253, 0.3);
  box-shadow: inset -8px 0 14px rgba(139, 118, 255, 0.28), 0 0 22px rgba(139, 118, 255, 0.16);
}

.tarot-card { margin: 0; display: grid; gap: 8px; container-type: inline-size; }
.tarot-card__pos {
  text-align: center; font-size: 0.68rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted-2);
}
.tarot-card__meaning { font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
@media (max-width: 680px) {
  .tarot-card__meaning { font-size: 0.72rem; line-height: 1.4; }
  .cardface { padding: 10px 6px 9px; }
  .cardface__key { font-size: 0.5rem; letter-spacing: 0.1em; }
  .cardface__top { font-size: 0.5rem; letter-spacing: 0.14em; }
}
/* 正念 breathing */
.breathe-panel { display: grid; gap: 6px; }
.breathe-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.breathe-count {
  flex: none; font-size: 0.8rem; color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.breathe {
  display: grid; place-items: center; gap: 14px;
  padding: 26px 0 20px; position: relative; min-height: 15rem;
}
.breathe__orb {
  width: 8.5rem; height: 8.5rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(196, 181, 253, 0.9), rgba(139, 92, 246, 0.55) 55%, rgba(76, 43, 140, 0.25));
  box-shadow: 0 0 42px rgba(139, 92, 246, 0.35), inset 0 0 24px rgba(255, 255, 255, 0.18);
  transform: scale(0.82);
  transition: transform 6s cubic-bezier(0.37, 0, 0.63, 1);
}
.breathe__orb.is-in { transform: scale(1.12); transition-duration: 4s; }
.breathe__orb.is-out { transform: scale(0.82); transition-duration: 6s; }
.breathe__label {
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); min-height: 1.2em;
}

@media (prefers-reduced-motion: reduce) {
  .breathe__orb { transition: none; }
}
/* appearance: swatches and the image picker */
.appearance { margin-top: 0; }
.swatch--custom { position: relative; min-height: 0; }
.swatch--custom input[type="color"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; cursor: pointer;
}
.swatch__chip--custom {
  background: conic-gradient(from 0deg, #f87171, #fbbf24, #4ade80, #38bdf8, #a78bfa, #f87171);
}
.swatch--custom.is-active { border-color: var(--accent); }

.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.swatch {
  display: grid; justify-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 12px;
  background: transparent; padding: 10px 12px; cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.swatch:hover { border-color: var(--line-2); background: var(--hover); }
.swatch.is-active { border-color: var(--accent); background: var(--hover); }
.swatch__chip {
  width: 34px; height: 34px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 2px 8px rgba(0, 0, 0, 0.4);
}
.swatch__name { font-size: 0.72rem; color: var(--muted); }
.swatch.is-active .swatch__name { color: var(--ink); }

/* ---------- opening a book by key ---------- */
.keyopen { display: grid; gap: 6px; min-width: 15rem; }
.keyopen__label {
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2);
}
.keyopen__input {
  width: 7.5rem; letter-spacing: 0.28em; text-align: center;
  font-variant-numeric: tabular-nums; font-size: 0.95rem;
}
@media (max-width: 680px) {
  .keyopen { min-width: 0; width: 100%; }
  .keyopen .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .keyopen__input { grid-column: 1 / -1; width: 100%; }
  .keyopen .row .btn { width: 100%; }
}

/* ---------- practice questions ---------- */
/* these blocks set their own display, which would beat the hidden attribute */
.scard--quiz [hidden] { display: none !important; }
.scard--quiz { grid-column: span 12; }
.quiz__setup { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.quiz__field { max-width: 15rem; }
.quiz__setup .btn { margin-bottom: 1px; }

.quiz { display: grid; gap: 12px; }
.quiz__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.quiz__meta { font-size: 0.78rem; color: var(--muted); }
.quiz__score { font-size: 0.8rem; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.quiz__q { font-size: 1.02rem; font-weight: 600; line-height: 1.45; max-width: 60ch; }

.quiz__options { display: grid; gap: 8px; max-width: 60rem; }
.quiz__option {
  display: flex; align-items: flex-start; gap: 10px; text-align: left;
  padding: 11px 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  font-size: 0.9rem; line-height: 1.45;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}
.quiz__option:hover:not(:disabled) { border-color: var(--line-2); background: var(--hover); color: var(--ink); }
.quiz__option:disabled { cursor: default; opacity: 0.85; }
.quiz__key {
  flex: none; width: 1.5rem; height: 1.5rem; display: grid; place-items: center;
  border-radius: 7px; border: 1px solid var(--line);
  font-size: 0.72rem; color: var(--muted-2);
}
.quiz__option.is-right { border-color: var(--good); color: var(--ink); }
.quiz__option.is-right .quiz__key { border-color: var(--good); color: var(--good); }
.quiz__option.is-wrong { border-color: var(--bad); }
.quiz__option.is-wrong .quiz__key { border-color: var(--bad); color: var(--bad); }

.quiz__feedback { font-size: 0.84rem; min-height: 1.2em; color: var(--muted); }
.quiz__feedback.is-right { color: var(--good); }
.quiz__feedback.is-wrong { color: var(--bad); }

.quiz__summary { display: grid; gap: 8px; justify-items: start; }
.quiz__result { font-size: 1.1rem; font-weight: 650; }

@media (max-width: 680px) {
  .quiz__field { max-width: none; width: 100%; }
  .quiz__setup .btn { width: 100%; }
}

/* ---------- weather module on the desk ---------- */
.wxcard {
  /* wide placement: one horizontal strip under the figures */
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: 18px; border-radius: 18px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--elevation); color: var(--ink);
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}
.wxcard:hover { border-color: var(--line-2); background: var(--panel-2); }
.wxcard__top {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: nowrap; flex: none;
}
.wxcard__icon { display: flex; flex: none; color: var(--accent); }
.wxcard__temp {
  font-size: clamp(2rem, 3.4vw, 2.6rem); font-weight: 700; line-height: 1;
  letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wxcard__line { font-size: 0.84rem; color: var(--muted); white-space: nowrap; }
.wxcard__facts {
  display: grid; grid-template-columns: repeat(3, auto); gap: 6px 22px;
  margin: 0 0 0 auto; padding: 2px 0 2px 20px; border-left: 1px solid var(--line);
}
.wxcard__facts dt {
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2);
}
.wxcard__facts dd { margin: 2px 0 0; font-size: 0.9rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* the clock itself is the way into the clock page */
.anchor--link { display: block; text-decoration: none; color: inherit; }
.anchor__go {
  font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted-2); margin-left: 8px; opacity: 0;
  transition: opacity 0.18s ease;
}
.anchor--link:hover .anchor__go, .anchor--link:focus-visible .anchor__go { opacity: 1; }

@media (max-width: 980px) {
  .wxcard { padding: 16px; }
}
@media (max-width: 640px) {
  /* the strip folds: the figures go under the reading, not beside it */
  .wxcard__facts {
    width: 100%; margin-left: 0; padding-left: 0;
    border-left: 0; border-top: 1px solid var(--line); padding-top: 8px;
  }
  }

/* ---------- framing a wallpaper ---------- */
.crop {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 20px;
  background: rgba(6, 6, 9, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.crop[hidden] { display: none !important; }

.crop__sheet {
  display: grid; gap: 8px; justify-items: center;
  max-width: min(920px, 94vw);
  padding: 18px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--line-2);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}
.crop__title { font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.crop__hint { font-size: 0.76rem; color: var(--muted); text-align: center; max-width: 46ch; }

.crop__stage {
  position: relative; margin-top: 6px; border-radius: 12px; overflow: hidden;
  background: #000; line-height: 0; touch-action: none;
}
.crop__stage img { display: block; width: 100%; height: 100%; object-fit: cover; }

.crop__sel {
  position: absolute; box-sizing: border-box;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 6px; cursor: move;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
}
.crop__handle {
  position: absolute; width: 14px; height: 14px; border-radius: 4px;
  background: #fff; border: 1px solid rgba(0, 0, 0, 0.35);
}
.crop__handle[data-h="nw"] { left: -7px; top: -7px; cursor: nwse-resize; }
.crop__handle[data-h="ne"] { right: -7px; top: -7px; cursor: nesw-resize; }
.crop__handle[data-h="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; }
.crop__handle[data-h="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }

.crop__actions { display: flex; gap: 8px; justify-content: flex-end; width: 100%; margin-top: 10px; }
@media (max-width: 680px) {
  .crop__sheet { padding: 14px; }
  .crop__actions .btn { flex: 1; }
}

/* the wallpaper page is a dark stage whatever the theme is: the picture sits
   behind the words, so the words have to be light in both modes */
.wp-body {
  --bg: #08080c;
  --panel: rgba(20, 20, 27, 0.72);
  --panel-2: rgba(30, 30, 39, 0.72);
  --line: rgba(255, 255, 255, 0.13);
  --line-2: rgba(255, 255, 255, 0.26);
  --hover: rgba(255, 255, 255, 0.08);
  --hover-2: rgba(255, 255, 255, 0.12);
  --ink: #f4f4f9;
  --ink-2: #d9d9e2;
  --muted: #a7a7b4;
  --muted-2: #8b8b98;
  color-scheme: dark;
  background: #08080c;
}
.wp-body .nav { background: transparent; }
.wp-body .nav__brand, .wp-body .nav__links a { color: var(--ink); }
.wp-body .tool__head h1 { color: var(--ink); }
.wp-body .tool__head p { color: var(--muted); }
.wp-body .petnotes { color: var(--ink-2); }
.wp-body .petnotes h2 { color: var(--ink); }
.wp-body .petnotes li b { color: var(--ink); }

/* ---------- the moving wallpaper behind a page ----------
   only mounted when the local service answers, so the published site never
   asks for it */
.wp-live {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  pointer-events: none; background: #08080c;
  image-rendering: auto; /* the video stays sharp; no smoothing tricks */
}
.wp-live__scrim {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 6, 10, 0.62), rgba(6, 6, 10, 0.34) 42%, rgba(6, 6, 10, 0.74));
}
/* the still must not show through the video: one picture at a time */
/* only once the video is actually playing: before that the still is the only
   thing on screen, and hiding it would leave a black page */
html[data-wallpaper-live="ready"] body,
html[data-wallpaper-live="ready"][data-wallpaper] body {
  background-image: none;
  background-color: #08080c;
}
html[data-wallpaper-live] .shell { position: relative; z-index: 1; }
html[data-wallpaper-live] .nav { position: relative; z-index: 3; }
/* over a moving picture the theme decides the ink, not the wallpaper: light
   theme keeps dark words with a pale halo, dark theme keeps pale words */
html[data-theme="dark"][data-wallpaper-live] .desk__greet,
html[data-theme="dark"][data-wallpaper-live] .anchor__meta,
html[data-theme="dark"][data-wallpaper-live] .affirm__line,
html[data-theme="dark"][data-wallpaper-live] .affirm__cn,
html[data-theme="dark"][data-wallpaper-live] .nextup {
  color: rgba(242, 242, 247, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 0 14px rgba(0, 0, 0, 0.3);
}
html[data-theme="light"][data-wallpaper-live] .desk__greet,
html[data-theme="light"][data-wallpaper-live] .anchor__meta,
html[data-theme="light"][data-wallpaper-live] .affirm__line,
html[data-theme="light"][data-wallpaper-live] .affirm__cn,
html[data-theme="light"][data-wallpaper-live] .nextup {
  color: rgba(16, 16, 22, 0.86);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85), 0 0 12px rgba(255, 255, 255, 0.6);
}
html[data-wallpaper-live] .anchor__meta b { color: inherit; }
html[data-wallpaper-live] .nav__brand,
html[data-wallpaper-live] .nav__links a { color: #f2f2f7; }
/* ---------- the wallpaper menu ---------- */
.wpmenu { position: relative; display: inline-block; }
.wpmenu__panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 40;
  width: 17rem; display: grid; gap: 4px; padding: 6px;
  border-radius: 14px; background: var(--panel-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.wpmenu__panel[hidden] { display: none !important; }
.wpmenu__item {
  display: grid; gap: 2px; text-align: left; width: 100%;
  padding: 9px 11px; border-radius: 10px; border: 0; cursor: pointer;
  background: transparent; color: var(--ink);
}
.wpmenu__item:hover { background: var(--hover); }
.wpmenu__item b { font-size: 0.82rem; font-weight: 600; }
.wpmenu__item span { font-size: 0.72rem; color: var(--muted); line-height: 1.35; }
/* ---------- the fitness column ---------- */
.fit__summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.fit__summary .metric { padding: 16px 18px; }
.fit__summary .metric__value { font-size: 1.5rem; }
.fit__summary .metric__meta { font-size: 0.74rem; color: var(--muted); }

.fit__panel { margin-bottom: 16px; }
.fit__panel h2 { display: flex; align-items: baseline; gap: 10px; }
.fit__cn {
  font-size: 0.76rem; font-weight: 500; letter-spacing: 0.06em;
  color: var(--muted-2);
}

.fit__table { margin: 12px 0 4px; }
.fit__caption {
  caption-side: bottom; text-align: left; padding-top: 8px;
  font-size: 0.74rem; color: var(--muted-2);
}
.fit__table tbody td:first-child {
  width: 6.5rem; color: var(--ink); font-weight: 600;
}
.fit__table tbody td:last-child { color: var(--muted); }

.fit__list { display: grid; gap: 9px; margin: 12px 0 4px; padding-left: 1.05rem; }
.fit__list li { font-size: 0.9rem; line-height: 1.55; color: var(--ink-2); }
.fit__list b { color: var(--ink); font-weight: 600; }
.fit__list a { color: var(--accent); }

.fit__caution .hint { margin-bottom: 8px; }
.fit__caution a { color: var(--accent); }

@media (max-width: 900px) {
  .fit__summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .fit__table tbody td:first-child { width: auto; }
}
/* ---------- the personal plan ---------- */
.fit__form {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 14px; margin: 14px 0 6px;
}
.fit__form .field > span em { font-style: normal; color: var(--muted-2); font-size: 0.7rem; }
.fit__form select,
.fit__form input[type="number"] {
  width: 100%; padding: 9px 11px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  font: inherit; font-size: 0.88rem;
}
.fit__form select:focus, .fit__form input:focus {
  outline: none; border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.fit__wish { grid-column: 1 / -1; }
.fit__actions { gap: 8px; margin-top: 4px; }

.plan {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid; gap: 12px;
}
.plan[hidden] { display: none !important; }
.plan__head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.plan__stat {
  display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.plan__stat span { font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.plan__stat b { font-size: 1.35rem; color: var(--ink); letter-spacing: -0.02em; }
.plan__stat i { font-style: normal; font-size: 0.68rem; color: var(--muted); }
.plan__stat.is-key { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.plan__stat.is-key b { color: var(--accent); }
.plan__stat.is-low b { color: var(--bad); }
.plan__stat.is-ok b { color: var(--good); }
.plan__stat.is-high b, .plan__stat.is-very-high b { color: var(--warn); }

.plan__line { font-size: 0.9rem; color: var(--ink-2); line-height: 1.6; }
.plan__line b { color: var(--ink); }
.plan__macros { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.plan__macros > div {
  display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}
.plan__macros span { font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.plan__macros b { font-size: 0.98rem; color: var(--ink); }
.plan__week { margin-top: 4px; }

@media (max-width: 900px) {
  .fit__form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan__head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan__macros { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ---------- the fitness block in the rail ---------- */
.fitmini__body { display: grid; gap: 8px; margin-top: 6px; }
.fitmini__empty { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }
.fitmini__empty a { color: var(--accent); }
.fitmini__list {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; margin: 0;
}
.fitmini__list dt {
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted-2); align-self: center;
}
.fitmini__list dd {
  margin: 0; text-align: right; font-size: 0.86rem; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.fitmini__link {
  justify-self: start; margin-top: 2px; font-size: 0.76rem; color: var(--accent);
  text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.fitmini__link:hover { border-bottom-color: var(--accent); }
/* ---------- the healing page ---------- */
.heal__grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px; padding-bottom: 8px;
}
.heal__card { display: grid; gap: 10px; align-content: start; padding: 20px; }
.heal__card h2 { display: flex; align-items: baseline; gap: 10px; }
.heal__card--history { grid-row: span 2; }

.heal__days { display: grid; gap: 6px; max-height: 22rem; overflow-y: auto; padding-right: 4px; }
.heal__day {
  display: grid; grid-template-columns: 7.2rem auto 1fr; align-items: center; gap: 10px;
  padding: 6px 0; border-top: 1px solid var(--line);
}
.heal__day:first-child { border-top: 0; }
.heal__date { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.heal__faces { display: flex; gap: 4px; }
.heal__face {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  color: var(--muted-2); background: transparent;
}
.heal__face.has { color: var(--ink); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.heal__face.l1 { color: var(--bad); }
.heal__face.l5 { color: var(--good); }
.heal__face i { width: 14px; height: 3px; border-radius: 999px; background: var(--line-2); display: block; }
.heal__words { font-size: 0.74rem; color: var(--muted-2); text-transform: lowercase; }
.heal__stats { font-size: 0.74rem; color: var(--muted); line-height: 1.5; }
.heal__empty { font-size: 0.82rem; color: var(--muted); }
.heal__clear { justify-self: start; }

.heal__quote {
  font-size: 1.15rem; line-height: 1.45; color: var(--ink);
  margin: 2px 0 0; padding-left: 14px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
}
.heal__cn { font-size: 0.86rem; color: var(--muted); padding-left: 14px; }

.heal__breath { position: relative; display: grid; place-items: center; height: 190px; }
.heal__orb {
  width: 118px; height: 118px; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--accent) 55%, transparent),
      color-mix(in srgb, var(--accent) 18%, transparent) 62%, transparent 72%);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 26%, transparent);
  transition: transform 4200ms cubic-bezier(0.34, 1, 0.64, 1);
}
.heal__orb[data-phase="2"] { transition-duration: 6000ms; }
.heal__breathText {
  position: absolute; display: grid; gap: 2px; justify-items: center; pointer-events: none;
}
.heal__breathText strong { font-size: 0.92rem; color: var(--ink); font-weight: 600; }
.heal__breathText span { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.heal__ground { display: grid; gap: 4px; margin: 4px 0 0; padding-left: 1.1rem; }
.heal__ground li { font-size: 0.8rem; color: var(--muted); }
.heal__ground b { color: var(--accent); }

@media (max-width: 900px) {
  .heal__grid { grid-template-columns: minmax(0, 1fr); }
  .heal__card--history { grid-row: auto; }
  .heal__day { grid-template-columns: 6rem auto; }
  .heal__words { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .heal__orb { transition: none; }
}
/* the quick action, the toolkit and the dump */
.heal__card--history { grid-row: span 3; }
.heal__quick {
  display: grid; gap: 6px; padding: 14px 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.heal__quick h3 { font-size: 0.98rem; color: var(--ink); margin: 0; }
.heal__quick p { font-size: 0.88rem; color: var(--ink-2); line-height: 1.55; margin: 0; }
.heal__quickTime {
  font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}

.heal__tools { display: grid; gap: 8px; margin: 2px 0 0; padding-left: 1.05rem; }
.heal__tools li { font-size: 0.86rem; line-height: 1.55; color: var(--ink-2); }
.heal__tools b { color: var(--ink); font-weight: 600; }

.heal__dump {
  width: 100%; resize: vertical; min-height: 8rem;
  padding: 12px 14px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--ink); font: inherit; font-size: 0.9rem; line-height: 1.6;
}
.heal__dump::placeholder { color: var(--muted-2); }
.heal__dump:focus {
  outline: none; border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.heal__dumpRow { justify-content: space-between; align-items: center; gap: 10px; }
.heal__count { font-size: 0.74rem; color: var(--muted-2); font-variant-numeric: tabular-nums; }
/* ---------- the quiet line under the rail ---------- */
.rail__more {
  display: flex; flex-wrap: wrap; gap: 14px;
  padding: 14px 4px 0; margin: 0;
  font-size: 0.74rem;
}
.rail__more a {
  color: var(--muted-2); text-decoration: none;
  border-bottom: 1px solid transparent; transition: color 160ms ease, border-color 160ms ease;
}
.rail__more a:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.rail__more a[hidden] { display: none !important; }
/* ---------- contact ---------- */
.contact {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px; align-items: start; padding-bottom: 8px;
}
.contact__direct { display: grid; gap: 12px; }
.contact__card { display: grid; gap: 8px; padding: 20px; }
.contact__card h2, .contact__form h2 {
  font-size: 1rem; font-weight: 600; color: var(--ink); letter-spacing: -0.01em;
}
.contact__value {
  font-size: 0.86rem; color: var(--ink-2); word-break: break-word;
}
.contact__note { font-size: 0.78rem; color: var(--muted); line-height: 1.5; max-width: 46ch; }

.contact__form { display: grid; gap: 10px; padding: 20px; position: sticky; top: 84px; }
.field { display: grid; gap: 4px; }
.field > span {
  font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2);
}
.field input, .field textarea {
  width: 100%; padding: 9px 11px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--ink); font: inherit; font-size: 0.86rem; resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.field textarea { min-height: 8.5rem; line-height: 1.5; }

.sign {
  margin: 26px 0 40px; font-size: 0.78rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted-2);
}

@media (max-width: 900px) {
  .contact { grid-template-columns: minmax(0, 1fr); }
  .contact__form { position: static; }
}

/* a still picture gets the same rule: the theme chooses the ink, the picture
   only decides how strong the halo has to be */
html[data-theme="light"][data-wallpaper] .anchor__meta,
html[data-theme="light"][data-wallpaper] .desk__greet,
html[data-theme="light"][data-wallpaper] .nextup,
html[data-theme="light"][data-wallpaper] .affirm__cn {
  color: rgba(16, 16, 22, 0.84);
}
html[data-theme="dark"][data-wallpaper] .anchor__meta,
html[data-theme="dark"][data-wallpaper] .desk__greet,
html[data-theme="dark"][data-wallpaper] .nextup {
  color: rgba(242, 242, 247, 0.88);
}
html[data-wallpaper] .anchor__meta b { color: inherit; }

/* ---------- a video wallpaper is expensive to composite ----------
   backdrop-filter has to be recomputed for every video frame and is by far the
   biggest cost on this page: with a moving picture behind them the panels go
   flat, which nobody can see anyway because the picture itself carries the
   depth. */
html[data-wallpaper-live="ready"] .panel,
html[data-wallpaper-live="ready"] .rail__block,
html[data-wallpaper-live="ready"] .scard,
html[data-wallpaper-live="ready"] .metric,
html[data-wallpaper-live="ready"] .exam,
html[data-wallpaper-live="ready"] .subject,
html[data-wallpaper-live="ready"] .project,
html[data-wallpaper-live="ready"] .cw,
html[data-wallpaper-live="ready"] .wxcard,
html[data-wallpaper-live="ready"] .affirm,
html[data-wallpaper-live="ready"] .btn {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
html[data-wallpaper-live="ready"] .panel,
html[data-wallpaper-live="ready"] .rail__block {
  background: rgba(16, 16, 22, 0.74);
}
html[data-wallpaper-live="ready"] .wp-live {
  will-change: transform;
  transform: translateZ(0);
}
/* ---------- wallpaper strip in the rail ---------- */
.wppick { display: grid; gap: 6px; margin-top: 14px; }
.wppick[hidden] { display: none !important; }
.rail__block li[hidden] { display: none !important; }
.wpmenu__item[hidden] { display: none !important; }
.wppick__label {
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2);
}
.wppick__row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 3.6rem; gap: 6px;
  overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: thin;
}
.wppick__thumb {
  position: relative; padding: 0; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; cursor: pointer; background: var(--panel-2); aspect-ratio: 1;
}
.wppick__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wppick__thumb:hover { border-color: var(--line-2); }
.wppick__thumb.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wppick__play {
  position: absolute; right: 3px; bottom: 3px; width: 14px; height: 14px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(8, 8, 12, 0.7); color: #fff; font-size: 0.5rem;
}
.wppick__launch {
  margin-left: 2px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--accent); background: transparent;
  color: var(--accent); font: inherit; font-size: 0.72rem; cursor: pointer;
}
.wppick__launch:hover { background: var(--hover); }
.wppick.is-flash {
  outline: 2px solid var(--accent);
  outline-offset: 6px; border-radius: 12px;
  animation: wppick-flash 1.2s ease-out;
}
@keyframes wppick-flash {
  0% { outline-color: transparent; }
  20% { outline-color: var(--accent); }
  100% { outline-color: transparent; }
}
.wppick__hint { font-size: 0.72rem; color: var(--muted); line-height: 1.45; }
/* ---------- wallpaper page ---------- */
.wp-body { background: #08080c; }
.wp-body .nav { position: sticky; }
.wp-body .tool { position: relative; z-index: 2; padding-bottom: 96px; }

.wp-stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #08080c; }
.wp-media {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  opacity: 0; transition: opacity 600ms ease;
}
.wp-stage.is-live .wp-media:not([hidden]) { opacity: 1; }
.wp-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 6, 10, 0.72) 0%, rgba(6, 6, 10, 0.35) 38%, rgba(6, 6, 10, 0.82) 100%),
    radial-gradient(80% 60% at 20% 10%, rgba(6, 6, 10, 0.25), transparent 70%);
}

.wp-bar {
  /* in the flow now: a floating bar sat on top of the library */
  position: sticky; top: 12px; z-index: 6;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  width: 100%; max-width: none; margin: 0 0 18px;
  padding: 10px 14px; border-radius: 999px;
  background: rgba(18, 18, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.wp-bar__now { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.wp-bar__dot {
  width: 7px; height: 7px; border-radius: 50%; background: #7a7a86; flex: none;
  align-self: center;
}
.wp-bar__dot.is-live { background: #4cc38a; box-shadow: 0 0 10px rgba(76, 195, 138, 0.8); }
.wp-bar__title {
  font-size: 0.86rem; font-weight: 600; color: #f6f6fa;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw;
}
.wp-bar__meta { font-size: 0.72rem; color: rgba(246, 246, 250, 0.55); white-space: nowrap; }
.wp-bar__actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }

.wp-chip {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(246, 246, 250, 0.82);
  border-radius: 999px; padding: 6px 12px; font-size: 0.76rem; cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.wp-chip:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.wp-chip.is-on { border-color: var(--accent); color: var(--accent); background: rgba(255, 255, 255, 0.1); }

.wp-spectrum {
  display: block; width: 100%; max-width: 680px; height: 54px;
  margin: -8px 0 16px; opacity: 0.75; pointer-events: none;
}

.wp-controls {
  display: grid; gap: 10px; padding: 16px 18px; margin-bottom: 18px;
  border-radius: 18px; background: rgba(18, 18, 24, 0.62);
  border: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.wp-controls__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wp-controls__label {
  font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2);
}
.wp-controls__hint { font-size: 0.76rem; color: var(--muted); max-width: 78ch; }

.wp-offline {
  margin: -6px 0 18px; padding: 12px 16px; border-radius: 14px;
  font-size: 0.82rem; color: var(--ink-2);
  background: rgba(120, 60, 40, 0.28);
  border: 1px solid rgba(255, 140, 100, 0.35);
}
.wp-library {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.wp-card {
  display: grid; grid-template-rows: auto auto; gap: 0; cursor: pointer; overflow: hidden;
  border-radius: 16px; background: var(--panel); border: 1px solid var(--line);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.wp-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.wp-card.is-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.wp-card__thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0d0d12; }
.wp-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wp-card__thumb.is-blank {
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(120, 110, 220, 0.35), transparent 70%),
    linear-gradient(135deg, #1a1a24, #101018);
}
.wp-card__thumb.is-blank::after {
  content: attr(data-initial); position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 2.1rem; font-weight: 700; color: rgba(255, 255, 255, 0.22);
  letter-spacing: 0.02em;
}
.wp-card__badge {
  position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(8, 8, 12, 0.7); color: #e9e9f0; border: 1px solid rgba(255, 255, 255, 0.16);
}
.wp-card__play {
  position: absolute; right: 10px; bottom: 10px; width: 26px; height: 26px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(8, 8, 12, 0.68); color: #fff; font-size: 0.7rem;
}
.wp-card__body { display: grid; gap: 2px; padding: 10px 12px 12px; }
.wp-card__body b { font-size: 0.86rem; font-weight: 600; color: var(--ink); }
.wp-card__meta { font-size: 0.72rem; color: var(--muted); }

@media (max-width: 680px) {
  .wp-bar { border-radius: 18px; bottom: 12px; padding: 10px; }
  .wp-bar__title { max-width: 52vw; }
  .wp-bar__actions { margin-left: 0; width: 100%; justify-content: space-between; }
  .wp-offline {
  margin: -6px 0 18px; padding: 12px 16px; border-radius: 14px;
  font-size: 0.82rem; color: var(--ink-2);
  background: rgba(120, 60, 40, 0.28);
  border: 1px solid rgba(255, 140, 100, 0.35);
}
.wp-library { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 10px; }
}

/* ---------- everything that changes should arrive, not appear ----------
   A static site is a series of separate documents, so smoothness has to be
   built twice: once between pages (the view transition below) and once inside
   a page, where palettes, wallpapers and tab contents swap in place. */
:root {
  --ease-out-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-swap: cubic-bezier(0.33, 1, 0.68, 1);
  --clock-soft: color-mix(in srgb, var(--accent) 58%, var(--bg));
}

/* a palette swap recolours the page over a beat instead of at once */
body,
.panel,
.rail__block,
.metric,
.scard,
.tool__head h1,
.nav,
.nav__links a,
.btn,
.ct__col,
.anchor__value,
.wxcard {
  transition:
    background-color 260ms var(--ease-out-soft),
    border-color 260ms var(--ease-out-soft),
    color 260ms var(--ease-out-soft);
}

/* blocks settle in as the page paints, a breath apart */
@keyframes settle-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.shell > header,
.desk__main > *,
.rail > *,
.tool > header,
.panel,
.metric {
  animation: settle-in 420ms var(--ease-swap) both;
}
.desk__main > *:nth-child(2) { animation-delay: 40ms; }
.desk__main > *:nth-child(3) { animation-delay: 80ms; }
.desk__main > *:nth-child(4) { animation-delay: 120ms; }
.desk__main > *:nth-child(5) { animation-delay: 160ms; }
.rail > *:nth-child(2) { animation-delay: 60ms; }
.rail > *:nth-child(3) { animation-delay: 120ms; }

/* a row that appears because something was clicked fades rather than jumps */
.mood__slots,
.mood__week,
[data-swap] {
  animation: settle-in 260ms var(--ease-swap) both;
}

/* the wallpaper itself fades when it is replaced */
html[data-wallpaper] body {
  transition: background-color 420ms var(--ease-out-soft);
}

@media (prefers-reduced-motion: reduce) {
  .shell > header,
  .desk__main > *,
  .rail > *,
  .tool > header,
  .panel,
  .metric,
  .mood__slots,
  .mood__week,
  [data-swap] {
    animation: none !important;
  }
  body,
  .panel,
  .rail__block,
  .metric,
  .scard,
  .nav,
  .btn,
  .wxcard {
    transition: none !important;
  }
}

/* ---------- moving between pages ----------
   The site is plain HTML, so every link is a full document swap. The View
   Transitions API turns that swap into a cross-fade the browser does itself;
   where it is missing, the content still fades in on load (see below). */
@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 300ms;
  animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
}
::view-transition-old(root) {
  animation-name: fade-out-page;
  animation-duration: 140ms;
}
::view-transition-new(root) {
  animation-name: fade-in-page;
  animation-duration: 320ms;
}

@keyframes fade-out-page {
  to { opacity: 0; }
}
@keyframes fade-in-page {
  from { opacity: 0; transform: translateY(10px) scale(0.996); }
  to { opacity: 1; transform: none; }
}

/* the pet is the same creature on both sides, so it holds still instead of
   fading with the content; the bar cross-fades so its sliding pill stays visible */
.petcanvas { view-transition-name: pet; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

/* browsers without cross-document transitions get a short entrance instead */
@supports not (view-transition-name: nav) {
  main { animation: fade-in-page 260ms ease-out both; }
  @media (prefers-reduced-motion: reduce) {
    main { animation: none; }
  }
}

/* ---------- the desk pet ---------- */
.petcanvas {
  position: fixed; z-index: 60; left: 0; top: 0;
  cursor: grab; touch-action: none; user-select: none;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.35));
}
.petcanvas.is-dragging { cursor: grabbing; }

.petbubble {
  position: fixed; z-index: 62; max-width: 15rem;
  display: grid; gap: 2px; padding: 9px 13px;
  border-radius: 14px; background: var(--panel);
  border: 1px solid var(--line-2); box-shadow: var(--elevation);
  pointer-events: none;
}
.petbubble__en { font-size: 0.84rem; color: var(--ink); }
.petbubble__cn { font-size: 0.76rem; color: var(--muted); }

.petmenu {
  position: fixed; z-index: 63; display: grid; padding: 6px;
  border-radius: 12px; background: var(--panel);
  border: 1px solid var(--line-2); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.petmenu button {
  border: 0; background: none; text-align: left; cursor: pointer;
  padding: 8px 12px; border-radius: 8px;
  font-size: 0.84rem; color: var(--ink-2);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.petmenu button:hover { background: var(--hover-2); color: var(--ink); }
/* these two set their own display, so the attribute needs saying out loud */
.petbubble[hidden], .petmenu[hidden] { display: none !important; }

.petctrl {
  display: grid; gap: 12px; padding: 18px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--elevation);
  margin-bottom: 18px;
}
.petctrl__row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.petctrl__label {
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-2); min-width: 6rem;
}
.petctrl__btn { padding: 7px 13px; font-size: 0.82rem; }
.petctrl__btn.is-on { border-color: var(--accent); color: var(--accent); background: var(--hover-2); }
.petctrl__range { width: min(18rem, 60vw); accent-color: var(--accent); }
.petctrl__hint { font-size: 0.76rem; color: var(--muted); max-width: 60ch; }

.petnotes {
  display: grid; gap: 10px; padding: 20px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--elevation);
  margin-bottom: 120px;
}
.petnotes h2 { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); }
.petnotes ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; }
.petnotes li { font-size: 0.86rem; color: var(--ink-2); }
.petnotes b { color: var(--ink); font-weight: 600; }

@media (max-width: 680px) {
  .petctrl__label { min-width: 0; width: 100%; }
  .petnotes { margin-bottom: 140px; }
}

/* ---------- today's mood ---------- */
.mood__slots { display: flex; gap: 4px; margin-top: 10px; }
.mood__slot {
  flex: 1; border: 1px solid var(--line); background: transparent;
  color: var(--muted); border-radius: 8px; padding: 5px 0;
  font-size: 0.7rem; letter-spacing: 0.04em; cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}
.mood__slot:hover { color: var(--ink); background: var(--hover); }
/* the chosen tab is a little firmer than the others, but it does not wear the
   accent until the block is actually in play */
.mood__slot.is-on {
  color: var(--ink); border-color: var(--line-2); background: var(--hover-2);
  transition: color 180ms var(--ease-out-soft, ease),
              border-color 180ms var(--ease-out-soft, ease);
}
.rail__block:hover .mood__slot.is-on,
.mood__slots:hover .mood__slot.is-on,
.mood__slot.is-on:focus-visible {
  color: var(--accent); border-color: var(--accent);
}

.mood { display: flex; gap: 6px; margin-top: 10px; }
.mood__btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--line); background: transparent;
  color: var(--mood); opacity: 0.6; cursor: pointer;
  transition: opacity 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}
.mood__btn:hover { opacity: 1; background: var(--hover); }
/* the face keeps its mouth colour — that is the record — but the ring waits */
.mood__btn.is-picked { opacity: 1; border-color: var(--line-2); }
.rail__block:hover .mood__btn.is-picked,
.mood:hover .mood__btn.is-picked,
.mood__btn.is-picked:focus-visible { border-color: var(--mood); }
.mood__btn[data-level="1"] { --mood: var(--mood-1); }
.mood__btn[data-level="2"] { --mood: var(--mood-2); }
.mood__btn[data-level="3"] { --mood: var(--mood-3); }
.mood__btn[data-level="4"] { --mood: var(--mood-4); }
.mood__btn[data-level="5"] { --mood: var(--mood-5); }
/* three cells a day: evening on top, morning at the bottom */
/* a calendar week: Monday to Sunday, with the weekday under each column */
.mood__week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin-top: 12px; }
.mood__day {
  display: grid; grid-template-rows: 3fr 3fr 3fr auto; gap: 2px;
  border-radius: 4px; padding: 2px;
}
.mood__day.is-future { opacity: 0.4; }
.mood__letter {
  font-size: 0.58rem; letter-spacing: 0.04em; color: var(--muted-2);
  text-align: center; padding-top: 3px;
}
.mood__letter.is-today { color: var(--accent); }
.mood__day.is-today { background: var(--hover); outline: 1px solid var(--line-2); outline-offset: 1px; }
.mood__cell {
  border-radius: 2px; background: var(--line);
  position: relative; overflow: hidden; min-height: 8px;
}
.mood__cell[data-level="1"].has::after { background: var(--mood-1); }
.mood__cell[data-level="2"].has::after { background: var(--mood-2); }
.mood__cell[data-level="3"].has::after { background: var(--mood-3); }
.mood__cell[data-level="4"].has::after { background: var(--mood-4); }
.mood__cell[data-level="5"].has::after { background: var(--mood-5); }
.mood__cell.has::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 2px;
}
.mood__open {
  justify-self: start; margin-top: 6px; font-size: 0.74rem; color: var(--accent);
  text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.mood__open:hover { border-bottom-color: var(--accent); }
.mood__undo {
  justify-self: start; margin-top: 8px; padding: 4px 11px;
  border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted-2);
  font: inherit; font-size: 0.72rem; cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}
.mood__undo:hover {
  color: var(--ink); border-color: var(--line-2);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.mood__undo[hidden] { display: none !important; }
.mood__note { font-size: 0.72rem; color: var(--muted); margin-top: 8px; }

/* ---------- study: content-driven dashboard ----------
   The photo and the one headline figure carry the page; everything else is a
   card at one of three widths, so no two rows look the same. */
.study-hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 28px); align-items: stretch;
  margin-bottom: clamp(16px, 2.4vw, 28px);
}
.study-hero__photo {
  margin: 0; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line); background: var(--panel);
  /* the picture leads, but it must not push the grid off the first screen */
  height: clamp(15rem, 24vw, 21rem); position: relative;
}
.study-hero__photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(0.92) contrast(1.02);
}
.study-hero__photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(200deg, transparent 40%, rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.study-hero__panel {
  display: grid; gap: 10px; align-content: center;
  padding: clamp(18px, 2.6vw, 30px);
  border-radius: 20px; background: var(--panel);
  border: 1px solid var(--line); box-shadow: var(--elevation);
}
.study-hero__eyebrow {
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted-2);
}
.study-hero__eyebrow span { color: var(--accent); }
.study-hero__figure {
  font-size: clamp(3.2rem, 7vw, 5rem); line-height: 0.95; font-weight: 700;
  letter-spacing: -0.05em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.study-hero__figure small { font-size: 0.32em; font-weight: 500; color: var(--muted); margin-left: 6px; }
.study-hero__note { font-size: 0.86rem; color: var(--muted); }
.study-hero__track {
  height: 6px; border-radius: 999px; background: var(--line); overflow: hidden;
}
.study-hero__track i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}
.study-hero__facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin: 8px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
}
.study-hero__facts dt {
  font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2);
}
.study-hero__facts dd { margin: 3px 0 0; font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* three card widths, so the grid reads as a composition */
.study-grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(14px, 1.8vw, 22px); padding-bottom: 72px;
}
.scard {
  grid-column: span 12;
  align-self: start;   /* a short card should stay short, not stretch to its neighbour */
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px; box-shadow: var(--elevation);
  display: grid; gap: 12px; align-content: start; min-width: 0;
}
.scard--courses { grid-column: span 7; }
.scard--chart { grid-column: span 5; }
.scard--deck { grid-column: span 8; }
.scard--exams { grid-column: span 4; }
.scard--projects { grid-column: span 12; }
/* the course tiles sit inside a 7-column card, so they get two columns */
.scard--courses .subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scard--courses .subject__head b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.scard h2 { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; }
.scard__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.scard__meta { font-size: 0.76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.scard__hint { font-size: 0.78rem; color: var(--muted); }
/* inline code inside study cards: a quiet chip so the snippets stay scannable */
.scard code {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 5px; font-size: 0.86em; color: var(--ink-2); white-space: nowrap;
}

/* period switch: three small buttons, one clearly pressed */
.period { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.period button {
  border: 0; background: transparent; color: var(--muted);
  padding: 5px 11px; border-radius: 999px; font-size: 0.76rem; cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.period button:hover { color: var(--ink); }
.period button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }

/* with nothing marked the card says so in one line instead of drawing four grey slabs */
.chart.is-empty { grid-template-columns: minmax(0, 1fr); min-height: 0; align-items: start; }
.chart__empty { display: grid; gap: 4px; padding: 18px 0 6px; }
.chart__empty p { font-size: 0.88rem; color: var(--ink-2); }
.chart__empty .chart__hint { font-size: 0.78rem; color: var(--muted); max-width: 34ch; }

/* the chart: four columns, the selected course picked out */
.chart {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px; align-items: end; min-height: 12rem; margin-top: 4px;
}
.chart__col {
  display: grid; gap: 6px; justify-items: center; align-content: end;
  border: 1px solid transparent; border-radius: 12px; background: transparent;
  padding: 8px 4px 6px; cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.chart__col:hover { background: var(--hover); }
.chart__col.is-current { border-color: var(--line-2); background: var(--hover); }
.chart__value { font-size: 0.86rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.chart__bar {
  display: flex; align-items: flex-end; width: 100%; height: 8.5rem;
  border-radius: 8px; background: var(--hover); overflow: hidden;
}
.chart__bar i {
  display: block; width: 100%; min-height: 3px; border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transition: height 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.chart__label { font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }

@media (max-width: 1100px) {
  .scard--courses, .scard--chart, .scard--deck, .scard--exams { grid-column: span 12; }
  .study-hero { grid-template-columns: minmax(0, 1fr); }
  .study-hero__photo { min-height: 15rem; max-height: 22rem; }
}
@media (max-width: 680px) {
  .study-hero__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart__bar { height: 6.5rem; }
}

/* 7 · phone */
@media (max-width: 1000px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clockgrid { grid-template-columns: minmax(0, 1fr); }
  .entryform { grid-template-columns: 1fr 1fr; }
  .entryform .field--wide { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .cards, .strip, .stats { grid-template-columns: minmax(0, 1fr); }
  .spread { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .nav { flex-wrap: wrap; row-gap: 8px; padding: 12px 16px; }
  .nav__links { width: 100%; margin-left: 0; gap: 2px; }
  .nav__links a { padding: 0 8px; font-size: 0.8rem; height: 32px; }
  /* on a phone the toggle belongs on the brand row, not stranded after the links */
  .nav__links {
    order: 2; flex-wrap: nowrap; overflow-x: auto;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .nav__links::-webkit-scrollbar { display: none; }
  .nav__mode { order: 1; margin-left: auto; width: 32px; height: 32px; }
  .shell { padding: 0 16px; }
  .hero { padding: 36px 0 4px; }
  .entryform { grid-template-columns: 1fr; }
  thead { display: none; }
  tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
  tbody td { border: 0; padding: 0; }
  tbody td.num { grid-column: 2; grid-row: 1; }
  tbody td.actions { grid-column: 2; grid-row: 3; }
  .spread { gap: 10px; }
}

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

  /* One exception, and only one: the menu highlight. A reduced-motion setting
     should stop decorative motion, not the feedback that says which page you
     are on — so it still travels, once, short and without overshoot. */
  .nav__ink {
    transition: transform 0.2s ease-out, width 0.2s ease-out,
                height 0.16s ease-out, opacity 0.16s ease-out !important;
  }
}

/* ---------- quiet until touched ----------
   Nothing wears the accent while the pointer is elsewhere: buttons sit in the
   page's own ink, and only the thing under the cursor takes the colour. */
.btn--primary {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink-2);
  transition: background-color 180ms var(--ease-out-soft, ease),
              border-color 180ms var(--ease-out-soft, ease),
              color 180ms var(--ease-out-soft, ease);
}
.btn--primary:hover,
.btn--primary:focus-visible {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line-2));
  color: color-mix(in srgb, var(--accent) 70%, var(--ink));
}

.fitmini__link,
.mood__open,
.panel a,
.rail__more a {
  color: var(--muted);
  border-bottom-color: color-mix(in srgb, var(--muted-2) 42%, transparent);
  transition: color 180ms var(--ease-out-soft, ease),
              border-color 180ms var(--ease-out-soft, ease);
}
.fitmini__link:hover,
.fitmini__link:focus-visible,
.mood__open:hover,
.mood__open:focus-visible,
.panel a:hover,
.panel a:focus-visible,
.rail__more a:hover,
.rail__more a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* the fitness block's link only steps forward when the block is in play */
.fitmini__link { opacity: 0.62; }
.rail__block:hover .fitmini__link,
.fitmini__link:focus-visible { opacity: 1; }
/* ---------- a rail block that is a door ---------- */
.rail__block--go {
  cursor: pointer;
  transition: border-color 180ms var(--ease-out-soft, ease),
              background-color 180ms var(--ease-out-soft, ease);
}
.rail__block--go:hover { border-color: var(--line-2); }
.rail__block--go h2 a {
  color: inherit; text-decoration: none; border-bottom: 0;
}
.rail__block--go h2 a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 3px; border-radius: 4px;
}
/* the controls inside keep their own cursor */
.rail__block--go button,
.rail__block--go input,
.rail__block--go select { cursor: pointer; }
/* ---------- the bar once it is covering something ---------- */
.nav.is-stuck {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: 0 1px 0 var(--line);
}
html[data-wallpaper] .nav.is-stuck,
html[data-wallpaper-live] .nav.is-stuck {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}
html[data-theme="light"] .nav.is-stuck {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}
@media (max-width: 680px) {
  .nav.is-stuck { padding-bottom: 12px; }
}
/* rail links follow the same rule as panel links */
.rail__block a {
  color: var(--muted);
  border-bottom-color: color-mix(in srgb, var(--muted-2) 42%, transparent);
  transition: color 180ms var(--ease-out-soft, ease),
              border-color 180ms var(--ease-out-soft, ease);
}
.rail__block a:hover,
.rail__block a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.rail__block h2 a,
.rail__block h2 a:hover { color: inherit; border-bottom-color: transparent; }
/* a tab that is ahead of the clock: visible, but plainly not available yet */
.mood__slot.is-ahead,
.mood__slot:disabled {
  color: var(--muted-2);
  border-color: var(--line);
  background: transparent;
  cursor: default;
  opacity: 0.55;
}
.mood__slot.is-ahead:hover,
.mood__slot:disabled:hover {
  color: var(--muted-2); background: transparent; border-color: var(--line);
}

/* ---------- the history card, kept small ----------
   It is a glance, not a report: fourteen days, tight rows, and its own scroll
   so it never stretches the column it lives in. */
.heal__card--history { grid-row: auto; padding: 18px 20px; }
.heal__card--history .hint { margin-bottom: 6px; }
.heal__days { max-height: 13.5rem; overflow-y: auto; gap: 2px; padding-right: 6px; }
.heal__day { grid-template-columns: 5.6rem auto 1fr; gap: 8px; padding: 3px 0; }
.heal__date { font-size: 0.72rem; }
.heal__faces { gap: 2px; }
.heal__face { width: 22px; height: 22px; border-radius: 7px; }
.heal__face svg { width: 17px; height: 17px; }
.heal__face i { width: 11px; height: 2px; }
.heal__words { font-size: 0.68rem; }
.heal__stats { font-size: 0.68rem; line-height: 1.45; }
.heal__clear { font-size: 0.74rem; padding: 5px 12px; }
/* the page title and the line that belongs to it, side by side */
.heal__head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: 24px; align-items: end;
}
.heal__headLine {
  display: grid; gap: 10px; align-content: end;
  padding: 16px 18px 18px; border-radius: var(--r, 16px);
  background: var(--panel-a, var(--panel));
  border: 1px solid var(--line);
}
.heal__headLine h2 {
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted-2); margin: 0;
}
.heal__headLine .heal__quote { margin: 0; }
.heal__headLine .btn { justify-self: start; padding: 6px 14px; font-size: 0.78rem; }

@media (max-width: 900px) {
  .heal__head { grid-template-columns: minmax(0, 1fr); align-items: start; }
}
/* the unit cards hide and show by course; a display rule would otherwise win */
.unitcard[hidden] { display: none !important; }
/* ---------- Stitch's home ----------
   A small drawing at the end of the quote, where the page has room to breathe.
   It sits over whatever is behind, so it carries its own soft halo. */
.affirm { position: relative; }
.stitchhome {
  position: absolute; right: 0; bottom: -6px;
  display: grid; justify-items: center; gap: 2px;
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--ink-2);
  opacity: 0.72;
  transition: opacity 200ms var(--ease-out-soft, ease), transform 260ms var(--ease-out-soft, ease);
  filter: drop-shadow(0 1px 0 color-mix(in srgb, var(--bg) 65%, transparent));
}
.stitchhome svg { width: 116px; height: auto; display: block; }
.stitchhome__label {
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-2);
}
.stitchhome:hover { opacity: 1; transform: translateY(-2px); }
.stitchhome:active { transform: translateY(0); }
.stitchhome:focus-visible {
  outline: 2px solid color-mix(in srgb, #4a7fd4 60%, transparent);
  outline-offset: 6px; border-radius: 12px;
}
html[data-wallpaper] .stitchhome,
html[data-wallpaper-live] .stitchhome { color: var(--ink); }

@media (max-width: 900px) {
  .stitchhome { position: static; justify-self: end; margin-top: 8px; }
}
/* ---------- how Stitch is ---------- */
.petlife { margin: 0 0 18px; }
.petlife__card { display: grid; gap: 12px; }
.petlife__head { display: flex; align-items: center; gap: 10px; }
.petlife__head h2 { margin: 0; }
.petlife__mood {
  margin-left: auto; padding: 3px 11px; border-radius: 999px;
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line-2);
}
.petlife__mood[data-mood="happy"] { color: var(--good); border-color: color-mix(in srgb, var(--good) 55%, transparent); }
.petlife__mood[data-mood="hungry"] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.petlife__mood[data-mood="low"] { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.petlife__mood[data-mood="sleepy"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

.petlife__meters { display: grid; gap: 8px; }
.petlife__meter { display: grid; grid-template-columns: 5.4rem 1fr 2.6rem; align-items: center; gap: 10px; }
.petlife__label { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.petlife__track { height: 7px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.petlife__track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4a7fd4, var(--accent)); }
.petlife__value { font-size: 0.76rem; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }

.petlife__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.petlife__feed { display: flex; flex-wrap: wrap; gap: 6px; }
.petlife__btn span { color: var(--muted-2); }
.petlife__meta { font-size: 0.72rem; color: var(--muted-2); margin: 0; }
/* ---------- filling in a missed day ---------- */
.heal__fillbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
.heal__filllabel { font-size: 0.72rem; color: var(--muted-2); }
.heal__filldate {
  padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink); font: inherit; font-size: 0.78rem;
}
.heal__filldate:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.heal__fillgo { padding: 5px 12px; font-size: 0.76rem; }

.heal__editor {
  margin-top: 10px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  display: grid; gap: 8px;
}
.heal__editor[hidden] { display: none !important; }
.heal__editorHead { display: flex; align-items: center; gap: 10px; }
.heal__editorHead strong { font-size: 0.86rem; color: var(--ink); }
.heal__editorClose {
  margin-left: auto; padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font: inherit; font-size: 0.7rem; cursor: pointer;
}
.heal__editorClose:hover { color: var(--ink); border-color: var(--line-2); }
.heal__editorRows { display: grid; gap: 6px; }
.heal__editorRow { display: grid; grid-template-columns: 5.4rem auto; align-items: center; gap: 10px; }
.heal__editorSlot { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }
.heal__editorFaces { display: flex; gap: 4px; }
.heal__editorFace { width: 28px; height: 28px; }
.heal__editorHint { font-size: 0.68rem; color: var(--muted-2); margin: 0; }

/* a history row is a door now */
.heal__day { cursor: pointer; border-radius: 8px; }
.heal__day:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.heal__day:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
/* icons inside the pet card: inline, currentColor, aligned with the text */
.petlife__icon { display: inline-flex; vertical-align: -2px; margin-right: 5px; }
.petlife__moodIcon { display: inline-flex; vertical-align: -3px; margin-right: 6px; }
.petlife__mood { display: inline-flex; align-items: center; }
.petlife__btn { display: inline-flex; align-items: center; gap: 2px; }
.petlife__btn .petlife__icon { margin-right: 4px; }