/* ==========================================================================
   qurmy-shell.css — Phase 1 of the design unification (The Signal)
   Loads AFTER every section stylesheet and AFTER qurmy-tokens.css.

   What it does, in order:
     1. Sidebar: the tonal fade, the spine through the icon nodes, the active
        node with its pulse, drifting colour, serif wordmark. CSS only; the
        existing markup in site.html is untouched.
     2. Top header: transparent on the canvas.
     3. Page header contract: .q-page-header (injected by qurmy-page-header.js)
        and the two sections that already own a head (Overview, Competition)
        restyled to the same contract.
     4. Typography normalisation across tabs: every "page title" class the
        audit found gets the same treatment; section/card titles the same.
     5. Component harmonisation: stat tiles, in-page tabs, chips, buttons.
   Nothing here uses a hex that is not a --q-* token.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Canvas and base type
   -------------------------------------------------------------------------- */
body { margin: 0; }
body,
.sr-main-content,
.sr-page-content {
  background: var(--q-canvas);
  font-family: var(--q-font-body);
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   1. Sidebar — The Signal nav
   -------------------------------------------------------------------------- */
.sr-sidebar {
  width: var(--q-sidebar);
  background: var(--q-nav-bg);
  border-right: 1px solid rgba(5,150,105,.12);
  overflow: hidden;
  isolation: isolate;
}
.sr-sidebar > * { position: relative; z-index: 1; }

/* wordmark */
.sr-sidebar-logo { padding: 18px 20px 14px; border-bottom: none; }
.sr-sidebar-logo img { height: 26px; }
.sr-sidebar-logo span {
  font-family: var(--q-font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -.01em;
  color: var(--q-ink);
}

/* site switcher as a white card */
.sr-site-switcher { padding: 4px 14px 10px; border-bottom: none; }
.sr-site-switcher-btn {
  width: 100%;
  background: var(--q-card);
  border: 1px solid var(--q-border);
  border-radius: var(--q-radius-md);
  box-shadow: var(--q-shadow-card);
  padding: 10px 12px;
}
.sr-site-switcher-icon,
.sr-site-switcher-btn > div:first-child {
  border-radius: 9px;
  background: #e8f5ee;
  color: #065f46;
}
/* real favicons sit without a tile */
.sr-site-switcher-icon:has(img), .sr-site-switcher-btn > div:first-child:has(img) { background: transparent; }
.sr-site-switcher-url { font-family: var(--q-font-mono); font-size: 12px; color: var(--q-text-muted); }

/* the nav list: the spine runs down the icon column */
.sr-sidebar-nav {
  position: relative;
  padding: 6px 14px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.sr-sidebar-nav::-webkit-scrollbar { display: none; }
.sr-sidebar-nav::before {
  content: "";
  position: absolute;
  left: 37px;                       /* 14 pad + 10 item pad + 14 half-node - 1 */
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: rgba(5,150,105,.25);
  pointer-events: none;
}
.sr-nav-section { margin-bottom: 4px; }

/* group labels sit on the line as small stations */
.sr-nav-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 4px 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--q-text-subtle);
  position: relative;
}
.sr-nav-section-title::before {
  content: "";
  width: 28px;
  height: 6px;
  flex: 0 0 28px;
  background: radial-gradient(circle, rgba(5,150,105,.55) 3px, transparent 3.5px) center / 28px 6px no-repeat;
}

/* items: the icon is the node */
.sr-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 5px 12px 5px 10px;
  margin-bottom: 1px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .005em;
  color: var(--q-grey-600);
  transition: color var(--q-dur) var(--q-ease), background var(--q-dur) var(--q-ease);
}
.sr-nav-item svg {
  width: 28px;
  height: 28px;
  padding: 7px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--q-card);
  border: 1px solid var(--q-border-strong);
  color: var(--q-grey-600);
  flex: 0 0 28px;
  position: relative;
  z-index: 1;
  transition: all var(--q-dur) var(--q-ease);
}
.sr-nav-item:hover { background: rgba(255,255,255,.55); color: var(--q-ink); }
.sr-nav-item:hover svg { border-color: var(--q-brand); color: var(--q-brand); }
.sr-nav-item.active {
  background: linear-gradient(90deg, rgba(5,150,105,.10), rgba(5,150,105,0) 75%);
  color: var(--q-ink);
  font-weight: 500;
}
.sr-nav-item.active svg {
  background: var(--q-brand);
  border-color: var(--q-brand);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(5,150,105,.18);
}
/* badges some items carry */
.sr-nav-item .sr-nav-badge,
.sr-nav-badge {
  margin-left: auto;
  font-family: var(--q-font-mono);
  font-size: 11px;
  font-weight: 500;
  background: var(--q-grey-100);
  color: var(--q-grey-600);
  border-radius: var(--q-radius-pill);
  padding: 1px 7px;
}
/* Quick Links group retired: All sites is in the breadcrumb and the switcher */
.sr-sidebar-nav .sr-nav-section:last-child:has(.sr-nav-item[href="/dash"]) { display: none; }

