/* =========================================================
   CARREL
   Two skins live here:
     Reading Room — warm paper, brass, serif. Has light + dark.
     Night Shift  — near-black, violet, technical. Dark only.
   Everything else reads from the same tokens, so the whole
   interface reskins from these blocks alone.
   ========================================================= */

/* ---------- Reading Room · light (default) ---------- */
:root {
  --bg: #F3EFE6;
  --surface: #FAF7EF;
  --surface-hover: #F1ECDF;
  --ink: #1E2A32;
  --ink-soft: #5B6A72;
  --ink-faint: #8A968E;
  --rule: #DCD3C2;
  --brass: #A9762F;
  --brass-strong: #7C5620;
  --brass-tint: color-mix(in srgb, var(--brass) 14%, var(--surface));
  --live: #B0432D;
  --shadow: 0 1px 2px rgba(30, 42, 50, 0.06), 0 8px 24px rgba(30, 42, 50, 0.08);
  --bean-eye: #FDFBF6;

  /* the sign-in scene */
  --sc-wood: #C6AE8C;
  --sc-wood-dark: #A8906E;
  --sc-ink: #4A3A2C;
  --sc-paper: #FBF8F1;
  --sc-glow: #F2C464;

  --page-bg: var(--bg);

  --serif: "Fraunces", Georgia, "Iowan Old Style", serif;
  --sans: "Libre Franklin", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;

  --radius: 10px;
  --radius-pill: 18px;

  /* TYPE FLOOR — measured, not guessed.
     A pass over every text style in the app found eight below 11px
     and eight more under 13px, including the session-length and
     ambience buttons at 10px. People sit in front of this for two
     hours at a stretch; nothing here is worth squinting at.

       --fs-label    mono uppercase labels  (was 0.58-0.65rem)
       --fs-meta     secondary text         (was 0.72-0.80rem)
       --fs-control  anything clickable     (was 0.63-0.85rem)
       --fs-body     read-a-sentence text   (was 0.84-0.92rem)  */
  --fs-label: 0.72rem;      /* 11.5px */
  --fs-meta: 0.85rem;       /* 13.6px */
  --fs-control: 0.88rem;    /* 14.1px */
  --fs-body: 0.95rem;       /* 15.2px */
}

/* ---------- Reading Room · dark ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-skin="night-shift"]) {
    --bg: #14181B;
    --surface: #1B2023;
    --surface-hover: #22282B;
    --ink: #ECE6D8;
    --ink-soft: #A9AFA8;
    --ink-faint: #6F7773;
    --rule: #2B3134;
    --brass: #D9A25C;
    --brass-strong: #F0B876;
    --live: #E2694C;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
    --sc-wood: #4A3E33;
    --sc-wood-dark: #372E26;
    --sc-ink: #23282B;
    --sc-paper: #E6DFD0;
    --sc-glow: #F0C36A;
  }
}

:root[data-theme="dark"]:not([data-skin="night-shift"]) {
  --bg: #14181B;
  --surface: #1B2023;
  --surface-hover: #22282B;
  --ink: #ECE6D8;
  --ink-soft: #A9AFA8;
  --ink-faint: #6F7773;
  --rule: #2B3134;
  --brass: #D9A25C;
  --brass-strong: #F0B876;
  --live: #E2694C;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
  --sc-wood: #4A3E33;
  --sc-wood-dark: #372E26;
  --sc-ink: #23282B;
  --sc-paper: #E6DFD0;
  --sc-glow: #F0C36A;
}

/* ---------- Night Shift · always dark, wins over everything ---------- */
:root[data-skin="night-shift"] {
  --bg: #04050C;
  --surface: #0D1020;
  --surface-hover: #141830;
  --ink: #F3F5FF;
  --ink-soft: #A5ABC8;
  --ink-faint: #646B8C;
  --rule: #232A52;
  --brass: #7B61FF;
  --brass-strong: #A78BFA;
  --brass-tint: color-mix(in srgb, var(--brass) 18%, var(--surface));
  --live: #FF4D6D;
  --shadow: 0 1px 2px rgba(0,0,0,0.5), 0 14px 38px -12px rgba(0,0,0,0.85);
  --bean-eye: #F3F5FF;

  --sc-wood: #1C2140;
  --sc-wood-dark: #141833;
  --sc-ink: #090B16;
  --sc-paper: #DDE2F5;
  --sc-glow: #7DE2FF;

  --serif: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --sans: "Manrope", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --radius: 6px;
  --radius-pill: 6px;

  --page-bg:
    radial-gradient(1100px 560px at 10% -12%, rgba(123,97,255,0.20), transparent 60%),
    radial-gradient(900px 520px at 104% -2%, rgba(125,226,255,0.10), transparent 56%),
    #04050C;
}

/* ---------- Sunset Sea · the other one ---------------------------

   Deep ocean at dusk, and the sun going down on it. Same idea
   from the other end: dark, warm, gold on navy.

   For the same reason as Night Shift — some people study late and
   a cream page at 1am is a torch in the face.
   ---------------------------------------------------------------- */
:root[data-skin="sunset-sea"] {
  --bg: #0A1E30;
  --surface: #10293E;
  --surface-hover: #16344C;
  --ink: #F5E9D2;
  --ink-soft: #A6BACB;
  --ink-faint: #6C8298;
  --rule: #1C3C57;

  --brass: #E9A13B;
  --brass-strong: #FFC46B;
  --brass-tint: color-mix(in srgb, var(--brass) 16%, var(--surface));

  --live: #E2553C;

  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 16px 40px -14px rgba(0,0,0,0.7);
  --bean-eye: #0A1E30;

  --sc-wood: #1D4059;
  --sc-wood-dark: #143046;
  --sc-ink: #06121D;
  --sc-paper: #F5E9D2;
  --sc-glow: #E9A13B;

  --serif: "Fraunces", Georgia, "Iowan Old Style", serif;
  --sans: "Libre Franklin", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;

  --radius: 8px;
  --radius-pill: 16px;

  /* sun low on the water, off to one side */
  --page-bg:
    radial-gradient(1000px 520px at 88% -8%, rgba(233,161,59,0.16), transparent 62%),
    radial-gradient(900px 500px at 4% 10%, rgba(226,85,60,0.07), transparent 58%),
    #0A1E30;
}

