/* Tardis: the control room. Midnight navy and signal blue by night, the same blue on pale sky by day.
   The shared frame (header, tab bar, sidebar, app switcher, type) is in family.css; this file is Tardis' own look. */
@font-face { font-family: "Space Grotesk"; src: url("/fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
:root {
  color-scheme: light dark;
  /* Tardis' personality, for the family frame */
  --bg: #f3f6fc; --surface: #ffffff; --surface-2: #e8eef9; --sidebar: #eaf0fa;
  --text: #0e1a3a; --text-2: #4e5c80; --text-3: #6b7799; --line: rgba(14, 26, 58, .1);
  --accent: #2459c7; --accent-fill: #2f6fe0; --on-accent: #ffffff; --brand: #2f6fe0;
  --bar: rgba(243, 246, 252, .84); --face: "Space Grotesk", var(--ui);
  --green: #1a8a4b; --red: #cf3434; --amber: #a86207;
  --shadow-s: 0 1px 2px rgba(14, 26, 58, .05), 0 2px 8px rgba(14, 26, 58, .05);
  --shadow-l: 0 2px 6px rgba(14, 26, 58, .08), 0 16px 40px rgba(14, 26, 58, .14);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1530; --surface: #142046; --surface-2: #1c2a57; --sidebar: #0b1530;
    --text: #eaf0ff; --text-2: #a3b1d6; --text-3: #8392bc; --line: rgba(255, 255, 255, .08);
    --accent: #7fb1ff; --accent-fill: #2f6fe0; --on-accent: #ffffff; --brand: #2f6fe0;
    --bar: rgba(11, 21, 48, .84);
    --green: #4cd88a; --red: #ff6b6b; --amber: #ffbf6b;
    --shadow-s: none; --shadow-l: 0 2px 6px rgba(0, 0, 0, .3), 0 18px 50px rgba(0, 0, 0, .45);
  }
}
/* The names the rest of this file was written with, in terms of the above. */
:root, body.night {
  --sky: var(--bg); --label: var(--text); --label-2: var(--text-2); --label-3: var(--text-3); --tint: var(--accent);
  --surface-edge: transparent; --surface-line: var(--line);
  --control: var(--surface-2); --control-edge: transparent; --control-press: color-mix(in srgb, var(--surface-2) 88%, var(--text));
  --field: color-mix(in srgb, var(--text) 6%, transparent);
  --card: var(--surface); --on-tint: var(--on-accent);
}
/* Night: the darkest sky, for sleep. */
body.night {
  color-scheme: dark;
  --bg: #05070f; --surface: #0d1124; --surface-2: #151a33; --sidebar: #05070f;
  --text: #c8cde0; --text-2: #9aa1ba; --text-3: #767e99; --line: rgba(255, 255, 255, .06);
  --accent: #8fa0d6; --accent-fill: #8fa0d6; --on-accent: #0b0e1a; --bar: rgba(5, 7, 15, .88);
  --shadow-s: none; --shadow-l: 0 20px 60px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--label); font: 100%/1.47 var(--ui); -webkit-font-smoothing: antialiased; transition: color .6s ease; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
a { color: var(--tint); text-decoration: none; }
:focus-visible { outline: 2.5px solid var(--tint); outline-offset: 2px; }

/* The background: one still colour, so the cards read cleanly. */
.sky { position: fixed; inset: 0; z-index: -1; background: var(--sky); transition: background-color .8s ease; }

/* ---------- surfaces ---------- */
.card, .glass-card, .wish, .app-tile {
  background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-s), inset 0 0 0 1px var(--line);
}
.card { padding: .95rem 1.1rem; }

/* Buttons: quiet tinted pills; the one that matters is filled. Instant press. */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 2.75rem; padding: .5rem 1.1rem; border: 0; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: .95rem; letter-spacing: -.005em; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  transition: transform .1s ease-out, background-color .1s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 19%, transparent); }
.btn:active { transform: scale(.96); }
.btn.primary { color: var(--on-accent); background: var(--accent-fill); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent-fill) 88%, var(--text)); }
.btn.small { min-height: 2.25rem; padding: .3rem .85rem; font-size: .86rem; }
.btn.danger { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

input, select, textarea {
  font: inherit; color: var(--label); background: var(--field); border: 0; border-radius: 12px; padding: .65rem .8rem; width: 100%;
  box-shadow: inset 0 0 0 1px var(--line);
}
input::placeholder { color: var(--label-3); }

/* ---------- layout and type ---------- */
.view { max-width: 62rem; margin: 0 auto; padding: 1.25rem 1.1rem calc(var(--tabbar-h) + var(--safe-bottom) + 3rem); }
@media (min-width: 900px) { .view { padding: 2.25rem 2.5rem 4rem; } }
h1.big { font-size: clamp(2.1rem, 6vw, 2.9rem); line-height: 1.05; letter-spacing: -.028em; font-weight: 700; margin: 1.1rem 0 .3rem; font-optical-sizing: auto; }
.sub { color: var(--label-2); font-size: .94rem; line-height: 1.4; }
h2.section { font-size: 1.3rem; line-height: 1.2; letter-spacing: -.016em; font-weight: 700; margin: 2rem 0 .7rem; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
h2.section .meta { font-size: .9rem; font-weight: 500; letter-spacing: 0; color: var(--label-2); }
.row { display: flex; gap: .5rem; align-items: center; }
.list { display: grid; gap: .55rem; }
.twocol { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr)); }