/* user block */
.sr-sidebar-footer { padding: 10px 14px 14px; border-top: 1px solid var(--q-border); }
.sr-user-menu { padding: 8px 6px; border-radius: 12px; }
.sr-user-avatar {
  width: 34px; height: 34px;
  background: var(--q-card);
  border: 2px solid var(--q-brand);
  color: var(--q-ink);
}
.sr-user-name { font-size: 14px; font-weight: 500; color: var(--q-ink); }
.sr-user-plan {
  font-family: var(--q-font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--q-brand);
}
.sr-logout-link { color: var(--q-text-muted); padding: 8px 6px; }

/* --------------------------------------------------------------------------
   2. Top header: transparent on the canvas
   -------------------------------------------------------------------------- */
.sr-top-header {
  background: transparent;
  border-bottom: 1px solid var(--q-border);
  padding: 0 32px;
  backdrop-filter: blur(8px);
}
.sr-breadcrumb { font-size: 13px; color: var(--q-text-muted); }
.sr-breadcrumb a { color: var(--q-text-muted); }
.sr-breadcrumb-current { color: var(--q-ink); font-weight: 500; }
.sr-page-content { padding: 32px 32px 64px; }

/* --------------------------------------------------------------------------
   3. Page header contract
   Injected block (.q-page-header) and the two native heads (.ov-head, .cp-head)
   share one look: eyebrow → serif finding → context → chips, action on the right.
   -------------------------------------------------------------------------- */
.q-page-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 24px;
}
.q-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-size: var(--q-fs-eyebrow);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--q-brand);
  background: var(--q-brand-faint);
  border: 1px solid rgba(5,150,105,.2);
  border-radius: var(--q-radius-pill);
  padding: 5px 12px;
}
.q-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--q-brand); }

.q-finding,
.ov-title,
.cp-title,
.cdb-title,
.cga-page-title,
.sr-content-header h1 {
  margin: 0;
  font-family: var(--q-font-display) !important;
  font-weight: 400 !important;
  font-size: var(--q-fs-display) !important;
  line-height: var(--q-lh-display) !important;
  letter-spacing: var(--q-track-tight) !important;
  color: var(--q-ink) !important;
  max-width: 760px;
}
.q-finding em,
.ov-title em,
.cp-title em { font-style: italic; color: var(--q-brand); }

.q-context,
.ov-subline,
.cp-subline {
  margin: 0;
  font-size: var(--q-fs-body);
  color: var(--q-text-muted);
}
.q-page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.q-page-header-left { display: flex; flex-direction: column; gap: 12px; }
.q-page-header-actions { display: flex; gap: 8px; }

/* native heads adopt the contract spacing */
.ov-head, .cp-head { margin-bottom: 24px; }

/* --------------------------------------------------------------------------
   4. Typography normalisation across tabs
   -------------------------------------------------------------------------- */