/* Gold fill needs dark text on it, same problem Green Room had. */
:root[data-skin="sunset-sea"] .btn.primary,
:root[data-skin="sunset-sea"] .music-btn.active,
:root[data-skin="sunset-sea"] .card-tick,
:root[data-skin="sunset-sea"] .plan-item.done .plan-check {
  color: #0A1E30;
}
:root[data-skin="sunset-sea"] .plan-item.done .plan-check .icon { stroke: #0A1E30; }
:root[data-skin="sunset-sea"] .card.picked .card-tick .icon { stroke: #0A1E30; }

/* Night Shift wants tighter, more technical headings. */
:root[data-skin="night-shift"] .brand-word,
:root[data-skin="night-shift"] .section-head h2,
:root[data-skin="night-shift"] .auth-word {
  font-variation-settings: "wdth" 92, "wght" 700;
  letter-spacing: 0.01em;
}
:root[data-skin="night-shift"] .brand-word { text-transform: uppercase; font-size: 1.15rem; letter-spacing: 0.14em; }
:root[data-skin="night-shift"] .streak-num { font-variation-settings: "wdth" 88, "wght" 700; }

/* =========================================================
   Base
   ========================================================= */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

button, input { font-family: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.icon {
  width: 1.15em;
  height: 1.15em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* =========================================================
   Sign in
   ========================================================= */

.auth {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--page-bg);
  background-attachment: fixed;
  overflow-y: auto;
}

.auth-card {
  width: min(430px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  padding: 2rem 1.9rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
:root[data-skin="night-shift"] .auth-card { border-radius: 10px; }

.auth-scene {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 0.6rem;
}
.auth-scene svg { width: 100%; height: auto; display: block; }

.auth-brand { text-align: center; display: flex; flex-direction: column; gap: 0.25rem; }

.auth-word {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: -0.015em;
}

.auth-tag {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
:root[data-skin="night-shift"] .auth-tag { font-family: var(--sans); font-style: normal; }

.auth-options,
.auth-email { width: 100%; display: flex; flex-direction: column; gap: 0.55rem; }
.auth-email { display: none; }
.auth.email-step .auth-options { display: none; }
.auth.email-step .auth-email { display: flex; }

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.auth-btn:hover { background: var(--surface-hover); border-color: var(--brass); }
.auth-btn .icon { width: 1.15rem; height: 1.15rem; color: var(--ink-soft); }
.auth-btn .g-logo { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }

.auth-btn.primary {
  background: var(--brass);
  border-color: var(--brass);
  color: #FFFDF8;
}
:root[data-skin="night-shift"] .auth-btn.primary { color: #fff; }
.auth-btn.primary:hover { background: var(--brass-strong); border-color: var(--brass-strong); }

.auth-btn.ghost { background: transparent; color: var(--ink-soft); font-weight: 500; }
.auth-btn.ghost:hover { color: var(--ink); }

.auth-label {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.auth-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 0.92rem;
  outline: none;
}
.auth-input:focus { border-color: var(--brass); }
.auth-input::placeholder { color: var(--ink-faint); }

.auth-error {
  margin: 0;
  min-height: 1.1em;
  font-size: 0.78rem;
  color: var(--live);
}

.auth-back {
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.3rem;
}
.auth-back:hover { color: var(--ink); }

.auth-foot {
  margin: 0.2rem 0 0;
  font-size: var(--fs-meta);
  color: var(--ink-faint);
  text-align: center;
}

/* =========================================================
   Top nav
   ========================================================= */

.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 72px;
  padding: 0 1.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--ink);
  text-align: left;
}

.brand-text { display: flex; flex-direction: column; gap: 0.16rem; }

.brand-word {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: -0.015em;
}

.brand-tag {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1.1;
  color: var(--ink-soft);
}
:root[data-skin="night-shift"] .brand-tag {
  font-family: var(--mono); font-style: normal;
  font-size: 0.74rem; letter-spacing: 0.08em;
}

.brand-bean {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  color: var(--brass);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.brand:hover .brand-bean { transform: translateY(-2px) rotate(-4deg); }
@media (prefers-reduced-motion: reduce) { .brand:hover .brand-bean { transform: none; } }

.search-wrap {
  flex: 1;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 22px;
  padding: 0.5rem 1rem;
  background: var(--surface);
}
:root[data-skin="night-shift"] .search-wrap { border-radius: var(--radius); }
.search-wrap:focus-within { border-color: var(--brass); }

.search-wrap input {
  border: none; outline: none; background: transparent;
  width: 100%; font-size: 0.92rem; color: var(--ink);
}
.search-wrap input::placeholder { color: var(--ink-faint); }
.search-wrap .icon { color: var(--ink-faint); }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--ink-soft);
}
/* The three controls in the top bar carry more weight than an icon
   button buried in a panel, so their glyphs are drawn larger. */
.topnav .icon-btn .icon { width: 1.45rem; height: 1.45rem; }
.icon-btn:hover { background: var(--surface-hover); color: var(--ink); }

.icon-btn:focus-visible, .btn:focus-visible, .chip:focus-visible,
.side-link:focus-visible, .card:focus-visible, .auth-btn:focus-visible,
.len-btn:focus-visible, .skin-card:focus-visible, .ambient-btn:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.95rem;
  font-size: var(--fs-control);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); }

.btn.primary { background: var(--brass); border-color: var(--brass); color: #FFFDF8; }
.btn.primary:hover { background: var(--brass-strong); border-color: var(--brass-strong); }
:root[data-skin="night-shift"] .btn.primary {
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

.avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brass) 30%, var(--surface));
  border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--brass-strong);
  cursor: pointer;
}
.avatar.sm { width: 42px; height: 42px; font-size: 1rem; cursor: default; }

/* =========================================================
   Shell
   ========================================================= */

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: calc(100vh - 62px); }

.sidebar {
  border-right: 1px solid var(--rule);
  padding: 1.1rem 0.9rem 1.5rem;
  display: flex; flex-direction: column; gap: 1.4rem;
  position: sticky; top: 62px; align-self: start;
  height: calc(100vh - 62px);
  overflow-y: auto;
}

.side-group { display: flex; flex-direction: column; gap: 0.15rem; }

.side-link {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: none; background: transparent;
  color: var(--ink);
  font-size: var(--fs-body); font-weight: 500;
  text-align: left; cursor: pointer; width: 100%;
}
.side-link:hover { background: var(--surface-hover); }
.side-link.active { background: var(--brass-tint); color: var(--brass-strong); font-weight: 600; }
.side-link .icon { color: var(--ink-soft); }
.side-link.active .icon { color: var(--brass-strong); }

.side-rule { height: 1px; background: var(--rule); margin: 0 0.2rem; }

.streak-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.9rem 0.95rem 1rem;
  background: var(--surface);
  display: flex; flex-direction: column; gap: 0.6rem;
}
.streak-top { display: flex; align-items: baseline; gap: 0.5rem; }
.streak-num { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; color: var(--brass-strong); line-height: 1; }
.streak-label { font-family: var(--mono); font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }

.streak-say {
  font-family: var(--serif); font-style: italic;
  font-size: var(--fs-meta); line-height: 1.4;
  color: var(--ink-soft); margin: -0.15rem 0 0.1rem;
}
:root[data-skin="night-shift"] .streak-say { font-family: var(--sans); font-style: normal; font-size: 0.72rem; }

