:root {
  --navy: #142c42;
  --navy-2: #0d2031;
  --paper: #fffdf8;
  --cream: #f7f1e5;
  --gold: #f5b63c;
  --coral: #e95f55;
  --sky: #4faad4;
  --mint: #61b998;
  --ink: #172433;
  --muted: #5d6973;
  --line: rgba(20, 44, 66, .14);
  --shadow: 0 24px 70px rgba(20, 44, 66, .14);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: "DM Sans", system-ui, sans-serif; font-size: 16px; line-height: 1.55; }
body::before { content: ""; position: fixed; inset: 0; z-index: 10; pointer-events: none; opacity: .025; background-image: radial-gradient(var(--navy) .7px, transparent .7px); background-size: 10px 10px; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: fixed; left: 10px; top: 10px; z-index: 100; transform: translateY(-150%); padding: 10px 16px; border-radius: 8px; color: #fff; background: var(--navy); }
.skip-link:focus { transform: translateY(0); }
header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(255, 253, 248, .92); backdrop-filter: blur(14px); }
.nav { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: var(--navy); background: var(--gold); border-radius: 13px; font-weight: 800; letter-spacing: -.05em; }
.brand-text { display: grid; line-height: 1.12; }
.brand-text strong, h1, h2 { font-family: "Fraunces", Georgia, serif; }
.brand-text span { margin-top: 3px; color: var(--muted); font-size: .76rem; letter-spacing: .09em; text-transform: uppercase; }
.nav-actions { display: flex; align-items: center; gap: 18px; font-weight: 700; }
.nav-actions > a { text-decoration: none; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; border: 0; border-radius: 999px; color: #fff; background: var(--navy); box-shadow: 0 9px 24px rgba(20,44,66,.18); font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.button:hover { transform: translateY(-2px); box-shadow: 0 13px 30px rgba(20,44,66,.24); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }
.button.gold { color: var(--navy); background: var(--gold); }
.button.light { color: var(--navy); background: #fff; box-shadow: none; }
.button.ghost { color: var(--navy); background: transparent; border: 1px solid var(--line); box-shadow: none; }
.button.compact { min-height: 40px; padding-inline: 16px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.eyebrow, .kicker { color: var(--coral); font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.auth-stage { min-height: calc(100vh - 130px); display: grid; grid-template-columns: 1.04fr .96fr; align-items: stretch; }
.auth-card { padding: clamp(50px, 8vw, 120px) max(40px, calc((100vw - 1180px) / 2)); padding-right: clamp(40px, 7vw, 100px); background: var(--paper); }
.auth-card h1 { max-width: 650px; margin: 18px 0 0; color: var(--navy); font-size: clamp(3.2rem, 6vw, 6.4rem); line-height: .98; letter-spacing: -.055em; }
.auth-card > p { max-width: 620px; margin: 24px 0 28px; color: var(--muted); font-size: 1.15rem; }
.trust-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 28px !important; font-size: .86rem !important; }
.trust-note span { flex: 0 0 auto; width: 22px; height: 22px; display: grid; place-items: center; color: #fff; background: var(--mint); border-radius: 50%; font-size: .72rem; font-weight: 900; }
.setup-note { max-width: 620px; margin-top: 24px; padding: 16px; color: var(--navy); background: #fff3d8; border-radius: 14px; }
.auth-side { display: grid; align-content: center; gap: 20px; padding: clamp(44px, 7vw, 100px); color: #fff; background: var(--navy); }
.mini-step { display: grid; grid-template-columns: 46px 1fr; gap: 16px; padding: 24px; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; background: rgba(255,255,255,.06); }
.mini-step b { width: 42px; height: 42px; display: grid; place-items: center; color: var(--navy); background: var(--gold); border-radius: 14px; }
.mini-step span { display: grid; color: rgba(255,255,255,.72); }
.mini-step strong { color: #fff; font-family: "Fraunces", Georgia, serif; font-size: 1.25rem; }
.loading-view { min-height: calc(100vh - 130px); display: grid; place-items: center; align-content: center; gap: 18px; color: var(--navy); font-weight: 700; }
.spinner { width: 44px; height: 44px; border: 4px solid rgba(20,44,66,.14); border-top-color: var(--coral); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dashboard { padding-block: 60px 90px; }
.welcome-row { display: flex; justify-content: space-between; align-items: center; gap: 28px; margin-bottom: 34px; }
.welcome-row h1 { margin: 10px 0 0; color: var(--navy); font-size: clamp(2.6rem, 5vw, 4.8rem); line-height: 1; letter-spacing: -.045em; }
.welcome-row p { margin: 9px 0 0; color: var(--muted); }
.progress-orbit { width: 112px; height: 112px; flex: 0 0 auto; display: grid; place-items: center; align-content: center; color: var(--navy); background: var(--gold); border-radius: 50%; box-shadow: var(--shadow); transform: rotate(2deg); }
.progress-orbit strong { font-family: "Fraunces", Georgia, serif; font-size: 2rem; line-height: 1; }
.progress-orbit span { font-size: .75rem; font-weight: 800; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); gap: 24px; align-items: start; }
.workspace-card { padding: 30px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 12px 42px rgba(20,44,66,.08); }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.card-heading h2, .next-step-card h2 { margin: 5px 0 0; color: var(--navy); font-size: 2rem; line-height: 1.05; }
.save-status, .upload-status { min-height: 22px; color: #26785c; font-size: .85rem; font-weight: 700; }
.save-status.error, .upload-status.error { color: #b33f37; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend, .form-section h3 { margin: 0 0 13px; color: var(--navy); font-size: 1rem; font-weight: 800; }
.progress-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.progress-grid label { position: relative; cursor: pointer; }
.progress-grid input { position: absolute; opacity: 0; }
.progress-grid span { min-height: 68px; display: grid; align-content: center; padding: 12px 14px 12px 45px; border: 1px solid var(--line); border-radius: 15px; color: var(--muted); background: var(--paper); font-size: .82rem; }
.progress-grid span::before { content: ""; position: absolute; left: 15px; top: 23px; width: 19px; height: 19px; border: 2px solid rgba(20,44,66,.3); border-radius: 6px; background: #fff; }
.progress-grid input:checked + span { color: var(--navy); border-color: var(--mint); background: #effaf6; }
.progress-grid input:checked + span::before { content: "✓"; display: grid; place-items: center; color: #fff; background: var(--mint); border-color: var(--mint); font-size: .72rem; font-weight: 900; }
.progress-grid b { color: var(--navy); font-size: .92rem; }
.form-section { margin-top: 30px; padding-top: 27px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid label, .upload-form > label { display: grid; gap: 7px; color: var(--navy); font-size: .88rem; font-weight: 700; }
.form-grid .wide { grid-column: 1 / -1; }
input, select, textarea { width: 100%; min-width: 0; padding: 11px 13px; color: var(--ink); background: #fff; border: 1px solid rgba(20,44,66,.22); border-radius: 11px; }
input, select { min-height: 46px; }
textarea { resize: vertical; }
.search-section { padding: 27px; border: 1px solid rgba(79,170,212,.3); border-radius: 19px; background: #f8fcff; }
.search-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.search-heading h3 { margin: 5px 0 0; font-family: "Fraunces", Georgia, serif; font-size: 1.65rem; }
.search-status-badge { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 11px; border-radius: 999px; color: var(--navy); background: #e9eef2; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.status-review-requested { background: #fff0c9; }
.status-approved { color: #176047; background: #dff5eb; }
.status-changes-requested { color: #9c332d; background: #fee6e3; }
.status-paused { color: #535d66; background: #e9ecef; }
.search-summary { display: grid; gap: 9px; margin: 17px 0 22px; padding: 17px; border-radius: 15px; color: #fff; background: var(--navy); }
.search-summary div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.search-summary span { color: rgba(255,255,255,.7); font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.search-summary strong { color: var(--gold); font-family: "Fraunces", Georgia, serif; font-size: 1.45rem; }
.search-summary p { margin: 0; color: rgba(255,255,255,.85); font-size: .88rem; }
.search-summary ul { margin: 0; padding-left: 19px; color: rgba(255,255,255,.72); font-size: .8rem; }
.search-summary ul:empty { display: none; }
.search-choices { margin-top: 20px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.choice-grid label { position: relative; cursor: pointer; }
.choice-grid input { position: absolute; opacity: 0; }
.choice-grid span { min-height: 42px; display: grid; place-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: #fff; font-size: .8rem; font-weight: 700; text-align: center; }
.choice-grid input:checked + span { color: var(--navy); border-color: var(--sky); background: #eaf7fc; box-shadow: inset 0 0 0 1px var(--sky); }
.search-notes { margin-top: 20px; }
.search-review-request { margin-top: 20px; background: #fffaf0; }
.plan-card > .button { width: 100%; margin-top: 28px; }
.contact-consent { display: grid; grid-template-columns: 23px 1fr; gap: 12px; align-items: start; margin-top: 28px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #f8fcff; cursor: pointer; }
.contact-consent input { width: 21px; height: 21px; min-height: 0; margin: 2px 0 0; accent-color: var(--coral); }
.contact-consent strong, .contact-consent small { display: block; }
.contact-consent small { margin-top: 4px; color: var(--muted); font-size: .8rem; font-weight: 500; }
.side-stack { display: grid; gap: 24px; }
.puzzle-card { overflow: hidden; }
.puzzle-heading { align-items: center; margin-bottom: 18px; }
.puzzle-heading h2 { margin-top: 5px; }
.puzzle-count { flex: 0 0 auto; display: grid; place-items: center; min-width: 62px; min-height: 62px; padding: 8px; color: var(--navy); background: var(--gold); border-radius: 50%; font-family: "Fraunces", Georgia, serif; font-size: 1.05rem; line-height: 1; box-shadow: 0 9px 24px rgba(20,44,66,.14); }
.puzzle-frame { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border: 9px solid #fff; border-radius: 21px; background: var(--cream); box-shadow: 0 14px 36px rgba(20,44,66,.14); isolation: isolate; }
.puzzle-frame::after { content: ""; position: absolute; inset: 0; z-index: 9; pointer-events: none; border: 1px solid rgba(20,44,66,.12); border-radius: 12px; }
.puzzle-ghost, .puzzle-piece, .puzzle-piece img { position: absolute; inset: 0; width: 100%; height: 100%; }
.puzzle-ghost { object-fit: cover; filter: grayscale(1) contrast(.78); opacity: .13; }
.puzzle-piece { z-index: 2; opacity: 0; transform: scale(.94); transition: opacity .42s ease, transform .42s cubic-bezier(.2,.75,.25,1); }
.puzzle-piece img { object-fit: cover; }
.puzzle-piece.is-complete { opacity: 1; transform: scale(1); }
.puzzle-piece-1 { clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 8%); }
.puzzle-piece-2 { clip-path: polygon(50% 50%, 100% 8%, 100% 50%); }
.puzzle-piece-3 { clip-path: polygon(50% 50%, 100% 50%, 100% 100%, 84% 100%); }
.puzzle-piece-4 { clip-path: polygon(50% 50%, 84% 100%, 38% 100%); }
.puzzle-piece-5 { clip-path: polygon(50% 50%, 38% 100%, 0 100%, 0 69%); }
.puzzle-piece-6 { clip-path: polygon(50% 50%, 0 69%, 0 25%); }
.puzzle-piece-7 { clip-path: polygon(50% 50%, 0 25%, 0 0, 50% 0); }
.puzzle-finished { position: absolute; left: 50%; bottom: 18px; z-index: 12; width: calc(100% - 36px); padding: 12px 14px; color: #fff; background: rgba(20,44,66,.94); border: 1px solid rgba(255,255,255,.22); border-radius: 13px; box-shadow: 0 10px 30px rgba(20,44,66,.28); text-align: center; opacity: 0; transform: translate(-50%, 16px); transition: opacity .35s ease .18s, transform .35s ease .18s; }
.puzzle-finished b, .puzzle-finished small { display: block; }
.puzzle-finished b { color: var(--gold); font-family: "Fraunces", Georgia, serif; font-size: 1.18rem; }
.puzzle-finished small { margin-top: 2px; font-size: .72rem; }
.puzzle-frame.is-finished .puzzle-finished { opacity: 1; transform: translate(-50%, 0); }
.puzzle-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.puzzle-legend li { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: .78rem; font-weight: 700; }
.puzzle-legend li span { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--cream); font-size: .7rem; }
.puzzle-legend li.is-complete { color: var(--navy); }
.puzzle-legend li.is-complete span { color: #fff; border-color: var(--mint); background: var(--mint); }
.puzzle-legend li.is-complete span::before { content: "✓"; }
.puzzle-legend li.is-complete span { font-size: 0; }
.puzzle-legend li.is-complete span::before { font-size: .72rem; }
.toolkit-list { display: grid; gap: 9px; }
.toolkit-list a { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 11px; align-items: center; min-height: 66px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--paper); text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.toolkit-list a:hover { transform: translateY(-2px); border-color: rgba(79,170,212,.55); box-shadow: 0 9px 22px rgba(20,44,66,.09); }
.toolkit-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--navy); background: var(--gold); font-size: 1rem; font-weight: 900; }
.toolkit-list b, .toolkit-list small { display: block; }
.toolkit-list b { color: var(--navy); font-size: .84rem; }
.toolkit-list small { margin-top: 2px; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.toolkit-action { color: var(--coral); font-size: .68rem; font-weight: 900; letter-spacing: .08em; }
.section-copy { margin: -12px 0 22px; color: var(--muted); font-size: .9rem; }
.upload-form { display: grid; gap: 13px; }
.file-picker input { position: absolute; opacity: 0; pointer-events: none; }
.file-picker span { min-height: 48px; display: flex; align-items: center; padding: 10px 13px; overflow: hidden; border: 1px dashed rgba(20,44,66,.36); border-radius: 11px; color: var(--muted); background: var(--paper); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.document-list { display: grid; gap: 10px; margin-top: 22px; }
.document-empty { padding: 22px; color: var(--muted); background: var(--cream); border-radius: 14px; text-align: center; font-size: .88rem; }
.document-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 14px; }
.document-row strong, .document-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-row small { color: var(--muted); }
.document-actions { display: flex; gap: 7px; }
.icon-button { min-width: 36px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--navy); background: #fff; font-weight: 800; cursor: pointer; }
.icon-button.danger { color: #a8342e; }
.vault-note { margin: 20px 0 0; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.next-step-card { padding: 30px; color: #fff; background: var(--navy); border-radius: 24px; box-shadow: var(--shadow); }
.next-step-card .kicker { color: var(--gold); }
.next-step-card h2 { color: #fff; }
.next-step-card p { margin: 15px 0 22px; color: rgba(255,255,255,.74); }
.agent-card { margin: 0 0 24px; border-color: rgba(245, 182, 60, .55); box-shadow: 0 18px 54px rgba(20,44,66,.12); }
.social-card { margin: 0 0 24px; border-color: rgba(79,170,212,.45); }
.reel-status { min-height: 22px; color: var(--muted); font-size: .84rem; }
.reel-status.error, .reel-message { color: #9c332d; }
.reel-list { display: grid; gap: 18px; }
.reel-card { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: var(--cream); }
.reel-media { min-height: 260px; display: grid; place-items: center; overflow: hidden; border-radius: 13px; color: var(--muted); background: var(--navy); font-size: .85rem; text-align: center; }
.reel-media video { width: 100%; max-height: 470px; background: #000; }
.reel-detail { display: grid; align-content: start; gap: 12px; }
.reel-detail label { display: grid; gap: 6px; color: var(--navy); font-size: .84rem; font-weight: 700; }
.reel-detail small { color: var(--muted); }
.reel-message { min-height: 20px; font-size: .84rem; }
.reel-message a { color: var(--navy); font-weight: 800; }
.reel-published { color: #176047; background: #dff5eb; }
.reel-publish_failed, .reel-generation_failed { color: #9c332d; background: #fee6e3; }
.reel-publish_queued, .reel-publishing { background: #fff0c9; }
.agent-layout { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(0, 1.28fr); min-height: 320px; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; }
.member-list { border-right: 1px solid var(--line); background: var(--cream); }
.member-button { width: 100%; display: grid; gap: 3px; padding: 15px; border: 0; border-bottom: 1px solid var(--line); color: var(--navy); background: transparent; text-align: left; cursor: pointer; }
.member-button:hover, .member-button.active { background: #fff; }
.member-button small { color: var(--muted); }
.member-progress-track { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 7px; }
.member-progress-track i { height: 5px; border-radius: 999px; background: rgba(20,44,66,.12); }
.member-progress-track i.is-complete { background: var(--mint); }
.member-detail { padding: 24px; }
.member-detail h3 { margin: 0; color: var(--navy); font-family: "Fraunces", Georgia, serif; font-size: 1.5rem; }
.agent-progress-panel { margin-top: 18px; padding: 15px; border: 1px solid rgba(97,185,152,.35); border-radius: 14px; background: #f3fbf8; }
.agent-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--navy); }
.agent-progress-heading span { color: #26785c; font-size: .76rem; font-weight: 800; }
.agent-progress-pieces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.agent-progress-pieces span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; font-size: .7rem; font-weight: 700; }
.agent-progress-pieces span.is-complete { color: #176047; border-color: rgba(97,185,152,.65); background: #dff5eb; }
.detail-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
.detail-list div { padding: 13px; border-radius: 12px; background: var(--cream); }
.detail-list span { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.agent-search-review { margin-top: 24px; padding: 19px; border: 1px solid rgba(79,170,212,.32); border-radius: 15px; background: #f8fcff; }
.agent-search-review h3 { margin-bottom: 8px; }
.agent-search-review > p { margin: 0 0 15px; font-size: .86rem; }
.review-ready { color: #26785c; }
.review-missing { color: #9c332d; }
.agent-search-review label { display: grid; gap: 7px; color: var(--navy); font-size: .84rem; font-weight: 700; }
.agent-review-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
footer { padding: 24px 0; color: rgba(255,255,255,.72); background: var(--navy-2); font-size: .82rem; }
@media (max-width: 900px) {
  .auth-stage { grid-template-columns: 1fr; }
  .auth-card { padding-inline: 28px; }
  .auth-side { padding: 38px 28px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 650px) {
  .shell { width: min(100% - 26px, 1180px); }
  .brand-text span, .nav-actions > a { display: none; }
  .dashboard { padding-top: 34px; }
  .welcome-row { align-items: flex-start; }
  .progress-orbit { width: 86px; height: 86px; }
  .progress-orbit strong { font-size: 1.55rem; }
  .workspace-card { padding: 21px; border-radius: 19px; }
  .progress-grid, .form-grid, .side-stack, .agent-layout, .choice-grid, .reel-card { grid-template-columns: 1fr; }
  .member-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-list { grid-template-columns: 1fr; }
  .puzzle-card { padding: 18px; }
  .puzzle-count { min-width: 56px; min-height: 56px; font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) {
  .puzzle-piece, .puzzle-finished { transition: none; }
}
