/* Studiowyre. Tokens are Postwyre's (C:\dev\postwyre\app\globals.css,
   brand/tokens.md): shadcn neutral base, --brand moss on light and lime on
   dark, Inter, pills for everything clickable. Layout follows Postwyre's
   signed-in shell (w-56 sidebar, h-14 sticky header) and x-design-patterns. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-400-normal.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-600-normal.woff") format("woff");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --popover: oklch(1 0 0);
  --secondary: oklch(0.97 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.52 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --brand: #4a7300;
  --brand-foreground: #ffffff;
  --player: oklch(0.205 0 0);
  --shadow-pop: 0 4px 12px rgb(0 0 0 / 0.12), 0 0 2px rgb(0 0 0 / 0.12);
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.dark {
  color-scheme: dark;
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --popover: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --brand: #c6ef4a;
  --brand-foreground: oklch(0.145 0 0);
  --player: oklch(0.1 0 0);
  --shadow-pop: 0 4px 12px rgb(0 0 0 / 0.5), 0 0 2px rgb(0 0 0 / 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--background);
  color: var(--foreground);
  font: 400 15px/20px var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.icon.sm { width: 16px; height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted-foreground); }
.mono { font-family: var(--font-mono); font-size: 13px; }
.nums { font-variant-numeric: tabular-nums; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { display: none; }
.sidebar-inner { display: flex; flex-direction: column; height: 100%; }
.brand-row { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.brand-row a { display: flex; align-items: center; gap: 10px; min-height: 44px; transition: opacity .15s ease; }
.brand-row a:hover { opacity: .8; }
.logo { height: 20px; width: auto; flex: none; }
.logo .ink { fill: currentColor; }
.logo .accent { fill: var(--brand); }
.brand-lockup { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-lockup .mark { width: 24px; height: 24px; flex: none; display: block; } /* brand/suite/studiowyre.svg, the suite mark */
.wordmark { font-size: 17px; line-height: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--foreground); white-space: nowrap; }
.nav { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px; border-radius: 9999px; font-size: 14px; color: var(--muted-foreground); transition: background-color .2s ease, color .2s ease; }
.nav a:hover { background: var(--muted); color: var(--foreground); }
.nav a[aria-current="page"] { background: color-mix(in oklch, var(--brand) 10%, transparent); color: var(--brand); font-weight: 600; }
.nav .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 9999px; background: var(--brand); color: var(--brand-foreground); font-size: 12px; line-height: 22px; font-weight: 600; text-align: center; }
.side-foot { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 16px; color: var(--muted-foreground); min-height: 56px; }
.side-foot a:hover { color: var(--foreground); }
.dot { width: 8px; height: 8px; border-radius: 9999px; background: var(--muted-foreground); flex: none; }
.dot.on { background: var(--brand); }

.column { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--border); background: color-mix(in oklch, var(--background) 80%, transparent); backdrop-filter: blur(12px); }
.topbar .mobile-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar .spacer { flex: 1; }
main { flex: 1; min-width: 0; padding: 16px; }
.page { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }

/* Buttons: pills (Postwyre components/ui/button.tsx) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 9999px; border: 1px solid transparent; background: var(--brand); color: var(--brand-foreground); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color .2s ease, box-shadow .2s ease, opacity .2s ease; }
.btn:hover { background: color-mix(in oklch, var(--brand) 90%, transparent); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.outline { background: var(--background); color: var(--foreground); border-color: var(--border); }
.dark .btn.outline { background: color-mix(in oklch, var(--input) 30%, transparent); border-color: var(--input); }
.btn.outline:hover { background: var(--muted); }
.btn.ghost { background: transparent; color: var(--foreground); }
.btn.ghost:hover { background: var(--muted); }
.btn.block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 9999px; border: 0; background: transparent; color: var(--foreground); cursor: pointer; transition: background-color .2s ease; flex: none; }
.icon-btn:hover { background: var(--muted); }
.theme-toggle .moon, .dark .theme-toggle .sun { display: none; }
.dark .theme-toggle .moon { display: block; }

/* Pills used as toggles and filters (no native select, checkbox or radio) */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 9999px; border: 1px solid var(--border); background: var(--background); color: var(--muted-foreground); font-size: 14px; cursor: pointer; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.pill:hover { color: var(--foreground); background: var(--muted); }
.pill[aria-pressed="true"] { background: var(--foreground); border-color: var(--foreground); color: var(--background); font-weight: 600; }
.pill .n { font-size: 12px; opacity: .8; font-variant-numeric: tabular-nums; }
.pill:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 767px) { .pill { min-height: 44px; } }

