/* Walks with Charlie — tokens and components from docs/design/HANDOFF.md.
   Mobile-first (390 mockups); desktop layout from 1024px (1440 mockups). */

@font-face { font-family: 'Fraunces'; font-weight: 600; font-style: normal; font-display: swap; src: url('/static/vendor/fonts/fraunces-600.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('/static/vendor/fonts/dm-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('/static/vendor/fonts/dm-sans-500.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('/static/vendor/fonts/dm-sans-600.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('/static/vendor/fonts/dm-sans-700.woff2') format('woff2'); }

:root {
  --bg: #F3EFE4;
  --paper: #FBF9F3;
  --white: #FFFFFF;
  --ink: #1E2B24;
  --muted: #56615A;
  --pine: #2F5D46;
  --pine-hover: #1E3F2F;
  --live: #C33D27;          /* LIVE badges and the heart only */
  --border: #DCD5C4;
  --border-soft: #E6E0D2;
  --input: #CFC7B4;
  --overlay: rgba(20, 28, 24, 0.72);
  --marker: #F4B96A;
  --r-video: 14px;
  --r-card: 12px;
  --gutter: 16px;
  --max: 1312px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
}
@media (min-width: 1024px) { :root { --r-video: 16px; --gutter: 64px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; }
a { color: var(--pine); }
a:hover { color: var(--pine-hover); }
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pine); outline-offset: 2px; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex-grow: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > .field { flex: 1 1 200px; }
.display { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; font-size: 26px; }
@media (min-width: 1024px) { .display { font-size: 44px; } }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--pine); }
.eyebrow-live { color: var(--live); }
@media (min-width: 1024px) { .eyebrow { font-size: 14px; } }
.mobile-only { display: flex; }
.desktop-only { display: none; }
@media (min-width: 1024px) { .mobile-only { display: none !important; } .desktop-only { display: block; } }

/* ---------- Header ---------- */
.site-header { height: 64px; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .logo { color: var(--pine); width: 28px; height: 28px; }
.brand span { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.site-nav { display: flex; align-items: center; gap: 20px; font-size: 15px; font-weight: 500; }
.site-nav a { text-decoration: none; color: var(--ink); }
.site-nav a.current { border-bottom: 2px solid var(--pine); padding-bottom: 2px; }
.site-nav > a:not(.account-btn):not(.nav-live) { display: none; }
.nav-live { display: flex; align-items: center; gap: 8px; }
.nav-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); }
.account-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--paper); color: var(--pine) !important; display: flex; align-items: center; justify-content: center; }
@media (min-width: 1024px) {
  .site-header { height: 80px; }
  .brand .logo { width: 34px; height: 34px; }
  .brand span { font-size: 24px; }
  .site-nav { gap: 32px; }
  .site-nav > a:not(.account-btn):not(.nav-live) { display: inline; }
}

main { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; }

/* ---------- Buttons & pills ---------- */
.btn-primary, .btn-outline, .btn-danger { min-height: 48px; padding: 0 22px; border-radius: 24px; font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--pine); color: var(--white); border: 0; }
.btn-primary:hover { background: var(--pine-hover); color: var(--white); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-outline { background: transparent; color: var(--pine); border: 1px solid var(--pine); }
.btn-danger { background: var(--live); color: var(--white); border: 0; }
.pill-btn { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--border); background: var(--white); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.pill-btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.pill-link { height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--input); background: var(--white); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.danger-text { color: var(--live); }
.icon-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--ink); cursor: pointer; }

/* ---------- Badges ---------- */
.badge { font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; }
.badge-live { background: var(--live); color: var(--white); font-weight: 700; letter-spacing: 0.08em; }
.badge-overlay { background: var(--overlay); color: var(--white); font-weight: 500; }
.badge-muted { background: var(--border); color: var(--ink); }
.badge-ok { background: #D9E6DD; color: var(--pine-hover); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; }
.field label, .field legend, .field-label { font-size: 14px; font-weight: 600; }
.field-label { font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=date], input[type=time], select, textarea { min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--input); background: var(--white); font-size: 16px; width: 100%; }
textarea { min-height: 96px; resize: vertical; }
.radio, .check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.radio input, .check input { width: 20px; height: 20px; accent-color: var(--pine); margin: 0; }
.form-note { margin: 0; font-size: 14px; color: var(--muted); }
.form-note.error { color: var(--live); }
.card { background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-card); padding: 20px; }
.card.danger { border-color: #E3B4AA; }
.card h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; }

