/* ============================================================
   Dad Actually — design system
   Palette: deep blue / dusty blue / pale blue-grey / warm cream
            / soft amber / charcoal
   Type:    Fraunces (display + italic whisper) · Mulish (UI/body)
   ============================================================ */

:root {
  --deep:      #24364B;
  --deep-2:    #1B2A3B;   /* sidebar depth */
  --deep-3:    #2E425A;   /* raised surfaces on deep */
  --dusty:     #71859A;
  --pale:      #E8EDF0;
  --cream:     #F7F2E8;
  --cream-2:   #FCFAF4;   /* raised cards on cream */
  --amber:     #D79A57;
  --amber-ink: #B57A38;   /* amber as *text* on light (contrast) */
  --charcoal:  #292D32;

  --line:      rgba(36, 54, 75, 0.10);
  --line-dark: rgba(255, 255, 255, 0.09);

  --shadow-sm: 0 1px 2px rgba(36, 54, 75, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(36, 54, 75, 0.22);
  --shadow-lg: 0 24px 60px -24px rgba(27, 42, 59, 0.45);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;

  --sidebar-w: 256px;
  --rail-w: 340px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);   /* calm deceleration */

  --font-serif: "Fraunces", "Iowan Old Style", Palatino, "Times New Roman", serif;
  --font-sans:  "Mulish", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must always win over any component's own display
   rule (e.g. .btn's `display: inline-flex`) — do not remove !important. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--charcoal);
  background: var(--deep);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

/* ---- reusable type helpers ---- */
.serif   { font-family: var(--font-serif); font-optical-sizing: auto; }
.whisper {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.005em;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dusty);
}

/* Quiet secondary text: role labels, "Recorded by …" attribution, hints. */
.muted { color: var(--dusty); font-size: 0.9em; }

/* Small "Audio" marker on recording cards. */
.media-tag { display:inline-flex; align-items:center; gap:4px; font-size:12px; color:var(--dusty); }
.media-tag svg { width:14px; height:14px; }

/* ============================================================
   App shell
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--deep);
}

/* ---- Sidebar ---- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px 18px 22px;
  color: #DCE4EC;
  background: linear-gradient(180deg, var(--deep) 0%, var(--deep-2) 100%);
  overflow-y: auto;
}

.brand { display: flex; align-items: flex-start; gap: 11px; padding: 2px 8px 6px; }
.brand__mark { flex: 0 0 auto; margin-top: 3px; color: var(--amber); }
.brand__name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 25px;
  line-height: 1.05;
  color: #F4EEE1;
  letter-spacing: -0.01em;
}
.brand__tag {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--amber);
  margin-top: 2px;
}

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  color: #B9C6D2;
  font-weight: 600;
  font-size: 14.5px;
  transition: background .18s ease, color .18s ease;
}
.nav__item svg { flex: 0 0 auto; width: 19px; height: 19px; stroke-width: 1.7; }
.nav__item:hover { background: rgba(255,255,255,0.05); color: #EAF0F5; }
.nav__item--active {
  background: rgba(255,255,255,0.09);
  color: #FFFFFF;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.nav__item--active svg { color: var(--amber); }
.nav__item--soon { color: #6E8093; cursor: default; }
.nav__item--soon:hover { background: transparent; color: #6E8093; }
.nav__soon {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--deep);
  background: var(--dusty);
  border-radius: 999px;
  padding: 2px 7px;
}

.search { position: relative; margin: 2px 4px 4px; }
.search__icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--dusty); pointer-events: none; }
.search__icon svg { width: 16px; height: 16px; }
.search__input {
  width: 100%; padding: 9px 12px 9px 34px; font: inherit; font-size: 13.5px;
  color: #EAF0F5; background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-dark); border-radius: 10px;
}
.search__input::placeholder { color: #7f92a4; }
.search__input:focus { outline: none; border-color: var(--amber); background: rgba(255,255,255,0.1); }
mark { background: rgba(215,154,87,0.35); color: inherit; border-radius: 2px; padding: 0 1px; }

.sidebar__spacer { flex: 1 1 auto; }

.account {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 8px;
  border-top: 1px solid var(--line-dark);
}
.account__avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--deep-3); color: #F4EEE1;
  display: grid; place-items: center;
  font-family: var(--font-serif); font-weight: 600; font-size: 16px;
  flex: 0 0 auto;
}
.account__name { font-weight: 700; font-size: 14px; color: #EAF0F5; line-height: 1.2; }
.account__sub  { font-size: 12px; color: var(--dusty); }
.account__logout {
  margin-left: auto; background: none; border: 0; cursor: pointer;
  color: var(--dusty); padding: 6px; border-radius: 8px; display: grid; place-items: center;
}
.account__logout:hover { color: #EAF0F5; background: rgba(255,255,255,0.06); }

/* Two-parent co-keeper block */
.keepers { padding: 12px 8px 10px; border-top: 1px solid var(--line-dark); }
.keepers__label {
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--dusty); margin-bottom: 9px;
}
.keepers__row { display: flex; align-items: center; gap: 11px; }
.keepers__avatars { display: flex; flex: 0 0 auto; }
.keepers__avatars .account__avatar:nth-child(2) { margin-left: -12px; }
.account__avatar--invite {
  background: transparent; color: var(--dusty);
  border: 1.5px dashed rgba(255,255,255,0.28);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.account__avatar--invite:hover {
  color: var(--amber); border-color: var(--amber);
  background: rgba(215,154,87,0.12);
}
.account__avatar--invite svg { width: 16px; height: 16px; }
.account__sub--link { display: inline-block; }
.account__sub--link:hover { color: var(--amber); }
.keepers__names { min-width: 0; line-height: 1.25; }

.datecard {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-dark);
  border-radius: var(--r-md);
  padding: 14px 15px;
}
.datecard__day { font-size: 12.5px; color: #C3CED8; }
.datecard__note { font-family: var(--font-serif); font-style: italic; font-size: 15px; color: var(--amber); margin-top: 4px; }

/* ---- Main canvas ---- */
.main {
  background: var(--cream);
  border-radius: 26px 0 0 26px;
  min-width: 0;
  min-height: 100vh;
  padding: 30px 34px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.topbar { display: flex; align-items: flex-start; gap: 20px; }
.topbar__titles { min-width: 0; }
.topbar__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--deep);
}
.topbar__subtitle { color: var(--dusty); margin-top: 6px; font-size: 15px; max-width: 72ch; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-sans); font-weight: 700; font-size: 14px;
  padding: 11px 17px; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; stroke-width: 1.8; }
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--deep); color: #F6F1E7; box-shadow: var(--shadow-md); }
.btn--primary:hover { background: #2B4159; }
.btn--primary .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }

.btn--ghost { background: #FFFFFF; color: var(--deep); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { border-color: rgba(36,54,75,0.22); }

.btn--accent { background: var(--amber); color: var(--deep); box-shadow: 0 10px 24px -12px rgba(215,154,87,0.9); }
.btn--accent:hover { background: #E0A863; }
.btn--accent .dot { width: 8px; height: 8px; border-radius: 50%; background: #FFFFFF; }

.btn--block { width: 100%; justify-content: center; }
.btn--lg { padding: 13px 20px; font-size: 15px; }

.iconbtn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: #FFFFFF; border: 1px solid var(--line); color: var(--deep);
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.iconbtn:hover { border-color: rgba(36,54,75,0.22); }

/* ============================================================
   Content region (main + optional right rail)
   ============================================================ */
.region { display: grid; grid-template-columns: minmax(0,1fr) var(--rail-w); gap: 24px; align-items: start; }
.region--solo { grid-template-columns: minmax(0,1fr); }
.stack { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.rail  { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 30px; }

/* ---- Cards ---- */
.card {
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.card--pad { padding: 20px; }

.section__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.section__title { font-family: var(--font-serif); font-weight: 500; font-size: 22px; color: var(--deep); letter-spacing: -0.01em; }
.section__link { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 7px 13px; border: 1px solid rgba(36,54,75,0.14); border-radius: 999px; background: #fff; color: var(--deep); font-weight: 700; font-size: 13px; transition: border-color .15s ease, box-shadow .15s ease, color .15s ease; }
.section__link:hover { color: var(--amber-ink); border-color: rgba(215,154,87,0.55); box-shadow: 0 2px 8px rgba(36,54,75,0.08); }
.section__link svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* ---- Featured / hero card ---- */
.feature {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 320px;
  display: flex;
  color: #F4EEE1;
  background: var(--deep);
  box-shadow: var(--shadow-md);
}
.feature__media { position: absolute; inset: 0; }
.feature__media img { width: 100%; height: 100%; object-fit: cover; }
.feature__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(24,35,49,0.94) 0%, rgba(24,35,49,0.72) 38%, rgba(24,35,49,0.15) 72%, rgba(24,35,49,0) 100%);
}
.feature__body { position: relative; padding: 30px; max-width: 60%; margin-top: auto; }
.feature__eyebrow { color: var(--amber); letter-spacing: 0.14em; }
.feature__title { font-family: var(--font-serif); font-weight: 500; font-size: 40px; line-height: 1.05; letter-spacing: -0.02em; margin: 10px 0 14px; }
.feature__meta { display: flex; align-items: center; gap: 8px; color: #C7D2DD; font-size: 13.5px; }
.feature__row { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.feature__watch { background: rgba(255,255,255,0.14); color: #F4EEE1; border: 1px solid rgba(255,255,255,0.18); backdrop-filter: blur(4px); }
.feature__watch:hover { background: rgba(255,255,255,0.22); }
.feature__left { color: #C7D2DD; font-size: 13px; }
.progress { height: 5px; width: 210px; border-radius: 999px; background: rgba(255,255,255,0.22); overflow: hidden; margin-top: 16px; }
.progress > span { display: block; height: 100%; background: var(--amber); border-radius: 999px; }

/* ---- Horizontal shelves (collections / recent) ---- */
.shelf {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(196px, 1fr);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.shelf::-webkit-scrollbar { height: 8px; }
.shelf::-webkit-scrollbar-thumb { background: var(--pale); border-radius: 999px; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile { scroll-snap-align: start; display: flex; flex-direction: column; gap: 10px; }
.tile__thumb {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden;
  background: var(--pale); box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.tile__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile__badge {
  position: absolute; left: 10px; top: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.9); color: var(--deep);
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.tile__badge svg { width: 16px; height: 16px; }
.tile__dur {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(24,35,49,0.82); color: #F4EEE1;
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
}
.tile__title { font-weight: 700; font-size: 14.5px; color: var(--deep); }
.tile__sub { font-size: 12.5px; color: var(--dusty); }
/* Card-wrapped tile (Collections index): a contained card with border + shadow. */
.tile--card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); padding: 12px; }
.tile--card .tile__thumb { border-radius: var(--r-sm); }
.tile--card .tile__title, .tile--card .tile__sub { padding: 0 2px; }
.tile--card:hover { box-shadow: var(--shadow-md); border-color: rgba(36,54,75,0.14); }
.tile--card:hover .tile__thumb { box-shadow: none; }
.tile--placeholder .tile__thumb {
  display: grid; place-items: center;
  background: repeating-linear-gradient(135deg, #EEF2F5 0 12px, #E8EDF0 12px 24px);
  color: var(--dusty);
}

/* ---- Rail cards ---- */
.prompt-card { padding: 22px; }
.prompt-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.prompt-card__icon { width: 34px; height: 34px; border-radius: 50%; background: var(--pale); color: var(--deep); display: grid; place-items: center; }
.prompt-card__label { font-family: var(--font-serif); font-weight: 500; font-size: 17px; color: var(--deep); }
.prompt-card__q { font-family: var(--font-serif); font-weight: 500; font-size: 22px; line-height: 1.25; color: var(--deep); letter-spacing: -0.01em; }
.prompt-card__foot { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.prompt-card__sep { border: 0; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }
.prompt-card__more { display: flex; justify-content: center; align-items: center; gap: 6px; white-space: nowrap; padding: 10px 14px; border: 1px solid rgba(36,54,75,0.14); border-radius: 999px; color: var(--deep); font-weight: 700; font-size: 13px; transition: border-color .15s ease, color .15s ease; }
.prompt-card__more:hover { color: var(--amber-ink); border-color: rgba(215,154,87,0.55); }
.prompt-card__more svg { width: 15px; height: 15px; flex: 0 0 auto; }

.watchlist { display: flex; flex-direction: column; gap: 8px; }
.watchrow {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--r-sm);
  background: #FFFFFF; border: 1px solid var(--line);
}
.watchrow:hover { border-color: rgba(36,54,75,0.2); }
.watchrow__icon { width: 34px; height: 34px; border-radius: 9px; background: var(--pale); color: var(--deep); display: grid; place-items: center; flex: 0 0 auto; }
.watchrow__title { font-weight: 700; font-size: 13.5px; color: var(--deep); line-height: 1.25; }
.watchrow__sub { font-size: 12px; color: var(--dusty); }

/* ---- Footer whisper ---- */
.whisper-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: linear-gradient(180deg, var(--deep) 0%, var(--deep-2) 100%);
  color: #E4EBF1; border-radius: var(--r-lg);
  padding: 20px 26px; text-align: center;
  box-shadow: var(--shadow-md);
}
.whisper-bar .leaf { color: var(--amber); opacity: 0.9; }
.whisper-bar__text { font-family: var(--font-serif); font-style: italic; font-size: 18px; }
.whisper-bar__text .heart { color: var(--amber); font-style: normal; }

/* ---- Empty states ---- */
.empty {
  border: 1px dashed rgba(36,54,75,0.22);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.5);
  padding: 34px; text-align: center; color: var(--dusty);
}
.empty__title { font-family: var(--font-serif); font-weight: 500; font-size: 19px; color: var(--deep); margin-bottom: 6px; }

/* ============================================================
   Prompts page (category browser)
   ============================================================ */
.cat { margin-bottom: 22px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-md); padding: 22px 22px 24px; }
.cat__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.cat__name { font-family: var(--font-serif); font-weight: 500; font-size: 22px; color: var(--deep); letter-spacing: -0.01em; }
.cat__count { font-size: 12.5px; color: var(--dusty); font-weight: 700; }
.cat__desc { color: var(--dusty); font-size: 13.5px; line-height: 1.5; margin: 0 0 16px; max-width: 72ch; }
.cat__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.prompt {
  display: flex; flex-direction: column; height: 100%; padding: 18px 18px 16px;
  background: var(--cream-2); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .18s ease, border-color .18s ease;
}
.prompt:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(36,54,75,0.18); }
.prompt__title { font-family: var(--font-serif); font-weight: 500; font-size: 18px; color: var(--deep); line-height: 1.2; }
.prompt__body { color: var(--dusty); font-size: 13.5px; margin-top: 7px; }
.prompt__cta { margin-top: auto; padding-top: 14px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--amber-ink); font-weight: 700; font-size: 13px; }
.prompt__cta svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* ============================================================
   Timeline (library grouped)
   ============================================================ */
.tl-group { margin-bottom: 28px; }
.tl-cat { font-family: var(--font-serif); font-weight: 500; font-size: 24px; color: var(--deep); margin-bottom: 4px; }
.tl-year { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dusty); margin: 16px 0 8px; }
.tl-list { display: flex; flex-direction: column; gap: 2px; }
.tl-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-radius: var(--r-sm);
  background: var(--cream-2); border: 1px solid var(--line);
}
.tl-item:hover { border-color: rgba(36,54,75,0.2); }
.tl-item__play { width: 34px; height: 34px; border-radius: 50%; background: var(--pale); color: var(--deep); display: grid; place-items: center; flex: 0 0 auto; }
.tl-item__title { font-weight: 700; color: var(--deep); }
.tl-item__status { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--dusty); text-transform: capitalize; }
.tl-item__status--ready { color: #4E7A4B; }
.tl-item__status--error { color: #A8443C; }

/* ---- Status pill ---- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pill--processing { background: rgba(215,154,87,0.16); color: var(--amber-ink); }
.pill--ready { background: rgba(78,122,75,0.14); color: #4E7A4B; }
.pill--error { background: rgba(168,68,60,0.12); color: #A8443C; }

/* ============================================================
   Record + Watch pages
   ============================================================ */
.panel { max-width: 640px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-md); padding: 26px 26px 28px; }
.panel--wide { max-width: 860px; }
.record-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.switch-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--deep); font-weight: 700; font-size: 13px; transition: border-color .15s ease, color .15s ease; }
.switch-link:hover { color: var(--amber-ink); border-color: rgba(215,154,87,0.55); }
.switch-link svg { width: 15px; height: 15px; flex: 0 0 auto; }
.form-note {
  background: var(--pale); border-radius: var(--r-md);
  padding: 16px 18px; color: var(--deep); margin-bottom: 20px;
}
.form-note strong { font-family: var(--font-serif); font-weight: 600; }
/* Account page: flash notice, inline field+button rows, keeper list. */
.notice { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; color: var(--deep); font-size: 14px; }
.field-row { display: flex; gap: 10px; align-items: stretch; }
.field-row input { flex: 1 1 auto; min-width: 0; }
.field-row .btn { flex: 0 0 auto; }
.keeper-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.keeper-list__item { display: flex; align-items: center; gap: 12px; }
.keeper-list__avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--pale); color: var(--deep); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: 0 0 auto; }
.keeper-list__name { font-weight: 700; color: var(--deep); }
.keeper-list__role { margin-left: auto; color: var(--dusty); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.keeper-invite { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }

.field { margin-bottom: 16px; }
.field > label { display: block; font-weight: 700; font-size: 13px; color: var(--deep); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; font: inherit;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #FFFFFF; color: var(--charcoal);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(215,154,87,0.18); }
.field input[type="file"] { padding: 10px 12px; cursor: pointer; background: var(--cream-2); }
.field input[type="file"]::file-selector-button { font: inherit; margin-right: 12px; padding: 8px 15px; border: 0; border-radius: 999px; background: var(--deep); color: #fff; font-weight: 700; cursor: pointer; transition: background .15s ease; }
.field input[type="file"]::file-selector-button:hover { background: var(--amber-ink); }
/* iOS gives datetime-local an intrinsic width that overflows its box — normalise it. */
.field input[type="datetime-local"] { -webkit-appearance: none; appearance: none; min-width: 0; }
.filedrop {
  border: 1.5px dashed rgba(36,54,75,0.28); border-radius: var(--r-md);
  background: rgba(255,255,255,0.6); padding: 22px; text-align: center; color: var(--dusty);
}
.status-line { margin-top: 12px; color: var(--dusty); font-size: 14px; min-height: 1.4em; }

/* --- Upload progress (record pages) ------------------------------------- */
.upload-progress { margin-top: 14px; }

.upload-progress__bar {
  appearance: none; -webkit-appearance: none;
  display: block; width: 100%; height: 10px; border: 0;
  border-radius: 999px; overflow: hidden;
  background: rgba(36, 54, 75, 0.12);
}
/* Native progress bars cannot be styled portably without the vendor
   pseudo-elements. The -webkit- pair covers Safari/iOS, which is the
   primary path for this app. */
.upload-progress__bar::-webkit-progress-bar {
  background: rgba(36, 54, 75, 0.12); border-radius: 999px;
}
.upload-progress__bar:indeterminate::-webkit-progress-bar {
  background: linear-gradient(90deg, var(--cream) 0%, var(--deep) 50%, var(--cream) 100%);
  background-size: 200% 100%;
  animation: upload-sweep 1.1s linear infinite;
}
.upload-progress__bar::-webkit-progress-value {
  background: var(--deep); border-radius: 999px;
  transition: width 120ms linear;
}
.upload-progress__bar::-moz-progress-bar {
  background: var(--deep); border-radius: 999px;
}
.upload-progress__bar:indeterminate::-moz-progress-bar {
  background: linear-gradient(90deg, var(--cream) 0%, var(--deep) 50%, var(--cream) 100%);
  background-size: 200% 100%;
  animation: upload-sweep 1.1s linear infinite;
}
/* Indeterminate state: the value attribute is removed when the browser cannot
   determine the total size, and the bar animates instead of filling. */
.upload-progress__bar:indeterminate {
  background: linear-gradient(90deg, var(--cream) 0%, var(--deep) 50%, var(--cream) 100%);
  background-size: 200% 100%;
  animation: upload-sweep 1.1s linear infinite;
}
@keyframes upload-sweep {
  from { background-position: 100% 0; }
  to   { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .upload-progress__bar::-webkit-progress-value { transition: none; }
  .upload-progress__bar:indeterminate { animation: none; }
  .upload-progress__bar:indeterminate::-webkit-progress-bar { animation: none; }
  .upload-progress__bar:indeterminate::-moz-progress-bar { animation: none; }
}

.upload-progress__label {
  margin: 8px 0 0; color: var(--dusty); font-size: 14px; min-height: 1.4em;
}

.watch__frame { border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-md); background: #000; }
/* Responsive video frame: the iframe fills a 16:9 box (Stream letterboxes portrait video). */
.ratio { position: relative; width: 100%; }
.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watch__head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.watch__head .filed { margin-top: 0; }
.filed__select { max-width: 100%; }
.watch__meta { color: var(--dusty); font-size: 14px; margin: 14px 0 18px; }
.watch__desc { color: var(--charcoal); margin-bottom: 22px; }
/* Interactive (click-to-seek) transcript, grouped into timestamped bubbles.
   `position: relative` and the bounded scroll box are load-bearing: the
   follow-along scroll measures block.offsetTop against .ts and moves
   .ts's own scrollTop, so the page — and the video — never move. */
.ts {
  position: relative;
  max-height: 46vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 14px;
  padding-right: 4px;
}
.ts__block { display: flex; flex-direction: column; gap: 5px; }
.ts__time {
  font-size: 12px; font-weight: 700; color: var(--dusty);
  letter-spacing: .02em; padding-left: 2px;
}
.ts__bubble {
  background: var(--pale);
  border: 1px solid rgba(36,54,75,0.45);
  border-radius: 16px 16px 16px 5px;
  padding: 11px 14px;
  color: var(--charcoal); line-height: 1.65;
}
.ts__cue {
  display: inline; cursor: pointer; border-radius: 4px;
  transition: background .15s ease, color .15s ease;
}
.ts__cue:hover { background: rgba(36,54,75,0.06); }
/* These are spans with role="button", not real buttons — a visible focus ring
   is the only thing telling a keyboard user where they are. */
.ts__cue:focus-visible { outline: 2px solid var(--deep); outline-offset: 2px; }
/* No font-weight here: cues are `display: inline` inside flowing prose, so
   bolding the active cue widens it and reflows every following line in the
   bubble every ~3s. The amber background + color change carry the highlight. */
.ts__cue--active { background: rgba(215,154,87,0.30); color: var(--deep); }
@media (prefers-reduced-motion: reduce) {
  .ts__cue { transition: none; }
}
.watch__pending, .watch__error {
  aspect-ratio: 16/9; border-radius: var(--r-lg); display: grid; place-items: center;
  text-align: center; padding: 24px; color: var(--dusty);
  background: var(--pale);
}
.backlink { display: inline-flex; align-items: center; gap: 7px; color: var(--dusty); font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.backlink:hover { color: var(--amber-ink); }
.backlink svg { width: 16px; height: 16px; flex: 0 0 auto; }

.filed { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; }
.filed__label { color: var(--dusty); font-weight: 700; font-size: 13px; }
.filed__select { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--deep); font-weight: 700; font-size: 13px; cursor: pointer; }
/* Custom chevron for all dropdowns, with breathing room from the right edge. */
.filed__select, .field select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371859A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* ============================================================
   Auth (login) — centered, off-shell
   ============================================================ */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1100px 600px at 20% -10%, rgba(215,154,87,0.10), transparent 60%),
    linear-gradient(180deg, var(--deep) 0%, var(--deep-2) 100%);
}
.auth__card {
  width: 100%; max-width: 400px; background: var(--cream);
  border-radius: var(--r-lg); padding: 36px 32px; box-shadow: var(--shadow-lg);
}
.auth__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; color: var(--amber); }
.auth__name { font-family: var(--font-serif); font-weight: 600; font-size: 26px; color: var(--deep); }
.auth__tag { font-family: var(--font-serif); font-style: italic; color: var(--amber-ink); font-size: 14px; margin-bottom: 24px; }
.auth__err { background: rgba(168,68,60,0.1); color: #8f3a33; border-radius: var(--r-sm); padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; }
.auth__note { color: var(--dusty); font-size: 13px; margin: -8px 0 16px; }

/* One-time-code: six digit boxes */
.otp { display: flex; gap: 8px; margin-bottom: 18px; }
.otp__box {
  flex: 1 1 0; min-width: 0; height: 56px; padding: 0;
  text-align: center; font-family: var(--font-sans); font-size: 24px; font-weight: 700;
  color: var(--charcoal); background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  -webkit-appearance: none; appearance: none;
}
.otp__box:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(215,154,87,0.18); }

/* Button submitting state: the leading dot becomes a spinner; text swaps via JS. */
@keyframes fyl-spin { to { transform: rotate(360deg); } }
.btn.is-loading { pointer-events: none; opacity: 0.9; }
/* Buttons with a leading dot: the dot becomes a spinner. */
.btn.is-loading .dot {
  width: 15px; height: 15px; background: transparent;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: fyl-spin .6s linear infinite;
}
/* Buttons without a dot (ghost, etc.): prepend a spinner in the current text colour. */
.btn.is-loading:not(:has(.dot))::before {
  content: ""; width: 15px; height: 15px; flex: 0 0 auto;
  border: 2px solid; border-color: currentColor currentColor currentColor transparent;
  border-radius: 50%; animation: fyl-spin .6s linear infinite;
}
.account-signout { margin-top: 18px; }

/* ============================================================
   Responsive
   ============================================================ */
/* ---- Mobile chrome: hidden on desktop, shown < 720px ---- */
.mtop, .tabbar, .drawer, .drawer__scrim { display: none; }
.drawer-toggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

@media (max-width: 1160px) {
  .region { grid-template-columns: minmax(0,1fr); }
  .rail { position: static; flex-direction: row; flex-wrap: wrap; }
  .rail > * { flex: 1 1 300px; }
}
@media (max-width: 720px) {
  /* Sidebar out; single column. */
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }

  /* Mobile top bar */
  .mtop {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 30;
    padding: 10px 14px calc(10px) 16px;
    padding-top: calc(10px + env(safe-area-inset-top));
    background: var(--deep);
  }
  .mtop__brand { display: flex; align-items: center; gap: 8px; color: #F4EEE1; font-family: var(--font-serif); font-weight: 600; font-size: 19px; text-decoration: none; }
  .mtop__brand svg { width: 22px; height: 22px; color: var(--amber); }
  .mtop__menu { display: grid; place-items: center; width: 44px; height: 44px; color: #DCE4EC; cursor: pointer; border-radius: 10px; }

  /* Content clears the fixed bottom bar */
  .main { border-radius: 18px 18px 0 0; padding: 18px 16px; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .topbar { flex-direction: column; }
  .topbar__actions { margin-left: 0; }
  .topbar__title { font-size: 24px; }
  .feature__body { max-width: 100%; }
  /* Hero action buttons: stack full-width so nothing is cut off on a phone. */
  .feature__row { flex-direction: column; align-items: stretch; gap: 10px; }
  .feature__row .btn { width: 100%; justify-content: center; }
  /* Action buttons inside cards/panels go full-width on phones, and input+button
     field-rows stack vertically so nothing is squished or overlapping. */
  .card .btn, .panel .btn { width: 100%; justify-content: center; }
  .field-row { flex-direction: column; align-items: stretch; }
  .field-row .btn, .field-row input { width: 100%; }
  /* Watch page: stack "Recorded by" + the Filed-under label/select vertically. */
  .watch__head { flex-direction: column; align-items: stretch; }
  .filed { flex-direction: column; align-items: stretch; gap: 6px; }
  .filed__select { width: 100%; }
  .region { grid-template-columns: 1fr; }
  .rail { position: static; flex-direction: column; }

  /* Bottom tab bar */
  .tabbar {
    display: flex; align-items: flex-end; justify-content: space-around;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(60px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px -12px rgba(36,54,75,0.30);
  }
  .tabbar__item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 60px; min-width: 44px; color: var(--dusty); font-size: 11px; font-weight: 700;
    text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .tabbar__item svg { width: 22px; height: 22px; }
  .tabbar__item--active { color: var(--deep); }
  .tabbar__item--active svg { color: var(--amber); }
  .tabbar__rec {
    flex: 0 0 auto; display: grid; place-items: center;
    width: 58px; height: 58px; margin: 0 4px; transform: translateY(-14px);
    background: var(--amber); color: #fff; border-radius: 50%;
    box-shadow: 0 8px 20px -6px rgba(215,154,87,0.70); border: 3px solid #fff;
  }
  .tabbar__rec svg { width: 26px; height: 26px; }

  /* Drawer (CSS-only) */
  .drawer__scrim {
    display: block; position: fixed; inset: 0; z-index: 45;
    background: rgba(27,42,59,0.5); opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
  }
  .drawer {
    display: flex; flex-direction: column; gap: 14px;
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 46;
    width: min(84vw, 320px); padding: 20px 18px;
    padding-top: calc(20px + env(safe-area-inset-top));
    background: linear-gradient(180deg, var(--deep) 0%, var(--deep-2) 100%);
    color: #DCE4EC; overflow-y: auto;
    transform: translateX(100%); transition: transform .22s var(--ease);
  }
  .drawer-toggle:checked ~ .drawer { transform: translateX(0); }
  .drawer-toggle:checked ~ .drawer__scrim { opacity: 1; pointer-events: auto; }

  .search--drawer { margin: 0; }
  .search--drawer .search__input { width: 100%; }
  .drawer__nav { display: flex; flex-direction: column; gap: 3px; }
  .drawer__item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 11px; color: #B9C6D2; font-weight: 600; font-size: 15px; text-decoration: none; }
  .drawer__item svg { width: 20px; height: 20px; flex: 0 0 auto; }
  .drawer__item--active { background: rgba(255,255,255,0.09); color: #fff; }
  .drawer__item--active svg { color: var(--amber); }
  .drawer__item--soon { color: #6E8093; }
  .drawer__keepers { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-dark); }
  .drawer__keepers .keepers__label { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dusty); margin-bottom: 4px; }
  .drawer__keepers-names { color: #DCE4EC; font-size: 14px; font-weight: 700; }
  .drawer__signout { margin-top: 12px; }
}

/* ============================================================
   Motion — calm "rise and settle", like a memory surfacing. Kept
   subtle and fully disabled under prefers-reduced-motion (below).
   ============================================================ */
@keyframes fyl-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fyl-shake {
  10%, 90%      { transform: translateX(-1px); }
  20%, 80%      { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60%      { transform: translateX(3px); }
}

/* Content eases up on load, lightly staggered so the page settles top-down. */
.main > *                { animation: fyl-rise .5s var(--ease) both; }
.main > *:nth-child(2)   { animation-delay: .05s; }
.main > *:nth-child(3)   { animation-delay: .10s; }
.main > *:nth-child(n+4) { animation-delay: .14s; }

/* Auth card rises in; shakes to reject a bad code. */
.auth__card         { animation: fyl-rise .55s var(--ease) both; }
.auth__card--shake  { animation: fyl-shake .5s ease both; }

/* Thumbnails lift on hover; large panels and dense rows stay put. */
.tile              { transition: transform .16s var(--ease); }
.tile:hover        { transform: translateY(-3px); }
.tile__thumb       { transition: box-shadow .18s ease, border-color .18s ease; }
.tile:hover .tile__thumb { box-shadow: var(--shadow-md); border-color: rgba(36,54,75,0.18); }

/* Interactive rows: a quiet shadow on hover, no layout shift. */
.tl-item, .watchrow            { transition: border-color .15s ease, box-shadow .18s ease; }
.tl-item:hover, .watchrow:hover { box-shadow: var(--shadow-sm); }

/* Nav: a small directional nudge on the icon. */
.nav__item:not(.nav__item--soon) svg        { transition: transform .15s var(--ease); }
.nav__item:not(.nav__item--soon):hover svg   { transform: translateX(2px); }

/* ---- accessibility floor ---- */
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