/* ---------- Home ---------- */
.grid { display: grid; gap: .65rem; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); }
.app-tile { display: grid; grid-template-columns: auto 1fr auto; gap: .75rem; align-items: center; padding: .75rem .9rem; color: var(--label); transition: transform .1s ease-out; -webkit-tap-highlight-color: transparent; }
.app-tile:active { transform: scale(.97); }
.app-tile .emoji { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; font-size: 1.45rem; background: var(--control); box-shadow: inset 0 1px 0 var(--control-edge); }
.app-tile .name { font-weight: 650; letter-spacing: -.01em; }
.app-tile .note { font-size: .8rem; color: var(--label-2); }
.dot { width: .62rem; height: .62rem; border-radius: 50%; background: var(--label-3); }
.dot.up { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
.dot.down { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent); }
.kv { display: flex; justify-content: space-between; gap: .75rem; padding: .55rem 0; border-top: .5px solid var(--surface-line); }
.kv:first-child { border-top: 0; }
.kv span:last-child { color: var(--label-2); text-align: right; }
.bar { height: .5rem; border-radius: 999px; background: var(--field); overflow: hidden; margin: .4rem 0 .15rem; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--tint) 70%, transparent), var(--tint)); }
.bar i.warn { background: var(--amber); } .bar i.full { background: var(--red); }

/* ---------- Wishlist ---------- */
.add-form { display: grid; gap: .6rem; }
.kinds { display: flex; flex-wrap: wrap; gap: .4rem; }
.kinds button {
  border: 0; border-radius: 999px; padding: .4rem .85rem; cursor: pointer; font-size: .9rem; font-weight: 550; color: var(--label);
  background: var(--control); box-shadow: inset 0 1px 0 var(--control-edge), inset 0 0 0 .5px var(--surface-line); transition: transform .1s ease-out;
}
.kinds button:active { transform: scale(.95); }
.kinds button[aria-pressed="true"] { color: #fff; background: color-mix(in srgb, var(--tint) 85%, transparent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.wish { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; padding: .6rem .75rem; border-radius: 18px; }
.wish .art { width: 2.75rem; height: 4rem; border-radius: 9px; background: var(--field) center/cover; display: grid; place-items: center; font-size: 1.35rem; box-shadow: inset 0 0 0 .5px var(--surface-line); }
.wish .t { font-weight: 650; letter-spacing: -.01em; }
.wish .s { font-size: .82rem; color: var(--label-2); }
.wish.done { opacity: .62; }
.wish.done .t { text-decoration: line-through; text-decoration-thickness: 1px; }
.chip { display: inline-block; vertical-align: .1em; padding: .05rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 650; margin-left: .35rem; background: var(--field); color: var(--label-2); }
.chip.ready { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.results { display: grid; gap: .3rem; }
.results button { text-align: left; border: 0; background: var(--field); border-radius: 12px; padding: .55rem .75rem; cursor: pointer; color: var(--label); transition: transform .1s ease-out; }
.results button:active { transform: scale(.98); }
.results button small { display: block; color: var(--label-2); }
details.done-list summary { cursor: pointer; color: var(--label-2); margin: 1.4rem 0 .6rem; font-weight: 600; }

/* ---------- Night ---------- */
.night-player { text-align: center; padding: 1.6rem 0 .4rem; }
.night-now { font-size: 1.35rem; font-weight: 650; letter-spacing: -.015em; margin: .4rem 0 .1rem; }
.night-show { color: var(--label-2); }
.night-big { /* a glass orb */
  position: relative; display: grid; place-items: center; width: 9.5rem; height: 9.5rem; margin: 1.7rem auto 1rem; border: 0; border-radius: 50%; cursor: pointer;
  color: var(--label); font-size: 1.15rem; font-weight: 650; letter-spacing: -.01em;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .14), rgba(255, 255, 255, .03) 60%), var(--control);
  box-shadow: inset 0 1px 0 var(--control-edge), inset 0 -10px 30px rgba(0, 0, 0, .25), var(--shadow-l);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  transition: transform .12s ease-out;
}
.night-big:active { transform: scale(.96); }
.night-big:disabled { opacity: .4; }
.night-big.playing { box-shadow: inset 0 1px 0 var(--control-edge), 0 0 0 1px rgba(143, 160, 214, .2), 0 0 70px rgba(143, 160, 214, .14); }
.night-vol { font-variant-numeric: tabular-nums; color: var(--label-2); font-size: .92rem; }
.night-controls { display: flex; justify-content: center; gap: .6rem; margin-top: 1.1rem; flex-wrap: wrap; }
.slider-row { display: grid; grid-template-columns: 1fr auto; gap: .3rem .75rem; align-items: center; padding: .6rem 0; border-top: .5px solid var(--surface-line); }
.slider-row:first-child { border-top: 0; }
.slider-row select { grid-column: 1 / -1; }
.slider-row input[type=range] { grid-column: 1 / -1; padding: 0; background: none; box-shadow: none; accent-color: var(--tint); }
.show-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 .7rem; }
.show-chips span { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .3rem .3rem .8rem; border-radius: 999px; background: var(--control); box-shadow: inset 0 1px 0 var(--control-edge); }
.show-chips button { border: 0; background: none; cursor: pointer; color: var(--label-2); width: 1.6rem; height: 1.6rem; border-radius: 50%; }

