@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --brand: #16213E;
  --brand-2: #a855f7;
  --brand-ink: #ffffff;
  --grad: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  --brand-soft: color-mix(in srgb, var(--brand) 9%, white);
  --brand-line: color-mix(in srgb, var(--brand) 32%, white);
  --bg: #f5f6fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6e8f0;
  --ok: #059669; --ok-soft: #d1fae5;
  --warn: #b45309; --warn-soft: #fef3c7;
  --bad: #dc2626; --bad-soft: #fee2e2;
  --night: #0b1020;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 2px 8px rgba(15,23,42,.05);
  --shadow-lg: 0 18px 50px rgba(15,23,42,.16);
  --glow: 0 10px 30px color-mix(in srgb, var(--brand) 35%, transparent);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 16.5px; font-weight: 700; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11.5px; font-weight: 700; color: var(--brand); }

/* ---------- buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 8px 15px; border-radius: 10px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: .15s; }
.btn:hover { background: #f8fafc; text-decoration: none; border-color: #d5d9e4; }
.btn.primary { background: var(--grad); border-color: transparent; color: var(--brand-ink); box-shadow: var(--glow); }
.btn.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.dark { background: var(--night); color: #fff; border-color: var(--night); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.danger { color: var(--bad); border-color: #fecaca; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 12px 22px; font-size: 16px; border-radius: 12px; }
.btn.xl { padding: 15px 28px; font-size: 17px; border-radius: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
label { display: block; font-weight: 600; font-size: 13.5px; margin: 0 0 6px; color: var(--ink-2); }
.help { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=month], select, textarea {
  width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid #d7dbe6; border-radius: 10px; background: #fff; color: var(--ink); transition: .15s; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 960px) { .grid.c2, .grid.c3, .grid.split { grid-template-columns: 1fr; } .grid.c4 { grid-template-columns: 1fr 1fr; } }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: var(--shadow); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(20px); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; background: #fff; font-weight: 500; transition: .12s; margin: 0; }
.check:hover { border-color: var(--brand-line); }
.check input { margin-top: 3px; accent-color: var(--brand); width: 17px; height: 17px; flex: none; }
.check.on { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.pad-lg { padding: 28px; }
.card h3 { margin-bottom: 4px; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-title h3 { margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eef0f6; color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: #065f46; }
.pill.warn { background: var(--warn-soft); color: #92400e; }
.pill.bad { background: var(--bad-soft); color: #991b1b; }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.dark { background: var(--night); color: #fff; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: #78350f; font-size: 14px; margin-bottom: 16px; }
.notice.info { background: var(--brand-soft); color: var(--ink-2); }
.notice.bad { background: var(--bad-soft); color: #7f1d1d; }
.notice.ok { background: var(--ok-soft); color: #064e3b; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 38px; margin-bottom: 6px; }

.kpi { padding: 18px; position: relative; overflow: hidden; }
.kpi .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); font-size: 17px; margin-bottom: 10px; }
.kpi .v { font-size: 27px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: 13px; margin-top: 3px; }
.kpi .d { font-size: 12px; font-weight: 600; margin-top: 6px; }
.kpi.hero { background: var(--grad); color: #fff; border: 0; box-shadow: var(--glow); }
.kpi.hero .l, .kpi.hero .d { color: rgba(255,255,255,.85); }
.kpi.hero .ic { background: rgba(255,255,255,.18); }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #fafbff; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* ---------- app shell */
.shell { display: grid; grid-template-columns: 258px 1fr; min-height: 100vh; }
.side { background: radial-gradient(400px 300px at -10% -5%, color-mix(in srgb, var(--brand) 40%, transparent), transparent 70%), var(--night);
  color: #cbd5e1; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side .logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 16.5px; padding: 4px 8px 18px; letter-spacing: -.02em; }
.mark { width: 32px; height: 32px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; font-size: 16px; color: #fff; box-shadow: var(--glow); flex: none; }
.side .sect { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #64748b; padding: 16px 10px 6px; font-weight: 700; }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: #cbd5e1; font-size: 14px; font-weight: 500; margin: 1px 0; }
.side a.nav:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.side a.nav.on { background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 38%, transparent), rgba(255,255,255,.04)); color: #fff; box-shadow: inset 2px 0 0 var(--brand-2); }
.side a.nav .ic { width: 20px; text-align: center; }
.side a.nav .count { margin-left: auto; background: var(--grad); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 99px; font-weight: 700; }
.side .foot { margin-top: auto; padding: 12px 10px 0; font-size: 13px; color: #94a3b8; border-top: 1px solid rgba(255,255,255,.08); }
.side .cta { margin: 6px 4px 4px; }
.main { padding: 28px 36px 70px; max-width: 1280px; width: 100%; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.topbar p { color: var(--muted); margin: 0; max-width: 720px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.banner { background: var(--night); color: #f9fafb; padding: 9px 36px; font-size: 13px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.banner a { color: #c4b5fd; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.menu-btn { display: none; }
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 270px; transform: translateX(-100%); transition: .2s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .main { padding: 18px 16px 60px; }
  .menu-btn { display: inline-flex; }
  .banner { padding: 9px 16px; }
  h1 { font-size: 25px; }
}

/* ---------- hero panels */
.hero-panel { position: relative; overflow: hidden; border-radius: 20px; padding: 28px 30px; color: #fff; margin-bottom: 20px;
  background: radial-gradient(500px 260px at 100% 0%, color-mix(in srgb, var(--brand-2) 55%, transparent), transparent 70%),
              radial-gradient(500px 300px at 0% 100%, color-mix(in srgb, var(--brand) 60%, transparent), transparent 70%), var(--night); box-shadow: var(--shadow-lg); }
.hero-panel h1, .hero-panel h2 { color: #fff; }
.hero-panel p { color: #cbd5e1; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.hero-stat { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 14px 16px; backdrop-filter: blur(6px); }
.hero-stat .v { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.hero-stat .l { font-size: 12.5px; color: #cbd5e1; }
@media (max-width: 880px) { .hero-stats { grid-template-columns: 1fr 1fr; } .hero-panel { padding: 22px 18px; } }

/* ---------- solution & tool tiles */
.tile { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; flex: none;
  background: color-mix(in srgb, var(--c, var(--brand)) 14%, white); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--brand)) 22%, white); }
.tile.lg { width: 56px; height: 56px; font-size: 28px; border-radius: 16px; }
.sol-card { display: flex; flex-direction: column; gap: 10px; position: relative; transition: .15s; border-top: 3px solid var(--c, var(--brand)); }
.sol-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.sol-card .promise { color: var(--ink-2); font-size: 14px; flex: 1; }
.sol-card .price { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.sol-card.picked { box-shadow: 0 0 0 2px var(--c, var(--brand)), var(--shadow-lg); }
.tool-card { display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: .15s; position: relative; }
.tool-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tool-card h3 { font-size: 15.5px; margin: 0; }
.tool-card p { color: var(--muted); font-size: 13.5px; margin: 0; flex: 1; }
.tool-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.tool-card.locked { background: linear-gradient(180deg, #fff, #f8f9fc); }
.tool-card.locked .tile { filter: grayscale(.8); opacity: .75; }
.tool-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tool-row:last-child { border-bottom: 0; }
.ticks { list-style: none; padding: 0; margin: 0 0 10px; }
.ticks li { padding: 3px 0 3px 24px; position: relative; font-size: 14px; }
.ticks li::before { content: "✓"; position: absolute; left: 2px; color: var(--ok); font-weight: 800; }

/* ---------- output */
.output { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; min-height: 180px; }
.output.loading::after { content: "▍"; animation: blink 1s steps(2) infinite; color: var(--brand); }
@keyframes blink { 50% { opacity: 0; } }
.md h1 { font-size: 22px; } .md h2 { font-size: 18px; margin-top: 1.2em; } .md h3 { font-size: 16px; margin-top: 1em; }
.md ul, .md ol { padding-left: 22px; margin: 0 0 .8em; }
.md li { margin: 2px 0; }
.md table { border-collapse: collapse; margin: 8px 0 14px; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.md th { background: #f8fafc; }
.md pre { background: var(--night); color: #e2e8f0; padding: 12px 14px; border-radius: 10px; overflow-x: auto; font-size: 13px; }
.md code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.md pre code { background: none; padding: 0; }
.md blockquote { border-left: 3px solid var(--brand); margin: 0 0 12px; padding: 6px 14px; color: var(--ink-2); background: var(--brand-soft); border-radius: 0 10px 10px 0; }

/* ---------- chat */
.chat { display: flex; flex-direction: column; height: 560px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; box-shadow: var(--shadow); }
.chat .msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f8f9fc; }
.bubble { max-width: 80%; padding: 9px 13px; border-radius: 16px; font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.bubble.user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.sys { align-self: center; background: var(--ok-soft); color: #065f46; font-size: 12px; }
.chat form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat input { flex: 1; }

/* ---------- wizard */
.steps { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.steps .s { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px; background: #eef0f6; color: var(--muted); font-size: 13px; font-weight: 600; }
.steps .s .n { width: 21px; height: 21px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 12px; }
.steps .s.on { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.steps .s.on .n { color: var(--brand); }
.steps .s.done { background: var(--ok-soft); color: #065f46; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; font-weight: 600; font-size: 14px; transition: .12s; text-align: left; font-family: inherit; color: var(--ink); }
.choice:hover { border-color: var(--brand-line); }
.choice.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.choice .e { font-size: 22px; }
.summary-box { position: sticky; top: 20px; }
.price-line { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.price-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 4px; }
.price-total .big { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.roi-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--ok-soft); color: #065f46; font-weight: 800; padding: 5px 11px; border-radius: 99px; font-size: 13px; }

/* ---------- health */
.ring { --p: 50; --c: var(--ok); width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none;
  background: radial-gradient(closest-side, #fff 76%, transparent 78% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), #e8ebf2 0); }
.ring.sm { width: 40px; height: 40px; font-size: 12px; }

/* ---------- modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(11,16,32,.55); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 18px; max-width: 720px; width: 100%; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg); padding: 28px; position: relative; animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal .x { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--muted); }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--night); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; z-index: 200; box-shadow: var(--shadow-lg); display: none; max-width: 90vw; }
#toast.bad { background: var(--bad); }

/* ---------- auth pages */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(700px 400px at 15% 0%, color-mix(in srgb, var(--brand) 30%, transparent), transparent 70%), radial-gradient(600px 400px at 100% 100%, color-mix(in srgb, var(--brand-2) 25%, transparent), transparent 70%), var(--night); }
.auth { width: 100%; max-width: 430px; }
.auth .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; margin-bottom: 18px; justify-content: center; color: #fff; }

/* ---------- charts */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding-top: 8px; }
.bars .b { flex: 1; background: var(--grad); border-radius: 5px 5px 0 0; min-height: 2px; position: relative; }
.bars-labels { display: flex; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.bars-labels span { flex: 1; text-align: center; }
.hbar { height: 8px; background: #eef0f6; border-radius: 99px; overflow: hidden; }
.hbar > div { height: 100%; background: var(--grad); border-radius: 99px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--brand-line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
code.snippet { display: block; white-space: pre-wrap; word-break: break-all; background: var(--night); color: #e2e8f0; padding: 12px 14px; border-radius: 10px; font-size: 12.5px; }
.opp { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.opp:last-child { border-bottom: 0; }
.opp .k { font-size: 18px; width: 30px; text-align: center; }

/* ---------- printable documents (proposal, invoice, report) */
.doc { max-width: 900px; margin: 0 auto; padding: 32px 20px 80px; }
.doc-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.doc-head { padding: 34px 40px; color: #fff; background: radial-gradient(500px 260px at 100% 0%, color-mix(in srgb, var(--brand-2) 60%, transparent), transparent 70%), radial-gradient(500px 300px at 0% 100%, color-mix(in srgb, var(--brand) 65%, transparent), transparent 70%), var(--night); }
.doc-head h1 { color: #fff; font-size: 32px; }
.doc-body { padding: 32px 40px; }
@media (max-width: 700px) { .doc-head, .doc-body { padding: 24px 20px; } }
@media print {
  body { background: #fff; }
  .no-print, .side, .banner, .menu-btn, #toast { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .doc { padding: 0; } .doc-card { box-shadow: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .hero-panel, .doc-head, .kpi.hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

label.row { flex-wrap: nowrap; align-items: flex-start; }
label.row input[type=checkbox], label.row input[type=radio] { margin-top: 3px; flex: none; accent-color: var(--brand); }
.row.nowrap { flex-wrap: nowrap; }

/* ---------- Autopilot ---------- */
.ap-hero { border-radius: 22px; padding: 44px 40px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--brand-2) 55%, transparent) 0%, transparent 55%), linear-gradient(135deg, #0b1020 0%, #1e1b4b 100%); }
.ap-hero h1 { color: #fff; font-size: 38px; margin: 8px 0 10px; max-width: 760px; }
.ap-hero p { color: #cbd5e1; max-width: 760px; font-size: 16px; }
.ap-start { display: flex; gap: 10px; margin: 22px 0 6px; max-width: 640px; flex-wrap: wrap; }
.ap-start input { flex: 1; min-width: 220px; font-size: 17px; padding: 14px 16px; border-radius: 12px; border: 0; }
.ap-note { font-size: 13.5px; margin: 12px 0 0; }
.ap-note a { color: #c4b5fd; }
.ap-regions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--ink); }
.chip small { color: var(--muted); font-weight: 500; }
.chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.ap-stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.ap-stat .v { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.ap-stat .l { font-size: 12.5px; color: var(--muted); }
.ap-stat.ok .v { color: var(--ok); }
.ap-stat.brand { background: var(--grad); border: 0; color: #fff; }
.ap-stat.brand .l { color: rgba(255,255,255,.85); }
.ap-board { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.ap-col { background: #eef0f7; border-radius: 14px; padding: 10px; min-height: 140px; }
.ap-col-h { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin: 2px 4px 8px; }
.ap-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; font-size: 13.5px; line-height: 1.3; transition: .12s; }
.ap-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow); }
.ap-card small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.ap-empty, .ap-more { text-align: center; color: var(--muted); font-size: 12.5px; padding: 6px; }
.ap-log { max-height: 520px; overflow-y: auto; }
.ap-log-row { display: flex; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ap-log-row[data-p] { cursor: pointer; }
.ap-log-row[data-p]:hover { background: var(--brand-soft); }
.ap-log-row .k { width: 22px; text-align: center; }
.ap-log-row small { display: block; }
.ap-inbox { border-color: #fcd34d; background: #fffbeb; margin-bottom: 16px; }
.ap-thread { display: grid; gap: 8px; max-height: 360px; overflow-y: auto; }
.ap-msg { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.ap-msg.in { background: var(--brand-soft); border-color: var(--brand-line); }
.ap-body { white-space: pre-wrap; color: var(--ink-2); }
@media (max-width: 1100px) { .ap-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .ap-stats { grid-template-columns: 1fr 1fr; } .ap-hero { padding: 28px 20px; } .ap-hero h1 { font-size: 28px; } }

/* ---------- contracts ---------- */
.contract-box { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; background: #fff; }
.contract-box details { border-bottom: 1px solid var(--line); }
.contract-box details:last-child { border-bottom: 0; }
.contract-box summary { cursor: pointer; padding: 11px 14px; font-weight: 600; font-size: 14px; }
.contract-doc { max-height: 340px; overflow: auto; padding: 4px 16px 14px; font-size: 13.5px; color: var(--ink-2); }
.contract-doc h2 { font-size: 17px; margin-top: 10px; } .contract-doc h3 { font-size: 14px; margin: 14px 0 4px; }
.contract-doc ul { padding-left: 20px; margin: 4px 0 8px; }
.contract-full .contract-doc { max-height: none; overflow: visible; }
@media print { .contract-full details { break-inside: auto; } .contract-full details:not([open]) > :not(summary) { display: block; } }

/* ---------- owner home ---------- */
.feed-row { display: flex; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 14px; text-decoration: none !important; }
.feed-row:hover { background: var(--brand-soft); }
.feed-row .k { width: 24px; text-align: center; }
#feed { max-height: 560px; overflow-y: auto; }
.staff-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none !important; font-size: 14px; }
.staff-row:hover { background: var(--brand-soft); }
.staff-row:last-of-type { border-bottom: 0; }
.tile.sm { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; flex: none; }

/* ---------- AI Marketer ---------- */
.mk-card { display: flex; flex-direction: column; }
.mk-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--brand-soft); border-radius: 10px; padding: 10px 12px; }
.mk-facts small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.mk-facts b { font-size: 14px; }
.tier { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.flyer { border: 2px dashed var(--line); border-radius: 12px; padding: 24px; text-align: center; }

/* ---------- guided setup & teach ---------- */
.start-wrap { max-width: 860px; margin: 0 auto; }
.sdots { display: flex; gap: 8px; margin: 6px 0 16px; flex-wrap: wrap; }
.sdot { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--muted); }
.sdot.done { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.sdot.on { border-color: var(--brand); color: var(--brand); box-shadow: var(--glow); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px dashed var(--brand-line); border-radius: 16px; padding: 28px; cursor: pointer; text-align: center; background: var(--brand-soft); }
.drop.over { border-color: var(--brand); }
.teach-q { padding: 10px 0; border-bottom: 1px solid var(--line); }
.teach-q:last-child { border-bottom: 0; }

/* ---------- five levels ---------- */
.smart-note { font-size: 13px; color: var(--ink-2); background: var(--brand-soft); border-radius: 12px; padding: 10px 12px; margin-top: 12px; }
.smart-note:empty { display: none; }
.level-bar { gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pill.warm { background: var(--warn-soft); color: var(--warn); }
.brief-metric { display: flex; flex-direction: column; } .brief-metric .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.brief-metric .d { font-size: 12.5px; } .brief-metric .d.up { color: var(--ok); } .brief-metric .d.down { color: var(--bad); }

/* ---------- Scale cockpit */
.sc-meter { height: 14px; background: rgba(255,255,255,.14); border-radius: 99px; overflow: hidden; }
.sc-meter > div { height: 100%; background: linear-gradient(90deg, #a78bfa, #34d399); border-radius: 99px; min-width: 4px; }

.grow-card { margin-bottom: 12px; }
.grow-ev { margin-top: 10px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.loc-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; font-size: 14px; }

.notice.row { flex-wrap: wrap; gap: 8px; }
.main { min-width: 0; }
.mk-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); overflow-wrap: anywhere; }
.grid > * { min-width: 0; }
.mark.lh, .p-logo .mark.lh { background: none; box-shadow: none; color: var(--ink, #16213E); border-radius: 0; padding: 0; }
.mark.lh svg { display: block; width: 100%; height: 100%; }
