/* ════════════════════════════════════════════════════════════════════
   QA Tester — The Quiet Watchroom
   Dentli design system applied. See DESIGN.md.
   ──────────────────────────────────────────────────────────────────── */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
[hidden] { display: none !important; }
.u-flex-1 { flex: 1; }
.u-min-0 { min-width: 0; }
.u-no-shrink { flex-shrink: 0; }
.u-full-width { width: 100%; }
.u-lavender { color: var(--lavender); }
.u-muted { color: var(--text-muted); }
.u-subtle { color: var(--text-subtle); }
.u-mt-hairline { margin-top: 1px; }
.u-col-actions { width: 80px; }

/* ════════════════════════════════════════════════════════════════════
   TOKENS
   ──────────────────────────────────────────────────────────────────── */

:root {
  /* Brand */
  --lavender:        #806DFF;
  --lavender-soft:   #A8A1FF;
  --lavender-deep:   #5C55C4;
  --ink-deep:        #4A379B;
  --ink-muted:       #4F4968;
  --cream:           #FFECD6;
  --coral:           #FD898B;
  --taupe:           #846643;

  /* Surfaces (light theme — default) */
  --paper:           #FCFBFF;
  --paper-soft:      #F4F2FA;
  --paper-deep:      #ECE9F5;
  --border-hairline: #DEDAE8;
  --border-strong:   #C0BAD0;

  /* Text (light) */
  --text-primary:    #4A379B;
  --text-body:       #383649;
  --text-muted:      #6F6A82;
  --text-subtle:     #968FA8;

  /* Status (light) */
  --pass:            #2D7A4F;
  --warning:         #B36810;
  --fail:            #B53B2C;
  --pass-bg:         #E0F0E5;
  --warning-bg:      #FBEBD6;
  --fail-bg:         #FBDED9;

  /* Cross-theme accents */
  --link:            var(--ink-deep);
  --link-hover:      var(--lavender);

  /* Focus */
  --focus-ring:      rgba(168, 161, 255, 0.55);

  /* Radii */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-pill: 999px;

  /* Shadows: hairline-first system. Most surfaces are flat. */
  --shadow-card-rest:  0 1px 2px rgba(74, 55, 155, .08), 0 4px 12px rgba(74, 55, 155, .05);
  --shadow-card-hover: 0 2px 4px rgba(74, 55, 155, .10), 0 8px 20px rgba(74, 55, 155, .08);
  --shadow-popover:    0 8px 24px rgba(74, 55, 155, .15), 0 2px 6px rgba(74, 55, 155, .08);
  --shadow-modal:      0 16px 48px rgba(31, 22, 50, .40);

  /* Status-dot shadows: tiny ambient halo, not glow. */
  --halo-pass: 0 0 0 3px rgba(45, 122, 79, .12);
  --halo-warn: 0 0 0 3px rgba(179, 104, 16, .12);
  --halo-fail: 0 0 0 3px rgba(181, 59, 44, .15);

  /* Motion */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --d-fast:    120ms;
  --d-default: 180ms;
  --d-slow:    260ms;

  --shadow-skeleton: rgba(74, 55, 155, .06);
}

/* Dark theme — Dentli at Night. Not an inversion. Composed independently. */
[data-theme="dark"] {
  --paper:           #1F1632;          /* night */
  --paper-soft:      #292244;          /* night-soft */
  --paper-deep:      #322A50;          /* night-card */
  --border-hairline: #423C5E;
  --border-strong:   #5F5680;

  --text-primary:    #F8F6FB;
  --text-body:       #DAD6E3;
  --text-muted:      #A8A2BB;
  --text-subtle:     #807A93;

  --lavender:        #A595FF;
  --lavender-soft:   #C2B7FF;
  --lavender-deep:   #806DFF;
  --ink-deep:        #F8F6FB;          /* primary text reads as the "ink" on dark */
  --ink-muted:       #A8A2BB;
  --cream:           #FBE4C0;
  --coral:           #FD898B;

  --pass:            #51AC78;
  --warning:         #DCA055;
  --fail:            #E25849;
  --pass-bg:         rgba(81, 172, 120, .18);
  --warning-bg:      rgba(220, 160, 85, .20);
  --fail-bg:         rgba(226, 88, 73, .22);

  --link:            #C2B7FF;
  --link-hover:      #E0DAFF;

  --focus-ring:      rgba(168, 161, 255, 0.45);

  --shadow-card-rest:  0 1px 2px rgba(0, 0, 0, .35), 0 4px 12px rgba(0, 0, 0, .25);
  --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, .40), 0 8px 20px rgba(0, 0, 0, .30);
  --shadow-popover:    0 8px 24px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .40);
  --shadow-modal:      0 16px 48px rgba(0, 0, 0, .70);

  --halo-pass: 0 0 0 3px rgba(81, 172, 120, .25);
  --halo-warn: 0 0 0 3px rgba(220, 160, 85, .25);
  --halo-fail: 0 0 0 3px rgba(226, 88, 73, .25);

  --shadow-skeleton: rgba(255, 255, 255, .04);

  /* Night-name aliases. Component-level dark-mode overrides reference these
     token names directly (e.g. var(--night-card), var(--text-night-muted)).
     Without these definitions they resolve to nothing, which is why hairline
     borders and section backgrounds disappear in dark mode. */
  --night:               #1F1632;
  --night-soft:          #292244;
  --night-card:          #322A50;
  --night-border-hairline: #423C5E;
  --night-border-strong:   #5F5680;
  --text-night-primary:  #F8F6FB;
  --text-night-body:     #DAD6E3;
  --text-night-muted:    #A8A2BB;
  --text-night-subtle:   #807A93;
  --lavender-night:      #A595FF;
  --cream-night:         #FBE4C0;
}

/* ════════════════════════════════════════════════════════════════════
   BASE TYPOGRAPHY
   DM Sans is the workhorse. Kalnia is rare (panel titles only). JetBrains
   Mono is utility (URLs, code, identifiers).
   ──────────────────────────────────────────────────────────────────── */

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--paper);
  color: var(--text-body);
  font-size: .875rem;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--d-default) var(--ease-out-quart),
              color var(--d-default) var(--ease-out-quart);
}
body.modal-open { overflow: hidden; }

a { color: var(--link); text-decoration: none; transition: color var(--d-fast) var(--ease-out-quart); }
a:hover { color: var(--link-hover); text-decoration: underline; }

code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .85em;
  background: var(--paper-soft);
  padding: .1em .4em;
  border-radius: var(--radius-sm);
  color: var(--ink-deep);
  border: 1px solid var(--border-hairline);
}

::selection {
  background: rgba(128, 109, 255, .25);
  color: var(--ink-deep);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hairline); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* Reduced-motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   HEADER
   ──────────────────────────────────────────────────────────────────── */

.app-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .75rem 1.5rem;
  background: var(--paper);
  border-bottom: 1px solid var(--border-hairline);
}

.header-brand { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.brand-icon {
  width: 36px; height: 36px;
  background: var(--lavender);
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-icon svg { width: 18px; height: 18px; color: var(--paper); }
.brand-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text-primary);
}
.brand-sub {
  font-size: .72rem;
  color: var(--text-muted);
  letter-spacing: .02em;
}

/* ── Tab Nav ── */
.tab-nav {
  display: inline-flex; gap: 2px;
  flex: 1; justify-content: center;
  background: transparent;
}
.tab-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--d-default) var(--ease-out-quart),
              color var(--d-default) var(--ease-out-quart);
}
.tab-btn svg { width: 15px; height: 15px; color: currentColor; }
.tab-btn:hover { background: var(--paper-soft); color: var(--ink-deep); }
.tab-btn.active {
  background: var(--paper-deep);
  color: var(--ink-deep);
}
.tab-btn.active svg { color: var(--lavender); }
.tab-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ── Header right cluster (status + theme toggle) ── */
.header-status {
  display: flex; align-items: center; gap: .85rem;
  font-size: .78rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-subtle);
  transition: background var(--d-default), box-shadow var(--d-default);
}
.status-dot.online { background: var(--pass); box-shadow: var(--halo-pass); }
.status-dot.offline { background: var(--fail); box-shadow: var(--halo-fail); }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--d-default) var(--ease-out-quart),
              color var(--d-default) var(--ease-out-quart),
              border-color var(--d-default) var(--ease-out-quart);
}
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle:hover {
  background: var(--paper-soft);
  color: var(--ink-deep);
  border-color: var(--border-strong);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
/* Show only the icon for the current theme */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ════════════════════════════════════════════════════════════════════
   MAIN / PANELS
   ──────────────────────────────────────────────────────────────────── */

.app-main { padding: 2rem 1.5rem; max-width: 1280px; margin: 0 auto; }
.tab-panel { display: none; animation: fadeUp .25s var(--ease-out-quart); }
.tab-panel.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel-header { margin-bottom: 1.75rem; }
.panel-title {
  font-family: 'Kalnia', Georgia, serif;
  font-size: clamp(1.85rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.015em;
  color: var(--text-primary);
}
.panel-desc {
  color: var(--text-muted);
  font-size: .92rem;
  margin-top: .55rem;
  max-width: 70ch;
}

/* ════════════════════════════════════════════════════════════════════
   URL BAR
   ──────────────────────────────────────────────────────────────────── */

.url-bar { display: flex; gap: .75rem; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; }
.url-input-wrap { flex: 1; position: relative; min-width: 240px; display: flex; }
.url-input-wrap.is-fixed { flex: none; }
.url-input-wrap.is-compact { max-width: 200px; }
.url-input-wrap.is-full { width: 100%; }
.url-input.is-plain { padding-left: .9rem; border-radius: var(--radius-md); }
.url-protocol {
  flex-shrink: 0;
  padding: 0 .45rem 0 .6rem;
  background: var(--paper-deep);
  border: 1px solid var(--border-strong);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .78rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--d-default), box-shadow var(--d-default);
}
.url-protocol:focus { border-color: var(--lavender); box-shadow: 0 0 0 3px var(--focus-ring); z-index: 1; }
.url-input {
  width: 100%;
  padding: .65rem .9rem;
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-body);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .82rem;
  outline: none;
  transition: border-color var(--d-default), box-shadow var(--d-default);
}
.url-input-wrap:has(.url-protocol) .url-input {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding-left: .7rem;
}
.url-input::placeholder { color: var(--text-subtle); }
.url-input:focus { border-color: var(--lavender); box-shadow: 0 0 0 3px var(--focus-ring); }

/* ════════════════════════════════════════════════════════════════════
   BUTTONS
   ──────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--d-default) var(--ease-out-quart),
              border-color var(--d-default) var(--ease-out-quart),
              color var(--d-default) var(--ease-out-quart);
}
.btn svg { width: 15px; height: 15px; }
.btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

.btn-primary {
  background: var(--lavender);
  color: var(--paper);
  font-weight: 500;
}
.btn-primary:hover { background: var(--lavender-deep); }
.btn-primary:active { background: var(--ink-deep); }
[data-theme="dark"] .btn-primary { color: #1F1632; }

.btn-outline {
  background: transparent;
  color: var(--ink-deep);
  border-color: var(--border-strong);
}
.btn-outline:hover {
  background: var(--paper-soft);
  border-color: var(--lavender);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: .35rem .75rem;
  font-size: .8rem;
}
.btn-ghost:hover { background: var(--paper-soft); color: var(--ink-deep); }

.btn-sm  { padding: .35rem .75rem; font-size: .8rem; }
.btn-lg  { padding: .8rem 1.5rem; font-size: .9rem; }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .55; cursor: not-allowed; pointer-events: none;
}

.checkbox-label {
  display: flex; align-items: center; gap: .55rem;
  font-size: .875rem;
  color: var(--text-body);
  cursor: pointer;
}
.checkbox-label input { accent-color: var(--lavender); width: 15px; height: 15px; }

/* ════════════════════════════════════════════════════════════════════
   LOADING BAR
   Solid lavender progress, not a gradient.
   ──────────────────────────────────────────────────────────────────── */

