/*
 * LayerAdapt interface.
 *
 * One design system for the whole product: a calm, dense workspace with deliberate depth, a tinted neutral
 * palette, hairline borders and short, physical motion. --brand is replaced per organization at runtime, and
 * every accent is derived from it, so a customer's own colour never breaks the hierarchy.
 */
:root {
  --brand: #4f46e5;
  --brand-ink: #ffffff;
  --brand-weak: color-mix(in srgb, var(--brand) 10%, transparent);
  --brand-soft: color-mix(in srgb, var(--brand) 16%, transparent);
  --brand-deep: color-mix(in srgb, var(--brand) 82%, #05060a);
  --brand-lift: color-mix(in srgb, var(--brand) 88%, white);

  /* Neutrals carry a trace of the brand hue, so surfaces feel part of one palette. */
  --bg: #f4f5f8;
  --bg-tint: radial-gradient(1200px 520px at 12% -8%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 70%);
  --surface: #ffffff;
  --surface-2: #f2f4f8;
  --surface-3: #e9ecf2;
  --rail: linear-gradient(180deg, #ffffff 0%, #fafbfd 55%, #f6f8fb 100%);
  --border: #e4e7ee;
  --border-strong: #d2d7e2;
  --text: #11131a;
  --muted: #58606f;
  --faint: #868e9d;

  --ok: #0f7a3d;
  --ok-bg: #e4f5e9;
  --warn: #8a5a00;
  --warn-bg: #fdf1d8;
  --bad: #b02318;
  --bad-bg: #fde7e5;
  --info: #1a5ec0;
  --info-bg: #e6eefc;

  --radius-xl: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* Layered shadows, tinted rather than grey, so cards lift without looking cut out. */
  --ring: 0 0 0 1px rgba(17, 19, 26, .04);
  --shadow-xs: 0 1px 2px rgba(18, 23, 41, .05);
  --shadow: 0 1px 2px rgba(18, 23, 41, .05), 0 4px 12px -4px rgba(18, 23, 41, .10);
  --shadow-md: 0 2px 4px rgba(18, 23, 41, .05), 0 12px 28px -8px rgba(18, 23, 41, .16);
  --shadow-lg: 0 24px 64px -16px rgba(18, 23, 41, .30), 0 2px 8px rgba(18, 23, 41, .08);
  --glow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);

  --font: "Inter var", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --fast: 120ms var(--ease);
  --med: 200ms var(--ease);
  --sidebar: 256px;
  color-scheme: light;
}

/* Dark is a first-class theme, not an inversion: deeper blues, lighter hairlines, softer accents. */
:root[data-theme="dark"] {
  --brand-weak: color-mix(in srgb, var(--brand) 20%, transparent);
  --brand-soft: color-mix(in srgb, var(--brand) 28%, transparent);
  --brand-deep: color-mix(in srgb, var(--brand) 86%, white);
  --bg: #0b0d13;
  --bg-tint: radial-gradient(1100px 520px at 10% -10%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 70%);
  --surface: #14171f;
  --surface-2: #1b1f29;
  --surface-3: #232834;
  --rail: linear-gradient(180deg, #161a23 0%, #12151d 100%);
  --border: #262c38;
  --border-strong: #333a49;
  --text: #eef0f5;
  --muted: #a2abbb;
  --faint: #6f7889;
  --ok: #45d483;
  --ok-bg: #0e2b1c;
  --warn: #f5c05a;
  --warn-bg: #2e2308;
  --bad: #ff8077;
  --bad-bg: #351614;
  --info: #7fb2ff;
  --info-bg: #10233f;
  --ring: 0 0 0 1px rgba(255, 255, 255, .04);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 6px 16px -6px rgba(0, 0, 0, .6);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .5), 0 16px 32px -12px rgba(0, 0, 0, .7);
  --shadow-lg: 0 28px 70px -20px rgba(0, 0, 0, .85), 0 2px 8px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-weak: color-mix(in srgb, var(--brand) 20%, transparent);
    --brand-soft: color-mix(in srgb, var(--brand) 28%, transparent);
    --brand-deep: color-mix(in srgb, var(--brand) 86%, white);
    --bg: #0b0d13;
    --bg-tint: radial-gradient(1100px 520px at 10% -10%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 70%);
    --surface: #14171f; --surface-2: #1b1f29; --surface-3: #232834;
    --rail: linear-gradient(180deg, #161a23 0%, #12151d 100%);
    --border: #262c38; --border-strong: #333a49;
    --text: #eef0f5; --muted: #a2abbb; --faint: #6f7889;
    --ok: #45d483; --ok-bg: #0e2b1c; --warn: #f5c05a; --warn-bg: #2e2308;
    --bad: #ff8077; --bad-bg: #351614; --info: #7fb2ff; --info-bg: #10233f;
    --ring: 0 0 0 1px rgba(255, 255, 255, .04);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 6px 16px -6px rgba(0, 0, 0, .6);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, .5), 0 16px 32px -12px rgba(0, 0, 0, .7);
    --shadow-lg: 0 28px 70px -20px rgba(0, 0, 0, .85), 0 2px 8px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.55 var(--font);
  letter-spacing: -.006em;
  font-feature-settings: "cv05" 1, "ss01" 1, "cv11" 1;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-deep); }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -.021em; }