.streak-foot {
  display: flex; justify-content: space-between; gap: 0.5rem;
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: 0.06em; color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.heatmap { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; }
.heatmap .cell { aspect-ratio: 1; border-radius: 2px; background: var(--rule); }
/* today gets a ring, so "did I do it yet" is answerable at a glance */
.heatmap .cell.today { box-shadow: 0 0 0 1.5px var(--brass); }
.heatmap .cell[data-lvl="1"] { background: color-mix(in srgb, var(--brass) 30%, var(--surface)); }
.heatmap .cell[data-lvl="2"] { background: color-mix(in srgb, var(--brass) 55%, var(--surface)); }
.heatmap .cell[data-lvl="3"] { background: color-mix(in srgb, var(--brass) 80%, var(--surface)); }
.heatmap .cell[data-lvl="4"] { background: var(--brass-strong); }

/* =========================================================
   Feed
   ========================================================= */

.feed { padding: 1.2rem 1.5rem 4rem; min-width: 0; }

/* The focus timer is fixed to the bottom-right corner, so on a
   short window it rides up over whatever is in the feed. Reserve
   its column rather than letting content slide underneath — this
   is why the right-hand gutter looks wide and empty on a tall
   screen. It isn't empty; the widget lives there. */
@media (min-width: 700px)  { .feed { padding-right: calc(232px + 2.75rem); } }
@media (min-width: 901px)  { .feed { padding-right: calc(272px + 2.75rem); } }

.chip-row { display: flex; gap: 0.6rem; overflow-x: auto; padding-bottom: 1.1rem; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  padding: 0.42rem 0.95rem;
  border-radius: 16px;
  font-size: var(--fs-control); font-weight: 600;
  cursor: pointer;
}
:root[data-skin="night-shift"] .chip { border-radius: 99px; color: var(--ink-soft); }
.chip:hover { background: var(--surface-hover); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.6rem 0 0.9rem; }
.section-right { display: flex; align-items: baseline; gap: 0.8rem; }

.clear-btn {
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-faint);
  font-size: var(--fs-control); font-weight: 600;
  padding: 0.25rem 0.7rem;
  cursor: pointer; white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.clear-btn:hover { color: var(--ink); border-color: var(--ink-soft); }
/* armed: says exactly what it will do, in the colour that means it */
.clear-btn.armed {
  color: var(--live);
  border-color: var(--live);
  background: color-mix(in srgb, var(--live) 12%, transparent);
}
.section-head h2 { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin: 0; }
:root[data-skin="night-shift"] .section-head h2 { font-size: 1.1rem; text-transform: uppercase; }
.section-head .sub { font-size: var(--fs-meta); color: var(--ink-soft); }
:root[data-skin="night-shift"] .section-head .sub { font-family: var(--mono); font-size: 0.72rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.4rem 1.1rem; }

.card {
  display: flex; flex-direction: column; gap: 0.55rem;
  text-align: left; background: none; border: none; padding: 0;
  cursor: pointer; border-radius: var(--radius);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 14px),
    linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.card:hover .thumb { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .card:hover .thumb { transform: none; } }

.badge {
  position: absolute;
  font-family: var(--mono);
  font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.4rem;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.badge.duration { bottom: 0.45rem; right: 0.45rem; background: rgba(10,12,14,0.72); color: #F3EFE6; }
.badge.live {
  top: 0.5rem; left: 0.5rem;
  background: var(--live); color: #FFF5F1;
  display: flex; align-items: center; gap: 0.35rem;
  text-transform: uppercase;
}
.badge.live .dot { width: 6px; height: 6px; border-radius: 50%; background: #FFF5F1; animation: pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .badge.live .dot { animation: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.card-meta { display: flex; flex-direction: column; gap: 0.15rem; padding: 0 0.1rem; }
.card-title { font-size: var(--fs-body); font-weight: 600; line-height: 1.3; }
.card-sub { font-size: var(--fs-meta); color: var(--ink-soft); }
.card-stat { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.tag {
  display: inline-flex; align-self: flex-start;
  font-family: var(--mono);
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  padding: 0.15rem 0.45rem; border-radius: 4px;
  background: color-mix(in srgb, var(--tagc) 20%, var(--surface));
  color: color-mix(in srgb, var(--tagc) 75%, var(--ink));
}

.end-note {
  margin-top: 3rem; padding-top: 2.25rem;
  border-top: 1px solid var(--rule);
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}

/* Bean's asleep pose only fills the top ~83% of its box — the Z's
   are up high and there's empty space under the mug. Without this
   pull-up the text sits a good 10px further away than the gap
   says it should. */
.end-bean {
  width: 56px; height: 56px;
  color: var(--brass); opacity: 0.85;
  margin-bottom: -0.5rem;
}

.end-note p {
  margin: 0; text-align: center;
  font-family: var(--serif); font-style: italic;
  color: var(--ink-soft); font-size: 1.05rem;
  /* Narrow enough that BOTH skins break into the same two balanced
     lines. Left wider, the serif fits on one line and the sans
     doesn't, and the two themes disagree about the shape. */
  max-width: 30ch; text-wrap: balance; line-height: 1.5;
}
:root[data-skin="night-shift"] .end-note p { font-family: var(--sans); font-style: normal; font-size: 0.95rem; }

.no-results {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
  color: var(--ink-soft); font-size: var(--fs-body);
  padding: 3rem 0.2rem; text-align: center;
}
.no-results .empty-bean { width: 58px; height: 58px; color: var(--brass); opacity: 0.7; }

/* =========================================================
   Focus timer
   ========================================================= */

.focus-widget {
  position: fixed;
  right: 1.25rem; bottom: 1.25rem;
  width: 272px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem 1rem;
  z-index: 50;
  display: flex; flex-direction: column; gap: 0.65rem;
}
:root[data-skin="night-shift"] .focus-widget { border-radius: var(--radius); }

.focus-head { display: flex; align-items: center; justify-content: space-between; }
.focus-title {
  font-family: var(--mono); font-size: var(--fs-label); font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft);
}
.focus-collapse {
  border: none; background: none; color: var(--ink-soft);
  cursor: pointer; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}

.focus-bean-wrap { display: flex; justify-content: center; padding: 0.15rem 0 0.1rem; }
.focus-bean { width: 54px; height: 54px; color: var(--brass); transition: color 0.3s ease; }

.focus-widget.running .focus-bean {
  color: var(--brass-strong);
  animation: bean-breathe 3.4s ease-in-out infinite;
}
@keyframes bean-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-3px) scale(1.04); }
}
@media (prefers-reduced-motion: reduce) { .focus-widget.running .focus-bean { animation: none; } }

.focus-time {
  font-family: var(--mono); font-weight: 600; font-size: 2.1rem;
  text-align: center; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink); line-height: 1.1;
}
.focus-state {
  font-family: var(--serif); font-style: italic; font-size: var(--fs-meta);
  text-align: center; color: var(--ink-faint); margin-top: -0.35rem;
}
:root[data-skin="night-shift"] .focus-state {
  font-family: var(--mono); font-style: normal;
  font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.focus-widget.running .focus-state { color: var(--brass-strong); }

/* session length */
.len-row { display: flex; gap: 0.28rem; }
.len-btn {
  flex: 1;
  border: 1px solid var(--rule);
  background: var(--bg);
  border-radius: 7px;
  padding: 0.32rem 0;
  font-family: var(--mono);
  font-size: var(--fs-control);
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.len-btn:hover { color: var(--ink); border-color: var(--brass); }
.len-btn.active {
  background: var(--brass-tint);
  border-color: var(--brass);
  color: var(--brass-strong);
}
.len-row.wide .len-btn { padding: 0.5rem 0; font-size: 0.75rem; }

.focus-controls { display: flex; gap: 0.5rem; }
.focus-controls .btn { flex: 1; justify-content: center; padding: 0.42rem 0; font-size: var(--fs-control); }

.ambient-label {
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.15rem;
}

.ambient-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.35rem; }
.ambient-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
  border: 1px solid var(--rule);
  background: var(--bg);
  border-radius: 8px;
  padding: 0.38rem 0.2rem;
  font-size: var(--fs-control); font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer; text-align: center;
}
:root[data-skin="night-shift"] .ambient-btn { border-radius: 5px; }
.ambient-btn:hover { color: var(--ink); }
.ambient-btn.active { background: var(--brass-tint); border-color: var(--brass); color: var(--brass-strong); }
.ambient-btn.loading { opacity: 0.6; cursor: progress; }
.lofi-ico { width: 0.85em; height: 0.85em; }