/* in-page section titles → h2 scale */
.ov-rail-title, .cp-report-title, .aip-section-title, .si-brain-header h3,
.sr-kr-serp-header h3, .cga-drawer-title,
.sr-seo-panel-title h3, .all-changes-title-text {
  font-family: var(--q-font-body) !important;
  font-size: var(--q-fs-h2) !important;
  line-height: var(--q-lh-h2) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  color: var(--q-ink) !important;
}
/* card titles → h3 scale */
.ov-panel-title, .cp-panel-title, .aeo-score-title, .aeo-intel-title, .aeo-card-title,
.cd-lens-title, .cd-h2h-title, .cdb-lb-title, .aip-detail-strip-title,
.cga-modal-title, .sr-card-header h3, .sr-content-card-title,
.content-section-header h3, .modal-header h3, .sr-modal-header h2, .sr-modal-title,
.sr-pi-categories-header h3, .sr-pi-brain-header h3, .sr-page-analysis .sr-card-header h3,
.sr-kd-section-title, .si-so-section-title, .sr-run-summary-title {
  font-family: var(--q-font-body) !important;
  font-size: var(--q-fs-h3) !important;
  line-height: var(--q-lh-h3) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  color: var(--q-ink) !important;
}
/* eyebrow / small caps labels → one treatment */
.ov-wins-title, .ov-hero-eyebrow, .cm-kw-table-title, .cga-drawer-section-title,
.sr-cap-section-title .title, .sr-expansion-section-title, .si-perf-slow-title,
.sr-source-title, .cp-filter-label, .cd-column-title, .sr-kd-danger-zone .sr-kd-section-title,
.aip-finding-title {
  font-size: var(--q-fs-eyebrow) !important;
  font-weight: 600 !important;
  letter-spacing: var(--q-track-eyebrow) !important;
  text-transform: uppercase !important;
  color: var(--q-text-muted) !important;
}
/* no 700/800 sans anywhere in the app: the serif carries emphasis */
.sr-section [style*="font-weight: 700"],
.sr-section [style*="font-weight:700"] { font-weight: 600 !important; }
.sr-section h1:not(.q-finding):not(.ov-title):not(.cp-title),
.sr-section h2, .sr-section h3, .sr-section h4,
.sr-section strong, .sr-section b, .sr-section th { font-weight: 600; }

/* headline numbers → serif */
.ov-ring-score, .cp-stat-value, .ov-stat-value, .cga-stat-value, .ct-stat-value,
.cm-stat-value, .aip-stat-value, .sr-kpi-value, .sr-stat-value, .cd-stat-value,
.disc-stat-value, .sr-pi-score-value {
  font-family: var(--q-font-display) !important;
  font-weight: 400 !important;
  letter-spacing: -.01em;
  color: var(--q-ink);
}

/* --------------------------------------------------------------------------
   5. Component harmonisation (CSS overrides on existing classes)
   -------------------------------------------------------------------------- */
/* cards: one radius, one border, no resting shadow */
.sr-content-card, .ov-panel, .cp-panel, .ov-hero-panel, .cga-card, .cd-card, .aeo-card,
.aip-card, .cm-card, .ct-card, .sr-card, .si-card, .sr-pi-card, .disc-card, .sr-kr-card {
  border-radius: var(--q-radius-md) !important;
  border: 1px solid var(--q-border) !important;
  box-shadow: none !important;
  background: var(--q-card);
}
/* stat tiles: remove coloured top borders */
.cm-stat, .ct-stat, .cga-stat, .disc-stat, .sr-stat-card, .aip-stat {
  border-top: 1px solid var(--q-border) !important;
  border-radius: var(--q-radius-md) !important;
}
.cm-stat-label, .ct-stat-label, .cga-stat-label, .disc-stat-label, .sr-stat-label, .aip-stat-label {
  font-size: var(--q-fs-caption) !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--q-text-muted) !important;
}

