/* BirdieBook web — app UI (Instagram/Facebook-style: desktop left sidebar,
   mobile bottom bar, content-first feed). Brand palette kept; dark mode kept. */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@1&family=Geist:wght@400;500;600;700;800&family=Geist+Mono:wght@400;500&display=swap');

:root, [data-theme="light"] {
  --fairway: oklch(0.30 0.05 150);
  --fairway-deep: oklch(0.22 0.05 150);
  --bg: oklch(0.97 0.008 90);
  --surface: #ffffff;
  --surface-2: oklch(0.95 0.01 90);
  --ink: oklch(0.18 0.012 150);
  --ink-soft: oklch(0.44 0.01 150);
  --ink-mute: oklch(0.60 0.006 150);
  --line: oklch(0.90 0.008 90);
  --line-strong: oklch(0.82 0.01 90);
  --citrus: oklch(0.84 0.18 95);
  --gold: oklch(0.66 0.11 82);
  --clay: oklch(0.62 0.17 30);
  --like: oklch(0.62 0.20 18);
  --nav-bg: rgba(250, 249, 244, 0.86);
  --poster-ink: #1a2e1f;
  --shadow: 0 1px 2px rgba(20,40,28,0.04), 0 12px 34px rgba(20,40,28,0.07);
  --shadow-lg: 0 4px 14px rgba(20,40,28,0.06), 0 30px 64px rgba(20,40,28,0.10);

  --font-ui: 'Geist', -apple-system, system-ui, sans-serif;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --r: 16px; --r-lg: 22px; --r-pill: 980px;
}
[data-theme="dark"] {
  --fairway: oklch(0.70 0.10 150);
  --fairway-deep: oklch(0.30 0.06 150);
  --bg: oklch(0.15 0.012 150);
  --surface: oklch(0.19 0.014 150);
  --surface-2: oklch(0.24 0.016 150);
  --ink: oklch(0.96 0.008 90);
  --ink-soft: oklch(0.78 0.01 150);
  --ink-mute: oklch(0.62 0.01 150);
  --line: oklch(0.30 0.012 150);
  --line-strong: oklch(0.40 0.014 150);
  --citrus: oklch(0.85 0.17 95);
  --gold: oklch(0.80 0.12 88);
  --clay: oklch(0.68 0.16 30);
  --like: oklch(0.68 0.20 18);
  --nav-bg: rgba(20, 28, 21, 0.86);
  --poster-ink: #14201a;
  --shadow: none;
  --shadow-lg: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-ui); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; line-height: 1.5; transition: background .25s, color .25s; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.018em; line-height: 1.15; text-wrap: balance; }
.muted { color: var(--ink-mute); } .soft { color: var(--ink-soft); }
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-display); font-style: italic; }
button { font-family: inherit; }

/* ---------------- App shell ---------------- */
.app { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; align-self: start; display: flex; flex-direction: column; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.s-logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; font-family: var(--font-display); font-style: italic; font-size: 25px; }
.s-logo .mark { width: 30px; height: 30px; border-radius: 50%; background: var(--fairway-deep); display: grid; place-items: center; flex-shrink: 0; }
.s-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.s-item { display: flex; align-items: center; gap: 15px; padding: 12px 12px; border-radius: 12px; border: none; background: none; cursor: pointer; color: var(--ink); font-size: 16px; font-weight: 500; width: 100%; text-align: left; transition: background .14s; }
.s-item svg { width: 24px; height: 24px; flex-shrink: 0; }
.s-item:hover { background: var(--surface-2); }
.s-item.active { font-weight: 700; background: var(--surface-2); }
.s-item.active svg { stroke-width: 2.3; color: var(--fairway); }
.s-item.create { color: var(--fairway); }
.s-foot { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.feedcol { width: 100%; max-width: 620px; margin: 0 auto; padding: 32px 16px 120px; }
.widecol { width: 100%; max-width: 980px; margin: 0 auto; padding: 36px 22px 120px; }

/* mobile bars */
.topbar { display: none; align-items: center; justify-content: space-between; padding: 10px 16px; position: sticky; top: 0; z-index: 40; background: var(--nav-bg); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); border-bottom: 1px solid var(--line); }
.topbar .s-logo { padding: 0; font-size: 22px; }
.bottombar { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--nav-bg); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px)); justify-content: space-around; }
.b-item { background: none; border: none; cursor: pointer; color: var(--ink); padding: 8px; border-radius: 12px; display: grid; place-items: center; flex: 1; }
.b-item svg { width: 26px; height: 26px; }
.b-item.active svg { stroke-width: 2.4; color: var(--fairway); }
.b-create svg { width: 30px; height: 30px; color: var(--fairway); }