.volume-row { display: flex; align-items: center; gap: 0.5rem; }
.volume-row input[type="range"] { flex: 1; accent-color: var(--brass); }
.volume-row .icon { color: var(--ink-soft); width: 1em; height: 1em; }

.focus-widget.collapsed .focus-bean-wrap,
.focus-widget.collapsed .focus-time,
.focus-widget.collapsed .focus-state,
.focus-widget.collapsed .len-row,
.focus-widget.collapsed .focus-controls,
.focus-widget.collapsed .ambient-label,
.focus-widget.collapsed .ambient-row,
.focus-widget.collapsed .volume-row { display: none; }

/* =========================================================
   Overlays — theater + settings
   ========================================================= */

.overlay {
  position: fixed; inset: 0;
  background: rgba(10, 12, 14, 0.6);
  backdrop-filter: blur(3px);
  z-index: 60;
  display: none;
  align-items: center; justify-content: center;
  padding: 2rem;
}
.overlay.open { display: flex; }

/* One column, nothing beside the video. There used to be a
   "Studying along" list here; it was the last thing on screen
   competing with the session, so it's gone. */
.theater {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  width: min(1120px, 100%);
  max-height: 92vh;
  overflow: hidden;
  box-shadow: var(--shadow);
  /* A column that shares out the height, so the video gives way
     rather than shoving the time-left bar off the bottom. */
  display: flex;
  flex-direction: column;
}
.player-col { flex: 1 1 auto; min-height: 0; }

.player-col { display: flex; flex-direction: column; }
.player-surface {
  aspect-ratio: 16/9;
  /* Can shrink below its natural height on a short window; the
     video letterboxes rather than the controls disappearing. */
  min-height: 0;
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 14px),
    linear-gradient(160deg, var(--c1), var(--c2));
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.play-toggle {
  width: 62px; height: 62px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.9); color: #1E2A32;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.play-toggle .icon { width: 1.6em; height: 1.6em; stroke-width: 0; fill: currentColor; }

.player-caption {
  position: absolute; bottom: 0.7rem; left: 0.9rem; right: 0.9rem;
  font-family: var(--mono); font-size: 0.7rem; color: rgba(255,255,255,0.85);
}
.progress-track { height: 4px; background: rgba(255,255,255,0.35); border-radius: 2px; margin-top: 0.4rem; overflow: hidden; }
.progress-fill { height: 100%; width: 34%; background: #F3EFE6; }

.player-info { padding: 1rem 1.25rem 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; }
.player-info h3 { font-family: var(--serif); font-size: 1.25rem; margin: 0; }
.player-info .card-sub { font-size: 0.85rem; }

.no-autoplay-note {
  margin-top: 0.4rem; padding: 0.75rem 0.9rem;
  background: var(--brass-tint);
  border: 1px solid color-mix(in srgb, var(--brass) 40%, var(--rule));
  border-radius: 8px;
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--brass-strong) 85%, var(--ink));
  line-height: 1.5;
}

/* The theater's own strip, sitting above the video. Nothing here
   ever overlaps the player — that was breaking YouTube's rules and
   colliding with their settings button at the same time. */
.theater-bar {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.7rem 0.6rem 0.9rem;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.theater-spacer { flex: 1; }

.exit-session {
  padding: 0.35rem 0.85rem;
  font-size: var(--fs-control);
  color: var(--ink-soft);
}
.exit-session:hover { color: var(--live); border-color: var(--live); }
.exit-session .icon { width: 0.85em; height: 0.85em; }

.close-btn {
  flex: none;
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: transparent; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.close-btn:hover { background: var(--surface-hover); color: var(--ink); }

/* ---------- Settings ---------- */

.settings-panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  width: min(560px, 100%);
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
}
:root[data-skin="night-shift"] .settings-panel { border-radius: var(--radius); }

.settings-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1rem 1rem 1.4rem;
  border-bottom: 1px solid var(--rule);
}
.settings-head h3 { margin: 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
:root[data-skin="night-shift"] .settings-head h3 { text-transform: uppercase; font-size: 1rem; letter-spacing: 0.06em; }

.settings-body { padding: 1.3rem 1.4rem 1.6rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1.8rem; }

.set-section h4 {
  margin: 0 0 0.3rem;
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--brass);
}
.set-hint { margin: 0 0 0.9rem; font-size: var(--fs-body); color: var(--ink-soft); }
.set-note { margin: 0.75rem 0 0; font-size: var(--fs-meta); color: var(--ink-faint); min-height: 1em; }

/* ---------- Picking sessions to delete ---------- */

.select-btn {
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-faint);
  font-size: var(--fs-control); font-weight: 600;
  padding: 0.25rem 0.7rem;
  cursor: pointer; white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.select-btn:hover { color: var(--ink); border-color: var(--ink-soft); }
.select-btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.sel-count {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--ink-faint);
  white-space: nowrap;
}

/* Delete carries the same warning colour as the armed Clear, so
   the destructive button always looks the same. */
#sel-delete:not(:disabled) { color: var(--live); border-color: var(--live); }
#sel-delete:disabled { opacity: 0.45; cursor: not-allowed; }

/* While picking, a card is a checkbox. The cursor says so, and
   the whole grid dims slightly so it reads as a different mode. */
.grid.picking .card { cursor: pointer; }
.card.pickable .card-save,
.card.pickable .card-remove { display: none !important; }

.card-tick {
  position: absolute; top: 0.6rem; left: 0.6rem;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,12,14,0.55);
  border: 1.5px solid rgba(255,255,255,0.75);
  z-index: 2;
}
.card-tick .icon { width: 14px; height: 14px; stroke: transparent; stroke-width: 3.2; fill: none; }
.card.picked .card-tick { background: var(--brass); border-color: var(--brass); }
.card.picked .card-tick .icon { stroke: #fff; }

.card.pickable .thumb { transition: opacity 0.15s; }
.card.pickable:not(.picked) .thumb { opacity: 0.6; }
.card.picked { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 12px; }

/* ---------- Planner ---------- */

.planner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}
.plan-col { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }

.plan-block {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
}
.plan-block-grow { display: flex; flex-direction: column; }

.plan-h {
  margin: 0 0 0.2rem;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--brass-strong);
}
.plan-hint { margin: 0 0 0.75rem; font-size: var(--fs-meta); color: var(--ink-faint); }

.plan-list { list-style: none; margin: 0 0 0.6rem; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }

.plan-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.35rem;
  border-radius: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent);
}
.plan-item:last-child { border-bottom: none; }
.plan-item:hover { background: color-mix(in srgb, var(--brass) 6%, transparent); }