.loading-bar {
  height: 2px;
  background: var(--paper-deep);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.loading-bar-fill {
  height: 100%;
  background: var(--lavender);
  width: 32%;
  border-radius: inherit;
  animation: loadSlide 1.4s var(--ease-out-quart) infinite;
}
@keyframes loadSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* ════════════════════════════════════════════════════════════════════
   ALERTS
   ──────────────────────────────────────────────────────────────────── */

.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius-md);
  font-size: .875rem;
  margin-bottom: 1.25rem;
  display: flex; align-items: flex-start; gap: .55rem;
  border: 1px solid transparent;
}
.alert::before {
  content: '';
  width: 16px; height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.alert-error {
  background: var(--fail-bg);
  border-color: var(--fail);
  color: var(--fail);
}
.alert-error::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23B53B2C'%3E%3Cpath d='M8 1.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13Zm-.75 3.5h1.5v4.25h-1.5V5Zm0 5.5h1.5V12h-1.5v-1.5Z'/%3E%3C/svg%3E");
}
.alert-success {
  background: var(--pass-bg);
  border-color: var(--pass);
  color: var(--pass);
}
.alert-success::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%232D7A4F'%3E%3Cpath d='M8 1.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13Zm3.5 4.7L7 11.05 4.5 8.5l1.05-1.05L7 8.95l3.45-3.5 1.05.75Z'/%3E%3C/svg%3E");
}
.gen-run-alert {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}
.gen-run-title { font-weight: 600; }
.gen-run-meta {
  color: inherit;
  opacity: .8;
  font-size: .82rem;
}
.gen-run-link {
  margin-left: auto;
  color: inherit;
  text-decoration: underline;
}

/* ════════════════════════════════════════════════════════════════════
   PANEL CARD
   Default surface for grouped content. Hairline-first. No shadow at rest.
   ──────────────────────────────────────────────────────────────────── */

.panel-card {
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  transition: border-color var(--d-default), box-shadow var(--d-default);
}
.panel-card:hover {
  border-color: var(--border-strong);
}

/* ════════════════════════════════════════════════════════════════════
   INSPECTOR RESULTS
   ──────────────────────────────────────────────────────────────────── */

.result-summary {
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.result-page-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: .25rem;
}
.result-page-url {
  font-size: .78rem;
  color: var(--lavender);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  word-break: break-all;
}
.meta-pill {
  font-size: .78rem;
  color: var(--text-muted);
  font-style: italic;
  max-width: 400px;
}

/* Stat tiles: small, inline, body-weight numbers (NOT hero metrics). */
.stats-row { display: flex; gap: .65rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.stat-card {
  flex: 1; min-width: 96px;
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: .65rem .85rem;
  text-align: left;
}
.stat-num {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-family: 'DM Sans', sans-serif;
}
.stat-label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .2rem;
}

/* Detail panels grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.detail-card { overflow: hidden; }
.card-header {
  display: flex; align-items: center; gap: .55rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border-hairline);
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.card-header svg { width: 14px; height: 14px; color: var(--lavender); }
.card-body { padding: .75rem 1rem; }
.card-body.scrollable { max-height: 220px; overflow-y: auto; }

.dom-item {
  display: flex; align-items: baseline; gap: .55rem;
  padding: .35rem 0;
  border-bottom: 1px solid var(--border-hairline);
  font-size: .82rem;
}
.dom-item:last-child { border-bottom: none; }
.dom-tag {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .7rem;
  color: var(--ink-deep);
  background: var(--paper-soft);
  padding: .12em .45em;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.dom-text {
  color: var(--text-body);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dom-empty {
  color: var(--text-muted);
  font-size: .8rem;
}
.dom-link {
  color: var(--lavender);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .76rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dom-link:hover { color: var(--lavender-deep); }
.dom-attr { font-size: .72rem; color: var(--text-subtle); }

.inspect-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ════════════════════════════════════════════════════════════════════
   EDITOR
   ──────────────────────────────────────────────────────────────────── */

.editor-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 900px) { .editor-layout { grid-template-columns: 1fr; } }

.editor-toolbar {
  display: flex; align-items: center; gap: .35rem;
  padding: .5rem .65rem;
  background: var(--paper-soft);
  border: 1px solid var(--border-hairline);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-wrap: wrap;
}
.toolbar-sep {
  width: 1px; height: 18px;
  background: var(--border-hairline);
  margin: 0 .25rem;
}

.code-editor-wrap {
  display: flex;
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  min-height: 380px;
}
.code-editor-wrap.is-generated { min-height: 260px; border-radius: var(--radius); }
.editor-gutter {
  padding: .85rem .5rem;
  background: var(--paper-soft);
  border-right: 1px solid var(--border-hairline);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .78rem;
  color: var(--text-subtle);
  text-align: right;
  min-width: 42px;
  user-select: none;
  line-height: 1.6;
}
.code-editor {
  flex: 1;
  padding: .85rem 1rem;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink-deep);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .84rem;
  line-height: 1.6;
  resize: none;
  min-height: 380px;
  tab-size: 2;
}
.code-editor.is-readonly-generated { min-height: 260px; cursor: default; }
.code-editor::placeholder { color: var(--text-subtle); }

.editor-actions { display: flex; align-items: center; gap: 1rem; margin-top: .85rem; }
.editor-hint { font-size: .75rem; color: var(--text-muted); }

/* Output panel */
.output-header {
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem .9rem;
  background: var(--paper-soft);
  border: 1px solid var(--border-hairline);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.output-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.output-badges { display: flex; gap: .5rem; flex: 1; }

.status-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .15em .65em;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: .06em;
  border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: .25em;
}
.status-badge.pass {
  background: var(--pass-bg);
  color: var(--pass);
  border-color: rgba(45, 122, 79, .25);
}
.status-badge.warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: rgba(179, 104, 16, .25);
}
.status-badge.fail {
  background: var(--fail-bg);
  color: var(--fail);
  border-color: rgba(181, 59, 44, .25);
}
.duration-badge {
  font-size: .7rem;
  color: var(--text-muted);
  padding: .15em .65em;
  background: var(--paper-deep);
  border-radius: var(--radius-pill);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.output-panel {
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: .85rem 1rem;
  min-height: 380px;
  max-height: 500px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .78rem;
}
.output-placeholder {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .65rem;
  color: var(--text-subtle);
  text-align: center;
  min-height: 300px;
}
.output-placeholder svg { width: 36px; height: 36px; opacity: .35; }

.log-line {
  display: flex; gap: .75rem;
  padding: .25rem 0;
  border-bottom: 1px solid var(--border-hairline);
  line-height: 1.5;
}
.log-line:last-child { border-bottom: none; }
.log-time {
  color: var(--text-subtle);
  flex-shrink: 0; min-width: 55px;
}
.log-msg {
  color: var(--text-body);
  word-break: break-word;
  white-space: pre-wrap;
}
.log-msg.error { color: var(--fail); }
.log-msg.success { color: var(--pass); }

.report-link-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .85rem;
  background: var(--paper-soft);
  border: 1px solid var(--border-hairline);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: .8rem;
  color: var(--text-muted);
}
.report-link-bar.is-spaced { margin-top: .75rem; }
.report-link-bar svg { width: 14px; height: 14px; }

/* ════════════════════════════════════════════════════════════════════
   SECTION DIVIDER
   ──────────────────────────────────────────────────────────────────── */

.section-divider {
  display: flex; align-items: center; justify-content: space-between;
  margin: 1.5rem 0 1rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}
.section-divider::before, .section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-hairline);
}
.section-divider::before { margin-right: .85rem; }
.section-divider::after { margin-left: .85rem; }
.section-divider span { flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════════════
   SCREENSHOTS
   ──────────────────────────────────────────────────────────────────── */

.screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.gallery-placeholder {
  grid-column: 1/-1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .75rem;
  padding: 3rem;
  color: var(--text-muted);
  text-align: center;
}
.gallery-placeholder svg { width: 40px; height: 40px; opacity: .3; }
.gallery-placeholder p { font-size: .9rem; }

.screenshot-card {
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--d-default), box-shadow var(--d-default);
}
.screenshot-card:hover {
  border-color: var(--lavender);
  box-shadow: var(--shadow-card-hover);
}
.screenshot-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  object-position: top;
  display: block;
}
.screenshot-info { padding: .7rem .85rem; }
.screenshot-filename {
  font-size: .75rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text-body);
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.screenshot-date {
  font-size: .7rem;
  color: var(--text-subtle);
  margin-top: .2rem;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(31, 22, 50, .82);
}
.lightbox-content {
  position: relative;
  max-width: 92vw; max-height: 92vh;
  display: flex; flex-direction: column;
  gap: .65rem;
}
.lightbox-close {
  position: absolute; top: -2.5rem; right: 0;
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: 50%;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background var(--d-default), color var(--d-default), border-color var(--d-default);
}
.lightbox-close:hover {
  background: var(--fail-bg);
  color: var(--fail);
  border-color: var(--fail);
}
.lightbox-close svg { width: 16px; height: 16px; }
#lightbox-img {
  max-width: 92vw; max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  background: var(--paper);
  box-shadow: var(--shadow-modal);
}
.lightbox-meta {
  font-size: .78rem;
  color: var(--paper);
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ════════════════════════════════════════════════════════════════════
   SETTINGS MODAL
   ──────────────────────────────────────────────────────────────────── */

.settings-modal {
  position: fixed; inset: 0; z-index: 520;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.settings-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(31, 22, 50, .72);
}
.settings-modal-content {
  position: relative;
  width: min(560px, 100%);
  max-height: min(92vh, 680px);
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.settings-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border-hairline);
  background: var(--paper-soft);
}
.settings-modal-header h3 {
  font-size: .98rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .15rem;
}
.settings-modal-header p {
  font-size: .78rem;
  color: var(--text-muted);
}
.settings-modal-close {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--text-muted);
  cursor: pointer;
}
.settings-modal-close:hover, .settings-modal-close:focus-visible {
  color: var(--ink-deep);
  border-color: var(--border-strong);
  outline: none;
}
.settings-modal-close svg { width: 14px; height: 14px; }
.settings-modal-body {
  padding: 1rem 1.1rem;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .85rem;
  overflow-y: auto;
}
.settings-field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.settings-field-full { grid-column: 1 / -1; }
.settings-field label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.settings-field input,
.settings-field select {
  width: 100%;
  background: var(--paper);
  color: var(--text-body);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: .55rem .65rem;
  font: inherit;
  font-size: .86rem;
}
.settings-field input:focus,
.settings-field select:focus {
  outline: none;
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.spell-word-row {
  display: grid;
  grid-template-columns: 1fr minmax(130px, auto) auto;
  align-items: end;
}
.spell-word-row label { grid-column: 1 / -1; }
.spell-dictionary-panel {
  border-top: 1px solid var(--border-hairline);
  padding-top: .8rem;
}
.spell-dictionary-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem;
}
.spell-dictionary-head span {
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.spell-word-list {
  display: flex; flex-wrap: wrap;
  gap: .35rem;
  max-height: 120px;
  overflow: auto;
  padding: .1rem 0;
}
.spell-word-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  background: var(--paper-soft);
  color: var(--text-body);
  padding: .2rem .45rem;
  font: inherit;
  font-size: .72rem;
  cursor: pointer;
  transition: background var(--d-default), color var(--d-default), border-color var(--d-default);
}
.spell-word-chip:hover {
  color: var(--fail);
  border-color: var(--fail);
  background: var(--fail-bg);
}
.spell-word-chip:disabled { opacity: .55; cursor: default; }
.spell-empty-list {
  color: var(--text-subtle);
  font-size: .76rem;
  padding: .15rem 0;
}
.settings-modal-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: .65rem;
  padding: .85rem 1.1rem;
  border-top: 1px solid var(--border-hairline);
  background: var(--paper-soft);
}
.settings-modal-footer .retention-feedback { margin-right: auto; }
@media (max-width: 640px) {
  .settings-modal-body { grid-template-columns: 1fr; }
  .spell-word-row { grid-template-columns: 1fr; }
  .settings-modal-footer { flex-wrap: wrap; }
}

