/* AiB Platform — the Invoice Extractor's workspace grammar (rd- is its
   short prefix: the reader workspace on /free-tools/invoice-extractor/).
   Loaded by the widget partial itself (_invoice-extractor.html), after
   css/public/public.css and tools.css. The design is the owner-approved
   concept mockup (2026-08-16), spoken in the platform's tokens: paper and
   canvas, the document as a white sheet with a soft shadow, and the three
   semantic statuses doing the talking (--ok read verbatim, --warn derived or
   worth a look, --danger not an invoice). Sodium appears ONLY as the
   running indicator while a file is being read — the site's LIVE
   discipline. Marks are quiet by default (a tinted outline) and turn ink
   when pointed at, so the document stays a document.

   Ladder literals used: 1180 (the file rail folds into a strip above the
   viewer), 1019 (the record panel becomes the bottom sheet — the 1020
   two-column fold), 719 (phone). */

/* ---------- full-bleed sections ---------- */
/* Break out of .public-main's 1080px column; the body's overflow-x clip
   (base.css drift guard) absorbs the scrollbar-width remainder of 100vw. */
.rd-bleed { width: 100vw; margin-inline: calc(50% - 50vw); }

/* ---------- hero: the shared .public-hero--tool, plus a wider lede ---------- */
.rd-hero .public-sub { max-width: 60ch; }
.rd-hero .public-sub b { color: var(--ink); font-weight: 600; }

/* ---------- the workspace band (the hero's own bottom margin spaces it) ---------- */
.rd-ws { background: var(--canvas); border-block: 1px solid var(--hairline); }
.rd-grid {
  max-width: 1480px; margin: 0 auto;
  display: grid; grid-template-columns: 236px minmax(0, 1fr) 412px;
  gap: 0 24px; padding: 24px var(--pad) 40px;
  align-items: start;
}
/* the script marks the section as scripted once it runs; the empty state's
   controls only act through it (see the template's <noscript> line) */