/* ---------------- buttons / tags ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 14px; font-weight: 600; padding: 10px 18px; border-radius: var(--r-pill); border: none; cursor: pointer; transition: transform .12s ease, background .15s, box-shadow .15s, filter .15s, opacity .15s; white-space: nowrap; }
.btn:active { transform: scale(0.97); } .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--fairway-deep); color: oklch(0.97 0.01 90); box-shadow: 0 1px 2px rgba(20,40,28,0.14), 0 6px 18px rgba(20,40,28,0.12); }
.btn-primary:hover:not(:disabled) { background: var(--fairway); transform: translateY(-1px); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover { background: var(--line); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); }
.tag.fairway { background: color-mix(in srgb, var(--fairway) 16%, transparent); color: var(--fairway); }
.tag.clay { background: color-mix(in srgb, var(--clay) 18%, transparent); color: var(--clay); }

/* ---------------- avatar ---------------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; background: linear-gradient(135deg, var(--fairway), var(--fairway-deep)); }
.avatar.lg { width: 84px; height: 84px; font-size: 30px; }

/* ---------------- feed post ---------------- */
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 22px; overflow: hidden; box-shadow: var(--shadow); }
.post-head { display: flex; align-items: center; gap: 11px; padding: 12px 14px; }
.post-head .handle { font-weight: 700; font-size: 14px; }
.post-head .time { color: var(--ink-mute); font-size: 12px; }
.post-del { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--ink-mute); padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.post-del:hover { color: var(--clay); background: var(--surface-2); }
.cbubble { position: relative; }
.cbubble .cb-del, .cmt .cb-del { opacity: 0; background: none; border: none; cursor: pointer; color: var(--ink-mute); padding: 4px; border-radius: 6px; align-self: center; margin-left: auto; flex-shrink: 0; }
.cbubble:hover .cb-del, .cmt:hover .cb-del { opacity: 1; }
.cb-del:hover { color: var(--clay); }
@media (hover: none) { .cbubble .cb-del, .cmt .cb-del { opacity: 1; } }
.post-media { position: relative; background: #000; }
.post-media video, .post-media .poster { width: 100%; display: block; }
.post-media canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.like-burst { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.like-burst svg { width: 92px; height: 92px; color: #fff; filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4)); opacity: 0; }
.like-burst.go svg { animation: likepop .9s ease; }
@keyframes likepop { 0% { opacity: 0; transform: scale(0.4); } 15% { opacity: 0.95; transform: scale(1.1); } 30% { transform: scale(0.95); } 45% { transform: scale(1); } 80% { opacity: 0.95; } 100% { opacity: 0; transform: scale(1); } }
/* the author's own text — prominent, sits right under the header */
.post-body { padding: 2px 16px 12px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
/* reaction summary pills, between media and the action bar */
.reactions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; }
.reactions:empty { display: none; }
/* labeled action bar with a hairline above (Facebook-style) */
.post-actions { display: flex; align-items: center; gap: 4px; padding: 4px 8px; margin: 0 8px; border-top: 1px solid var(--line); }
.act { flex: 1; background: none; border: none; cursor: pointer; color: var(--ink-soft); padding: 9px 6px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 14px; font-weight: 600; transition: background .12s, color .12s; }
.act span { line-height: 1; }
.act:hover { background: var(--surface-2); color: var(--ink); }
.act.act-icon { flex: 0 0 auto; }
.act.saved { color: var(--fairway); } .act.saved svg { fill: var(--fairway); stroke: var(--fairway); }
/* comments — distinct grey bubbles, clearly not the post body */
.post-cmt { padding: 4px 14px 0; display: flex; flex-direction: column; gap: 8px; }
.post-cmt .more { color: var(--ink-mute); font-size: 13px; font-weight: 600; cursor: pointer; }
.cbubble { display: flex; gap: 8px; align-items: flex-start; }
.cbubble .avatar { width: 30px; height: 30px; font-size: 12px; }
.cb-body { background: var(--surface-2); border-radius: 16px; padding: 8px 12px; font-size: 14px; line-height: 1.4; }
.cb-name { font-weight: 700; display: block; font-size: 13px; }
.post-foot { padding: 10px 14px 14px; }

/* ---------------- stories rail ---------------- */
.stories { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 20px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; flex-shrink: 0; width: 68px; }
.story .ring { width: 64px; height: 64px; border-radius: 50%; padding: 3px; background: linear-gradient(135deg, var(--citrus), var(--fairway)); display: grid; place-items: center; }
.story .ring .avatar { width: 100%; height: 100%; border: 2px solid var(--surface); }
.story .s-label { font-size: 11px; color: var(--ink-soft); max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- composer / dropzone ---------------- */
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--r-lg); padding: 44px 24px; text-align: center; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--fairway); background: var(--surface-2); }
.dz-badge { width: 60px; height: 60px; border-radius: 18px; background: var(--fairway-deep); display: grid; place-items: center; margin: 0 auto 16px; color: var(--citrus); }
.dz-badge svg { width: 28px; height: 28px; }
.field-label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-mute); margin: 18px 0 8px; text-transform: uppercase; letter-spacing: 0.05em; }
select, textarea, input[type=text], input[type=password] { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); font-family: var(--font-ui); font-size: 15px; background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
select:focus, textarea:focus, input[type=text]:focus, input[type=password]:focus { outline: none; border-color: var(--fairway); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fairway) 18%, transparent); }
select:focus, textarea:focus, input[type=text]:focus { outline: none; border-color: var(--fairway); }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg button { font-size: 13px; font-weight: 600; padding: 9px 15px; border-radius: 999px; cursor: pointer; background: var(--surface-2); color: var(--ink-soft); border: none; }
.seg button.active { background: var(--fairway-deep); color: oklch(0.97 0.01 90); }
.video-wrap { position: relative; width: 100%; background: #000; border-radius: var(--r); overflow: hidden; }
.video-wrap video { width: 100%; } .video-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }

/* ---------------- cards / sections ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card.pad { padding: 22px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 36px 0 16px; }
.sec-head h2 { font-size: 21px; letter-spacing: -0.015em; }
/* Landing: editorial section rhythm — a gold mono eyebrow above a larger heading. */
.sec-head.lg { flex-direction: column; align-items: flex-start; gap: 5px; margin: 50px 0 20px; }
.sec-head.lg h2 { font-size: 27px; letter-spacing: -0.02em; text-wrap: balance; }
.sec-eyebrow { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--gold); }
.sec-head .link { color: var(--fairway); font-weight: 600; font-size: 14px; cursor: pointer; }
.h-title { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 32px; letter-spacing: -0.01em; margin-bottom: 4px; }
.h-sub { color: var(--ink-soft); font-size: 15px; line-height: 1.5; }

/* explore grid */
.tilegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { position: relative; aspect-ratio: 1; overflow: hidden; cursor: pointer; background: var(--poster-ink); border-radius: 14px; transition: transform .12s; }
.tile:hover { transform: translateY(-2px); }
.tile .poster, .tile video { width: 100%; height: 100%; object-fit: cover; }
.tile .tlabel { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px; background: linear-gradient(transparent, rgba(0,0,0,0.65)); color: #fff; font-size: 12px; font-weight: 600; }
.cardgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

/* profile */
.profile-head { display: flex; align-items: center; gap: 26px; padding: 14px 0 22px; }
.pstats { display: flex; gap: 28px; }
.pstat b { font-size: 19px; } .pstat span { color: var(--ink-mute); font-size: 13px; display: block; }

/* learning path stepper */
.step { position: relative; padding: 0 0 20px 40px; }
.step::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child { padding-bottom: 0; } .step:last-child::before { display: none; }
.step-num { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--fairway-deep); color: var(--citrus); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.step h4 { font-size: 16px; margin: 3px 0 6px; }
.drill-chip { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin-top: 8px; }
.checkpoint { display: flex; gap: 7px; align-items: flex-start; color: var(--fairway); font-size: 13px; font-weight: 600; margin-top: 10px; }
.checkpoint svg { width: 16px; flex-shrink: 0; }

/* coach insight (inside create result) */
.insight { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; background: var(--surface); box-shadow: var(--shadow); }
.coach-star { width: 30px; height: 30px; border-radius: 50%; background: var(--fairway-deep); color: var(--citrus); display: grid; place-items: center; flex-shrink: 0; }
.cand { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.cand:first-of-type { border-top: none; }
.cand .evidence { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.cand .conf { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); }

/* list / inbox */
.row-item { display: flex; gap: 13px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 10px; cursor: pointer; transition: border-color .14s, transform .12s; }
.row-item:hover { border-color: var(--fairway); transform: translateY(-1px); }
.thumb { width: 72px; height: 50px; border-radius: 9px; background: var(--poster-ink); object-fit: cover; flex-shrink: 0; }

/* empty / skeleton */
.empty { text-align: center; padding: 56px 20px; color: var(--ink-mute); }
.empty .e-badge { width: 64px; height: 64px; border-radius: 20px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 16px; }
.empty .e-badge svg { width: 30px; height: 30px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 12px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(125,125,125,0.12), transparent); }
@media (prefers-reduced-motion: no-preference) { .skeleton::after { animation: shimmer 1.4s infinite; } }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* analysis video player — hovering overlay controls + draw palette */
.vp { position: relative; background: #000; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.vp video { width: 100%; display: block; }
.vp canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; z-index: 2; }
.vp .vp-skel { pointer-events: none; z-index: 1; }
.vp-pill { position: absolute; top: 10px; right: 10px; z-index: 4; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: rgba(0,0,0,0.5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; border: none; cursor: pointer; font-size: 13px; font-weight: 700; }
.vp-pill.on { background: #32ade6; color: #06283a; box-shadow: 0 2px 10px rgba(50,173,230,0.45); }
.vp-pill svg { width: 16px; height: 16px; }
.vp-palette { position: absolute; top: 52px; right: 10px; z-index: 4; display: none; flex-direction: column; gap: 6px; padding: 8px; border-radius: 16px; background: rgba(0,0,0,0.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); max-height: calc(100% - 62px); overflow-y: auto; scrollbar-width: none; }
.vp-palette::-webkit-scrollbar { display: none; }
.vp-palette.open { display: flex; }
.vp-tool { width: 42px; height: 42px; border-radius: 11px; border: none; cursor: pointer; background: rgba(255,255,255,0.14); color: #fff; display: grid; place-items: center; }
.vp-tool svg { width: 20px; height: 20px; }
.vp-tool.active { background: rgba(255,204,0,0.22); color: #ffcc00; box-shadow: inset 0 0 0 1.5px rgba(255,204,0,0.65); }
.vp-tool.sep { margin-top: 4px; border-top: 1px solid rgba(255,255,255,0.15); border-radius: 0 0 11px 11px; padding-top: 4px; }
.vp-tool.danger:hover { background: rgba(220,70,50,0.85); }
.vp-tool.done { color: #32ade6; }
.vp-tool.done:hover { background: rgba(50,173,230,0.22); }
.vp-swatches { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100px; padding: 6px 2px 2px; margin-top: 4px; border-top: 1px solid rgba(255,255,255,0.15); }
.vp-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.4); cursor: pointer; padding: 0; }
.vp-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,0.45); }
.vp-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 28px 12px 10px; background: linear-gradient(transparent, rgba(0,0,0,0.7)); display: flex; flex-direction: column; gap: 8px; }
.vp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #fff; }
.vp-ob { width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer; background: rgba(255,255,255,0.16); color: #fff; display: grid; place-items: center; }
.vp-ob svg { width: 18px; height: 18px; }
.vp-ob.txt { width: auto; padding: 0 12px; border-radius: 18px; font-size: 13px; font-weight: 700; }
.vp-ob.on { background: var(--citrus); color: #1a2e1f; }
.vp-time { font-family: var(--font-mono); font-size: 12px; margin-left: auto; color: #fff; }
.vp-scrub { width: 100%; accent-color: var(--citrus); cursor: pointer; }
.vp-trimrow { display: flex; gap: 6px; }
.vp-trimbtn { font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 9px; border: none; cursor: pointer; background: rgba(255,255,255,0.16); color: #fff; }
.vp-trimtrack { position: relative; height: 3px; background: rgba(255,255,255,0.28); border-radius: 2px; }
.vp-trimtrack .reg { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; background: var(--citrus); border-radius: 2px; }
.angle-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.05em; margin: 4px 2px 8px; min-height: 24px; }
.angle-edit { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: none; border-radius: 6px; cursor: pointer; background: transparent; color: var(--ink-mute); }
.angle-edit:hover { background: rgba(127,127,127,0.18); color: var(--ink); }
.angle-edit svg { width: 12px; height: 12px; }
.angle-label .seg { text-transform: none; }

/* side-by-side dual angle */
.dual { display: grid; gap: 14px; }
@media (min-width: 980px) { .dual.two { grid-template-columns: 1fr 1fr; align-items: start; } }
/* Single clip: fit the player to the viewport so a portrait video isn't taller
   than the screen. The wrap shrinks to the video so the draw canvas stays aligned. */
.dual:not(.two) .vp { width: fit-content; max-width: 100%; margin: 0 auto; }
.dual:not(.two) .vp video { width: auto; max-width: 100%; max-height: 72vh; }
/* Narrow screens: shrink the floating draw palette so it overlaps less of the clip */
@media (max-width: 560px) {
  .vp-palette { top: 48px; right: 8px; gap: 5px; padding: 6px; }
  .vp-tool { width: 36px; height: 36px; border-radius: 9px; }
  .vp-tool svg { width: 17px; height: 17px; }
  .vp-swatches { max-width: 84px; gap: 5px; }
  .vp-swatch { width: 19px; height: 19px; }
}
.modal-card.wide { max-width: 1000px; }
.modal-card.huge { max-width: min(1200px, 96vw); padding: 14px; }
.vp.enlarged { margin: 0 auto; }

/* poster (placeholder media) */
.poster { position: relative; overflow: hidden; background: var(--poster-ink); }
.poster .grain { position: absolute; inset: 0; background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,0.03) 0 8px, transparent 8px 16px); }

/* sheets / modal */
.sheet-scrim, .modal { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 25, 18, 0.5); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); display: flex; }
.modal { align-items: center; justify-content: center; padding: 20px; }
.modal.hidden, .sheet-scrim.hidden { display: none; }
.modal-card { background: var(--surface); border-radius: 22px; max-width: 640px; width: 100%; padding: 26px; position: relative; max-height: 88vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,0.35); }
.sheet-scrim { align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; max-height: 80vh; display: flex; flex-direction: column; }
@media (min-width: 720px) { .sheet-scrim { align-items: center; } .sheet { border-radius: 22px; max-height: 70vh; } }
.sheet-head { padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.sheet-body { overflow: auto; padding: 12px 18px; flex: 1; }
.sheet-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.cmt { display: flex; gap: 10px; padding: 10px 0; }
.cmt .ctxt { font-size: 14px; } .cmt .ctxt .handle { font-weight: 700; margin-right: 6px; }
.icon-x { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); border: none; cursor: pointer; color: var(--ink-soft); display: grid; place-items: center; }
@media (prefers-reduced-motion: no-preference) { .modal:not(.hidden) .modal-card, .sheet-scrim:not(.hidden) .sheet { animation: rise .22s cubic-bezier(0.2,0.8,0.2,1); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* toast */
.bb-toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--fairway-deep); color: oklch(0.97 0.01 90); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 1100; opacity: 0; pointer-events: none; transition: all .25s; display: flex; gap: 9px; align-items: center; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.bb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 901px) { .bb-toast { bottom: 28px; } }

