/* OptiScan — warm, calm operate system.
   Paper neutrals, one indigo accent, hairline structure, status colour only for status. */
:root {
  --paper: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --line: #e7e4de;
  --line-soft: #efece6;
  --divider: #f1eee9;
  --hover: #f3f1ec;
  --hover-2: #f5f3ef;
  --input-border: #ddd9d1;
  --dash-border: #d6d2ca;

  --ink: #1a1a1f;
  --ink-2: #64615a;
  --ink-3: #6e6a63;
  --muted: #8e8a82;
  --disabled: #bdb9b1;

  --accent: #4b4fd1;
  --accent-hover: #3d40b5;
  --accent-tint: #eeeefc;
  --progress-track: #e1e2f9;

  --ok: #1c7a4c; --ok-bg: #e6f4ec; --ok-dot: #2f9e62;
  --warn: #9a5b00; --warn-bg: #fcf1de; --warn-dot: #d08a1e;
  --bad: #b42318; --bad-bg: #fdecea; --bad-dot: #d9443a;

  --nav-bg: #17171c; --nav-border: #26262c; --nav-active: #2a2a31;
  --nav-text-off: #b3b1ba; --nav-icon-off: #85838d;
  --nav-card: #1f1f25; --nav-card-border: #2a2a31; --nav-card-sub: #a9a7b0; --nav-link: #a5a7f5;

  --r-card: 12px; --r-btn: 9px; --r-input: 9px; --r-pill: 6px; --r-ico: 10px; --r-dd: 10px;
  --sh-btn: 0 1px 2px rgba(16, 24, 40, .12);
  --sh-card: 0 2px 10px rgba(26, 26, 31, .05);
  --sh-dd: 0 8px 24px rgba(26, 26, 31, .12);

  --display: "Poppins", ui-sans-serif, system-ui, sans-serif;
  --sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-tint); color: var(--accent); }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; }
svg { display: block; }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.dim { color: var(--muted); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--nav-bg); color: #fff; border-right: 1px solid var(--nav-border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.scrim { position: fixed; inset: 0; background: rgba(15, 20, 30, .35); opacity: 0; pointer-events: none; z-index: 39; transition: opacity .2s; }

