/* ── Recording dialog: steps and summary of one recording (js/components/recentDialog.js) ── */
/* Tokens copied from the agent panel's --ap-* (starman.css), so the dialog reads as part of it; --rd-raised*
   (the picked Run segment, lighter than its track in both themes) are the dialog's own, and --rd-menu-* (the
   More menu's raised surface) are the app's dropdown surface (starman.css .sl-filter-dropdown-menu) */
.rd-root {
  --rd-ink: #0f172a; --rd-muted: #64748b; --rd-faint: #94a3b8; --rd-line: #e8ebf0;
  --rd-fill: #f1f5f9; --rd-bg: #ffffff; --rd-accent: #2563eb; --rd-soft: #334155;
  --rd-raised: #ffffff; --rd-accent-bg: #dbeafe;
  --rd-raised-ring: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.04);
  --rd-success: #15803d; --rd-success-bg: #dcfce7;
  --rd-warning: #b45309; --rd-warning-bg: #fef3c7;
  --rd-danger: #b91c1c; --rd-danger-bg: #fee2e2;
  --rd-backdrop: rgba(15, 23, 42, 0.4);
  --rd-shadow: 0 24px 64px -16px rgba(15, 23, 42, 0.28), 0 2px 6px rgba(15, 23, 42, 0.06);
  --rd-menu-bg: #ffffff; --rd-menu-line: #e2e8f0;
  --rd-menu-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.18), 0 2px 4px rgba(15, 23, 42, 0.06);
  --rd-ease: cubic-bezier(0.23, 1, 0.32, 1);
  position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px; color: var(--rd-ink); font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[data-theme="dark"] .rd-root {
  --rd-ink: #f1f5f9; --rd-muted: #94a3b8; --rd-faint: #64748b; --rd-line: rgba(255, 255, 255, 0.08);
  --rd-fill: rgba(255, 255, 255, 0.06); --rd-bg: #11141d; --rd-accent: #7aa2ff; --rd-soft: #cbd5e1;
  --rd-raised: rgba(255, 255, 255, 0.12); --rd-accent-bg: rgba(122, 162, 255, 0.14);
  --rd-raised-ring: 0 0 0 1px rgba(255, 255, 255, 0.08);
  --rd-success: #4ade80; --rd-success-bg: rgba(74, 222, 128, 0.12);
  --rd-warning: #fbbf24; --rd-warning-bg: rgba(251, 191, 36, 0.12);
  --rd-danger: #f87171; --rd-danger-bg: rgba(248, 113, 113, 0.12);
  --rd-backdrop: rgba(0, 0, 0, 0.6);
  --rd-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
  --rd-menu-bg: #181c28; --rd-menu-line: rgba(255, 255, 255, 0.12);
  --rd-menu-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}
.rd-root [hidden] { display: none !important; }

.rd-backdrop { position: absolute; inset: 0; background: var(--rd-backdrop); }
.rd-panel {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  width: min(880px, calc(100vw - 32px));
  /* As tall as the record needs, up to 660px; the floor keeps the skeleton-to-content swap small */
  max-height: min(660px, calc(100vh - 48px)); max-height: min(660px, calc(100dvh - 48px));
  min-height: min(420px, calc(100vh - 48px)); min-height: min(420px, calc(100dvh - 48px));
  background: var(--rd-bg); border: 1px solid var(--rd-line); border-radius: 16px; box-shadow: var(--rd-shadow);
  transform-origin: center;
}

/* Motion: pointer opens fade the backdrop and scale the panel from 0.96; keyboard opens and Escape don't animate */
.rd-root[data-motion="pointer"] .rd-backdrop { transition: opacity 200ms var(--rd-ease); }
.rd-root[data-motion="pointer"] .rd-panel { transition: opacity 200ms var(--rd-ease), transform 200ms var(--rd-ease); }
.rd-root[data-state="enter"] .rd-backdrop,
.rd-root[data-state="leave"] .rd-backdrop { opacity: 0; }
.rd-root[data-state="enter"] .rd-panel { opacity: 0; transform: scale(0.96); }
.rd-root[data-state="leave"] { pointer-events: none; }
.rd-root[data-state="leave"] .rd-backdrop,
.rd-root[data-state="leave"] .rd-panel { transition-duration: 150ms; }
.rd-root[data-state="leave"] .rd-panel { opacity: 0; transform: scale(0.98); }