/* ---------- sign-in and messages ---------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; }
.signin-card { display: grid; gap: .7rem; width: min(21rem, 100%); padding: 1.6rem; text-align: center; }
.signin-card h1 { margin: .2rem 0 .4rem; font-size: 2rem; letter-spacing: -.025em; }
.error { color: var(--red); font-size: .92rem; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 1.25rem); transform: translateX(-50%); z-index: 50; max-width: 90vw;
  padding: .65rem 1.1rem; border-radius: 999px; color: var(--label); font-weight: 550;
  background: var(--surface); box-shadow: var(--shadow-l), inset 0 0 0 1px var(--line);
}

/* ---------- respecting people's settings ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
  .btn:active, .app-tile:active, .kinds button:active, .tabbar button:active, .night-big:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .card, .app-tile, .wish, .glass-card, .btn, .tabbar, .toast, .night-big { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(14, 26, 58, .45); --text-2: #2e3a5c; }
  @media (prefers-color-scheme: dark) { :root { --line: rgba(255, 255, 255, .5); --text-2: #d3dcf3; } }
  .card, .wish, .app-tile, .btn { box-shadow: inset 0 0 0 1.5px var(--line); }
}

/* ---------- refinements after review ---------- */
.results:empty { display: none; }
.slider-row > span:first-child { white-space: nowrap; }
.slider-row > span:nth-child(2) { text-align: right; font-size: .85rem; }

/* a nearly full disk */
.card.alert { margin-top: 1rem; box-shadow: var(--shadow-s), inset 0 0 0 1.5px color-mix(in srgb, var(--red) 55%, transparent), inset 0 1px 0 var(--surface-edge); }
.card.alert b { color: var(--red); }
/* up next in your comics */
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(8.5rem, 10rem); gap: .8rem; overflow-x: auto; padding-bottom: .4rem; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.comic { display: grid; gap: .3rem; color: var(--label); text-decoration: none; transition: transform .1s ease-out; -webkit-tap-highlight-color: transparent; }
.comic:active { transform: scale(.97); }
.ccover { aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: var(--field); display: grid; place-items: center; color: var(--label-3); font-size: 1.6rem;
  box-shadow: var(--shadow-s), inset 0 0 0 .5px var(--surface-line); }
.ccover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ctitle { font-weight: 650; font-size: .9rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.csub { font-size: .76rem; color: var(--label-2); }
.comic.absent { opacity: .62; }

/* notifications */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: .5px solid var(--surface-line); }
.toggle-row:first-of-type { border-top: 0; }
.toggle-row input[type=checkbox] { width: 1.25rem; height: 1.25rem; accent-color: var(--tint); flex: none; }
input[type=time] { width: auto; }
details summary { cursor: pointer; padding: 8px 0; }

/* the night sounds mixer */
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.mix-group { margin-top: 10px; }
.mix-head { margin: 4px 0; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--label-3); }
.mix-row { display: grid; grid-template-columns: minmax(7.5rem, 9rem) 1fr 2.4rem; gap: 10px; align-items: center; padding: 4px 0; }
.mix-row input[type=range] { padding: 0; background: none; box-shadow: none; accent-color: var(--tint); }
.mix-row .sub { text-align: right; font-variant-numeric: tabular-nums; }
.mix-row:not(.on) .mix-name { color: var(--label-2); }
.show-chips span.collection { box-shadow: inset 0 1px 0 var(--control-edge), inset 0 0 0 1px color-mix(in srgb, var(--tint) 45%, transparent); }

/* what to play: shows and sounds, sounds only, shows only */
.night-modes { display: inline-flex; margin: 14px auto 0; padding: .25rem; border-radius: 999px; background: var(--control); box-shadow: inset 0 1px 0 var(--control-edge), inset 0 0 0 .5px var(--surface-line); }
.night-modes button { border: 0; border-radius: 999px; padding: .45rem .9rem; background: none; color: var(--label-2); font-weight: 600; font-size: .88rem; cursor: pointer; white-space: nowrap; }
.night-modes button[aria-checked="true"] { background: var(--control-press); color: var(--label); box-shadow: inset 0 1px 0 var(--control-edge); }
@media (max-width: 420px) { .night-modes button { padding: .4rem .6rem; font-size: .8rem; } }

/* your recordings in the mixer */
.rec + .rec { border-top: .5px solid var(--surface-line); }
.rec-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 0 6px; }
.rec-place { width: auto; padding: .3rem .6rem; font-size: .85rem; }
.rec-credit { font-size: .78rem; }

