/* Completed checks only: the light flash look. The account shell and the upload flow share the older stylesheet.
   Light only, whatever the device theme. Motion only when the rider hasn't asked for less. */
html:root:has(.rd) {
  --bg: #f4f8ff; --inset: #eef5ff; --card: #fff; --raised: #e3eefc; --line: #d6e3f3; --text: #0b1e3a; --muted: #5d7396;
  --blue: #2563eb; --btn: #2563eb; --on: #fff; --ok: #0f7a4a; --ok-s: #e3f7ec; --watch: #9a5b00; --watch-s: #fff1d6; --fix: #c2352f; --fix-s: #fde7e5;
  --front: #0d9488; --rear: #db2777; color-scheme: light;
}
body:has(.rd), body.iq-workspace:has(.rd) {
  background:
    linear-gradient(#2563eb08 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, #2563eb08 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(ellipse at 85% 0%, #dbeafe 0, transparent 55%),
    #f4f8ff;
  color: #0b1e3a; color-scheme: light;
}
.rd {
  --navy: #0b1e3a; --body: #334e73; --muted: #5d7396; --edge: #dbe6f4; --accent: #2563eb; --cyan: #0284c7; --glow: #22d3ee;
  --front: #0d9488; --rear: #db2777; --heavy: "Libre Franklin", Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
  color: var(--body); font-family: "Libre Franklin", Inter, system-ui, sans-serif;
}
.rd [hidden] { display: none !important; }
.rd, .rd *, .rd *::before, .rd *::after { box-sizing: border-box; }
.rd :is(h1,h2,h3,h4,p,dl,dd,ol,ul) { margin: 0; }
.rd :is(.rd-main,.rd-aside,.rd-hero > *,.rd-lower > *) { min-width: 0; }
.rd button, .rd summary { cursor: pointer; }
.rd :is(button,a,input,summary):focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
.rd .rd-number, .rd .hc-val { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.rd h2 { color: var(--navy); font-family: var(--heavy); font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.1; }
.rd-eyebrow { display: block; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.rd .hc-card { background: #fff; border: 1px solid var(--edge); border-radius: 22px; box-shadow: 0 1px 2px #0b1e3a08, 0 14px 40px #2563eb10; }
.rd .hc-btn { min-height: 46px; border-radius: 14px; background: linear-gradient(100deg, #2563eb, #0284c7); border: 0; color: #fff; font-weight: 800; box-shadow: 0 8px 22px #2563eb38; }
.rd .hc-btn.ghost { background: #fff; color: var(--accent); border: 1px solid #c7d9f2; box-shadow: none; }
.rd .hc-btn:disabled { background: #e7eefa; color: #6b7f9e; box-shadow: none; }
.rd .hc-link { min-height: 44px; display: inline-flex; align-items: center; color: var(--accent); font-weight: 700; }
.rd .hc-v { text-transform: uppercase; font-size: 12px; font-weight: 800; letter-spacing: .1em; padding: 5px 12px; border: 1px solid transparent; }
.rd .hc-v.ok { color: #0f7a4a; background: #e3f7ec; border-color: #bfe9d1; }
.rd .hc-v.watch { color: #9a5b00; background: #fff1d6; border-color: #f6d9a0; }
.rd .hc-v.fix { color: #b42318; background: #fde7e5; border-color: #f7c2bd; }
.rd .hc-v.none { color: #1d4ed8; background: #eef4ff; border-color: #c9dafb; }

/* Top bar */
.rd-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 18px; }
.rd-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; color: var(--muted); font-weight: 600; font-size: 15px; }
.rd-crumbs a, .rd-crumbs .hc-link { color: var(--muted); text-decoration: none; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.rd-crumbs [aria-current] { color: var(--navy); font-weight: 800; }
.rd-top-actions { display: flex; align-items: center; gap: 12px; }
.rd .hc-plan { font-size: 13px; font-weight: 800; color: var(--accent); background: #eaf2ff; border-radius: 999px; padding: 6px 12px; }

/* Hero */
.rd .rd-verdict { position: relative; overflow: hidden; padding: clamp(14px, 1.25vw, 20px); background: linear-gradient(120deg, #fff 35%, #eaf3ff 75%, #e9e7ff); border: 1px solid #c9dcf6; border-radius: 28px; box-shadow: 0 0 0 1px #ffffff inset, 0 20px 60px #2563eb1c; scroll-margin-top: 12px; }
.rd-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(16px, 2.2vw, 34px); align-items: center; }
.rd-score { display: grid; justify-items: center; gap: 6px; }
.rd-ring { position: relative; width: clamp(96px, 9.4vw, 140px); aspect-ratio: 1; display: grid; place-items: center; }
.rd-ring svg { position: absolute; inset: 0; width: 100%; transform: rotate(-90deg); overflow: visible; }
.rd-ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.rd-ring-track { stroke: #dfe9f7; }
.rd-ring-fill { stroke: url(#rd-ring-grad); filter: drop-shadow(0 0 6px #22d3ee66); }
.rd-ring span { display: grid; justify-items: center; line-height: 1; }
.rd-ring strong { font-family: var(--heavy); font-weight: 900; font-size: clamp(34px, 3.2vw, 48px); color: var(--navy); letter-spacing: -.03em; }
.rd-ring small { margin-top: 8px; font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--muted); letter-spacing: .1em; }
.rd-score-label { display: grid; justify-items: center; text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.rd-score-label b { color: var(--navy); }
.rd-hero-text { display: grid; gap: 7px; }
.rd-hero-text .rd-eyebrow { color: #1d4ed8; }
.rd .rd-hero h1 { font-family: var(--heavy); font-weight: 800; text-transform: none; color: var(--navy); font-size: clamp(28px, 2.7vw, 42px); line-height: 1.08; letter-spacing: -.02em; overflow-wrap: anywhere; }
.rd .rd-verdict-detail { font-size: 17px; font-weight: 500; line-height: 1.4; color: var(--body); }
.rd-summary { font-size: clamp(16px, 1.4vw, 20px); line-height: 1.5; color: var(--body); max-width: 60ch; }
.rd-summary b { color: var(--navy); }
.rd-facts { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.rd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.rd-stats > div { position: relative; display: grid; align-content: start; gap: 6px; padding: 16px 16px 14px; background: #fff; border: 1px solid var(--edge); border-radius: 16px; overflow: hidden; }
.rd-stats > div::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, #22d3ee, #2563eb 60%, #7c3aed); opacity: .8; }
.rd-stats dt { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.rd-stats dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; overflow-wrap: anywhere; }
.rd-big { font-size: clamp(20px, 1.9vw, 26px); font-weight: 800; color: var(--navy); }
.rd-sub { font-size: 13px; color: var(--muted); }
.rd-change { font-size: 13px; font-weight: 700; color: var(--muted); }
.rd-change.worse, .rd-move.worse { color: #c2352f; }
.rd-change.better, .rd-move.better { color: #0f7a4a; }
.rd-move.same { color: var(--muted); }
.rd .rd-verdict .hc-quality { background: #fff7e6; color: #7a4b05; border: 1px solid #f6dca6; border-radius: 12px; padding: 10px 14px; font-weight: 600; }

/* Top alert */
.rd-alert { display: flex; gap: 16px; align-items: flex-start; margin-top: 18px; padding: 18px 22px; border-radius: 18px; border: 1px solid #f3d9a4; border-left: 5px solid #f59e0b; background: linear-gradient(100deg, #fffaf0, #fff6e5); }
.rd-alert.fix { border-color: #f5c4bf; border-left-color: #dc2626; background: linear-gradient(100deg, #fff6f5, #fdeeed); }
.rd-alert-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #d97706; background: #fff1d6; }
.rd-alert.fix .rd-alert-icon { color: #dc2626; background: #fde7e5; }
.rd-alert-icon svg { width: 22px; height: 22px; }
.rd-alert .rd-eyebrow { color: #b45309; margin-bottom: 4px; }
.rd-alert.fix .rd-eyebrow { color: #b42318; }
.rd-alert p { color: var(--navy); font-size: 17px; font-weight: 650; line-height: 1.5; }
.rd-quiet { color: var(--muted); margin-top: 14px; }

/* Areas */
.rd-areas { margin-top: 22px; }
.rd-areas-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.rd-areas-head h2 { font-size: clamp(28px, 3vw, 40px); }
.rd-areas-head h2 .rd-number { font-family: var(--heavy); }
.rd-areas-head p { color: var(--muted); }
.rd-count { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--muted); }
.rd-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 10px 0 14px; }
.rd .rd-pills { display: flex; flex-wrap: wrap; gap: 10px; background: none; border: 0; padding: 0; }
.rd .rd-pills button { min-height: 46px; padding: 10px 20px; border-radius: 999px; border: 1px solid #d3e1f4; background: #fff; color: var(--navy); font: inherit; font-weight: 700; }
.rd .rd-pills button[aria-pressed="true"] { color: #fff; border-color: transparent; background: linear-gradient(100deg, #2563eb, #0284c7); box-shadow: 0 8px 22px #2563eb40; }
.rd .rd-search { flex: 0 1 320px; min-width: 200px; }
.rd .rd-search input { min-height: 48px; border-radius: 14px; border: 1px solid #d3e1f4; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d7396' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 16px 50% / 18px no-repeat; padding: 12px 16px 12px 44px; color: var(--navy); font: inherit; }
.rd-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 36%); gap: 22px; align-items: start; }
.rd-main { display: grid; gap: 14px; }
.rd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; perspective: 900px; }
.rd-tile {
  --status: #94a3b8; position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 7px; min-width: 0; padding: 12px 16px;
  font: inherit; text-align: left; color: var(--body); background: linear-gradient(180deg, #fff, #fbfdff); border: 1px solid var(--edge); border-radius: 22px;
  box-shadow: 0 1px 2px #0b1e3a08, 0 10px 30px #2563eb0d; overflow-wrap: anywhere;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d;
}
.rd-ok { --status: #10b981; } .rd-watch { --status: #f59e0b; } .rd-fix { --status: #ef4444; } .rd-info { --status: #2563eb; }
.rd-tile-top { display: flex; align-items: center; gap: 12px; }
.rd-tile-title { flex: 1; min-width: 0; font-size: 20px; line-height: 1.15; font-weight: 800; color: var(--navy); }
.rd-tile-top .hc-v { margin-left: auto; }
.rd-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--accent); background: #eef5ff; border: 1px solid #d6e5fb; }
.rd-icon svg { width: 22px; height: 22px; }
.rd .hc-fr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; }
.rd .hc-fr .hc-k { grid-row: 1; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.rd .hc-fr .hc-k.f { color: var(--front); } .rd .hc-fr .hc-k.r { color: var(--rear); }
.rd .hc-fr .hc-val { grid-row: 2; }
.rd .hc-val { display: block; font-size: clamp(20px, 1.9vw, 26px); font-weight: 800; color: var(--navy); }
.rd-tile-verdict { font-family: var(--mono); font-size: 24px; font-weight: 800; color: var(--navy); }
.rd-meter { display: block; height: 6px; border-radius: 6px; background: #e6eef9; overflow: hidden; }
.rd-meter i { display: block; height: 100%; width: var(--level); border-radius: inherit; background: linear-gradient(90deg, #22d3ee, #2563eb); transform-origin: left; }
.rd-watch .rd-meter i { background: linear-gradient(90deg, #22d3ee, #2563eb 70%, #f59e0b); }
.rd-fix .rd-meter i { background: #ef4444; }
.rd-reading-label { font-size: 15px; line-height: 1.45; color: var(--muted); }
.rd-chev { display: inline-block; color: var(--accent); font-size: .95em; line-height: 1; transition: transform .2s; }
.rd .rd-tile[aria-pressed="true"] { border-color: #60a5fa; box-shadow: 0 0 0 4px #60a5fa26, 0 0 32px #22d3ee40, 0 16px 40px #2563eb26; }
.rd .rd-tile[aria-pressed="true"]::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, #22d3ee, #2563eb, #7c3aed); }
.rd .rd-tile[aria-pressed="true"] .rd-chev { transform: rotate(90deg); }

/* Detail panel */
.rd-aside { position: sticky; top: 12px; }
.rd-aside.has-panel .rd-aside-empty, .rd-aside:has(.rd-inspector:not([hidden])) .rd-aside-empty { display: none; }
.rd-aside-empty { padding: 28px; border: 1px dashed #c7d9f2; border-radius: 22px; color: var(--muted); text-align: center; background: #ffffffaa; }
.rd .rd-inspector { position: relative; min-width: 0; width: 100%; max-height: calc(100vh - 24px); overflow: auto; overscroll-behavior: contain; padding: 0 24px 24px; border: 1px solid #c9dcf6; border-radius: 24px; background: #fff; color: var(--body); box-shadow: 0 0 0 1px #fff inset, 0 24px 60px #2563eb22; }
.rd-inspector::before { content: ''; position: sticky; top: 0; z-index: 3; display: block; height: 4px; margin: 0 -24px; background: linear-gradient(90deg, #22d3ee, #2563eb, #7c3aed, #22d3ee); background-size: 300% 100%; }
.rd-dialog-head { display: flex; justify-content: flex-end; padding-top: 12px; }
.rd-dialog-head .hc-btn { display: none; min-height: 44px; }
.rd .rd-inspector .hc-area { padding: 12px 0 0; border: 0; border-radius: 0; box-shadow: none; background: #fff; gap: 16px; }
.rd-area-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rd-area-heading h3 { font-family: var(--heavy); font-weight: 900; text-transform: uppercase; color: var(--navy); font-size: clamp(26px, 2.4vw, 34px); line-height: 1.05; letter-spacing: -.01em; }
.rd-panel-lead { padding-bottom: 16px; border-bottom: 1px solid var(--edge); }
.rd-panel-lead .hc-fr { justify-content: start; grid-template-columns: repeat(2, max-content); column-gap: 32px; }
.rd-panel-lead .hc-one .hc-val { font-size: 26px; }
.rd-why { font-size: 17px; line-height: 1.65; color: var(--body); }
.rd .rd-inspector h4 { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.rd .hc-cylinder-switch { display: inline-flex; gap: 6px; }
.rd .hc-cylinder-switch button { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid #d3e1f4; background: #fff; color: var(--navy); font: inherit; font-weight: 700; text-transform: capitalize; }
.rd .hc-cylinder-switch button[aria-pressed="true"] { background: #0b1e3a; color: #fff; border-color: #0b1e3a; }
.rd-readings { display: grid; }
.rd-readings > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 8px 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--edge); }
.rd-readings dt { font-weight: 700; color: var(--navy); line-height: 1.35; }
.rd-readings dd { min-width: 0; overflow-wrap: anywhere; font-weight: 800; color: var(--navy); }
.rd-readings dd > .rd-number { font-family: var(--mono); }
.rd-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rd-pair > div { display: grid; gap: 4px; min-width: 0; }
.rd-pair small { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.rd-pair [data-cylinder="front"] { color: var(--front); }
.rd-pair [data-cylinder="rear"] { color: var(--rear); }
.rd-value-track { display: block; height: 6px; border-radius: 6px; background: #edf2f9; overflow: hidden; }
.rd-value-track i { display: block; height: 100%; border-radius: inherit; background: #64748b; transform-origin: left; }
[data-cylinder="front"] .rd-value-track i { background: linear-gradient(90deg, #2dd4bf, #0d9488); }
[data-cylinder="rear"] .rd-value-track i { background: linear-gradient(90deg, #f472b6, #db2777); }
.rd .hc-sub { gap: 8px; }
.rd .hc-scroll { overflow-x: auto; width: 100%; }
.rd .hc-cells td.cf { color: var(--front); } .rd .hc-cells td.cr { color: var(--rear); }
.rd-tuner { display: grid; gap: 10px; padding: 18px 20px; border-radius: 16px; background: linear-gradient(120deg, #eff6ff, #f5f3ff); border: 1px solid #d6e3fb; }
.rd-tuner .rd-eyebrow { color: #1d4ed8; }
.rd-tuner p { color: var(--navy); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.rd-tuner .hc-btn { justify-self: start; }

/* Trend and retest */
.rd-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 36%); gap: 22px; align-items: start; margin-top: 34px; }
.rd-lower.rd-verdict-only { grid-template-columns: minmax(0, 1fr); }
.rd .rd-trends, .rd .rd-retest { padding: clamp(18px, 2.4vw, 30px); gap: 16px; }
.rd-say { font-size: 17px; color: var(--navy); font-weight: 600; }
.rd-hint { color: var(--muted); margin-top: -8px; }
.rd-metrics { display: flex; flex-wrap: wrap; gap: 10px; }
.rd-metrics button { min-height: 46px; padding: 10px 18px; border-radius: 999px; border: 1px solid #d3e1f4; background: #fff; color: var(--navy); font: inherit; font-weight: 700; }
.rd-metrics [aria-pressed="true"] { color: #fff; border-color: transparent; background: linear-gradient(100deg, #2563eb, #0284c7); box-shadow: 0 8px 22px #2563eb40; }
.rd-chart-box { padding: 18px 18px 8px; border: 1px solid var(--edge); border-radius: 18px; background: linear-gradient(180deg, #fbfdff, #f5f9ff); }
.rd-chart-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.rd-chart-title h3 { font-family: var(--mono); font-size: 18px; color: var(--navy); font-weight: 700; }
.rd-move { font-weight: 800; font-size: 15px; }
.rd-chart { display: block; width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.rd-grid-line { stroke: #dfe8f5; stroke-width: 1; }
.rd-axis { font: 600 12px var(--mono); fill: #7186a6; }
.rd-line { fill: none; stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.rd-dot { fill: #fff; stroke: #2563eb; stroke-width: 3; }
.rd-dot.now { fill: #2563eb; stroke: #fff; filter: drop-shadow(0 0 6px #22d3eeaa); }
.rd-now-label { font: 800 15px var(--mono); fill: var(--navy); }
.rd-worse-note { color: #c2352f; font-weight: 700; padding-bottom: 8px; }
.rd-trend-rows { list-style: none; padding: 0; display: grid; }
.rd-trend-rows button { width: 100%; min-height: 56px; display: grid; grid-template-columns: minmax(0, 1fr) 90px auto 64px; align-items: center; gap: 14px; padding: 10px 4px; background: none; border: 0; border-top: 1px solid var(--edge); font: inherit; text-align: left; color: var(--navy); }
.rd-trend-rows button[aria-pressed="true"] { background: linear-gradient(90deg, #eff6ff, transparent); }
.rd-trend-name { font-weight: 650; }
.rd-trend-nums { font-size: 14px; font-weight: 700; white-space: nowrap; }
.rd-trend-rows .rd-move { text-align: right; }
.rd-spark { width: 90px; height: 30px; }
.rd-spark polyline { fill: none; stroke: #0284c7; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rd-steps { list-style: none; padding: 0; display: grid; }
.rd-steps li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--edge); color: var(--navy); font-size: 16px; line-height: 1.55; }
.rd-steps li:first-child { border-top: 0; }
.rd-step-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 800; background: linear-gradient(135deg, #22d3ee, #2563eb); box-shadow: 0 0 0 4px #dbeafe; }
.rd .rd-upload { width: 100%; min-height: 56px; font-size: 17px; }
.rd-disclaimer { display: grid; gap: 8px; padding: 18px 20px; border-radius: 16px; background: #f5f9ff; border: 1px solid var(--edge); }
.rd-disclaimer .rd-eyebrow { color: var(--muted); }
.rd-disclaimer p { line-height: 1.65; }
.rd .hc-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-retest .hc-link.danger { color: #c2352f; align-self: flex-start; }
.rd-extras { display: grid; gap: 18px; margin-top: 28px; }
.rd-extras > .hc-card, .rd-extras > .hc-lock { padding: 22px; }
.rd .hc-h2 { margin-top: 6px; }
.rd .hc-lock { border-radius: 22px; border: 1px dashed #c7d9f2; background: #fbfdff; }
.rd .hc-notice { margin-top: 18px; }
.rd-explorer { font-size: 16px; }

/* Motion, only when welcome */
@media (prefers-reduced-motion: no-preference) {
  .rd-verdict, .rd-alert, .rd-tile, .rd-stats > div, .rd-lower > * { animation: rd-rise .6s cubic-bezier(.2,.7,.2,1) both; }
  .rd-alert { animation-delay: .15s; }
  .rd-tile { animation-delay: calc(.2s + var(--i, 0) * 60ms); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
  .rd-stats > div { animation-delay: calc(.25s + var(--i, 0) * 70ms); }
  .rd-ring-fill { animation: rd-sweep 1.4s cubic-bezier(.3,.7,.2,1) .2s both; }
  .rd-meter i { animation: rd-grow .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(.45s + var(--i, 0) * 60ms); }
  .rd-alert-icon { animation: rd-pulse 2s ease-in-out infinite; }
  .rd-inspector::before { animation: rd-flow 4s linear infinite; }
  .rd-inspector.rd-enter .hc-area:not([hidden]) { animation: rd-rise .4s ease-out both; }
  .rd-inspector.rd-enter .rd-value-track i { animation: rd-grow .8s cubic-bezier(.2,.7,.2,1) .1s both; }
  .rd .rd-tile[aria-pressed="true"] { animation: rd-rise .6s both, rd-glow 2.6s ease-in-out 1s infinite; }
  .rd-line { stroke-dasharray: 100; animation: rd-draw 1.1s ease-out both; }
  .rd-pills button, .rd-metrics button, .rd .hc-btn { transition: background .2s, box-shadow .2s, transform .2s; }
  @keyframes rd-rise { from { opacity: 0; transform: translateY(14px); } }
  @keyframes rd-sweep { from { stroke-dasharray: 0 100; } }
  @keyframes rd-grow { from { transform: scaleX(0); } }
  @keyframes rd-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
  @keyframes rd-flow { to { background-position: -300% 0; } }
  @keyframes rd-pulse { 0%, 100% { box-shadow: 0 0 0 0 #f59e0b55; } 50% { box-shadow: 0 0 0 10px #f59e0b00; } }
  @keyframes rd-glow { 0%, 100% { box-shadow: 0 0 0 4px #60a5fa26, 0 0 24px #22d3ee30, 0 16px 40px #2563eb22; } 50% { box-shadow: 0 0 0 4px #60a5fa40, 0 0 40px #22d3ee60, 0 16px 40px #2563eb30; } }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .rd-tile:hover { border-color: #93c5fd; box-shadow: 0 1px 2px #0b1e3a08, 0 22px 44px #2563eb22; }
  .rd .hc-btn:hover, .rd-pills button:hover, .rd-metrics button:hover { transform: translateY(-1px); }
}

/* Keep the heading and filters on one line when the results have room. */
@media (min-width: 1250px) {
  main#hc-root:has(.rd) { padding-top: 14px; }
  .rd-topbar { margin-bottom: 10px; }
  .rd-areas { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; margin-top: 18px; }
  .rd-areas-head { column-gap: 12px; }
  .rd-areas-head h2 { font-size: 30px; }
  .rd-count { margin-left: 0; }
  .rd-toolbar { margin: 0; justify-content: end; }
  .rd .rd-search { flex-basis: 200px; }
  .rd-columns { grid-column: 1 / -1; }
}

/* Narrower screens */
@media (max-width: 1180px) {
  .rd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rd-columns, .rd-lower { grid-template-columns: minmax(0, 1fr) minmax(300px, 40%); }
  .rd-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .rd-hero { grid-template-columns: 1fr; justify-items: start; }
  .rd-score { grid-template-columns: auto auto; align-items: center; justify-items: start; }
  .rd-score-label { justify-items: start; text-align: left; }
  .rd-columns, .rd-lower { grid-template-columns: 1fr; }
  .rd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rd-aside { position: static; }
  .rd-aside-empty { display: none; }
  .rd-grid > .rd-inspector { grid-column: 1 / -1; max-height: none; overflow: visible; overscroll-behavior: auto; }
  .rd-dialog-head { position: sticky; top: 4px; z-index: 4; }
  .rd-dialog-head .hc-btn { display: inline-flex; }
  .rd-count { margin-left: 0; }
}
@media (max-width: 640px) {
  .rd-topbar { align-items: stretch; }
  .rd-top-actions { width: 100%; justify-content: space-between; }
  .rd .rd-verdict { border-radius: 22px; }
  .rd-ring { width: 88px; }
  .rd-ring strong { font-size: 32px; }
  .rd-ring small { font-size: 12px; margin-top: 4px; }
  .rd .rd-hero h1 { font-size: clamp(26px, 6.8vw, 32px); }
  .rd-stats { gap: 10px; }
  .rd-stats > div { padding: 14px 12px 12px; }
  .rd-grid { grid-template-columns: 1fr; gap: 14px; }
  .rd .rd-pills { gap: 8px; }
  .rd .rd-pills button { padding: 10px 14px; flex: 1 1 auto; }
  .rd .rd-search { flex: 1 1 100%; min-width: 0; }
  .rd .rd-inspector { padding: 0 16px 18px; }
  .rd-inspector::before { margin: 0 -16px; }
  .rd-readings > div { grid-template-columns: 1fr; }
  .rd-trend-rows button { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .rd-spark { display: none; }
  .rd-trend-rows .rd-trend-nums { grid-column: 1; grid-row: 2; }
  .rd-trend-rows .rd-move { grid-column: 2; grid-row: 1 / span 2; }
  .rd-alert { padding: 16px; gap: 12px; }
  .rd-alert p { font-size: 16px; }
}