/* Status chips (Postwyre STATUS_CLASS) */
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 9999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.needs_review { background: color-mix(in oklch, var(--brand) 12%, transparent); color: var(--brand); }
.chip.changes, .chip.in_progress { background: var(--muted); color: var(--muted-foreground); }
.chip.approved { background: color-mix(in oklch, var(--foreground) 10%, transparent); color: var(--foreground); }
.chip.sent { background: color-mix(in oklch, var(--foreground) 10%, transparent); color: var(--foreground); }
.chip.attention { background: color-mix(in oklch, var(--destructive) 10%, transparent); color: var(--destructive); }
:root:not(.dark) .chip.attention { color: oklch(0.505 0.213 27.518); } /* --destructive is 4.0:1 on its own tint; red-700 reads 5.4:1 */
.chip.test { border: 1px dashed color-mix(in oklch, var(--muted-foreground) 60%, transparent); color: var(--muted-foreground); }

/* Page header (Postwyre components/posting/page-header.tsx) */
.page-head { display: flex; flex-direction: column; gap: 12px; }
.page-head h1 { margin: 0; font-size: 20px; line-height: 24px; font-weight: 700; }
.page-head p { margin: 4px 0 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
@media (min-width: 640px) { .page-head { flex-direction: row; align-items: flex-end; justify-content: space-between; } }

/* Big number (one per screen, robinhood-design) */
.hero-num { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hero-num .big { font-size: 36px; line-height: 40px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.hero-num .label { font-size: 15px; color: var(--muted-foreground); }
.counts { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; line-height: 16px; color: var(--muted-foreground); }
.counts b { color: var(--foreground); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Sections and rows */
section > h2, .section-title { margin: 0 0 12px; font-size: 14px; line-height: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
section > h2 .n { color: var(--muted-foreground); font-weight: 400; font-variant-numeric: tabular-nums; }
.list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--card); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 72px; border-top: 1px solid var(--border); transition: background-color .2s ease; }
.row:first-child { border-top: 0; }
a.row:hover { background: color-mix(in oklch, var(--foreground) 3%, transparent); }
.thumb { width: 40px; height: 56px; border-radius: 8px; background: var(--player); overflow: hidden; flex: none; display: flex; align-items: center; justify-content: center; color: var(--muted-foreground); }
.thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.thumb.wide { width: 72px; height: 40px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-size: 13px; line-height: 16px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row .chev { color: var(--muted-foreground); }
.row .chip.inline { display: none; margin-top: 6px; }
@media (max-width: 559px) { .row .chip.side { display: none; } .row .chip.inline { display: inline-flex; } }

/* Cards */
.card { border: 1px solid var(--border); border-radius: 16px; background: var(--card); padding: 16px; min-width: 0; }
.card h3 { margin: 0; font-size: 15px; line-height: 20px; font-weight: 700; }
.card .sub { margin: 4px 0 0; font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tinted { border-radius: 16px; background: var(--muted); padding: 12px 16px; font-size: 14px; line-height: 20px; display: flex; gap: 12px; align-items: flex-start; }
.tinted.dashed { background: color-mix(in oklch, var(--muted) 40%, transparent); border: 1px dashed var(--border); }
.tinted .icon { margin-top: 1px; color: var(--muted-foreground); }

/* How it works flow (empty Home) */
.flow { display: grid; grid-template-columns: 1fr; gap: 8px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); min-width: 0; }
.step .num { width: 32px; height: 32px; border-radius: 9999px; background: var(--muted); display: flex; align-items: center; justify-content: center; flex: none; color: var(--foreground); }
.step.you .num { background: color-mix(in oklch, var(--brand) 12%, transparent); color: var(--brand); }
.step b { display: block; font-weight: 600; }
.step span { display: block; font-size: 13px; line-height: 18px; color: var(--muted-foreground); margin-top: 2px; }
.step code { font-family: var(--font-mono); font-size: 12px; background: var(--muted); padding: 1px 6px; border-radius: 6px; color: var(--foreground); overflow-wrap: anywhere; }
@media (min-width: 900px) { .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); } .step { flex-direction: column; } }

.empty { display: flex; flex-direction: column; gap: 8px; padding: 24px 0 8px; max-width: 520px; }
.empty h2 { margin: 0; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.01em; }
.empty p { margin: 0; color: var(--muted-foreground); }

/* Library grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; } }
.tile { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--card); min-width: 0; transition: border-color .2s ease; }
.tile:hover { border-color: color-mix(in oklch, var(--foreground) 25%, transparent); }
.tile .media { aspect-ratio: 4 / 5; background: var(--player); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tile .media video { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.tile .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile .t { font-weight: 600; font-size: 14px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .m { font-size: 13px; line-height: 16px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filters { display: flex; flex-direction: column; gap: 10px; }
.filters .label { font-size: 13px; line-height: 16px; color: var(--muted-foreground); }

/* Review */
.back { display: flex; align-items: center; gap: 8px; min-width: 0; }
.back h1 { margin: 0; font-size: 20px; line-height: 24px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Phones: player, then the decision, then the details. Desktop: decision in a sticky right column. */
.review { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "side" "details"; gap: 16px; align-items: start; }
.review .stage { grid-area: stage; }
.review .side { grid-area: side; }
.review .details { grid-area: details; }
@media (min-width: 1024px) { .review { grid-template-columns: minmax(0, 1fr) 400px; grid-template-areas: "stage side" "details side"; column-gap: 24px; } }
.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.tinted p, .tinted ol { margin-top: 0; margin-bottom: 0; }
.tinted b { display: block; }
.stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.player { background: var(--player); border-radius: 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0; }
.player video { display: block; max-width: 100%; max-height: min(72vh, 760px); background: #000; }
@media (min-width: 1024px) { .review .side { position: sticky; top: 72px; } }
.facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; line-height: 16px; color: var(--muted-foreground); }
.facts b { color: var(--foreground); font-weight: 600; }
.kv { display: flex; flex-direction: column; gap: 4px; }
.kv .k { font-size: 13px; line-height: 16px; color: var(--muted-foreground); }
.kv .v { white-space: pre-wrap; overflow-wrap: anywhere; }
.fit { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 16px; color: var(--muted-foreground); }
.fit.ok .icon { color: var(--brand); }
.fit.warn { color: var(--destructive); }
textarea.field { width: 100%; min-height: 96px; resize: vertical; border: 1px solid var(--input); border-radius: 12px; background: var(--background); padding: 10px 12px; font-size: 16px; line-height: 22px; }
@media (min-width: 768px) { textarea.field { font-size: 14px; line-height: 20px; } }
textarea.field:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 140px; }
.error { color: var(--destructive); font-size: 13px; line-height: 18px; }
.history { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.history li { display: flex; gap: 10px; font-size: 13px; line-height: 18px; }
.history .when { color: var(--muted-foreground); white-space: nowrap; }
.history .what { min-width: 0; overflow-wrap: anywhere; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--foreground); color: var(--background); padding: 10px 16px; border-radius: 9999px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-pop); z-index: 50; opacity: 0; transition: opacity .15s ease; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; }

/* Settings rows */
.settings-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-top: 1px solid var(--border); }
.settings-row:first-child { border-top: 0; }
.settings-row .icon { color: var(--muted-foreground); margin-top: 1px; }
.settings-row .t { font-weight: 600; overflow-wrap: anywhere; }
.card .sub.path { overflow-wrap: anywhere; }
.settings-row .d { font-size: 13px; line-height: 18px; color: var(--muted-foreground); margin-top: 2px; overflow-wrap: anywhere; }
ol.steps { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 20px; }

