/* ── Round 365 (5 October 2026): the done screen, drawn again from nothing ───────────────────────────────────────────────────────────
   Sergio, on the published screen: "se ve horrible, los textos sobrepuestos, en tamaños incorrectos, todo apretadísimo". The video's
   preview carried seven things at once on a frame 190 px wide (a chip, a seal, the name plate, a tick over the face, the captions, a
   Full screen pill, the mark), and beside it a line, a card and three closed rows shared 470 px.

   Now the screen holds two objects. The video, larger and clean: only what the file itself carries (its captions, its name plate, the AI
   label and the mark along the bottom edge); Full screen sits under it and a press on the video opens it too. And one card that answers
   "Where should it go?": four tabs with a pill that slides under the chosen one, and one panel of fixed height under them, so nothing is
   hidden behind a closed row and nothing moves when a tab changes. The approval's record is the line over the title, with a tick that
   draws itself as the screen arrives. On a phone the video is a small still beside the title and everything fits the window.

   Loaded after glass.css: these rules have the last word on the parts of this screen. The hooks are the old ones (.dest-card,
   .dest-head, .dest-opts, .dchip, #doneShare, .patient-*), restyled here inside [data-step="done"]. */

@property --seal-a { syntax:'<angle>'; inherits:false; initial-value:0deg; }

/* the screen keeps one height whatever tab is open, so it can sit in the middle of the window (it used to hang from the top, so that an
   opening row would not move it) */
[data-step="done"] { align-self:center; max-width:980px; padding:var(--sp-3) var(--sp-8) var(--sp-8); text-align:left;
  /* the sizes a short window tightens (see "a short window" below): the title, the air over the card and under it, a tab, the panel, the QR */
  --d-q:clamp(36px, 2.1vw + 16px, 48px); --d-air:var(--sp-6); --d-ap:var(--sp-4); --d-tab:76px; --d-panel:194px; --d-sq:132px; }
/* In the page the parts come in the order they are read and reached with the keyboard: the words (approved), the video, the card, what
   next. Here the video takes the left column, whole height; the other three sit in the right one, held in its middle by the two free rows */
[data-step="done"] .done { display:grid; grid-template-columns:auto minmax(0, 500px); grid-template-rows:1fr auto auto auto 1fr; justify-content:center; gap:0 clamp(32px, 5.2vw, 76px); width:100%; margin:0; text-align:left; }
[data-step="done"] .done-stage { grid-area:1 / 1 / -1 / 2; align-self:center; }
[data-step="done"] .done-head { grid-area:2 / 2; }
[data-step="done"] .dests { grid-area:3 / 2; }
[data-step="done"] .actions { grid-area:4 / 2; }