/* in-page tabs: one system in qurmy-tabs.css (9 Nov 2026) */

/* primary buttons: pill, brand, 600 */
.sr-btn-primary, .ov-btn-primary, .cp-btn.is-primary, .cga-btn-primary, .sr-pi-btn-primary,
.aip-btn-primary, .cd-btn-primary, .sr-btn.sr-btn-primary, .sr-kr-btn-primary, .btn-primary {
  border-radius: var(--q-radius-pill) !important;
  background: var(--q-brand) !important;
  border-color: var(--q-brand) !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: var(--q-fs-body) !important;
  box-shadow: var(--q-shadow-brand) !important;
  transition: transform var(--q-dur) var(--q-ease), background var(--q-dur) var(--q-ease);
}
.sr-btn-primary:hover, .ov-btn-primary:hover, .cp-btn.is-primary:hover, .cga-btn-primary:hover,
.btn-primary:hover { background: var(--q-brand-deep) !important; transform: translateY(-1px); }
/* secondary buttons: pill, white */
.sr-btn-secondary, .cp-btn:not(.is-primary), .cga-btn-secondary, .sr-btn.sr-btn-secondary, .btn-secondary {
  border-radius: var(--q-radius-pill) !important;
  background: var(--q-card) !important;
  border: 1px solid var(--q-border) !important;
  color: var(--q-ink) !important;
  font-weight: 500 !important;
}

/* status / priority chips */
.sr-badge, .cp-chip, .cga-pill, .ov-chip, .sr-status-badge, .aip-chip, .cd-pill, .sr-pill {
  border-radius: var(--q-radius-pill) !important;
  font-size: var(--q-fs-caption) !important;
  font-weight: 500 !important;
}
.sr-badge.priority-high, .ov-priority.is-high, .cga-priority.is-high, .cga-pill.is-high {
  background: var(--q-danger-bg) !important; color: var(--q-danger-text) !important;
  font-size: var(--q-fs-eyebrow) !important; font-weight: 600 !important; letter-spacing: .04em;
}
.sr-badge.priority-medium, .ov-priority.is-medium, .cga-priority.is-medium, .cga-pill.is-medium {
  background: var(--q-warn-bg) !important; color: var(--q-warn-text) !important;
  font-size: var(--q-fs-eyebrow) !important; font-weight: 600 !important; letter-spacing: .04em;
}
.sr-badge.success, .sr-status-online, .ov-chip.is-ok, .sr-badge.is-ok {
  background: var(--q-ok-bg) !important; color: var(--q-ok-text) !important;
}

/* URLs, keywords and codes in tables → mono (the Site Map's .cm-url line is DM Sans, see site-detail-content-map.css) */
.sr-table td.is-url, .sr-table .sr-url, .ct-url, .disc-url, .sr-kw-tag, .cga-kw,
.sr-table code, .sr-mono { font-family: var(--q-font-mono) !important; font-size: 13px; }