.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.35); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) { .view-enter { animation: viewIn .28s cubic-bezier(0.2,0.8,0.2,1); } }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------------- responsive ---------------- */
.mobile-only { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { display: flex; }
  .bottombar { display: flex; }
  .feedcol, .widecol { padding-bottom: 96px; }
  .cardgrid { grid-template-columns: 1fr; }
  .mobile-only { display: inline-flex; }
}

/* ---- identity (sidebar foot / topbar) ---- */
img.avatar { object-fit: cover; }
.ident { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-width: 0; }
.ident-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ident-role { font-size: 12px; color: var(--ink-mute); text-transform: capitalize; }

/* ---- admin ---- */
.admin-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, transform .12s; }
.admin-card:hover { border-color: var(--fairway); transform: translateY(-2px); }
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.role-sel { width: auto; min-width: 110px; padding: 7px 10px; font-size: 13px; flex-shrink: 0; }
@media (max-width: 720px) { .admin-cards { grid-template-columns: 1fr; } }

/* ---- fault matrix editor ---- */
.matrix-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table.matrix { border-collapse: collapse; width: 100%; }
table.matrix th, table.matrix td { border: 1px solid var(--line); padding: 6px; vertical-align: top; text-align: left; }
table.matrix thead th { background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.mx-corner { min-width: 200px; font-weight: 800; }
.mx-faultcell { min-width: 200px; background: var(--surface-2); }
.mx-head { display: flex; align-items: center; gap: 4px; }
.mx-head-input { font-weight: 700; font-size: 13px; padding: 6px 8px; border-color: transparent; background: transparent; }
.mx-head-input:hover, .mx-head-input:focus { border-color: var(--line-strong); background: var(--surface); }
.mx-code { font-size: 11px; color: var(--ink-mute); margin-top: 3px; padding-left: 8px; }
.mx-cell { min-width: 170px; font-size: 13px; padding: 7px 9px; resize: vertical; }
.mx-del { background: none; border: none; cursor: pointer; color: var(--ink-mute); padding: 4px; border-radius: 6px; flex-shrink: 0; display: grid; place-items: center; }
.mx-del:hover { color: var(--clay); background: var(--surface); }
.mx-rec-h, .mx-rec { min-width: 200px; }
.rec-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.rec-chip { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--fairway) 16%, transparent); color: var(--fairway); }