.plan-check {
  flex: none; width: 20px; height: 20px;
  border-radius: 5px;
  border: 1.5px solid color-mix(in srgb, var(--ink) 32%, transparent);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: background 0.15s, border-color 0.15s;
}
.plan-check .icon { width: 13px; height: 13px; stroke: transparent; stroke-width: 3.2; fill: none; }
.plan-check:hover { border-color: var(--brass); }
.plan-check:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.plan-item.done .plan-check { background: var(--brass); border-color: var(--brass); }
.plan-item.done .plan-check .icon { stroke: #fff; }

.plan-text { flex: 1; min-width: 0; font-size: var(--fs-body); line-height: 1.45; overflow-wrap: anywhere; }
.plan-item.done .plan-text { text-decoration: line-through; color: var(--ink-faint); }

.plan-del {
  flex: none; width: 26px; height: 26px;
  border: none; background: transparent; color: var(--ink-faint);
  border-radius: 6px; cursor: pointer; opacity: 0;
  display: flex; align-items: center; justify-content: center;
}
.plan-del .icon { width: 13px; height: 13px; stroke: currentColor; }
.plan-item:hover .plan-del, .plan-del:focus-visible { opacity: 1; }
.plan-del:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }

.plan-add { display: flex; gap: 0.45rem; }
.plan-add input {
  flex: 1; min-width: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 9px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  font: inherit; font-size: var(--fs-control);
}
.plan-add input:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; border-color: var(--brass); }
.plan-add input:disabled { opacity: 0.45; cursor: not-allowed; }

.plan-add-btn {
  flex: none; width: 36px; border-radius: 9px;
  border: 1px solid var(--rule); background: transparent; color: var(--ink);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.plan-add-btn .icon { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2.2; }
.plan-add-btn:hover { border-color: var(--brass); color: var(--brass-strong); }

.plan-full { margin: 0.5rem 0 0; font-size: var(--fs-meta); color: var(--ink-faint); }

.plan-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 0.5rem; }
.plan-count { font-family: var(--mono); font-size: var(--fs-meta); color: var(--ink-faint); }
.plan-clear {
  border: none; background: transparent; color: var(--brass-strong);
  font: inherit; font-size: var(--fs-meta); cursor: pointer; padding: 0.2rem 0.3rem; border-radius: 6px;
}
.plan-clear:hover { text-decoration: underline; }

.water { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.water-cup {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--rule); background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.water-cup .icon { width: 16px; height: 16px; fill: none; stroke: var(--ink-faint); stroke-width: 1.6; }
.water-cup:hover { border-color: var(--brass); }
.water-cup:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.water-cup.full { background: color-mix(in srgb, var(--brass) 16%, transparent); border-color: var(--brass); }
.water-cup.full .icon { fill: var(--brass); stroke: var(--brass); }

.plan-notes {
  width: 100%; min-height: 190px; flex: 1;
  resize: vertical;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  font: inherit; font-size: var(--fs-body); line-height: 1.6;
}
.plan-notes:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; border-color: var(--brass); }
.plan-saved { margin: 0.4rem 0 0; min-height: 1em; font-family: var(--mono); font-size: var(--fs-label); color: var(--ink-faint); }

@media (max-width: 900px) {
  .planner { grid-template-columns: 1fr; }
}

/* ---------- Session music, inside the theater ---------- */

/* Wraps onto its own line under the scrubber. Never over the
   video — same rule the YouTube bar follows, kept here so the
   two players behave identically. */
.music-row {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--rule);
}

.music-label {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-right: 0.15rem;
}

.music-btn {
  padding: 0.34rem 0.8rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--fs-control);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.music-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.music-btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.music-btn.active {
  background: var(--brass);
  border-color: var(--brass);
  color: #fff;
}
.music-btn.loading { opacity: 0.55; cursor: progress; }

@media (max-width: 560px) {
  .music-label { display: none; }
  .music-btn { flex: 1; text-align: center; padding-inline: 0.4rem; }
}

/* ---------- Study with me: Carrel's own sessions ---------- */

/* There is more than one of these now, so the spacing lives on the
   list rather than trailing off the last card. */
.house-list { display: flex; flex-direction: column; gap: 1.1rem; margin: 0 0 1.5rem; }
.house-list .house-card { margin: 0; }