/* ════════════════════════════════════════════════════════════════════
   REPORTS
   ──────────────────────────────────────────────────────────────────── */

.reports-toolbar {
  display: flex; flex-direction: column;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.reports-toolbar-row {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}
.site-picker-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.site-picker {
  appearance: none;
  -webkit-appearance: none;
  background: var(--paper);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: .45rem 2rem .45rem .75rem;
  font-family: inherit;
  font-size: .82rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236F6A82' stroke-width='1.4'%3E%3Cpolyline points='4 6 8 10 12 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .55rem center;
  background-size: 14px;
  min-width: 220px;
  max-width: 360px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .8rem;
  transition: border-color var(--d-default), background-color var(--d-default), box-shadow var(--d-default);
}
.site-picker:hover {
  border-color: var(--lavender);
  background-color: var(--paper-soft);
}
.site-picker:focus {
  border-color: var(--lavender);
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
[data-theme="dark"] .site-picker {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23A8A2BB' stroke-width='1.4'%3E%3Cpolyline points='4 6 8 10 12 6'/%3E%3C/svg%3E");
}

.site-summary {
  font-size: .78rem;
  color: var(--text-muted);
  padding: .55rem .85rem;
  background: var(--paper-soft);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
}
.site-summary-host {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text-primary);
  font-weight: 600;
}
.report-host-chip {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .68rem;
  color: var(--text-body);
  background: var(--paper-soft);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: .15rem .5rem;
  max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex-shrink: 0;
}

/* Filter pills */
.filter-pills {
  display: flex; gap: .35rem; margin-left: auto; flex-wrap: wrap;
}
.pill {
  padding: .35rem .85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--d-default), color var(--d-default), border-color var(--d-default);
}
.pill:hover {
  border-color: var(--lavender);
  color: var(--ink-deep);
  background: var(--paper-soft);
}
.pill.active {
  background: var(--lavender);
  color: var(--paper);
  border-color: var(--lavender);
}
[data-theme="dark"] .pill.active { color: #1F1632; }
.pill:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Reports list — rows, not cards */
.reports-list { display: flex; flex-direction: column; gap: .5rem; }
.report-card {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  transition: border-color var(--d-default), background var(--d-default);
}
.report-card:hover {
  border-color: var(--border-strong);
  background: var(--paper-soft);
}
.report-status-dot {
  width: 12px; height: 12px;
  flex-shrink: 0;
  border-radius: 50%;
  position: relative;
}
.report-status-dot::after {
  content: '';
  position: absolute; inset: -2px;
  border-radius: inherit;
  border: 2px solid currentColor;
  opacity: 0.18;
}
.report-status-dot.pass  { background: var(--pass); color: var(--pass); }
.report-status-dot.fail  { background: var(--fail); color: var(--fail); }
.report-info { flex: 1; min-width: 0; }
.report-id {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .8rem;
  color: var(--text-primary);
  font-weight: 500;
}
.report-time {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .15rem;
}
.report-duration {
  font-size: .76rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.report-duration.has-errors { color: var(--fail); }
.report-badge {
  display: inline-flex; align-items: center; gap: .3em;
  font-size: .68rem;
  font-weight: 600;
  padding: .2em .65em;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: .06em;
  flex-shrink: 0;
  border: 1px solid transparent;
}
.report-badge.pass { background: var(--pass-bg); color: var(--pass); border-color: rgba(45, 122, 79, .25); }
.report-badge.fail { background: var(--fail-bg); color: var(--fail); border-color: rgba(181, 59, 44, .25); }
.report-link {
  font-size: .78rem;
  color: var(--lavender);
  font-weight: 500;
}
.report-link:hover { color: var(--lavender-deep); }

/* Archived */
.report-card.archived {
  opacity: .68;
  border-style: dashed;
}
.report-archived-chip {
  font-size: .66rem;
  font-weight: 600;
  color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  border-radius: var(--radius-pill);
  padding: .15rem .55rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  flex-shrink: 0;
}
.btn-archive {
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: .78rem;
  padding: .35rem .75rem;
}
.btn-archive:hover {
  border-color: var(--warning);
  color: var(--warning);
  background: var(--warning-bg);
}

/* Retention panel (collapsible) */
.retention-panel {
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.retention-panel > summary {
  cursor: pointer;
  list-style: none;
  padding: .65rem .9rem;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.retention-panel > summary::-webkit-details-marker { display: none; }
.retention-panel > summary:hover { background: var(--paper-soft); color: var(--ink-deep); }
.retention-body {
  display: grid;
  gap: .75rem;
  padding: .85rem .9rem;
  border-top: 1px solid var(--border-hairline);
  background: var(--paper-soft);
}
.retention-row label {
  display: flex; align-items: center;
  gap: .55rem; flex-wrap: wrap;
  color: var(--text-body);
  font-size: .82rem;
}
.retention-row input {
  width: 90px;
  padding: .4rem .55rem;
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-body);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .82rem;
}
.retention-row input:focus {
  outline: none;
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.retention-hint { color: var(--text-subtle); font-size: .76rem; }
.retention-actions { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.retention-feedback { font-size: .78rem; color: var(--text-muted); }
.retention-feedback-ok { color: var(--pass); }
.retention-feedback-err { color: var(--fail); }

/* ════════════════════════════════════════════════════════════════════
   CRAWL & ANALYZE
   ──────────────────────────────────────────────────────────────────── */

.crawl-config {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex; flex-direction: column;
  gap: 1rem;
}
.crawl-url-row { display: flex; gap: .75rem; align-items: center; }
.crawl-options {
  display: flex; align-items: center;
  gap: 1.5rem; flex-wrap: wrap;
}
.crawl-options.is-auth {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border-hairline);
}
.crawl-auth-title {
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.crawl-auth-title small {
  font-size: inherit;
  font-weight: 400;
}

.option-label {
  display: flex; align-items: center;
  gap: .55rem;
  font-size: .85rem;
  color: var(--text-body);
}
.option-select {
  background: var(--paper);
  border: 1px solid var(--border-strong);
  color: var(--text-body);
  border-radius: var(--radius-md);
  padding: .35rem .65rem;
  font-family: inherit;
  font-size: .85rem;
  cursor: pointer;
  outline: none;
}
.option-select:focus {
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.generator-options {
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
  padding: 1rem 0;
  display: flex; flex-direction: column;
  gap: .75rem;
}
.generator-options-head {
  display: flex; align-items: baseline;
  gap: .55rem; flex-wrap: wrap;
}
.generator-options-head span {
  color: var(--text-primary);
  font-weight: 600;
  font-size: .92rem;
}
.generator-options-head small {
  color: var(--text-muted);
  font-size: .78rem;
}
.generator-toggles { gap: .9rem; }
.generated-plan-summary {
  display: flex; flex-direction: column;
  gap: .4rem;
  padding: .75rem .85rem;
  background: var(--paper-soft);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  margin-bottom: .75rem;
  color: var(--text-body);
  font-size: .82rem;
}
.generated-plan-summary strong { color: var(--text-primary); }
.generated-plan-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.generated-plan-chip {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--text-body);
  padding: .12rem .55rem;
  font-size: .7rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* Progress */
.crawl-progress-bar {
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
}
.crawl-progress-inner {
  display: flex; align-items: center;
  gap: .75rem;
  color: var(--text-body);
  font-size: .875rem;
  width: min(760px, 100%);
}
.crawl-cancel-btn {
  flex: 0 0 auto;
  border: 1px solid var(--border-hairline);
  background: var(--paper-soft);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  padding: .45rem .7rem;
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}
.crawl-cancel-btn:hover:not(:disabled) {
  color: var(--fail);
  border-color: var(--fail-bg);
  background: var(--fail-bg);
}
.crawl-cancel-btn:disabled {
  cursor: default;
  opacity: .6;
}
.spin-icon {
  width: 18px; height: 18px;
  color: var(--lavender);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.crawl-progress-copy { flex: 1; min-width: 0; }
.crawl-progress-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
#crawl-progress-text {
  color: var(--text-primary);
  font-weight: 600;
}
#crawl-progress-count {
  color: var(--text-muted);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.crawl-progress-detail {
  margin-top: .25rem;
  color: var(--text-muted);
  font-size: .78rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.crawl-progress-track {
  height: 4px;
  margin-top: .65rem;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--paper-deep);
}
.crawl-progress-fill {
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: var(--lavender);
  transition: width var(--d-default) var(--ease-out-quart);
}
.crawl-jobs-panel {
  margin: -0.25rem 0 1.25rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  background: var(--paper);
  overflow: hidden;
}
.crawl-jobs-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-primary);
  font-size: .82rem;
  font-weight: 700;
}
#crawl-jobs-count {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .72rem;
  font-weight: 500;
}
.crawl-jobs-list {
  display: flex; flex-direction: column;
}
.crawl-job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .8rem;
  padding: .8rem .85rem;
  border-top: 1px solid var(--border-hairline);
}
.crawl-job-row:first-child { border-top: 0; }
.crawl-job-row.is-selected {
  background: color-mix(in srgb, var(--lavender) 8%, transparent);
}
.crawl-job-main {
  min-width: 0;
  display: flex; flex-direction: column;
  gap: .42rem;
}
.crawl-job-title-row {
  display: flex; align-items: center;
  gap: .5rem;
  min-width: 0;
}
.crawl-job-title {
  min-width: 0;
  color: var(--text-primary);
  font-size: .86rem;
  font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crawl-job-meta {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: .45rem;
  color: var(--text-muted);
  font-size: .74rem;
}
.crawl-job-status {
  flex: 0 0 auto;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  padding: .1rem .45rem;
  background: var(--paper-soft);
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}
.crawl-job-status.status-running,
.crawl-job-status.status-queued {
  color: var(--lavender);
  border-color: color-mix(in srgb, var(--lavender) 35%, var(--border-hairline));
}
.crawl-job-status.status-complete {
  color: var(--pass);
  border-color: var(--pass-bg);
  background: var(--pass-bg);
}
.crawl-job-status.status-failed {
  color: var(--fail);
  border-color: var(--fail-bg);
  background: var(--fail-bg);
}
.crawl-job-status.status-cancelled {
  color: var(--text-muted);
  background: var(--paper-deep);
}
.crawl-job-detail {
  min-height: 1rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .72rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crawl-job-track {
  height: 4px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--paper-deep);
}
.crawl-job-fill {
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: var(--lavender);
  transition: width var(--d-default) var(--ease-out-quart);
}
.crawl-job-actions {
  display: flex; align-items: center;
  gap: .45rem;
}
.crawl-job-action {
  border: 1px solid var(--border-hairline);
  background: var(--paper-soft);
  color: var(--text-body);
  border-radius: var(--radius-md);
  padding: .35rem .58rem;
  font: inherit;
  font-size: .74rem;
  cursor: pointer;
}
.crawl-job-action:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.crawl-job-action.is-danger:hover:not(:disabled) {
  color: var(--fail);
  border-color: var(--fail-bg);
  background: var(--fail-bg);
}
.crawl-job-action:disabled {
  cursor: default;
  opacity: .6;
}
.progress-pct-0 { width: 0%; }
.progress-pct-5 { width: 5%; }
.progress-pct-10 { width: 10%; }
.progress-pct-15 { width: 15%; }
.progress-pct-20 { width: 20%; }
.progress-pct-25 { width: 25%; }
.progress-pct-30 { width: 30%; }
.progress-pct-35 { width: 35%; }
.progress-pct-40 { width: 40%; }
.progress-pct-45 { width: 45%; }
.progress-pct-50 { width: 50%; }
.progress-pct-55 { width: 55%; }
.progress-pct-60 { width: 60%; }
.progress-pct-65 { width: 65%; }
.progress-pct-70 { width: 70%; }
.progress-pct-75 { width: 75%; }
.progress-pct-80 { width: 80%; }
.progress-pct-85 { width: 85%; }
.progress-pct-90 { width: 90%; }
.progress-pct-95 { width: 95%; }
.progress-pct-100 { width: 100%; }

@media (max-width: 640px) {
  .crawl-job-row {
    grid-template-columns: 1fr;
  }
  .crawl-job-actions {
    justify-content: flex-start;
  }
}

/* Summary tiles — small inline, body-weight numbers (NOT hero metrics) */
.crawl-summary-row {
  display: flex; gap: .6rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.crawl-stat {
  flex: 1; min-width: 120px;
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: .7rem .9rem;
  display: flex; flex-direction: column; gap: .15rem;
}
.crawl-stat-num {
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-primary);
}
.crawl-stat-label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
/* Status-tinted variants — use color on the LABEL not the number, so the
   number itself stays calm and readable. */
.crawl-stat.c-pages    .crawl-stat-num   { color: var(--text-primary); }
.crawl-stat.c-pages    { border-color: var(--border-hairline); }
.crawl-stat.c-errors   .crawl-stat-num   { color: var(--fail); }
.crawl-stat.c-errors   { border-color: rgba(181, 59, 44, .35); }
.crawl-stat.c-warnings .crawl-stat-num   { color: var(--warning); }
.crawl-stat.c-warnings { border-color: rgba(179, 104, 16, .35); }
.crawl-stat.c-info     .crawl-stat-num   { color: var(--lavender-deep); }
.crawl-stat.c-info     { border-color: var(--border-hairline); }
.crawl-stat.c-passed   .crawl-stat-num   { color: var(--pass); }
.crawl-stat.c-passed   { border-color: rgba(45, 122, 79, .30); }

/* Page accordion */
.crawl-page-card {
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  margin-bottom: .65rem;
  overflow: hidden;
}
.crawl-page-header {
  display: flex; align-items: center; gap: .85rem;
  padding: .85rem 1.1rem;
  cursor: pointer;
  transition: background var(--d-default);
}
.crawl-page-header:hover { background: var(--paper-soft); }
.crawl-page-title {
  flex: 1;
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crawl-page-url {
  font-size: .72rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 300px;
}
.crawl-page-load {
  font-size: .72rem;
  color: var(--text-subtle);
  flex-shrink: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.crawl-chevron {
  width: 14px; height: 14px;
  color: var(--text-subtle);
  flex-shrink: 0;
  transition: transform var(--d-default) var(--ease-out-quart);
}
.crawl-page-card.open .crawl-chevron { transform: rotate(90deg); }

.crawl-page-body { display: none; border-top: 1px solid var(--border-hairline); }
.crawl-page-card.open .crawl-page-body { display: block; }
.crawl-page-body-inner {
  padding: 1rem 1.1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 700px) { .crawl-page-body-inner { grid-template-columns: 1fr; } }

.crawl-thumb {
  width: 220px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  cursor: pointer;
  flex-shrink: 0;
  display: block;
  transition: border-color var(--d-default), box-shadow var(--d-default);
}
.crawl-thumb:hover {
  border-color: var(--lavender);
  box-shadow: var(--shadow-card-hover);
}

/* ════════════════════════════════════════════════════════════════════
   ISSUES & FINDINGS
   The Loud Alarm Rule applied: severity drives type weight, color, and
   default-open behaviour. Errors, then warnings, then passes.
   ──────────────────────────────────────────────────────────────────── */

.issues-list { display: flex; flex-direction: column; gap: .5rem; }
.issue-item {
  display: flex; align-items: baseline;
  gap: .55rem;
  padding: .55rem .75rem;
  background: var(--paper-soft);
  border-radius: var(--radius-md);
  font-size: .82rem;
  border: 1px solid var(--border-hairline);
}

/* Severity pills — always paired with an icon, never color-only */
.issue-sev {
  display: inline-flex; align-items: center; gap: .25em;
  font-size: .66rem;
  font-weight: 600;
  padding: .15em .55em;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  flex-shrink: 0;
  letter-spacing: .06em;
  border: 1px solid transparent;
}
.issue-sev.error,
.issue-sev.fail {
  background: var(--fail-bg);
  color: var(--fail);
  border-color: rgba(181, 59, 44, .35);
}
.issue-sev.warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: rgba(179, 104, 16, .35);
}
.issue-sev.info {
  background: var(--paper-deep);
  color: var(--lavender-deep);
  border-color: var(--border-hairline);
}
.issue-sev.pass {
  background: var(--pass-bg);
  color: var(--pass);
  border-color: rgba(45, 122, 79, .25);
}

.issue-cat {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--paper-deep);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: .15rem .5rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  flex-shrink: 0;
}
.issue-msg { color: var(--text-body); flex: 1; }
.issue-sel {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .7rem;
  color: var(--text-muted);
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: .1rem .4rem;
}

/* Grouped findings (errors / warnings / passed by type) */
.grouped-issue {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--border-hairline);
}
.grouped-issue-head {
  display: flex; align-items: center;
  gap: .65rem;
  padding: .85rem 1rem;
  flex-wrap: wrap;
}
.grouped-issue-head .issue-msg {
  font-size: .9rem;
  color: var(--text-body);
}
/* Loud Alarm Rule: fail/warning rows lift the headline to Title weight.
   Pass rows stay Body weight so they collapse into a quiet stack. */
.grouped-issue.severity-fail .grouped-issue-head .issue-msg,
.grouped-issue.severity-error .grouped-issue-head .issue-msg {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}
.grouped-issue.severity-warning .grouped-issue-head .issue-msg {
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}
.issue-count {
  font-size: .7rem;
  font-weight: 600;
  padding: .15em .65em;
  border-radius: var(--radius-pill);
  background: var(--paper-deep);
  color: var(--text-muted);
  border: 1px solid var(--border-hairline);
  flex-shrink: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.grouped-issue-subtitle {
  padding: 0 1rem .85rem;
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.5;
  margin-top: -.25rem;
  word-break: break-word;
}

/* Affected URLs accordion */
.group-urls {
  border-top: 1px solid var(--border-hairline);
  background: var(--paper-soft);
}
.group-urls[open] { padding-bottom: .35rem; }
.group-urls summary {
  cursor: pointer;
  padding: .55rem 1rem;
  font-size: .76rem;
  color: var(--text-muted);
  list-style: none;
  user-select: none;
  display: flex; align-items: center;
  gap: .45rem;
  font-weight: 500;
}
.group-urls summary::-webkit-details-marker { display: none; }
.group-urls summary::before {
  content: '▸';
  display: inline-block;
  transition: transform var(--d-fast) var(--ease-out-quart);
  color: var(--text-subtle);
}
.group-urls[open] summary::before { transform: rotate(90deg); }
.group-urls summary:hover { color: var(--ink-deep); background: var(--paper-deep); }
.group-urls-hint {
  color: var(--text-subtle);
  font-size: .68rem;
  margin-left: auto;
}
.group-urls ul {
  list-style: none;
  margin: 0;
  padding: .25rem 1rem .5rem 2.25rem;
}
.group-url-row {
  display: flex; align-items: flex-start;
  gap: .75rem;
  padding: .45rem .5rem;
  border-radius: var(--radius-sm);
  transition: background var(--d-default);
}
.group-url-row:hover { background: var(--paper-deep); }
.url-thumb {
  width: 96px; height: 60px;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  cursor: zoom-in;
  flex-shrink: 0;
  transition: border-color var(--d-default), transform var(--d-default);
  background: var(--paper);
}
.url-thumb:hover {
  border-color: var(--lavender);
  transform: scale(1.04);
}
.url-thumb-placeholder { width: 0; }
.url-col { flex: 1; min-width: 0; }
.url-link {
  display: block;
  flex: 1; min-width: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .76rem;
  color: var(--lavender);
  text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.url-link:hover { text-decoration: underline; color: var(--lavender-deep); }
.url-variants {
  display: flex; flex-direction: column;
  gap: .15rem;
  margin-top: .25rem;
}
.url-variant {
  font-size: .72rem;
  color: var(--text-muted);
  padding-left: .5rem;
  border-left: 1px solid var(--border-hairline);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-style: italic;
}
.url-selector {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .68rem;
  color: var(--text-muted);
  background: var(--paper);
  padding: .08rem .4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  margin-right: .25rem;
}
.group-url-more {
  font-size: .72rem;
  color: var(--text-subtle);
  padding: .3rem .5rem;
  font-style: italic;
}
.findings-group { margin-bottom: 1.25rem; }

/* Result category groups (collapsible category-level grouping) */
.result-category-group {
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  margin-bottom: .65rem;
  overflow: hidden;
}
.result-category-summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  transition: background var(--d-default);
}
.result-category-summary::-webkit-details-marker { display: none; }
.result-category-summary::before {
  content: '▸';
  color: var(--text-subtle);
  flex-shrink: 0;
  transition: transform var(--d-fast);
}
.result-category-group[open] .result-category-summary::before { transform: rotate(90deg); }
.result-category-summary:hover { background: var(--paper-soft); }
.result-category-title {
  display: flex; flex-direction: column;
  gap: .15rem;
  flex: 1; min-width: 0;
}
.result-category-title span {
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -.005em;
}
.result-category-title small {
  font-size: .76rem;
  color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Triage toolbar */
.triage-toolbar {
  display: flex; align-items: center;
  gap: .75rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.triage-filter-pills { display: flex; gap: .35rem; flex-wrap: wrap; }
.triage-pill {
  padding: .35rem .85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--d-default), color var(--d-default), border-color var(--d-default);
}
.triage-pill:hover { border-color: var(--lavender); color: var(--ink-deep); }
.triage-pill.active {
  background: var(--lavender);
  color: var(--paper);
  border-color: var(--lavender);
}
[data-theme="dark"] .triage-pill.active { color: #1F1632; }
.triage-search-wrap { flex: 1; min-width: 240px; max-width: 420px; }
.triage-search {
  width: 100%;
  padding: .45rem .75rem;
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-body);
  font-family: inherit;
  font-size: .82rem;
}
.triage-search:focus {
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}
.triage-note {
  color: var(--text-muted);
  font-size: .8rem;
  margin-bottom: 1rem;
}

.no-issues {
  padding: .85rem 1rem;
  color: var(--text-muted);
  font-size: .85rem;
}

/* ════════════════════════════════════════════════════════════════════
   PREDEFINED TEST CHECKLIST
   ──────────────────────────────────────────────────────────────────── */

.test-checklist {
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.checklist-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-hairline);
  background: var(--paper);
}
.checklist-title-row {
  display: flex; align-items: center;
  gap: .75rem;
  margin-bottom: .25rem;
}
.test-set-picker { font-size: .78rem; padding: .28rem .5rem .28rem .6rem; height: auto; }
.checklist-title {
  font-weight: 600;
  font-size: .95rem;
  color: var(--text-primary);
  flex: 1;
}
.checklist-desc {
  font-size: .8rem;
  color: var(--text-muted);
}
.checklist-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0;
  padding: .35rem 0;
  background: var(--paper-soft);
  max-height: 280px;
  overflow-y: auto;
}
/* Each test row is a horizontal flex with: [label growing] [optional chips] [category]. */
.test-item-row {
  display: flex; align-items: center;
  gap: .55rem;
  padding: .5rem 1.1rem;
  cursor: default;
  transition: background var(--d-fast);
  min-width: 0;
}
.test-item-row:hover { background: var(--paper-deep); }
.test-item-label {
  display: flex; align-items: center;
  gap: .55rem;
  flex: 1; min-width: 0;
  cursor: pointer;
  margin: 0; padding: 0;
}
.test-item-label input {
  accent-color: var(--lavender);
  width: 15px; height: 15px;
  margin: 0;
  flex-shrink: 0;
}
.test-item-text {
  font-size: .85rem;
  color: var(--text-body);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Language chip on the spellcheck row (auto-detected page language). */
.test-item-lang {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .68rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  padding: .15rem .5rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color var(--d-fast), border-color var(--d-fast), background var(--d-fast);
}
.test-item-lang[data-state="loading"] { color: var(--text-subtle); border-style: dashed; }
.test-item-lang[data-state="ok"]      { color: var(--ink-deep); border-color: var(--lavender-soft); background: var(--paper-deep); }
.test-item-lang[data-state="error"]   { color: var(--fail); border-color: var(--fail); background: var(--fail-bg); }
/* Settings cog for the spellcheck row. 32px hit target, ghost style. */
.spell-settings-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: background var(--d-fast), color var(--d-fast), border-color var(--d-fast);
}
.spell-settings-btn svg { width: 15px; height: 15px; }
.spell-settings-btn:hover {
  background: var(--paper);
  color: var(--lavender-deep);
  border-color: var(--border-strong);
  text-decoration: none;
}
.spell-settings-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
/* Category chip on the right. */
.test-item-cat {
  font-size: .64rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  padding: .15rem .5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: .06em;
  flex-shrink: 0;
}

/* Predefined test results list */
.predefined-results-list {
  display: flex; flex-direction: column;
  gap: .5rem;
  margin-bottom: 1.5rem;
}
.ptest-card {
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: .85rem 1rem;
}
.ptest-header {
  display: flex; align-items: flex-start;
  gap: .75rem;
}
.ptest-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  margin-top: .15rem;
}
.ptest-icon.pass    { color: var(--pass); }
.ptest-icon.fail    { color: var(--fail); }
.ptest-icon.warning { color: var(--warning); }
.ptest-icon.skip    { color: var(--text-subtle); }
.ptest-icon.info    { color: var(--lavender-deep); }
.ptest-info { flex: 1; min-width: 0; }
.ptest-title {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-primary);
  margin-bottom: .2rem;
  display: flex; align-items: center;
  gap: .5rem;
}
.ptest-msg {
  font-size: .82rem;
  color: var(--text-body);
  line-height: 1.5;
}
.ptest-details { margin-top: .4rem; }
.ptest-details ul {
  list-style: none;
  margin-left: 0;
  padding-left: .5rem;
  border-left: 1px solid var(--border-hairline);
}
.ptest-details li {
  font-size: .78rem;
  color: var(--text-muted);
  padding: .15rem 0 .15rem .5rem;
}

