:root {
  --accent: #4f46e5; --bg: #f6f7fb; --card: #fff; --text: #1d2130; --muted: #6b7185; --line: #e4e7ef;
  --good: #15803d; --good-bg: #e6f6ea; --ok: #2563eb; --ok-bg: #e8f0fe; --warn: #b45309; --warn-bg: #fdf3e2; --bad: #b91c1c; --bad-bg: #fdecec;
  --radius: 10px; font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: .2em 0 .5em; } h2 { font-size: 1.2rem; margin: .2em 0 .7em; } h3 { margin: .3em 0 .5em; } h4 { margin: .8em 0 .3em; }
small, .small { font-size: .85rem; } .muted { color: var(--muted); } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.hidden { display: none !important; } .nowrap { white-space: nowrap; } .wrap { word-break: break-word; } .center { text-align: center; }
.text-good { color: var(--good); } .text-bad { color: var(--bad); }

.topbar { display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); font-size: 1.05rem; }
.logo img { height: 30px; }
.mainnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.mainnav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.mainnav a.active, .mainnav a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.userbox { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.credits { background: var(--ok-bg); color: var(--ok); padding: 3px 10px; border-radius: 99px; font-weight: 600; font-size: .85rem; }
.page { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card.narrow, .narrow { max-width: 620px; }
.grid { display: grid; gap: 16px; } .grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); } .grid.three { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.stat span { color: var(--muted); font-size: .85rem; display: block; } .stat strong { font-size: 1.7rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-end { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.row-gap { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline { display: inline; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 8px; cursor: pointer; font-size: .95rem; font-weight: 500; text-decoration: none !important; font-family: inherit; }
.btn:hover { border-color: #c9cede; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); } .btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 4px 10px; font-size: .85rem; } .btn.big { padding: 12px 22px; font-size: 1.05rem; }

label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: .92rem; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.inline-field { flex-direction: row; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; font-weight: 400; }
.inline-field input { width: 80px; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; } input[type=color] { height: 40px; padding: 2px; width: 80px; }
textarea { resize: vertical; } input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; } legend { font-weight: 600; padding: 0 6px; }
details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--ok-bg); color: var(--ok); word-break: break-word; }
.flash.ok { background: var(--good-bg); color: var(--good); } .flash.bad { background: var(--bad-bg); color: var(--bad); } .flash.warn { background: var(--warn-bg); color: var(--warn); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; vertical-align: middle; }
.badge.good { background: var(--good-bg); color: var(--good); } .badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.muted { background: #eef0f4; color: var(--muted); }
.score { display: inline-block; min-width: 46px; text-align: center; padding: 3px 8px; border-radius: 6px; font-weight: 700; }
.score.good { background: var(--good-bg); color: var(--good); } .score.ok { background: var(--ok-bg); color: var(--ok); } .score.warn { background: var(--warn-bg); color: var(--warn); } .score.bad { background: var(--bad-bg); color: var(--bad); }

.table { width: 100%; border-collapse: collapse; } .table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.form-table input, .form-table textarea { min-width: 70px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; } .tabs a.active { color: var(--accent); border-color: var(--accent); }
.tabs.vertical { flex-direction: column; border: 0; min-width: 190px; } .tabs.vertical a { border: 0; border-left: 3px solid transparent; border-radius: 0 6px 6px 0; }
.tabs.vertical a.active { background: #fff; border-left-color: var(--accent); }
.settings-wrap { display: flex; gap: 20px; align-items: flex-start; } .settings-form { flex: 1; max-width: 760px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.checklist { list-style: none; padding: 0; } .checklist li { padding: 4px 0; } .checklist .ok { color: var(--good); } .checklist .todo { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; } .chip { flex-direction: row; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; font-weight: 400; }

.question { border-top: 1px solid var(--line); padding: 8px 0; } .question summary { display: flex; justify-content: space-between; gap: 16px; font-weight: 400; }
.question .qtext { flex: 1; } .question .qmeta { color: var(--muted); font-size: .82rem; white-space: nowrap; } .question form { padding: 12px 0; }
.add-question { display: flex; gap: 8px; margin-top: 10px; }

.hero { text-align: center; padding: 48px 0 24px; } .hero h1 { font-size: 2.4rem; } .lead { font-size: 1.12rem; color: var(--muted); max-width: 760px; margin: 0 auto 1em; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0 36px; }
.packs { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 18px; }
.pack .price { font-size: 1.6rem; font-weight: 700; } .pack ul { padding-left: 18px; color: var(--muted); }

.report-top { grid-template-columns: 260px 1fr; } @media (max-width: 760px) { .report-top { grid-template-columns: 1fr; } .settings-wrap { flex-direction: column; } }
.overall { text-align: center; } .big-score { font-size: 3.4rem; font-weight: 800; line-height: 1.1; } .big-score small { font-size: 1rem; color: var(--muted); }
.big-score.good, .band.good { color: var(--good); } .big-score.ok, .band.ok { color: var(--ok); } .big-score.warn, .band.warn { color: var(--warn); } .big-score.bad, .band.bad { color: var(--bad); }
.band { font-weight: 700; margin-bottom: 10px; }
.integrity { display: inline-block; padding: 4px 12px; border-radius: 99px; font-weight: 600; font-size: .88rem; }
.integrity.good { background: var(--good-bg); color: var(--good); } .integrity.warn { background: var(--warn-bg); color: var(--warn); } .integrity.bad { background: var(--bad-bg); color: var(--bad); }
.dims { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.bar { height: 8px; background: #eef0f4; border-radius: 99px; overflow: hidden; margin: 6px 0; } .bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
video#player { width: 100%; max-height: 520px; background: #000; border-radius: 8px; }
.id-photo { width: 140px; border-radius: 8px; vertical-align: middle; }
.turn { border-top: 1px solid var(--line); padding: 10px 0; } .turn.followup { margin-left: 24px; } .turn p { margin: 4px 0; }
.turn .ai { color: var(--muted); } pre.code { background: #1e1e2e; color: #e4e4ef; padding: 12px; border-radius: 8px; overflow: auto; max-height: 420px; font-size: .85rem; }
.compare th { width: 200px; }
.logo-preview { max-height: 60px; align-self: flex-start; }

.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; width: 100%; max-width: 440px; }
.auth-card .logo { margin-bottom: 18px; }

@media print {
  .topbar, .no-print, form, .btn { display: none !important; }
  body { background: #fff; } .card { border: 0; padding: 8px 0; break-inside: avoid; } .page { padding: 0; }
}