h1 { font-size: 1.6rem; font-weight: 680; }
h2 { font-size: 1.2rem; font-weight: 640; }
h3 { font-size: 1rem; font-weight: 620; }
h4 { font-size: .875rem; font-weight: 620; }
p { margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--surface-2); padding: .1rem .3rem; border-radius: var(--radius-xs); }
pre { background: var(--surface-2); border: 1px solid var(--border); padding: .85rem; border-radius: var(--radius-sm); overflow: auto; white-space: pre-wrap; word-break: break-word; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--radius-xs); }
::selection { background: var(--brand-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.tight { gap: .3rem; }
.stack > * + * { margin-top: .75rem; }
.stack.lg > * + * { margin-top: 1.25rem; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- layout */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; background-image: var(--bg-tint); background-repeat: no-repeat; }
.sidebar {
  background: var(--rail);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  backdrop-filter: saturate(140%);
}
.brand { display: flex; align-items: center; gap: .65rem; padding: 1.05rem 1rem .9rem; font-weight: 660; letter-spacing: -.015em; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(145deg, var(--brand-lift), var(--brand-deep));
  color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; overflow: hidden;
  box-shadow: 0 1px 2px rgba(18, 23, 41, .25), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.org-switch { margin: 0 .8rem .6rem; }
.org-switch select { width: 100%; background: var(--surface-2); }
.nav { padding: .25rem .6rem 1rem; flex: 1; }
.nav-section { margin-top: 1rem; }
.nav-section:first-child { margin-top: 0; }
.nav-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; font-weight: 650; color: var(--faint); padding: 0 .65rem .35rem; }
.nav a {
  display: flex; align-items: center; gap: .6rem; padding: .44rem .65rem; margin-bottom: 1px;
  border-radius: var(--radius-sm); color: var(--muted); font-weight: 520;
  transition: background var(--fast), color var(--fast), transform var(--fast);
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a:active { transform: translateY(.5px); }
.nav a.active {
  background: linear-gradient(90deg, var(--brand-soft), var(--brand-weak));
  color: var(--brand-deep); font-weight: 620;
  box-shadow: inset 2px 0 0 var(--brand);
}
.nav .count { margin-left: auto; background: var(--brand); color: var(--brand-ink); border-radius: 999px; font-size: 11px; font-weight: 650; padding: 0 .42rem; min-width: 18px; text-align: center; }
.sidebar-foot { border-top: 1px solid var(--border); padding: .7rem .8rem; display: flex; gap: .4rem; align-items: center; background: var(--surface); }
.sidebar-foot .grow { min-width: 0; line-height: 1.35; }
.sidebar-foot .grow > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: .75rem; padding: .65rem 1.6rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  position: sticky; top: 0; z-index: 5;
}
.topbar .search { flex: 1; max-width: 520px; background: var(--surface-2); border-color: transparent; color: var(--muted); font-weight: 480; }
.topbar .search:hover { background: var(--surface-3); color: var(--text); }
.content { padding: 1.6rem; max-width: 1480px; width: 100%; animation: rise var(--med) both; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head p { margin: .3rem 0 0; color: var(--muted); max-width: 70ch; }
.page-head .eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; font-weight: 650; color: var(--faint); margin-bottom: .2rem; }
.menu-btn { display: none; }
kbd {
  font: 600 10.5px/1.6 var(--font); background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: var(--radius-xs); padding: 0 .35rem;
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 284px; z-index: 30; transform: translateX(-100%); transition: transform var(--med); box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .menu-btn { display: inline-flex; }
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
}

/* ---------------------------------------------------------------- controls */
button, .btn {
  font: inherit; font-weight: 560; letter-spacing: -.008em;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .45rem .9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap; min-height: 36px;
  box-shadow: var(--shadow-xs);
  transition: background var(--fast), border-color var(--fast), box-shadow var(--fast), transform var(--fast), color var(--fast);
}
button:hover, .btn:hover { background: var(--surface-2); border-color: var(--faint); color: var(--text); }
button:active, .btn:active { transform: translateY(1px); box-shadow: none; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.primary {
  background: linear-gradient(180deg, var(--brand-lift), var(--brand)); border-color: var(--brand-deep); color: var(--brand-ink);
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.primary:hover { background: linear-gradient(180deg, var(--brand), var(--brand-deep)); border-color: var(--brand-deep); color: var(--brand-ink); }
.danger { background: var(--bad); border-color: color-mix(in srgb, var(--bad) 80%, black); color: #fff; }
.danger:hover { background: color-mix(in srgb, var(--bad) 88%, black); color: #fff; }
.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.ghost:hover { background: var(--surface-2); border-color: transparent; }
.sm { padding: .2rem .6rem; min-height: 29px; font-size: 12.5px; }
.lg-btn { min-height: 42px; padding: .6rem 1.2rem; font-size: 15px; }
.icon-btn { padding: .3rem; min-width: 34px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; box-shadow: none; min-height: 28px; padding: .15rem .65rem; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: .45rem .65rem; min-height: 36px; width: 100%;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
select { appearance: none; padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand); }
input[type="color"] { padding: .2rem; height: 36px; }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--glow); }
label.field { display: block; }
label.field > span { display: block; font-weight: 580; font-size: 12.5px; color: var(--muted); margin-bottom: .32rem; }
label.field .req { color: var(--bad); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: .3rem; }
.err { font-size: 12.5px; color: var(--bad); margin-top: .3rem; font-weight: 520; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem 1.1rem; }
.form-grid .wide { grid-column: 1 / -1; }
.check { display: flex; gap: .55rem; align-items: center; }
.switch { position: relative; display: flex; width: fit-content; max-width: 100%; align-items: flex-start; gap: .6rem; cursor: pointer; }
.switch i { margin-top: .1rem; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: background var(--fast), border-color var(--fast); flex: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-xs); transition: transform var(--med); }
.switch input:checked + i { background: var(--brand); border-color: var(--brand-deep); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { box-shadow: var(--glow); }

/* ---------------------------------------------------------------- surfaces */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem;
  transition: box-shadow var(--med), border-color var(--med), transform var(--med);
}
.card.pad-0 { padding: 0; }
.card.flat { box-shadow: none; }
.card.lift:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .85rem; }
.card-head h3 { flex: 1; min-width: 0; margin: 0; }
.card-foot { border-top: 1px solid var(--border); margin: 1rem -1.1rem -1.1rem; padding: .8rem 1.1rem; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: .5rem; align-items: center; }
.panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem; }
.grid { display: grid; gap: 1.1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
/* A wide main column with a narrower companion beside it. */
.grid.split { grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 900px) { .grid.split { grid-template-columns: 1fr; } }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.widgets { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.1rem; }
.widget.sm { grid-column: span 3; }
.widget.md { grid-column: span 6; }
.widget.lg { grid-column: span 8; }
.widget.full { grid-column: 1 / -1; }
@media (max-width: 1100px) { .widget.sm { grid-column: span 6; } .widget.md, .widget.lg { grid-column: 1 / -1; } }
@media (max-width: 600px) { .widget.sm { grid-column: 1 / -1; } }
/* A number card: the label sits above, the value dominates, the context below. */
.stat { display: flex; flex-direction: column; gap: .35rem; min-height: 138px; position: relative; overflow: hidden; }
.stat::after {
  content: ""; position: absolute; right: -70px; bottom: -90px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, var(--brand-weak), transparent 70%); pointer-events: none;
}
.stat > :last-child { flex: 1; display: flex; flex-direction: column; }
.stat .kpi-label { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.stat .kpi-value { font-size: 2.25rem; margin-top: .1rem; }
.stat .stat-foot { margin-top: auto; display: flex; align-items: center; gap: .5rem; position: relative; }
.widget .card-head h3 { font-size: .95rem; font-weight: 620; letter-spacing: -.012em; }
.widget-actions { opacity: 0; transition: opacity var(--fast); }
.widget:hover .widget-actions, .widget:focus-within .widget-actions { opacity: 1; }
@media (hover: none) { .widget-actions { opacity: 1; } }
/* The strip of search, filters and views that sits above a table. */
.toolbar {
  display: flex; gap: .5rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .5rem .55rem; box-shadow: var(--shadow-xs); margin-bottom: .9rem;
}
.toolbar > .row { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; }
.toolbar input[type=search] { background: var(--surface-2); border-color: transparent; width: 280px; max-width: 100%; }
.toolbar input[type=search]:focus { background: var(--surface); }
.kpi-value { font-size: 2.1rem; font-weight: 690; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 620; color: var(--faint); }
.delta { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: .2rem; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.tabs { display: flex; flex-wrap: wrap; gap: .15rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: .55rem .85rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 540; transition: color var(--fast), border-color var(--fast); }
.tabs a.active { color: var(--text); border-color: var(--brand); font-weight: 620; }
.tabs a:hover { color: var(--text); }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; }
.meta-list dt { color: var(--muted); font-size: 12.5px; }
.meta-list dd { margin: 0; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th {
  font-size: 11.5px; font-weight: 640; text-transform: uppercase; letter-spacing: .055em; color: var(--muted);
  background: var(--surface-2); position: sticky; top: 0; white-space: nowrap; z-index: 1;
  border-bottom: 1px solid var(--border-strong);
}
th:first-child { border-top-left-radius: var(--radius); }
th:last-child { border-top-right-radius: var(--radius); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); background: var(--surface-3); }
tbody tr { transition: background var(--fast); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.select, th.select { width: 38px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: .7rem .8rem; gap: .5rem; flex-wrap: wrap; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------------------------------------------------------------- badges and states */
.badge {
  display: inline-flex; align-items: center; gap: .33rem; padding: .1rem .55rem; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .005em;
  background: var(--surface-2); color: var(--muted); white-space: nowrap; border: 1px solid transparent;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.brand { background: var(--brand-weak); color: var(--brand-deep); }
.badge.outline { background: transparent; border-color: var(--border-strong); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: currentColor; flex: none; }
.dot.pulse { box-shadow: 0 0 0 0 currentColor; animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.empty { text-align: center; padding: 3rem 1.25rem; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 1.05rem; }
.empty p { max-width: 46ch; margin-inline: auto; }
.empty .mark {
  width: 54px; height: 54px; margin: 0 auto .9rem; border-radius: var(--radius);
  background: linear-gradient(145deg, var(--brand-soft), transparent); display: grid; place-items: center;
  color: var(--brand); font-size: 22px; border: 1px solid var(--border);
}
.alert {
  padding: .75rem .9rem; border-radius: var(--radius-sm); background: var(--info-bg); color: var(--info);
  margin-bottom: 1rem; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); font-weight: 500;
}
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert strong { font-weight: 650; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: var(--radius-xs); height: 14px; margin: .45rem 0; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--brand-lift), var(--brand)); transition: width var(--med); border-radius: 999px; }
.steps { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.25rem; }
.steps .step { display: flex; align-items: center; gap: .45rem; color: var(--faint); font-size: 12.5px; font-weight: 560; }
.steps .step i { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 11px; font-style: normal; }
.steps .step.on { color: var(--text); }
.steps .step.on i { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.steps .step.done i { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.steps .sep { width: 18px; height: 1px; background: var(--border-strong); }
.score { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; font-weight: 700; font-size: 1.05rem;
  background: conic-gradient(var(--brand) calc(var(--pct, 0) * 1%), var(--surface-3) 0); position: relative; }
.score::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.score span { position: relative; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- overlays */
.backdrop {
  position: fixed; inset: 0; background: color-mix(in srgb, #080a10 55%, transparent); z-index: 40;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  backdrop-filter: blur(3px); animation: fade var(--fast) both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: 90vh; display: flex; flex-direction: column;
  animation: pop var(--med) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal.wide { width: min(880px, 100%); }
.modal-head, .modal-foot { padding: .95rem 1.2rem; display: flex; align-items: center; gap: .5rem; }
.modal-head { border-bottom: 1px solid var(--border); justify-content: space-between; }
.modal-head h3 { margin: 0; }
.modal-foot { border-top: 1px solid var(--border); justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.modal-body { padding: 1.2rem; overflow: auto; }
.drawer-backdrop { justify-content: flex-end; padding: 0; }
.drawer { background: var(--surface); width: min(580px, 100%); height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border-left: 1px solid var(--border); animation: slide var(--med) both; }
@keyframes slide { from { transform: translateX(16px); opacity: .6; } to { transform: none; opacity: 1; } }
#toasts { position: fixed; bottom: 1.1rem; right: 1.1rem; display: flex; flex-direction: column; gap: .55rem; z-index: 60; }
.toast {
  background: color-mix(in srgb, var(--text) 94%, transparent); color: var(--surface);
  padding: .65rem .95rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-width: 390px;
  font-weight: 520; animation: pop var(--med) both;
}
.toast.bad { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

/* Command palette */
.palette { width: min(640px, 100%); align-self: flex-start; margin-top: 11vh; }
.palette input { border: 0; font-size: 1.05rem; padding: 1.05rem 1.2rem; border-bottom: 1px solid var(--border); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.palette input:focus { box-shadow: none; }
.palette ul { list-style: none; margin: 0; padding: .45rem; max-height: 52vh; overflow: auto; }
.palette li { padding: .55rem .75rem; border-radius: var(--radius-sm); cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.palette li.active, .palette li:hover { background: var(--brand-weak); color: var(--brand-deep); }

/* ---------------------------------------------------------------- charts */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { stroke: var(--border); }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: .6rem; font-size: 12px; color: var(--muted); }
.chart .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }

/* ---------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--bg); background-image: var(--bg-tint); }
.auth .card { width: min(430px, 100%); padding: 2rem; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
.auth h1 { margin-bottom: .3rem; }
.auth .mark { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(145deg, var(--brand-lift), var(--brand-deep)); margin-bottom: 1rem;
  box-shadow: 0 4px 12px -4px var(--brand); display: grid; place-items: center; color: var(--brand-ink); font-weight: 700; }
.auth .mark::after { content: "L"; font-size: 20px; letter-spacing: -.02em; }

/* ---------------------------------------------------------------- assistant */
.chat { display: flex; flex-direction: column; gap: 1rem; }
.msg { max-width: 100%; }
.msg.user { align-self: flex-end; background: linear-gradient(180deg, var(--brand-lift), var(--brand)); color: var(--brand-ink); padding: .6rem .9rem; border-radius: 16px 16px 5px 16px; max-width: 75%; box-shadow: var(--shadow-xs); }
.msg.assistant { align-self: stretch; }
.composer { display: flex; gap: .5rem; position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, var(--bg) 35%); padding: .9rem 0 .75rem; }
.composer textarea { min-height: 46px; height: 46px; background: var(--surface); box-shadow: var(--shadow-xs); }
.explain { font-size: 12.5px; color: var(--muted); }
.explain dt { font-weight: 620; color: var(--text); }
.explain dd { margin: 0 0 .35rem; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .45rem 0 .45rem 1.1rem; border-left: 2px solid var(--border); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: .85rem; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--surface); }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.env-production { background: var(--bad-bg); color: var(--bad); }
.widget .card-head .row { flex-wrap: nowrap; gap: .1rem; opacity: 0; transition: opacity var(--fast); }
.widget:hover .card-head .row, .widget:focus-within .card-head .row { opacity: 1; }

/* ---------------------------------------------------------------- website mode */
.site-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.site-card { display: flex; flex-direction: column; gap: .75rem; }
.site-card .thumb {
  height: 92px; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--brand-soft), var(--surface-2));
  border: 1px solid var(--border); display: grid; place-items: center; color: var(--brand-deep); font-weight: 650; letter-spacing: -.02em;
}
.content-groups { display: grid; grid-template-columns: 250px 1fr; gap: 1.1rem; align-items: start; }
@media (max-width: 980px) { .content-groups { grid-template-columns: 1fr; } }
.group-rail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem; box-shadow: var(--shadow-xs); position: sticky; top: 4.6rem; }
.group-rail button {
  width: 100%; justify-content: flex-start; border: 0; background: transparent; box-shadow: none; color: var(--muted);
  font-weight: 540; padding: .45rem .6rem; margin-bottom: 1px; min-height: 34px; text-align: left;
}
.group-rail button:hover { background: var(--surface-2); color: var(--text); }
.group-rail button.on { background: var(--brand-weak); color: var(--brand-deep); font-weight: 620; }
.group-rail .count { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.group-rail .rail-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; font-weight: 650; color: var(--faint); padding: .55rem .6rem .3rem; }
.entry-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; background: var(--surface); box-shadow: var(--shadow-xs); }
.entry-card + .entry-card { margin-top: .85rem; }
.entry-card .drag { cursor: grab; color: var(--faint); }
.field-row { display: grid; grid-template-columns: 190px 1fr; gap: .75rem 1rem; align-items: start; padding: .6rem 0; border-top: 1px dashed var(--border); }
.field-row:first-of-type { border-top: 0; }
.field-row > .label { font-weight: 560; font-size: 12.5px; color: var(--muted); padding-top: .55rem; }
@media (max-width: 760px) { .field-row { grid-template-columns: 1fr; } .field-row > .label { padding-top: 0; } }
.image-field { display: flex; gap: .75rem; align-items: center; }
.image-field .preview { width: 76px; height: 56px; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; color: var(--faint); font-size: 11px; flex: none; }
.diff-view { font-family: var(--mono); font-size: 12px; line-height: 1.6; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; max-height: 60vh; }
.diff-view div { padding: 0 .9rem; white-space: pre-wrap; word-break: break-word; }
.diff-view .add { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.diff-view .del { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.diff-view .hunk { background: var(--surface-2); color: var(--muted); }
.diff-view .file { background: var(--surface-3); color: var(--text); font-weight: 650; padding: .4rem .9rem; position: sticky; top: 0; }
.seo-preview { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; }
.seo-preview .url { color: var(--ok); font-size: 12.5px; }
.seo-preview .title { color: #1a0dab; font-size: 1.05rem; font-weight: 500; line-height: 1.3; }
:root[data-theme="dark"] .seo-preview .title { color: #8ab4f8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seo-preview .title { color: #8ab4f8; } }
.seo-preview .desc { color: var(--muted); font-size: 13px; }
.issue { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem 0; border-top: 1px dashed var(--border); }
.issue:first-child { border-top: 0; }
.issue .mark { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; margin-top: .1rem; }
.issue.error .mark { background: var(--bad-bg); color: var(--bad); }
.issue.warning .mark { background: var(--warn-bg); color: var(--warn); }
.issue.info .mark { background: var(--info-bg); color: var(--info); }
.media-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.media-grid .item { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-xs); }
.media-grid .item .pic { height: 92px; background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; color: var(--faint); font-size: 11px; }
.media-grid .item .cap { padding: .4rem .55rem; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 860px) { td { white-space: nowrap; } }
@media print { .sidebar, .topbar { display: none; } .shell { grid-template-columns: 1fr; } .content { padding: 0; } }

/* =====================================================================================================
 * Workspace layer (2027).
 *
 * A soft grey canvas with floating white panels: the sidebar and top bar sit on the canvas like cards,
 * numbers are large and light rather than heavy, the main action is near-black ink, and the organization's
 * colour is kept for the moments that matter (the active page, the lead number, the highlighted bar).
 * ===================================================================================================== */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/Inter-Bold.woff2") format("woff2"); }
@font-face { font-family: "Inter Display"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/InterDisplay-SemiBold.woff2") format("woff2"); }

:root {
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Inter Display", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #eef0f3;
  --bg-tint: none;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --surface-3: #eceef2;
  --border: #e8eaef;
  --border-strong: #d9dce3;
  --text: #0e1014;
  --muted: #5d6370;
  --faint: #8d929d;
  --ink: #0e1014;
  --ink-text: #ffffff;
  --ink-hover: #262a32;
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(16, 20, 32, .04);
  --shadow: 0 1px 2px rgba(16, 20, 32, .03);
  --shadow-md: 0 1px 2px rgba(16, 20, 32, .04), 0 10px 24px -12px rgba(16, 20, 32, .14);
  --stripe: repeating-linear-gradient(135deg, var(--surface-3) 0 5px, color-mix(in srgb, var(--surface-3) 45%, var(--surface)) 5px 9px);
  --gap: 14px;
}
:root[data-theme="dark"] {
  --bg: #08090c; --surface: #121419; --surface-2: #181b21; --surface-3: #20242c;
  --border: #22262e; --border-strong: #2e333d; --text: #eef0f4; --muted: #a0a6b2; --faint: #6c727e;
  --ink: #f2f3f5; --ink-text: #0e1014; --ink-hover: #d9dce1;
  --shadow: none; --shadow-xs: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08090c; --surface: #121419; --surface-2: #181b21; --surface-3: #20242c;
    --border: #22262e; --border-strong: #2e333d; --text: #eef0f4; --muted: #a0a6b2; --faint: #6c727e;
    --ink: #f2f3f5; --ink-text: #0e1014; --ink-hover: #d9dce1;
    --shadow: none; --shadow-xs: none;
  }
}
body { letter-spacing: -.011em; font-feature-settings: "cv11" 1, "ss03" 1; }
h1 { font-family: var(--display); font-weight: 600; font-size: 1.75rem; letter-spacing: -.028em; }
h2 { font-weight: 600; letter-spacing: -.02em; }
h3 { font-weight: 600; letter-spacing: -.014em; }
.ico { flex: none; display: block; }

/* Shell: a canvas with two floating panels. */
.shell { --sidebar: 268px; gap: var(--gap); padding: var(--gap); background: var(--bg); }
.sidebar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  top: var(--gap); height: calc(100vh - var(--gap) * 2); box-shadow: var(--shadow); backdrop-filter: none;
}
.brand { padding: 1.15rem 1.15rem .85rem; font-size: 1.05rem; font-weight: 600; font-family: var(--display); }
.brand .logo { width: 34px; height: 34px; border-radius: 11px; font-size: 15px; }
.workspace {
  margin: 0 .85rem .5rem; display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); position: relative;
}
.workspace .ws-dot { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none;
  background: conic-gradient(from 210deg, #ff7a45, #ff3d71, #7c5cff, #ff7a45); }
.workspace .ws-name { flex: 1; min-width: 0; font-weight: 550; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.workspace .ico { color: var(--faint); }
.nav { padding: .35rem .85rem 1rem; }
.nav-section { margin-top: 1.1rem; }
.nav-title { text-transform: none; letter-spacing: -.005em; font-size: 12.5px; font-weight: 500; color: var(--faint); padding: 0 .35rem .4rem; }
.nav a {
  position: relative; gap: .7rem; padding: .5rem .65rem; margin-bottom: 2px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; font-size: 13.5px;
}
.nav a > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a .ico { color: var(--faint); transition: color var(--fast); }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a:hover .ico { color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); font-weight: 600; box-shadow: none; }
.nav a.active .ico { color: var(--brand); }
.nav a.active::before { content: ""; position: absolute; left: -.85rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav .count { background: var(--brand); color: var(--brand-ink); font-size: 10.5px; min-width: 20px; height: 20px; line-height: 20px; padding: 0 .4rem; }
.invite {
  margin: 0 .85rem .75rem; padding: .9rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.invite .badge-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--ink-text); display: grid; place-items: center; margin-bottom: .6rem; }
.invite strong { display: block; font-size: 13.5px; font-weight: 600; }
.invite p { font-size: 12px; color: var(--muted); margin: .2rem 0 .65rem; line-height: 1.45; }
.sidebar-foot { border-top: 1px solid var(--border); padding: .75rem .85rem; background: transparent; gap: .55rem; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; flex: none;
  color: #fff; background: linear-gradient(140deg, color-mix(in srgb, var(--brand) 70%, #ff8a5b), var(--brand-deep)); }
.sidebar-foot .grow > div:first-child { font-weight: 600; font-size: 13px; }
.icon-btn { min-width: 36px; min-height: 36px; padding: 0; border-radius: 50%; }
.icon-btn.square { border-radius: var(--radius-sm); }

.main { gap: var(--gap); }
.topbar {
  position: sticky; top: var(--gap); z-index: 5; padding: .6rem .7rem .6rem 1.25rem; gap: .6rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px) saturate(170%);
  border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow);
}
.topbar .page-title { font-weight: 600; font-size: 15px; letter-spacing: -.015em; white-space: nowrap; margin-right: .5rem; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.topbar .search { flex: 1; max-width: 460px; justify-content: flex-start; gap: .55rem; min-height: 40px; border-radius: 999px; padding: 0 .5rem 0 .9rem;
  background: var(--surface-2); border: 1px solid transparent; color: var(--faint); font-weight: 400; box-shadow: none; }
.topbar .search:hover { background: var(--surface-3); color: var(--muted); }
.topbar .search kbd { border-radius: 6px; }
.topbar .tb-actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.topbar .tb-actions .icon-btn { border: 1px solid var(--border); background: var(--surface); box-shadow: none; color: var(--muted); position: relative; }
.topbar .tb-actions .icon-btn:hover { color: var(--text); background: var(--surface-2); }
.topbar .ping { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: #ff4d3d; box-shadow: 0 0 0 2px var(--surface); }
.topbar .ask-ai { border-radius: 999px; min-height: 36px; }
.content { padding: .6rem .35rem 2rem; max-width: 1520px; }
@media (max-width: 860px) {
  .shell { padding: 8px; gap: 8px; }
  .sidebar { top: 8px; left: 8px; height: calc(100vh - 16px); border-radius: var(--radius-xl); }
  .topbar { top: 8px; padding: .5rem .6rem; }
  .topbar .page-title { display: none; }
  .content { padding: .4rem .1rem 1.5rem; }
}

/* Controls: near-black primary actions, soft secondary ones. */
button, .btn { border-radius: var(--radius-sm); font-weight: 550; border-color: var(--border); box-shadow: none; }
button:hover, .btn:hover { border-color: var(--border-strong); }
.primary { background: var(--ink); border-color: var(--ink); color: var(--ink-text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .08); }
.primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); color: var(--ink-text); }
.ghost { border-color: transparent; }
.seg { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.seg button { border-radius: 999px; padding: .15rem .85rem; }
.seg button.on { background: var(--ink); color: var(--ink-text); box-shadow: none; }
input, select, textarea { border-radius: var(--radius-sm); }

/* Tabs read as a pill group (the dark pill is the page you are on). */
.tabs { display: inline-flex; gap: .2rem; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); max-width: 100%; }
.tabs a { padding: .42rem .95rem; border: 0; border-radius: 999px; font-weight: 500; font-size: 13px; }
.tabs a:hover { background: var(--surface-2); }
.tabs a.active { background: var(--ink); color: var(--ink-text); font-weight: 550; }

/* Surfaces. */
.card { border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow); }
.card.lift:hover { transform: none; box-shadow: var(--shadow-md); }
.card-foot { margin: 1.1rem -1.25rem -1.25rem; padding: .85rem 1.25rem; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.grid, .widgets { gap: var(--gap); }
.panel { border-radius: var(--radius); }
.page-head { margin-bottom: 1.1rem; align-items: flex-end; }
.page-head h1 { margin: 0; }
.page-head p { margin-top: .35rem; }
.page-head .eyebrow { text-transform: none; letter-spacing: -.005em; font-size: 13px; font-weight: 500; color: var(--faint); }

/* Greeting at the top of the home dashboard. */
.hello h1 { font-size: 2.15rem; letter-spacing: -.035em; }
.hello h1 .wave { display: inline-block; margin-left: .3rem; }
.hello p { font-size: 14.5px; }

/* Number cards: an icon chip and a title, a large light figure, and context underneath. */
.stat { min-height: 156px; gap: .55rem; padding: 1.1rem 1.15rem 1.05rem; }
.stat::after { display: none; }
.stat .card-head { align-items: center; }
.stat .chip { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); flex: none; }
.stat .kpi-label { text-transform: none; letter-spacing: -.01em; font-size: 14px; font-weight: 500; color: var(--text); }
.stat .kpi-value, .kpi-value { font-family: var(--display); font-weight: 600; font-size: 2.35rem; letter-spacing: -.04em; }
.stat .stat-foot { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: .2rem; padding: .12rem .5rem; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill.up { background: var(--ok-bg); color: var(--ok); }
.pill.down { background: var(--bad-bg); color: var(--bad); }
/* The lead number is drawn in the organization's colour. */
.stat.feature { color: #fff; border-color: transparent;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--brand) 55%, #7dd3fc) 0%, transparent 55%),
              linear-gradient(160deg, var(--brand-lift) 0%, var(--brand) 45%, var(--brand-deep) 100%);
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--brand) 70%, transparent); }
.stat.feature .kpi-label, .stat.feature .stat-foot, .stat.feature .stat-foot .muted { color: rgba(255, 255, 255, .85); }
.stat.feature .chip { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .22); color: #fff; }
.stat.feature .pill { background: rgba(255, 255, 255, .18); color: #fff; }
.stat.feature .widget-actions button { color: #fff; }
.stat.feature .widget-actions button:hover { background: rgba(255, 255, 255, .14); }
.stat.feature .progress { background: rgba(255, 255, 255, .22); }
.stat.feature .progress > div { background: #fff; }
.progress { height: 10px; background: var(--stripe); }
.progress > div { background: linear-gradient(90deg, var(--brand-deep), var(--brand)); }

/* Column charts: striped columns with the peak drawn solid and labelled. */
.chart .bar-bg { fill: url(#stripe); }
.chart .bar-peak-label rect { fill: var(--brand); }
.chart .bar-peak-label text { fill: #fff; font-size: 11px; font-weight: 600; }
.chart text { font-family: var(--font); }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .legend { gap: .35rem 1rem; font-size: 12.5px; }
.chart .legend i { border-radius: 50%; width: 8px; height: 8px; }

/* Tables: a soft header band, roomy rows, status shown as a dot and a word. */
.table-wrap { border-radius: var(--radius); }
th { text-transform: none; letter-spacing: -.005em; font-size: 12.5px; font-weight: 500; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); padding: .7rem .9rem; }
td { padding: .78rem .9rem; border-bottom-color: var(--border); }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.badge { font-weight: 550; padding: .14rem .6rem; }
.badge.status { background: transparent; padding-left: 0; color: var(--text); font-weight: 500; font-size: 12.5px; }
.badge.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.badge.status.ok::before { background: #16b364; }
.badge.status.warn::before { background: #f5a524; }
.badge.status.bad::before { background: #f04438; }
.badge.status.info::before { background: #2e90fa; }
.badge.status.brand::before { background: var(--brand); }
.toolbar { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.toolbar input[type=search] { border-radius: 999px; }
.pager { border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--surface); }

/* Modals and the palette pick up the larger radius. */
.modal { border-radius: var(--radius-xl); }
.modal-foot { border-radius: 0 0 var(--radius-xl) var(--radius-xl); }

/* Sign-in: a single floating card on the canvas. */
.auth { background: var(--bg); }
.auth .card { border-radius: 26px; padding: 2.25rem; box-shadow: 0 30px 60px -30px rgba(16, 20, 32, .25); }
.auth .mark { border-radius: 13px; background: var(--ink); color: var(--ink-text); }
.auth h1 { font-size: 1.85rem; }
/* The search strip and the table below it read as one card. */
.toolbar { margin-bottom: 0; border-bottom: 0; box-shadow: none; padding: .7rem .75rem; }
.toolbar + .card { border-top-left-radius: 0; border-top-right-radius: 0; }
.toolbar + .card th:first-child, .toolbar + .card th:last-child { border-radius: 0; }
.toolbar input[type=search] { padding-left: 2.1rem; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238d929d' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat .8rem center; }
/* Website editor rail follows the sidebar's language. */
.group-rail { border-radius: var(--radius-lg); padding: .6rem; }
.group-rail .rail-title { text-transform: none; letter-spacing: -.005em; font-size: 12.5px; font-weight: 500; }
.group-rail button { border-radius: var(--radius-sm); font-weight: 500; }
.group-rail button.on { background: var(--surface-2); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.entry-card, .seo-preview, .media-grid .item { border-radius: var(--radius); }
.field-row { border-top-style: solid; }
.timeline li { border-left: 0; padding-left: 0; display: flex; gap: .75rem; align-items: flex-start; }
.timeline li::before { display: none; }
.timeline li + li { border-top: 1px solid var(--border); }
.timeline .avatar { width: 32px; height: 32px; font-size: 11.5px; }
.tabs { flex-wrap: nowrap; overflow-x: auto; }
.tabs a { padding: .42rem .8rem; }

/* Sign-in: form on the left, a product panel on the right. */
.auth.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); place-items: stretch; padding: 14px; gap: 14px; min-height: 100vh; }
.auth-main { display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 1.5rem 1rem; }
.auth-brand { align-self: flex-start; display: flex; align-items: center; gap: .6rem; font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.auth-brand .mark { width: 34px; height: 34px; margin: 0; border-radius: 11px; font-size: 15px; }
.auth.split .card { background: transparent; border: 0; box-shadow: none; padding: 0; width: min(400px, 100%); }
.auth.split .card h1 { font-size: 2.1rem; letter-spacing: -.035em; margin-bottom: .35rem; }
.auth.split input { min-height: 44px; background: var(--surface); }
.auth.split button[type=submit] { min-height: 46px; border-radius: 12px; font-size: 14.5px; }
.auth-side { position: relative; overflow: hidden; border-radius: 26px; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; color: #fff;
  background: radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--brand) 40%, #7dd3fc) 0%, transparent 60%),
              radial-gradient(70% 60% at 0% 100%, color-mix(in srgb, var(--brand) 50%, #f472b6) 0%, transparent 60%),
              linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%); }
.auth-quote h2 { font-family: var(--display); font-size: 2.2rem; line-height: 1.12; letter-spacing: -.035em; max-width: 15ch; margin-bottom: .8rem; }
.auth-quote p { color: rgba(255, 255, 255, .8); max-width: 42ch; font-size: 15px; }
.auth-mock { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); border-radius: 22px; padding: 1.2rem; backdrop-filter: blur(10px); }
.mock-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.mock-stat { background: #fff; color: #0e1014; border-radius: 16px; padding: .9rem 1rem; display: grid; gap: .2rem; }
.mock-stat span { font-size: 12.5px; color: #5d6370; }
.mock-stat b { font-family: var(--display); font-weight: 600; font-size: 1.7rem; letter-spacing: -.04em; }
.mock-stat i { font-style: normal; font-size: 12px; font-weight: 600; color: #0f7a3d; background: #e4f5e9; border-radius: 999px; padding: .05rem .5rem; width: fit-content; }
.mock-chart { margin-top: .8rem; background: #fff; border-radius: 16px; height: 150px; padding: 1rem; display: flex; align-items: flex-end; gap: 10px; }
.mock-chart div { flex: 1; border-radius: 999px; background: repeating-linear-gradient(135deg, #eceef2 0 5px, #f5f6f8 5px 9px); }
.mock-chart div.on { background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 40%, white)); }
@media (max-width: 900px) { .auth.split { grid-template-columns: 1fr; } .auth-side { display: none; } }
td a { color: var(--text); font-weight: 500; }
td a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); }
.mock-chart { height: 190px; }
@media (max-width: 860px) {
  .sidebar { transform: translateX(calc(-100% - 16px)); }
  .topbar .search { min-width: 0; }
  .topbar .search .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .search kbd, .topbar .ask-ai { display: none; }
  .hello h1 { font-size: 1.7rem; }
}

/* Password boxes: an eye button inside the box shows or hides what was typed. */
.password-box { position: relative; }
.password-box > input { padding-right: 2.6rem; }
.password-box > .reveal { position: absolute; top: 50%; right: .35rem; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; min-height: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); box-shadow: none; cursor: pointer; }
.password-box > .reveal:hover { color: var(--ink, inherit); background: var(--surface-2); }
.password-box > .reveal:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.password-box > input::-ms-reveal { display: none; }

/* AI review on a website's Overview. */
.ai-review { border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 5%, var(--surface)), var(--surface)); }
.ai-mark { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 8px; background: var(--brand); color: #fff; font-size: 13px; }
.ai-steps { margin: 0; padding-left: 1.1rem; display: grid; gap: .3rem; }

/* Website overview: numbers sit in short cards, and every card has room around it. */
.website-overview .stat { min-height: 0; }
.website-overview .grid.split { align-items: start; }
/* Menu links: label and link side by side, so a whole menu fits on one screen. */
.entry-card.compact { padding: .75rem 1rem; }
.entry-card.compact h4 { font-size: 14px; }
@media (min-width: 900px) {
  .entry-card.compact { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }
  .entry-card.compact > :first-child { grid-column: 1 / -1; margin-bottom: .2rem !important; }
  .entry-card.compact .field-row { grid-template-columns: 70px 1fr; border-top: 0; padding: .2rem 0; }
}

/* Plan and billing. */
.plan-card .eyebrow { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.plan-price strong { font-size: 1.75rem; letter-spacing: -.02em; }
.plan-features { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .35rem 1rem; font-size: 13.5px; }
.plan-features li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: .45rem; }
.danger-text { color: var(--bad) !important; }
.invoice table { width: 100%; }
.invoice tfoot th { border-top: 2px solid var(--border); }
@media print {
  body.printing-invoice * { visibility: hidden; }
  body.printing-invoice .invoice, body.printing-invoice .invoice * { visibility: visible; }
  body.printing-invoice .invoice { position: absolute; inset: 0; padding: 2rem; }
}

/* A bar for work in progress: moving stripes say "still working" even between steps. */
.progress > div { transition: width .25s linear; }
.progress.live > div { background-image: linear-gradient(90deg, var(--brand-deep, var(--brand)), var(--brand)), repeating-linear-gradient(45deg, rgba(255,255,255,.22) 0 10px, transparent 10px 20px);
  background-blend-mode: overlay; background-size: 100% 100%, 28px 28px; animation: progress-stripes 1s linear infinite; }
@keyframes progress-stripes { from { background-position: 0 0, 0 0; } to { background-position: 0 0, 28px 0; } }
@media (prefers-reduced-motion: reduce) { .progress.live > div { animation: none; } }

/* A button that is waiting for the server shows a small turning circle. */
button.busy { position: relative; color: transparent !important; }
button.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent; animation: spin .8s linear infinite; }
button.primary.busy::after, button.danger.busy::after { border-color: #fff transparent #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.sticky-save { position: sticky; top: .75rem; z-index: 5; }
@media (max-width: 1100px) { .plan-editor { grid-template-columns: 1fr; } }
.compact-stats .stat { min-height: 0; }

/* The LayerAdapt mark: one drawn logo everywhere (sidebar, sign-in, favicon). */
.brand .logo { background: #0b1220; box-shadow: none; }
.auth .mark { background: url("/assets/site/img/logo-mark.svg") center / cover no-repeat; box-shadow: 0 6px 16px -8px rgba(11, 18, 32, .5); }
.auth .mark::after { content: none; }

/* My account (admin console) */
.account-card { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 1.5rem; align-items: center; margin-bottom: 1rem; }
.account-id { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.account-id h2 { margin: 0; font-size: 1.15rem; }
.account-id .muted { overflow-wrap: anywhere; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.fact-value { margin-top: .3rem; font-weight: 600; }
@media (max-width: 900px) { .account-card { grid-template-columns: 1fr; } .facts { grid-template-columns: 1fr 1fr; } }
.session-row { padding: .55rem 0; border-top: 1px solid var(--line); } .session-row:first-child { border-top: 0; padding-top: 0; }
.pw-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; }
@media (max-width: 640px) { .pw-form .form-grid { grid-template-columns: 1fr; } .pw-form .form-grid > div:empty { display: none; } }

/* No grid lines or stripes: charts and progress bars use plain, quiet fills. */
.chart .grid-line { display: none; }
.progress { background: var(--surface-3); }
.mock-chart div { background: #eceef2; }
.field-row, .issue { border-top-style: solid; }

/* Notifications card under the bell */
.notif-wrap { position: relative; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-width: calc(100vw - 24px); z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 48px -12px rgba(11, 18, 32, .28), 0 2px 6px rgba(11, 18, 32, .06); overflow: hidden; animation: notif-in .14s ease-out; }
@keyframes notif-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.notif-head, .notif-foot { display: flex; align-items: center; justify-content: space-between; padding: .7rem 1rem; }
.notif-head { border-bottom: 1px solid var(--border); }
.notif-foot { border-top: 1px solid var(--border); justify-content: center; }
.notif-list { max-height: min(420px, 60vh); overflow-y: auto; }
.notif-item { display: flex; justify-content: flex-start; align-items: flex-start; gap: .65rem; width: 100%; text-align: left; padding: .75rem 1rem; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text); font: inherit; cursor: pointer; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover, .notif-item:focus-visible { background: var(--surface-2); }
.notif-dot { flex: none; width: 8px; height: 8px; margin-top: .4rem; border-radius: 50%; background: transparent; }
.notif-item.unread .notif-dot { background: var(--brand); }
.notif-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.notif-title { font-weight: 600; font-size: .9rem; }
.notif-item:not(.unread) .notif-title { font-weight: 500; color: var(--muted); }
.notif-body { font-size: .82rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.notif-time { font-size: .75rem; color: var(--faint, var(--muted)); }
.notif-empty { display: flex; gap: .7rem; align-items: flex-start; padding: 1.4rem 1rem; color: var(--muted); }
@media (max-width: 640px) { .notif-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; } }
.text-btn { border: 0; background: none; box-shadow: none; padding: .15rem .25rem; color: var(--brand); font-weight: 600; cursor: pointer; min-height: 0; }
.text-btn:hover { text-decoration: underline; background: none; }

/* Settings: grouped menu on the left, the chosen section on the right */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.settings-nav { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 1rem; padding: .9rem .6rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.settings-group { display: flex; flex-direction: column; gap: 2px; }
.settings-group-label { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint, var(--muted)); padding: 0 .6rem .3rem; }
.settings-nav a { display: block; padding: .45rem .6rem; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.settings-nav a:hover { background: var(--surface-2); color: var(--text); }
.settings-nav a.active { background: var(--surface-2); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--brand); }
.settings-body { min-width: 0; }
.logo-preview { width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview .small { font-size: .62rem; text-align: center; line-height: 1.1; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; gap: .25rem; padding: .4rem; }
  .settings-group { flex-direction: row; flex: none; }
  .settings-group-label { display: none; }
  .settings-nav a { white-space: nowrap; }
}
.ws-dot.has-logo { background: #fff; padding: 2px; overflow: hidden; }
.ws-dot.has-logo img { width: 100%; height: 100%; object-fit: contain; }