.house-card {
  display: grid;
  grid-template-columns: minmax(0, 300px) 1fr;
  gap: 0;
  width: 100%;
  margin: 0 0 1.5rem;
  padding: 0;
  text-align: left;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brass) 32%, var(--rule));
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.house-card:hover {
  border-color: var(--brass);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.house-card:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

.house-art { position: relative; display: block; aspect-ratio: 16/9; background: #10131a; }
.house-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.house-badge {
  position: absolute; top: 0.6rem; left: 0.6rem;
  padding: 0.2rem 0.5rem; border-radius: 999px;
  background: rgba(10,12,14,0.72); color: #F3EFE6;
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: 0.09em; text-transform: uppercase;
}

.house-body { display: flex; flex-direction: column; gap: 0.4rem; padding: 1.2rem 1.4rem; }

.house-kicker {
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: 0.11em; text-transform: uppercase; color: var(--brass-strong);
}
.house-title { font-family: var(--serif); font-size: 1.5rem; line-height: 1.15; }
.house-desc { font-size: var(--fs-body); color: var(--ink-soft); line-height: 1.55; max-width: 52ch; }

.house-cta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 0.35rem; font-weight: 600; font-size: 0.9rem; color: var(--brass-strong);
}
.house-cta .icon { width: 0.85em; height: 0.85em; fill: currentColor; stroke: none; }

@media (max-width: 700px) {
  .house-card { grid-template-columns: 1fr; }
  .house-title { font-size: 1.3rem; }
}

/* the length picker */
.settings-panel.narrow { max-width: 420px; }

.house-len { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
@media (max-width: 420px) { .house-len { grid-template-columns: repeat(2, 1fr); } }

.house-len-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  padding: 0.85rem 0.4rem;
  border: 1px solid var(--rule); border-radius: 10px;
  background: transparent; color: inherit; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.house-len-btn:hover { border-color: var(--brass); background: var(--brass-tint); }
.house-len-btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.hl-num { font-family: var(--mono); font-size: 1.3rem; font-weight: 600; color: var(--brass-strong); }
.hl-unit { font-size: var(--fs-meta); color: var(--ink-soft); }

/* ---------- Views: Home / Carrel Exclusive / Playlist ---------- */

.view-head { margin: 0.2rem 0 1.5rem; }
.view-head h2 {
  margin: 0 0 0.3rem;
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
}
:root[data-skin="night-shift"] .view-head h2 { text-transform: uppercase; font-size: 1.2rem; }
.view-head p { margin: 0; font-size: var(--fs-body); color: var(--ink-soft); max-width: 58ch; }

.exclusive-soon {
  display: flex; align-items: center; gap: 0.6rem;
  margin-top: 1.4rem; padding: 0.9rem 1.1rem;
  border: 1px dashed var(--rule); border-radius: var(--radius);
  font-size: var(--fs-meta); color: var(--ink-faint);
}
.exclusive-soon .icon { color: var(--brass); opacity: 0.8; }

.saved-empty {
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
  padding: 3.5rem 1rem; text-align: center;
  color: var(--ink-soft); font-size: var(--fs-body);
}
.saved-empty p { margin: 0; max-width: 34ch; }

/* the bookmark on a card */
.card-save {
  position: absolute;
  top: 0.45rem; left: 0.45rem;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(10,12,14,0.55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  z-index: 3;
}
.card:hover .card-save, .card:focus-within .card-save { opacity: 1; }
.card-save:hover { background: rgba(10,12,14,0.8); }
/* once it's saved, the mark stays visible — that's the signal */
.card-save.on { opacity: 1; background: var(--brass); color: #FFFDF8; }
.card-save .icon { width: 0.85em; height: 0.85em; fill: currentColor; stroke: none; }

/* and the same thing in the theater */
.player-info-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.player-info-top h3 { margin: 0; }

.theater-save {
  flex: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--rule); border-radius: var(--radius-pill);
  background: var(--bg); color: var(--ink-soft);
  font-size: var(--fs-control); font-weight: 600; cursor: pointer;
}
.theater-save:hover { color: var(--ink); border-color: var(--brass); }
.theater-save.on { background: var(--brass-tint); border-color: var(--brass); color: var(--brass-strong); }
.theater-save .icon { width: 0.9em; height: 0.9em; fill: currentColor; stroke: none; }

/* ---------- Study rooms ---------- */

.room-make { width: 100%; justify-content: center; padding: 0.7rem 1rem; }

.room-or {
  display: flex; align-items: center; gap: 0.7rem;
  margin: 1.1rem 0; color: var(--ink-faint);
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.room-or::before, .room-or::after {
  content: ""; flex: 1; height: 1px; background: var(--rule);
}

.room-join { display: flex; flex-direction: column; gap: 0.4rem; }
.room-join-row { display: flex; gap: 0.5rem; }
.room-join-row .btn { flex: none; padding: 0.6rem 1.1rem; }

.room-code {
  flex: 1; min-width: 0;
  font-family: var(--mono); font-size: 1.05rem;
  letter-spacing: 0.22em; text-transform: uppercase;
}
.room-code::placeholder { letter-spacing: 0.22em; color: var(--ink-faint); }

/* The panel that sits above the focus timer while you're in a room */
.room-panel {
  position: fixed;
  right: 1.25rem; bottom: calc(1.25rem + 400px);
  width: 272px;
  z-index: 51;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brass) 40%, var(--rule));
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.85rem 0.95rem 0.95rem;
  display: flex; flex-direction: column; gap: 0.6rem;
}
:root[data-skin="night-shift"] .room-panel { border-radius: var(--radius); }
@media (max-width: 900px) { .room-panel { width: 232px; } }

.room-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.room-label {
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint);
}

.room-code-chip {
  margin-top: 0.15rem;
  border: 1px dashed var(--rule); border-radius: 7px;
  background: var(--bg); color: var(--brass-strong);
  font-family: var(--mono); font-size: 1rem; font-weight: 600;
  letter-spacing: 0.18em;
  padding: 0.2rem 0.5rem; cursor: pointer;
}
.room-code-chip:hover { border-color: var(--brass); border-style: solid; }

.room-people { display: flex; flex-direction: column; gap: 0.3rem; }
.room-person {
  display: flex; align-items: center; gap: 0.45rem;
  font-size: var(--fs-meta); color: var(--ink);
}
.rp-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--rule); flex: none; transition: background 0.15s;
}
.room-person.speaking .rp-dot { background: var(--brass); box-shadow: 0 0 0 3px var(--brass-tint); }
.rp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-mic { width: 0.85em; height: 0.85em; color: var(--ink-faint); flex: none; }

.room-mic {
  display: flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.5rem; border-radius: 8px;
  border: 1px solid var(--rule); background: var(--bg);
  color: var(--ink-soft); font-size: var(--fs-control); font-weight: 600;
  cursor: pointer;
}
.room-mic:hover { color: var(--ink); border-color: var(--brass); }
.room-mic.on { background: var(--brass-tint); border-color: var(--brass); color: var(--brass-strong); }
.room-mic[disabled] { opacity: 0.6; cursor: default; }
.room-mic .icon { width: 1em; height: 1em; }

.room-note { margin: 0; font-size: var(--fs-meta); line-height: 1.45; color: var(--ink-faint); }

/* ---------- Settings toggle ---------- */
.switch-row {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule); border-radius: 10px;
  cursor: pointer;
}
.switch-row:hover { border-color: color-mix(in srgb, var(--brass) 45%, var(--rule)); }
.switch-text { display: flex; flex-direction: column; gap: 0.25rem; }
.switch-name { font-weight: 600; font-size: 0.92rem; }
.switch-desc { font-size: var(--fs-body); color: var(--ink-soft); line-height: 1.5; }

/* The real checkbox stays in the page for keyboard and screen
   readers; it's just visually replaced by the track below. */
.switch-input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch {
  flex: none; margin-top: 0.15rem;
  width: 42px; height: 24px; border-radius: 999px;
  background: var(--rule); position: relative; transition: background 0.18s;
}
.switch-knob {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.18s;
}
.switch-input:checked ~ .switch { background: var(--brass); }
.switch-input:checked ~ .switch .switch-knob { transform: translateX(18px); }
.switch-input:focus-visible ~ .switch { outline: 2px solid var(--brass); outline-offset: 3px; }

.skin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
@media (max-width: 520px) { .skin-grid { grid-template-columns: 1fr; } }

.skin-card {
  display: flex; flex-direction: column; gap: 0.7rem;
  padding: 0.7rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.skin-card:hover { border-color: var(--brass); }
.skin-card.active {
  border-color: var(--brass);
  box-shadow: 0 0 0 2px var(--brass-tint);
}

.skin-preview {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--rule);
  aspect-ratio: 16 / 10;
}
.skin-preview .sp-nav { display: block; height: 18%; }
.skin-preview .sp-body { display: flex; height: 82%; }
.skin-preview .sp-side { width: 26%; }
.skin-preview .sp-cards {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px; padding: 5px;
}
.skin-preview .sp-cards i { display: block; border-radius: 2px; }