.rd-ws:not(.is-scripted) .rd-drop-btns .btn { opacity: 0.5; pointer-events: none; }
.rd-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.rd-input:focus-visible + .btn { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- rail: the file queue ---------- */
.rd-rail { min-width: 0; position: sticky; top: 84px; }
.rd-rail-t { color: var(--grey); margin: 0 0 8px 2px; font-size: 10px; letter-spacing: 0.12em; }
.rd-file {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 10px; align-items: center;
  width: 100%; text-align: left; background: var(--paper); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: 10px 12px 10px 10px; margin-bottom: 8px;
  box-shadow: var(--shadow-card); cursor: pointer; font: inherit; color: inherit;
  transition: border-color 140ms var(--ease-out);
}
.rd-file:hover { border-color: var(--hairline-strong); }
.rd-file[aria-current="true"] { border-color: var(--ink); }
.rd-file-ico { width: 34px; height: 42px; border-radius: 3px; border: 1px solid var(--hairline-strong); background: var(--white); position: relative; overflow: hidden; grid-row: 1 / span 2; }
.rd-file-ico::before { content: ""; position: absolute; left: 6px; right: 6px; top: 8px; height: 2px; background: var(--hairline-strong); box-shadow: 0 6px 0 var(--hairline), 0 12px 0 var(--hairline), 0 18px 0 var(--hairline), 0 24px 0 var(--hairline); }
.rd-file-ico.is-photo::before { display: none; }
.rd-file-ico.is-photo::after { content: ""; position: absolute; inset: 6px; border-radius: 2px; background: linear-gradient(160deg, #DADCD8 0 60%, #C7C9C4 60%); }
.rd-file-n { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-file-m { font-family: var(--font-mono); font-size: 10.5px; color: var(--grey); display: flex; align-items: center; gap: 6px; min-width: 0; }
.rd-file-m span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-st { display: inline-block; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; }
.rd-st-ok { background: var(--ok); }
.rd-st-warn { background: var(--warn); }
.rd-st-danger { background: var(--danger); }
.rd-st-off { background: var(--grey-dark); }
.rd-st-live { background: var(--sodium); animation: rd-live 1.4s ease-out infinite; }
@keyframes rd-live { 0% { box-shadow: 0 0 0 0 rgba(255, 164, 59, 0.55); } 100% { box-shadow: 0 0 0 7px rgba(255, 164, 59, 0); } }
.rd-file-add { display: block; width: 100%; border: 1px dashed var(--hairline-strong); border-radius: var(--radius-sm); padding: 12px; font-size: 13px; color: var(--grey); text-align: center; cursor: pointer; }
.rd-file-add:hover { color: var(--ink); border-color: var(--ink); }
.rd-rail-quota { margin: 14px 2px 0; font-size: 10.5px; color: var(--grey); line-height: 1.7; text-transform: none; letter-spacing: 0.04em; }

/* ---------- viewer: the pages ---------- */
.rd-viewer { min-width: 0; }
.rd-vtool { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; min-height: 30px; }
.rd-pages { display: inline-flex; border: 1px solid var(--hairline-strong); border-radius: 999px; overflow: hidden; background: var(--paper); }
.rd-pages:empty { display: none; }
.rd-page-tab { padding: 6px 14px; border: 0; background: none; cursor: pointer; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--grey); }
.rd-page-tab + .rd-page-tab { border-left: 1px solid var(--hairline); }
.rd-page-tab[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.rd-vtool-r { display: flex; align-items: center; gap: 8px; }
.rd-tbtn { border: 1px solid var(--hairline-strong); border-radius: 999px; padding: 6px 12px; font-size: 10.5px; color: var(--grey); background: var(--paper); cursor: pointer; }
.rd-tbtn[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
.rd-tbtn:hover { color: var(--ink); }
[data-state="empty"] .rd-vtool { display: none; }

.rd-stage { position: relative; }
.rd-paper-wrap { display: none; }
.rd-paper {
  position: relative; width: min(100%, 760px); margin: 0 auto;
  background: var(--white); box-shadow: 0 2px 6px rgba(13, 14, 19, 0.06), 0 18px 48px rgba(13, 14, 19, 0.10);
  border-radius: 2px; overflow: hidden; display: none;
}
.rd-paper.is-shown { display: block; }
.rd-paper img { display: block; width: 100%; height: auto; }
.rd-paper-empty { aspect-ratio: 1 / 1.4142; display: grid; place-items: center; color: var(--grey); font-size: 14px; text-align: center; padding: 24px; }
.rd-under { margin: 12px auto 0; width: min(100%, 760px); display: flex; justify-content: space-between; gap: 12px; font-size: 10.5px; color: var(--grey); text-transform: none; letter-spacing: 0.04em; }
.rd-under:empty { display: none; }

/* the reading marks */
.rd-marks { position: absolute; inset: 0; pointer-events: none; }
.rd-mark {
  position: absolute; border: 1px solid rgba(46, 125, 91, 0.55); border-radius: 3px;
  background: rgba(46, 125, 91, 0.09); pointer-events: auto; cursor: pointer; padding: 0;
  transition: box-shadow 140ms var(--ease-out), background 140ms var(--ease-out), border-color 140ms var(--ease-out);
}
.rd-mark.warn { border-color: rgba(169, 107, 31, 0.6); background: rgba(169, 107, 31, 0.12); }
.rd-mark.is-hot, .rd-mark.is-sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 0 0 4px rgba(13, 14, 19, 0.10); background: rgba(46, 125, 91, 0.20); z-index: 2; }
.rd-mark.warn.is-hot, .rd-mark.warn.is-sel { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn), 0 0 0 4px rgba(169, 107, 31, 0.14); background: rgba(169, 107, 31, 0.24); }
.rd-mark.is-sel { animation: rd-sel 900ms var(--ease-out) 1; }
@keyframes rd-sel { 0% { box-shadow: 0 0 0 0 rgba(13, 14, 19, 0.28); } 100% { box-shadow: 0 0 0 10px rgba(13, 14, 19, 0); } }
.rd-mark::after {
  content: attr(data-cap); position: absolute; left: -1px; bottom: calc(100% + 3px);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--ink); color: var(--paper); padding: 2px 6px; border-radius: 3px; white-space: nowrap;
  opacity: 0; transform: translateY(2px); transition: opacity 120ms, transform 120ms var(--ease-out);
}
.rd-mark.warn::after { background: var(--warn); }
.rd-mark.is-hot::after, .rd-mark.is-sel::after { opacity: 1; transform: none; }
.rd-stage.marks-off .rd-mark { opacity: 0; pointer-events: none; }

/* processing: the reading sweep over the page */
.rd-scan { position: absolute; inset: 0; pointer-events: none; display: none; }
.rd-stage.is-scanning .rd-scan { display: block; }
.rd-scan::before { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--sodium); box-shadow: 0 0 18px 4px rgba(255, 164, 59, 0.35); animation: rd-sweep 2.6s var(--ease-out) infinite; }
.rd-scan::after { content: ""; position: absolute; left: 0; right: 0; height: 22%; background: linear-gradient(to bottom, rgba(255, 164, 59, 0.10), rgba(255, 164, 59, 0)); animation: rd-sweep 2.6s var(--ease-out) infinite; }
@keyframes rd-sweep { 0% { top: -2%; } 100% { top: 100%; } }
.rd-stage.is-scanning .rd-marks { display: none; }

/* state visibility: what the stage shows */
[data-state="empty"] .rd-drop { display: grid; }
.rd-drop { display: none; }
[data-state="reading"] .rd-paper-wrap, [data-state="answered"] .rd-paper-wrap { display: block; }
[data-state="empty"] .rd-rail, [data-state="empty"] .rd-under { display: none; }
[data-state="empty"] .rd-grid { grid-template-columns: minmax(0, 1fr) 412px; }

/* the empty state: the drop zone IS the form */
.rd-drop {
  width: min(100%, 760px); margin: 0 auto; min-height: 520px;
  border: 1.5px dashed var(--hairline-strong); border-radius: var(--radius); background: var(--paper);
  place-items: center; text-align: center; padding: 32px;
  transition: border-color 140ms var(--ease-out), background 140ms var(--ease-out);
}
.rd-drop:hover, .rd-drop.is-over { border-color: var(--ink); }
.rd-drop.is-over { background: var(--white); }
.rd-drop-in { max-width: 40ch; }
.rd-drop-ico { width: 56px; height: 68px; margin: 0 auto 18px; border: 1.5px solid var(--ink); border-radius: 4px; position: relative; background: var(--white); }
.rd-drop-ico::before { content: ""; position: absolute; left: 10px; right: 10px; top: 14px; height: 2px; background: var(--ink); box-shadow: 0 8px 0 var(--hairline-strong), 0 16px 0 var(--hairline-strong), 0 24px 0 var(--hairline-strong); }
.rd-drop-ico::after { content: ""; position: absolute; right: 12px; bottom: 10px; width: 14px; height: 8px; border: 1.5px solid var(--ok); border-radius: 2px; background: var(--ok-face); }
.rd-drop-title { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -0.01em; margin: 0; }
.rd-drop-sub { color: var(--grey); margin: 8px 0 0; font-size: 14px; }
.rd-drop-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.rd-drop-fmt { font-size: 10.5px; color: var(--grey-dark); margin-top: 18px; }

/* ---------- record panel ---------- */
.rd-record { min-width: 0; }
.rd-panel {
  position: sticky; top: 84px;
  background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow-card);
  max-height: calc(100vh - 84px - 24px);
  max-height: calc(100dvh - 84px - 24px);
  display: flex; flex-direction: column;
}
.rd-panel-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 20px 22px 8px; min-height: 0; flex: 1 1 auto; }
.rd-sheet-grip, .rd-sheet-close, .rd-sheet-fab { display: none; }
.rd-p-file { font-size: 10.5px; color: var(--grey); margin: 0; overflow-wrap: anywhere; text-transform: none; }
.rd-p-title { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.01em; margin: 4px 0 0; line-height: 1.1; }
.rd-verdict { display: inline-flex; align-items: center; gap: 9px; border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 14px; margin-top: 12px; }
.rd-verdict::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.rd-verdict-ok { background: var(--ok-face); color: var(--ok); }
.rd-verdict-warn { background: var(--warn-face); color: var(--warn); }
.rd-verdict-danger { background: var(--danger-face); color: var(--danger); }
.rd-verdict-muted { background: var(--canvas); color: var(--grey); }
.rd-verdict-live { background: var(--canvas); color: var(--ink); }
.rd-verdict-live::before { background: var(--sodium); animation: rd-live 1.4s ease-out infinite; }
.rd-lead { margin: 12px 0 0; font-size: 14px; color: var(--grey); max-width: 44ch; }
.rd-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.rd-ck { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; border-radius: 6px; padding: 4px 8px; border: 1px solid var(--hairline); color: var(--grey); background: var(--white); }
.rd-ck.ok { color: var(--ok); border-color: rgba(46, 125, 91, 0.35); background: var(--ok-face); }
.rd-ck.warn { color: var(--warn); border-color: rgba(169, 107, 31, 0.35); background: var(--warn-face); }
.rd-ck.info { color: var(--info); border-color: rgba(61, 99, 159, 0.35); background: var(--info-face); }

