:root {
  --canvas: #efe8da;
  --paper: #fffdf7;
  --ink: #27231f;
  --muted: #71695f;
  --aubergine: #4c294f;
  --aubergine-dark: #351d38;
  --brass: #b28645;
  --sage: #5f715f;
  --danger: #8a3b34;
  --line: #d8cdbb;
  --shadow: 0 12px 30px rgba(53, 29, 56, .10);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at top left, #faf4e8 0, var(--canvas) 46%, #e5dbc9 100%); font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 0; }
.topbar { display: flex; gap: 18px; align-items: center; padding: 22px clamp(18px, 4vw, 56px); background: rgba(255,253,247,.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); }
.topbar h1 { margin: 0; font-size: clamp(1.35rem, 3vw, 2.1rem); letter-spacing: -.03em; }
.topbar p { margin: 2px 0 0; color: var(--muted); }
.brandmark { width: 64px; height: 70px; border-radius: 48% 48% 43% 43%; background: #9d8d71; border: 3px dashed #6f604c; display: grid; grid-template-columns: 1fr 1fr; place-items: center; position: relative; box-shadow: inset 0 0 0 6px rgba(255,255,255,.18); flex: 0 0 auto; }
.brandmark .eye { width: 8px; height: 8px; border-radius: 50%; background: #201c19; margin-top: 8px; }
.brandmark .stitch { position: absolute; bottom: 8px; color: #efe1bd; background: var(--aubergine); border-radius: 7px; padding: 1px 7px 3px; font-weight: 800; }
.badge { margin-left: auto; padding: 7px 11px; border-radius: 999px; background: #ece4d5; color: var(--muted); font-size: .85rem; font-weight: 700; white-space: nowrap; }
.badge.ok { background: #dde8dc; color: #31513a; }
.tabs { display: flex; gap: 8px; padding: 12px clamp(18px, 4vw, 56px); overflow-x: auto; border-bottom: 1px solid var(--line); background: rgba(239,232,218,.9); position: sticky; top: 115px; z-index: 9; }
.tabs button { background: transparent; color: var(--muted); padding: 10px 16px; border-radius: 999px; font-weight: 800; white-space: nowrap; }
.tabs button.active { color: white; background: var(--aubergine); }
main { width: min(1240px, calc(100% - 30px)); margin: 28px auto 70px; }
.tab { display: none; }
.tab.active { display: block; }
.card { background: rgba(255,253,247,.96); border: 1px solid var(--line); border-radius: 18px; padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow); }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 24px; border-left: 8px solid var(--brass); }
.hero h2, .section-heading h2, .progress-card h2 { margin: 3px 0 8px; font-size: clamp(1.55rem, 3.5vw, 2.6rem); line-height: 1.08; letter-spacing: -.035em; }
.hero p { max-width: 760px; margin: 0; color: var(--muted); font-size: 1.08rem; }
.eyebrow { color: var(--aubergine); font-size: .74rem; letter-spacing: .14em; font-weight: 900; }
.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.talk-grid { grid-template-columns: minmax(0, 1.55fr) minmax(280px, .7fr); }
label { display: grid; gap: 7px; font-weight: 750; margin: 15px 0; }
input, textarea, select { width: 100%; background: #fff; color: var(--ink); border: 1px solid #cfc2ae; border-radius: 12px; padding: 12px 13px; outline: none; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--aubergine); box-shadow: 0 0 0 3px rgba(76,41,79,.13); }
fieldset { border: 1px solid var(--line); border-radius: 14px; margin: 16px 0; padding: 12px 14px; }
.check { display: inline-flex; grid-template-columns: auto 1fr; align-items: center; margin: 7px 14px 7px 0; font-weight: 650; }
.check input { width: auto; }
.primary, .secondary, .danger, .quiet { border-radius: 11px; padding: 10px 14px; font-weight: 850; }
.primary { color: #fff; background: var(--aubergine); }
.primary:hover { background: var(--aubergine-dark); }
.secondary { color: var(--aubergine); background: #ede3ee; }
.danger { color: #fff; background: var(--danger); }
.quiet { color: var(--ink); background: #eee7da; }
.quiet.active { color: #fff; background: var(--sage); }
.big { padding: 14px 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: 14px; }
.empty-state { color: var(--muted); text-align: center; padding: 30px; }
.engagement-item { display: flex; gap: 10px; align-items: stretch; border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: #fff; }
.engagement-open { flex: 1; min-width: 0; display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 8px; background: transparent; text-align: left; border-radius: 10px; }
.engagement-open:hover { background: #faf5eb; }
.engagement-item strong { display: block; }
.engagement-item small { color: var(--muted); }
.delete-draft, .draft-clear { color: #fff; background: var(--danger); border-radius: 10px; padding: 9px 12px; font-weight: 850; white-space: nowrap; }
.delete-draft:hover, .draft-clear:hover { filter: brightness(.92); }
.protected-mark { align-self: center; color: var(--sage); background: #e4ece2; border-radius: 999px; padding: 7px 10px; font-size: .75rem; font-weight: 850; white-space: nowrap; }
.saved-heading { gap: 12px; flex-wrap: wrap; }

.progress-card { margin-bottom: 22px; }
.progress { height: 10px; border-radius: 999px; background: #e6ddce; overflow: hidden; }
.progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--aubergine), var(--brass)); transition: width .25s ease; }
.progress-number { font-weight: 900; color: var(--aubergine); font-size: 1.2rem; }
.recording-box { border: 1px dashed var(--brass); padding: 14px; border-radius: 14px; background: #fffaf0; }
.recording-help { margin: 12px 0 8px; color: var(--muted); font-size: .9rem; }
.recording-takes { display: grid; gap: 10px; margin-top: 10px; }
.recording-takes.empty-takes { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; color: var(--muted); text-align: center; }
.recording-take { border: 1px solid var(--line); border-left: 5px solid var(--brass); border-radius: 12px; background: #fff; padding: 12px; }
.recording-take-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.recording-take-head strong, .recording-take-head small { display: block; }
.recording-take-head small { color: var(--muted); }
.recording-take audio { width: 100%; margin-top: 9px; }
.discard-take { color: #fff; background: var(--danger); border-radius: 10px; padding: 9px 12px; font-weight: 850; white-space: nowrap; }
.discard-take:hover { filter: brightness(.92); }
.discard-take:disabled { opacity: .6; cursor: wait; }
.source-mini { border-left: 4px solid var(--brass); padding: 10px 12px; background: #f8f2e7; border-radius: 8px; }
.source-mini small { display: block; color: var(--muted); }
.section-heading { margin: 10px 0 20px; }
.proposal-card { display: grid; gap: 12px; border-left: 7px solid var(--brass); }
.proposal-card.confirmed { border-left-color: var(--sage); }
.proposal-card.rejected { border-left-color: var(--danger); opacity: .78; }
.proposal-card.postponed, .proposal-card.shelved { border-left-color: #7f7464; }
.proposal-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font-size: .75rem; font-weight: 850; padding: 4px 8px; border-radius: 999px; background: #eee6d9; }
.pill.private { background: #eadfea; color: var(--aubergine); }
.proposal-card h3 { margin: 0; }
.proposal-card p { white-space: pre-wrap; margin: 0; }
.source-quote { color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; font-size: .92rem; }
.stats { margin-bottom: 22px; }
.stat { text-align: center; padding: 18px; }
.stat strong { display: block; font-size: 2rem; color: var(--aubergine); }
.stat span { color: var(--muted); }
.download-card { margin-bottom: 22px; border-top: 7px solid var(--aubergine); }
.lane-card h3 { margin-top: 0; color: var(--aubergine); }
.lane-card li { margin: 8px 0; }
.audit-block { overflow: auto; }
.audit-row { border-bottom: 1px solid var(--line); padding: 10px 0; }
.audit-row:last-child { border-bottom: 0; }
.audit-row code { font-size: .78rem; word-break: break-all; }
.plain { color: var(--muted); }
dialog { border: 0; border-radius: 18px; padding: 0; width: min(680px, calc(100% - 30px)); box-shadow: 0 25px 80px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(30,23,24,.62); }
.dialog-form { padding: 25px; background: var(--paper); }
.dialog-form h3 { margin-top: 0; }
#toast { position: fixed; right: 18px; bottom: 18px; max-width: 420px; background: var(--ink); color: white; padding: 13px 16px; border-radius: 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; z-index: 30; }
#toast.show { opacity: 1; transform: translateY(0); }
code { background: #eee5d7; padding: 3px 6px; border-radius: 6px; }
@media (max-width: 900px) {
  .topbar { align-items: flex-start; }
  .topbar p { display: none; }
  .badge { font-size: .7rem; }
  .tabs { top: 93px; }
  .grid.two, .talk-grid, .grid.four { grid-template-columns: 1fr; }
  .hero { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .brandmark { width: 48px; height: 54px; }
  .topbar { padding: 14px; }
  .tabs { top: 82px; padding: 9px 12px; }
  main { width: min(100% - 18px, 1240px); margin-top: 15px; }
  .row.between { align-items: flex-start; }
  .recording-take-head { align-items: stretch; flex-direction: column; }
  .discard-take { width: 100%; }
}

.recovery-note { margin: 12px 0 18px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; background: rgba(255,255,255,.55); }
.recovery-note strong { display: block; margin-bottom: 4px; }
.recovery-note p { margin: 0 0 10px; color: var(--muted); }