/* ---- recommendations + article reader ---- */
.rec-list { display: flex; flex-direction: column; gap: 8px; }
.rec-item { text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; cursor: pointer; color: var(--ink); }
.rec-item:hover { border-color: var(--fairway); }
.article-body { line-height: 1.7; font-size: 16px; }
.article-body h1 { font-size: 28px; margin: 0 0 10px; }
.article-body h2 { font-size: 22px; margin: 22px 0 8px; }
.article-body h3 { font-size: 18px; margin: 18px 0 6px; }
.article-body p { margin: 0 0 12px; }
.article-body ul { margin: 0 0 12px; padding-left: 22px; }
.article-body li { margin: 3px 0; }
.article-body img { display: block; }
.wikilink { color: var(--fairway); font-weight: 600; text-decoration: underline; text-decoration-style: dotted; cursor: pointer; }
.wikilink.broken { color: var(--clay); cursor: default; text-decoration: none; }
.tutor-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.tutor-thread:empty { display: none; }
.bubble { padding: 10px 13px; border-radius: 14px; font-size: 15px; line-height: 1.6; max-width: 92%; }
.bubble.user { align-self: flex-end; background: var(--fairway-deep); color: oklch(0.97 0.01 90); border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.assistant p { margin: 0 0 8px; } .bubble.assistant p:last-child { margin-bottom: 0; }
.bubble.assistant ul { margin: 4px 0; padding-left: 20px; }
.tutor-src { margin-top: 10px; font-size: 13px; color: var(--ink-mute); }
.tutor-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { font-size: 13px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--fairway); background: var(--surface-2); }