.rd-grp { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.rd-grp-t { display: flex; justify-content: space-between; align-items: baseline; font-size: 10px; letter-spacing: 0.12em; color: var(--grey); margin: 0 0 6px; }
.rd-grp-t small { letter-spacing: 0.04em; color: var(--grey-dark); text-transform: none; }
.rd-fld {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 0 10px; align-items: baseline;
  padding: 6px 8px; margin: 0 -8px; border-radius: 8px; cursor: default;
  transition: background 120ms var(--ease-out);
}
.rd-fld.has-mark { cursor: pointer; }
.rd-fld:hover, .rd-fld.is-hot { background: var(--canvas); }
.rd-fld.is-sel { background: var(--canvas); box-shadow: inset 2px 0 0 var(--ink); }
.rd-fld-k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey); padding-top: 3px; }
.rd-fld-v { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.rd-fld-v.big { font-weight: 700; font-size: 16px; }
.rd-fld-v small { color: var(--grey); font-weight: 400; font-size: 12px; }
.rd-fld-v.is-empty { color: var(--grey-dark); font-weight: 400; }
.rd-src { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; white-space: nowrap; border-radius: 5px; padding: 2px 6px; align-self: center; }
.rd-src-ok { color: var(--ok); background: var(--ok-face); }
.rd-src-warn { color: var(--warn); background: var(--warn-face); }
.rd-src-none { color: var(--grey-dark); background: transparent; border: 1px dashed var(--hairline-strong); }
.rd-lines { width: 100%; border-collapse: collapse; margin-top: 2px; font-variant-numeric: tabular-nums; }
.rd-lines th { font-family: var(--font-mono); font-weight: 500; font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey-dark); text-align: left; padding: 2px 6px 6px; }
.rd-lines th.n, .rd-lines td.n { text-align: right; }
.rd-lines td { padding: 6px 6px; border-top: 1px solid var(--hairline); font-size: 13px; vertical-align: top; }
.rd-lines tr.rd-row.has-mark { cursor: pointer; }
.rd-lines tr.rd-row:hover td, .rd-lines tr.is-hot td, .rd-lines tr.is-sel td { background: var(--canvas); }
.rd-lines tr.is-sel td:first-child { box-shadow: inset 2px 0 0 var(--ink); }
.rd-lines tr.is-off td { color: var(--warn); }
.rd-lines .mn { font-family: var(--font-mono); font-size: 12px; }
.rd-sum-note { margin: 8px 0 0; font-size: 12.5px; color: var(--ok); display: flex; gap: 6px; align-items: baseline; }
.rd-sum-note.warn { color: var(--warn); }
.rd-note { border: 1px solid var(--hairline); border-left: 3px solid var(--warn); border-radius: 8px; background: var(--white); padding: 10px 12px; font-size: 13px; color: var(--ink); margin-top: 6px; }
.rd-note.info { border-left-color: var(--info); }
.rd-panel-meta { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--hairline); font-family: var(--font-mono); font-size: 11px; color: var(--grey); line-height: 1.7; }