/* Menus and the phone nav sheet (one elevation step) */
.menu { position: absolute; right: 16px; top: 52px; min-width: 180px; padding: 6px; border-radius: 12px; background: var(--popover); border: 1px solid var(--border); box-shadow: var(--shadow-pop); z-index: 40; }
.menu button { display: flex; width: 100%; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 14px; text-align: left; }
.menu button:hover { background: var(--muted); }
.menu button[aria-checked="true"] { font-weight: 600; }
.mask { position: fixed; inset: 0; background: rgb(0 0 0 / .5); z-index: 30; }
.sheet { position: fixed; top: 0; bottom: 0; left: 0; width: 288px; max-width: 85vw; background: var(--background); border-right: 1px solid var(--border); z-index: 31; }
[hidden] { display: none !important; }
.page.narrow { max-width: 720px; }
a.link { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 768px) {
  .sidebar { display: block; position: sticky; top: 0; height: 100vh; width: 224px; flex: none; border-right: 1px solid var(--border); overflow-y: auto; }
  .topbar .menu-btn, .topbar .mobile-brand { display: none; }
  .topbar { padding: 0 24px; }
  main { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Date range calendar (Library). Opens under the Date pills; full width of
   the content column on phones, 320px from 640px up. */
.pills.dates { position: relative; }
.calendar { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: 100%; max-width: 320px; padding: 12px; border-radius: 12px; background: var(--popover); border: 1px solid var(--border); box-shadow: var(--shadow-pop); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-title { font-weight: 600; font-size: 14px; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--muted-foreground); padding: 4px 0; }
.cal-day { min-height: 40px; border: 0; border-radius: 9999px; background: transparent; cursor: pointer; font-size: 14px; font-variant-numeric: tabular-nums; }
.cal-day:hover { background: var(--muted); }
.cal-day[aria-current="date"] { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.cal-day[aria-pressed="true"] { background: var(--foreground); color: var(--background); }
.cal-day.blank { cursor: default; }
.calendar .sub { margin: 8px 0 0; }
@media (max-width: 767px) { .cal-day { min-height: 44px; } }

/* Moments: one card-row per moment. Phones stack the buttons full width. */
.player.wide video { width: 100%; max-height: min(56vh, 520px); }
.moments-note { margin: 0; font-size: 13px; line-height: 18px; }
.moment { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-top: 1px solid var(--border); min-width: 0; }
.moment:first-child { border-top: 0; }
.moment-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.moment-time { font-weight: 600; }
.moment-hook { font-size: 15px; line-height: 20px; overflow-wrap: anywhere; }
.row-meta.wrap { white-space: normal; }
.moment .sub { margin: 0; font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.moment-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.moment-actions .btn { flex: 1 1 140px; }
@media (min-width: 640px) { .moment-actions .btn { flex: 0 0 auto; } }