.brand { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 18px; border-bottom: 1px solid var(--nav-border); flex: 0 0 auto; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.brand-name { font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: #fff; }
.brand-logo { height: 34px; width: auto; display: block; }
.auth-brand .brand-logo-lg { height: 44px; width: auto; display: block; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 11px; border-radius: 7px;
  color: var(--nav-text-off); font-weight: 500; font-size: 15px; font-family: var(--sans);
  background: none; border: none; cursor: pointer; width: 100%; text-align: left;
  transition: background .14s, color .14s;
}
.nav-item .icon { width: 16px; height: 16px; flex: 0 0 auto; stroke: var(--nav-icon-off); }
.nav-item:hover { background: #202027; color: #fff; }
.nav-item:hover .icon { stroke: #cfcdd6; }
.nav-item.active { background: var(--nav-active); color: #fff; }
.nav-item.active .icon { stroke: #fff; }
.nav-count { margin-left: auto; font-size: 13px; color: var(--nav-icon-off); font-variant-numeric: tabular-nums; }
.nav-item.active .nav-count { color: var(--nav-text-off); }
.nav-divider { height: 1px; background: var(--nav-border); margin: 8px 6px; }

.nav-foot { margin-top: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.side-plan { background: var(--nav-card); border: 1px solid var(--nav-card-border); border-radius: var(--r-dd); padding: 14px; }
.side-plan .sp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.side-plan .sp-title { font-size: 14px; font-weight: 600; color: #fff; }
.side-plan .sp-link { font-size: 14px; color: var(--nav-link); background: none; border: none; padding: 0; cursor: pointer; font-family: var(--sans); flex: 0 0 auto; }
.side-plan .sp-link:hover { text-decoration: underline; }
.side-plan .sp-body { font-size: 13px; color: var(--nav-card-sub); line-height: 1.5; }

.account { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.account-meta { min-width: 0; flex: 1; }
.account-name { font-size: 14px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-plan { font-size: 13px; color: var(--nav-card-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linkbtn { background: none; border: none; color: var(--nav-icon-off); cursor: pointer; padding: 6px; border-radius: 7px; flex: 0 0 auto; }
.linkbtn:hover { color: #fff; background: #222229; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 64px; flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 0 32px;
  background: rgba(246, 245, 242, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 15px; color: var(--muted); min-width: 0; }
.crumbs .sep { color: var(--disabled); }
.crumbs .root { background: none; border: none; color: var(--ink-3); cursor: pointer; padding: 0; font: inherit; }
.crumbs .root:hover { color: var(--accent); }
.crumbs .cur { color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topsearch { position: relative; width: 280px; flex: 0 0 auto; }
.topsearch .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--muted); }
.topsearch input { height: 40px; padding: 0 44px 0 36px; border-radius: var(--r-input); border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.topsearch .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; background: var(--surface-2); pointer-events: none; }
.menu-btn { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; background: none; border: none; color: var(--ink); cursor: pointer; margin-left: -10px; }

/* ---------- Content + footer ---------- */
.content { padding: 28px 32px; max-width: 1240px; width: 100%; container-type: inline-size; container-name: content; }
.content > * + * { margin-top: 24px; }
.content > *:empty { display: none; }
.site-credit { margin-top: auto; padding: 18px 32px 22px; text-align: right; font-size: 14px; color: var(--muted); max-width: 1240px; width: 100%; }
.site-credit a { color: var(--ink-3); }
.site-credit a:hover { color: var(--accent); }

/* ---------- Headings ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-head h1 { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.page-head .sub { color: var(--ink-2); margin-top: 7px; font-size: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-btn); font-size: 15px; font-weight: 500;
  font-family: var(--sans); border: 1px solid var(--input-border); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: background .14s, border-color .14s, color .14s; white-space: nowrap;
}
.btn:hover { background: var(--hover-2); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn .icon { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--sh-btn); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn.big { height: 50px; font-size: 16px; font-weight: 600; width: 100%; }
.btn.danger { color: var(--bad); border-color: #eccbc7; background: var(--surface); }
.btn.danger:hover { background: var(--bad-bg); }
.btn:disabled { opacity: 0.55; cursor: default; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; }
.card + .card { margin-top: 16px; }
#ovroot > * + * { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { font-family: var(--display); font-size: 17px; font-weight: 600; }

/* ---------- Pills / status ---------- */
.pill { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 8px; border-radius: var(--r-pill); font-size: 14px; font-weight: 500; background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--disabled); }
.pill.completed { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.pill.completed .dot { background: var(--ok-dot); }
.pill.running, .pill.queued { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.pill.running .dot, .pill.queued .dot { background: var(--warn-dot); }
.pill.failed { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.pill.failed .dot { background: var(--bad-dot); }
.pill.accent { color: var(--accent); background: var(--accent-tint); border-color: transparent; }
.pill.accent .dot { background: var(--accent); }
.pill.none { color: var(--ink-3); }

.cat-pill { font-size: 13px; font-weight: 500; padding: 3px 9px; border-radius: var(--r-pill); color: var(--ink-3); background: var(--surface-2); }
.cat-pill.statistics { color: #4b4fd1; background: #eeeefc; }
.cat-pill.marketing { color: #9a5b00; background: #fcf1de; }
.cat-pill.preferences, .cat-pill.functional { color: #4a4843; background: #f0eee9; }
.cat-pill.necessary { color: #1c7a4c; background: #e6f4ec; }
.cat-pill.unclassified { color: var(--ink-3); background: var(--surface-2); }

/* ---------- Sites toolbar ---------- */
.sites-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg { display: flex; gap: 2px; }
.seg-btn { background: none; border: none; cursor: pointer; font: inherit; font-size: 15px; font-weight: 500; color: var(--ink-3); height: 46px; padding: 0 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { color: var(--ink); border-bottom-color: var(--accent); }
.seg-btn .c { color: var(--muted); font-size: 14px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.searchbox { position: relative; width: 300px; max-width: 100%; margin: 8px 0; }
.searchbox .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--muted); }
.searchbox input { height: 40px; padding: 0 12px 0 36px; border-radius: var(--r-input); border: 1px solid var(--line); background: var(--surface); font-size: 14px; }

/* ---------- Site cards ---------- */
.site-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 700px) { .site-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .site-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.site-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); text-align: left; width: 100%; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; position: relative; }
.site-card:hover { border-color: var(--dash-border); box-shadow: var(--sh-card); }
.sc-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 16px; }
.favbox { flex: 0 0 auto; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ico); overflow: hidden; }
.favbox img { width: 100%; height: 100%; object-fit: contain; }
.favbox .fav-letter { font-family: var(--display); font-weight: 600; color: var(--ink-2); }
.sc-fav { width: 40px; height: 40px; }
.sc-fav .fav-letter { font-size: 16px; }
.sc-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sc-dom { display: block; font-size: 16px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.sc-sub { display: block; }
.sc-sub { font-size: 14px; color: var(--muted); margin-top: 0; }
.sc-sub.never { color: var(--bad); }
.sc-menu { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; background: none; border: none; border-radius: 8px; color: var(--muted); cursor: pointer; }
.sc-menu:hover { background: var(--hover); color: var(--ink-2); }

.sc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); padding: 16px 14px; }
.sc-stat { display: flex; align-items: center; gap: 8px; padding: 0 8px; flex-wrap: wrap; border-left: 1px solid var(--line-soft); }
.sc-stat:first-child { border-left: none; }
.sc-ico { width: 40px; height: 40px; flex: 0 0 auto; border-radius: var(--r-ico); border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; box-shadow: 0 1px 2px rgba(26, 26, 31, .04); }
.sc-ico .icon { width: 22px; height: 22px; stroke: var(--accent); stroke-width: 1.75; }
.sc-stat .t { display: flex; flex-direction: column; justify-content: center; height: 40px; }
.sc-num { font-size: 18px; font-weight: 600; line-height: 20px; font-variant-numeric: tabular-nums; color: var(--ink); }
.sc-lab { font-size: 13px; line-height: 16px; color: var(--ink-3); }

.sc-cta { padding: 0 20px 20px; }
.sc-cta p { margin: 0 0 20px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.sc-prog { border-top: 1px solid var(--line-soft); padding: 16px 20px; }
.sc-prog-top { display: flex; align-items: center; justify-content: space-between; font-size: 14px; margin-bottom: 10px; }
.sc-prog-top b { color: var(--accent); font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 4px; background: var(--progress-track); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.sc-foot { margin-top: auto; display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--line-soft); padding: 12px 20px; font-size: 14px; color: var(--ink-2); }
.sc-foot .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--disabled); }
.sc-foot.on .dot { background: var(--ok-dot); }

.empty-tile { border: 1px dashed var(--dash-border); border-radius: var(--r-card); padding: 40px 24px; text-align: center; color: var(--ink-3); font-size: 15px; }

/* card dropdown menu */
.cardmenu { position: absolute; z-index: 30; width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-dd); box-shadow: var(--sh-dd); padding: 4px; }
.cardmenu button { display: flex; width: 100%; align-items: center; gap: 10px; height: 38px; padding: 0 10px; background: none; border: none; border-radius: 7px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; text-align: left; }
.cardmenu button:hover { background: var(--hover); }
.cardmenu .icon { width: 16px; height: 16px; stroke: var(--ink-3); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab { background: none; border: none; cursor: pointer; height: 46px; padding: 0 12px; color: var(--ink-3); font-size: 15px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- Site detail head ---------- */
.site-head { display: flex; align-items: flex-start; gap: 16px; }
.site-head .favbox { width: 44px; height: 44px; }
.site-head .favbox .fav-letter { font-size: 18px; }
.sh-main { flex: 1; min-width: 0; }
.sh-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sh-title h1 { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; overflow-wrap: anywhere; }
.sh-url { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-family: var(--mono); font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.sh-url .icon { width: 14px; height: 14px; stroke: var(--muted); }
.sh-actions { display: flex; gap: 10px; flex: 0 0 auto; flex-wrap: wrap; }

.scan-banner { background: #f6f6fe; border: 1px solid #dadbf7; border-radius: var(--r-card); padding: 16px 18px; }
.scan-banner .sb-top { display: flex; align-items: center; justify-content: space-between; font-size: 15px; margin-bottom: 10px; }
.scan-banner b { color: var(--accent); font-variant-numeric: tabular-nums; }
.scan-banner .bar { height: 4px; }

/* ---------- Overview ---------- */
.ov-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.ov-status { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ov-sentence { font-size: 17px; line-height: 1.5; color: var(--ink); margin: 0 0 20px; }
.ov-sentence strong { font-weight: 600; }
.ov-breakdown { border-top: 1px solid var(--line); padding-top: 16px; }
.ov-blabel { font-size: 13px; font-weight: 600; color: var(--ink-3); display: block; margin-bottom: 10px; }
.pillrow { display: flex; gap: 8px; flex-wrap: wrap; }

.getstarted { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.gs-step { padding: 18px; border-left: 1px solid var(--line); }
.gs-step:first-child { border-left: none; }
.gs-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.gs-mark.done { background: var(--ok-bg); color: var(--ok); }
.gs-mark.done .icon { width: 15px; height: 15px; stroke: var(--ok); }
.gs-mark.active { background: var(--accent-tint); color: var(--accent); }
.gs-mark.todo { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }
.gs-step b { font-size: 15px; font-weight: 600; display: block; margin-bottom: 4px; }
.gs-step p { margin: 0 0 14px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ck-item { display: flex; gap: 11px; align-items: flex-start; }
.ck-mark { width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.ck-mark.done { background: var(--ok-bg); color: var(--ok); }
.ck-mark.done .icon { width: 14px; height: 14px; stroke: var(--ok); }
.ck-mark.todo { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }
.ck-txt { display: flex; flex-direction: column; gap: 2px; font-size: 15px; padding-top: 1px; }
.ck-txt b { font-weight: 600; }
.ck-txt .dim { font-size: 14px; }
.ck-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

.hist { list-style: none; margin: 0; padding: 0; }
.hist-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.hist-row:first-child { border-top: none; }
.hist-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hist-date { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.hist-sub { font-size: 13px; color: var(--muted); }
.hist-row .pill { flex: 0 0 auto; }

.consent-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 16px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.consent-n { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.consent-l { font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.consent-rows { display: flex; flex-direction: column; gap: 15px; }
.crow-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 7px; }
.crow-bar { height: 6px; background: var(--progress-track); border-radius: 4px; overflow: hidden; }
.crow-bar span { display: block; height: 100%; background: var(--accent); }

/* ---------- KPI strip (scanned overview) + admin keytiles ---------- */
.kpi-box { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.kpi-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1160px) { .kpi-4 { grid-template-columns: repeat(4, 1fr); } }
.kpi-3 { grid-template-columns: 1fr; }
@media (min-width: 560px) { .kpi-3 { grid-template-columns: repeat(3, 1fr); } }
.kpi-cell { background: var(--surface); padding: 18px 20px; }
.kpi-cell .l { font-size: 14px; color: var(--ink-3); }
.kpi-cell .n { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi-cell .n.zero { color: #a19d95; }
.kpi-cell .n.big { font-size: 30px; }
.kpi-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 15px; font-weight: 500; }
.kpi-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--disabled); }
.kpi-status.ok { color: var(--ok); } .kpi-status.ok .dot { background: var(--ok-dot); }
.kpi-status.warn { color: var(--warn); } .kpi-status.warn .dot { background: var(--warn-dot); }

.queue-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 20px; font-size: 15px; }
.queue-row .health { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.queue-row .health .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok-dot); }
.queue-row .qitem b { font-variant-numeric: tabular-nums; font-weight: 600; margin-left: 4px; }
.queue-row .qitem { color: var(--ink-2); }

/* feature list (overview trackers) */
.find-list { display: flex; flex-direction: column; }
.find-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.find-row:first-child { border-top: none; }
.find-row .fm { flex: 1; min-width: 0; }
.find-row .fn { font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.find-row .fv { font-size: 14px; color: var(--muted); }
.find-row .fc { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Stats (legacy) ---------- */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 18px; }
.stat .n { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 14px; color: var(--ink-3); margin-top: 4px; }

/* ---------- Tables ---------- */
.table { border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; background: var(--surface); }
.tr { display: grid; gap: 12px; padding: 15px 18px; align-items: center; border-top: 1px solid var(--line); font-size: 15px; }
.tr:first-child { border-top: none; }
.tr.head { background: var(--surface-2); color: var(--ink-3); font-size: 14px; font-weight: 500; }
.tr.find { grid-template-columns: 90px 1fr auto; }
.tr.orgrow { grid-template-columns: 1.6fr 1fr .6fr .9fr auto; }
.tr.scanrow { grid-template-columns: 1.5fr .8fr .5fr auto; }
.tr .mono { font-family: var(--mono); font-size: 14px; }
.tr .kind { color: var(--ink-3); font-size: 14px; }
.tr .right { text-align: right; font-variant-numeric: tabular-nums; }
.scan-link { background: none; border: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; }

/* ---------- Forms ---------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); font-weight: 500; }
input, select, textarea {
  width: 100%; height: 40px; padding: 0 12px; font: inherit; font-size: 15px; background: var(--surface);
  border: 1px solid var(--input-border); border-radius: var(--r-input); color: var(--ink);
  transition: border-color .14s, box-shadow .14s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 64px; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e6a63' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 16px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.colorrow { display: flex; gap: 8px; align-items: center; }
.colorrow input[type="color"] { width: 44px; height: 40px; padding: 3px; cursor: pointer; }
.colorrow input[type="text"] { flex: 1; font-family: var(--mono); }
.form-actions { display: flex; align-items: center; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.save-status { font-size: 14px; color: var(--ok); }

/* ---------- Snippet ---------- */
.snippet { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; font-family: var(--mono); font-size: 14px; color: #35455a; white-space: pre-wrap; word-break: break-all; line-height: 1.75; }
.copy-btn { position: absolute; top: 10px; right: 10px; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 50px 24px; }
.empty .ico { width: 48px; height: 48px; margin: 0 auto 18px; color: var(--accent); background: var(--accent-tint); border-radius: 12px; display: grid; place-items: center; }
.empty .ico .icon { width: 24px; height: 24px; }
.empty h3 { font-family: var(--display); font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.empty p { color: var(--ink-2); max-width: 440px; margin: 0 auto 22px; font-size: 15px; }
.empty .btn { display: inline-flex; }
.steps { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.step { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); }
.step b { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; color: var(--ink-2); font-weight: 600; }

/* ---------- Skeleton ---------- */
.skel { background: linear-gradient(90deg, #efece6 25%, #f6f5f2 37%, #efece6 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 10px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Banner preview ---------- */
.preview { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; display: grid; place-items: center; }
.pv-card { width: 100%; max-width: 340px; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--sh-dd); border: 1px solid var(--line); color: #1b1a16; }
.pv-top { display: flex; align-items: center; gap: 8px; padding: 12px 15px; border-bottom: 1px solid #ededed; }
.pv-logo { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: 12px; overflow: hidden; }
.pv-logo img { width: 100%; height: 100%; object-fit: cover; }
.pv-name { font-weight: 600; font-size: 14px; font-family: var(--display); }
.pv-body { padding: 14px 15px; }
.pv-body h4 { margin: 0 0 6px; font-size: 15px; }
.pv-body p { margin: 0; font-size: 13px; color: #5b5d70; line-height: 1.5; }
.pv-actions { display: flex; gap: 8px; padding: 0 15px 15px; }
.pv-btn { flex: 1; text-align: center; padding: 8px; border-radius: 7px; font-size: 13px; font-weight: 600; }
.pv-btn.out { border: 1.5px solid; background: #fff; }
.pv-btn.solid { color: #fff; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(15, 20, 30, .4); display: flex; justify-content: center; align-items: flex-start; padding: 24px; }
.modal { width: 100%; max-width: 440px; margin-top: 96px; background: var(--surface); border-radius: 14px; box-shadow: var(--sh-dd); overflow: hidden; }
.modal-head { padding: 22px 24px 4px; }
.modal-head h3 { font-family: var(--display); font-size: 19px; font-weight: 600; }
.modal-head p { margin: 7px 0 0; font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.modal-body { padding: 18px 24px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; background: var(--surface-2); border-top: 1px solid var(--line); }
.prefix-field { display: flex; align-items: stretch; border: 1px solid var(--input-border); border-radius: var(--r-input); overflow: hidden; }
.prefix-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.prefix-field .pf { display: flex; align-items: center; padding: 0 10px; background: #f7f6f2; font-family: var(--mono); font-size: 14px; color: var(--ink-3); border-right: 1px solid var(--input-border); }
.prefix-field input { border: none; border-radius: 0; height: 40px; }
.prefix-field input:focus { box-shadow: none; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.auth { width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; gap: 11px; justify-content: center; margin-bottom: 28px; }
.auth-brand .brand-mark { width: 34px; height: 34px; }
.auth-brand .brand-name { font-size: 22px; color: var(--ink); }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 30px; box-shadow: var(--sh-card); }
.auth-card h1 { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 7px; }
.auth-card .lead { color: var(--ink-2); font-size: 15px; margin-bottom: 24px; }
.auth-fields { display: flex; flex-direction: column; gap: 14px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--ink-3); line-height: 1.5; }
.auth-switch button { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; font-weight: 600; }
.auth-hint { font-size: 14px; color: var(--muted); margin-top: -4px; line-height: 1.5; }
.err { color: var(--bad); font-size: 14px; min-height: 18px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px); background: var(--ink); color: #faf8f4; padding: 12px 18px; border-radius: 9px; font-size: 14px; box-shadow: var(--sh-dd); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 70; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--ok-bg); color: var(--ok); font-weight: 500; }
.toast .ti { display: inline-flex; align-items: center; gap: 8px; }
.toast .ti .icon { width: 16px; height: 16px; }

/* ---------- Spinner ---------- */
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; vertical-align: -3px; animation: os-spin .7s linear infinite; }
@keyframes os-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.6s; } }
.spinner.tiny { width: 9px; height: 9px; border-width: 1.5px; vertical-align: 0; }
.btn.loading { pointer-events: none; opacity: 0.9; }
.scan-run { display: flex; align-items: center; gap: 13px; color: var(--ink-2); font-size: 15px; padding: 4px 0; }
.scan-run .spinner { width: 22px; height: 22px; border-width: 2.5px; color: var(--accent); flex: 0 0 auto; }

/* ===== Analytics ===== */
.an-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.an-range { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-btn); padding: 3px; }
.an-rbtn { background: none; border: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink-3); padding: 7px 13px; border-radius: 7px; }
.an-rbtn:hover { color: var(--ink); }
.an-rbtn.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-btn); }
.an-priv { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ok); background: var(--ok-bg); border-radius: 7px; padding: 5px 10px; }
.an-priv .icon { width: 14px; height: 14px; stroke: var(--ok); }
.an-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.an-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px 20px; }
.an-n { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.an-l { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 8px; }
.an-s { font-size: 13px; margin-top: 2px; color: var(--muted); }
.an-chartcard { margin-bottom: 16px; }
.an-chart { display: grid; grid-template-columns: repeat(var(--an-cols), 1fr); align-items: flex-end; gap: 2px; height: 160px; padding-top: 6px; }
.an-bar { position: relative; align-self: flex-end; width: 100%; min-height: 0; background: var(--accent); border-radius: 3px 3px 0 0; opacity: .85; transition: opacity .12s; }
.an-bar:hover { opacity: 1; }
.an-bar-hit { position: absolute; inset: -4px 0 0 0; }
.an-axis { display: flex; justify-content: space-between; font-size: 13px; margin-top: 8px; color: var(--muted); }
.an-lists { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.an-listcard { padding: 18px 20px; }
.an-listbody { display: flex; flex-direction: column; gap: 9px; }
.an-lrow { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 9px; border-radius: 7px; overflow: hidden; font-size: 14px; }
.an-lbar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-tint); border-radius: 7px; z-index: 0; }
.an-lval { position: relative; z-index: 1; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.an-ln { position: relative; z-index: 1; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); flex: 0 0 auto; }
.ev-list { display: flex; flex-direction: column; gap: 8px; }
.ev-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border-radius: 8px; background: var(--surface-2); font-size: 14px; }
.ev-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-right { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.ev-conv { background: none; border: none; cursor: pointer; font-size: 17px; color: var(--muted); padding: 0; line-height: 1; }
.ev-conv.on { color: #d08a1e; }
.ev-badge { font-size: 13px; font-weight: 500; color: var(--ok); background: var(--ok-bg); border-radius: 5px; padding: 1px 7px; }

/* ===== Tags ===== */
.tag-list { display: flex; flex-direction: column; gap: 12px; }
.tag-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 18px; }
.tag-row.off { opacity: .62; }
.tag-main { min-width: 0; }
.tag-top { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; flex-wrap: wrap; }
.tag-type { font-weight: 600; font-size: 15px; color: var(--ink); }
.tag-label { font-size: 14px; color: var(--ink-2); margin-bottom: 3px; }
.tag-id { font-size: 14px; color: var(--ink-2); word-break: break-all; }
.tag-scope { font-size: 13px; margin-top: 3px; color: var(--muted); }
.tag-actions { display: flex; gap: 8px; flex: 0 0 auto; }

/* ===== Reviews ===== */
.rv-stars { letter-spacing: 1px; color: #d08a1e; }
.rv-star { opacity: .28; } .rv-star.on { opacity: 1; }
.rv-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rv-sum-main { display: flex; align-items: center; gap: 14px; }
.rv-score { font-family: var(--display); font-size: 42px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.rv-sum-actions { display: flex; gap: 8px; }
.rv-cands { display: flex; flex-direction: column; gap: 8px; }
.rv-cand { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--input-border); border-radius: var(--r-input); padding: 12px 14px; cursor: pointer; }
.rv-cand:hover { border-color: var(--accent); background: var(--accent-tint); }
.rv-cand-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rv-cand-name { font-weight: 600; font-size: 15px; }
.rv-cand-addr { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-cand-rating { font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; flex: 0 0 auto; }
.rv-list { display: flex; flex-direction: column; gap: 12px; }
.rv-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; }
.rv-row.hidden { opacity: .5; }
.rv-row-head { display: flex; align-items: center; gap: 11px; margin-bottom: 9px; }
.rv-av { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex: 0 0 auto; }
.rv-who { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.rv-name { font-weight: 600; font-size: 15px; }
.rv-meta { font-size: 14px; }
.rv-row-actions { display: flex; gap: 7px; flex: 0 0 auto; }
.rv-text { font-size: 15px; line-height: 1.55; color: var(--ink); }
.rv-reply { margin-top: 9px; padding: 9px 12px; border-radius: 8px; background: var(--accent-tint); font-size: 14px; line-height: 1.45; color: var(--accent); }
.rv-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.rv-pageinfo { font-size: 14px; }

/* ===== Widget builder ===== */
.wbuild { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.wbuild-form .auth-fields { gap: 12px; }
.w-toggles { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.w-tog { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
.w-tog input { width: auto; height: auto; }
.wbuild-preview { top: 16px; }
.wbuild-preview iframe { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: var(--r-card); background: #f3f4f6; }

/* ---------- Plan ---------- */
.plan-note { padding: 14px 16px; border-radius: var(--r-dd); font-size: 15px; color: var(--ink-2); background: #f7f6f2; border: 1px solid var(--line); }
.plan-note .tag { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-tint); border-radius: var(--r-pill); padding: 2px 8px; margin-right: 8px; }
.plan-note strong { color: var(--ink); font-weight: 600; }
.plan-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; align-items: start; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 26px; }
.plan-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.plan-name { font-family: var(--display); font-size: 17px; font-weight: 600; }
.plan-tagline { color: var(--ink-2); font-size: 15px; margin-top: 5px; }
.seg-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-btn); padding: 3px; }
.seg-toggle button { background: none; border: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink-3); padding: 6px 12px; border-radius: 7px; }
.seg-toggle button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-btn); }
.seg-toggle .save { color: var(--ok); font-size: 12px; margin-left: 5px; }
.plan-price { margin-bottom: 22px; }
.plan-amt { font-family: var(--display); font-size: 42px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.plan-per { font-size: 15px; color: var(--ink-3); margin-left: 8px; }
.plan-sub2 { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }
.plan-feats { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 0 0 24px; padding: 0; }
.plan-feats li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--ink); }
.plan-feats .icon { width: 16px; height: 16px; flex: 0 0 auto; stroke: var(--ok); margin-top: 3px; }
.bill-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; }
.bill-card h3 { font-family: var(--display); font-size: 17px; font-weight: 600; margin-bottom: 14px; }
.bill-dl { display: flex; flex-direction: column; }
.bill-dl .row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.bill-dl .row:first-child { border-top: none; }
.bill-dl dt { color: var(--ink-3); } .bill-dl dd { margin: 0; text-align: right; color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 899px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--sh-dd); }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .topsearch { display: none; }
  .content { padding: 20px 16px; }
  .site-credit { padding: 16px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head h1 { font-size: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .ov-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .an-lists { grid-template-columns: 1fr; }
  .an-tiles { grid-template-columns: 1fr 1fr; }
  .wbuild { grid-template-columns: 1fr; }
  .wbuild-preview iframe { height: 420px; }
  .sh-actions { width: 100%; }
}
@media (max-width: 1159px) {
  .tr.orgrow { grid-template-columns: 1.6fr 1fr auto; }
  .tr.scanrow { grid-template-columns: 1.5fr .8fr auto; }
  .tr.orgrow .col-hide, .tr.scanrow .col-hide { display: none; }
}
@media (max-width: 519px) {
  .an-tiles { grid-template-columns: 1fr; }
  .tag-row { flex-direction: column; align-items: stretch; }
  .tag-actions { justify-content: flex-end; }
  .rv-row-head { flex-wrap: wrap; }
  .rv-row-actions { width: 100%; justify-content: flex-end; }
  .modal { margin-top: 48px; }
}
.side-plan-side { display: none; }

/* ===== Admin page ===== */
.ad-status { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 18px; }
.ad-status.err { border-color: #f3c9c4; }
.as-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; background: var(--ok-dot); box-shadow: 0 0 0 4px #ddf0e5; }
.ad-status.err .as-dot { background: var(--bad-dot); box-shadow: 0 0 0 4px #fbd9d5; }
.as-main { min-width: 0; flex: 1; }
.as-title { font-size: 15px; font-weight: 600; color: var(--ok); }
.ad-status.err .as-title { color: var(--bad); }
.as-sub { font-size: 14px; color: var(--ink-2); margin-top: 1px; }
.as-queue { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.as-q { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.as-q b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 5px; }
.as-q.bad b { color: var(--bad); }
.as-btn { flex: 0 0 auto; }

.ad-cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
@container content (min-width: 700px) { .ad-cards { grid-template-columns: repeat(3, 1fr); } }
.ad-kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.akc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 18px 20px 0; }
.akc-title { font-family: var(--display); font-size: 16px; font-weight: 600; }
.akc-period { font-size: 13px; color: var(--muted); }
.akc-main { display: flex; align-items: baseline; gap: 10px; padding: 10px 20px 16px; }
.akc-n { font-family: var(--display); font-size: 32px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.akc-n.zero { color: #a19d95; } .akc-n.bad { color: var(--bad); }
.akc-lab { font-size: 14px; color: var(--ink-2); }
.akc-rows { border-top: 1px solid var(--line-soft); }
.akc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-top: 1px solid #f4f2ee; font-size: 14px; }
.akc-row:first-child { border-top: none; }
.akc-row dt { color: var(--ink-2); } .akc-row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.akc-row dd.zero { color: #a19d95; font-weight: 500; } .akc-row dd.bad { color: var(--bad); }

.ad-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 0; }
.adc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.adc-head h2 { font-family: var(--display); font-size: 17px; font-weight: 600; }
.adc-head .cnt { font-size: 14px; color: var(--muted); margin-left: 6px; }
.adc-search { position: relative; width: 280px; max-width: 100%; }
.adc-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--muted); }
.adc-search input { height: 38px; padding: 0 12px 0 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }

.ad-thead { display: none; background: var(--surface-2); color: var(--ink-3); font-size: 14px; font-weight: 500; padding: 0 20px; height: 42px; align-items: center; gap: 16px; }
.ad-row { position: relative; display: grid; gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--divider); }
.ad-row:first-of-type { border-top: none; }
.org-grid { grid-template-columns: 1fr; }
.scan-grid { grid-template-columns: 1fr auto; }
@container content (min-width: 760px) {
  .ad-thead.org { display: grid; grid-template-columns: minmax(240px, 1fr) 150px 70px 150px 36px; }
  .ad-thead.scan { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 70px 150px 110px; }
  .org-grid { grid-template-columns: minmax(240px, 1fr) 150px 70px 150px 36px; }
  .scan-grid { grid-template-columns: minmax(220px, 1fr) 150px 70px 150px 110px; }
  .ad-row-sub { display: none; }
  .hide-narrow { display: block; }
}
@container content (max-width: 759px) {
  .org-grid { grid-template-columns: 1fr auto; }
  .scan-grid { grid-template-columns: 1fr; }
  .hide-narrow { display: none !important; }
}
.ad-thead .r, .ad-row .r { text-align: right; }
.ad-row.off { opacity: 0.55; }

.cust { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cust-av { width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto; background: var(--accent-tint); color: var(--accent); display: grid; place-items: center; font-size: 14px; font-weight: 600; }
.cust-meta { min-width: 0; }
.cust-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cust-name { font-size: 16px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.role-badge { height: 22px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: var(--r-pill); background: #f0eee9; color: #4a4843; font-size: 13px; font-weight: 500; }
.cust-email { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.ad-row-sub { font-size: 14px; color: var(--ink-2); margin-top: 3px; }
.ad-num { font-variant-numeric: tabular-nums; }
.ad-num.zero { color: #a19d95; }

.plandd { position: relative; justify-self: start; }
.dd-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; height: 36px; max-width: 140px; width: 140px; padding: 0 36px 0 12px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--surface); font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; position: relative; }
.dd-btn::after { content: ""; position: absolute; right: 13px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e6a63' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / 14px; }
.dd-panel { position: absolute; z-index: 30; top: 42px; left: 0; width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-dd); box-shadow: var(--sh-dd); padding: 4px; }
.dd-panel.right { left: auto; right: 0; }
.dd-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 38px; padding: 0 10px; background: none; border: none; border-radius: 7px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; text-align: left; }
.dd-opt:hover { background: var(--hover); }
.dd-opt .vald { font-size: 13px; color: var(--accent); font-weight: 500; }

.ad-menu { width: 36px; height: 36px; display: grid; place-items: center; background: none; border: none; border-radius: 8px; color: var(--muted); cursor: pointer; justify-self: end; }
.ad-menu:hover { background: var(--hover); color: var(--ink-2); }
.cardmenu .sepline { height: 1px; background: var(--line); margin: 4px 6px; }
.cardmenu button.danger-item { color: var(--bad); } .cardmenu button.ok-item { color: var(--ok); }

.status-tabs { display: flex; gap: 4px; }
.status-tab { background: none; border: none; cursor: pointer; height: 44px; padding: 0 10px; color: var(--ink-3); font-size: 15px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -17px; }
.status-tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.status-tab .c { color: var(--muted); font-size: 14px; margin-left: 4px; font-variant-numeric: tabular-nums; }

.fav32 { width: 32px; height: 32px; border-radius: 8px; }
.fav32 .fav-letter { font-size: 14px; }
.scan-site { display: flex; align-items: center; gap: 12px; min-width: 0; }
.scan-dom { font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.scan-time { font-size: 15px; color: var(--ink-2); }
.ad-empty { padding: 28px 20px; text-align: center; color: var(--ink-3); font-size: 15px; }

.ul-user { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--divider); flex-wrap: wrap; }
.ul-user:first-child { border-top: none; }
.ul-sites { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; max-width: 420px; }
.ul-site { display: flex; align-items: center; gap: 10px; }
.ul-dom { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.ul-site .pill { flex: 0 0 auto; }
.ul-nosite { font-size: 14px; color: var(--muted); align-self: center; }
@container content (max-width: 620px) { .ul-user { flex-direction: column; } .ul-sites { max-width: none; width: 100%; } }