/* ---------- Sign-in (Mobile-Access) ---------- */
body.access main { max-width: 480px; }
.access-wrap { min-height: 100vh; min-height: 100dvh; padding: 72px 24px 40px; display: flex; flex-direction: column; gap: 32px; }
.access-intro { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.access-intro .logo { color: var(--pine); }
.access-intro h1 { font-family: var(--serif); font-size: 40px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
.lede { margin: 0; font-size: 17px; line-height: 1.5; color: var(--muted); }
.access-wrap input[type=email] { height: 52px; font-size: 17px; }
.access-wrap .btn-primary { height: 52px; border-radius: 26px; font-size: 17px; margin-top: 8px; }
.privacy-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--r-card); background: var(--paper); border: 1px solid var(--border); color: var(--pine); }
.privacy-card p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }

/* ---------- Video frame & player ---------- */
.video-frame { position: relative; border-radius: var(--r-video); overflow: hidden; background: #26302B; aspect-ratio: 16 / 9; }
.video-frame .art, .video-frame video, .video-frame img { width: 100%; height: 100%; object-fit: cover; }
.video-bleed { border-radius: 0; }
.video-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 8px; pointer-events: none; }
@media (min-width: 1024px) { .video-badges { top: 20px; left: 20px; } .video-badges .badge { font-size: 13px; padding: 6px 10px; } }
.poster-link { display: block; }
.play-badge { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; background: var(--overlay); }
.play-badge::after { content: ''; position: absolute; left: 24px; top: 18px; border-left: 18px solid var(--white); border-top: 12px solid transparent; border-bottom: 12px solid transparent; }

