/* Weblay dashboard — Vercel/Geist-inspired design system.
   Self-contained (no external fonts/CDN) to keep the single-binary,
   privacy-first story intact. Monochrome canvas, hairline borders,
   white primary button, Wolfigs-orange accent, semantic status colors. */

:root {
  /* Surfaces — near-black canvas with subtly lifted panels. */
  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --panel: #0d0d0d;
  --panel-2: #141414;
  --panel-hover: #171717;

  /* Hairline borders. */
  --border: #1f1f1f;
  --border-strong: #2e2e2e;
  --border-focus: #3a3a3a;

  /* Text. */
  --text: #ededed;
  --text-dim: #a1a1a1;
  --text-faint: #8a8a8a;
  --text-invert: #0a0a0a;

  /* Accents & status — Wolfigs brand orange. */
  --accent: #F26222;
  --accent-strong: #d9500f;
  --accent-soft: rgba(242, 98, 34, 0.14);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.13);
  --warning: #f5c451;
  --danger: #ff6166;
  --danger-strong: #e5484d;
  --danger-soft: rgba(255, 97, 102, 0.12);

  /* Focus ring. */
  --ring: rgba(242, 98, 34, 0.55);

  /* Typography. */
  --font-sans: "Inter", "Inter var", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo,
    Consolas, "Liberation Mono", monospace;

  /* Radii. */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 999px;

  /* Spacing scale (dense / dashboard). */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;

  /* Elevation. */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.65);

  --topnav-h: 56px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 50% -280px, rgba(242, 98, 34, 0.08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

::selection { background: rgba(242, 98, 34, 0.3); }

a { color: var(--text); text-decoration: none; }
a:hover { color: #fff; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
p { margin: 0; }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1px 5px;
}

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: #2a2a2a transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #262626; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #333; background-clip: padding-box; }

/* ─── App shell ─────────────────────────────────────────────── */

.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topnav-h);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 0 var(--s-6);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}

.brand { display: flex; align-items: center; gap: var(--s-3); font-weight: 600; letter-spacing: -0.02em; }
.brand .crumb-root { display: inline-flex; align-items: center; gap: 9px; }
.brand .brand-logo { height: 17px; width: auto; display: block; }
.brand .sep { color: var(--border-strong); font-size: 18px; font-weight: 300; }
.brand .crumb-name { color: var(--text); font-weight: 550; }

.topnav .spacer { flex: 1; }

.usermenu { position: relative; }
.userchip {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 5px 8px 5px 5px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.userchip:hover { background: var(--panel-hover); border-color: var(--border-strong); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 650; color: #000;
  background: linear-gradient(140deg, #f7a072, #F26222);
  flex-shrink: 0;
}
.userchip .email { font-size: 13px; color: var(--text-dim); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userchip .chev { color: var(--text-faint); }

.menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  opacity: 0; transform: translateY(-4px) scale(.98);
  pointer-events: none;
  transition: opacity .14s, transform .14s;
}
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu .menu-head { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu .menu-head .n { font-size: 13px; font-weight: 600; }
.menu .menu-head .e { font-size: 12px; color: var(--text-faint); }
.menu button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: transparent; border: 0; color: var(--text-dim);
  padding: 8px 10px; border-radius: var(--r-sm);
  font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.menu button:hover { background: var(--panel-2); color: var(--text); }
.menu button svg { width: 15px; height: 15px; }

main { max-width: 960px; margin: 0 auto; padding: var(--s-8) var(--s-6) var(--s-12); }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-faint); font-size: 13px; font-weight: 500;
  margin-bottom: var(--s-4);
}
.back-link:hover { color: var(--text); }
.back-link svg { width: 15px; height: 15px; transition: transform .15s; }
.back-link:hover svg { transform: translateX(-2px); }

.page-head { display: flex; align-items: flex-end; gap: var(--s-4); margin-bottom: var(--s-6); }
.page-head .grow { flex: 1; min-width: 0; }
.page-head h1 { font-size: 26px; }
.page-head .sub { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

.section-title { display: flex; align-items: center; gap: 8px; margin: var(--s-8) 0 var(--s-3); }
.section-title h2 { color: var(--text); }
.section-title .hint { color: var(--text-faint); font-size: 12.5px; font-weight: 400; }

/* ─── Cards ─────────────────────────────────────────────────── */

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card + .card { margin-top: var(--s-3); }
.card-pad { padding: var(--s-5); }
.card-head { padding: var(--s-5) var(--s-5) 0; }
.card-head h2 { margin-bottom: 2px; }
.card-head .desc { color: var(--text-dim); font-size: 13px; }
.card-foot {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.012);
}
.card-foot .grow { flex: 1; }
.card-foot .note { color: var(--text-faint); font-size: 12.5px; }

/* Interactive site cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-3); }
.site-card {
  display: block; padding: var(--s-5);
  background: linear-gradient(180deg, var(--panel), var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color .16s, transform .16s, box-shadow .16s;
  cursor: pointer;
}
.site-card:hover { border-color: var(--border-focus); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.site-card:hover .go-arrow { transform: translateX(2px); color: var(--text); }
.site-card .sc-top { display: flex; align-items: center; gap: var(--s-3); }
.site-card .sc-icon {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--text-dim);
  background: var(--panel-2); border: 1px solid var(--border);
}
.site-card .sc-icon svg { width: 15px; height: 15px; }
.site-card .sc-name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.site-card .go-arrow { margin-left: auto; color: var(--text-faint); transition: transform .16s, color .16s; }
.site-card .sc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-4); }

/* ─── Buttons ───────────────────────────────────────────────── */

.btn {
  --h: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--h); padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--r-md);
  font: inherit; font-size: 13.5px; font-weight: 550; line-height: 1;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .15s, border-color .15s, color .15s, transform .06s, opacity .15s;
}
.btn:active { transform: scale(.975); }
.btn svg { width: 15px; height: 15px; }
.btn.sm { --h: 30px; padding: 0 11px; font-size: 12.5px; }
.btn.lg { --h: 42px; padding: 0 18px; font-size: 14px; }
.btn.block { width: 100%; }