/* ── the video ── */
[data-step="done"] .done-stage { display:flex; flex-direction:column; align-items:center; gap:var(--sp-1); min-width:0; }
[data-step="done"] .done-frame { position:relative; isolation:isolate; }
/* the light the video casts on the page under it */
[data-step="done"] .done-frame::before { content:''; position:absolute; inset:14% 2% -5%; z-index:-1; border-radius:40%; background:radial-gradient(closest-side, rgba(var(--op-accent-rgb), .5), transparent); filter:blur(30px); opacity:.5; pointer-events:none; }
/* approved, sealed: one line of light runs round the frame once, after a fresh approval (app.js sets .sealed) */
[data-step="done"] .done-frame::after { content:''; position:absolute; inset:-4px; z-index:2; border-radius:32px; padding:2px; background:conic-gradient(from var(--seal-a), transparent 0deg 236deg, rgba(var(--op-accent-rgb), .0) 236deg, rgba(var(--op-accent-rgb), .95) 330deg, #fff 354deg, transparent 360deg); -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite:xor; mask:linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); opacity:0; pointer-events:none; }
[data-step="done"] .done.sealed .done-frame::after { animation:doneSeal 1.5s cubic-bezier(.45, 0, .2, 1) .6s both; }
@keyframes doneSeal { 0% { --seal-a:-90deg; opacity:0; } 10% { opacity:1; } 78% { opacity:1; } 100% { --seal-a:270deg; opacity:0; } }

[data-step="done"] .done .phone { height:clamp(300px, calc((100dvh - var(--tb-h) - var(--banner-h, 0px) - 176px) / var(--zoom, 1)), 560px); margin:0; border:0; border-radius:28px; cursor:zoom-in; background-clip:border-box;
  box-shadow:0 0 0 1px rgba(var(--op-line), .12), 0 2px 6px rgba(27,25,38,.08), 0 30px 60px -30px rgba(27,25,38,.55); transition:translate 320ms var(--ease-out), box-shadow 320ms var(--ease-out); }
@media (hover:hover) and (pointer:fine) { [data-step="done"] .done .phone:hover { translate:0 -3px; box-shadow:0 0 0 1px rgba(var(--op-line), .14), 0 2px 6px rgba(27,25,38,.08), 0 38px 70px -30px rgba(27,25,38,.6); } }
/* on the frame: only what the file carries. The approval is said beside it, so the "Reviewed by" chip stays in the full-screen viewer */
#donePhone .phone-seal { display:none; }
#donePhone .phone-ai { top:auto; right:auto; left:12px; bottom:12px; z-index:5; }
#donePhone .phone-mark { top:auto; left:auto; right:14px; bottom:16px; z-index:5; }
#donePhone .phone-withdrawn { top:14px; }

/* Full screen: under the video, never on it */
[data-step="done"] .done-stage > .phone-expand { position:static; display:inline-flex; align-items:center; gap:var(--sp-2); height:44px; min-height:44px; margin-top:var(--sp-1); padding:0 var(--sp-4); border:0; border-radius:999px; background:transparent; -webkit-backdrop-filter:none; backdrop-filter:none; box-shadow:none; opacity:1; transform:none; color:var(--t-400); font-size:var(--fs-small); font-weight:500; cursor:pointer; transition:color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), scale var(--dur-fast) var(--ease-out); }
[data-step="done"] .done-stage > .phone-expand i { font-size:17px; }
@media (hover:hover) { [data-step="done"] .done-stage > .phone-expand:hover, [data-step="done"] .done-stage:has(.phone:hover) > .phone-expand { color:var(--t-100); background:var(--hover-tint, rgba(var(--op-line), .05)); transform:none; } }
[data-step="done"] .done-stage > .phone-expand:active { scale:.96; }

/* ── the words ── */
/* The approval comes before anything is offered, and it is said first. After a fresh approval: the title "Approved" with its tick, who
   and when under it. Opened from Content: the line over the video's name ("Approved by …", or "Withdrawn"). Then, apart, the question
   that belongs to the card. The tick is drawn as the screen arrives. */
[data-step="done"] .done-head { display:flex; flex-direction:column; align-items:stretch; min-width:0; text-align:left; }
[data-step="done"] .done-head > .approval { order:0; }
[data-step="done"] .done-head > .q { order:1; }
[data-step="done"] .done-head > .sub { order:2; }
[data-step="done"] .done[data-from="approval"] .done-head > .q { order:0; }
[data-step="done"] .done[data-from="approval"] .done-head > .approval { order:1; margin:var(--sp-3) 0 0; font-size:15px; }
[data-step="done"] .approval { display:flex; align-items:flex-start; gap:var(--sp-2); margin:0 0 var(--d-ap); font-size:var(--fs-small); line-height:22px; color:var(--t-500); text-wrap:pretty; }
[data-step="done"] .approval .ap-off { flex:none; display:grid; place-items:center; width:22px; height:22px; font-size:19px; color:var(--t-400); }
[data-step="done"] .approval:empty { display:none; }
[data-step="done"] .ap-seal { flex:none; width:22px; height:22px; color:var(--sem-green); --seal-ink:#fff; }
html.op-dark [data-step="done"] .ap-seal { --seal-ink:var(--s-0); }
[data-step="done"] .ap-seal svg { display:block; width:100%; height:100%; overflow:visible; }
[data-step="done"] .ap-ring { fill:currentColor; transform-box:fill-box; transform-origin:center; }
[data-step="done"] .ap-tick { stroke:var(--seal-ink); stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:14; stroke-dashoffset:0; }
[data-step="done"] .done.arriving .ap-ring { animation:doneRing 480ms var(--ease-out) 380ms both; }
[data-step="done"] .done.arriving .ap-tick { animation:doneTick 420ms var(--ease-out) 700ms both; }
@keyframes doneRing { from { scale:.3; opacity:0; } to { scale:1; opacity:1; } }
@keyframes doneTick { from { stroke-dashoffset:14; } to { stroke-dashoffset:0; } }
[data-step="done"] .ap-t { flex:1 1 auto; display:flex; flex-wrap:wrap; align-items:baseline; column-gap:var(--sp-2); min-width:0; }
[data-step="done"] .ap-t b { display:inline; font-size:inherit; font-weight:600; color:var(--t-150); }
/* beside the name when it fits, on a line of its own when it is long, and never a third line: the whole record is in Details */
[data-step="done"] .ap-t small { flex:0 1 auto; min-width:0; display:block; margin:0; font-size:inherit; color:var(--t-500); font-variant-numeric:tabular-nums; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

[data-step="done"] .q { display:flex; align-items:center; gap:.3em; margin:0; font-size:var(--d-q); font-weight:600; letter-spacing:-.028em; line-height:1.06; text-wrap:balance; }
[data-step="done"] .q:focus, [data-step="done"] .q:focus-visible { outline:none; }
[data-step="done"] #doneTitle { min-width:0; text-wrap:balance; }
/* the title's own seal, only when the title is "Approved" */
[data-step="done"] .done-seal { display:none; width:.84em; height:.84em; }
[data-step="done"] .done[data-from="approval"] .done-seal { display:block; }
[data-step="done"] .done[data-from="approval"] .done-seal .ap-tick { stroke-width:2.4; }
[data-step="done"] .done[data-from="content"] .q { font-size:clamp(26px, 1.1vw + 16px, 32px); letter-spacing:-.02em; line-height:1.14; }
/* the question, a step apart from the approval and close to the card it belongs to */
[data-step="done"] .sub { margin:var(--d-air) 0 0; max-width:42ch; font-size:17px; line-height:1.5; color:var(--t-200); text-wrap:pretty; }
[data-step="done"] .done[data-from="content"] .sub { margin-top:var(--sp-3); color:var(--t-400); }

/* ── the card: four tabs, one panel ── */
[data-step="done"] .dests { --door:0; position:relative; display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); column-gap:4px; width:100%; margin-top:var(--sp-3); padding:6px; gap:0 4px; border-radius:26px; background:var(--g-fill-up); box-shadow:var(--g-rim), 0 0 0 1px var(--line), 0 1px 2px rgba(27,25,38,.04), 0 28px 60px -38px rgba(var(--op-accent-rgb), .55); }
/* the track the pill runs on */
[data-step="done"] .dests::before { content:''; grid-area:1 / 1 / 2 / -1; border-radius:20px; background:rgba(var(--op-line), .05); }
[data-step="done"] .dest-pill { grid-area:1 / 1; margin:4px; border-radius:16px; background:var(--s-1); box-shadow:0 0 0 1px rgba(var(--op-line), .06), 0 1px 2px rgba(27,25,38,.08), 0 8px 18px -10px rgba(27,25,38,.32); translate:calc(var(--door) * (100% + 12px)) 0; transition:translate 520ms var(--ease-out); pointer-events:none; }
html.op-dark [data-step="done"] .dest-pill { background:var(--s-3); box-shadow:0 0 0 1px rgba(255,255,255,.06), 0 8px 18px -10px rgba(0,0,0,.6); }
[data-step="done"] .dests.snap .dest-pill { transition:none; }
[data-step="done"] .dest-card { display:contents; }
/* three doors when posting is off (SOCIAL in app.js): the track and the pill keep their proportions */
[data-step="done"] .dests:not(:has(> .dest-card:nth-of-type(4))) { grid-template-columns:repeat(3, minmax(0, 1fr)); }
[data-step="done"] .dest-tab { grid-row:1; position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; width:auto; min-width:0; min-height:var(--d-tab); padding:var(--sp-2) var(--sp-1); border:0; border-radius:16px; background:transparent; color:var(--t-500); text-align:center; cursor:pointer; transition:color 240ms var(--ease-out), scale var(--dur-fast) var(--ease-out); }
[data-step="done"] .dest-card:nth-of-type(1) .dest-tab { grid-column:1; }
[data-step="done"] .dest-card:nth-of-type(2) .dest-tab { grid-column:2; }
[data-step="done"] .dest-card:nth-of-type(3) .dest-tab { grid-column:3; }
[data-step="done"] .dest-card:nth-of-type(4) .dest-tab { grid-column:4; }
[data-step="done"] .dest-tab::after { display:none; }
[data-step="done"] .dest-tab:hover { background:transparent; color:var(--t-200); }
[data-step="done"] .dest-tab:active { scale:.96; transform:none; }
[data-step="done"] .dest-tab[aria-expanded="true"] { color:var(--t-100); }
/* a door that is shut until the video is approved again */
[data-step="done"] .dest-tab:disabled { opacity:.42; cursor:not-allowed; }
[data-step="done"] .dest-tab:disabled:hover { color:var(--t-500); }
[data-step="done"] .dest-tab > i:first-child { flex:none; display:block; width:auto; height:auto; border-radius:0; background:none; font-size:24px; line-height:1; color:inherit; transition:color 240ms var(--ease-out), translate 320ms var(--ease-out); }
[data-step="done"] .dest-tab[aria-expanded="true"] > i:first-child { color:var(--accent); translate:0 -1px; }
[data-step="done"] .dest-tab > span { flex:none; display:block; min-width:0; max-width:100%; }
[data-step="done"] .dest-tab strong { position:relative; display:block; font-size:13.5px; font-weight:600; line-height:18px; letter-spacing:-.005em; color:inherit; white-space:nowrap; }
/* what a door is, said once: in its panel's first line (.dest-lead). In the tab it is for a screen reader */
[data-step="done"] .dest-tab small { position:absolute; width:1px; height:1px; margin:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
/* a door the plan does not include keeps its mark: a small lock by the icon; the plan's notice is the panel */
[data-step="done"] .dest-tab .plan-tag { position:absolute; left:calc(50% + 8px); top:-31px; margin:0; padding:3px; gap:0; font-size:0; line-height:0; border-radius:99px; color:#fff; background:var(--accent); box-shadow:0 0 0 2px var(--s-1); }
[data-step="done"] .dest-tab .plan-tag i { font-size:10px; }

[data-step="done"] .dest-opts { grid-row:2; grid-column:1 / -1; display:flex; flex-direction:column; flex-wrap:nowrap; justify-content:center; gap:var(--sp-3); min-height:var(--d-panel); margin:0; padding:var(--sp-4) var(--sp-4) var(--sp-3); border:0; border-radius:0; background:none; box-shadow:none; animation:none; }
[data-step="done"] .dest-opts[hidden] { display:none; }
[data-step="done"] .dest-lead { margin:0; font-size:var(--fs-small); line-height:20px; color:var(--t-500); text-align:center; }
[data-step="done"] .dest-tiles { display:flex; justify-content:center; gap:var(--sp-1); }
[data-step="done"] .dest-gate { padding:0; }
[data-step="done"] .dest-gate .plan-gate { flex-wrap:wrap; padding:var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4); }
[data-step="done"] .dest-gate .plan-gate p { flex:1 1 220px; }

/* a destination: an icon in its well, its name, and what happened to it */
[data-step="done"] .dest-tiles .dchip:not(#_) { position:relative; flex:0 1 108px; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:0; min-width:0; height:auto; min-height:112px; padding:var(--sp-3) 2px var(--sp-2); border:0; border-radius:20px; background:transparent; box-shadow:none; color:var(--t-150); font-size:13.5px; font-weight:500; line-height:18px; text-align:center; transform:none; transition:background-color var(--dur-fast) var(--ease-out), scale var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
[data-step="done"] .dest-tiles .dchip > i { flex:none; display:grid; place-items:center; width:52px; height:52px; margin-bottom:var(--sp-2); border-radius:18px; background:var(--s-3); box-shadow:inset 0 0 0 1px rgba(var(--op-line), .04); font-size:25px; color:var(--t-200); transition:background-color 200ms var(--ease-out), color 200ms var(--ease-out), translate 280ms var(--ease-out), box-shadow 280ms var(--ease-out); }
[data-step="done"] .dest-tiles .dchip > span { max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
[data-step="done"] .dest-tiles .dchip small, [data-step="done"] .dest-tiles .dchip small:empty { display:block; min-height:16px; margin-top:1px; font-family:var(--font-sans); font-size:var(--fs-caption); font-weight:500; line-height:16px; letter-spacing:0; text-transform:none; color:var(--t-500); }
@media (hover:hover) and (pointer:fine) {
  [data-step="done"] .dest-tiles .dchip:not(#_):hover { transform:none; box-shadow:none; background:transparent; color:var(--t-100); }
  [data-step="done"] .dest-tiles .dchip:hover > i { translate:0 -3px; background:color-mix(in srgb, var(--accent) 12%, var(--s-1)); color:var(--accent); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent), 0 12px 20px -14px rgba(var(--op-accent-rgb), .7); }
}
[data-step="done"] .dest-tiles .dchip:active { scale:.96; }
[data-step="done"] .dest-tiles .dchip:disabled { opacity:1; }
[data-step="done"] .dest-tiles .dchip[data-done]:not(#_) { background:transparent; color:var(--t-150); }
[data-step="done"] .dest-tiles .dchip[data-done] > i { background:color-mix(in srgb, var(--sem-green) 13%, var(--s-1)); color:var(--sem-green); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--sem-green) 22%, transparent); translate:none; }
[data-step="done"] .dest-tiles .dchip[data-done] small { color:var(--sem-green); }
/* an account that is not connected yet: the well is an outline, and a small plus says what a press does */
[data-step="done"] .dest-tiles .dchip[data-off]:not(#_) { border:0; background:transparent; color:var(--t-300); }
[data-step="done"] .dest-tiles .dchip[data-off] > i { background:transparent; box-shadow:inset 0 0 0 1.5px rgba(var(--op-line), .16); color:var(--t-400); }
[data-step="done"] .dest-tiles .dchip .dchip-plug { position:absolute; top:7px; left:calc(50% + 15px); display:grid; place-items:center; width:20px; height:20px; margin:0; border-radius:99px; background:var(--s-1); box-shadow:0 0 0 1px rgba(var(--op-line), .12), 0 2px 5px -2px rgba(27,25,38,.3); color:var(--t-400); font-size:11px; transition:background-color 200ms var(--ease-out), color 200ms var(--ease-out); }
@media (hover:hover) and (pointer:fine) { [data-step="done"] .dest-tiles .dchip:hover .dchip-plug { background:var(--accent); color:#fff; } }
[data-step="done"] .dest-tiles .dchip .dchip-plug i { color:inherit; font-size:11px; }

/* ── the patient link: a square at the left (the QR, or its place), the words and their buttons at the right ── */
[data-step="done"] .patient::after { display:none; }
[data-step="done"] .patient-body { display:flex; flex-direction:row; align-items:center; gap:var(--sp-6); margin:0; }
[data-step="done"] .patient-sq { position:relative; flex:none; display:grid; place-items:center; width:var(--d-sq); height:var(--d-sq); border-radius:20px; overflow:hidden; background:#fff; box-shadow:0 0 0 1px rgba(var(--op-line), .1), 0 14px 26px -18px rgba(27,25,38,.45); }
[data-step="done"] .patient-qr { display:block; width:100%; height:100%; border:0; border-radius:0; image-rendering:pixelated; }
/* while the link is on its way, and for a piece that has none: a field of dots where the QR will be */
[data-step="done"] .patient-sq.wait { background:radial-gradient(circle, rgba(var(--op-line), .2) 1.3px, transparent 1.8px) 50% 50% / 11px 11px, var(--s-3); box-shadow:inset 0 0 0 1px rgba(var(--op-line), .06); }
[data-step="done"] .patient-sq.wait > i { display:grid; place-items:center; width:48px; height:48px; border-radius:16px; background:var(--s-1); box-shadow:0 0 0 1px rgba(var(--op-line), .06), 0 8px 16px -10px rgba(27,25,38,.3); font-size:22px; color:var(--t-400); }
[data-step="done"] .patient-sq.wait.busy::after { content:''; position:absolute; inset:0; background:linear-gradient(100deg, transparent 30%, rgba(255,255,255,.75) 50%, transparent 70%) 0 0 / 250% 100% no-repeat; animation:doneWait 1.6s linear infinite; }
html.op-dark [data-step="done"] .patient-sq.wait.busy::after { background-image:linear-gradient(100deg, transparent 30%, rgba(255,255,255,.12) 50%, transparent 70%); }
@keyframes doneWait { from { background-position:130% 0; } to { background-position:-130% 0; } }
/* the link arrived while the doctor was looking: the square that waited becomes the QR */
[data-step="done"] .patient-sq.landed { animation:doneQr 700ms var(--ease-out) both; }
[data-step="done"] .patient-sq.landed::after { content:''; position:absolute; inset:0; background:linear-gradient(100deg, transparent 30%, rgba(var(--op-accent-rgb), .35) 50%, transparent 70%) 0 0 / 250% 100% no-repeat; animation:doneWait 900ms var(--ease-out) 1 both; }
@keyframes doneQr { from { scale:.9; opacity:0; filter:blur(8px); } to { scale:1; opacity:1; filter:blur(0); } }

[data-step="done"] .patient-txt { flex:1; min-width:0; display:flex; flex-direction:column; align-items:stretch; gap:var(--sp-2); text-align:left; }
[data-step="done"] .patient-head { display:block; font-size:var(--fs-small); }
[data-step="done"] .patient-head > i { display:none; }
[data-step="done"] .patient-head b { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
[data-step="done"] .patient-head small { display:block; margin:0; font-size:var(--fs-small); line-height:20px; color:var(--t-500); }
[data-step="done"] .patient-link { display:flex; align-items:center; gap:var(--sp-1); min-width:0; margin:-6px 0; }
/* the address is read without its "https://": the letters stay in the link's name (a screen reader and the checks read it whole), at no size */
[data-step="done"] .pu-proto { font-size:0; line-height:0; }
[data-step="done"] .patient-copy { flex:none; display:grid; place-items:center; width:44px; height:44px; margin-right:-10px; border:0; border-radius:99px; background:transparent; color:var(--t-400); font-size:19px; cursor:pointer; transition:color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), scale var(--dur-fast) var(--ease-out); }
@media (hover:hover) { [data-step="done"] .patient-copy:hover { color:var(--accent); background:color-mix(in srgb, var(--accent) 10%, transparent); } }
[data-step="done"] .patient-copy:active { scale:.92; }
[data-step="done"] .patient-copy[data-done] { color:var(--sem-green); }
[data-step="done"] .patient-url { flex:0 1 auto; min-width:0; display:block; max-width:100%; font-family:var(--font-sans); font-size:15px; font-weight:600; line-height:22px; color:var(--t-100); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-decoration:none; word-break:normal; }
[data-step="done"] .patient-url:hover { color:var(--accent); text-decoration:none; }
[data-step="done"] .patient-acts { display:flex; flex-wrap:wrap; gap:6px; margin-top:var(--sp-1); }
[data-step="done"] .patient-acts-wait { margin-top:var(--sp-2); }
[data-step="done"] .patient-acts:not(.patient-acts-wait) .dchip { flex:1 1 auto; }
[data-step="done"] .patient-acts .dchip:not(#_) { justify-content:center; gap:var(--sp-2); min-width:0; height:44px; min-height:44px; padding:0 var(--sp-3); border:0; border-radius:14px; background:var(--s-3); box-shadow:inset 0 0 0 1px rgba(var(--op-line), .04); color:var(--t-150); font-size:var(--fs-small); font-weight:500; text-decoration:none; transform:none; }
[data-step="done"] .patient-acts .dchip span { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
[data-step="done"] .patient-acts .dchip i { flex:none; font-size:18px; color:var(--t-400); transition:color var(--dur-fast) var(--ease-out); }
@media (hover:hover) and (pointer:fine) {
  [data-step="done"] .patient-acts .dchip:not(#_):hover { transform:none; background:color-mix(in srgb, var(--accent) 10%, var(--s-1)); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); color:var(--t-100); }
  [data-step="done"] .patient-acts .dchip:hover i { color:var(--accent); }
}
[data-step="done"] .patient-wait { display:block; font-size:15px; line-height:22px; color:var(--t-200); text-wrap:pretty; }
[data-step="done"] .patient-wait > i { display:none; }
[data-step="done"] .patient-wait small { display:block; margin-top:var(--sp-1); font-size:var(--fs-small); line-height:20px; color:var(--t-500); }
[data-step="done"] .patient-stage { display:block; margin-top:var(--sp-1); font-size:var(--fs-small); line-height:20px; color:var(--t-500); }   /* round 367: the step the link's errand is on */

/* ── what next ── */
[data-step="done"] .actions { justify-content:flex-start; flex-wrap:wrap; gap:var(--sp-2); margin-top:var(--d-air); }
[data-step="done"] .done-next { height:48px; padding:0 var(--sp-6); font-size:var(--fs-body); }
[data-step="done"] .ghost.done-next { padding:0 var(--sp-4); border-color:transparent; background:transparent; box-shadow:none; color:var(--t-300); }
@media (hover:hover) { [data-step="done"] .ghost.done-next:hover { background:var(--hover-tint, rgba(var(--op-line), .05)); box-shadow:none; color:var(--t-100); transform:none; } }

/* ── a short window: the same screen, a little tighter, so it still fits with no scroll. The text-size setting zooms the stage, which
   a media query cannot see, so each size has its own thresholds: the same two steps at 1.12 and 1.25 times the height ── */
@media (max-height:760px) and (min-width:781px) { [data-step="done"] { --d-q:clamp(32px, 1.6vw + 16px, 40px); --d-air:var(--sp-4); --d-ap:var(--sp-3); --d-tab:68px; --d-sq:124px; } }
@media (max-height:680px) and (min-width:781px) { [data-step="done"] { --d-q:32px; --d-air:var(--sp-3); --d-ap:var(--sp-2); --d-tab:62px; --d-panel:176px; --d-sq:112px; padding-bottom:var(--sp-4); } [data-step="done"] .sub { font-size:var(--fs-body); } [data-step="done"] .dest-opts { padding-top:var(--sp-3); padding-bottom:var(--sp-2); } [data-step="done"] .patient-txt { gap:var(--sp-1); } [data-step="done"] .patient-acts { margin-top:0; } }
@media (max-height:851px) and (min-width:781px) { html[data-text="lg"] [data-step="done"] { --d-q:clamp(32px, 1.6vw + 16px, 40px); --d-air:var(--sp-4); --d-ap:var(--sp-3); --d-tab:68px; --d-sq:124px; } }
@media (max-height:762px) and (min-width:781px) { html[data-text="lg"] [data-step="done"] { --d-q:32px; --d-air:var(--sp-3); --d-ap:var(--sp-2); --d-tab:62px; --d-panel:176px; --d-sq:112px; padding-bottom:var(--sp-4); } html[data-text="lg"] [data-step="done"] .sub { font-size:var(--fs-body); } html[data-text="lg"] [data-step="done"] .dest-opts { padding-top:var(--sp-3); padding-bottom:var(--sp-2); } html[data-text="lg"] [data-step="done"] .patient-txt { gap:var(--sp-1); } html[data-text="lg"] [data-step="done"] .patient-acts { margin-top:0; } }
@media (max-height:950px) and (min-width:781px) { html[data-text="xl"] [data-step="done"] { --d-q:clamp(32px, 1.6vw + 16px, 40px); --d-air:var(--sp-4); --d-ap:var(--sp-3); --d-tab:68px; --d-sq:124px; } }
@media (max-height:850px) and (min-width:781px) { html[data-text="xl"] [data-step="done"] { --d-q:32px; --d-air:var(--sp-3); --d-ap:var(--sp-2); --d-tab:62px; --d-panel:176px; --d-sq:112px; padding-bottom:var(--sp-4); } html[data-text="xl"] [data-step="done"] .sub { font-size:var(--fs-body); } html[data-text="xl"] [data-step="done"] .dest-opts { padding-top:var(--sp-3); padding-bottom:var(--sp-2); } html[data-text="xl"] [data-step="done"] .patient-txt { gap:var(--sp-1); } html[data-text="xl"] [data-step="done"] .patient-acts { margin-top:0; } }

/* ── a narrow window (a tablet held upright): the two objects one over the other is too tall, so the card takes the width ── */
@media (max-width:980px) and (min-width:781px) { [data-step="done"] .done { grid-template-columns:auto minmax(0, 1fr); gap:0 var(--sp-8); } [data-step="done"] { padding-left:var(--sp-4); padding-right:var(--sp-4); --d-sq:96px; --d-panel:236px; } }
/* in a narrow card (that tablet, and a phone) the patient link's buttons go under the QR, two by two, so none is cut and none wraps */
@media (max-width:980px) {
  [data-step="done"] .patient-body { display:grid; grid-template-columns:auto minmax(0, 1fr); column-gap:var(--sp-4); row-gap:0; align-items:center; }
  [data-step="done"] .patient-sq { grid-area:1 / 1 / 3 / 2; }
  [data-step="done"] .patient-sq.wait { grid-row:1 / 4; align-self:start; }
  [data-step="done"] .patient-txt { display:contents; }
  [data-step="done"] .patient-head { grid-area:1 / 2; align-self:end; }
  [data-step="done"] .patient-link { grid-area:2 / 2; align-self:start; margin:0; }
  [data-step="done"] .patient-acts { grid-area:3 / 1 / 4 / -1; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); margin-top:var(--sp-3); }
  [data-step="done"] .patient-wait { grid-area:1 / 2; }
  [data-step="done"] .patient-acts-wait { grid-area:2 / 2; display:flex; margin-top:var(--sp-2); }
}

/* ── a phone: the record on one line, the video as a small still beside the title (a press opens it whole), then the card, then what
   next. The destinations are two columns of rows, so no name is cut; the patient link's buttons go under the QR ── */
@media (max-width:780px) {
  [data-step="done"] { padding:var(--sp-2) var(--sp-1) var(--sp-4); --d-q:clamp(28px, 8vw, 34px); --d-air:var(--sp-4); --d-ap:var(--sp-3); --d-tab:66px; --d-panel:212px; --d-sq:84px; }
  [data-step="done"] .done { grid-template-columns:auto minmax(0, 1fr); grid-template-rows:auto auto auto; gap:0 var(--sp-4); align-items:center; justify-items:stretch; }
  [data-step="done"] .done-stage { grid-area:1 / 1; position:relative; }
  [data-step="done"] .done-head { grid-area:1 / 2; }
  [data-step="done"] .approval, [data-step="done"] .done[data-from="approval"] .done-head > .approval { font-size:13px; line-height:20px; }
  [data-step="done"] .done[data-from="approval"] .done-head > .approval { margin-top:var(--sp-2); }
  [data-step="done"] .approval .ap-seal, [data-step="done"] .approval .ap-off { width:20px; height:20px; }
  [data-step="done"] .done[data-from="content"] .q { font-size:clamp(19px, 5.4vw, 23px); }
  [data-step="done"] .sub, [data-step="done"] .done[data-from="content"] .sub { margin-top:var(--sp-3); font-size:15px; line-height:1.45; }
  [data-step="done"] .dests { grid-area:2 / 1 / 3 / -1; margin-top:var(--sp-4); padding:5px; border-radius:24px; }
  [data-step="done"] .actions { grid-area:3 / 1 / 4 / -1; flex-wrap:nowrap; }
  [data-step="done"] .done .phone { height:clamp(150px, 24dvh, 204px) !important; border-radius:18px; cursor:pointer; }
  [data-step="done"] .done-frame::before { filter:blur(18px); }
  [data-step="done"] .done-frame::after { inset:-3px; border-radius:21px; }
  #donePhone .phone-cap, #donePhone .phone-ai, #donePhone .phone-mark, #donePhone .kind-ui.intro, #donePhone .phone-withdrawn { display:none; }
  [data-step="done"] .done-stage > .phone-expand { position:absolute; right:2px; bottom:2px; width:44px; height:44px; margin:0; padding:0; justify-content:center; background:transparent; color:#fff; }
  [data-step="done"] .done-stage > .phone-expand::before { content:''; position:absolute; inset:8px; border-radius:99px; background:rgba(15,14,20,.55); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); box-shadow:inset 0 0 0 1px rgba(255,255,255,.18); }
  [data-step="done"] .done-stage > .phone-expand i { position:relative; font-size:14px; }
  [data-step="done"] .done-stage > .phone-expand span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  [data-step="done"] .dest-tab { padding:var(--sp-2) 0; }
  [data-step="done"] .dest-tab strong { font-size:12.5px; }
  [data-step="done"] .dest-tab > i:first-child { font-size:22px; }
  [data-step="done"] .dest-opts { padding:var(--sp-3) var(--sp-2) var(--sp-2); }
  [data-step="done"] .dest-tiles { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:6px; }
  [data-step="done"] .dest-tiles .dchip:not(#_) { display:grid; grid-template-columns:auto minmax(0, 1fr); grid-template-rows:auto auto; column-gap:var(--sp-2); align-content:center; justify-items:start; min-height:56px; padding:6px var(--sp-2) 6px 6px; border-radius:16px; font-size:13px; background:var(--s-3); box-shadow:inset 0 0 0 1px rgba(var(--op-line), .04); text-align:left; }
  [data-step="done"] .dest-tiles .dchip:last-child:nth-child(odd) { grid-column:1 / -1; }
  [data-step="done"] .dest-tiles .dchip > i { grid-row:1 / 3; align-self:center; width:36px; height:36px; margin:0; border-radius:11px; background:var(--s-1); font-size:20px; }
  [data-step="done"] .dest-tiles .dchip > span { grid-column:2; align-self:end; }
  [data-step="done"] .dest-tiles .dchip small { grid-column:2; align-self:start; margin:0; }
  [data-step="done"] .dest-tiles .dchip small:empty { display:none; }
  [data-step="done"] .dest-tiles .dchip:has(small:empty) > span { grid-row:1 / 3; align-self:center; }
  [data-step="done"] .dest-tiles .dchip[data-done]:not(#_), [data-step="done"] .dest-tiles .dchip[data-off]:not(#_) { background:var(--s-3); }
  [data-step="done"] .dest-tiles .dchip[data-off] > i { background:transparent; }
  [data-step="done"] .dest-tiles .dchip .dchip-plug { top:3px; left:30px; width:18px; height:18px; }
  [data-step="done"] .patient-body { column-gap:var(--sp-3); }
  [data-step="done"] .patient-sq { border-radius:14px; }
  [data-step="done"] .patient-sq.wait > i { width:40px; height:40px; border-radius:12px; font-size:19px; }
  [data-step="done"] .patient-acts .dchip:not(#_) { padding:0 var(--sp-2); font-size:13px; }
  [data-step="done"] .patient-wait { font-size:14.5px; line-height:21px; }
  [data-step="done"] .done-next { flex:1 1 0; min-width:0; padding:0 var(--sp-3); }
  /* pass 3 of the 20 November audit: "Open Content" broke onto two lines at 390; each button keeps its words on one line */
  [data-step="done"] .done-next { white-space:nowrap; }
}

/* ── still, when asked: the calm setting and the system's reduced motion ── */
html.calm [data-step="done"] :is(.dest-pill, .phone, .dest-tab, .dest-tab > i, .dchip, .dchip > i), html.calm [data-step="done"] .done-frame::after { transition:none !important; animation:none !important; }
html.calm [data-step="done"] :is(.ap-ring, .ap-tick, .patient-sq, .patient-sq::after) { animation:none !important; }
@media (prefers-reduced-motion:reduce) {
  [data-step="done"] :is(.dest-pill, .phone, .dest-tab, .dest-tab > i, .dchip, .dchip > i) { transition:none !important; }
  [data-step="done"] :is(.ap-ring, .ap-tick, .patient-sq, .patient-sq::after), [data-step="done"] .done-frame::after { animation:none !important; }
}
@media (forced-colors:active) { [data-step="done"] .dest-pill { border:2px solid Highlight; } [data-step="done"] .dest-tab[aria-expanded="true"] { color:Highlight; } }

/* ── round 371: the link's errand, seen. The square's dots fill from the middle out as the file and the page come, and the QR takes
   their place; the two steps tick with their seconds; the time left is said; and the doctor is told they can go ── */
[data-step="done"] .patient-sq.wait.link { background-image:none; display:grid; place-items:center; padding:8px; }
[data-step="done"] .patient-sq.wait.link > i { display:none; }
[data-step="done"] .patient-dots { display:block; width:100%; height:100%; color:var(--t-100); }
[data-step="done"] .patient-steps { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; }
[data-step="done"] .patient-steps li { display:flex; align-items:center; gap:8px; min-height:24px; font-size:var(--fs-small); line-height:20px; color:var(--t-400); }
[data-step="done"] .patient-steps li > i { flex:none; font-size:16px; color:var(--t-500); }
[data-step="done"] .patient-steps li.is-now { color:var(--t-100); }
[data-step="done"] .patient-steps li.is-now > i { color:var(--accent); }
[data-step="done"] .patient-steps li.is-done > i { color:var(--sem-green); }
[data-step="done"] .patient-steps li > span { min-width:0; }
[data-step="done"] .patient-steps li small { margin-left:auto; flex:none; font-size:12.5px; font-variant-numeric:tabular-nums; color:var(--t-500); white-space:nowrap; }
[data-step="done"] .patient-steps li.is-now small { font-weight:600; color:var(--accent); }
[data-step="done"] .patient-steps li.is-now { font-size:15px; }
[data-step="done"] .patient-leave { margin:0; font-size:var(--fs-small); line-height:20px; color:var(--t-500); }
@media (max-width:980px) {
  [data-step="done"] .patient-sq.wait.link { grid-row:1 / 3; align-self:center; }
  [data-step="done"] .patient-steps { grid-area:1 / 2; align-self:center; }
  [data-step="done"] .patient-leave { display:none; }
  [data-step="done"] .patient-body:has(.patient-steps) .patient-acts-wait { grid-area:2 / 2; }
}
