/* AnvixaAI dashboard — light theme, minusPHI color language. Soft blue-white
   canvas, white surfaces with hairline borders, emerald primary buttons,
   readable tinted status chips per lifecycle state. */
:root {
  --bg: #f5f8fc;
  --surface: #fff;
  --line: rgba(0, 0, 0, 0.08);
  --line-dark: rgba(15, 23, 42, 0.15);
  --ink: #0f172a;
  --muted: #4b5563;
  --faint: #94a3b8;
  --radius: 10px;
  --brand: #026c39;
  --brand-dark: #015a2f;
  --brand-tint: rgba(2, 108, 57, 0.1);
  --blue: #2563eb;
  --amber: #f59e0b;
  --green: #026c39;
  --red: #dc2626;
  --mono: ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
/* The hidden ATTRIBUTE must always win over any author display rule. */
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 14.5px/1.6 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
/* Poppins for display text only — matches anvixa.com's type pairing. */
h1, h2, .brand, .sitename, .statnum, .ringlabel { font-family: 'Poppins', 'Inter', system-ui, sans-serif; }
a { color: inherit; }

header {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; margin: 0 auto; padding: 18px 32px;
}
.brand { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; text-decoration: none; }
.brand span { color: var(--muted); }
.hright { display: flex; align-items: center; gap: 12px; }

main { width: 100%; margin: 0 auto 90px; padding: 0 32px; }

@media (max-width: 640px) {
  header, main { padding-left: 16px; padding-right: 16px; }
  .pagehead { align-items: flex-start; flex-direction: column; }
}

h1 { font-size: 22px; margin: 8px 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 10px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; margin: 0 0 14px;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); font-size: 13.5px; }
.tiny { color: var(--muted); font-size: 12.5px; }
.tiny a { color: var(--muted); }
.tiny a:hover { color: var(--ink); }
.err { color: var(--red); font-size: 13px; margin: 8px 0 0; }
.err.inline { margin: 0; }

input, textarea, select {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line-dark); border-radius: 8px; padding: 10px 13px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
select { cursor: pointer; }
select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
input { flex: 1; min-width: 160px; }
input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { width: 100%; resize: vertical; }