/* notifications */
.notif-badge { position: absolute; top: 4px; left: 24px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--clay); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.b-item .notif-badge { top: 2px; left: 22px; }
.notif-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.notif { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; color: var(--ink); }
.notif:hover { border-color: var(--fairway); }
.notif.unread { border-left: 3px solid var(--fairway); background: var(--surface-2); }

/* filming tips */
.tips { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--fairway) 8%, var(--surface-2)); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }
.tips-ic { color: var(--fairway); flex-shrink: 0; margin-top: 1px; }
.tips b { color: var(--ink); }

/* journey progress strip */
.jrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.jpill { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.jpill.ok { background: color-mix(in srgb, var(--fairway) 16%, transparent); color: var(--fairway); }
.jpill.fault { background: color-mix(in srgb, var(--clay) 16%, transparent); color: var(--clay); }

/* emoji reactions (Slack-style) — layout of .reactions defined in the feed section */
.rx { font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; line-height: 1.4; transition: border-color .12s, background .12s; }
.rx:hover { border-color: var(--fairway); }
.rx.mine { background: color-mix(in srgb, var(--fairway) 14%, transparent); border-color: var(--fairway); color: var(--fairway); font-weight: 700; }
.rx-add { display: inline-grid; place-items: center; color: var(--ink-mute); padding: 5px 9px; }
.emoji-pop { width: 100%; max-width: 360px; }
.emoji-search { margin-bottom: 10px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 300px; overflow-y: auto; }
.emoji-b { font-size: 22px; padding: 6px 0; border: none; background: none; border-radius: 10px; cursor: pointer; }
.emoji-b:hover { background: var(--surface-2); }
.composer .post-img, .composer-prev img, .composer-prev video { width: 100%; border-radius: 12px; margin-top: 10px; max-height: 320px; object-fit: cover; }
.post-img { width: 100%; display: block; }

/* stories rail additions */
.story .ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--surface); }
.ring.add { background: var(--surface-2) !important; color: var(--fairway); border: 1px dashed var(--line-strong); }
.ring.live { background: linear-gradient(135deg, var(--citrus), var(--fairway)); }