/* ════════════════════════════════════════════════════════════════════
   RESULT FINDINGS (rendered by main.js#renderFinding)
   The Loud Alarm Rule: failing findings get Title-weight messages and
   open-by-default URL accordions; passing findings stay Body weight.
   ──────────────────────────────────────────────────────────────────── */

.result-finding { padding: 0; }
.result-finding-body {
  padding: .85rem 1rem .35rem;
  display: flex; flex-direction: column;
  gap: .25rem;
}
.result-finding-title {
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-body);
  word-break: break-word;
}
.result-finding.result-finding-error .result-finding-title,
.result-finding.result-finding-fail .result-finding-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}
.result-finding.result-finding-warning .result-finding-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}
.result-finding-subtitle {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  word-break: break-word;
  max-width: 75ch;
}
.result-finding-tech {
  display: flex; align-items: center;
  gap: .5rem;
  margin-top: .25rem;
  flex-wrap: wrap;
}
.result-finding-tech span {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--paper-deep);
  border: 1px solid var(--border-hairline);
  padding: .12rem .5rem;
  border-radius: var(--radius-sm);
}

/* Category counts on the result-category-summary row */
.result-category-counts {
  display: flex; align-items: center;
  gap: .35rem; flex-wrap: wrap;
  flex-shrink: 0;
}
.category-count {
  font-size: .68rem;
  font-weight: 600;
  padding: .15em .55em;
  border-radius: var(--radius-pill);
  letter-spacing: .04em;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.category-count.error,
.category-count.fail {
  background: var(--fail-bg);
  color: var(--fail);
  border-color: rgba(181, 59, 44, .35);
}
.category-count.warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: rgba(179, 104, 16, .35);
}
.category-count.pass {
  background: var(--pass-bg);
  color: var(--pass);
  border-color: rgba(45, 122, 79, .25);
}

