/* Media House Agency — Marketing Audit
   One stylesheet for the three surfaces: the public scorecard (dark, the
   mediahouse.ltd look), the client report (a light document that prints),
   and the auditor's workspace (light, built for long sessions). */

:root {
  --teal: #1490af;
  --teal-2: #4fc3dd;
  --teal-deep: #003a48;
  --ink: #0d0f10;
  --ink-2: #141618;
  --ink-3: #1b1e20;
  --line-dark: rgba(255, 255, 255, 0.09);
  --mute-dark: #9aa3a6;
  --paper: #ffffff;
  --paper-2: #f2f4f5;
  --paper-3: #e9edee;
  --line: #dde3e5;
  --text: #141618;
  --mute: #5d686c;
  --red: #e05a4f;
  --amber: #eba13a;
  --green: #3fae7a;
  --radius: 18px;
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); line-height: 1.55; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 999px; padding: 15px 26px; cursor: pointer;
  font-weight: 700; font-size: 15px; letter-spacing: 0.01em; text-decoration: none;
  background: var(--teal); color: #fff; transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}
.btn:hover { background: #17a3c6; box-shadow: 0 10px 30px rgba(20, 144, 175, 0.35); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.ghost:hover { background: rgba(127, 127, 127, 0.1); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.small { padding: 9px 16px; font-size: 13px; }
.btn.dark { background: var(--ink); }
.btn.dark:hover { background: #24292c; box-shadow: none; }
.kicker { font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--teal); font-weight: 700; }

/* ================= public: landing + quiz + results ================= */

body.public { background: var(--ink); color: #f2f4f5; min-height: 100vh; }
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px clamp(16px, 4vw, 48px); }
.pub-head img { height: 30px; width: auto; display: block; }
.pub-head a.back { font-size: 13px; color: var(--mute-dark); text-decoration: none; }
.pub-head a.back:hover { color: #fff; }
.wrap { width: min(1120px, 100% - 32px); margin: 0 auto; }
.narrow { width: min(720px, 100% - 32px); margin: 0 auto; }

.hero { position: relative; padding: clamp(40px, 8vw, 96px) 0 clamp(48px, 8vw, 88px); overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -30% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, rgba(20, 144, 175, 0.28), transparent 70%); pointer-events: none;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(34px, 5.4vw, 64px); line-height: 1.04; margin: 18px 0 20px; font-weight: 800; letter-spacing: -0.02em; }
.hero h1 em { font-style: normal; color: var(--teal-2); }
.hero p.lead { font-size: clamp(16px, 1.6vw, 19px); color: #c3cacc; max-width: 560px; margin: 0 0 30px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; font-size: 13px; color: var(--mute-dark); }
.hero .meta span::before { content: '✓'; color: var(--teal-2); margin-right: 8px; font-weight: 800; }
.hero-card {
  background: linear-gradient(160deg, #15191b, #0f1213); border: 1px solid var(--line-dark); border-radius: 26px; padding: 26px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.45);
}
.hero-card .mini-gauge { display: flex; justify-content: center; color: #fff; }
.hero-card .mini-bars { display: grid; gap: 9px; margin-top: 14px; }
.mini-bar { display: grid; grid-template-columns: 92px 1fr 30px; gap: 10px; align-items: center; font-size: 12px; color: #c3cacc; }
.mini-bar i { display: block; height: 7px; border-radius: 9px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.mini-bar i b { display: block; height: 100%; border-radius: 9px; }
.mini-bar span:last-child { text-align: right; font-weight: 700; color: #fff; }

.section { padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--line-dark); }
.section h2 { font-size: clamp(26px, 3.4vw, 40px); line-height: 1.1; margin: 14px 0 14px; font-weight: 700; letter-spacing: -0.01em; }
.section p.sub { color: var(--mute-dark); max-width: 640px; margin: 0 0 36px; font-size: 16px; }
.pillar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.pillar-tile { background: var(--ink-2); border: 1px solid var(--line-dark); border-radius: 16px; padding: 18px; }
.pillar-tile b { display: block; font-size: 15px; margin-bottom: 6px; }
.pillar-tile span { font-size: 13px; color: var(--mute-dark); line-height: 1.5; display: block; }
.pillar-tile .n { color: var(--teal-2); font-size: 12px; font-weight: 800; letter-spacing: .1em; margin-bottom: 10px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { padding: 24px; border-radius: 18px; background: var(--ink-2); border: 1px solid var(--line-dark); }
.step .num { font-size: 13px; font-weight: 800; color: var(--teal-2); letter-spacing: .12em; }
.step h3 { margin: 10px 0 8px; font-size: 19px; }
.step p { margin: 0; color: var(--mute-dark); font-size: 14px; }
.cta-band { text-align: center; }
.cta-band h2 { max-width: 760px; margin-left: auto; margin-right: auto; }
.pub-foot { padding: 32px 0 48px; color: #6c7679; font-size: 13px; text-align: center; border-top: 1px solid var(--line-dark); }
.pub-foot a { color: #9aa3a6; }

/* quiz */
.quiz { padding: clamp(24px, 5vw, 56px) 0 80px; }
.progress { display: flex; align-items: center; gap: 14px; margin-bottom: 34px; font-size: 13px; color: var(--mute-dark); }
.progress .track { flex: 1; height: 6px; background: rgba(255, 255, 255, 0.08); border-radius: 9px; overflow: hidden; }
.progress .fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--teal-2)); border-radius: 9px; transition: width .35s ease; }
.q-card { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.q-card h2 { font-size: clamp(22px, 3vw, 32px); line-height: 1.2; margin: 12px 0 26px; font-weight: 700; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  padding: 17px 20px; border-radius: 14px; border: 1.5px solid var(--line-dark); background: var(--ink-2);
  font-size: 16px; transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.option:hover { border-color: rgba(79, 195, 221, 0.55); background: #182024; }
.option.on { border-color: var(--teal-2); background: rgba(20, 144, 175, 0.16); }
.option .key {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; background: rgba(255, 255, 255, 0.07); color: var(--mute-dark);
}
.option.on .key { background: var(--teal); color: #fff; }
.q-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; gap: 12px; }
.q-nav .hint { font-size: 12px; color: #6c7679; }
.linkish { background: none; border: 0; padding: 8px 0; cursor: pointer; color: var(--mute-dark); font-size: 14px; }
.linkish:hover { color: #fff; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 7px; }
.field.full, .form-grid .full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: #c3cacc; }
.field input, .field select, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--line-dark); background: var(--ink-2); color: #fff; font-size: 16px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal-2); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: var(--mute-dark); line-height: 1.5; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--teal); flex: none; }
.err { color: #ff8a80; font-size: 14px; min-height: 20px; margin: 10px 0 0; }

/* results */
.results-head { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 48px); align-items: center; padding: clamp(28px, 5vw, 56px) 0 36px; }
.results-head .gauge-box { color: #fff; }
.results-head h1 { font-size: clamp(28px, 4vw, 46px); line-height: 1.08; margin: 10px 0 12px; }
.results-head p { color: #c3cacc; margin: 0; max-width: 560px; font-size: 16px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.gauge-arc { animation: sweep 1.2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sweep { from { stroke-dashoffset: var(--len); } }

.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.res-card { background: var(--ink-2); border: 1px solid var(--line-dark); border-radius: var(--radius); padding: 22px; }
.res-card h3 { margin: 0; font-size: 17px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.res-card h3 b { font-size: 22px; }
.res-card .bar { height: 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.08); margin: 12px 0 14px; overflow: hidden; }
.res-card .bar i { display: block; height: 100%; border-radius: 9px; }
.res-card p { margin: 0; color: #c3cacc; font-size: 14px; }
.top3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.top3 .res-card { border-color: rgba(79, 195, 221, 0.3); background: linear-gradient(170deg, rgba(20, 144, 175, 0.14), var(--ink-2) 60%); }
.radar-box { display: flex; justify-content: center; color: #c3cacc; }
.radar-box svg { width: min(520px, 100%); height: auto; }
.cta-card {
  margin: 48px 0 0; padding: clamp(26px, 4vw, 44px); border-radius: 26px;
  background: radial-gradient(circle at 85% 0%, rgba(79, 195, 221, 0.28), transparent 55%), linear-gradient(150deg, #0f5e72, #0a3540);
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center;
}
.cta-card h2 { margin: 0 0 10px; font-size: clamp(24px, 3vw, 34px); line-height: 1.12; }
.cta-card p { margin: 0; color: #d5ecf1; }
.cta-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; font-size: 14px; color: #e6f4f7; }
.cta-card li::before { content: '✓'; margin-right: 10px; color: #8fe0f0; font-weight: 800; }
.cta-card .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; align-items: center; }
.cta-card .price { font-size: 13px; color: #bfe3ea; }
.cta-card .btn { background: #fff; color: var(--teal-deep); }
.cta-card .btn:hover { background: #e9fbff; }

.loading { padding: 120px 0; text-align: center; color: var(--mute-dark); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(127, 127, 127, 0.25); border-top-color: var(--teal); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .hero-grid, .cta-card { grid-template-columns: 1fr; }
  .pillar-grid { grid-template-columns: repeat(2, 1fr); }
  .steps, .top3 { grid-template-columns: 1fr; }
  .hero-card { max-width: 440px; }
}
@media (max-width: 640px) {
  .res-grid, .form-grid { grid-template-columns: 1fr; }
  .results-head { grid-template-columns: 1fr; text-align: left; }
  .pillar-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pillar-tile { padding: 14px; }
  .pub-head a.back { display: none; }
}

/* ================= the client report (light document) ================= */

body.report { background: var(--paper-2); color: var(--text); }
.doc { width: min(980px, 100% - 32px); margin: 24px auto 64px; }
.doc-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.doc-bar .note { font-size: 13px; color: var(--mute); }
.preview-flag { background: #fff4dc; color: #8a5a00; border: 1px solid #f0d49a; padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.cover {
  background: radial-gradient(circle at 90% 0%, rgba(79, 195, 221, 0.32), transparent 50%), linear-gradient(155deg, #0d0f10 30%, #0b3a46);
  color: #fff; border-radius: 26px; padding: clamp(28px, 5vw, 56px); display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: end;
}
.cover img.logo { height: 30px; width: auto; display: block; margin-bottom: clamp(40px, 7vw, 90px); }
.cover h1 { font-size: clamp(30px, 4.6vw, 52px); line-height: 1.04; margin: 14px 0 12px; letter-spacing: -0.02em; }
.cover .who { color: #c3cacc; font-size: 15px; }
.cover .gauge-box { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cover .gauge-box .pill { margin-top: 6px; }
.panel { background: var(--paper); border-radius: 22px; padding: clamp(22px, 4vw, 40px); margin-top: 18px; border: 1px solid var(--paper-3); }
.panel h2 { margin: 8px 0 16px; font-size: clamp(22px, 2.8vw, 30px); line-height: 1.15; letter-spacing: -0.01em; }
.panel .prose p { margin: 0 0 14px; font-size: 16px; line-height: 1.7; color: #2b3134; }
.overview { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; }
.overview .radar-box { color: #3a4145; }
.legend { display: flex; gap: 18px; font-size: 12px; color: var(--mute); justify-content: center; margin-top: 4px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.legend i.dash { background: repeating-linear-gradient(90deg, #9aa3a6 0 5px, transparent 5px 9px); }
.score-rows { display: grid; gap: 10px; }
.score-row { display: grid; grid-template-columns: 1fr 120px 40px; gap: 12px; align-items: center; font-size: 14px; }
.score-row a { text-decoration: none; font-weight: 600; }
.score-row a:hover { color: var(--teal); }
.score-row .bar { height: 8px; border-radius: 9px; background: var(--paper-3); overflow: hidden; position: relative; }
.score-row .bar i { display: block; height: 100%; border-radius: 9px; }
.score-row .bar s { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #6c7679; }
.score-row b { text-align: right; }
.plan { counter-reset: plan; display: grid; gap: 12px; }
.plan-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: start; padding: 16px 18px; border: 1px solid var(--paper-3); border-radius: 16px; }
.plan-item::before { counter-increment: plan; content: counter(plan); width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; }
.plan-item h4 { margin: 2px 0 4px; font-size: 16px; }
.plan-item p { margin: 0; color: #3a4145; font-size: 14px; line-height: 1.6; }
.plan-item .area { font-size: 12px; color: var(--mute); font-weight: 600; letter-spacing: .04em; }
.tag { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.tag.quick { background: #e3f6ec; color: #23764e; }
.tag.medium { background: #e6f3f7; color: #0f6a81; }
.tag.project { background: #f1ecfb; color: #5b3f9e; }
.s-0 { background: #fde8e6; color: #b23a30; } .s-1 { background: #fdf0dc; color: #9a6210; }
.s-2 { background: #e6f3f7; color: #0f6a81; } .s-3 { background: #e3f6ec; color: #23764e; } .s-na { background: var(--paper-3); color: var(--mute); }
.money-total { font-size: clamp(34px, 5vw, 52px); font-weight: 800; color: var(--teal); letter-spacing: -0.02em; margin: 4px 0 4px; }
.money-lines { display: grid; gap: 10px; margin-top: 18px; }
.money-line { display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; padding: 14px 0; border-top: 1px solid var(--paper-3); }
.money-line b { font-size: 15px; } .money-line strong { font-size: 17px; }
.money-line span { grid-column: 1 / -1; font-size: 13px; color: var(--mute); }
.pillar-sec { break-inside: avoid-page; }
.pillar-sec .head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.pillar-sec .head .score { text-align: right; flex: none; }
.pillar-sec .head .score b { font-size: 36px; display: block; line-height: 1; }
.pillar-sec .head .score span { font-size: 12px; color: var(--mute); }
.pillar-sec .blurb { color: var(--mute); margin: -8px 0 14px; font-size: 14px; }
.find { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--paper-3); }
.find h5 { margin: 0 0 4px; font-size: 15px; }
.find p { margin: 0; font-size: 14px; color: #3a4145; line-height: 1.6; }
.find p.rec { margin-top: 6px; color: #0f5e72; }
.find p.rec::before { content: 'Fix: '; font-weight: 700; }
.find .tag { justify-self: start; align-self: start; }
.gap-note { font-size: 13px; color: var(--mute); margin-top: 6px; }
.doc-foot { text-align: center; font-size: 13px; color: var(--mute); margin: 26px 0 0; }

@media (max-width: 760px) {
  .cover, .overview { grid-template-columns: 1fr; }
  .cover .gauge-box { align-items: flex-start; }
  .plan-item { grid-template-columns: 36px 1fr; }
  .plan-item .tag { grid-column: 2; justify-self: start; }
  .score-row { grid-template-columns: 1fr 80px 34px; }
  .find { grid-template-columns: 1fr; gap: 6px; }
}

@media print {
  @page { margin: 12mm; }
  body.report { background: #fff; }
  .doc { width: 100%; margin: 0; }
  .doc-bar, .no-print { display: none !important; }
  .panel { border: 0; padding: 18px 0; border-radius: 0; break-inside: auto; }
  .cover { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tag, .score-row .bar i, .plan-item::before, .s-0, .s-1, .s-2, .s-3 { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pillar-sec { break-before: page; }
  .gauge-arc { animation: none; }
}

/* ================= the auditor's workspace ================= */

body.admin { background: var(--paper-2); color: var(--text); min-height: 100vh; }
.adm-top { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff; display: flex; align-items: center; gap: 18px; padding: 12px clamp(14px, 3vw, 28px); }
.adm-top img { height: 24px; }
.adm-top nav { display: flex; gap: 4px; margin-left: 12px; flex-wrap: wrap; }
.adm-top nav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-size: 14px; color: #c3cacc; font-weight: 600; }
.adm-top nav a.on, .adm-top nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.adm-top .spacer { flex: 1; }
.adm-top .linkish { color: #9aa3a6; }
.adm-main { width: min(1240px, 100% - 28px); margin: 22px auto 80px; }
.adm-h { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.adm-h h1 { font-size: 26px; margin: 0; letter-spacing: -0.01em; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.card.pad { padding: 20px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat b { display: block; font-size: 28px; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--mute); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; font-weight: 600; color: #3a4145; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.search { flex: 1; min-width: 180px; max-width: 320px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; }
table.list td { padding: 12px 14px; border-bottom: 1px solid var(--paper-3); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: #f7f9fa; }
.table-wrap { overflow-x: auto; }
.score-badge { display: inline-grid; place-items: center; min-width: 42px; height: 30px; padding: 0 8px; border-radius: 9px; font-weight: 800; color: #fff; font-size: 14px; }
.status { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: capitalize; }
.st-new { background: #e6f3f7; color: #0f6a81; } .st-contacted { background: #fdf0dc; color: #9a6210; } .st-booked { background: #efe9fb; color: #5b3f9e; }
.st-won, .st-published { background: #e3f6ec; color: #23764e; } .st-lost, .st-archived { background: var(--paper-3); color: var(--mute); } .st-draft { background: #fdf0dc; color: #9a6210; }
.muted { color: var(--mute); }
.small { font-size: 13px; }
.empty { padding: 48px 20px; text-align: center; color: var(--mute); }

.af { display: grid; gap: 6px; }
.af label { font-size: 12px; font-weight: 700; color: #3a4145; }
.af input, .af select, .af textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 14px; }
.af textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.af input:focus, .af select:focus, .af textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 144, 175, 0.15); }
.af .help { font-size: 12px; color: var(--mute); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* lead drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(13, 15, 16, 0.4); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: #fff; z-index: 41; overflow-y: auto; padding: 24px; box-shadow: -20px 0 50px rgba(0, 0, 0, 0.15); }
.drawer h2 { margin: 4px 0 4px; }
.drawer .close { position: absolute; top: 16px; right: 16px; }
.mini-rows { display: grid; gap: 7px; margin: 14px 0; }
.mini-row { display: grid; grid-template-columns: 1fr 120px 34px; gap: 10px; align-items: center; font-size: 13px; }
.mini-row i { height: 7px; border-radius: 9px; background: var(--paper-3); overflow: hidden; display: block; }
.mini-row i b { display: block; height: 100%; }
.mini-row span:last-child { text-align: right; font-weight: 700; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 14px; margin: 14px 0; }
.kv dt { color: var(--mute); } .kv dd { margin: 0; word-break: break-word; }

/* audit editor */
.ed { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; }
.ed-side { position: sticky; top: 70px; display: grid; gap: 12px; }
.ed-score { text-align: center; padding: 14px 10px 10px; }
.ed-score .gauge-box { color: var(--text); display: flex; justify-content: center; }
.ed-nav { padding: 6px; }
.ed-nav a { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; text-decoration: none; font-size: 13px; font-weight: 600; color: #3a4145; }
.ed-nav a:hover { background: var(--paper-2); }
.ed-nav a.on { background: var(--ink); color: #fff; }
.ed-nav a small { font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 7px; color: #fff; min-width: 30px; text-align: center; }
.ed-nav a .prog { font-size: 11px; opacity: .7; font-weight: 600; }
.ed-nav hr { border: 0; border-top: 1px solid var(--paper-3); margin: 6px 4px; }
.savebar { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--mute); justify-content: center; padding: 4px 0 2px; }
.savebar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.savebar .dot.dirty { background: var(--amber); } .savebar .dot.err { background: var(--red); }
.ed-main { display: grid; gap: 14px; min-width: 0; }
.ed-main h2 { margin: 0 0 4px; font-size: 22px; }
.ed-main .blurb { margin: 0 0 4px; color: var(--mute); font-size: 14px; }
.cp { padding: 16px 18px; border-top: 1px solid var(--paper-3); display: grid; gap: 10px; }
.cp:first-of-type { border-top: 0; }
.cp-top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.cp-top h4 { margin: 0; font-size: 15px; }
.cp-top .good { font-size: 13px; color: var(--mute); margin: 3px 0 0; max-width: 560px; }
.cp-meta { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; flex: none; }
.seg button { border: 0; background: #fff; padding: 8px 12px; font-size: 13px; font-weight: 700; cursor: pointer; color: #3a4145; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--paper-2); }
.seg button.on.v0 { background: var(--red); color: #fff; } .seg button.on.v1 { background: var(--amber); color: #fff; }
.seg button.on.v2 { background: var(--teal); color: #fff; } .seg button.on.v3 { background: var(--green); color: #fff; }
.seg button.on.vna { background: #6c7679; color: #fff; }
.scan-hint { font-size: 13px; background: #eef7fa; border: 1px solid #cfe7ee; color: #0f5e72; border-radius: 10px; padding: 9px 12px; display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.scan-hint button { flex: none; }
.cp textarea { min-height: 54px; }
.cp details summary { cursor: pointer; font-size: 12px; color: var(--mute); font-weight: 600; }
.cp details[open] summary { margin-bottom: 8px; }
.cp.hide-prio { opacity: .85; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; font-size: 13px; }
.facts div { background: var(--paper-2); border-radius: 10px; padding: 10px 12px; }
.facts b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin-bottom: 3px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 60; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); max-width: calc(100% - 32px); }
.toast.bad { background: #b23a30; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--ink); }
.login form { width: min(380px, 100%); background: #fff; border-radius: 22px; padding: 30px; display: grid; gap: 14px; }
.login img { height: 26px; filter: invert(1) hue-rotate(180deg); justify-self: start; }
.rev-out { background: var(--paper-2); border-radius: 12px; padding: 14px 16px; }
.rev-out .money-total { font-size: 32px; }

@media (max-width: 980px) {
  .ed { grid-template-columns: 1fr; }
  .ed-side { position: static; }
  .ed-nav { display: flex; overflow-x: auto; gap: 4px; }
  .ed-nav a { flex: none; }
  .ed-nav hr { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .adm-top nav { margin-left: 0; }
  .adm-top img { display: none; }
  .hide-sm { display: none; }
}