/* story viewer */
.story-viewer { position: relative; width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 9 / 16; max-height: 82vh; background: #000; border-radius: 16px; overflow: hidden; }
.story-bars { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 3; display: flex; gap: 4px; }
.sbar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.35); }
.sbar.done, .sbar.active { background: #fff; }
.story-vhead { position: absolute; top: 20px; left: 12px; right: 12px; z-index: 3; display: flex; align-items: center; gap: 8px; color: #fff; }
.story-vhead img, .story-vhead .avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.story-vmedia { position: absolute; inset: 0; display: grid; place-items: center; background: #000; }
.story-vmedia img, .story-vmedia video { width: 100%; height: 100%; object-fit: contain; }
.story-vcap { position: absolute; bottom: 16px; left: 16px; right: 16px; z-index: 3; color: #fff; text-align: center; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.story-zone { position: absolute; top: 0; bottom: 0; z-index: 2; cursor: pointer; }
.story-zone.left { left: 0; width: 35%; }
.story-zone.right { right: 0; width: 65%; }
.story-close { position: absolute; top: 14px; right: 10px; z-index: 4; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; }

/* Instagram-style profile header */
.pf-header { display: flex; align-items: center; gap: 24px; padding: 8px 0 6px; }
.pf-av { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-weight: 800; font-size: 32px; color: #fff; background: linear-gradient(135deg, var(--fairway), var(--fairway-deep)); flex-shrink: 0; }
.pf-main { flex: 1; min-width: 0; }
.pf-name { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.pf-stats { display: flex; gap: 26px; margin: 12px 0; }
.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) { .pf-header { gap: 16px; } .pf-av { width: 72px; height: 72px; font-size: 26px; } .pf-name { font-size: 20px; } }

/* in-browser capture */
.capture video { width: 100%; max-height: 70vh; border-radius: 14px; background: #000; }
.capture-bar { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.btn.recording { background: var(--clay); animation: recpulse 1.2s infinite; }
@keyframes recpulse { 0%,100% { opacity: 1; } 50% { opacity: .72; } }

/* ---- landing / learn (logged out) ---- */
.landing-hero {
  position: relative; min-height: 480px; display: flex; align-items: flex-end;
  padding: 46px; margin-top: 6px; border-radius: 26px; overflow: hidden; color: #fff;
  background-image:
    linear-gradient(90deg, rgba(16,30,22,.94) 0%, rgba(16,30,22,.74) 40%, rgba(16,30,22,.30) 72%, rgba(16,30,22,.10) 100%),
    linear-gradient(0deg, rgba(16,30,22,.55) 0%, transparent 42%),
    url("https://media.birdiebook.golf/assets/hero-golf.jpg");
  background-size: cover; background-position: center 32%;
  box-shadow: var(--shadow-lg);
}
.lh-copy { position: relative; max-width: 600px; }
.lh-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.16); padding: 6px 12px; border-radius: 999px; }
.landing-hero h1 { font-size: 48px; line-height: 1.03; letter-spacing: -0.025em; margin: 18px 0 14px; font-weight: 800; }
.lh-accent { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--citrus); }
.landing-hero p { color: rgba(255,255,255,.9); font-size: 17px; line-height: 1.55; max-width: 520px; margin: 0; }
.lh-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.lh-trust { margin-top: 14px; font-size: 13px; color: rgba(255,255,255,.75); }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.landing-hero .btn:not(.btn-ghost) { background: #fff; color: var(--fairway-deep); }
.landing-hero .btn:not(.btn-ghost):hover { background: rgba(255,255,255,.88); }
.landing-hero .btn-ghost { color: #fff; background: transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.landing-hero .btn-ghost:hover { background: rgba(255,255,255,.12); }
.lh-visual { display: grid; place-items: center; }
.lh-card { width: 100%; max-width: 300px; background: var(--surface); color: var(--ink); border-radius: 18px; padding: 14px; box-shadow: 0 26px 55px rgba(0,0,0,.30); transform: rotate(-2deg); }
.lh-frame { position: relative; height: 152px; border-radius: 12px; display: grid; place-items: center; color: rgba(255,255,255,.85); background: linear-gradient(135deg, oklch(0.52 0.06 150), oklch(0.30 0.05 150)); }
.lh-tag { position: absolute; bottom: 8px; left: 8px; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px; background: var(--clay); color: #fff; }
.lh-focus { font-size: 14px; margin-top: 12px; }
.lh-read { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fairway); font-weight: 600; margin-top: 8px; }

.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); transition: transform .12s, border-color .15s; }
.feat-card:hover { transform: translateY(-2px); border-color: var(--fairway); }
.feat-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--fairway), var(--fairway-deep)); }

.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.how-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 18px; text-align: center; box-shadow: var(--shadow); }
.how-ic { width: 46px; height: 46px; border-radius: 13px; background: color-mix(in srgb, var(--fairway) 12%, var(--surface-2)); color: var(--fairway); display: grid; place-items: center; margin: 0 auto; }
.landing-foot { text-align: center; background: linear-gradient(135deg, color-mix(in srgb, var(--fairway) 10%, var(--surface-2)), var(--surface-2)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 34px 20px; margin-top: 28px; }
.landing-foot h3 { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 30px; letter-spacing: -0.01em; margin: 0 0 8px; }
@media (max-width: 860px) {
  .landing-hero {
    min-height: 420px; padding: 28px 22px;
    background-image:
      linear-gradient(0deg, rgba(16,30,22,.95) 0%, rgba(16,30,22,.55) 46%, rgba(16,30,22,.30) 100%),
      url("https://media.birdiebook.golf/assets/hero-golf.jpg");
    background-position: center 26%;
  }
  .landing-hero h1 { font-size: 32px; }
  .feat-grid, .how-grid { grid-template-columns: 1fr; }
}
/* ---- pricing ---- */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.price-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 22px; box-shadow: var(--shadow); }
.price-card.featured { border-color: var(--fairway); box-shadow: var(--shadow-lg); }
.price-badge { position: absolute; top: -11px; left: 22px; background: var(--fairway-deep); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.price-name { font-weight: 700; font-size: 15px; color: var(--ink-soft); }
.price-amt { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 2px; }
.price-amt span { font-size: 15px; font-weight: 600; color: var(--ink-mute); }
.price-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.price-feats li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.price-feats svg { color: var(--fairway); flex-shrink: 0; margin-top: 2px; }
@media (max-width: 860px) { .price-grid { grid-template-columns: 1fr; } }

/* scroll-in reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.22,.61,.36,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