/* ── Header ── */
.rd-head { flex: none; padding: 14px 16px 18px 24px; border-bottom: 1px solid var(--rd-line); }
.rd-head-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin-bottom: 10px; }
.rd-head-main { display: flex; align-items: flex-start; gap: 14px; padding-right: 8px; }
.rd-tile {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; background: var(--rd-fill); color: var(--rd-soft);
}
.rd-tile svg { width: 18px; height: 18px; }
/* The Ideas page's icon is its own tile (assets/ideas/*.svg): nothing behind it */
.rd-tile.is-image { background: transparent; }
.rd-img { display: block; width: 100%; height: 100%; border-radius: 27%; user-select: none; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.08); }
.rd-tile-sm { width: 32px; height: 32px; border-radius: 8px; }
.rd-tile-sm svg { width: 16px; height: 16px; }
.rd-heading { flex: 1; min-width: 0; outline: none; }
.rd-title {
  margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; color: var(--rd-ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere; text-wrap: balance;
}
.rd-title.is-pending { width: min(60%, 320px); color: transparent; background: var(--rd-fill); border-radius: 6px; }
.rd-meta {
  margin: 3px 0 0; min-height: 1.45em; font-size: 0.8125rem; line-height: 1.45; color: var(--rd-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums;
}

.rd-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; line-height: 1; white-space: nowrap;
  background: var(--rd-fill); color: var(--rd-soft);
}
.rd-pill svg { width: 14px; height: 14px; flex: none; }
.rd-pill[data-tone="success"] { background: var(--rd-success-bg); color: var(--rd-success); }
.rd-pill[data-tone="accent"] { background: var(--rd-accent-bg); color: var(--rd-accent); }
.rd-pill[data-tone="warning"] { background: var(--rd-warning-bg); color: var(--rd-warning); }
.rd-pill[data-tone="danger"] { background: var(--rd-danger-bg); color: var(--rd-danger); }

/* More and Close */
.rd-head-actions { display: flex; align-items: center; gap: 2px; }
.rd-icon-btn {
  flex: none; width: 32px; height: 32px; padding: 0; display: grid; place-items: center;
  border: none; border-radius: 8px; background: none; color: var(--rd-muted); cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 120ms var(--rd-ease);
}
.rd-icon-btn svg { width: 18px; height: 18px; }
.rd-icon-btn:active:not(:focus-visible) { transform: scale(0.97); }
.rd-icon-btn[aria-expanded="true"] { background: var(--rd-fill); color: var(--rd-ink); }

/* The More menu: under its button, right edges aligned. Opened by pointer it fades and scales in from the
   button (origin top right, 150 ms ease-out); by a key it shows at once; it always closes at once */
.rd-menu-wrap { position: relative; display: flex; }
.rd-menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 5; min-width: 200px; padding: 4px;
  border: 1px solid var(--rd-menu-line); border-radius: 10px; background: var(--rd-menu-bg); box-shadow: var(--rd-menu-shadow);
  transform-origin: top right; transition: opacity 150ms var(--rd-ease), transform 150ms var(--rd-ease);
}
.rd-menu[data-state="enter"] { opacity: 0; transform: scale(0.97); transition: none; }
.rd-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px;
  border: none; border-radius: 6px; background: none; text-align: left; white-space: nowrap; cursor: pointer;
  font: inherit; font-size: 0.8125rem; font-weight: 500; color: var(--rd-ink); transition: background-color 150ms ease;
}
.rd-menu-item svg { flex: none; width: 16px; height: 16px; color: var(--rd-muted); }
.rd-menu-item[data-tone="danger"], .rd-menu-item[data-tone="danger"] svg { color: var(--rd-danger); }
/* Focus is the menu's highlight (arrow keys move it), with a ring for the keyboard */
.rd-menu-item:focus { outline: none; background: var(--rd-fill); }
.rd-menu-item[data-tone="danger"]:focus { background: var(--rd-danger-bg); }
.rd-menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--rd-accent); }

