/* Signed-in app + login. Same palette as the landing page. */
:root {
  --bg: #02060f;
  --ink: #ffffff;
  --sub: #a2a9b8;
  --line: rgba(196, 214, 232, 0.18);
  --gold: #ffe2b2;
  --blue: #96c4f4;
  --good: #8fd8a8;
  --bad: #ffb4a8;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; background: radial-gradient(80% 50% at 50% -10%, rgba(40, 70, 140, 0.35), rgba(2, 6, 15, 0) 70%), var(--bg); }
a { color: var(--gold); }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid #9fe0ff; outline-offset: 3px; border-radius: 6px; }
button { font-family: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--sub); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

.brand { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; }
.brand-word { font-size: 19px; letter-spacing: 4px; font-weight: 600; }
.brand-ai { font-size: 19px; letter-spacing: 2px; color: var(--gold); font-weight: 300; }

.glass-card { border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015)); backdrop-filter: blur(18px); }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 0; background: #fff; color: #02060f; font-size: 16px; font-weight: 600; cursor: pointer; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-ghost { min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid rgba(196,214,232,0.6); background: transparent; color: #fff; font-size: 15px; cursor: pointer; }
.btn-mini { min-height: 36px; padding: 6px 12px; margin-left: 6px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: #fff; cursor: pointer; }
.btn-mini:disabled { opacity: 0.4; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--gold); font-size: 14px; cursor: pointer; padding: 10px 0; min-height: 44px; }
.link-quiet { color: var(--sub); font-size: 14px; text-decoration: none; }

.spinner { display: inline-flex; align-items: center; gap: 10px; }
.spinner-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner-dot { animation: none; } }
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--sub); }

/* login */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; padding: 24px clamp(16px, 5vw, 64px); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-card { width: 100%; max-width: 440px; margin: auto; padding: 32px clamp(20px, 5vw, 36px); display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { margin: 0; font-size: 28px; font-weight: 500; }
.auth-card p { margin: 0; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); }
.tab { min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: #c9d2de; font-size: 15px; cursor: pointer; }
.tab.on { background: #fff; color: #02060f; font-weight: 600; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--sub); }
.field input, .field select, .field textarea, .goal-form textarea, .phone-row select, .phone-row input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(196,214,232,0.28); background: rgba(2,6,15,0.6); color: #fff; font: inherit; font-size: 16px;
}
.field textarea, .goal-form textarea { resize: vertical; line-height: 1.5; }
.phone-row { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 8px; }
.code-input { letter-spacing: 8px; font-size: 22px !important; text-align: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.notice { padding: 12px 14px; border-radius: 14px; background: rgba(150,196,244,0.1); color: #dbe9f8; font-size: 14px; line-height: 1.5; }
.error { padding: 12px 14px; border-radius: 14px; background: rgba(255,120,100,0.12); color: var(--bad); font-size: 14px; }
.fine { font-size: 12px; color: #8d96a8; line-height: 1.5; }

/* app */
.app { min-height: 100vh; }
.app-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px clamp(16px, 4vw, 48px); flex-wrap: wrap; }
.app-user { display: flex; align-items: center; gap: 12px; }
.app-tabs { display: flex; gap: 6px; padding: 0 clamp(16px, 4vw, 48px); overflow-x: auto; border-bottom: 1px solid var(--line); }
.app-tab { min-height: 48px; padding: 0 16px; border: 0; border-bottom: 2px solid transparent; background: none; color: #c9d2de; font-size: 15px; cursor: pointer; white-space: nowrap; }
.app-tab.on { color: #fff; border-bottom-color: var(--gold); }
.app-main { max-width: 1100px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 48px) 64px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.panel { padding: clamp(18px, 3vw, 28px); }
.panel h2 { margin: 0 0 14px; font-size: 21px; font-weight: 500; }
.panel h3 { margin: 6px 0 10px; font-size: 16px; font-weight: 600; }
.lead { font-size: 17px; line-height: 1.5; margin: 0 0 16px; }
.goal-form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .grid3, .grid2 { grid-template-columns: minmax(0, 1fr); } }
.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.5; }
.steps { margin: 16px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.output { margin: 6px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.04); font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: rgba(255,255,255,0.08); color: #dfe6ef; }
.pill-done { background: rgba(143,216,168,0.14); color: var(--good); }
.pill-awaiting_approval, .pill-draft_for_human { background: rgba(255,226,178,0.14); color: var(--gold); }
.pill-failed, .pill-rejected { background: rgba(255,120,100,0.14); color: var(--bad); }
.approval { display: flex; flex-direction: column; gap: 12px; }
.agent { padding: 14px; border-radius: 14px; border: 1px solid var(--line); }
.agent p { margin: 6px 0 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--sub); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.lvl { padding: 3px 10px; border-radius: 8px; font-size: 12px; color: #02060f; font-weight: 600; }
.lvl-1 { background: var(--gold); }
.lvl-2 { background: #cfe3fa; }
.lvl-3 { background: var(--blue); }
.activity li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; }
@media (max-width: 600px) { .activity li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* legal pages */
.legal { max-width: 760px; margin: 0 auto; padding: 32px 20px 80px; line-height: 1.7; color: #dfe6ef; }
.legal h1 { font-weight: 500; color: #fff; }
.legal h2 { font-size: 19px; font-weight: 600; color: #fff; margin-top: 32px; }