.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { background: #e6e6e6; }

.btn-secondary { background: var(--panel-2); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--panel-hover); border-color: var(--border-focus); }

.btn-ghost { background: transparent; color: var(--text-dim); border-color: transparent; }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }

.btn-danger { background: transparent; color: var(--danger); border-color: rgba(255,97,102,.4); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-danger-solid { background: var(--danger-strong); color: #fff; }
.btn-danger-solid:hover { background: #d13b40; }

.btn:disabled, .btn.loading { opacity: .6; pointer-events: none; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after {
  content: ""; position: absolute; width: 15px; height: 15px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .6s linear infinite;
  color: var(--text);
}
.btn-primary.loading::after { color: #000; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid transparent; color: var(--text-faint);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.icon-btn svg { width: 16px; height: 16px; }

/* ─── Forms ─────────────────────────────────────────────────── */

.field { display: block; }
.field + .field { margin-top: var(--s-4); }
.field > label, .lbl { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 500; color: var(--text); }
.field .help { margin-top: 6px; font-size: 12.5px; color: var(--text-faint); }

input[type="text"], input[type="email"], input[type="password"], input:not([type]), select, textarea {
  width: 100%; height: 38px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--r-md);
  padding: 0 12px;
  font: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #5c5c5c; }
input:hover, select:hover, textarea:hover { border-color: var(--border-focus); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a8a8a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }

:focus-visible { outline: none; }
.btn:focus-visible, .icon-btn:focus-visible, .userchip:focus-visible, .site-card:focus-visible, a:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--r-md);
}

/* ─── Inline alerts ─────────────────────────────────────────── */

.alert {
  display: none; align-items: flex-start; gap: 9px;
  padding: 10px 12px; border-radius: var(--r-md); font-size: 13px;
  margin-bottom: var(--s-4);
}
.alert.show { display: flex; }
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert.error { background: var(--danger-soft); border: 1px solid rgba(255,97,102,.35); color: #ff9a9d; }

/* ─── Tables ────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; padding: 10px var(--s-5);
  color: var(--text-faint); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
  background: rgba(255,255,255,.015);
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 12px var(--s-5); border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255,255,255,.02); }
td .path { font-family: var(--font-mono); font-size: 12.5px; color: var(--text); }
.t-actions { text-align: right; white-space: nowrap; }
.t-actions .btn + .btn { margin-left: 6px; }
.col-actions { width: 1%; }
.num { font-variant-numeric: tabular-nums; }

/* Pages table — clickable path + inline history accordion */
.path-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--text); transition: color .12s;
}
.path-link:hover { color: var(--accent); }
.path-link svg { width: 12px; height: 12px; color: var(--text-faint); }
.path-link:hover svg { color: var(--accent); }

/* History drawer (slide-over from the right) */
#drawer-root { position: fixed; inset: 0; z-index: 120; pointer-events: none; }
#drawer-root.open { pointer-events: auto; }
.drawer-scrim {
  position: absolute; inset: 0; background: rgba(0,0,0,.6);
  opacity: 0; transition: opacity .22s ease;
}
#drawer-root.open .drawer-scrim { opacity: 1; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(420px, 92vw);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-strong);
  box-shadow: -24px 0 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .24s cubic-bezier(.4,0,.2,1);
}
#drawer-root.open .drawer { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.drawer-heading { flex: 1; min-width: 0; }
.drawer-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 4px;
}
.drawer-head h3 { font-size: 16px; font-weight: 600; margin: 0; }
.drawer-head h3 .mono { font-size: 14px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-loading {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-faint); font-size: 13px; padding: 20px 0;
}
.drawer-loading.err { color: var(--danger); }
.drawer-loading svg { width: 15px; height: 15px; }
.empty.sm { padding: 40px 10px; }