.result-category-body {
  padding: .25rem 1rem 1rem;
  border-top: 1px solid var(--border-hairline);
  background: var(--paper-soft);
}

/* ════════════════════════════════════════════════════════════════════
   URL list extras
   ──────────────────────────────────────────────────────────────────── */

.url-assets {
  display: flex; flex-direction: column;
  gap: .2rem;
  margin-top: .35rem;
}
.url-asset {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .72rem;
  color: var(--lavender);
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.url-asset:hover { color: var(--lavender-deep); text-decoration: underline; }
.url-asset-more {
  font-size: .72rem;
  color: var(--text-subtle);
  font-style: italic;
}

.url-actions {
  display: flex; flex-wrap: wrap;
  gap: .4rem;
  margin-top: .4rem;
}

/* Inline "Add word to dictionary" button on the spellcheck per-URL row */
.spell-inline-add {
  display: inline-flex; align-items: center;
  gap: .35rem;
  padding: .2rem .55rem;
  background: var(--paper-deep);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--d-fast), color var(--d-fast), border-color var(--d-fast);
}
.spell-inline-add:hover {
  background: var(--paper);
  color: var(--lavender-deep);
  border-color: var(--lavender);
}
.spell-inline-add:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Per-occurrence cards for spellcheck findings (one per misspelling instance) */
.spell-occurrence-list {
  display: flex; flex-direction: column;
  gap: .45rem;
  margin-top: .45rem;
}
.spell-occurrence {
  display: flex; align-items: flex-start;
  gap: .65rem;
  padding: .55rem .65rem;
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
}
.spell-occurrence-thumb {
  width: 112px;
  height: 70px;
  flex-shrink: 0;
}
.spell-occurrence-copy {
  flex: 1;
  min-width: 0;
  display: flex; flex-direction: column;
  gap: .15rem;
}
.spell-occurrence-meta {
  font-size: .66rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.spell-occurrence-context {
  font-size: .8rem;
  color: var(--text-body);
  line-height: 1.5;
  word-break: break-word;
}
.spell-occurrence-detail {
  font-size: .72rem;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
}

/* Auto-link: anchors injected into rendered text by main.js#linkify. */
.auto-link {
  color: var(--lavender);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  word-break: break-all;
}
.auto-link:hover { color: var(--lavender-deep); }

/* ════════════════════════════════════════════════════════════════════
   MISC
   ──────────────────────────────────────────────────────────────────── */

button { font-family: inherit; }

input, textarea, select {
  font-family: inherit;
  color: inherit;
}

/* Ensure no decoration leaks from the user agent */
button[disabled] { cursor: not-allowed; }

/* ════════════════════════════════════════════════════════════════════
   SITES DASHBOARD
   ──────────────────────────────────────────────────────────────────── */

/* ── Header bar ── */
.sites-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-hairline);
}
.sites-bar-title {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  margin-left: auto;
}
.sites-heading {
  font-family: 'Kalnia', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--ink-deep);
  line-height: 1.2;
}
.sites-count-chip {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-subtle);
  background: var(--paper-deep);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

/* ── Sites filtering ── */
.sites-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: .65rem;
  align-items: center;
  padding: 1rem 1.5rem 0;
}
.sites-search-wrap {
  position: relative;
  min-width: 0;
}
.sites-search-wrap svg {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}
.sites-search {
  width: 100%;
  min-height: 2.35rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--text-body);
  padding: .55rem .75rem .55rem 2.15rem;
  font: inherit;
}
.sites-search:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--lavender-deep);
}
.site-filter-group {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
}
.site-filter-pill {
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  min-height: 2.05rem;
  padding: .35rem .7rem;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
  white-space: nowrap;
}
.site-filter-pill:hover {
  border-color: var(--lavender-soft);
  color: var(--ink-deep);
  background: var(--paper-soft);
}
.site-filter-pill.active {
  border-color: var(--lavender);
  background: var(--lavender);
  color: var(--paper);
}
.site-sort-wrap,
.site-more-filter-grid label {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--text-muted);
  font-size: .8rem;
  white-space: nowrap;
}
.site-sort-select {
  min-height: 2.05rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--text-body);
  padding: .35rem .55rem;
  font: inherit;
  font-size: .82rem;
}
.site-more-filters {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border-hairline);
  padding-top: .65rem;
}
.site-more-filters summary {
  width: fit-content;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 600;
  user-select: none;
}
.site-more-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem .9rem;
  padding-top: .65rem;
}
.site-preset-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  padding-top: .65rem;
}
.site-preset-name {
  min-height: 2.05rem;
  width: min(220px, 100%);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--text-body);
  padding: .35rem .55rem;
  font: inherit;
  font-size: .82rem;
}
@media (max-width: 1180px) {
  .sites-toolbar { grid-template-columns: 1fr; }
  .site-sort-wrap { justify-content: flex-start; }
}