.rd-export { border-top: 1px solid var(--hairline); padding: 14px 22px 16px; background: var(--paper); border-radius: 0 0 var(--radius) var(--radius); }
.rd-export-t { font-size: 10px; letter-spacing: 0.12em; color: var(--grey); margin: 0 0 8px; }
.rd-export-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rd-export-cta { margin: 12px 0 0; font-size: 13px; color: var(--grey); }
.rd-export-cta a { color: var(--ink); }

/* processing narration */
.rd-steps { list-style: none; margin: 14px 0 0; padding: 0; }
.rd-steps li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--hairline); font-size: 14px; }
.rd-steps li:last-child { border-bottom: 0; }
.rd-steps .ic { width: 12px; height: 12px; border-radius: 50%; display: inline-block; align-self: center; }
.rd-steps .done .ic { background: var(--ok-face); border: 1.5px solid var(--ok); position: relative; }
.rd-steps .done .ic::after { content: ""; position: absolute; left: 3px; top: 1px; width: 3px; height: 6px; border: solid var(--ok); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.rd-steps .live .ic { background: var(--sodium); animation: rd-live 1.4s ease-out infinite; }
.rd-steps .todo { color: var(--grey); }
.rd-steps .todo .ic { border: 1.5px dashed var(--hairline-strong); }
.rd-skel { height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--canvas) 0%, #ECECEA 40%, var(--canvas) 80%); background-size: 200% 100%; animation: rd-shimmer 1.6s linear infinite; margin: 10px 0; }
@keyframes rd-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* the empty panel: what you'll see */
.rd-what h3 { font-family: var(--font-display); font-weight: 800; font-size: 20px; margin: 4px 0 0; letter-spacing: -0.01em; }
.rd-what-row { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.rd-what-row:last-of-type { border-bottom: 0; }
.rd-what-k { font-size: 10px; letter-spacing: 0.12em; color: var(--grey-dark); padding-top: 3px; }
.rd-what-row p { margin: 0; font-size: 13.5px; color: var(--grey); }
.rd-what-row p b { color: var(--ink); font-weight: 600; }

/* ---------- under the workspace ---------- */
.rd-method { padding: clamp(36px, 6vw, 64px) 0 0; }
.rd-method h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -0.01em; margin: 0 0 6px; }
.rd-method-sub { color: var(--grey); max-width: 60ch; margin: 0 0 26px; }
.rd-method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rd-m-card { border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--paper); padding: 20px; box-shadow: var(--shadow-card); }
.rd-m-card h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.rd-m-card p { margin: 0; color: var(--grey); font-size: 13.5px; }
.rd-m-num { font-size: 11px; color: var(--grey-dark); letter-spacing: 0.1em; display: block; margin-bottom: 10px; }
.rd-warning { margin-top: clamp(24px, 4vw, 40px); }
.rd-warning-inner {
  border: 1px solid var(--hairline); border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm); background: var(--paper);
  padding: 16px 20px; color: var(--grey); font-size: 13.5px; max-width: 76ch; margin: 0;
}
.rd-warning-inner b { color: var(--ink); }
.tool-widget--canvas .trust-line { margin-top: 18px; }