/* the picture in the Night player */
.night-picture { margin: 14px auto 6px; max-width: 46rem; }
.np-stage { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; box-shadow: var(--shadow-l); }
.np-stage video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.np-dim { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.np-controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 10px; }
.np-controls select { width: auto; padding: .35rem .7rem; }
.np-dimmer { display: inline-flex; align-items: center; gap: 6px; }
.np-dimmer input { width: 7rem; padding: 0; background: none; box-shadow: none; accent-color: var(--tint); }
.night-picture-toggle { display: flex; gap: 10px; align-items: flex-start; text-align: left; max-width: 26rem; margin: 14px auto 0; cursor: pointer; }
.night-picture-toggle input { width: 1.2rem; height: 1.2rem; margin-top: 2px; accent-color: var(--tint); flex: none; }
.block { display: block; }
@media (prefers-reduced-motion: reduce) { .np-dim { transition: none; } }

/* =================== Night: tiles, mixes, the sleep screen =================== */
.night-now-mix { text-align: center; margin-top: 4px; }
.tile-card { padding-bottom: 14px; }
.tile-group + .tile-group { margin-top: 12px; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.6rem, 1fr)); gap: 8px; }
.tile { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 8px; align-items: center;
  min-height: 4.2rem; padding: .6rem .75rem; border-radius: 14px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: pan-y;
  background: var(--control); box-shadow: inset 0 1px 0 var(--control-edge), inset 0 0 0 .5px var(--surface-line); transition: transform .1s ease-out; }
.tile:active { transform: scale(.98); }
.tile:focus-visible { outline: 2.5px solid var(--tint); outline-offset: 2px; }
.tile-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--tint) 32%, transparent), color-mix(in srgb, var(--tint) 18%, transparent)); pointer-events: none; transition: width .12s ease-out; }
.tile-icon { position: relative; grid-row: 1 / 3; font-size: 1.45rem; opacity: .55; }
.tile-name { position: relative; font-weight: 600; font-size: .9rem; line-height: 1.2; color: var(--label-2); }
.tile-level { position: relative; font-size: .78rem; color: var(--label-2); font-variant-numeric: tabular-nums; min-height: 1em; }
.tile.on .tile-icon { opacity: 1; } .tile.on .tile-name { color: var(--label); }
.tile-extra { position: relative; grid-column: 2; justify-self: start; border: 0; border-radius: 999px; padding: .1rem .5rem; font-size: .72rem; font-weight: 600; cursor: pointer;
  color: var(--label-2); background: color-mix(in srgb, var(--label) 10%, transparent); }
.mix-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mix-chip { display: inline-flex; align-items: center; border-radius: 999px; background: var(--control); box-shadow: inset 0 1px 0 var(--control-edge), inset 0 0 0 .5px var(--surface-line); }
.mix-chip > button { border: 0; background: none; color: var(--label); font-weight: 600; font-size: .88rem; padding: .42rem .85rem; cursor: pointer; }
.mix-chip.saved { box-shadow: inset 0 1px 0 var(--control-edge), inset 0 0 0 1px color-mix(in srgb, var(--tint) 50%, transparent); }
.mix-chip .mix-del { padding: .42rem .7rem .42rem 0; color: var(--label-3); }
.save-mix { display: flex; gap: 8px; margin-top: 12px; }
.save-mix input { flex: 1; }
.night-lengths { display: flex; flex-wrap: wrap; gap: 4px; padding: .25rem; border-radius: 999px; width: fit-content; max-width: 100%; margin-bottom: 8px;
  background: var(--control); box-shadow: inset 0 1px 0 var(--control-edge), inset 0 0 0 .5px var(--surface-line); }