/* ── Support triage ── */
.support-shell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  min-height: calc(100vh - 7rem);
  border-top: 1px solid var(--border-hairline);
}
.support-list-pane {
  border-right: 1px solid var(--border-hairline);
  min-width: 0;
}
.support-detail-pane {
  min-width: 0;
  background: var(--paper);
}
.support-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.25rem .75rem;
  border-bottom: 1px solid var(--border-hairline);
}
.support-title {
  font-family: 'Kalnia', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--ink-deep);
  line-height: 1.2;
}
.support-count {
  display: block;
  min-height: 1rem;
  color: var(--text-subtle);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.support-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: .55rem;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border-hairline);
}
.support-list {
  display: flex;
  flex-direction: column;
}
.support-ticket-row {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  width: 100%;
  min-height: 5.6rem;
  padding: .85rem 1.25rem;
  border: 0;
  border-bottom: 1px solid var(--border-hairline);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.support-ticket-row:hover,
.support-ticket-row.is-selected {
  background: var(--paper-soft);
}
.support-ticket-row.is-selected {
  box-shadow: inset 3px 0 0 var(--lavender);
}
.support-ticket-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .5rem;
}
.support-ticket-title {
  min-width: 0;
  color: var(--text-body);
  font-weight: 700;
  font-size: .9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-ticket-time,
.support-ticket-meta,
.support-ticket-site,
.support-muted {
  color: var(--text-muted);
  font-size: .78rem;
}
.support-ticket-meta,
.support-ticket-site {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-loading,
.support-empty,
.support-detail-empty {
  padding: 1.25rem;
  color: var(--text-muted);
  font-size: .9rem;
}
.support-detail-empty h3 {
  margin-bottom: .25rem;
  color: var(--text-body);
  font-size: 1rem;
}
.support-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid var(--border-hairline);
}
.support-detail-head h3 {
  margin-top: .45rem;
  color: var(--ink-deep);
  font-size: 1.35rem;
  line-height: 1.2;
}
.support-detail-head p {
  margin-top: .35rem;
  color: var(--text-muted);
  font-size: .85rem;
}
.support-detail-section {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-hairline);
}
.support-detail-section h4 {
  margin-bottom: .7rem;
  color: var(--text-body);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.support-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .7rem;
}
.support-section-head h4 {
  margin-bottom: 0;
}
.support-affected-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  min-width: 0;
}
.support-affected-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.support-remediation dl {
  display: grid;
  gap: .55rem;
  margin: 0;
}
.support-remediation dl > div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: .8rem;
}
.support-remediation dt {
  color: var(--text-subtle);
  font-size: .78rem;
  font-weight: 700;
}
.support-remediation dd {
  min-width: 0;
  color: var(--text-body);
  font-size: .86rem;
  overflow-wrap: anywhere;
}
.support-triage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin-bottom: .75rem;
}
.support-triage-grid > div {
  min-width: 0;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: .65rem .7rem;
  background: var(--paper-soft);
}
.support-triage-grid span {
  display: block;
  margin-bottom: .18rem;
  color: var(--text-subtle);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.support-triage-grid strong {
  display: block;
  min-width: 0;
  color: var(--text-body);
  font-size: .9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-triage-summary {
  margin-bottom: .45rem;
  color: var(--text-body);
  font-size: .92rem;
  line-height: 1.45;
}
.support-note-textarea {
  width: 100%;
  min-height: 13rem;
  resize: vertical;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--text-body);
  padding: .75rem .8rem;
  font: 500 .86rem/1.5 'JetBrains Mono', ui-monospace, monospace;
}
.support-note-textarea:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--lavender-deep);
}
.support-note-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .55rem;
  margin-top: .65rem;
}
.support-audit-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-hairline);
}
.support-audit-row {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-muted);
  font-size: .8rem;
}
.support-audit-row span {
  color: var(--text-body);
  font-weight: 700;
}
.support-articles {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.support-article {
  border-top: 1px solid var(--border-hairline);
  padding-top: .8rem;
}
.support-article:first-child {
  border-top: 0;
  padding-top: 0;
}
.support-article-meta {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .35rem;
  color: var(--text-subtle);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.support-article-body {
  color: var(--text-body);
  font-size: .9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 920px) {
  .support-shell { grid-template-columns: 1fr; }
  .support-list-pane { border-right: 0; border-bottom: 1px solid var(--border-hairline); }
}
@media (max-width: 560px) {
  .site-preset-bar { align-items: stretch; }
  .site-preset-bar .btn,
  .site-preset-bar .site-sort-wrap,
  .site-preset-name { width: 100%; }
  .support-detail-head,
  .support-affected-row { flex-direction: column; align-items: flex-start; }
  .support-triage-grid { grid-template-columns: 1fr; }
  .support-note-actions { justify-content: flex-start; }
  .support-remediation dl > div { grid-template-columns: 1fr; gap: .15rem; }
}

/* ── Grid ── */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  padding: 1.5rem;
}
@media (max-width: 960px) { .sites-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px)  { .sites-grid { grid-template-columns: 1fr; } }

/* ── Site card ── */
.site-card {
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--d-default), box-shadow var(--d-default);
  display: flex;
  flex-direction: column;
  outline: none;
}
.site-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}
.site-card:focus-visible {
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* thumbnail */
.site-card-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-soft);
  flex-shrink: 0;
}
.site-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 300ms var(--ease-out-quart);
}
.site-card:hover .site-card-thumb img { transform: scale(1.02); }

/* placeholder (no crawl yet) */
.site-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--paper-deep);
  color: var(--text-subtle);
}
/* card body */
.site-card-body {
  padding: .7rem .9rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  flex: 1;
}
.site-card-name {
  font-weight: 600;
  font-size: .82rem;
  color: var(--text-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-card-url {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: auto;
  padding-top: .3rem;
}
.site-card-date {
  font-size: .68rem;
  color: var(--text-subtle);
  white-space: nowrap;
}
.site-card-no-crawl {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.site-ticket-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .35rem;
}
.ticket-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  border-radius: var(--radius-pill);
  padding: .18rem .5rem;
  background: var(--paper-soft);
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ticket-chip.open { background: var(--paper-soft); color: var(--ink-deep); }
.ticket-chip.review { background: var(--warning-bg); color: var(--warning); }
.ticket-chip.blocked { background: var(--fail-bg); color: var(--fail); }
.ticket-chip.high { background: var(--cream); color: var(--taupe); }

/* ── Empty state ── */
.sites-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
}
.sites-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--paper-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  margin: 0 auto 1.25rem;
}
.sites-empty-heading {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: .4rem;
}
.sites-empty-body {
  font-size: .875rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 36ch;
  line-height: 1.55;
  margin: 0 auto 1.5rem;
}

/* ════════════════════════════════════════════════════════════════════
   APP DRAWER — generic reusable side panel (drawer.js)
   ──────────────────────────────────────────────────────────────────── */

.app-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
.app-drawer.open { pointer-events: all; }

.app-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 22, 50, .42);
  opacity: 0;
  transition: opacity var(--d-slow) var(--ease-out-quart);
}
.app-drawer.open .app-drawer-backdrop { opacity: 1; }

.app-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 92vw;
  background: var(--paper);
  border-left: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 240ms var(--ease-out-quart);
  overflow: hidden;
}
.app-drawer.open .app-drawer-panel { transform: translateX(0); }

.app-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1rem 1rem 1.25rem;
  border-bottom: 1px solid var(--border-hairline);
  gap: 1rem;
  background: var(--paper-soft);
  flex-shrink: 0;
}
.app-drawer-title {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
}
.app-drawer-subtitle {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .2rem;
}
.app-drawer-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--d-fast), color var(--d-fast), border-color var(--d-fast);
}
.app-drawer-close:hover { background: var(--paper-deep); color: var(--ink-deep); border-color: var(--border-hairline); }
.app-drawer-close:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.app-drawer-close svg { pointer-events: none; }

.app-drawer-body {
  flex: 1;
  overflow-y: auto;
}

.app-drawer-footer {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--border-hairline);
  background: var(--paper-soft);
  flex-shrink: 0;
}
.app-drawer-footer-feedback {
  margin-right: auto;
  font-size: .8rem;
}

/* Select inside a drawer — clean native appearance, no custom chevron conflicts */
.drawer-select {
  width: 100%;
  background: var(--paper);
  color: var(--text-body);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: .36rem .6rem;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}
.drawer-select:focus {
  outline: none;
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Add-word row inside the spell drawer */
.spell-add-row { margin-bottom: .85rem; }
.spell-add-inputs {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: .5rem;
  margin-top: .4rem;
  align-items: center;
}
.spell-scope-select { width: auto; }

/* Dark mode */
[data-theme="dark"] .app-drawer-panel  { background: var(--night-soft); border-color: var(--night-border-hairline); }
[data-theme="dark"] .app-drawer-header { background: var(--night-soft); border-color: var(--night-border-hairline); }
[data-theme="dark"] .app-drawer-footer { background: var(--night-soft); border-color: var(--night-border-hairline); }
[data-theme="dark"] .app-drawer-title  { color: var(--text-night-primary); }
[data-theme="dark"] .app-drawer-subtitle { color: var(--text-night-muted); }
[data-theme="dark"] .drawer-select { background: var(--night-card); color: var(--text-night-body); border-color: var(--night-border-strong); }

/* ════════════════════════════════════════════════════════════════════
   SITE DRAWER
   ──────────────────────────────────────────────────────────────────── */

.site-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
.site-drawer.open { pointer-events: all; }

.site-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 22, 50, .42);
  opacity: 0;
  transition: opacity var(--d-slow) var(--ease-out-quart);
}
.site-drawer.open .site-drawer-backdrop { opacity: 1; }

.site-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 92vw;
  background: var(--paper);
  border-left: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 240ms var(--ease-out-quart);
  overflow: hidden;
}
.site-drawer.open .site-drawer-panel { transform: translateX(0); }

.site-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem .9rem 1.25rem;
  border-bottom: 1px solid var(--border-hairline);
  gap: .75rem;
  background: var(--paper);
  flex-shrink: 0;
}
.site-drawer-identity {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
}
.site-drawer-favicon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--paper-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
  overflow: hidden;
}
.site-drawer-favicon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.site-drawer-url {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .78rem;
  color: var(--text-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.site-drawer-actions { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }
.site-drawer-delete { color: var(--text-subtle) !important; }
.site-drawer-delete:hover { color: var(--fail) !important; background: var(--fail-bg) !important; }

.site-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.drawer-section {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-hairline);
}
.drawer-section:last-child { border-bottom: none; }

.drawer-section-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .85rem;
}
.drawer-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.drawer-section-count {
  color: var(--text-subtle);
  font-size: .78rem;
  white-space: nowrap;
}
.drawer-section-head .drawer-section-label { margin-bottom: .85rem; }

/* history list */
.drawer-history-list { display: flex; flex-direction: column; gap: 0; }
.drawer-history-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border-hairline);
  text-decoration: none;
  color: inherit;
  transition: background var(--d-fast);
  border-radius: var(--radius-sm);
}
.drawer-history-row:last-child { border-bottom: none; }
.drawer-history-row:hover { background: var(--paper-soft); }
.drawer-history-date {
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 90px;
}
.drawer-history-meta {
  font-size: .75rem;
  color: var(--text-subtle);
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.drawer-history-chevron {
  margin-left: auto;
  color: var(--text-subtle);
  flex-shrink: 0;
}
/* History meta: semantic status colours via class, not inline style */
.hist-errors  { color: var(--fail); }
.hist-warnings { color: var(--warning); }
.drawer-no-history {
  font-size: .82rem;
  color: var(--text-muted);
  padding: .25rem 0 .5rem;
}
.drawer-ticket-list { display: flex; flex-direction: column; gap: 0; }
.drawer-ticket-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .65rem;
  align-items: center;
  min-height: 3.5rem;
  padding: .65rem 0;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
}
.drawer-ticket-row:last-child { border-bottom: none; }
.drawer-ticket-row:hover { background: var(--paper-soft); }
.drawer-ticket-main {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.drawer-ticket-title {
  color: var(--text-body);
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-ticket-meta,
.drawer-ticket-url {
  color: var(--text-muted);
  font-size: .76rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-ticket-url {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text-subtle);
}
.drawer-ticket-time {
  color: var(--text-subtle);
  font-size: .76rem;
  white-space: nowrap;
}

/* skeletons */
.drawer-skeleton { display: flex; flex-direction: column; gap: .6rem; }
.skeleton-row {
  height: 14px;
  border-radius: var(--radius-sm);
  background: var(--paper-deep);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.skeleton-row:nth-child(2) { width: 80%; animation-delay: .15s; }
.skeleton-row:nth-child(3) { width: 60%; animation-delay: .3s; }
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

/* run section */
.drawer-run-section { background: var(--paper-soft); }
.drawer-run-controls {
  display: flex;
  gap: .6rem;
  align-items: center;
}
.drawer-test-set { flex: 1; }
.drawer-start-btn { flex-shrink: 0; white-space: nowrap; }

/* ════════════════════════════════════════════════════════════════════
   ADD WEBSITE MODAL
   ──────────────────────────────────────────────────────────────────── */

.add-site-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--d-default) var(--ease-out-quart);
}
.add-site-modal.open {
  pointer-events: all;
  opacity: 1;
}
.add-site-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 22, 50, .5);
}
.add-site-dialog {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 440px;
  max-width: 92vw;
  transform: translateY(8px);
  transition: transform var(--d-default) var(--ease-out-quart);
}
.add-site-modal.open .add-site-dialog { transform: translateY(0); }

.add-site-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem .75rem;
  border-bottom: 1px solid var(--border-hairline);
}
.add-site-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}
.add-site-dialog-body {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}
.add-site-field { display: flex; flex-direction: column; gap: .35rem; }
.add-site-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
}
.add-site-optional { font-weight: 400; color: var(--text-subtle); }
.add-site-error {
  font-size: .8rem;
  color: var(--fail);
  padding: .5rem .75rem;
  background: var(--fail-bg);
  border-radius: var(--radius-sm);
}
.add-site-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  padding: .75rem 1.25rem 1.1rem;
  border-top: 1px solid var(--border-hairline);
}