/* ---------- keyboard ---------- */
.rd-file:focus-visible, .rd-page-tab:focus-visible, .rd-tbtn:focus-visible, .rd-mark:focus-visible,
.rd-fld:focus-visible, .rd-row:focus-visible, .rd-sheet-grip:focus-visible, .rd-sheet-close:focus-visible,
.rd-sheet-fab:focus-visible, .rd-file-add:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}

/* ---------- laptop: the rail folds into a strip ---------- */
@media (max-width: 1180px) {
  .rd-grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 0 20px; }
  .rd-rail { position: static; grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; margin-bottom: 14px; overflow-x: auto; padding-bottom: 4px; }
  .rd-rail-t { display: none; }
  #rd-queue { display: contents; }
  .rd-file { width: auto; min-width: 210px; margin: 0; flex: 0 0 auto; }
  .rd-file-add { width: auto; flex: 0 0 auto; padding: 12px 16px; }
  .rd-rail-quota { margin: 0 0 0 auto; white-space: nowrap; }
  .rd-fld { grid-template-columns: 88px minmax(0, 1fr) auto; }
}

/* ---------- tablet & phone: the record becomes a bottom sheet ---------- */
@media (max-width: 1019px) {
  .rd-grid, [data-state="empty"] .rd-grid { grid-template-columns: minmax(0, 1fr); padding-left: 8px; padding-right: 8px; }
  .rd-record { position: static; }
  /* The side panel becomes a bottom sheet that exists ONLY while the record
     is being read: off-screen until the button or a mark opens it; Close,
     the grip, Escape or a swipe down put it back. It never peeks (the sea
     sheet's lesson: a fixed peek rides over the method cards and the
     footer). `top: auto` beats the desktop sticky top in the
     over-constrained box; z 61 keeps it above the cookie pill. */
  .rd-panel {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 61;
    margin: 0 auto; max-width: 560px; max-height: 82dvh;
    border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0;
    box-shadow: 0 12px 40px rgba(13, 14, 19, 0.14);
    transform: translateY(calc(100% + 48px));
    visibility: hidden;
    transition: transform 260ms var(--ease-out), visibility 0s linear 260ms;
  }
  .rd-panel.is-open { transform: none; visibility: visible; transition-delay: 0s; }
  .rd-sheet-open .cookie-note { opacity: 0; pointer-events: none; transition: opacity 200ms; }
  /* the empty state's "what you'll see" is not a sheet — it sits under the drop zone */
  [data-state="empty"] .rd-panel { position: static; transform: none; visibility: visible; max-height: none; border-radius: var(--radius); border-bottom: 1px solid var(--hairline); box-shadow: var(--shadow-card); margin-top: 16px; }
  [data-state="empty"] .rd-sheet-grip, [data-state="empty"] .rd-sheet-close { display: none; }
  .rd-panel-scroll { padding: 6px 18px 8px; }
  .rd-sheet-grip { display: block; width: 100%; border: 0; background: none; cursor: pointer; padding: 6px 0 8px; text-align: center; }
  .rd-sheet-grip::before { content: ""; display: inline-block; width: 44px; height: 4px; border-radius: 999px; background: var(--hairline-strong); }
  .rd-sheet-close { display: block; position: absolute; top: 12px; right: 14px; border: 0; background: none; cursor: pointer; font-size: 12px; color: var(--grey); padding: 4px 8px; }
  /* bottom-right: the cookie pill owns the bottom-left corner */
  .rd-sheet-fab {
    display: inline-flex; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 55;
    align-items: center; gap: 8px; border: 0; cursor: pointer; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 11px 18px;
    font: inherit; font-size: 14px; font-weight: 600; box-shadow: 0 12px 40px rgba(13, 14, 19, 0.14); white-space: nowrap;
  }
  .rd-sheet-fab[hidden], .rd-panel.is-open ~ .rd-sheet-fab { display: none; }
  .rd-fab-n { font-size: 11px; color: rgba(250, 250, 249, 0.7); letter-spacing: 0.04em; text-transform: none; }
  .rd-ws { padding-bottom: 60px; }
  .rd-mark::after { font-size: 9px; }
  .rd-export { padding: 12px 18px 14px; }
  .rd-method-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 719px) {
  .rd-vtool { gap: 8px; }
  .rd-file { min-width: 180px; }
  .rd-drop { min-height: 0; padding: 36px 20px; }
  .rd-drop-title { font-size: 22px; }
  .rd-fld { grid-template-columns: 82px minmax(0, 1fr) auto; }
  .rd-rail-quota { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rd-panel, .rd-mark, .rd-file, .rd-fld { transition: none; }
  .rd-st-live, .rd-verdict-live::before, .rd-steps .live .ic, .rd-scan::before, .rd-scan::after, .rd-skel, .rd-mark.is-sel { animation: none; }
}
