:root {
  --bg: #121211; --panel: #1A1918; --panel-2: #161615; --line: #302E2B; --line-2: #24231F;
  --text: #F2EFE8; --muted: #BDB9B0; --dim: #A8A39A; --accent: #FFFFFF; --ok: #8FD19E; --warn: #F2B872; --err: #FF9C8F;
  --radius: 6px; --font: 'Helvetica Neue', Helvetica, Arial, sans-serif; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.55; }
a { color: var(--text); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.hint { color: var(--dim); font-size: 14px; margin: 8px 0 0; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 4px; border: 1px solid transparent; font: 600 16px var(--font); cursor: pointer; text-decoration: none; transition: opacity .15s, border-color .15s, transform .15s; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: #141413; }
.btn-primary:hover:not(:disabled) { opacity: .88; }
.btn-ghost { background: transparent; color: var(--text); border-color: #3A3835; }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); }
.btn-small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn-wide { width: 100%; }
.linkish { background: none; border: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; padding: 10px 0; min-height: 44px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -.02em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.who { color: var(--dim); font-size: 14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .who { display: none; } .topbar { padding: 10px 16px; } .brand span { display: none; } .topbar-right { gap: 8px; } }
.topbar .btn { white-space: nowrap; }

.banner { margin: 16px auto 0; max-width: 1240px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); width: calc(100% - 32px); }
.banner.good { border-color: var(--ok); }
.banner.bad { border-color: var(--err); }
.loading { padding: 80px 24px; text-align: center; color: var(--dim); }

/* Auth */
.auth { display: flex; justify-content: center; padding: 56px 16px; }
.auth-card { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 32px; }
.auth-card h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.auth-card p { margin: 10px 0 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; margin: 24px 0 8px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button { min-height: 44px; background: transparent; color: var(--muted); border: 0; font: 600 15px var(--font); cursor: pointer; }
.seg button[aria-selected="true"] { background: #2A2926; color: var(--text); }
label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: 15px; }
input[type=email], input[type=password], textarea { width: 100%; background: #0E0E0D; color: var(--text); border: 1px solid #3A3835; border-radius: 4px; padding: 12px 14px; font: 16px var(--font); }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
#authSubmit, #resetForm .btn { margin-top: 22px; }
.form-msg { min-height: 1.5em; margin: 12px 0 0; color: var(--muted); }
.form-msg.bad { color: var(--err); }
.form-msg.good { color: var(--ok); }

/* Layout */
.layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); max-width: 1240px; margin: 0 auto; gap: 0; min-height: calc(100vh - 69px); }
.side { border-right: 1px solid var(--line-2); padding: 20px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 69px; align-self: start; max-height: calc(100vh - 69px); overflow-y: auto; }

.stage-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.stage-btn { min-height: 56px; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 4px; cursor: pointer; font: 600 15px var(--font); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; }
.stage-btn small { font-weight: 400; font-size: 11px; color: var(--dim); letter-spacing: .02em; }
.stage-btn[aria-current="true"] { border-color: var(--accent); background: #22211F; }
.stage-btn.done small { color: var(--ok); }

.steps-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.steps-box summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 600; min-height: 32px; list-style: none; }
.steps-box summary::-webkit-details-marker { display: none; }
.count { color: var(--dim); font-weight: 400; font-size: 14px; }
.steps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.steps li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.steps li:first-child { border-top: 0; }
.steps .mark { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #4A4844; display: flex; align-items: center; justify-content: center; margin-top: 1px; font-size: 12px; color: var(--dim); }
.steps li.done .mark { background: var(--ok); border-color: var(--ok); color: #10200F; }
.steps li.next .mark { border-color: var(--accent); color: var(--text); }
.steps .name { font-size: 15px; }
.steps .chk { display: block; color: var(--dim); font-size: 13px; line-height: 1.4; margin-top: 2px; }
.steps li.done .name { color: var(--muted); }
#iconsDownload { margin-top: 12px; }
.tip { font-size: 14px; color: var(--muted); border: 1px dashed #3A3835; border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.tip strong { color: var(--text); }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line-2); padding: 16px; }
  .tip { display: none; }
}
.tip b { color: var(--text); font-weight: 600; }

/* Chat */
.chat { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 20px 24px 0; }
@media (max-width: 640px) { .chat { padding: 16px 16px 0; } }
.chat-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.chat-head h1 { margin: 4px 0 0; font-size: 26px; letter-spacing: -.02em; }
.thread:empty { display: none; }
.thread { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: 22px 0 24px; }
.msg { max-width: 760px; }
.msg.user { align-self: flex-end; background: #24231F; border: 1px solid #34322F; border-radius: 12px 12px 4px 12px; padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user img { display: block; max-width: 260px; max-height: 200px; border-radius: 6px; margin-bottom: 8px; border: 1px solid var(--line); }
.msg.user .shot { display: inline-flex; gap: 6px; align-items: center; color: var(--dim); font-size: 13px; margin-bottom: 4px; }
.msg.coach { align-self: stretch; overflow-wrap: anywhere; }
.msg.coach > *:first-child { margin-top: 0; }
.msg.coach p, .msg.coach li { color: #E4E0D8; }
.msg.coach h1, .msg.coach h2, .msg.coach h3 { font-size: 18px; margin: 18px 0 6px; }
.msg.coach ol, .msg.coach ul { padding-left: 22px; }
.msg.coach li { margin: 4px 0; }
.msg.coach code { font-family: var(--mono); font-size: 14px; background: #24231F; border: 1px solid #34322F; border-radius: 4px; padding: 1px 5px; }
.msg.coach .codebox { border: 1px solid var(--line); border-radius: var(--radius); margin: 14px 0; overflow: hidden; background: #0E0E0D; }
.msg.coach .codebar { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 4px 14px; border-bottom: 1px solid var(--line); background: #1C1B1A; font-size: 13px; color: var(--dim); }
.msg.coach .codebar button { min-height: 36px; padding: 0 14px; border-radius: 4px; border: 1px solid #3A3835; background: var(--accent); color: #141413; font: 600 14px var(--font); cursor: pointer; }
.msg.coach pre { margin: 0; padding: 14px; overflow-x: auto; max-height: 520px; }
.msg.coach pre code { background: none; border: 0; padding: 0; font-size: 13.5px; line-height: 1.5; white-space: pre; }
.msg.coach .step-done { display: inline-flex; align-items: center; gap: 8px; color: #10200F; background: var(--ok); border-radius: 999px; padding: 3px 12px; font-weight: 600; font-size: 14px; }
.msg.coach blockquote { border-left: 3px solid #3A3835; margin: 10px 0; padding: 2px 14px; color: var(--muted); }
.msg.coach table { border-collapse: collapse; display: block; overflow-x: auto; }
.msg.coach th, .msg.coach td { border: 1px solid var(--line); padding: 6px 10px; }
.typing { display: inline-flex; gap: 5px; padding: 6px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.msg-error { color: var(--err); border: 1px solid var(--err); border-radius: var(--radius); padding: 10px 14px; max-width: 760px; }
.msg-error button { margin-top: 8px; }

.empty { margin: 32px 0; max-width: 560px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.empty h2 { margin: 6px 0 8px; font-size: 24px; letter-spacing: -.02em; }
.empty .btn { margin-top: 18px; }

.composer { position: sticky; bottom: 0; background: linear-gradient(to bottom, rgba(18,18,17,0), var(--bg) 18px); padding: 18px 0 20px; }
.composer textarea { resize: none; min-height: 52px; max-height: 240px; line-height: 1.5; }
.composer-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.composer-status { flex: 1; color: var(--dim); font-size: 14px; min-width: 0; }
.attach-btn { cursor: pointer; }
.attach-preview { position: relative; display: inline-block; margin-bottom: 10px; }
.attach-preview img { display: block; max-height: 110px; max-width: 220px; border-radius: 6px; border: 1px solid var(--line); }
.attach-preview .x { position: absolute; top: -12px; right: -12px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #3A3835; background: var(--panel); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.drop { position: absolute; inset: 0; background: rgba(18,18,17,.88); border: 2px dashed var(--accent); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600; z-index: 4; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; } .btn { transition: none; } }

/* ── Phase 1: checkout, welcome, About you, milestones ─────────────────── */
.coach-chip { font-size: 13px; color: var(--ok); border: 1px solid #2E4A33; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.coach-chip.off { color: var(--warn); border-color: #5A4527; }
@media (max-width: 640px) { .coach-chip, #manageSub { display: none; } }

.pay-card .price-row { display: flex; align-items: baseline; gap: 10px; margin: 20px 0 8px; }
.pay-card .price { font-size: 48px; font-weight: 700; letter-spacing: -.02em; }
.ticks { list-style: none; padding: 0; margin: 12px 0 24px; display: flex; flex-direction: column; gap: 10px; }
.ticks li { position: relative; padding-left: 28px; color: #E4E0D8; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--ok); font-weight: 700; }

.onboard { max-width: 860px; margin: 0 auto; padding: 32px 24px 120px; }
@media (max-width: 640px) { .onboard { padding: 20px 16px 120px; } }
.ob-progress { height: 4px; background: var(--line-2); border-radius: 4px; overflow: hidden; margin-bottom: 32px; }
.ob-progress span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s ease; }
.ob-panel h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.12; letter-spacing: -.02em; margin: 10px 0 0; }
.ob-panel h1:focus { outline: none; }
.ob-panel .lead { font-size: 18px; color: var(--muted); margin: 14px 0 28px; max-width: 680px; }
.ob-h2 { font-size: 20px; margin: 36px 0 12px; }
.ob-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ob-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ob-card h3 { margin: 0; font-size: 18px; }
.ob-card p { margin: 0; color: var(--muted); }
.ob-card .btn { margin-top: 6px; }
.tool-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; }
.pill { font-size: 13px; border: 1px solid #3A3835; border-radius: 999px; padding: 2px 10px; color: var(--muted); white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.cost-table { border-collapse: collapse; width: 100%; font-size: 15px; }
.cost-table th, .cost-table td { text-align: left; vertical-align: top; padding: 12px 14px; border-top: 1px solid var(--line-2); }
.cost-table thead th { border-top: 0; color: var(--dim); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; background: var(--panel-2); }
.cost-table tbody th { font-weight: 600; white-space: nowrap; }
.cost-table td:last-child { white-space: nowrap; color: var(--muted); }

.choices { display: grid; gap: 12px; max-width: 560px; }
.choices button, .check { display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; color: var(--text); font: 16px var(--font); cursor: pointer; min-height: 64px; justify-content: center; }
.choices button strong { font-size: 18px; }
.choices button span { color: var(--muted); font-size: 15px; }
.choices button:hover, .check:hover { border-color: #5A5852; }
.choices button[aria-checked="true"], .style-card[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: #22211F; }
.checks { display: grid; gap: 10px; max-width: 560px; }
.check { flex-direction: row; align-items: center; gap: 14px; margin: 0; font-weight: 400; }
.check input { width: 22px; height: 22px; accent-color: #FFFFFF; flex: none; }
.check strong { font-size: 17px; font-weight: 600; }

.styles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.style-card { display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: var(--text); font: 15px var(--font); cursor: pointer; }
.style-card strong { font-size: 16px; margin-top: 6px; }
.style-card > span:last-child { color: var(--muted); font-size: 14px; }
.swatch { height: 76px; border-radius: 6px; border: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; justify-content: space-between; padding: 0 14px; }
.swatch b { font: 700 26px Georgia, 'Times New Roman', serif; }
.swatch i { width: 22px; height: 22px; border-radius: 50%; }
.style-extra { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 22px; align-items: flex-start; }
.style-extra .grow { flex: 1 1 320px; }
.accent-row { display: flex; align-items: center; gap: 12px; }
.accent-row input[type=color] { width: 56px; height: 48px; border: 1px solid #3A3835; border-radius: 6px; background: #0E0E0D; padding: 4px; cursor: pointer; }

.ob-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 14px max(24px, calc((100vw - 812px) / 2)); background: rgba(18,18,17,.96); border-top: 1px solid var(--line-2); z-index: 6; }
.ob-nav .form-msg { margin: 0; flex: 1; text-align: center; min-height: 0; }
#obBack[hidden] + .form-msg { text-align: left; }

.side-links { display: flex; flex-direction: column; align-items: flex-start; }
.side-links .linkish { padding: 6px 0; min-height: 36px; text-align: left; }

.milestone { position: fixed; inset: 0; background: rgba(10,10,9,.72); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.milestone-card { max-width: 440px; width: 100%; text-align: center; background: var(--panel); border: 1px solid var(--accent); border-radius: 14px; padding: 36px 28px 28px; animation: pop .45s cubic-bezier(.2,.8,.2,1.2); }
.milestone-card h2 { font-size: 28px; letter-spacing: -.02em; margin: 8px 0 8px; }
.milestone-card p { color: var(--muted); margin: 0 0 22px; }
.ms-badge { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; background: var(--ok); color: #10200F; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .milestone-card { animation: none; } .ob-progress span { transition: none; } }

.hint a, .legal-links a { color: var(--muted); }
.legal-links { margin: 8px 0 0; font-size: 13px; color: var(--dim); }