/* Ink block: the Overview hero already is one; give it the exact surface */
.ov-hero {
  background: radial-gradient(circle at 30% 20%, rgba(5,150,105,.18), transparent 55%), var(--q-ink) !important;
  border-radius: var(--q-radius-lg) !important;
  box-shadow: var(--q-shadow-ink) !important;
}
.ov-hero-headline { font-family: var(--q-font-body) !important; font-weight: 600 !important; font-size: var(--q-fs-h2) !important; color: #fff !important; }
.ov-hero-headline em { font-style: italic; color: var(--q-brand-bright); }
.ov-ring-score { font-size: 52px !important; color: #fff !important; }

/* focus visible everywhere */
:focus-visible { outline: none; box-shadow: var(--q-focus-ring); border-radius: var(--q-radius-sm); }

/* --------------------------------------------------------------------------
   6. Auth pages (dashboard login): serif heading, flat pill button
   -------------------------------------------------------------------------- */
.login-header h1 {
  font-family: var(--q-font-display) !important;
  font-weight: 400 !important;
  font-size: 30px !important;
  letter-spacing: -.02em;
  color: var(--q-ink) !important;
}
.btn-login, .login-form .btn-primary {
  background: var(--q-brand) !important;
  background-image: none !important;
  border-radius: var(--q-radius-pill) !important;
  font-weight: 600 !important;
  box-shadow: var(--q-shadow-brand) !important;
}
.btn-login:hover, .login-form .btn-primary:hover { background: var(--q-brand-deep) !important; }

/* --------------------------------------------------------------------------
   7. /dash (portfolio) and account pages — v2 additions
   -------------------------------------------------------------------------- */
.sr-dash-logo span {
  font-family: var(--q-font-display) !important;
  font-weight: 400 !important;
  font-size: 22px !important;
  color: var(--q-ink) !important;
}
.sr-dash-header { background: transparent; border-bottom: 1px solid var(--q-border); }
.ov-metric-value, .sr-dash-example-stat strong {
  font-family: var(--q-font-display) !important;
  font-weight: 400 !important;
  letter-spacing: -.01em;
  color: var(--q-ink);
}
.sr-dash-step-title, .sr-dash-tool-title, .sr-dash-add-title, .sr-dash-site-head h3 {
  font-size: var(--q-fs-h3) !important; font-weight: 600 !important; color: var(--q-ink) !important;
}
/* site cards on /dash: the score ring number in serif */
.sr-dash-site-score, .ov-site-score, .sr-site-card-score { font-family: var(--q-font-display) !important; font-weight: 400 !important; }

/* account page uses the same sidebar classes: tone it the same, no spine pulses there */
.sr-account-container .sr-nav-item.active::before,
.sr-account-container .sr-nav-item.active::after { display: none; }
.sr-account-container .sr-content-header h1 { margin-bottom: 4px; }

/* activity log entries read as sentences, not logs */
.sr-activity-entry .summary { font-size: var(--q-fs-small); line-height: 1.5; }
.sr-activity-entry.is-failed .summary { color: var(--q-warn-text); }
.sr-activity-entry.is-failed .dot { background: var(--q-warn) !important; }

/* --------------------------------------------------------------------------
   8. Live spine — the nav spine as the agent's status line (Phase 3)
   Driven by qurmy-spine.js: .sr-sidebar[data-run] and the Automation item.
   -------------------------------------------------------------------------- */
@keyframes q-run-up   { 0% { transform: translateY(0); opacity: 0; } 8% { opacity: 1; } 100% { transform: translateY(-640px); opacity: 0; } }
@keyframes q-run-down { 0% { transform: translateY(0); opacity: 0; } 8% { opacity: 1; } 100% { transform: translateY(640px); opacity: 0; } }
@keyframes q-run-node { 0%,100% { box-shadow: 0 0 0 3px var(--q-brand-glow), 0 0 18px rgba(52,211,153,.55); } 50% { box-shadow: 0 0 0 8px rgba(5,150,105,.06), 0 0 28px rgba(52,211,153,.9); } }
@keyframes q-stall    { 0%,100% { box-shadow: 0 0 0 3px rgba(217,119,6,.18); } 50% { box-shadow: 0 0 0 7px rgba(217,119,6,.04); } }

/* running: the Automation node glows green-bright and pulses leave it fast, both ways */
.sr-nav-item[data-section="automation"][data-run="running"] svg {
  background: var(--q-brand-bright);
  border-color: var(--q-brand-bright);
  color: var(--q-ink);
  animation: q-run-node 1.2s ease-in-out infinite;
}
.sr-nav-item[data-section="automation"][data-run="running"]::before,
.sr-nav-item[data-section="automation"][data-run="running"]::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 50%;
  width: 2px;
  height: 56px;
  border-radius: 2px;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(52,211,153,.8);
}
.sr-nav-item[data-section="automation"][data-run="running"]::before {
  margin-top: -56px;
  background: linear-gradient(180deg, rgba(52,211,153,0), var(--q-brand-bright));
  animation: q-run-up 1.4s linear infinite;
}
.sr-nav-item[data-section="automation"][data-run="running"]::after {
  background: linear-gradient(180deg, var(--q-brand-bright), rgba(52,211,153,0));
  animation: q-run-down 1.4s linear infinite;
}
/* the whole line brightens a touch while running */
.sr-sidebar[data-run="running"] .sr-sidebar-nav::before { opacity: 1; filter: saturate(1.3); }

/* stalled: amber node, slow breath, no travelling pulses */
.sr-nav-item[data-section="automation"][data-run="stalled"] svg {
  background: var(--q-warn-bg);
  border-color: var(--q-warn);
  color: var(--q-warn-text);
  animation: q-stall 2.4s ease-in-out infinite;
}
.sr-nav-item[data-section="automation"][data-run="stalled"].active svg {
  background: var(--q-warn);
  color: #fff;
}
.sr-nav-item[data-section="automation"][data-run="stalled"].active::before,
.sr-nav-item[data-section="automation"][data-run="stalled"].active::after { display: none; }

@media (prefers-reduced-motion: reduce) {
  .sr-nav-item[data-run] svg,
  .sr-nav-item[data-run]::before,
  .sr-nav-item[data-run]::after { animation: none !important; }
}

/* --------------------------------------------------------------------------
   9. /dash — one Ink summary block instead of four tiles, sparklines on cards
   Markup is produced by dashboard-ai.js (see PHASE 3 brief, Step 4).
   -------------------------------------------------------------------------- */
.q-ink {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--q-ink) 0%, var(--q-ink-2) 100%);
  color: #fff;
  border-radius: var(--q-radius-lg);
  box-shadow: var(--q-shadow-ink);
  padding: 28px 32px;
  margin: 0 0 28px;
}
.q-ink::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: .2;
  pointer-events: none;
}
.q-ink > * { position: relative; }
.q-ink-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 28px;
  align-items: end;
}
.q-ink-finding {
  font-family: var(--q-font-display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: var(--q-track-tight);
  color: #fff;
  margin: 0 0 8px;
}
.q-ink-finding em { font-style: italic; color: var(--q-brand-bright); }
.q-ink-sub { font-size: 14px; line-height: 1.5; color: rgba(255,255,255,.7); margin: 0; }
.q-ink-stat .q-ink-stat-label {
  font-size: var(--q-fs-eyebrow);
  letter-spacing: var(--q-track-eyebrow);
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-bottom: 6px;
}
.q-ink-stat .q-ink-stat-value {
  font-family: var(--q-font-display);
  font-size: 32px;
  line-height: 1;
  color: #fff;
}
.q-ink-stat .q-ink-stat-value small { font-family: var(--q-font-body); font-size: 13px; color: rgba(255,255,255,.55); margin-left: 6px; }
.q-ink-stat .q-ink-stat-note { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 6px; }
.q-ink-stat .q-ink-stat-note.is-up { color: var(--q-brand-bright); }
.q-ink-stat .q-ink-stat-note.is-warn { color: #fbbf24; }
@media (max-width: 960px) { .q-ink-grid { grid-template-columns: 1fr 1fr; } .q-ink-finding { font-size: 22px; } }
@media (max-width: 600px) { .q-ink-grid { grid-template-columns: 1fr; } }

/* sparkline inside a site card (inline SVG, 12 points max) */
.q-spark { display: block; width: 100%; height: 28px; overflow: visible; }
.q-spark path.q-spark-line { fill: none; stroke: var(--q-brand); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.q-spark path.q-spark-fill { fill: var(--q-brand-faint); stroke: none; }
.q-spark circle { fill: var(--q-brand); }
.q-spark-empty { font-size: 11px; color: var(--q-text-subtle); font-style: italic; font-family: var(--q-font-display); }

/* --------------------------------------------------------------------------
   10. Fixes, 8 Nov: switcher width, dropdown stacking, palette trigger
       position, credit bar parity between /dash and the site tabs
   -------------------------------------------------------------------------- */
/* the switcher card was 100% + padding (content-box) and ran past the nav edge */
.sr-site-switcher-btn { box-sizing: border-box; width: 100%; }
/* the open dropdown must sit above the nav (spine nodes carry their own z-index) */
.sr-site-switcher { position: relative; z-index: 60; }
.sr-site-dropdown {
  background: var(--q-card);
  border: 1px solid var(--q-border);
  border-radius: var(--q-radius-md);
  box-shadow: var(--q-shadow-raised);
  z-index: 61;
}
/* "Jump to" sits on the right, beside the credits, not after the breadcrumb */
.sr-top-header .q-palette-trigger { margin-left: auto; margin-right: 16px; }
.sr-top-header .sr-credit-bar { margin-left: 0; }
.sr-dash-header .sr-dash-logo { order: -2; }
.sr-dash-header .q-palette-trigger { order: -1; }
/* one credit tracker everywhere */
.sr-top-header .sr-credit-bar-inner,
.sr-dash-header .sr-credit-bar-inner {
  background: var(--q-grey-50);
  border: 1px solid var(--q-border);
  border-radius: 8px;
  padding: 6px 14px;
}
.sr-dash-header .sr-credit-bar { margin-right: 16px; }
/* dropdown edges align with the switcher card */
.sr-site-switcher .sr-site-dropdown { left: 14px; right: 14px; }

/* --------------------------------------------------------------------------
   11. Small screens (<= 720px), Phase 5
       The brief calls this "§9 Small screens"; §9 was already taken by the
       /dash Ink block, so it is the last section instead. One block, tokens
       only. Root causes were fixed in the files that caused them (see the
       Phase 5 report); this block only holds the mobile layout itself.
   -------------------------------------------------------------------------- */
.q-nav-toggle,
.q-nav-scrim { display: none; }

@media (max-width: 720px) {
  /* sidebar as an off-canvas drawer, opened by the header menu button (qurmy-spine.js) */
  .sr-app-container .sr-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    height: auto;
    transform: translateX(-100%);
    transition: transform var(--q-dur) var(--q-ease), box-shadow var(--q-dur) var(--q-ease);
    z-index: 1001;
  }
  body.q-nav-open .sr-app-container .sr-sidebar { transform: translateX(0); box-shadow: var(--q-shadow-ink); }
  body.q-nav-open .q-nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(11, 17, 32, .4);
  }
  body.q-nav-open { overflow: hidden; }
  .sr-app-container .sr-main-content { margin-left: 0; min-width: 0; }

  .q-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 40px;
    height: 40px;
    padding: 0;
    margin-right: var(--q-space-3);
    border: 1px solid var(--q-border);
    border-radius: 50%;
    background: var(--q-card);
    color: var(--q-ink);
    cursor: pointer;
  }
  .q-nav-toggle svg { width: 20px; height: 20px; }
  .q-nav-toggle:hover { border-color: var(--q-brand); color: var(--q-brand); }
  .q-nav-toggle:focus-visible { outline: none; box-shadow: var(--q-focus-ring); }

  /* header bar: menu, breadcrumb (shrinks, ellipsis), Jump to (icon only), credits */
  .sr-top-header { padding: 0 var(--q-space-3); gap: var(--q-space-2); }
  .sr-breadcrumb { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; }
  .sr-breadcrumb > a,
  .sr-breadcrumb > a + .sr-breadcrumb-separator { display: none; }
  .sr-breadcrumb-site,
  .sr-breadcrumb-current { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .sr-top-header .q-palette-trigger { margin-right: 0; flex: none; }
  .sr-top-header .sr-credit-bar { flex: none; margin-right: 0; }
  .sr-top-header .sr-credit-bar-inner,
  .sr-dash-header .sr-credit-bar-inner { padding: var(--q-space-1) var(--q-space-2); gap: var(--q-space-2); }
  .sr-content-header { padding: var(--q-space-4); gap: var(--q-space-3); }
  .sr-content-header .sr-header-left { flex: 1 1 auto; min-width: 0; }

  /* page content and the finding sentence */
  .sr-page-content,
  .sr-site-detail-container .sr-page-content { padding: var(--q-space-5) var(--q-space-4) var(--q-space-7); }
  /* the finding sentence is 26px: scope the token so every user of it follows (no override flags) */
  .sr-main-content,
  .sr-dash-main { --q-fs-display: 26px; }
  .q-finding,
  .ov-title,
  .cp-title,
  .cdb-title,
  .cga-page-title,
  .sr-content-header h1 { max-width: 100%; overflow-wrap: break-word; }

  /* command palette: full width with 12px gutters, input pinned while the keyboard is open */
  .q-palette-card {
    position: fixed;
    top: 8px;
    left: var(--q-space-3);
    right: var(--q-space-3);
    width: auto;
    transform: none;
    animation: none;
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 16px);
  }
  .q-palette-input-row { flex: none; }
  .q-palette-list { flex: 1 1 auto; max-height: none; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .q-palette-foot { display: none; }

  /* /dash header: the serif wordmark, as in the sidebar; Top up on one line */
  .sr-dash-header { padding: 0 var(--q-space-3); gap: var(--q-space-2); }
  .sr-dash-header .sr-dash-logo img { display: none; }
  .sr-dash-header .sr-dash-logo span { display: inline; }
  .sr-dash-header .sr-header-actions { gap: var(--q-space-2); }
  .sr-dash-header .sr-credit-bar { margin-right: 0; }
  .sr-dash-topup { white-space: nowrap; }

  /* Ink block (/dash summary): one column, stats stacked */
  .q-ink { padding: var(--q-space-5) var(--q-space-4); }
  .q-ink-grid { grid-template-columns: minmax(0, 1fr); gap: var(--q-space-4); align-items: start; }
  /* Overview hero: ring above the text, the trend below, all full width */
  .ov-hero { flex-direction: column; align-items: stretch; }
  .ov-hero-body,
  .ov-hero-trend { flex: none; width: 100%; }

  /* cards: every fixed repeat(N, 1fr) grid (no auto-fit / minmax) becomes one column.
     Same selectors as the component files; this file loads after them, so source order wins. */
  .aeo-dim-grid, .aip-grid, .analyse-stats-grid, .cd-columns, .cd-ins-tiles, .cd-lens-stats,
  .channels-setup-grid, .content-stats-grid, .crawl-stats-row, .pa-cat-grid, .pa-kw-secondaries,
  .pa-stats-row, .page-audit-grid, .perf-stats-grid, .si-bl-summary-grid, .si-cat-grid,
  .si-eeat-grid, .si-so-cats, .si-xref-grid, .site-header-stats, .sr-agent-stats,
  .sr-ai-modal-stats, .sr-ai-prompt-scores, .sr-cap-field-group, .sr-channels-grid, .sr-chart-grid,
  .sr-citation-type-grid, .sr-form-grid, .sr-grid-2, .sr-grid-3, .sr-grid-4, .sr-grid-6,
  .sr-kd-positions, .sr-metrics-row, .sr-modal-stats, .sr-pi-airead-grid, .sr-pi-cat-grid,
  .sr-pi-context-stats, .sr-pi-history-list, .sr-pi-perf-cards, .sr-pi-quick-stats,
  .sr-pi-split-row .sr-pi-airead-grid, .sr-plan-limits-grid, .sr-seo-panel-metrics,
  .sr-stats-grid-2, .sr-stats-grid-3, .sr-stats-grid-4, .sr-stats-grid-5, .sr-summary-grid,
  .sr-summary-stats, .sr-team-stats, .sr-usage-grid, .sru-cards, .uptime-stats-grid { grid-template-columns: minmax(0, 1fr); }
}