/* Reading Room preview */
.skin-preview.rr { background: #F3EFE6; }
.skin-preview.rr .sp-nav { background: #FAF7EF; border-bottom: 1px solid #DCD3C2; }
.skin-preview.rr .sp-side { background: #F3EFE6; border-right: 1px solid #DCD3C2; }
.skin-preview.rr .sp-cards i { background: #A9762F; opacity: 0.55; }
.skin-preview.rr .sp-cards i:nth-child(2) { background: #5C7A6A; }
.skin-preview.rr .sp-cards i:nth-child(3) { background: #8A6A4B; }

/* Night Shift preview */
.skin-preview.ns { background: #04050C; }
.skin-preview.ns .sp-nav { background: #0D1020; border-bottom: 1px solid #232A52; }
.skin-preview.ns .sp-side { background: #04050C; border-right: 1px solid #232A52; }
.skin-preview.ns .sp-cards i { background: #7B61FF; }
.skin-preview.ns .sp-cards i:nth-child(2) { background: #7DE2FF; }
.skin-preview.ns .sp-cards i:nth-child(3) { background: #A78BFA; }

/* Green Room's swatch shows the discipline: one green, one bone,
   nothing else. */

.skin-preview.ss { background: #0A1E30; }
.skin-preview.ss .sp-nav { background: #10293E; border-bottom: 1px solid #1C3C57; }
.skin-preview.ss .sp-side { background: #0A1E30; border-right: 1px solid #1C3C57; }
.skin-preview.ss .sp-cards i { background: #E9A13B; }
.skin-preview.ss .sp-cards i:nth-child(2) { background: #E2553C; }
.skin-preview.ss .sp-cards i:nth-child(3) { background: #FFC46B; }

.skin-meta { display: flex; flex-direction: column; gap: 0.2rem; }
.skin-name {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.9rem; font-weight: 700;
}
.skin-tick { width: 0.95em; height: 0.95em; color: var(--brass); opacity: 0; }
.skin-card.active .skin-tick { opacity: 1; }
.skin-desc { font-size: var(--fs-meta); color: var(--ink-soft); line-height: 1.4; }

.acct-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
}
.acct-who { display: flex; align-items: center; gap: 0.7rem; }
.acct-name { font-size: 0.9rem; font-weight: 600; }
.acct-meta { font-size: var(--fs-meta); color: var(--ink-soft); }

/* =========================================================
   The paste bar
   ========================================================= */

.paste-panel {
  margin-bottom: 1.6rem;
  padding: 1.3rem 1.4rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
:root[data-skin="night-shift"] .paste-panel {
  background: linear-gradient(180deg, var(--surface), var(--bg));
}

.paste-head { display: flex; align-items: flex-start; gap: 0.85rem; margin-bottom: 1rem; }
.paste-bean { width: 38px; height: 38px; color: var(--brass); flex-shrink: 0; }

.paste-title {
  margin: 0 0 0.15rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
}
:root[data-skin="night-shift"] .paste-title { text-transform: uppercase; letter-spacing: 0.03em; font-size: 1rem; }

.paste-sub { margin: 0; font-size: var(--fs-body); color: var(--ink-soft); max-width: 58ch; }

.paste-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.paste-input {
  flex: 1 1 260px;
  min-width: 0;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.9rem;
  outline: none;
}
.paste-input:focus { border-color: var(--brass); }
.paste-input::placeholder { color: var(--ink-faint); }

.paste-subject {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}
.paste-subject:focus { border-color: var(--brass); }

.paste-bar .btn.primary { padding: 0.6rem 1.15rem; }
.paste-bar .btn.primary[disabled] { opacity: 0.6; cursor: default; }

.paste-status {
  margin: 0.6rem 0 0;
  min-height: 1.15em;
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}
.paste-status.ok { color: var(--brass-strong); }
.paste-status.bad { color: var(--live); }

/* real thumbnails, when we have them */
.thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-remove {
  position: absolute;
  top: 0.45rem; right: 0.45rem;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: rgba(10,12,14,0.6);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 3;
}
.card:hover .card-remove, .card:focus-within .card-remove { opacity: 1; }
.card-remove:hover { background: var(--live); }
.card-remove .icon { width: 0.8em; height: 0.8em; }

/* =========================================================
   Real video + submit screen
   ========================================================= */

.player-media { position: absolute; inset: 0; background: #000; }
.player-media iframe,
.player-media video { width: 100%; height: 100%; border: 0; display: block; }

/* ---- the player, and the card that hides YouTube's end screen ---- */

.cp-root { position: absolute; inset: 0; background: #000; }
.cp-frame { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Bare player: Carrel's own control bar ----------
   Sits under the video, never over it. YouTube's rules forbid
   any overlay in front of their player, so this is not a
   stylistic choice — it's the compliant place for it. */

.player-stage { display: flex; flex-direction: column; background: #000; min-height: 0; flex: 1 1 auto; }

.cp-bar {
  /* wrap so the music row drops to its own line instead of
     squeezing the scrubber down to a stub */
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.55rem 0.8rem;
  background: var(--surface-2, var(--surface));
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
}

.cpb-btn {
  flex: none;
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: transparent; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s;
}
.cpb-btn:hover { background: var(--brass-tint); color: var(--brass-strong); }
.cpb-icon { width: 17px; height: 17px; fill: currentColor; stroke: currentColor; stroke-width: 1.6; }
[data-cp-play] .cpb-icon, [data-cp-mute] .cpb-icon { stroke: none; }
[data-cp-fs] .cpb-icon { fill: none; }

.cp-bar .cpb-time {
  flex: none; font-size: var(--fs-meta); color: var(--ink-soft);
  font-variant-numeric: tabular-nums; min-width: 3.2em;
}
.cp-bar .cpb-dur { text-align: right; }

/* One slider style, two widths. --pct is set from JS so the
   filled part of the track reads at a glance. */
.cp-bar input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 3px; cursor: pointer; margin: 0;
  background: linear-gradient(to right,
    var(--brass) 0 var(--pct, 0%), var(--rule) var(--pct, 0%) 100%);
}
.cpb-seek { flex: 1 1 auto; min-width: 60px; }
.cpb-vol  { flex: 0 1 84px; }
.cp-bar input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brass); border: 2px solid var(--surface);
}
.cp-bar input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brass); border: 2px solid var(--surface);
}
.cp-bar input[type="range"]:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

@media (max-width: 560px) { .cpb-vol { flex-basis: 48px; } .cp-bar { gap: 0.4rem; padding: 0.5rem; } }

/* The house-session bar: one slow fill across the whole session,
   never the 4-second clip. */
.hs-track {
  flex: 1 1 auto; min-width: 160px; height: 4px;
  background: var(--rule); border-radius: 3px; overflow: hidden;
}
.hs-fill {
  height: 100%; width: 0;
  background: var(--brass);
  border-radius: 3px;
  transition: width 0.9s linear;
}
.hs-time {
  flex: none; font-size: var(--fs-meta); color: var(--ink-soft);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hs-time strong { color: var(--ink); font-weight: 600; }

/* Fullscreen: the video takes the room it needs, the bar stays put. */
.player-stage:fullscreen { background: #000; justify-content: center; }
.player-stage:fullscreen .player-surface { aspect-ratio: auto; flex: 1 1 auto; min-height: 0; }
.player-stage:fullscreen .cp-bar { background: rgba(12,12,14,0.94); border-top-color: rgba(255,255,255,0.14); }
.player-stage:fullscreen .cpb-btn { color: #F3EFE6; }
.player-stage:fullscreen .cpb-time { color: rgba(243,239,230,0.7); }

.cp-endcard {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg);
  text-align: center;
}

.cp-end-inner { display: flex; flex-direction: column; align-items: center; gap: 0.55rem; max-width: 34ch; }
.cp-end-bean { width: 54px; height: 54px; color: var(--brass); opacity: 0.9; }

.cp-end-title {
  margin: 0.3rem 0 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}
:root[data-skin="night-shift"] .cp-end-title { text-transform: uppercase; letter-spacing: 0.04em; font-size: 1rem; }

.cp-end-sub {
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink-soft);
}

.cp-end-btn {
  margin-top: 0.6rem;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.cp-end-btn:hover { border-color: var(--brass); color: var(--brass-strong); }

/* tells people what Carrel recognised while they're pasting */
.link-check {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  min-height: 1.1em;
}
.link-check.ok { color: var(--brass-strong); }
.link-check.bad { color: var(--live); }

.player-mock {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}

.pending-note {
  margin-top: 0.2rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: var(--brass-tint);
  border: 1px solid color-mix(in srgb, var(--brass) 40%, var(--rule));
  font-size: 0.78rem;
  color: var(--brass-strong);
}

.source-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.9rem; }
.source-tab {
  flex: 1;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer;
}
.source-tab:hover { color: var(--ink); }
.source-tab.active { background: var(--brass-tint); border-color: var(--brass); color: var(--brass-strong); }

.source-pane { display: flex; flex-direction: column; gap: 0.5rem; }

.file-drop {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 1.5rem 1rem;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 0.88rem; font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.file-drop:hover { border-color: var(--brass); color: var(--ink); }
.file-drop .icon { color: var(--ink-faint); }

select.auth-input { cursor: pointer; }

.submit-actions {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  padding-top: 0.3rem;
}
.submit-hint { font-size: 0.78rem; color: var(--ink-faint); }

.submit-actions .btn.primary[disabled] { opacity: 0.6; cursor: default; }

.demo-banner {
  position: fixed;
  left: 1.25rem; bottom: 1.25rem;
  z-index: 45;
  max-width: 300px;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: var(--fs-meta);
  line-height: 1.5;
  color: var(--ink-soft);
}
.demo-banner strong { color: var(--ink); }
.demo-banner code {
  font-family: var(--mono); font-size: 0.9em;
  background: var(--bg); padding: 0.05em 0.3em; border-radius: 3px;
}
@media (max-width: 900px) { .demo-banner { display: none; } }

/* =========================================================
   Toast
   ========================================================= */

.toast {
  position: fixed; bottom: 1.4rem; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: var(--bg);
  padding: 0.6rem 1.1rem;
  border-radius: 20px;
  font-size: var(--fs-meta);
  box-shadow: var(--shadow);
  z-index: 80;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(420px, calc(100vw - 2rem));
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .search-wrap { display: none; }
  .focus-widget { width: 232px; }
}

@media (max-width: 560px) {
  .brand-tag { display: none; }
  .topnav { gap: 0.6rem; padding: 0 0.9rem; }
  .grid { grid-template-columns: 1fr; }
  .overlay { padding: 0.9rem; }
}

/* ---------- Closing an account ---------- */

/* Separated from everything above it, because it is not a
   setting — it is the end of the account. */
.set-block.danger {
  border-top: 1px solid var(--rule);
  margin-top: 1.6rem;
  padding-top: 1.4rem;
}
.set-block.danger .set-h { color: var(--live); }

.danger-btn {
  border-color: color-mix(in srgb, var(--live) 55%, var(--rule));
  color: var(--live);
}
.danger-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--live) 12%, transparent);
  border-color: var(--live);
}
.danger-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.danger-confirm { margin-top: 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; }

.danger-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 9px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  font: inherit; font-size: var(--fs-control);
  font-family: var(--mono);
}
.danger-input:focus-visible { outline: 2px solid var(--live); outline-offset: 1px; border-color: var(--live); }

.danger-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* =========================================================
   Tags

   The playlist grows past the point where scanning it works.
   Tags are the user's own words for what a video is for —
   Accounting, Econ, whatever they call it — and the bar below
   filters the grid down to one of them.

   There is no tag list stored anywhere. The bar is built from
   whatever the videos are wearing, so a tag exists exactly as
   long as something wears it and never needs tidying up.
   ========================================================= */

.tagbar { margin: 0 0 1.1rem; }

.tagbar-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem;
}

.tag-chip {
  display: inline-flex; align-items: center; gap: 0.42rem;
  padding: 0.42rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tag-chip:hover { border-color: var(--brass); color: var(--ink); }
.tag-chip.on {
  background: var(--brass); border-color: var(--brass); color: #FFFDF8;
}
:root[data-skin="night-shift"] .tag-chip.on { color: #fff; }

.tag-chip .tag-count {
  font-family: var(--mono);
  font-size: 0.82em;
  opacity: 0.72;
}

/* Deleting a tag is offered only on the tag you are looking at,
   so the bar doesn't fill with little crosses. */
.tag-chip .tag-drop {
  display: none;
  margin: -0.2rem -0.45rem -0.2rem 0.1rem;
  width: 18px; height: 18px;
  border-radius: 50%;
  align-items: center; justify-content: center;
  opacity: 0.75;
}
.tag-chip.on .tag-drop { display: inline-flex; }
.tag-chip .tag-drop:hover { opacity: 1; background: rgba(0,0,0,0.18); }
.tag-chip .tag-drop .icon { width: 0.66em; height: 0.66em; }

.tag-chip.new { border-style: dashed; font-weight: 500; }
.tag-chip .icon { width: 0.82em; height: 0.82em; }

/* ---- the tags a card is wearing, under its title ---- */

.card-tags {
  display: flex; flex-wrap: wrap; gap: 0.36rem;
  margin-top: 0.5rem;
}

.card-tag {
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.22rem 0.62rem;
  border-radius: var(--radius-pill);
  background: var(--brass-tint);
  color: var(--brass-strong);
  white-space: nowrap;
}

.card-tagbtn {
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.22rem 0.68rem;
  border-radius: var(--radius-pill);
  border: 1px dashed var(--rule);
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.25rem;
}
.card-tagbtn:hover { border-color: var(--brass); color: var(--brass-strong); }
.card-tagbtn .icon { width: 0.86em; height: 0.86em; }

/* ---- the little panel for choosing tags ---- */

.tagpop {
  position: fixed;
  z-index: 200;
  width: 232px;
  max-height: 320px;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tagpop-head {
  padding: 0.55rem 0.75rem;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
}

.tagpop-list { overflow-y: auto; padding: 0.3rem; }

.tagpop-item {
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: none; background: none;
  border-radius: 7px;
  color: var(--ink);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}
.tagpop-item:hover { background: var(--surface-hover); }
.tagpop-box {
  width: 16px; height: 16px; flex: none;
  border: 1.5px solid var(--rule);
  border-radius: 4px;
  display: grid; place-items: center;
}
.tagpop-item.on .tagpop-box {
  background: var(--brass); border-color: var(--brass); color: #FFFDF8;
}
.tagpop-box .icon { width: 11px; height: 11px; opacity: 0; }
.tagpop-item.on .tagpop-box .icon { opacity: 1; }

.tagpop-new { display: flex; gap: 0.35rem; padding: 0.5rem; border-top: 1px solid var(--rule); }
.tagpop-new input {
  flex: 1 1 auto; min-width: 0;
  padding: 0.38rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--bg);
  color: var(--ink);
  font: inherit; font-size: 0.82rem;
}
.tagpop-new input:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.tagpop-new button {
  flex: none;
  padding: 0.38rem 0.6rem;
  border: none; border-radius: 7px;
  background: var(--brass); color: #FFFDF8;
  font: inherit; font-size: 0.8rem; font-weight: 700;
  cursor: pointer;
}
.tagpop-new button:hover { background: var(--brass-strong); }

/* =========================================================
   Profile picture
   ========================================================= */

.avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.avatar.lg { width: 72px; height: 72px; font-size: 1.6rem; cursor: default; flex: none; }

.pic-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.pic-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pic-note {
  flex-basis: 100%;
  margin: 0.15rem 0 0;
  font-size: var(--fs-meta);
  color: var(--ink-faint);
  min-height: 1.1em;
}
.pic-note.bad { color: var(--live); }
.pic-note.good { color: var(--brass-strong); }