/* Working-draft card at the top of the history drawer */
.draft-card {
  border: 1px solid rgba(251,191,36,.3); background: rgba(251,191,36,.06);
  border-radius: 12px; padding: 14px; margin-bottom: 18px;
}
.draft-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.draft-when { color: var(--text-faint); font-size: 12px; }
.draft-note { color: var(--text-dim); font-size: 12.5px; margin: 8px 0 12px; }
.draft-actions { display: flex; gap: 8px; }
.tl-heading {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-faint); margin: 0 0 12px;
}

/* Revision timeline inside the drawer */
.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; }
.tl-item { position: relative; padding: 0 0 18px 22px; }
.tl-item::before {
  content: ""; position: absolute; left: 4px; top: 16px; bottom: -2px;
  width: 2px; background: var(--border);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item:last-child::before { display: none; }
.tl-node {
  position: absolute; left: 0; top: 7px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--panel-2); border: 2px solid var(--border-strong);
}
.tl-item.live .tl-node {
  background: var(--success); border-color: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}
.tl-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 10px 12px;
}
.tl-item.live .tl-card { border-color: rgba(74,222,128,.35); }
.tl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tl-live { font-size: 12px; font-weight: 600; color: var(--success); }
.tl-time { color: var(--text-faint); font-size: 12.5px; margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ─── Badges ────────────────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px;
  border-radius: var(--r-full);
  font-size: 12px; font-weight: 500;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.badge svg { width: 13px; height: 13px; flex-shrink: 0; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge.mono { font-family: var(--font-mono); font-size: 11.5px; }
.badge.success { color: var(--success); background: var(--success-soft); border-color: rgba(74,222,128,.25); }
.badge.accent  { color: var(--accent);  background: var(--accent-soft);  border-color: rgba(242,98,34,.28); }
.badge.neutral { color: var(--text-dim); }
.badge.warn    { color: #fbbf24; background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.3); }
.badge.danger-badge { color: var(--danger); background: var(--danger-soft); border-color: rgba(255,97,102,.3); }

.status-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ─── Override health ───────────────────────────────────────── */
.hstat {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; color: var(--text-dim); background: var(--panel-2); border: 1px solid var(--border);
}
.hstat b { font-size: 15px; color: var(--text); }
.hstat.success b { color: var(--success); }
.hstat.warn b { color: #fbbf24; }
.hstat.danger b { color: var(--danger); }
.hlist { display: flex; flex-direction: column; }
.hrow { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.hrow:last-child { border-bottom: 0; }
.hrow-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hconf { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; color: var(--text-dim); }
.hsel { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.hreasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hreasons span { font-size: 11.5px; color: #fcd34d; background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.2); padding: 2px 8px; border-radius: 6px; }
.hmeta { font-size: 12px; color: var(--text-faint); }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 12px; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* Grouped health: page groups + scope + category rows */
.hpage { border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 16px; overflow: hidden; background: var(--panel); }
.hpage-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.hpage-head .path { font-size: 13.5px; }
.hpage-count { margin-left: auto; font-size: 12px; color: var(--text-faint); }
.scope { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; }
.scope.warn { color: #fbbf24; background: rgba(251,191,36,.12); }
.scope.danger { color: var(--danger); background: var(--danger-soft); }
.scope.success { color: var(--success); background: var(--success-soft); }
.revamp { margin: 12px 16px; padding: 14px; border: 1px solid rgba(255,97,102,.35); background: rgba(255,97,102,.07); border-radius: 10px; }
.revamp-head { display: flex; align-items: center; gap: 8px; color: var(--danger); }
.revamp-head svg { width: 16px; height: 16px; }
.revamp p { margin: 8px 0 12px; font-size: 13px; color: var(--text-dim); }
.revamp-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.revamp-note { font-size: 12px; color: var(--text-faint); }
.hrow { padding: 13px 16px; border-bottom: 1px solid var(--border); }
.hrow:last-child { border-bottom: 0; }
.hrow-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hconf { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px; color: var(--text-dim); }
.hsel { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.hdesc { margin: 7px 0 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.hfoot { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.hfoot .hmeta { flex: 1; min-width: 160px; }
.hactions { display: flex; gap: 8px; }
.hhealthy { display: flex; align-items: center; gap: 8px; color: var(--success); font-size: 13px; padding: 4px 2px; }
.hhealthy svg { width: 15px; height: 15px; }

/* Site alert banner (site detail) */
.site-alert { display: flex; align-items: center; gap: 12px; padding: 13px 16px; margin-bottom: 18px;
  border: 1px solid rgba(255,97,102,.3); background: rgba(255,97,102,.07); border-radius: var(--r-lg); }
.site-alert .sa-ico { color: var(--danger); display: inline-flex; }
.site-alert .sa-ico svg { width: 20px; height: 20px; }
.site-alert b { font-size: 14px; }
.site-alert .faint { font-size: 13px; margin-left: 4px; }

/* Site card alert (home) */
.site-card.has-alert { border-color: rgba(255,97,102,.35); }
.sc-alert { color: var(--danger); display: inline-flex; }
.sc-alert svg { width: 17px; height: 17px; }

/* ─── Code snippet with copy ────────────────────────────────── */

.snippet {
  position: relative;
  background: #060606;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 14px 52px 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px; line-height: 1.7;
  overflow-x: auto; white-space: pre;
}
.snippet .tok-tag { color: #ff8fa3; }
.snippet .tok-attr { color: var(--accent); }
.snippet .tok-str { color: var(--success); }
.snippet .copy {
  position: absolute; top: 8px; right: 8px;
}

/* ─── Install verification result ───────────────────────────── */
.verify-result { display: none; margin-top: 12px; }
.verify-result.show { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); font-size: 13px; border: 1px solid var(--border); }
.verify-result .vi { display: inline-flex; flex: 0 0 auto; margin-top: 1px; }
.verify-result .vi svg { width: 16px; height: 16px; }
.verify-result.ok   { background: var(--success-soft); border-color: rgba(74,222,128,.35); color: #86efac; }
.verify-result.warn { background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.3); color: #fbbf24; }
.verify-result.bad  { background: var(--danger-soft); border-color: rgba(255,97,102,.35); color: #ff9a9d; }

/* ─── Loading-indicator configurator ────────────────────────── */

.lseg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 3px; }
.lseg button { border: 0; background: transparent; color: var(--text-dim); font: inherit; font-size: 13px; padding: 6px 13px; border-radius: 6px; cursor: pointer; }
.lseg button:hover { background: var(--panel-hover); color: var(--text); }
.lseg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.ldr-opts { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 4px; }
.ldr-opts:empty { margin: 0; }
.lrow { display: flex; align-items: center; gap: 12px; }
.lrow-label { flex: 0 0 110px; font-size: 13px; color: var(--text-dim); }
.lrow .linput, .lrow .color-ctl .hex {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); padding: 6px 10px; outline: none; font: inherit; font-size: 13px;
}
.lrow .linput { flex: 1; }
.lrow .color-ctl { display: inline-flex; align-items: center; gap: 8px; }
.lrow .color-ctl input[type=color] { -webkit-appearance: none; appearance: none; width: 30px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 7px; background: none; cursor: pointer; }
.lrow .color-ctl input[type=color]::-webkit-color-swatch-wrapper { padding: 2px; }
.lrow .color-ctl input[type=color]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.lrow .color-ctl .hex { width: 96px; font-family: var(--font-mono); font-size: 12.5px; }

.ldr-preview { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.ldr-none { padding: 22px 16px; text-align: center; color: var(--text-faint); font-size: 13px; }
.ldr-preview.on { position: relative; height: 150px; background: #f4f4f5; }
.pv-page { position: absolute; inset: 0; background:
  repeating-linear-gradient(0deg, transparent 0 18px, rgba(0,0,0,.04) 18px 20px); }
.pv-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: color-mix(in srgb, var(--acc) 18%, transparent); overflow: hidden; z-index: 1; }
.pv-bar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 40%; background: var(--acc); animation: pv-slide 1.1s cubic-bezier(.4,0,.2,1) infinite; }
@keyframes pv-slide { 0% { left: -40%; } 50% { left: 30%; width: 55%; } 100% { left: 100%; } }
.pv-ov { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.pv-ov img { max-width: 120px; max-height: 40px; object-fit: contain; }
.pv-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--acc) 22%, transparent); border-top-color: var(--acc); animation: pv-spin .7s linear infinite; }
.pv-txt { font-size: 13px; font-weight: 500; }
@keyframes pv-spin { to { transform: rotate(360deg); } }
.pv-sk { position: absolute; inset: 0; padding: 22px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.pv-sk span { height: 16px; border-radius: 6px; background: linear-gradient(100deg, rgba(0,0,0,.06) 30%, rgba(0,0,0,.12) 50%, rgba(0,0,0,.06) 70%); background-size: 200% 100%; animation: pv-shimmer 1.2s ease-in-out infinite; }
@keyframes pv-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── Tabs ──────────────────────────────────────────────────── */

.tabs {
  position: relative;
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin: var(--s-6) 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 12px;
  background: transparent; border: 0;
  color: var(--text-dim); font: inherit; font-size: 14px; font-weight: 500;
  white-space: nowrap; cursor: pointer;
  transition: color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: #fff; }
.tab:focus-visible { outline: 2px solid var(--ring); outline-offset: -6px; border-radius: 8px; }
.tab .count {
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tab.active .count { color: var(--text); border-color: var(--border-strong); }
.tab-ink {
  position: absolute; bottom: -1px; left: 0;
  height: 2px; width: 0; border-radius: 2px;
  background: #fff; pointer-events: none;
  transition: transform .28s cubic-bezier(.16,1,.3,1), width .28s cubic-bezier(.16,1,.3,1);
}
.panel { animation: fade-up .3s cubic-bezier(.16,1,.3,1) both; }
.panel[hidden] { display: none; }
.panel .section-title:first-child { margin-top: 0; }

/* ─── Empty states ──────────────────────────────────────────── */

.empty { text-align: center; padding: var(--s-10) var(--s-6); }
.empty .ei {
  width: 46px; height: 46px; margin: 0 auto var(--s-4);
  display: grid; place-items: center; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text-faint);
}
.empty .ei svg { width: 22px; height: 22px; }
.empty h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.empty p { color: var(--text-faint); font-size: 13px; max-width: 340px; margin: 0 auto; }

/* ─── Toasts ────────────────────────────────────────────────── */

#toasts {
  position: fixed; bottom: 20px; right: 20px; z-index: 90;
  display: flex; flex-direction: column; gap: 10px; max-width: 380px;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--panel); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md); color: var(--text); font-size: 13.5px;
  animation: toast-in .28s cubic-bezier(.16,1,.3,1);
}
.toast.out { animation: toast-out .2s ease forwards; }
.toast .ti { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast.success .ti { color: var(--success); }
.toast.error .ti { color: var(--danger); }
.toast.info .ti { color: var(--accent); }
.toast .tt { font-weight: 600; }
.toast .td { color: var(--text-dim); font-size: 12.5px; margin-top: 2px; }

/* ─── Modal ─────────────────────────────────────────────────── */

#modal-root { position: fixed; inset: 0; z-index: 80; display: none; }
#modal-root.open { display: block; }
.modal-scrim {
  position: absolute; inset: 0; background: rgba(0,0,0,.6);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fade-in .18s ease;
}
.modal {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: var(--s-6);
  animation: modal-in .22s cubic-bezier(.16,1,.3,1);
}
.modal h3 { font-size: 16px; margin-bottom: 8px; }
.modal p { color: var(--text-dim); font-size: 13.5px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: var(--s-6); }
.modal .warn-icon {
  width: 40px; height: 40px; border-radius: 10px; margin-bottom: var(--s-4);
  display: grid; place-items: center;
  background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(255,97,102,.3);
}
.modal .warn-icon svg { width: 20px; height: 20px; }

/* ─── Auth screens ──────────────────────────────────────────── */

.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s-6); }
.auth-box { width: 100%; max-width: 380px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: var(--s-6); }
.auth-brand .brand-logo { height: 30px; width: auto; display: block; }
.auth-brand .product {
  font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}
.auth-title { text-align: center; margin-bottom: var(--s-6); }
.auth-title h1 { font-size: 21px; }
.auth-title p { color: var(--text-dim); font-size: 13.5px; margin-top: 4px; }
.auth .card-pad { padding: var(--s-6); }
.auth-foot { text-align: center; margin-top: var(--s-5); color: var(--text-faint); font-size: 12.5px; }

/* ─── Skeletons ─────────────────────────────────────────────── */

.skel { background: linear-gradient(90deg, #141414 25%, #1e1e1e 37%, #141414 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; }
.skel-line { height: 12px; margin: 8px 0; }
.skel-card { height: 120px; border-radius: var(--r-lg); }

/* ─── Utilities ─────────────────────────────────────────────── */

.row { display: flex; align-items: center; gap: var(--s-3); }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--font-mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack-sm > * + * { margin-top: var(--s-3); }
.hide { display: none !important; }

.view { animation: fade-up .4s cubic-bezier(.16,1,.3,1) both; }
.stagger > * { animation: fade-up .45s cubic-bezier(.16,1,.3,1) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .10s; }
.stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; }
.stagger > *:nth-child(6) { animation-delay: .22s; }

/* ─── Keyframes ─────────────────────────────────────────────── */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* ─── Responsive ────────────────────────────────────────────── */

@media (max-width: 720px) {
  main { padding: var(--s-6) var(--s-4) var(--s-10); }
  .topnav { padding: 0 var(--s-4); }
  .userchip .email { display: none; }
  .page-head h1 { font-size: 22px; }
  .grid { grid-template-columns: 1fr; }
  .card-foot { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .view, .stagger > * { animation: none; }
}

/* --- Wolfigs admin panel --- */
.brand .product { color: var(--accent); font-weight: 600; }
.menu-head .role-tag {
  display: inline-block; margin-top: var(--s-2); padding: 1px 8px;
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border-radius: var(--r-full);
}
.menu-link {
  display: flex; align-items: center; gap: var(--s-3); width: 100%;
  padding: var(--s-3) var(--s-4); background: none; border: 0; cursor: pointer;
  color: var(--text); text-decoration: none; font: inherit; text-align: left;
}
.menu-link:hover { background: var(--panel-hover); }
.stat-n { font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--text); }
.stat-l { margin-top: var(--s-2); font-size: 13px; color: var(--text-dim); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl thead th {
  text-align: left; padding: var(--s-3) var(--s-4); font-size: 12px;
  font-weight: 600; color: var(--text-dim); border-bottom: 1px solid var(--border);
}
.tbl td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .right, .page-head .right { text-align: right; }
.tbl .u-name { font-weight: 600; color: var(--text); }
.tbl .u-email { font-size: 12px; color: var(--text-dim); }
.btn.sm.danger, .btn-ghost.danger { color: var(--danger); }
.checkgrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2) var(--s-4); }
.checkrow { display: flex; align-items: center; gap: var(--s-2); font-size: 14px; color: var(--text); cursor: pointer; }
.checkrow input { accent-color: var(--accent); }
.modal.wide { max-width: 520px; width: 92%; }

/* Inline text button (e.g. "Use a recovery code" on the login challenge). */
.linkbtn { background: none; border: 0; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; padding: 4px; }
.linkbtn:hover { color: var(--accent-strong); text-decoration: underline; }
.sec-methods { margin-top: 6px; }
