/* Get Booked by Contracting Empire — dark navy, gold gradient, Gelasio headings, Inter body. */
:root {
  --bg: #162231;
  --deep: #0c1725;
  --panel: #19232f;
  --card: linear-gradient(180deg, #2c3a4d, #19232f);
  --surface: #1f2b3a;
  --ink: #ffffff;
  --copy: #c5ccd5;
  --dim: #8d99a8;
  --gold: #e0b85c;
  --gold-bright: #fece85;
  --gradient: linear-gradient(150deg, #b58b2a 0%, #f3d58a 30%, #fff1c1 50%, #e0b85c 70%, #a0741d 100%);
  --line: #ffffff20;
  --line-strong: #ffffff35;
  --gold-line: #e0b85c88;
  --good: #3ddc84;
  --bad: #ff5c5c;
  --shadow: 0 0 20px 2px #0005;
  --serif: "Gelasio", Georgia, serif;
  --sans: "Inter", Arial, sans-serif;
  --btn-ink: #1e2e4a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Anchoring off: journey steps are added in view, so the page should grow downward under the reader. */
html { scroll-behavior: smooth; overflow-anchor: none; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 var(--sans);
}
/* Short pages still put the footer at the bottom of the screen. */
body > main { flex: 1 0 auto; }
img { max-width: 100%; }
button, input { font: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 4px;
}
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 12px; top: 12px; background: var(--bg); color: #fff; padding: 8px 12px; z-index: 20; }
.shell { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.gold {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kicker {
  margin: 0 0 18px;
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

/* ---------- buttons ---------- */
.btn, .url-row button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 14px 24px;
  border: 0;
  border-radius: 5px;
  background: var(--gradient);
  color: var(--btn-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s;
}
.btn:hover, .url-row button:hover { transform: translateY(-2px); }
.url-row button:disabled { opacity: 0.55; cursor: wait; transform: none; }
.ghost-btn {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--gold);
  border-radius: 5px;
  background: transparent;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}
.ghost-btn:hover { background: #e0b85c22; }
a.ghost-btn { text-decoration: none; white-space: nowrap; }
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

/* ---------- header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(22, 34, 49, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.topbar-inner { display: flex; align-items: center; gap: 18px; min-height: 84px; }
.brand { display: flex; align-items: center; margin-right: auto; text-decoration: none; }
.brand-logo { width: 190px; height: auto; display: block; }
.topbar-note {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  margin: 0;
  color: var(--copy);
  font-size: 12px;
}
.topbar-note::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-bright);
}

/* ---------- hero ---------- */
#composer, #report, .report-cover { scroll-margin-top: 84px; }
.hero {
  padding: 72px 0 84px;
  background: radial-gradient(ellipse at 85% 0%, rgba(224, 184, 92, 0.12), transparent 50%);
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.8fr);
  gap: 70px;
  align-items: center;
}
.hero h1 {
  margin: 0 0 25px;
  font-family: var(--serif);
  font-size: clamp(36px, 4.5vw, 62px);
  font-weight: 700;
  line-height: 1.13;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.lede { margin: 0 0 22px; color: var(--copy); font-size: 17px; max-width: 600px; }
.intake {
  position: relative;
  padding: 36px;
  border: 1px solid var(--gold-line);
  border-radius: 13px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.intake::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid #ffffff15;
  border-radius: 7px;
  pointer-events: none;
}
.intake label {
  display: block;
  margin-bottom: 14px;
  color: var(--gold-bright);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.url-row { position: relative; display: flex; flex-direction: column; gap: 12px; }
.url-row input {
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #0c1725aa;
  color: #fff;
}
.url-row input::placeholder { color: var(--dim); }
.url-row input:focus { outline: 2px solid var(--gold); outline-offset: 0; }
.intake-status { position: relative; margin: 14px 0 0; color: var(--gold-bright); font-size: 13px; }

/* ---------- progress / errors / banners ---------- */
.progress-wrap, .error-banner {
  margin: 40px auto;
  padding: 32px;
  border: 1px solid var(--gold-line);
  border-radius: 13px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.progress-wrap h2, .error-banner h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.steps { display: grid; gap: 10px; padding: 0; margin: 22px 0; list-style: none; }
.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff08;
  color: var(--dim);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.steps li::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
}
.steps li.active { border-color: var(--gold); background: #e0b85c1f; color: #fff; }
.steps li.active::before {
  border-color: var(--gold-bright);
  border-right-color: transparent;
  animation: step-spin 0.9s linear infinite;
}
.steps li.done { color: var(--copy); }
.steps li.done::before {
  content: "✓";
  display: grid;
  place-items: center;
  border: 0;
  background: var(--gradient);
  color: var(--btn-ink);
  font-size: 11px;
  font-weight: 800;
}
@keyframes step-spin { to { transform: rotate(360deg); } }
.progress-note, .error-banner p { color: var(--copy); }
/* ---------- report cover ---------- */
.report-cover { padding: 56px 0 40px; }
.cover-grid { display: flow-root; }
.homepage-preview { width: min(860px, 100%); margin: 30px auto 8px; }
#headline {
  margin: 0 0 22px;
  max-width: 26ch;
  font-family: var(--serif);
  font-size: clamp(26px, 2.7vw, 38px);
  font-weight: 700;
  line-height: 1.13;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.exec { max-width: 64ch; margin: 0 0 28px; color: var(--copy); font-size: 17px; }
.device-stage { position: relative; padding: 0 0 36px 0; }
.browser-frame {
  overflow: hidden;
  margin-right: 70px;
  border: 1px solid var(--gold-line);
  border-radius: 13px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: #0c1725;
  border-bottom: 1px solid var(--line);
}
.browser-bar span { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #ffffff30; }
.browser-url {
  flex: 1;
  min-width: 0;
  margin: 0 0 0 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #ffffff12;
  color: var(--copy);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser-view { height: 440px; overflow-y: auto; background: #fff; scrollbar-width: thin; }
.browser-view img, .phone-view img { display: block; width: 100%; height: auto; }
.phone-frame {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 170px;
  padding: 7px;
  border: 1px solid var(--gold-line);
  border-radius: 26px;
  background: var(--deep);
  box-shadow: 0 18px 40px #000a;
}
.phone-view { height: 340px; overflow-y: auto; border-radius: 20px; background: #fff; scrollbar-width: none; }
.phone-view::-webkit-scrollbar { display: none; }
.browser-view:focus-visible, .phone-view:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.homepage-preview.desktop-only .browser-frame { margin-right: 0; }
.homepage-preview.desktop-only .device-stage { padding-bottom: 0; }
.homepage-preview.mobile-only .device-stage { padding-bottom: 0; display: flex; justify-content: center; }
.homepage-preview.mobile-only .phone-frame { position: static; width: 200px; }
.homepage-preview.mobile-only .phone-view { height: 400px; }
/* Wide screens: the phone sticks out past the computer view's right edge. */
@media (min-width: 901px) {
  .homepage-preview { width: min(900px, 100% - 80px); }
  .homepage-preview .browser-frame { margin-right: 0; }
  .homepage-preview .browser-view { height: min(470px, 42vw); }
  .homepage-preview .device-stage { padding-bottom: 40px; }
  .homepage-preview .phone-frame { right: -40px; width: 185px; }
  .homepage-preview .phone-view { height: 370px; }
  .homepage-preview.mobile-only .phone-frame { width: 220px; }
  .homepage-preview.mobile-only .phone-view { height: 440px; }
}

/* ---------- overall score ---------- */
.score-label {
  margin: 0;
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}
.score-status { margin: 4px 0 0; color: var(--copy); font-size: 14px; }

/* Score colors: --tone / --tone-soft are set per element from the score (red → green). */
.score-band {
  --tone: #8d99a8;
  --tone-soft: #ffffff14;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  width: min(80%, 940px);
  margin: 0 auto;
  padding: 30px 34px;
  border: 1px solid var(--gold-line);
  border-radius: 13px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.final-lead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: min(80%, 940px);
  margin: 40px auto 22px;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  text-align: center;
}
.final-lead::before, .final-lead::after {
  content: "";
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.final-lead::after { background: linear-gradient(90deg, var(--gold), transparent); }
.score-dial {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  background:
    radial-gradient(closest-side, #222f40 76%, transparent 77%),
    conic-gradient(var(--tone) calc(var(--pct, 0) * 1%), var(--tone-soft) 0);
}
.score-dial-num { font-family: var(--serif); font-size: 50px; font-weight: 700; line-height: 1; color: var(--tone); }
.score-dial-max { margin-top: 4px; color: var(--copy); font-size: 11px; }
.score-verdict {
  margin: 6px 0 0;
  color: var(--tone);
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.scale { position: relative; margin-top: 18px; max-width: 540px; }
.scale-bar {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5c5c 0 40%, #ff8a3d 40% 60%, #f6b93b 60% 75%, #8bc34a 75% 90%, #3ddc84 90%);
}
.scale-marker {
  position: absolute;
  top: -5px;
  left: calc(var(--pct, 0) * 1%);
  width: 20px;
  height: 20px;
  margin-left: -10px;
  border-radius: 50%;
  background: var(--bg);
  border: 4px solid var(--tone);
  box-shadow: 0 2px 8px #0008;
}
.scale-labels {
  display: grid;
  grid-template-columns: 40fr 20fr 15fr 15fr 10fr;
  margin-top: 6px;
  color: var(--dim);
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

/* ---------- report sections ---------- */
.block { margin: 0; padding: 56px 0; border-top: 1px solid var(--line); }
.block-head { margin: 0 0 28px; max-width: 760px; }
.block-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.block-head p { margin: 8px 0 0; color: var(--copy); font-size: 15px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.card {
  --tone: #8d99a8;
  --tone-soft: #ffffff14;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.card h4 { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.3; }
.card p { margin: 0; }

/* homeowner visit: vertical journey */
.visit-timeline { position: relative; width: min(100%, 1160px); margin: 0 auto; padding: 0; list-style: none; }
.visit-step {
  --tone: #8d99a8;
  --tone-soft: #ffffff14;
  position: relative;
  scroll-margin-top: 110px;
}
.visit-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 3px solid var(--tone);
  border-radius: 13px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tone) 8%, transparent), transparent 45%), var(--card);
  box-shadow: var(--shadow);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.visit-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 24px 28px; }
.visit-tech { border-left: 1px solid var(--line); background: #0000001f; }
.side-label { margin: 0; color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.side-sub { margin: 4px 0 0; color: var(--gold-bright); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }

/* One header row for both columns. It stays under the top bar while the steps scroll past,
   and leaves with the last step because it is sticky inside .visit-board. */
.visit-board { position: relative; }
.visit-columns {
  position: sticky;
  top: 84px;
  z-index: 6;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: min(100%, 1160px);
  margin: 0 auto 26px;
  padding: 16px 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(22, 34, 49, 0.97);
  box-shadow: 0 0 0 100vmax rgba(22, 34, 49, 0.97);
  clip-path: inset(0 -100vmax);
}
.col-head {
  margin: 0;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: clamp(24px, 2.3vw, 32px);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
}
.col-head-leads { grid-column: 1; text-align: center; }
.col-head-issue { grid-column: 2; color: #fff; text-align: center; }
/* Phones stack the two sides, so each card gets its own header bands instead of the sticky row. */
.col-title { display: none; }

/* left: what the leads do */
.lead-title {
  margin: 26px 0 6px;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: clamp(17px, 1.5vw, 21px);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}
/* On the light panel the step title and "Outcome" read as label pills. */
.visit-client .lead-title,
.visit-client .lead-outcome .side-sub {
  display: inline-block;
  align-self: center;
  padding: 7px 16px;
  border: 1px solid #8a641859;
  border-radius: 999px;
  background: #8a64181a;
  color: #6e4f10;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
}
.lead-voice {
  position: relative;
  margin: 12px 0 0;
  padding: 0 0 0 30px;
  color: #fff;
  font-family: var(--serif);
  font-size: clamp(19px, 1.7vw, 23px);
  font-style: italic;
  line-height: 1.5;
}
.lead-voice::before {
  content: "“";
  position: absolute;
  top: -10px;
  left: 0;
  color: var(--tone);
  font-size: 56px;
  font-style: normal;
  line-height: 1;
}
.lead-outcome { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.outcome-text { margin: 8px 0 0; color: #fff; font-size: 15.5px; line-height: 1.55; }
/* The homeowner's side is a light panel, so it reads apart from the dark technical side. */
.visit-client { background: linear-gradient(160deg, #f6f8fa 0%, #e2e7ed 100%); }
.visit-client .lead-voice { color: #1b2735; }
.visit-client .lead-outcome { border-top-color: #1b273522; }
.visit-client .lead-outcome { text-align: center; }
.visit-client .lead-outcome .side-sub { margin: 4px 0 0; }
.visit-client .outcome-text {
  margin-top: 10px;
  color: #1b2735;
  font-family: var(--serif);
  font-size: clamp(17px, 1.45vw, 20px);
  font-weight: 600;
  line-height: 1.5;
}
.estimate {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 1px;
}

/* right: what is the issue (technical) */
.tech-score { display: flex; align-items: center; gap: 14px; }
.tech-score strong { display: block; color: var(--tone); font-family: var(--serif); font-size: 18px; line-height: 1.2; }
.tech-score div span { display: block; color: var(--dim); font-size: 12px; }
.tech-speed { margin: 0; color: var(--copy); font: 13px/1.55 var(--sans); }
.tech-speed a { color: var(--gold-bright); font-family: var(--sans); }
.tech-issues { display: grid; gap: 6px; }
.tech-issue { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.tech-issue[open] { border-color: var(--gold-line); }
.tech-issue summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.tech-issue summary::-webkit-details-marker { display: none; }
.tech-issue summary::after { content: "+"; margin-left: auto; color: var(--dim); font-size: 16px; font-weight: 400; }
.tech-issue[open] summary::after { content: "−"; }
.tech-issue ul { display: grid; gap: 6px; margin: 0; padding: 0 12px 12px 30px; color: var(--copy); font-size: 12.5px; line-height: 1.5; }
.tech-issue a { color: var(--gold-bright); }
.tech-src { display: block; color: var(--dim); font: 11.5px/1.4 var(--sans); }
.tech-sev { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.sev-high { background: #ff5c5c; box-shadow: 0 0 6px #ff5c5c88; }
.sev-medium { background: #f6b93b; }
.sev-low { background: #8bc34a; }
.tech-checks { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.tech-check {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.tech-check:hover, .tech-check:focus-visible { background: #ffffff0a; outline: none; }
.tech-check strong { color: #fff; font-size: 13.5px; font-weight: 600; }
.tech-grade { float: right; color: var(--tone); font: 700 12px var(--sans); font-variant-numeric: tabular-nums; }
.tech-reason {
  display: -webkit-box;
  overflow: hidden;
  color: var(--copy);
  font-size: 12.5px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.tech-check.open .tech-reason { display: block; }
.tech-check.unchecked { opacity: 0.6; }
.pips { display: inline-flex; gap: 3px; margin-top: 5px; }
.pips i { width: 8px; height: 8px; border-radius: 2px; background: #ffffff1a; }
.pips i.on { background: var(--tone); }
.tech-none { margin: 0; color: var(--copy); font-size: 13px; }

.visit-link {
  margin: 0;
  padding: 30px 4px 32px;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
}

/* Scroll focus: the step crossing the middle of the screen gets a soft glow; every step stays fully visible. */
.visit-card {
  transition: transform 0.45s ease, box-shadow 0.45s ease, border-color 0.45s ease;
}
.visit-step.active .visit-card {
  border-color: var(--gold-line);
  border-left-color: var(--tone);
  box-shadow: 0 18px 40px #0007, 0 0 22px color-mix(in srgb, var(--tone) 8%, transparent);
}
.score-pill {
  flex: none;
  min-width: 58px;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--tone);
  color: #0c1725;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}
.score-pill.muted { background: var(--tone-soft); color: var(--copy); font-family: var(--sans); font-size: 11px; padding: 8px 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.meter { height: 6px; border-radius: 999px; background: var(--tone-soft); overflow: hidden; }
.meter span { display: block; height: 100%; width: calc(var(--pct, 0) * 1%); background: var(--tone); border-radius: inherit; }

/* what to fix */
.action-card { border-top: 3px solid var(--tone); }
.action-num {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 2px solid var(--tone);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 11px var(--tone-soft);
  color: var(--tone);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
}
.card .area { color: var(--gold-bright); font-size: 10px; font-weight: 700; letter-spacing: 0.17em; text-transform: uppercase; }
.plain-row { color: var(--copy); font-size: 14px; }
.plain-row strong { display: block; margin-bottom: 2px; color: #fff; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.chip {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--copy);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.chip.tone { border-color: var(--tone); color: var(--tone); }
.card-grid.fixes { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
/* Labels sit in a fixed-height footer pinned to the bottom, so they line up across a row. */
.action-card .chips {
  box-sizing: border-box;
  min-height: 80px;
  align-content: flex-start;
  margin: auto -24px -26px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: #00000024;
}
.action-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fix-first-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff6b6b, #e04646);
  box-shadow: 0 0 12px rgba(255, 92, 92, 0.35);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.action-card.fix-first { border-color: var(--gold-line); border-top-color: var(--tone); }
.load-more-row { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 30px; }
.load-more-row[hidden] { display: none; }
.evidence-toggle { color: var(--copy); font-size: 13px; }
.evidence-toggle summary { display: flex; align-items: center; gap: 8px; color: var(--gold-bright); font-weight: 600; cursor: pointer; }
.evidence-count {
  min-width: 20px;
  padding: 1px 6px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  font-size: 11px;
  text-align: center;
}
.evidence-toggle ul { display: grid; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.evidence-toggle li { padding: 10px 12px; border-left: 2px solid var(--gold-line); border-radius: 0 8px 8px 0; background: #ffffff08; }
.evidence-toggle li p { margin: 0; color: #e3e8ee; line-height: 1.55; }
.evidence-toggle .evidence-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; color: var(--dim); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.evidence-toggle a { color: var(--gold-bright); text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }

.empty-card { color: var(--copy); }

/* ---------- check groups: GBP, website, paid ads, AI ranking ---------- */
.check-groups { display: grid; gap: 14px; padding: 8px 0 20px; }
.check-group { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.check-group[open] { border-color: var(--gold-line); }
.check-group > summary {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
}
.check-group > summary::-webkit-details-marker { display: none; }
.check-group > summary::after {
  content: "";
  grid-column: -2;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--gold-bright);
  border-bottom: 2px solid var(--gold-bright);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.2s;
}
.check-group[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
.check-group > summary:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; border-radius: 14px; }
.group-num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--btn-ink);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
}
.check-group.soon .group-num { background: #ffffff14; color: var(--dim); }
.group-text { display: flex; flex-direction: column; min-width: 0; }
.group-text strong { color: #fff; font-family: var(--serif); font-size: 22px; line-height: 1.2; text-transform: uppercase; }
.group-text span { color: var(--copy); font-size: 13.5px; }
.group-status {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.group-body { padding: 0 22px 10px; border-top: 1px solid var(--line); }
.group-soon { margin: 0 22px 22px; padding: 26px; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; }
.group-soon .kicker { margin-bottom: 8px; }
.group-soon p:last-child { max-width: 640px; margin: 0 auto; color: var(--copy); }
@media (max-width: 650px) {
  .check-group > summary { grid-template-columns: 36px minmax(0, 1fr) 14px; gap: 12px; padding: 16px; }
  .group-num { width: 36px; height: 36px; font-size: 17px; }
  .group-status { grid-column: 2; grid-row: 2; justify-self: start; }
  .group-text strong { font-size: 18px; }
  .group-body { padding: 0 12px 6px; }
}

/* ---------- report views ---------- */
#report[data-view="issues"] [data-view-only="homeowner"],
#report[data-view="homeowner"] [data-view-only="issues"] { display: none !important; }
.view-bar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 22px; }
.view-bar label { color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.view-bar select {
  min-width: 200px;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: var(--deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fece85' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: #fff;
  font: 600 14px var(--sans);
  appearance: none;
  cursor: pointer;
}
.view-bar select:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; }

/* Issues view */
.issue-steps { display: grid; gap: 16px; }
.problem-card {
  --state: #ff5c5c;
  --state-text: #ff8a8a;
  --state-soft: rgba(255, 92, 92, 0.13);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid var(--state);
  border-radius: 13px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.problem-card.state-ok { --state: #3ddc84; --state-text: #6fe7a5; --state-soft: rgba(61, 220, 132, 0.1); }
.problem-card.state-unchecked { --state: #8d99a8; --state-text: #c4ccd6; --state-soft: rgba(255, 255, 255, 0.04); }
.problem-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 28px;
  border-right: 1px solid var(--line);
  background: var(--state-soft);
}
.problem-icon {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--state);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.problem-side h4 { margin: 0; color: var(--state-text); font-family: var(--serif); font-size: 26px; line-height: 1.15; text-transform: uppercase; }
.problem-side p { margin: 0; color: #fff; font-size: 15.5px; line-height: 1.55; }
.problem-body { display: flex; flex-direction: column; gap: 10px; padding: 26px 28px; }
.problem-body .side-sub { margin: 0; }
.problem-body .side-sub ~ .side-sub { margin-top: 12px; }
.issues-more {
  align-self: flex-start;
  margin-top: 2px;
  padding: 8px 16px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: transparent;
  color: var(--gold-bright);
  font: 700 12px var(--sans);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.issues-more:hover { border-color: var(--gold); background: #ffffff08; }
.issues-more:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.conclusion-card {
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.conclusion { margin-top: 20px; }
.conclusion-card { border-left: 5px solid var(--tone); }
.conclusion-card h4 { margin: 6px 0 8px; color: #fff; font-family: var(--serif); font-size: clamp(24px, 2.6vw, 34px); text-transform: uppercase; }
.conclusion-card p { margin: 0; color: var(--copy); font-size: 16px; line-height: 1.6; }
.conclusion-big { margin-top: 14px !important; }
.conclusion-big strong { color: var(--tone); font-family: var(--serif); font-size: 44px; vertical-align: -6px; }
@media (max-width: 900px) {
  .problem-card { grid-template-columns: 1fr; }
  .problem-side { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px; }
  .problem-side h4 { font-size: 22px; }
  .problem-body { padding: 20px 22px; }
}

/* ---------- scan costs page ---------- */
.costs-page { padding: 56px 0 40px; }
.costs-page h1 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(32px, 3.6vw, 48px);
  font-weight: 700;
  line-height: 1.13;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.costs-page .lede { margin: 0 0 32px; color: var(--copy); max-width: 64ch; }
.costs-page code { color: var(--gold-bright); }
.cost-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 36px; }
.cost-summary article {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.cost-summary .num { margin: 6px 0 0; font-family: var(--serif); font-size: 34px; font-weight: 700; line-height: 1.1; }
.cost-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.cost-toolbar h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.cost-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cost-table th, .cost-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cost-table thead th { color: var(--gold-bright); font-size: 10px; letter-spacing: 0.17em; text-transform: uppercase; white-space: nowrap; }
.cost-table tbody tr:last-child td { border-bottom: 0; }
.cost-table .money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cost-table .total { font-weight: 700; }
.cost-table .sub { display: block; color: var(--dim); font-size: 12px; }
.cost-table .site,
.cost-table .business { min-width: 150px; max-width: 260px; overflow-wrap: break-word; }
.cost-table .email { max-width: 220px; overflow-wrap: anywhere; font-size: 13px; }
.cost-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 12px;
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.purchase-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.plan-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}
.purchase-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.pref-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}
.pref-row input { margin-top: 3px; }
.profile-role {
  margin: 0 0 10px;
  color: var(--dim);
  font-size: 12px;
  text-transform: capitalize;
}
.status-pill {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--good);
  border-radius: 4px;
  color: var(--good);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status-pill.failed { border-color: var(--bad); color: var(--bad); }
.status-pill.queued { border-color: var(--gold); color: var(--gold-bright); }
.status-pill.running { border-color: #6ea8fe; color: #9ec1ff; }
.cost-empty { margin: 0; padding: 28px; color: var(--copy); }
.open-report {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 5px;
  background: var(--gradient);
  color: var(--btn-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.open-report:hover { filter: brightness(1.05); }
.report-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.delete-report {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}
.delete-report svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.delete-report:hover { border-color: #ff5c5c; background: #ff5c5c1a; color: #ff8a8a; }
.delete-report:disabled { opacity: 0.5; cursor: wait; }
.sum-note { margin: 4px 0 0; color: var(--dim); font-size: 12px; }
.rerun-menu {
  position: relative;
  display: inline-flex;
}
.rerun-report {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--gold);
  border-radius: 5px;
  background: transparent;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.rerun-report svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rerun-report:hover,
.rerun-menu.is-open .rerun-report { background: #e0b85c22; }
.rerun-report:disabled { opacity: 0.55; cursor: wait; }
.rerun-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(340px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #141820;
  box-shadow: 0 18px 40px #00000088;
}
.rerun-popover-head {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}
.rerun-popover-head strong {
  font-size: 13px;
  color: #fff;
}
.rerun-popover-head span {
  color: var(--dim);
  font-size: 12px;
}
.rerun-popover-loading,
.rerun-empty {
  margin: 0;
  color: var(--dim);
  font-size: 13px;
}
.rerun-whole {
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: var(--gradient);
  color: var(--btn-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.rerun-whole:disabled,
.rerun-selected:disabled { opacity: 0.55; cursor: wait; }
.rerun-or {
  margin: 12px 0 8px;
  color: var(--dim);
  font-size: 12px;
}
.rerun-cats {
  display: grid;
  gap: 6px;
}
.rerun-cat {
  border: 1px solid #ffffff12;
  border-radius: 8px;
  background: #0f131a;
}
.rerun-cat > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
}
.rerun-cat > summary::-webkit-details-marker { display: none; }
.rerun-cat-check,
.rerun-task {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  color: #e8ecf4;
  font-size: 12px;
  line-height: 1.35;
}
.rerun-cat-check input,
.rerun-task input {
  margin-top: 2px;
}
.rerun-tasks {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px 28px;
}
.rerun-miss {
  margin-left: 6px;
  color: #e0b85c;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.rerun-popover-actions {
  margin-top: 12px;
}
.rerun-selected {
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.rerun-selected:not(:disabled):hover { background: #e0b85c22; }
.rerun-popover-status {
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 12px;
}
.rerun-popover-status.is-error { color: #ff8a8a; }
.cost-footnote { margin: 16px 0 0; color: var(--dim); font-size: 13px; }

/* ---------- footer ---------- */
.footer { margin-top: 40px; padding: 32px 0; background: var(--deep); color: var(--copy); font-size: 12px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.footer-logo { width: 165px; height: auto; display: block; }
.footer p { margin: 0; max-width: 640px; text-align: right; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .visit-timeline, .score-band, .final-lead { width: 100%; }
  .visit-card { grid-template-columns: 1fr; }
  .visit-tech { border-left: 0; }
  .col-title {
    display: block;
    margin: 0;
    padding: 12px 20px;
    font-family: var(--serif);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
  }
  .col-title-leads { background: #e7d8b6; color: #5f430c; }
  .col-title-found { border-top: 3px solid var(--tone); border-bottom: 1px solid var(--line); background: #0b1420; color: var(--gold-bright); }
  .visit-client .lead-title { margin-top: 14px; }
  .visit-columns { display: none; }
  .hero-grid, .cost-summary { grid-template-columns: 1fr; }
  .hero-grid { gap: 36px; }
  .homepage-preview { margin-top: 22px; }
  .browser-view { height: 330px; }
  .phone-frame { width: 140px; }
  .phone-view { height: 270px; }
  .card-grid.fixes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-band { grid-template-columns: auto minmax(0, 1fr); padding: 22px; gap: 20px; }
  .score-dial { width: 104px; height: 104px; }
  .score-dial-num { font-size: 38px; }
  .card-grid { grid-template-columns: 1fr; }
  .topbar-note { display: none; }
  .hero { padding: 44px 0 56px; }
  #headline { max-width: none; }
}

@media (max-width: 650px) {
  .shell { width: calc(100% - 40px); }
  .topbar-inner { min-height: 72px; gap: 10px; }
  .brand-logo { width: 140px; }
  .ghost-btn { padding: 8px 10px; font-size: 10px; }
  .card-grid.fixes { grid-template-columns: 1fr; }
  .intake { padding: 26px; }
  .visit-side { padding: 20px 18px; }
  .visit-link { font-size: 14px; }
  .scale-labels { display: flex; justify-content: space-between; }
  .scale-labels span:nth-child(n + 2):nth-child(-n + 4) { display: none; }
  .block { padding: 44px 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer p { text-align: left; }
}

/* ---------- sign in ---------- */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(circle at 70% 10%, #2c3a4d 0%, var(--bg) 55%);
}
.login-card {
  width: min(420px, 100%);
  padding: 40px 36px;
  border: 1px solid var(--gold-line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}
.login-logo { width: 200px; height: auto; }
.login-card h1 { margin: 22px 0 4px; font-family: var(--serif); font-size: 30px; text-transform: uppercase; }
.login-lede { margin: 0 0 24px; color: var(--copy); font-size: 14px; }
.login-error { margin: 0 0 18px; padding: 10px 12px; border: 1px solid #ff5c5c88; border-radius: 8px; background: #ff5c5c1a; color: #ffc4c4; font-size: 13px; }
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  border-radius: 6px;
  background: #fff;
  color: #1f1f1f;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s;
}
.google-btn:hover { transform: translateY(-2px); }
.google-btn svg { width: 20px; height: 20px; }
.login-note { margin: 18px 0 0; color: var(--dim); font-size: 12px; }
.login-providers {
  display: grid;
  gap: 10px;
}
.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.oauth-btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.oauth-btn.google:hover { background: #ffffff12; }
.oauth-btn.facebook {
  background: #1877f2;
  border-color: #1877f2;
  color: #fff;
}
.oauth-btn.facebook:hover { filter: brightness(1.05); }
.oauth-btn.apple {
  background: #111;
  border-color: #111;
  color: #fff;
}
.oauth-btn.apple:hover { filter: brightness(1.1); }
.google-btn { display: none; }

/* ---------- settings panel ---------- */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: transparent;
  color: var(--gold-bright);
  cursor: pointer;
  transition: background 0.2s, transform 0.4s;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: #e0b85c22; transform: rotate(45deg); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
body.settings-open { overflow: hidden; }
.settings-layer { position: fixed; inset: 0; z-index: 40; }
.settings-backdrop { position: absolute; inset: 0; background: #0c1725b3; backdrop-filter: blur(3px); animation: fade-in 0.2s ease; }
.settings-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(580px, 100%);
  border-left: 1px solid var(--gold-line);
  background: var(--panel);
  box-shadow: -20px 0 50px #0008;
  animation: slide-in 0.25s ease;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.settings-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px 12px; }
.settings-head h2 { margin: 0; font-family: var(--serif); font-size: 26px; text-transform: uppercase; }
.settings-close { border: 0; background: none; color: var(--copy); font-size: 30px; line-height: 1; cursor: pointer; }
.settings-close:hover { color: #fff; }
.settings-tabs { display: flex; gap: 4px; padding: 0 26px; border-bottom: 1px solid var(--line); }
.settings-tabs button {
  padding: 12px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.settings-tabs button[aria-selected="true"] { border-bottom-color: var(--gold); color: var(--gold-bright); }
.settings-pane { display: flex; flex: 1; flex-direction: column; min-height: 0; padding: 20px 26px 24px; overflow-y: auto; }
.pane-intro { margin: 0 0 16px; color: var(--copy); font-size: 14px; }
.ghost-btn.small { min-height: 34px; padding: 6px 12px; font-size: 10px; }

.agent-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.agent-model { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.agent-model select {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--deep);
  color: #fff;
  font: 13px var(--sans);
  letter-spacing: 0;
  text-transform: none;
}
.agent-note { margin: 12px 0; color: var(--dim); font-size: 12px; }
.agent-log { display: flex; flex: 1; flex-direction: column; gap: 12px; min-height: 200px; padding: 4px 2px 12px; overflow-y: auto; }
.agent-empty { margin: auto 0; color: var(--copy); font-size: 14px; text-align: center; }
.bubble { max-width: 88%; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.55; }
.bubble p { margin: 0; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; border-bottom-right-radius: 4px; background: #e0b85c26; border: 1px solid var(--gold-line); }
.bubble.assistant { align-self: flex-start; border-bottom-left-radius: 4px; background: var(--surface); border: 1px solid var(--line); }
.bubble.error { border-color: #ff5c5c88; color: #ffb3b3; }
.bubble-time { display: block; margin-top: 6px; color: var(--dim); font-size: 10px; }
.bubble-files { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; color: var(--dim); font-size: 11px; }
.bubble.thinking { display: flex; gap: 5px; padding: 14px 16px; }
.bubble.thinking span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-bright); opacity: 0.35; animation: think 1.1s ease-in-out infinite; }
.bubble.thinking span:nth-child(2) { animation-delay: 0.15s; }
.bubble.thinking span:nth-child(3) { animation-delay: 0.3s; }
@keyframes think { 30% { opacity: 1; transform: translateY(-3px); } }
.file-chip { padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--copy); font-size: 11px; }
.agent-form { display: flex; gap: 10px; align-items: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
.agent-form textarea {
  flex: 1;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--deep);
  color: #fff;
  font: 14px/1.5 var(--sans);
  resize: vertical;
}
.agent-form textarea:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 1px; }
.agent-form button {
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 5px;
  background: var(--gradient);
  color: var(--btn-ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.agent-form button:disabled { opacity: 0.5; cursor: wait; }

.md-list, .history-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.md-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.md-item:hover, .md-item:focus-visible { border-color: var(--gold-line); outline: none; }
.md-main { display: flex; flex-direction: column; min-width: 0; }
.md-main strong { color: #fff; font-size: 15px; }
.md-path { color: var(--dim); font-size: 11px; overflow-wrap: anywhere; }
.md-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--copy); font-size: 12px; }
.md-by { color: var(--dim); }
.md-by:not(:empty)::before { content: "· "; }
.bubble code { padding: 1px 5px; border-radius: 4px; background: #0003; font-size: 12.5px; overflow-wrap: anywhere; }
.md-tip {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(100% + 6px);
  z-index: 2;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  background: var(--deep);
  box-shadow: var(--shadow);
  color: var(--copy);
  font-size: 13px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
}
.md-item:hover .md-tip, .md-item:focus-visible .md-tip { opacity: 1; transform: none; }

.history-item { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.history-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; color: var(--dim); font-size: 12px; }
.history-when { color: var(--gold-bright); font-weight: 600; }
.history-body { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; }
.history-summary { flex: 1; min-width: 0; margin: 0; overflow: hidden; color: #e3e8ee; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.history-item.expanded .history-summary { white-space: normal; }
.history-expand {
  flex: none;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: none;
  color: var(--gold-bright);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s;
}
.history-item.expanded .history-expand { transform: rotate(90deg); }
.history-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.history-files:empty { display: none; }
.history-empty, .md-error { color: var(--copy); font-size: 14px; }

.agent-total {
  display: grid;
  gap: 2px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(211, 152, 71, 0.18), rgba(211, 152, 71, 0.04));
}
.agent-total span { color: var(--gold-bright); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.agent-total strong { font-family: var(--serif); font-size: 34px; line-height: 1.2; }
.agent-total small { color: var(--dim); font-size: 12px; }
.cost-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cost-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.cost-item > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.cost-meta { color: var(--dim); font-size: 12px; overflow-wrap: anywhere; }
.cost-amounts { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.cost-amounts strong { color: #fff; font-size: 15px; }
.cost-amounts span { color: var(--dim); font-size: 11px; }
.profile { position: relative; }
.profile-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--btn-ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--gold-line);
}
.profile-btn:hover, .profile-btn[aria-expanded="true"] { filter: brightness(1.08); }
.profile-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 30;
  width: 260px;
  padding: 16px;
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 18px 40px #0009;
}
.profile-label { margin: 0; color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.profile-email { margin: 4px 0 14px; color: #fff; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.profile-signout {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.profile-signout:hover { border-color: var(--gold); background: #e0b85c22; }
.md-viewer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; }
.md-viewer-backdrop { position: absolute; inset: 0; background: #0c1725cc; backdrop-filter: blur(4px); animation: fade-in 0.2s ease; }
.md-viewer-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(900px, 100%);
  max-height: min(88vh, 1000px);
  border: 1px solid var(--gold-line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 30px 80px #000a;
  animation: pop-in 0.2s ease;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.md-viewer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 26px 16px; border-bottom: 1px solid var(--line); }
.md-viewer-head h3 { margin: 0; font-family: var(--serif); font-size: 24px; }
.md-viewer-meta { margin: 2px 0 0; color: var(--dim); font-size: 12px; overflow-wrap: anywhere; }
.md-viewer-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.md-viewer-body { overflow-y: auto; padding: 22px 30px 30px; }
.md-plain { margin: 0; color: #e3e8ee; font: 13px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.md-doc { color: #dfe5ec; font-size: 15px; line-height: 1.7; }
.md-doc p { margin: 0 0 12px; }
.md-doc .md-h { margin: 26px 0 10px; color: #fff; font-family: var(--serif); font-weight: 700; line-height: 1.3; }
.md-doc .md-h:first-child { margin-top: 0; }
.md-doc .md-h1 { font-size: 28px; text-transform: uppercase; }
.md-doc .md-h2 { padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--gold-bright); font-size: 21px; }
.md-doc .md-h3 { font-size: 17px; }
.md-doc .md-h4, .md-doc .md-h5, .md-doc .md-h6 { color: var(--gold-bright); font-family: var(--sans); font-size: 14px; }
.md-doc ul, .md-doc ol { margin: 0 0 14px; padding-left: 22px; }
.md-doc li { margin-bottom: 4px; }
.md-doc code { padding: 1px 6px; border-radius: 4px; background: #0005; color: var(--gold-bright); font-size: 13px; }
.md-doc pre { margin: 0 0 14px; padding: 14px 16px; border-radius: 8px; background: var(--deep); overflow-x: auto; }
.md-doc pre code { padding: 0; background: none; color: #e3e8ee; }
.md-doc blockquote { margin: 0 0 12px; padding: 8px 14px; border-left: 3px solid var(--gold); background: #e0b85c12; color: var(--copy); }
.md-doc hr { margin: 22px 0; border: 0; border-top: 1px solid var(--line); }
.md-table { margin: 0 0 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.md-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.md-table th, .md-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.md-table th { background: #ffffff0d; color: var(--gold-bright); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.md-table tr:last-child td { border-bottom: 0; }
.bubble .md p { margin: 0 0 8px; }
.bubble .md p:last-child { margin-bottom: 0; }
.bubble .md .md-h { margin: 12px 0 6px; color: var(--gold-bright); font-weight: 700; }
.bubble .md .md-h:first-child { margin-top: 0; }
.bubble .md ul, .bubble .md ol { margin: 0 0 8px; padding-left: 20px; }
.bubble .md li { margin-bottom: 3px; }

@media (max-width: 650px) {
  .settings-head, .settings-pane { padding-inline: 18px; }
  .settings-tabs { padding-inline: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* Report timing column + breakdown */
.cost-table .time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.timing-toggle {
  display: block;
  margin-top: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--gold-bright);
  font-size: 12px;
  cursor: pointer;
}
.timing-toggle:hover { border-color: var(--gold); }
.timing-row td { background: #ffffff05; }
.timing-panel { display: grid; gap: 14px; }
.timing-head { margin: 0; color: var(--dim); font-size: 13px; }
.timing-cat { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.timing-cat header { display: grid; grid-template-columns: minmax(140px, 200px) 1fr auto; gap: 12px; align-items: center; }
.timing-bar { height: 6px; border-radius: 999px; background: #ffffff12; overflow: hidden; }
.timing-bar span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.timing-cat h5 { margin: 12px 0 6px; color: var(--dim); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
.timing-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.timing-list li { display: grid; grid-template-columns: minmax(140px, 1fr) auto auto; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed #ffffff10; }
.timing-list li:last-child { border-bottom: 0; }
.timing-call .timing-name .sub { display: block; }
.timing-call.is-shared .timing-name { color: var(--gold-bright); }
.timing-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.timing-tag { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); font-size: 11px; white-space: nowrap; }
.timing-tag.is-shared { border-color: var(--gold); color: var(--gold-bright); }
.timing-sec { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink, inherit); text-align: right; min-width: 52px; }