.player { position: relative; width: 100%; height: 100%; }
.player video { background: #000; }
.player-controls { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 6px 8px 2px; border-radius: 12px; background: rgba(20, 28, 24, 0.78); color: var(--white); display: flex; flex-direction: column; gap: 2px; }
@media (min-width: 1024px) { .player-controls { left: 16px; right: 16px; bottom: 16px; padding: 12px 12px 4px; } }
.control-row { display: flex; align-items: center; gap: 2px; }
.ctl { width: 44px; height: 44px; border: 0; background: transparent; color: var(--white); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ctl svg { pointer-events: none; }
.ctl-time { font-size: 14px; font-variant-numeric: tabular-nums; padding: 0 6px; white-space: nowrap; }
.ctl-speed { height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.5); background: transparent; color: var(--white); font-size: 13px; font-weight: 600; cursor: pointer; }
.scrubber { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.scrub-track, .scrub-fill { position: absolute; left: 0; height: 4px; border-radius: 2px; }
.scrub-track { right: 0; background: rgba(255, 255, 255, 0.3); }
.scrub-fill { width: 0; background: var(--white); }
.scrub-markers span { position: absolute; top: 6px; width: 3px; height: 10px; background: var(--marker); border-radius: 1px; }
.scrub-thumb { position: absolute; left: 0; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--white); }
.player-live .player-controls { flex-direction: row; }

/* ---------- Home: hero ---------- */
.hero { padding: 16px var(--gutter) 0; display: flex; flex-direction: column; gap: 12px; }
.hero.empty { padding-top: 48px; padding-bottom: 32px; gap: 8px; }
.hero-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hero-text { display: flex; flex-direction: column; gap: 12px; }
.hero-text .muted { margin-top: 4px; }
.hero-text [data-copy-link] { display: none; }
@media (min-width: 1024px) {
  .hero { padding-top: 40px; padding-bottom: 48px; flex-direction: row; gap: 32px; align-items: flex-start; }
  .hero-main { flex: 1 1 auto; gap: 20px; }
  .hero-latest { flex-direction: column; }
  .hero-latest .video-frame { max-width: 928px; width: 100%; }
  .hero-text { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px; }
  .hero-text [data-copy-link] { display: inline-flex; flex-shrink: 0; }
  .hero-live > .desktop-only { width: 352px; flex-shrink: 0; }
}

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; min-height: 0; }
.chat-aside { height: 650px; background: var(--paper); border: 1px solid var(--border); border-radius: 16px; }
.chat-head { padding: 20px 20px 14px; border-bottom: 1px solid var(--border-soft); }
.chat-head h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.chat-head .muted { font-size: 14px; margin-top: 4px; }
.chat-list { list-style: none; margin: 0; padding: 16px 20px; flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.chat-msg { display: flex; gap: 12px; align-items: flex-start; }
.chat-avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.chat-who { font-size: 14px; font-weight: 600; }
.chat-who .muted { font-weight: 400; }
.chat-text { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.chat-dad { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--white); background: var(--pine); border-radius: 4px; padding: 1px 5px; margin-left: 4px; }
.chat-reaction { font-size: 14px; color: var(--muted); }
.chat-foot { padding: 14px 20px 20px; border-top: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 10px; }
.reactions { display: flex; gap: 8px; }
.reactions .pill-btn { flex: 1 1 0; }
.chat-form { display: flex; flex-direction: column; gap: 6px; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input { flex: 1 1 auto; min-width: 0; height: 44px; min-height: 44px; border-radius: 10px; }
.send-btn { width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px; border: 0; background: var(--pine); color: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.chat-status { font-size: 13px; min-height: 1em; }

/* ---------- Live page (Mobile-Live) ---------- */
body.live-page main { max-width: 720px; }
.live-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.live-top { height: 56px; padding: 0 8px; display: flex; align-items: center; gap: 4px; }
.live-top-title { font-size: 16px; font-weight: 600; }
.live-top a { color: var(--ink); }
.live-head { padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid var(--border); }
.live-head .reactions { margin-top: 10px; }
.chat-inline { flex: 1 1 auto; }
.chat-inline .chat-list { padding: 16px; gap: 14px; }
.chat-inline .chat-foot { background: var(--paper); border-top: 1px solid var(--border); padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
.chat-inline .chat-input-row input { border-radius: 22px; }
.chat-inline .send-btn { border-radius: 22px; }
.not-live { padding: 48px 24px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

/* ---------- Archive ---------- */
.archive { padding: 32px var(--gutter); display: flex; flex-direction: column; gap: 16px; }
.archive-head { display: flex; flex-direction: column; gap: 16px; }
.archive-head h2.display { font-size: 28px; }
.archive-tools { display: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.chip { height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--input); background: var(--white); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; flex-shrink: 0; }
.chip.on { background: var(--ink); color: var(--white); border-color: var(--ink); }
.month { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.month-head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.month-head h3 { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.month-head .rule { display: none; }
.walk-grid { display: flex; flex-direction: column; gap: 4px; }
.more { align-self: stretch; }
a.more { align-self: center; margin-top: 8px; }
@media (min-width: 1024px) {
  .archive { border-top: 1px solid var(--border); padding-top: 48px; padding-bottom: 64px; gap: 32px; }
  .archive-head { flex-direction: row; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
  .archive-head h2.display { font-size: 40px; }
  .archive-tools { display: flex; align-items: flex-end; gap: 16px; }
  .chips { display: none; }
  .jump { display: flex; flex-direction: column; gap: 6px; }
  .jump select { min-width: 200px; height: 44px; min-height: 44px; border-radius: 10px; }
  .segmented { display: flex; height: 44px; border: 1px solid var(--input); border-radius: 10px; overflow: hidden; background: var(--white); }
  .segmented a { padding: 0 16px; display: flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; }
  .segmented a.on { background: var(--ink); color: var(--white); }
  .month { gap: 20px; margin-top: 0; }
  .month-head { border-bottom: 0; padding-bottom: 0; gap: 14px; }
  .month-head h3 { font-size: 26px; }
  .month-head .rule { display: block; flex-grow: 1; height: 1px; background: var(--border); align-self: center; }
  .walk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
}

/* ---------- Walk cards ---------- */
.walk-card { text-decoration: none; color: var(--ink); display: flex; }
.walk-card .thumb { position: relative; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: var(--border); }
.walk-card .thumb .art { width: 100%; height: 100%; object-fit: cover; }
.walk-card .duration { position: absolute; right: 6px; bottom: 6px; background: rgba(20, 28, 24, 0.8); color: var(--white); font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.walk-card .thumb .badge { position: absolute; left: 6px; top: 6px; }
.walk-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.walk-card-title { font-size: 17px; font-weight: 600; line-height: 1.25; }
.walk-card .muted { font-size: 13px; }
.walk-card-grid, .walk-card-row { flex-direction: row; gap: 14px; align-items: center; min-height: 80px; }
.walk-card-grid .thumb, .walk-card-row .thumb { width: 128px; height: 72px; }
@media (min-width: 1024px) {
  .walk-card-grid { flex-direction: column; align-items: stretch; gap: 12px; }
  .walk-card-grid .thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--r-card); }
  .walk-card-grid .duration { right: 10px; bottom: 10px; font-size: 12px; padding: 4px 8px; border-radius: 6px; }
  .walk-card-grid .walk-card-title { font-family: var(--serif); font-size: 20px; line-height: 1.2; }
  .walk-card-grid .muted { font-size: 14px; }
  .walk-card-grid .eyebrow { font-size: 13px; }
  .walk-card-row { align-items: flex-start; gap: 12px; }
  .walk-card-row .thumb { border-radius: 8px; }
  .walk-card-row .walk-card-title { font-size: 16px; }
}

/* ---------- Watch (Desktop-Watch) ---------- */
.watch { padding: 16px var(--gutter) 48px; display: flex; flex-direction: column; gap: 20px; }
.crumbs { font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs a { font-weight: 600; }
.watch-grid { display: flex; flex-direction: column; gap: 32px; }
.watch-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.watch-head { display: flex; flex-direction: column; gap: 16px; }
.watch-head .muted { margin-top: 8px; }
.prevnext { display: flex; gap: 8px; flex-shrink: 0; }
.moments { display: flex; flex-direction: column; gap: 12px; }
.moments h2, .more h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.moment-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.moment { min-height: 56px; padding: 10px 14px; border-radius: var(--r-card); border: 1px solid var(--border); background: var(--paper); font-size: 15px; text-align: left; display: flex; align-items: center; gap: 14px; cursor: pointer; }
.moment-t { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--pine); min-width: 48px; }
aside.more { display: flex; flex-direction: column; gap: 16px; }
.see-all { font-size: 15px; font-weight: 600; margin-top: 4px; }
@media (min-width: 1024px) {
  .watch { padding-top: 28px; }
  .watch-grid { flex-direction: row; gap: 40px; align-items: flex-start; }
  .watch-main { flex: 1 1 auto; }
  .watch-head { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 24px; }
  .moment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  aside.more { width: 312px; flex-shrink: 0; }
}

/* ---------- Account & admin ---------- */
.narrow { max-width: 560px; margin: 0 auto; padding: 32px var(--gutter); }
.admin { padding: 24px var(--gutter) 64px; display: flex; flex-direction: column; gap: 20px; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-tabs a { height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--input); background: var(--white); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; }
.admin-tabs a.on { background: var(--ink); color: var(--white); border-color: var(--ink); }
.stepup-banner { background: #FFF4E5; border: 1px solid var(--marker); border-radius: var(--r-card); padding: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.stepup-banner p { margin: 0; }
.admin-preview { max-width: 720px; }
.crumb-back { font-weight: 600; font-size: 14px; }
.table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; display: block; overflow-x: auto; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: top; font-size: 14px; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.table code { font-size: 12px; overflow-wrap: anywhere; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.chat-admin li { background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