button {
  font: inherit; font-weight: 600; padding: 10px 18px; border: 0;
  border-radius: 8px; cursor: pointer; background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity 0.15s, background 0.15s;
}
button:hover { background: var(--brand-dark); }
button:disabled { opacity: 0.45; cursor: default; }
button.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line-dark); }
button.ghost:hover { background: #f8fafc; opacity: 1; }
button.quiet { background: transparent; color: var(--muted); border: 0; }
button.quiet:hover { color: var(--red); background: transparent; opacity: 1; }
button.small { padding: 7px 13px; font-size: 13px; }
button.wide { width: 100%; }

.spin {
  width: 12px; height: 12px; border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff; border-radius: 50%; animation: rot 0.7s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* status chips: site pending/active + page discovered/crawled/draft/published/error */
.chip {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 10px;
  border-radius: 999px; border: 1px solid rgba(15, 23, 42, 0.12); color: var(--muted);
  background: rgba(15, 23, 42, 0.05); flex: none;
}
.chip.crawled { color: #1d4ed8; border-color: rgba(37, 99, 235, 0.3); background: rgba(37, 99, 235, 0.08); }
.chip.draft { color: #92400e; border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.13); }
.chip.published, .chip.active { color: var(--brand); border-color: rgba(2, 108, 57, 0.3); background: var(--brand-tint); }
.chip.error { color: #b91c1c; border-color: rgba(220, 38, 38, 0.3); background: rgba(220, 38, 38, 0.09); }

/* auth */
.auth { display: flex; justify-content: center; padding-top: 9vh; }
.authcard {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px;
}
.authcard h1 { margin: 0 0 6px; }
.authcard input { width: 100%; margin: 14px 0 10px; }
.authcard .err { min-height: 18px; }

/* sites grid */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 18px; flex-wrap: wrap; }
.pagehead h1 { margin: 0; }
.pagehead p { margin: 2px 0 0; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; margin: 0 0 22px;
}
.sitecard { display: block; text-decoration: none; margin: 0; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.sitecard:hover { border-color: rgba(2, 108, 57, 0.35); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08); transform: translateY(-1px); }
.empty { border: 1px dashed var(--line-dark); border-radius: 12px; text-align: center; padding: 44px 20px; color: var(--muted); background: var(--surface); }

/* Structural skeletons: .skl shimmer lines sized inline and composed inside
   the real component shells so loading states share the bones of the content
   that replaces them. .sk marks a placeholder shell. */
.skl {
  display: block; height: 12px; border-radius: 6px; overflow: hidden; position: relative;
  background: rgba(15, 23, 42, 0.07);
}
.skl::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.65) 50%, transparent 70%);
  animation: shimmer 1.4s infinite; transform: translateX(-100%);
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk { pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .skl::after { animation: none; }
}
.sitename { font-weight: 650; font-size: 16px; }
.cardfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.keychip {
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* site workspace */
.crumb { font-size: 13px; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--ink); }
.sitehead { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; }
.sitehead h1 { margin: 0 0 1px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-dark); margin: 16px 0 20px; }
.tabs a {
  padding: 9px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }

/* pages table */
.tablebar { margin: 0 0 14px; }
.crawlmax { display: inline-flex; align-items: center; gap: 6px; }
.crawlmax input { width: 72px; min-width: 0; flex: none; padding: 6px 8px; }
.tablecard { padding: 4px 0; }
.tscroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line);
}
td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.pathcell { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.actions { white-space: nowrap; text-align: right; }
.actions button { margin-left: 6px; }

/* modal */
.modal-wrap {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px 16px; overflow: auto; animation: fadein 0.15s ease-out;
}
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; width: 100%; max-width: 640px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25); animation: rise 0.18s ease-out;
}
@keyframes fadein { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.modal h2 { margin-top: 0; }
.modal .row { margin-top: 14px; }
.modal .mfoot { justify-content: flex-end; margin-top: 18px; }
textarea.jsonedit {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  min-height: 320px; white-space: pre;
}

pre {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  background: #0f172a; border: 1px solid #0f172a; color: #e2e8f0;
  padding: 13px 15px; border-radius: 8px; overflow-x: auto;
  white-space: pre-wrap; word-break: break-all; margin: 12px 0;
}
code {
  font-family: var(--mono); font-size: 12.5px; color: #334155; background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.05); padding: 1px 6px; border-radius: 5px;
}

/* profile form */
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.field input { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.formsect { margin: 20px 0 10px; }
.formfoot { margin-top: 18px; }
@media (max-width: 640px) { .formgrid { grid-template-columns: 1fr; } }

/* report tab — client-facing readiness report */
.reporthead { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin: 0 0 16px; }
.reporthead h2 { margin: 0 0 2px; }
.statgrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 0 0 12px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; min-width: 0;
}
.statnum {
  font-size: 26px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.25;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.statlabel {
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted); margin-top: 3px;
}
.stat.warn { border-color: rgba(245, 158, 11, 0.45); }
.stat.warn .statnum { color: #92400e; }
.coverbar { height: 6px; background: rgba(15, 23, 42, 0.08); border-radius: 999px; overflow: hidden; margin: 0 0 20px; }
.coverfill { height: 100%; background: var(--brand); border-radius: 999px; }
.chip.changed {
  color: #92400e; border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.13); margin-left: 6px;
}
/* The changed chip is a BUTTON (click → what-changed explainer). */
button.chip.changed { font: inherit; font-size: 11px; cursor: pointer; }
button.chip.changed:hover { text-decoration: underline; opacity: 1; }
.chip.generating {
  color: #1d4ed8; border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.08); margin-left: 0; gap: 7px;
}
.statusspin {
  width: 9px; height: 9px; display: inline-block; border-radius: 50%;
  border: 1.5px solid rgba(37, 99, 235, 0.25); border-top-color: #2563eb;
  animation: rot .7s linear infinite;
}
.reportcard td { font-variant-numeric: tabular-nums; }

/* entities tab — coverage strip, row editors, sticky save bar */
.checkstrip { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.check {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  font-weight: 600; padding: 4px 11px; border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12); color: var(--faint); background: rgba(15, 23, 42, 0.04);
}
.check.on { color: var(--brand); border-color: rgba(2, 108, 57, 0.3); background: var(--brand-tint); }
.entlist { display: flex; flex-direction: column; gap: 12px; margin: 0 0 12px; }
.entrow { background: #fbfdff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.entrow .row { gap: 8px; margin-top: 10px; justify-content: flex-end; }
.savebar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center;
  gap: 12px; border-top: 1px solid var(--line); background: rgba(245, 248, 252, 0.92);
  backdrop-filter: blur(6px); padding: 12px 0;
}

/* print — the Report tab doubles as a clean client-facing document */
@media print {
  body { background: #fff; color: #000; }
  header, nav, .tabs, .tablebar, button, .crumb, .noprint { display: none !important; }
  .card, .stat, .tablecard { background: #fff; border-color: #bbb; color: #000; }
  table { color: #000; }
  th { color: #333; border-bottom-color: #bbb; }
  td { border-bottom-color: #ddd; }
  .muted, .tiny, .statlabel, td.muted, .pathcell { color: #333; }
  .statnum { color: #000; }
  .stat.warn { border-color: #b58a2f; }
  .stat.warn .statnum { color: #7a5410; }
  .chip { background: none !important; border: 1px solid #999 !important; color: #000 !important; }
  .coverbar { background: #eee; border: 1px solid #ccc; }
  .coverfill { background: #000; }
  a { color: #000; text-decoration: none; }
}


/* row hover (pages + report tables) */
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: #f8fafc; }
.morebtn { font-size: 16px; letter-spacing: 2px; padding: 7px 10px; }

/* popover row menu */
.popmenu {
  position: absolute; z-index: 200; min-width: 170px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.16);
}
.popitem {
  display: block; width: 100%; text-align: left; background: transparent;
  color: var(--ink); font-weight: 500; padding: 8px 12px; border-radius: 7px;
}
.popitem:hover { background: var(--bg); opacity: 1; }
.popitem:disabled { opacity: 0.35; }
.popitem.danger { color: var(--red); }
.popitem.danger:hover { background: rgba(220, 38, 38, 0.05); }

/* entity accordion */
.entcount {
  font: 600 11px/1 'Inter', system-ui, sans-serif; color: var(--muted);
  background: #eef2f7; border: 1px solid rgba(15, 23, 42, 0.08); border-radius: 999px;
  padding: 3px 9px; vertical-align: 2px; margin-left: 6px;
}
/* In the entities section nav the count hugs the right edge; n/a = declared
   not-applicable (service business, no products). */
.setnav .entcount { margin-left: auto; }
.entcount.na { color: var(--faint); background: transparent; text-transform: uppercase; letter-spacing: 0.04em; }
.enthead {
  display: flex; width: 100%; align-items: center; gap: 12px; text-align: left;
  background: transparent; color: var(--ink); padding: 12px 14px; border-radius: 8px;
  font-weight: 500;
}
.enthead:hover { background: #f8fafc; opacity: 1; }
.entname { font-weight: 600; flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entsub { color: var(--muted); font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entchev { color: var(--faint); flex: none; transition: transform 0.15s; }
.entrow.open > .enthead .entchev { transform: rotate(180deg); }
.entrow.open > .enthead { background: #f1f5f9; border-radius: 8px 8px 0 0; }
.entbody { padding: 14px; border-top: 1px solid var(--line); }
.entbody .row { margin-top: 10px; justify-content: flex-end; }

/* coverage bar inside its stat tile */
.stat .coverbar { margin: 10px 0 8px; }

/* guided setup stepper (onboard.js) — shown above the tabs until the site
   is live; one active step at a time, done steps collapse to checks. */
.obcard { padding: 20px 22px 16px; border-color: rgba(2, 108, 57, 0.22); background: linear-gradient(180deg, #f8fcfa, #fff); }
.obhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.obhead h2 { margin: 0 0 2px; }
.obsteps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0 14px; }
.obstep {
  display: inline-flex; align-items: center; gap: 8px; background: transparent;
  border: 0; padding: 6px 8px; border-radius: 8px; color: var(--faint);
  font-weight: 600; font-size: 12.5px;
}
.obstep:hover { background: rgba(15, 23, 42, 0.045); opacity: 1; }
.obdot {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 700;
  border: 1px solid var(--line-dark); color: var(--muted); background: #fff;
}
.obstep.done .obdot { border-color: rgba(2, 108, 57, 0.45); color: var(--brand); background: var(--brand-tint); }
.obstep.on { color: var(--ink); }
.obstep.on .obdot { border-color: var(--brand); color: #fff; background: var(--brand); }
.obstep.done .oblabel { color: var(--muted); }
.obline { flex: 1; min-width: 14px; height: 1px; background: rgba(15, 23, 42, 0.12); }
.obline.done { background: rgba(2, 108, 57, 0.45); }
.obbody { border-top: 1px solid var(--line); padding-top: 14px; }
.obbody p { margin: 0 0 12px; }
.obbody pre { margin: 0 0 12px; }
.btnlink {
  display: inline-flex; align-items: center; font-weight: 600; font-size: 14px;
  background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 8px;
  text-decoration: none;
}
.btnlink:hover { background: var(--brand-dark); }
.btnlink.ghostlink { background: #fff; color: var(--ink); border: 1px solid var(--line-dark); }
.btnlink.ghostlink:hover { background: #f8fafc; }
.setuphint { color: #92400e; }
@media (max-width: 720px) { .oblabel { display: none; } .obstep.on .oblabel { display: inline; } }

/* ---- Setup & settings: one section at a time behind a sticky settings nav on
   the left — replaces the scroll-forever stack of cards. Below 900px the nav
   becomes a horizontal chip strip above the section. Ported from minusPHI. ---- */
.setwrap { display: grid; grid-template-columns: 216px minmax(0, 860px); gap: 24px; align-items: start; }
.setnav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; }
.setnav a {
  display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none;
  border: 1px solid transparent; white-space: nowrap;
}
.setnav a:hover { color: var(--ink); background: rgba(15, 23, 42, 0.045); }
.setnav a.on { background: #fff; color: var(--brand); border-color: var(--line); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06); }
.setnav a.danger { color: #b91c1c; }
.setnav a.danger:hover { color: var(--red); background: rgba(220, 38, 38, 0.05); }
.setnav a.danger.on { color: var(--red); }
/* Glanceable state on a nav item: green = live, amber = needs attention. */
.setnav .sn-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-left: auto; }
.sn-dot.ok { background: #10b981; }
.sn-dot.warn { background: #f59e0b; }
@media (max-width: 900px) {
  .setwrap { display: block; }
  .setnav {
    position: static; flex-direction: row; gap: 6px; margin: 0 0 14px; padding-bottom: 4px;
    overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  }
  .setnav::-webkit-scrollbar { display: none; }
  .setnav a { flex: none; background: #fff; border-color: var(--line-dark); border-radius: 99px; padding: 7px 13px; font-size: 13px; }
  .setnav a.on { background: var(--brand-tint); border-color: var(--brand); box-shadow: none; }
  .setnav .sn-dot { margin-left: 2px; }
}
.danger-zone { border-color: rgba(220, 38, 38, 0.3); }
.danger-zone .del { color: var(--red); border-color: rgba(220, 38, 38, 0.35); }

/* Opt-in toggle line (online-only address declaration) */
.checkline { display: flex; align-items: center; gap: 9px; margin: 2px 0 12px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.checkline input { width: 15px; min-width: 0; height: 15px; padding: 0; accent-color: var(--brand); margin: 0; flex: none; cursor: pointer; }

/* Pages status card: heading ("X of Y pages live"), one sentence saying what
   is left, ONE button that finishes it. The progress line sits under the
   button and only speaks after a run (errors, stalls, done-with-failures). */
.autocard { padding: 20px 22px 18px; margin-bottom: 14px; }
.autocard h2 { margin: 0 0 4px; }
.autocard p { margin: 0; max-width: 560px; text-wrap: pretty; }
.autocard .autocopy { margin-bottom: 14px; }
.autocard .autorow { align-items: center; gap: 10px; }
.autocard .autostat { display: block; min-height: 18px; margin-top: 8px; }

/* Automatic-setup progress bar (replaces the spinner-in-button). The fill
   width and status text are updated IN PLACE between full repaints
   (autorun.js paintAutoProgress) — an animation that restarts on every
   rerender is exactly what read as a stuck spinner. */
.autoprog { max-width: 560px; padding: 10px 0 2px; }
.autoprog .bar {
  height: 8px; border-radius: 999px; background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.autoprog .bar i {
  display: block; height: 100%; border-radius: 999px; background: var(--brand);
  position: relative; overflow: hidden; transition: width 0.5s ease;
}
/* liveness sweep across the filled part — motion even while a page renders */
.autoprog .bar i::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: sweep 1.8s ease-in-out infinite;
}
/* crawling / publishing: no per-item count — a block sweeping in ONE
   direction, wrapping around while fully off-screen. A ping-pong bounce
   reads as progress filling and then un-filling. */
.autoprog .bar i.indet { width: 38%; animation: barscan 1.6s ease-in-out infinite; }
.autoprog .bar i.indet::after { animation: none; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
/* NOT named 'scan' — the onboarding scanner beam defines keyframes with that
   name further down, which would override these document-wide (last
   definition wins) and bob the fill vertically instead. */
@keyframes barscan { from { margin-left: -40%; } to { margin-left: 102%; } }
/* All caught up: the card gives way to one slim line — the state of the
   world, a quiet re-scan, nothing that begs to be pressed. */
.donecard {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 18px; margin-bottom: 14px; font-size: 13.5px;
}
.donecard .donemark { color: var(--brand); font-weight: 700; flex: none; }
.donecard .donetext { flex: 1 1 260px; min-width: 0; text-wrap: pretty; }
.donecard #rescan { flex: none; }

/* Pages multi-select: checkbox column + the selection toolbar that appears
   once anything is checked. */
.selcell { width: 30px; padding-right: 2px; }
.selcell input { width: 15px; min-width: 0; height: 15px; padding: 0; accent-color: var(--brand); margin: 0; vertical-align: middle; cursor: pointer; }
.selbar {
  align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 14px;
  background: var(--brand-tint); border: 1px solid rgba(2, 108, 57, 0.25); border-radius: 10px;
}
.selbar #selcount { font-weight: 600; font-size: 13px; margin-right: 4px; }
.selbar .seldel { color: var(--red); border-color: rgba(220, 38, 38, 0.35); }
.selbar button.ghost { background: #fff; }

/* edit-schema modal — Simple/Advanced toggle + plain-language form */
.modal.wide { max-width: 720px; }
.segtoggle {
  display: inline-flex; border: 1px solid var(--line-dark); border-radius: 8px;
  overflow: hidden; margin: 2px 0 0;
}
.segtoggle button {
  background: transparent; color: var(--muted); border: 0; border-radius: 0;
  padding: 7px 16px; font-size: 13px;
}
.segtoggle button + button { border-left: 1px solid var(--line-dark); }
.segtoggle button:hover { color: var(--ink); background: transparent; opacity: 1; }
.segtoggle button.on { background: var(--brand); color: #fff; } /* keep after :hover — same specificity, later wins */
.editsect {
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted); margin: 18px 0 8px;
}
.editsect:first-child { margin-top: 8px; }

/* pages tablebar: manual add-page control */
.addpage { display: inline-flex; align-items: center; gap: 6px; }
.addpage input { width: 200px; min-width: 0; flex: none; padding: 6px 8px; }

/* Structured opening-hours editor (hours.js, Business profile): one row per
   day — Open checkbox · from/to time inputs — with quick presets above.
   Closed rows dim their times and show "Closed" instead. */
.hourseditor .hpresets { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.hourseditor .hgrid { border: 1px solid var(--line-dark); border-radius: 10px; overflow: hidden; background: #fff; }
.hrow {
  display: flex; align-items: center; gap: 14px;
  padding: 7px 14px; border-top: 1px solid var(--line);
}
.hrow:first-child { border-top: 0; }
.hrow .hday {
  display: flex; align-items: center; gap: 9px; width: 130px; flex: none;
  font-size: 13.5px; color: var(--ink); cursor: pointer;
}
.hrow .hday input { width: 15px; min-width: 0; height: 15px; padding: 0; accent-color: var(--brand); margin: 0; flex: none; cursor: pointer; }
.hrow .htimes { display: flex; align-items: center; gap: 8px; }
.hrow .htimes input[type='time'] { width: 116px; min-width: 0; flex: none; padding: 5px 8px; font-variant-numeric: tabular-nums; }
.hrow .hto { font-size: 12.5px; color: var(--muted); }
.hrow .hclosed { display: none; color: var(--faint, var(--muted)); }
.hrow.closed .hday span { color: var(--muted); }
.hrow.closed .htimes { display: none; }
.hrow.closed .hclosed { display: inline; }
.hextra { margin-top: 8px; color: var(--muted); }
.hextra code { font-size: 12px; }
@media (max-width: 480px) {
  .hrow { gap: 10px; padding: 7px 10px; }
  .hrow .hday { width: 104px; }
  .hrow .htimes input[type='time'] { width: 100px; }
}

/* ---- First-run focus: the crawl-then-choose screen a new site shows before
   any workspace exists. A mini page skeleton with a sweeping scan beam while
   crawling; a centered count + two buttons once pages are found. ---- */
.firstrun { text-align: center; padding: 44px 24px 38px; max-width: 720px; margin: 26px auto 0; }
.firstrun h2 { font-size: 19px; margin: 0 0 6px; letter-spacing: -0.01em; }
.firstrun p { max-width: 480px; margin: 0 auto; text-wrap: pretty; }
.firstrun p + p { margin-top: 10px; }
.firstrun .frrow { justify-content: center; margin-top: 18px; }
.frfoot { text-align: center; margin-top: 18px; }

.scanframe { width: 170px; margin: 0 auto 22px; }
.scanpage {
  position: relative; height: 208px; overflow: hidden; background: #fff;
  border: 1px solid var(--line-dark); border-radius: 10px; padding: 18px 16px 0;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}
.scanline {
  display: block; height: 9px; border-radius: 5px;
  background: rgba(15, 23, 42, 0.07); margin: 0 0 12px;
}
.scanline.w50 { width: 50%; } .scanline.w60 { width: 60%; } .scanline.w75 { width: 75%; }
.scanline.w80 { width: 80%; } .scanline.w85 { width: 85%; } .scanline.w90 { width: 90%; }
.scanpage .scanline:first-child { height: 14px; background: rgba(15, 23, 42, 0.12); margin-bottom: 16px; }
.scanbeam {
  position: absolute; left: 0; right: 0; top: -18%; height: 42px; pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 108, 57, 0) 0%, rgba(2, 108, 57, 0.14) 55%, rgba(2, 108, 57, 0.4) 100%);
  border-bottom: 2px solid var(--brand);
  animation: scan 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes scan {
  0% { top: -22%; }
  55% { top: 96%; }
  100% { top: -22%; }
}
#scanmsg { min-height: 22px; transition: opacity 0.3s; }
.scancount {
  font-family: 'Poppins', 'Inter', system-ui, sans-serif; font-weight: 700;
  font-size: 44px; line-height: 1; color: var(--brand); margin: 6px 0 12px;
}
@media (prefers-reduced-motion: reduce) {
  .scanbeam { animation: none; top: 40%; }
}