.night-lengths button { border: 0; border-radius: 999px; padding: .42rem .9rem; background: none; color: var(--label-2); font-weight: 600; font-size: .88rem; cursor: pointer; }
.night-lengths button[aria-checked="true"] { background: var(--control-press); color: var(--label); box-shadow: inset 0 1px 0 var(--control-edge); }
.wake-opts { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 8px 0 4px; }
.field-inline { display: inline-flex; align-items: center; gap: 8px; }
.field-inline select, .field-inline input { width: auto; }
/* the calm sleep screen: near-black, a big dim clock; controls only when you tap */
body.sleeping .fam-tabbar, body.sleeping .fam-header { display: none; }
body.sleeping .fam-shell { padding-left: 0; }
.sleep-screen { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  padding: calc(20px + var(--safe-top)) 18px calc(20px + var(--safe-bottom)); background: #020309; color: #9aa3c4; overflow-y: auto; cursor: default; }
.sleep-clock { font-size: clamp(4rem, 18vw, 9rem); font-weight: 200; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: rgba(150, 162, 205, .32); line-height: 1; }
.sleep-mix { font-size: 1rem; color: rgba(150, 162, 205, .38); }
.sleep-hint { margin-top: 2.5rem; font-size: .8rem; color: rgba(150, 162, 205, .2); transition: opacity .6s ease; }
.sleep-controls { width: min(44rem, 100%); max-height: 0; opacity: 0; overflow: hidden; transition: max-height .6s ease, opacity .5s ease; pointer-events: none; }
.sleep-screen.awake .sleep-controls { max-height: 120rem; opacity: 1; pointer-events: auto; margin-top: 1.5rem; }
.sleep-screen.awake .sleep-hint { opacity: 0; }
.sleep-buttons { display: flex; justify-content: center; gap: 10px; }
.sleep-plan { text-align: center; margin: 10px 0 14px; color: rgba(150, 162, 205, .55); }
.sleep-screen .tile { background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .06); }
.sleep-screen .tile-name, .sleep-screen .tile-level, .sleep-screen .mix-head { color: rgba(150, 162, 205, .6); }
.sleep-screen .tile.on .tile-name { color: rgba(190, 200, 235, .85); }
.sleep-screen .btn { color: #b9c3e6; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .08); }
@media (prefers-reduced-motion: reduce) { .sleep-controls, .sleep-hint, .tile-fill, .tile { transition: none; } }

.tile-name { overflow-wrap: anywhere; hyphens: auto; }

/* finding your apps */
.found { margin-bottom: 14px; }
.found-list { display: grid; gap: 2px; margin-top: 8px; }
.found-row { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; padding: 7px 4px; border-top: .5px solid var(--surface-line); cursor: pointer; }
.found-row:first-child { border-top: 0; }
.found-row input { width: 1.15rem; height: 1.15rem; accent-color: var(--tint); }
.found-row.already { opacity: .55; cursor: default; }
.found-icon { font-size: 1.3rem; }
.found-text .sub { overflow-wrap: anywhere; }

/* one search across your apps */
.search-wrap { margin: 14px 0 6px; }
.search { width: 100%; font: inherit; font-size: 1.05rem; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line, rgba(255,255,255,.14)); background: var(--card, rgba(255,255,255,.06)); color: inherit; }
.search-results { display: grid; gap: 14px; margin-top: 10px; }
.search-group h3 { margin: 4px 0 6px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.search-hit { display: flex; gap: 12px; align-items: flex-start; padding: 9px 12px; border-radius: 12px; text-decoration: none; color: inherit; }
.search-hit:hover { background: var(--card, rgba(255,255,255,.06)); }
.hit-kind { flex: none; width: 6.5rem; font-size: .78rem; opacity: .65; padding-top: 2px; }
.hit-main { display: grid; gap: 2px; min-width: 0; } .hit-title { font-weight: 600; } .hit-snippet { font-size: .9rem; opacity: .8; }
/* your week */
.week-line { padding: 5px 0; border-bottom: 1px solid var(--line, rgba(255,255,255,.08)); } .week-line:last-of-type { border-bottom: 0; }
.week-good { margin: 10px 0 4px; font-style: italic; }
.small { font-size: .85rem; }

/* Big Finish */
.bf-head { margin: 6px 0 4px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .65; }
.bf-row { display: flex; gap: 14px; align-items: flex-start; padding: 8px 4px; border-radius: 10px; text-decoration: none; color: inherit; }
.bf-row:hover { background: var(--field); }
.bf-date { flex: none; width: 5.2rem; font-size: .85rem; font-weight: 650; color: var(--tint); padding-top: 2px; }
.bf-main { display: grid; gap: 2px; min-width: 0; }

/* the app editor: an app that needs fixing before it can be saved */
.add-form.has-problem { box-shadow: 0 0 0 2px #e5484d inset; }
.add-form .problem { margin: 6px 0 0; }

/* notifications: from your apps, and the history */
.notice-head { margin: 14px 0 2px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .65; }
.notice-history { margin-top: 10px; }
.notice-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip-btn { border: 1px solid var(--line, rgba(0,0,0,.12)); background: none; color: inherit; border-radius: 999px; padding: 3px 11px; font: inherit; font-size: .82rem; cursor: pointer; }
.chip-btn.on { background: var(--tint); border-color: var(--tint); color: var(--on-tint, #fff); }
.notice-list { display: grid; gap: 2px; }
.notice { padding: 9px 2px; border-top: 1px solid var(--line, rgba(0,0,0,.08)); }
.notice-top { display: flex; justify-content: space-between; gap: 10px; }
.notice-app { font-size: .75rem; font-weight: 700; color: var(--tint); }
.notice-title { font-weight: 600; margin: 2px 0; }

/* connections */
.conn-sum { margin: 2px 0 6px; font-weight: 600; } .conn-sum.bad { color: #e5484d; }
.conn { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line, rgba(0,0,0,.08)); }
.conn-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800; }
.conn-mark.ok { background: color-mix(in srgb, #30a46c 22%, transparent); color: #30a46c; }
.conn-mark.bad { background: #e5484d; color: #fff; }

/* Now */
.now-card { display: grid; gap: 2px; }
.now-row { display: flex; align-items: center; gap: 14px; padding: 10px 2px; border-top: 1px solid var(--line, rgba(0,0,0,.08)); }
.now-row:first-child { border-top: 0; }
.now-icon { flex: none; font-size: 1.35rem; width: 32px; text-align: center; }
.now-main { flex: 1; min-width: 0; display: grid; }
.now-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-label { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .6; }

/* Siri */
.siri-preview { font-size: 1.02rem; line-height: 1.5; margin: 6px 0 12px; font-style: italic; }
.siri-steps { margin: 6px 0 8px; padding-left: 1.4em; display: grid; gap: 6px; line-height: 1.45; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.warn { color: #c2410c; }

/* this week last year */
.week-lastyear { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line, rgba(0,0,0,.08)); }
.week-lastyear p { margin: 0 0 4px; font-style: italic; }

/* comics: this week's covers */
.cover-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x mandatory; }
.cover-tile { position: relative; flex: 0 0 82px; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; scroll-snap-align: start; box-shadow: 0 4px 14px rgba(0,0,0,.18); background: var(--field); }
.cover-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-got { position: absolute; right: 4px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: #22c55e; color: #fff; display: grid; place-items: center; font-size: .65rem; font-weight: 800; }

/* Tardis Wrapped */
.year-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; } .year-card p { margin: 0; }
.year-card.december { background: linear-gradient(135deg, color-mix(in srgb, var(--tint) 30%, var(--card, transparent)), var(--card, transparent)); }
.wr-back { position: fixed; inset: 0; z-index: 200; background: #0b0b12; color: #fff; display: grid; user-select: none; -webkit-user-select: none; cursor: pointer; }
.wr-loading { place-self: center; opacity: .7; font-size: 1.1rem; }
.wr-dots { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); left: 16px; right: 64px; display: flex; gap: 4px; z-index: 2; }
.wr-dots span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.28); } .wr-dots span.on { background: #fff; }
.wr-close { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 4px); right: 10px; z-index: 3; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 1.1rem; cursor: pointer; }
.wr-stage { display: grid; place-items: center; padding: 70px 28px 40px; transition: background .4s; }
.wr-stage.tone-0 { background: radial-gradient(120% 90% at 20% 10%, color-mix(in srgb, var(--tint) 85%, #000), #0b0b12 70%); }
.wr-stage.tone-1 { background: linear-gradient(160deg, #f59e0b, #7c2d12); } .wr-stage.tone-2 { background: linear-gradient(160deg, #6366f1, #1e1b4b); }
.wr-stage.tone-3 { background: linear-gradient(160deg, #ec4899, #4a044e); } .wr-stage.tone-4 { background: linear-gradient(160deg, #ef4444, #450a0a); }
.wr-stage.tone-5 { background: linear-gradient(160deg, #0ea5e9, #082f49); } .wr-stage.tone-6 { background: linear-gradient(160deg, #a855f7, #2e1065); }
.wr-stage.tone-7 { background: linear-gradient(160deg, #10b981, #022c22); } .wr-stage.tone-8 { background: linear-gradient(160deg, #f472b6, #831843); }
.wr-stage.tone-9 { background: linear-gradient(160deg, color-mix(in srgb, var(--tint) 90%, #fff), #111827); }
.wr-card { width: min(560px, 100%); animation: wr-in .45s ease both; }
@keyframes wr-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wr-card { animation: none; } }
.wr-kicker { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .8; margin-bottom: 18px; }
.wr-title { font: 600 clamp(3rem, 12vw, 5.5rem)/1 Georgia, 'Iowan Old Style', serif; margin: 0 0 18px; }
.wr-big { margin: 6px 0 18px; } .wr-num { font: 600 clamp(3.2rem, 14vw, 6rem)/1 Georgia, 'Iowan Old Style', serif; } .wr-label { font-size: 1.2rem; opacity: .85; margin-top: 6px; }
.wr-line { font-size: 1.12rem; line-height: 1.5; margin: 0 0 10px; opacity: .95; }
.wr-list { margin: 10px 0 0; padding-left: 1.3em; display: grid; gap: 8px; font-size: 1.05rem; line-height: 1.4; }
.wr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 20px; margin: 10px 0 28px; } .wr-grid div { display: grid; }
.wr-grid strong { font: 600 clamp(2rem, 8vw, 3rem)/1.05 Georgia, serif; } .wr-grid span { opacity: .8; margin-top: 4px; }
.wr-download { border: 0; border-radius: 999px; padding: 12px 22px; background: #fff; color: #111; font: inherit; font-weight: 700; cursor: pointer; }

/* ---------- highlights, from the Kindle ---------- */
.hl-card { display: grid; gap: 4px; }
.hl { padding: 8px 0 8px 12px; border-left: 3px solid color-mix(in srgb, var(--hl, var(--tint, #7c3aed)) 70%, transparent); }
.hl + .hl { margin-top: 6px; }
.hl p { margin: 0; }
.hl-text { font-family: 'Iowan Old Style', Georgia, serif; font-size: 1.02rem; line-height: 1.5; white-space: pre-wrap; }
.hl-note { margin-top: 4px !important; font-size: .92rem; }
.hl-note::before { content: 'Your note: '; font-weight: 650; opacity: .7; }
.hl .sub.small { margin-top: 4px; }
.hl-yellow { --hl: #e0b400; } .hl-orange { --hl: #e8740c; } .hl-red { --hl: #d93a3a; } .hl-green { --hl: #3a9d4a; } .hl-olive { --hl: #8a8f2a; }
.hl-cyan { --hl: #17a2b8; } .hl-blue { --hl: #2f6fdd; } .hl-purple { --hl: #8a4fd8; } .hl-gray { --hl: #8a8a8a; }
.hl-books { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.week-kept { margin: 10px 0 4px; font-family: 'Iowan Old Style', Georgia, serif; font-style: italic; }
.wr-quote { font-family: 'Iowan Old Style', Georgia, serif; font-style: italic; font-size: 1.25rem; }

/* ---- press feedback the instant a finger lands (phones don't reliably show :active) ---- */
.app-tile.is-pressed, .bf-row.is-pressed { transform: scale(.97); }
.btn.is-pressed, .chip-btn.is-pressed, .tile-extra.is-pressed { transform: scale(.95); }
.fam-tabbar .is-pressed { opacity: .7; }
@media (prefers-reduced-motion: reduce) { .is-pressed { transform: none !important; } }
h1 { text-wrap: balance; } p { text-wrap: pretty; }

/* ================= the family look (Nov 2026) ================= */
h1.big { font-family: var(--face); font-weight: 700; letter-spacing: -.03em; margin-top: .35rem; }
h2.section { font-family: var(--face); letter-spacing: -.02em; }
h2.section .meta { font-family: var(--ui); }
.signin-card h1 { font-family: var(--face); }
/* app tiles: each app's own icon, in the family's rounded square */
.app-tile .emoji { width: 2.5rem; height: 2.5rem; border-radius: 10px; overflow: hidden; background: var(--surface-2); box-shadow: none; }
.app-tile .emoji img { width: 100%; height: 100%; display: block; object-fit: cover; }
.app-tile:hover { box-shadow: var(--shadow-s), inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
/* chips and toggles that were filled with the accent colour use the fill, so white text stays readable */
.kinds button { background: var(--surface-2); box-shadow: none; }
.kinds button[aria-pressed="true"] { color: var(--on-accent); background: var(--accent-fill); box-shadow: none; }
.chip-btn.on { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.bar i { background: var(--accent-fill); }
.search { border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.search:focus { box-shadow: inset 0 0 0 2px var(--accent); outline: none; }
.tile, .mix-chip, .night-modes, .night-lengths, .show-chips span { box-shadow: inset 0 0 0 1px var(--line); }
.night-modes button[aria-checked="true"], .night-lengths button[aria-checked="true"] { box-shadow: none; }
/* the sign-in page has no frame around it */
.signin-card { background: var(--surface); }

/* ---------- Presents ---------- */
.face { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: color-mix(in srgb, var(--tint) 16%, var(--field)); color: var(--tint); display: grid; place-items: center; font-weight: 700; overflow: hidden; }
.face img { width: 100%; height: 100%; object-fit: cover; }
details.person { border-radius: 18px; background: var(--surface, var(--field)); box-shadow: var(--shadow-s), inset 0 0 0 .5px var(--surface-line); }
details.person > summary { list-style: none; display: flex; gap: .8rem; align-items: center; padding: .65rem .8rem; cursor: pointer; }
details.person > summary::-webkit-details-marker { display: none; }
.p-main { display: grid; gap: 1px; min-width: 0; }
.p-main .t { font-weight: 650; letter-spacing: -.01em; }
.p-main .s { font-size: .84rem; color: var(--label-2); }
.p-body { padding: 0 .9rem .9rem 4.2rem; display: grid; gap: .7rem; }
@media (max-width: 560px) { .p-body { padding-left: .9rem; } }
.gifts { display: grid; gap: .35rem; }
.gift { display: flex; gap: .6rem; align-items: center; justify-content: space-between; padding: .45rem .6rem; border-radius: 12px; background: var(--field); }
.gift-main { display: grid; min-width: 0; }
.gift-main .t { font-weight: 600; overflow-wrap: anywhere; }
.gift-main .s { font-size: .78rem; color: var(--label-2); }
.gift.got .t::before { content: '✓ '; color: var(--green); }
.gift.given { opacity: .7; }
.add-idea { display: grid; gap: .45rem; }
.add-idea .row, .edit-person .row { flex-wrap: wrap; gap: .45rem; }
.add-idea input, .add-idea select, .edit-person input, .edit-person select, .edit-person textarea, .add-form input, .add-form select { min-width: 0; }
details.given > summary, details.edit-person > summary { cursor: pointer; color: var(--tint); font-size: .88rem; font-weight: 600; }
details.edit-person[open] { display: grid; gap: .5rem; }
label.check { display: flex; gap: .5rem; align-items: center; font-size: .92rem; }

.idea-row { display: grid; grid-template-columns: 6rem 1fr auto; gap: .45rem; align-items: center; }
.person-row { display: grid; grid-template-columns: 1fr 5.5rem 10rem auto; gap: .5rem; align-items: center; }
.date-row { display: grid; grid-template-columns: 5.5rem 1fr 8rem; gap: .45rem; }
.idea-row > *, .person-row > *, .date-row > * { max-width: none !important; width: 100%; min-width: 0; }
.idea-row > .btn, .person-row > .btn { width: auto; }
@media (max-width: 560px) { .person-row { grid-template-columns: 5.5rem 1fr auto; } .person-row > :first-child { grid-column: 1 / -1; } }
label.check input { width: 1.2rem !important; height: 1.2rem; min-height: 0; padding: 0; flex: none; accent-color: var(--tint); }
.date-row { grid-template-columns: 4.5rem 1fr 6rem; }

details.pool-card > summary { cursor: pointer; font-weight: 650; color: var(--tint); }
details.pool-card[open] { display: grid; gap: .6rem; }
.pool { display: grid; gap: 2px; max-height: 26rem; overflow: auto; }
.pool-row { display: flex; gap: .7rem; align-items: center; padding: .4rem .3rem; border-radius: 10px; cursor: pointer; font-weight: 550; }
.pool-row:hover { background: var(--field); }
.pool-row input { width: 1.2rem !important; height: 1.2rem; min-height: 0; padding: 0; flex: none; accent-color: var(--tint); }
.pool-row .face { width: 2.1rem; height: 2.1rem; font-size: .9rem; }

/* ---------- Wishlist ---------- */
.wl-tabs { display: flex; gap: .4rem; overflow-x: auto; padding: .6rem 0 .2rem; scrollbar-width: none; }
.wl-tabs::-webkit-scrollbar { display: none; }
.wl-tabs button { flex: none; border: 0; background: var(--field); color: var(--label); border-radius: 999px; padding: .5rem .95rem; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; gap: .4rem; align-items: center; }
.wl-tabs button[aria-selected="true"] { background: var(--tint); color: var(--on-tint, #fff); }
.wl-tabs .n { font-size: .78rem; opacity: .7; font-weight: 500; }
.wl-tabs .wl-new { background: none; color: var(--tint); box-shadow: inset 0 0 0 1px var(--surface-line); }
.wl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .4rem .8rem; }
.wl-head h2.section { margin-bottom: .4rem; }
.wl-head .row { flex-wrap: wrap; gap: .35rem; }
.wl-share { display: grid; gap: .6rem; }
.wl-share-main { display: grid; gap: 2px; min-width: 0; }
.wl-url { overflow-wrap: anywhere; font-size: .82rem; }
.wl-share .row { flex-wrap: wrap; gap: .4rem; }
.card.wl-add { margin-top: .8rem; display: grid; gap: .6rem; }
.wl-addrow { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.wl-form { display: grid; gap: .6rem; }
.wl-preview { display: grid; grid-template-columns: auto 1fr; gap: .8rem; align-items: start; }
.wl-preview img { width: 6rem; height: 6rem; object-fit: contain; background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 .5px var(--surface-line); }
.wl-preview:not(:has(img)) { grid-template-columns: 1fr; }
.wl-fields { display: grid; gap: .45rem; min-width: 0; }
.wl-two { display: grid; grid-template-columns: 7rem 1fr; gap: .5rem; align-items: center; }
.wl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); gap: .8rem; margin-top: 1rem; }
.wl-item { display: grid; grid-template-rows: auto 1fr; border-radius: 18px; overflow: hidden; background: var(--card); box-shadow: var(--shadow-s), inset 0 0 0 .5px var(--surface-line); }
.wl-img { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #fff; font-size: 2.2rem; }
.wl-img img { width: 100%; height: 100%; object-fit: contain; padding: .6rem; }
.wl-body { padding: .7rem .85rem .8rem; display: grid; gap: .2rem; align-content: start; }
.wl-title { font-weight: 650; letter-spacing: -.01em; line-height: 1.3; }
.wl-title a { color: inherit; text-decoration: none; }
.wl-title a:hover { text-decoration: underline; }
.wl-love { color: #e0457b; }
.wl-bought { font-size: .82rem; font-weight: 650; color: var(--green); }
.wl-actions { flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.wl-move { width: auto !important; min-height: 0; padding: .3rem .5rem; font-size: .82rem; border-radius: 999px; }
.wl-item.bought { opacity: .72; }
@media (max-width: 560px) { .wl-grid { grid-template-columns: 1fr 1fr; gap: .6rem; } .wl-body { padding: .55rem .6rem .65rem; } .wl-actions .btn { padding: 0 .55rem; } }

.wl-price-notes { display: flex; flex-wrap: wrap; gap: .25rem .5rem; font-size: .78rem; font-weight: 650; }
.wl-change.down { color: var(--green); }
.wl-change.up { color: #c27a00; }
.wl-low { color: var(--label-2); font-weight: 500; }
.wl-out { color: var(--red); }
.wl-checked { font-size: .72rem; color: var(--label-3, var(--label-2)); }
details.wl-safari { margin-top: 1.6rem; }
details.wl-safari > summary { cursor: pointer; font-weight: 650; color: var(--tint); }
details.wl-safari[open] > div { display: grid; gap: .7rem; margin-top: .7rem; }
details.wl-safari .row { gap: .5rem; align-items: center; flex-wrap: wrap; }
details.wl-safari select { width: auto; }
.wl-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .45rem; font-size: .92rem; }
.wl-steps code, code.wl-key { overflow-wrap: anywhere; font-size: .82rem; background: var(--field); padding: 1px 6px; border-radius: 6px; }
code.wl-key { display: block; padding: .5rem .7rem; font-size: .9rem; }
.wl-grid > .wl-item, .wl-body { min-width: 0; }
.wl-title, .wl-price-notes { overflow-wrap: anywhere; }
.wl-item, .wl-body { grid-template-columns: minmax(0, 1fr); }

.card.wl-incoming { margin: .8rem 0 .4rem; display: grid; gap: .7rem; box-shadow: var(--shadow-s), inset 0 0 0 1.5px color-mix(in srgb, var(--tint) 55%, transparent); }
.wl-incoming .row { gap: .5rem; align-items: center; flex-wrap: wrap; }
.wl-incoming select { width: auto; }
.wl-sub { font-size: 1rem; margin: .6rem 0 0; }
.wl-bookmarklet { cursor: grab; }