/* ── Crawl history "view all" link ──────────────────────────────────── */
.drawer-history-more {
  display: block;
  width: 100%;
  padding: .5rem .75rem;
  margin-top: .25rem;
  background: none;
  border: none;
  border-top: 1px solid var(--border-hairline);
  font-size: .75rem;
  font-weight: 500;
  color: var(--accent);
  text-align: center;
  cursor: pointer;
  transition: background .12s;
}
.drawer-history-more:hover { background: var(--accent-subtle, oklch(96% .01 280)); }
[data-theme="dark"] .drawer-history-more { border-color: var(--night-border-hairline); }
[data-theme="dark"] .drawer-history-more:hover { background: oklch(22% .015 280); }

/* ── Scheduled crawls section ───────────────────────────────────────── */
.drawer-schedule-section { background: none; }
.drawer-schedule-fields { display: flex; flex-direction: column; gap: .6rem; }
.drawer-schedule-row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  align-items: center;
  gap: .6rem;
}
.drawer-field-label {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-subtle);
  white-space: nowrap;
}
.drawer-sched-select {
  font-size: .8rem;
  padding: .32rem .5rem;
  height: auto;
}
.drawer-schedule-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .25rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border-hairline);
}
.drawer-sched-next {
  font-size: .72rem;
  color: var(--text-subtle);
}

/* ── WordPress credentials section ──────────────────────────────────── */
.drawer-creds-hint {
  font-size: .75rem;
  color: var(--text-subtle);
  margin: 0 0 .75rem;
  line-height: 1.5;
}
.drawer-creds-status {
  font-size: .78rem;
  font-weight: 500;
  margin-bottom: .6rem;
}
.drawer-creds-status.saved  { color: var(--pass); }
.drawer-creds-status.empty  { color: var(--text-subtle); }
.drawer-creds-fields { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .75rem; }
.drawer-creds-input {
  font-size: .82rem;
  padding: .36rem .7rem;
  border-radius: var(--radius-md);
  height: auto;
}
.drawer-creds-footer {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border-hairline);
}
.drawer-wp-resource-lookup {
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border-hairline);
}
.drawer-wp-resource-results {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: .65rem;
}
.drawer-wp-resource-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: .55rem .65rem;
  color: var(--text-body);
  text-decoration: none;
}
.drawer-wp-resource-row:hover {
  background: var(--paper-soft);
  text-decoration: none;
}
.drawer-wp-resource-row span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: .12rem;
}
.drawer-wp-resource-row strong {
  font-size: .78rem;
  color: var(--text-body);
}
.drawer-wp-resource-row small {
  min-width: 0;
  color: var(--text-muted);
  font-size: .74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-wp-resource-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
  min-width: 0;
}
.drawer-wp-resource-actions a,
.drawer-wp-resource-actions em,
.drawer-wp-resource-empty {
  color: var(--text-subtle);
  font-size: .72rem;
  font-style: normal;
}
.drawer-wp-alt-input {
  width: 150px;
  min-height: 1.85rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--text-body);
  padding: .3rem .45rem;
  font: inherit;
  font-size: .76rem;
}
.drawer-wp-proposals {
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border-hairline);
}
.drawer-wp-proposal-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.drawer-wp-proposal-row {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: .65rem;
}
.drawer-wp-proposal-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .55rem;
}
.drawer-wp-proposal-head strong {
  min-width: 0;
  color: var(--text-body);
  font-size: .8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-wp-proposal-head span {
  color: var(--text-subtle);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.drawer-wp-preview {
  display: grid;
  gap: .35rem;
  margin: 0;
}
.drawer-wp-preview div {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: .45rem;
}
.drawer-wp-preview dt {
  color: var(--text-subtle);
  font-size: .72rem;
  font-weight: 700;
}
.drawer-wp-preview dd {
  min-width: 0;
  color: var(--text-muted);
  font-size: .76rem;
  overflow-wrap: anywhere;
}
.drawer-wp-review-note {
  margin-top: .5rem;
  color: var(--text-muted);
  font-size: .74rem;
  line-height: 1.45;
}
.drawer-wp-proposal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .6rem;
}
.drawer-dictionary-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: center;
  margin-bottom: .6rem;
}
.drawer-spell-list {
  max-height: 108px;
  min-height: 34px;
  padding-top: .15rem;
}

/* ════════════════════════════════════════════════════════════════════
   DARK THEME — SITES DASHBOARD
   ──────────────────────────────────────────────────────────────────── */

[data-theme="dark"] .sites-heading { color: var(--text-night-primary); }
[data-theme="dark"] .sites-count-chip { background: var(--night-card); border-color: var(--night-border-hairline); color: var(--text-night-subtle); }
[data-theme="dark"] .sites-toolbar { border-color: var(--night-border-hairline); }
[data-theme="dark"] .sites-search,
[data-theme="dark"] .site-sort-select,
[data-theme="dark"] .site-preset-name {
  background: var(--night-card);
  color: var(--text-night-body);
  border-color: var(--night-border-strong);
}
[data-theme="dark"] .site-filter-pill {
  border-color: var(--night-border-hairline);
  color: var(--text-night-muted);
}
[data-theme="dark"] .site-filter-pill:hover {
  background: var(--night-card);
  color: var(--text-night-primary);
}
[data-theme="dark"] .site-filter-pill.active {
  background: var(--lavender-night);
  border-color: var(--lavender-night);
  color: var(--night);
}
[data-theme="dark"] .site-more-filters { border-color: var(--night-border-hairline); }
[data-theme="dark"] .site-more-filters summary,
[data-theme="dark"] .site-sort-wrap,
[data-theme="dark"] .site-more-filter-grid label { color: var(--text-night-muted); }
[data-theme="dark"] .site-card { background: var(--night-card); border-color: var(--night-border-hairline); }
[data-theme="dark"] .site-card:hover { border-color: var(--night-border-strong); }
[data-theme="dark"] .site-card-thumb,
[data-theme="dark"] .site-card-placeholder { background: var(--night-soft); }
[data-theme="dark"] .site-card-name { color: var(--text-night-body); }
[data-theme="dark"] .site-card-url { color: var(--text-night-muted); }
[data-theme="dark"] .site-card-date,
[data-theme="dark"] .site-card-no-crawl { color: var(--text-night-subtle); }
[data-theme="dark"] .ticket-chip.open { background: var(--night-soft); color: var(--lavender-night); }
[data-theme="dark"] .ticket-chip.review { background: oklch(26% .06 70); color: var(--warning); }
[data-theme="dark"] .ticket-chip.blocked { background: oklch(24% .07 28); color: var(--fail); }
[data-theme="dark"] .ticket-chip.high { background: oklch(26% .055 70); color: var(--cream-night); }
[data-theme="dark"] .sites-empty-icon { background: var(--night-card); }
[data-theme="dark"] .sites-empty-heading { color: var(--text-night-primary); }
[data-theme="dark"] .sites-empty-body { color: var(--text-night-muted); }
[data-theme="dark"] .site-drawer-panel { background: var(--night-soft); border-color: var(--night-border-hairline); }
[data-theme="dark"] .site-drawer-header { background: var(--night-soft); border-color: var(--night-border-hairline); }
[data-theme="dark"] .site-drawer-url { color: var(--text-night-body); }
[data-theme="dark"] .site-drawer-favicon { background: var(--night-card); }
[data-theme="dark"] .drawer-section { border-color: var(--night-border-hairline); }
[data-theme="dark"] .drawer-section-label { color: var(--text-night-muted); }
[data-theme="dark"] .drawer-history-row { border-color: var(--night-border-hairline); }
[data-theme="dark"] .drawer-history-row:hover { background: var(--night-card); }
[data-theme="dark"] .drawer-ticket-row { border-color: var(--night-border-hairline); }
[data-theme="dark"] .drawer-ticket-row:hover { background: var(--night-card); }
[data-theme="dark"] .drawer-ticket-title { color: var(--text-night-body); }
[data-theme="dark"] .drawer-ticket-meta { color: var(--text-night-muted); }
[data-theme="dark"] .drawer-ticket-url,
[data-theme="dark"] .drawer-ticket-time,
[data-theme="dark"] .drawer-section-count { color: var(--text-night-subtle); }
[data-theme="dark"] .drawer-history-date { color: var(--text-night-muted); }
[data-theme="dark"] .drawer-history-meta { color: var(--text-night-subtle); }
[data-theme="dark"] .drawer-no-history { color: var(--text-night-muted); }
[data-theme="dark"] .skeleton-row { background: var(--night-card); }
[data-theme="dark"] .drawer-run-section { background: var(--night); }
[data-theme="dark"] .add-site-dialog { background: var(--night-soft); border-color: var(--night-border-hairline); }

[data-theme="dark"] .support-shell,
[data-theme="dark"] .support-list-pane,
[data-theme="dark"] .support-header,
[data-theme="dark"] .support-filters,
[data-theme="dark"] .support-ticket-row,
[data-theme="dark"] .support-detail-head,
[data-theme="dark"] .support-detail-section,
[data-theme="dark"] .support-article,
[data-theme="dark"] .support-triage-grid > div,
[data-theme="dark"] .support-note-textarea,
[data-theme="dark"] .support-audit-list,
[data-theme="dark"] .support-audit-row {
  border-color: var(--night-border-hairline);
}
[data-theme="dark"] .support-detail-pane { background: var(--night-soft); }
[data-theme="dark"] .support-triage-grid > div,
[data-theme="dark"] .support-note-textarea { background: var(--night-card); }
[data-theme="dark"] .support-title,
[data-theme="dark"] .support-detail-head h3 { color: var(--text-night-primary); }
[data-theme="dark"] .support-ticket-title,
[data-theme="dark"] .support-detail-section h4,
[data-theme="dark"] .support-remediation dd,
[data-theme="dark"] .support-article-body,
[data-theme="dark"] .support-detail-empty h3,
[data-theme="dark"] .support-triage-grid strong,
[data-theme="dark"] .support-triage-summary,
[data-theme="dark"] .support-note-textarea,
[data-theme="dark"] .support-audit-row span { color: var(--text-night-body); }
[data-theme="dark"] .support-ticket-row:hover,
[data-theme="dark"] .support-ticket-row.is-selected { background: var(--night-card); }
[data-theme="dark"] .support-count,
[data-theme="dark"] .support-ticket-time,
[data-theme="dark"] .support-ticket-meta,
[data-theme="dark"] .support-ticket-site,
[data-theme="dark"] .support-muted,
[data-theme="dark"] .support-loading,
[data-theme="dark"] .support-empty,
[data-theme="dark"] .support-detail-empty,
[data-theme="dark"] .support-detail-head p { color: var(--text-night-muted); }
[data-theme="dark"] .support-remediation dt,
[data-theme="dark"] .support-article-meta,
[data-theme="dark"] .support-triage-grid span { color: var(--text-night-subtle); }
[data-theme="dark"] .add-site-dialog-header,
[data-theme="dark"] .add-site-dialog-footer { border-color: var(--night-border-hairline); }
[data-theme="dark"] .add-site-title { color: var(--text-night-primary); }
[data-theme="dark"] .add-site-label { color: var(--text-night-muted); }
[data-theme="dark"] .sites-bar { border-color: var(--night-border-hairline); }
[data-theme="dark"] .drawer-field-label { color: var(--text-night-subtle); }
[data-theme="dark"] .drawer-schedule-footer,
[data-theme="dark"] .drawer-creds-footer { border-color: var(--night-border-hairline); }
[data-theme="dark"] .drawer-sched-next { color: var(--text-night-subtle); }
[data-theme="dark"] .drawer-creds-hint { color: var(--text-night-subtle); }
[data-theme="dark"] .drawer-wp-resource-lookup,
[data-theme="dark"] .drawer-wp-proposals,
[data-theme="dark"] .drawer-wp-proposal-row,
[data-theme="dark"] .drawer-wp-resource-row { border-color: var(--night-border-hairline); }
[data-theme="dark"] .drawer-wp-resource-row:hover { background: var(--night-card); }
[data-theme="dark"] .drawer-wp-resource-row,
[data-theme="dark"] .drawer-wp-resource-row strong,
[data-theme="dark"] .drawer-wp-proposal-head strong { color: var(--text-night-body); }
[data-theme="dark"] .drawer-wp-resource-row small,
[data-theme="dark"] .drawer-wp-preview dd,
[data-theme="dark"] .drawer-wp-review-note { color: var(--text-night-muted); }
[data-theme="dark"] .drawer-wp-resource-actions a,
[data-theme="dark"] .drawer-wp-proposal-head span,
[data-theme="dark"] .drawer-wp-preview dt,
[data-theme="dark"] .drawer-wp-resource-empty { color: var(--text-night-subtle); }
[data-theme="dark"] .drawer-wp-alt-input {
  background: var(--night-card);
  color: var(--text-night-body);
  border-color: var(--night-border-hairline);
}