/* "Delete this recording?" in the header: Cancel / Delete; then Deleting…, or the error with Retry */
.rd-confirm { margin-top: 14px; }
.rd-confirm-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 10px 10px 14px;
  border-radius: 10px; background: var(--rd-danger-bg);
}
.rd-confirm-text { flex: 1 1 240px; min-width: 0; margin: 0; font-size: 0.8125rem; line-height: 1.45; color: var(--rd-ink); text-wrap: pretty; }
.rd-confirm-text strong { font-weight: 600; }
.rd-confirm-actions { display: flex; gap: 8px; margin-left: auto; }

/* ── Body: two panes, each scrolling on its own (placed by column: the DOM order follows the narrow layout's) ── */
.rd-body {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1.15fr); grid-template-rows: minmax(0, 1fr);
}
.rd-pane { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 24px 24px; scrollbar-width: thin; }
.rd-pane-steps { grid-column: 1; grid-row: 1; border-right: 1px solid var(--rd-line); }
.rd-pane-summary { grid-column: 2; grid-row: 1; }
.rd-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; margin-bottom: 14px; }
.rd-pane-title { margin: 0; font-size: 0.8125rem; font-weight: 600; color: var(--rd-ink); }
.rd-pane-title[tabindex] { outline: none; } /* focus parks here after a move, as on .rd-heading */

/* Run 1 · Run 2: which run's steps and details show */
.rd-seg { display: inline-flex; gap: 2px; min-width: 0; max-width: 70%; padding: 2px; overflow-x: auto; border-radius: 8px; background: var(--rd-fill); scrollbar-width: none; }
.rd-seg-btn {
  flex: none; height: 24px; padding: 0 10px; border: none; border-radius: 6px; background: none;
  font: inherit; font-size: 0.75rem; font-weight: 500; color: var(--rd-muted); white-space: nowrap; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: color 150ms ease, background-color 150ms ease, transform 120ms var(--rd-ease);
}
.rd-seg-btn[aria-pressed="true"] { background: var(--rd-raised); color: var(--rd-ink); box-shadow: var(--rd-raised-ring); }
.rd-seg-btn:active:not(:focus-visible) { transform: scale(0.97); }

/* ── Steps: a timeline with a 1px rail through 28px icon circles ── */
.rd-timeline { list-style: none; margin: 0; padding: 0; }
.rd-step { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; padding-bottom: 16px; }
.rd-step:last-child { padding-bottom: 0; }
.rd-step::before { content: ''; position: absolute; left: 13.5px; top: 0; bottom: 0; width: 1px; background: var(--rd-line); }
.rd-step:first-child::before { top: 14px; }
.rd-step:last-child::before { bottom: auto; height: 14px; }
.rd-step:only-child::before { display: none; }
/* Run steps sit under the step that started the run; the rail runs past them */
.rd-step[data-indent] { grid-template-columns: 20px minmax(0, 1fr); column-gap: 10px; padding-left: 40px; padding-bottom: 12px; }
.rd-step[data-indent]:last-child { padding-bottom: 0; }

.rd-dot {
  --dot-bg: var(--rd-fill); --dot-ink: var(--rd-muted);
  position: relative; z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(var(--dot-bg), var(--dot-bg)) var(--rd-bg); color: var(--dot-ink); /* opaque: the rail stops at it */
}
.rd-dot svg { width: 14px; height: 14px; }
.rd-step[data-indent] .rd-dot { width: 20px; height: 20px; }
.rd-step[data-indent] .rd-dot svg { width: 12px; height: 12px; }
.rd-step[data-tone="success"] .rd-dot { --dot-bg: var(--rd-success-bg); --dot-ink: var(--rd-success); }
.rd-step[data-tone="accent"] .rd-dot { --dot-bg: var(--rd-accent-bg); --dot-ink: var(--rd-accent); }
.rd-step[data-tone="warning"] .rd-dot { --dot-bg: var(--rd-warning-bg); --dot-ink: var(--rd-warning); }
.rd-step[data-tone="danger"] .rd-dot { --dot-bg: var(--rd-danger-bg); --dot-ink: var(--rd-danger); }
.rd-step[data-tone="muted"] .rd-dot { --dot-ink: var(--rd-faint); }