/* ── Header page label (settings / other sub-pages) ─────────────────────── */
.header-page-label {
  flex: 1;
  text-align: center;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
  pointer-events: none;
  user-select: none;
}

/* Make header-brand work as a link without visual noise */
a.header-brand {
  text-decoration: none;
  transition: opacity var(--d-fast) var(--ease-out-quart);
}
a.header-brand:hover { opacity: .8; text-decoration: none; }
a.header-brand .brand-name,
a.header-brand .brand-sub { color: inherit; }

/* ── User badge & dropdown ───────────────────────────────────────────────── */
.user-menu { position: relative; }

.user-badge {
  display: flex; align-items: center; gap: .4rem;
  padding: .3rem .6rem .3rem .35rem;
  background: transparent;
  border: 1.5px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text-body);
  transition: background var(--d-fast) var(--ease-out-quart),
              border-color var(--d-fast) var(--ease-out-quart);
  white-space: nowrap;
}
.user-badge:hover { background: var(--paper-soft); border-color: var(--lavender); }
.user-badge:focus-visible { outline: 2px solid var(--lavender-soft); outline-offset: 2px; }

.user-avatar {
  width: 22px; height: 22px;
  background: var(--lavender);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .625rem; font-weight: 700; color: var(--paper);
  flex-shrink: 0;
  user-select: none;
}

.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
  min-width: 200px;
  z-index: 200;
  overflow: hidden;
}

.user-dropdown-info {
  padding: .75rem 1rem;
  display: flex; flex-direction: column; gap: .25rem;
}
.user-dropdown-info span:first-child {
  font-size: .8125rem; color: var(--text-muted); word-break: break-all;
}

.user-role-badge {
  display: inline-flex; align-items: center;
  padding: .1rem .45rem;
  border-radius: var(--radius-pill);
  font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: color-mix(in srgb, var(--lavender) 14%, transparent);
  color: var(--lavender-deep);
  width: fit-content;
}
[data-theme="dark"] .user-role-badge { color: var(--lavender); }

.user-dropdown-divider { border: none; border-top: 1px solid var(--border-hairline); margin: 0; }

.user-dropdown-item {
  display: flex; align-items: center; gap: .5rem;
  width: 100%; padding: .625rem 1rem;
  background: transparent; border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: .875rem; color: var(--text-body);
  cursor: pointer; text-align: left;
  text-decoration: none;
  transition: background var(--d-fast) var(--ease-out-quart);
}
.user-dropdown-item:hover { background: var(--paper-soft); color: var(--text-body); text-decoration: none; }
.user-dropdown-item svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Global toast notifications ─────────────────────────────────────────── */
.toast-region {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  pointer-events: none;
}

.toast {
  padding: .5625rem 1rem;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  color: var(--paper);
  box-shadow: var(--shadow-popover);
  pointer-events: auto;
  max-width: min(32rem, calc(100vw - 2rem));
  white-space: normal;
  animation: toast-in .2s var(--ease-out-expo);
}
.toast.neutral { background: var(--ink-deep); }
.toast.success { background: var(--pass); }
.toast.error { background: var(--fail); }
.toast.is-leaving {
  opacity: 0;
  transition: opacity .25s;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Cookie-compliance panel (consent) ──────────────────────────────────
   The panel sits inside an existing finding card. No box-in-box: it adds
   a hairline rule to the top of the finding body and uses rhythmic
   spacing between sections, not card wrappers, to carry hierarchy.
   Order, by what a QA tester needs first: verdict pills, recommended
   actions, diagnostic record, per-region checklist. The Loud Alarm Rule
   gets the failing actions Title-weight and status colour up top; the
   record below stays composed.
*/
.consent-panel {
  /* Sits as a sibling of .result-finding-body inside .grouped-issue (padding 0).
     Apply the same 1rem horizontal inset the head and body use, plus a top
     hairline rule that visually separates the panel from the title/tech-bits
     above it. */
  margin: 0;
  padding: 1.5rem 1rem 1.25rem;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-body);
}

/* Verdict strip ── per-region pills, glance-test answer */
.consent-verdict {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.consent-region-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.25rem 0.625rem 0.25rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--paper-soft);
  color: var(--text-muted);
  font-size: 0.75rem;
}
.consent-region-pill-icon { font-weight: 700; line-height: 1; }
.consent-region-pill-label { font-weight: 600; color: var(--ink-deep); }
.consent-region-pill-status {
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.consent-region-pill-pass { background: var(--pass-bg); color: var(--pass); }
.consent-region-pill-pass .consent-region-pill-label { color: var(--pass); }
.consent-region-pill-warning { background: var(--warning-bg); color: var(--warning); }
.consent-region-pill-warning .consent-region-pill-label { color: var(--warning); }
.consent-region-pill-fail { background: var(--fail-bg); color: var(--fail); }
.consent-region-pill-fail .consent-region-pill-label { color: var(--fail); }
.consent-region-pill-skip,
.consent-region-pill-info {
  border-color: var(--border-hairline);
}

/* Section scaffolding */
.consent-section {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.consent-eyebrow {
  margin: 0;
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Recommended actions ── prominent, severity-led, Title-weight summary */
.consent-section-actions { gap: 0.75rem; }
.consent-actions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.consent-action {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  column-gap: 0.875rem;
  padding-block: 0.875rem;
  border-bottom: 1px solid var(--border-hairline);
}
.consent-action:last-child { border-bottom: 0; }
.consent-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  margin-top: 0.125rem;
  background: var(--paper-soft);
  color: var(--text-muted);
}
.consent-action-fail .consent-action-icon { background: var(--fail-bg); color: var(--fail); }
.consent-action-warning .consent-action-icon { background: var(--warning-bg); color: var(--warning); }
.consent-action-pass .consent-action-icon,
.consent-action-icon-pass { background: var(--pass-bg); color: var(--pass); }
.consent-action-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.consent-action-summary {
  margin: 0;
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-deep);
}
.consent-action-fail .consent-action-summary { color: var(--fail); }
.consent-action-warning .consent-action-summary { color: var(--warning); }
.consent-action-fix {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-body);
  max-width: 75ch;
}
.consent-no-actions {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--pass);
  font-size: 0.875rem;
}

/* Diagnostic record ── two-column key/value, hairline-divided */
.consent-record {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(9rem, 11rem) 1fr;
  column-gap: 1.75rem;
}
.consent-record-row { display: contents; }
.consent-record-row > .consent-record-key,
.consent-record-row > .consent-record-value {
  border-top: 1px solid var(--border-hairline);
  padding-block: 1rem;
}
.consent-record-row:first-child > .consent-record-key,
.consent-record-row:first-child > .consent-record-value {
  border-top: 0;
  padding-top: 0.25rem;
}
.consent-record-key {
  margin: 0;
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  align-self: start;
  /* Optical nudge: the cap-height of an 11px uppercase eyebrow sits higher
     than the x-height of the 14px body it labels. The extra top inset
     visually aligns the eyebrow with the first line of the value. */
  padding-top: calc(1rem + 0.1875rem);
}
.consent-record-row:first-child > .consent-record-key {
  padding-top: calc(0.25rem + 0.1875rem);
}
.consent-record-value {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-body);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}
.consent-record-lead {
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-weight: 600;
  color: var(--ink-deep);
}
.consent-record-foot {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.consent-record-key-inline {
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 0.375rem;
}
.consent-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.8125rem;
  background: var(--paper-soft);
  padding: 0.0625rem 0.375rem;
  border-radius: var(--radius-sm);
  color: var(--text-body);
}
.consent-link { color: var(--link); text-decoration: none; }
.consent-link:hover { color: var(--link-hover); text-decoration: underline; }
.consent-meta { color: var(--text-muted); font-size: 0.8125rem; }
.consent-yes { color: var(--pass); font-weight: 600; }
.consent-warn { color: var(--warning); font-weight: 600; }
.consent-no { color: var(--fail); font-weight: 600; }
.consent-inline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Region scorecards ── no card wrapper, hairline-only (per DESIGN.md) */
.consent-scorecards {
  display: flex;
  flex-direction: column;
}
.consent-scorecard {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-block: 1rem;
  border-top: 1px solid var(--border-hairline);
}
.consent-scorecards .consent-scorecard:last-of-type {
  border-bottom: 1px solid var(--border-hairline);
}
.consent-scorecard-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.consent-scorecard-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}
.consent-scorecard-icon-pass    { color: var(--pass); }
.consent-scorecard-icon-warning { color: var(--warning); }
.consent-scorecard-icon-fail    { color: var(--fail); }
.consent-scorecard-icon-skip    { color: var(--text-subtle); }
.consent-scorecard-icon-info    { color: var(--lavender); }
.consent-scorecard-label {
  margin: 0;
  flex: 1;
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-deep);
}
.consent-scorecard-fail .consent-scorecard-label    { color: var(--fail); }
.consent-scorecard-warning .consent-scorecard-label { color: var(--warning); }

.consent-counts {
  display: inline-flex;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.75rem;
}
.consent-counts-pass { color: var(--pass); }
.consent-counts-warn { color: var(--warning); }
.consent-counts-fail { color: var(--fail); }
.consent-counts-skip { color: var(--text-subtle); }

.consent-scorecard-items {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.875rem;
  display: flex;
  flex-direction: column;
}
.consent-scorecard-item {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  column-gap: 0.5rem;
  padding-block: 0.375rem;
  align-items: baseline;
}
.consent-scorecard-item .consent-scorecard-icon {
  width: 1rem;
  height: 1rem;
  font-size: 0.8125rem;
}
.consent-scorecard-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}
.consent-scorecard-text-label {
  font-size: 0.875rem;
  color: var(--text-body);
}
.consent-scorecard-item-fail .consent-scorecard-text-label,
.consent-scorecard-item-warning .consent-scorecard-text-label {
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-weight: 600;
}
.consent-scorecard-item-fail .consent-scorecard-text-label    { color: var(--fail); }
.consent-scorecard-item-warning .consent-scorecard-text-label { color: var(--warning); }
.consent-scorecard-text-detail {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Hidden regions ── computed, not counted toward verdict */
.consent-hidden-regions {
  margin-top: 0.875rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-hairline);
  opacity: 0.8;
}
.consent-hidden-regions summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  user-select: none;
}
.consent-hidden-regions summary::-webkit-details-marker { display: none; }
.consent-hidden-regions summary::before {
  content: '›';
  display: inline-block;
  color: var(--text-subtle);
  transition: transform var(--d-fast) var(--ease-out-quart);
}
.consent-hidden-regions[open] summary::before { transform: rotate(90deg); }
.consent-hidden-list {
  list-style: none;
  margin: 0.625rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.consent-hidden-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

/* Narrow viewport ── stack key above value with hairline above the key */
@media (max-width: 36rem) {
  .consent-record {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
  .consent-record-row > .consent-record-value {
    border-top: 0;
    padding-top: 0.125rem;
  }
  .consent-record-row > .consent-record-key {
    padding-top: 0.625rem;
    padding-bottom: 0.125rem;
  }
  .consent-record-row:first-child > .consent-record-key { padding-top: 0; }
}