.rd-step-body { min-width: 0; padding-top: 4px; }
.rd-step[data-indent] .rd-step-body { padding-top: 0; }
.rd-step-label { font-size: 0.875rem; font-weight: 500; line-height: 20px; color: var(--rd-ink); overflow-wrap: anywhere; }
.rd-step[data-indent] .rd-step-label { font-size: 0.8125rem; font-weight: 400; color: var(--rd-soft); }
.rd-step[data-tone="muted"] .rd-step-label { color: var(--rd-muted); }
.rd-step[data-kind="end"] .rd-step-label { font-weight: 600; }
.rd-step-detail { margin: 2px 0 0; font-size: 0.8125rem; line-height: 1.5; color: var(--rd-soft); overflow-wrap: anywhere; }
.rd-step-meta { margin-top: 2px; font-size: 0.75rem; line-height: 1.55; color: var(--rd-muted); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.rd-step-error { margin: 4px 0 0; font-size: 0.8125rem; line-height: 1.45; color: var(--rd-danger); overflow-wrap: anywhere; }
/* "Move to a new recording": quiet text at the end of a question's meta line. On pointer devices it shows on
   the row's hover or focus (reserving its room, so nothing shifts); on touch screens it always shows */
.rd-step-actions { white-space: nowrap; }
.rd-step-action {
  display: inline-flex; align-items: center; gap: 4px; margin: -2px -4px; padding: 2px 4px; vertical-align: baseline;
  border: none; border-radius: 4px; background: none; font: inherit; color: var(--rd-muted); cursor: pointer;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 2px;
  transition: color 150ms ease, text-decoration-color 150ms ease, transform 120ms var(--rd-ease);
}
.rd-step-action svg { flex: none; width: 12px; height: 12px; }
.rd-step-action:active:not(:focus-visible):not([aria-disabled="true"]) { transform: scale(0.97); }
.rd-step-action[aria-disabled="true"] { cursor: default; }
/* Another question is moving: these wait, and look it (as .rd-btn does); the one moving stays at full strength */
.rd-step-action[aria-disabled="true"]:not([data-pending]) { opacity: 0.6; }
.rd-tool {
  padding: 1px 5px; border-radius: 4px; background: var(--rd-fill); color: var(--rd-soft); white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.6875rem;
}
.rd-sep { margin: 0 6px; color: var(--rd-faint); }

/* Evidence opens at once: no height animation */
.rd-disclosure {
  display: inline-flex; align-items: center; gap: 2px; margin: 6px 0 0 -4px; padding: 2px 8px 2px 2px;
  border: none; border-radius: 6px; background: none; font: inherit; font-size: 0.75rem; font-weight: 500;
  color: var(--rd-accent); cursor: pointer; transition: background-color 150ms ease, transform 120ms var(--rd-ease);
}
.rd-disclosure svg { width: 14px; height: 14px; }
.rd-disclosure:active:not(:focus-visible) { transform: scale(0.97); }
.rd-evidence { margin-top: 6px; }

/* ── Sources (Summary) and evidence (Steps) ── */
.rd-sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rd-source { min-width: 0; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--rd-line); border-radius: 10px; }
.rd-sources-compact { gap: 6px; }
.rd-sources-compact .rd-source { padding: 8px 10px; border-color: transparent; border-radius: 8px; background: var(--rd-fill); }
.rd-source-title { font-size: 0.8125rem; font-weight: 600; line-height: 1.4; color: var(--rd-ink); overflow-wrap: anywhere; }
a.rd-source-title { width: fit-content; max-width: 100%; border-radius: 4px; text-decoration: none; }
a.rd-source-title svg { width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px; color: var(--rd-faint); }
.rd-source-meta { font-size: 0.75rem; line-height: 1.45; color: var(--rd-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-source-snippet {
  font-size: 0.75rem; line-height: 1.5; color: var(--rd-soft); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Summary ── */
.rd-summary-text { margin: 0; font-size: 0.875rem; line-height: 1.6; color: var(--rd-ink); overflow-wrap: anywhere; text-wrap: pretty; }
.rd-section { margin-top: 22px; }
.rd-label { margin: 0 0 10px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em; color: var(--rd-muted); }
.rd-answer-box { padding: 12px 14px; border-radius: 10px; background: var(--rd-fill); }
.rd-answer {
  font-size: 0.8125rem; line-height: 1.6; color: var(--rd-soft); white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden;
}
.rd-answer[data-open] { display: block; -webkit-line-clamp: unset; overflow: visible; }
.rd-answer-toggle { margin-top: 8px; }

/* The buttons (Open in chat, Stop) wrap under the name when it would get narrower than 120px */
.rd-run { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--rd-line); border-radius: 12px; }
.rd-run-text { flex: 1 1 120px; min-width: 0; }
.rd-run-name { font-size: 0.875rem; font-weight: 600; line-height: 1.4; color: var(--rd-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-run-meta { margin-top: 2px; font-size: 0.75rem; line-height: 1.45; color: var(--rd-muted); font-variant-numeric: tabular-nums; }
.rd-run-actions { flex: none; display: flex; gap: 8px; margin-left: auto; }
/* A stop that didn't go through, under the Run block */
.rd-run-error { margin: 8px 0 0; font-size: 0.8125rem; line-height: 1.45; color: var(--rd-danger); overflow-wrap: anywhere; }
.rd-tone-text { font-weight: 500; }
.rd-tone-text[data-tone="success"] { color: var(--rd-success); }
.rd-tone-text[data-tone="accent"] { color: var(--rd-accent); }
.rd-tone-text[data-tone="warning"] { color: var(--rd-warning); }
.rd-tone-text[data-tone="danger"] { color: var(--rd-danger); }

.rd-pairs { margin: 0; border: 1px solid var(--rd-line); border-radius: 12px; overflow: hidden; }
.rd-pair { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; padding: 9px 12px; font-size: 0.8125rem; line-height: 1.45; }
.rd-pair + .rd-pair { border-top: 1px solid var(--rd-line); }
.rd-pair dt { color: var(--rd-muted); overflow-wrap: anywhere; }
.rd-pair dd { margin: 0; color: var(--rd-ink); overflow-wrap: anywhere; }

.rd-callouts { display: grid; gap: 8px; }
.rd-callout { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--rd-fill); font-size: 0.8125rem; line-height: 1.5; color: var(--rd-soft); }
.rd-callout svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--rd-muted); }
.rd-callout p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.rd-callout[data-tone="warning"] { background: var(--rd-warning-bg); color: var(--rd-ink); }
.rd-callout[data-tone="warning"] svg { color: var(--rd-warning); }

.rd-footnote {
  margin: 28px 0 0; padding-top: 14px; border-top: 1px solid var(--rd-line);
  font-size: 0.75rem; line-height: 1.5; color: var(--rd-muted); text-wrap: pretty;
}

/* ── Controls (press feedback for the pointer only: Enter / Space never animate, a keyboard press is :focus-visible) ── */
.rd-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 12px;
  border: 1px solid var(--rd-line); border-radius: 8px; background: var(--rd-bg);
  font: inherit; font-size: 0.8125rem; font-weight: 500; color: var(--rd-ink); white-space: nowrap; cursor: pointer;
  transition: background-color 150ms ease, transform 120ms var(--rd-ease);
}
.rd-btn:active:not(:focus-visible) { transform: scale(0.97); }
.rd-btn[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.rd-btn[aria-disabled="true"]:active:not(:focus-visible) { transform: none; }
.rd-btn-sm { height: 28px; margin-top: 8px; padding: 0 10px; font-size: 0.75rem; }
/* Delete: the one destructive control (its word says it; the colour only repeats it) */
.rd-btn-danger { border-color: transparent; background: var(--rd-danger); color: var(--rd-bg); }
.rd-link {
  padding: 0; border: none; border-radius: 4px; background: none; text-align: left;
  font: inherit; font-size: 0.8125rem; font-weight: 500; color: var(--rd-accent); cursor: pointer;
  transition: transform 120ms var(--rd-ease);
}
.rd-link:active:not(:focus-visible) { transform: scale(0.98); }
.rd-step .rd-link.rd-step-label { font-weight: 400; color: var(--rd-soft); }

@media (hover: hover) and (pointer: fine) {
  /* The pointer's hover fades it in; reached by the keyboard (or moving, or failed) it is there at once */
  .rd-step-actions { opacity: 0; transition: opacity 150ms ease; }
  .rd-step:hover .rd-step-actions { opacity: 1; }
  .rd-step:focus-within .rd-step-actions, .rd-step-actions[data-shown] { opacity: 1; transition: none; }
  .rd-step-action:not([aria-disabled="true"]):hover { color: var(--rd-ink); text-decoration-color: currentColor; }
  .rd-menu-item:hover { background: var(--rd-fill); }
  .rd-menu-item[data-tone="danger"]:hover { background: var(--rd-danger-bg); }
  .rd-icon-btn:hover { background: var(--rd-fill); color: var(--rd-ink); }
  .rd-seg-btn:hover { color: var(--rd-ink); }
  .rd-disclosure:hover { background: var(--rd-accent-bg); }
  .rd-btn:hover { background: var(--rd-fill); }
  .rd-btn.rd-btn-danger:hover { background: var(--rd-danger); }
  .rd-btn.rd-btn-danger:not([aria-disabled="true"]):hover { filter: brightness(1.08); }
  .rd-link:hover, a.rd-source-title:hover { text-decoration: underline; text-underline-offset: 2px; }
}

.rd-icon-btn:focus-visible, .rd-seg-btn:focus-visible, .rd-disclosure:focus-visible,
.rd-btn:focus-visible, .rd-link:focus-visible, a.rd-source-title:focus-visible, .rd-step-action:focus-visible {
  outline: 2px solid var(--rd-accent); outline-offset: 2px;
}
.rd-icon-btn:focus-visible, .rd-seg-btn:focus-visible { outline-offset: -2px; }

/* ── Loading and error ── */
.rd-skel { display: block; height: 10px; border-radius: 5px; background: var(--rd-fill); }
.rd-skel-thin { height: 8px; }
.rd-skel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.rd-skel-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.rd-skel-dot { width: 28px; height: 28px; border-radius: 50%; }
.rd-skel-lines { display: grid; gap: 7px; padding-top: 4px; }
.rd-skel-block { display: grid; gap: 9px; }
.rd-skel-card { height: 88px; margin-top: 14px; border-radius: 12px; }

.rd-state {
  grid-column: 1 / -1; align-self: center; justify-self: center; max-width: 360px; padding: 40px 24px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.rd-state-icon { width: 40px; height: 40px; margin-bottom: 12px; display: grid; place-items: center; border-radius: 50%; background: var(--rd-fill); color: var(--rd-muted); }
.rd-state-icon svg { width: 18px; height: 18px; }
.rd-state-title { margin: 0; font-size: 0.875rem; font-weight: 600; color: var(--rd-ink); }
.rd-state-hint { margin: 4px 0 0; font-size: 0.8125rem; line-height: 1.45; color: var(--rd-muted); text-wrap: pretty; }
.rd-state .rd-btn { margin-top: 16px; }

.rd-visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* A wrapper the size of its icon (recentDialog.js spinning()): lucide never replaces it, so it keeps turning */
.rd-spin { display: inline-grid; place-items: center; flex: none; animation: rd-spin 0.9s linear infinite; }
@keyframes rd-spin { to { transform: rotate(360deg); } }

/* ── Narrow screens: full height, one column, Summary first (recentDialog.js orderPanes moves it in the DOM, so
   Tab and reading order follow); the header stays while the body scrolls ── */
@media (max-width: 719px) {
  .rd-root { padding: 0; }
  .rd-panel { width: 100%; height: 100%; max-height: none; min-height: 0; border: none; border-radius: 0; }
  .rd-head { padding: 12px 12px 16px 16px; }
  .rd-body { display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
  .rd-pane { flex: none; overflow: visible; padding: 18px 16px 20px; }
  .rd-pane-steps { border-right: none; border-top: 1px solid var(--rd-line); }
  .rd-state { margin: auto; }
}

/* Reduced motion: the fades stay, nothing scales or turns (spinners stand still, as in the Recent tab) */
@media (prefers-reduced-motion: reduce) {
  .rd-root[data-motion="pointer"] .rd-panel { transition-property: opacity; }
  .rd-root[data-state] .rd-panel { transform: none; }
  .rd-menu { transition-property: opacity; }
  .rd-menu[data-state="enter"] { transform: none; }
  .rd-btn:active:not(:focus-visible), .rd-icon-btn:active:not(:focus-visible), .rd-seg-btn:active:not(:focus-visible),
  .rd-disclosure:active:not(:focus-visible), .rd-link:active:not(:focus-visible),
  .rd-step-action:active:not(:focus-visible):not([aria-disabled="true"]) { transform: none; }
  .rd-spin { animation: none; }
}
