/* bookmarker — Quick File on the web: the dial, the Add sheet once the link
   is saved, the "Drop to bork it" overlay and the "Sort your borks" deck.

   Loaded after library-layout.css. Light paper, always, in the iPhone's own
   tokens (the page's :root). Motion is transform and opacity only, nothing on
   the save or file path runs past 300 ms, and under reduced motion (the media
   query, or .qf-reduced on an ancestor) everything is a short crossfade. */

/* ── The dial ─────────────────────────────────────────────────────────── */
/* --qf-rest: how much of a topic's tint a resting segment shows over warm
   white. The iPhone's tints are strong pastels, made for chips; seven of them
   round a ring want softening so the highlighted segment and the clay art lead. */
.qf { --qf-size: clamp(272px, 78vw, 340px); --qf-rest: 56%; --qf-white: #FFFCF7;
  container: qf / inline-size; width: 100%; display: flex; flex-direction: column; align-items: center;
  text-align: center; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.qf[data-mode="triage"] { --qf-size: clamp(256px, 72vw, 316px); }
.qf-dial { position: relative; container: qfd / inline-size; flex: 0 0 auto;
  width: min(var(--qf-size), 100cqw); aspect-ratio: 1; }
/* The contact shadow: the ring sits on the paper like a clay coin. */
.qf-dial::before { content: ""; position: absolute; inset: 1.5%; border-radius: 50%; pointer-events: none;
  box-shadow: 0 20px 38px -20px rgba(25,21,16,.42), 0 3px 8px -3px rgba(25,21,16,.14); }
.qf-ring { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }

.qf-seg { --qf-c: var(--control, #EEE8DE); --qf-on: var(--ink, #191510);
  fill: color-mix(in srgb, var(--qf-c) var(--qf-rest), var(--qf-white)); stroke: color-mix(in srgb, var(--qf-c) var(--qf-rest), var(--qf-white));
  stroke-width: 6; stroke-linejoin: round; transform-box: view-box; transform-origin: 0 0;
  transition: fill .14s ease, stroke .14s ease, transform .2s cubic-bezier(.3,1.4,.5,1), opacity .16s ease; }
.qf-seg.is-on { fill: var(--qf-on); stroke: var(--qf-on); transform: scale(1.025); }
.qf-seg.is-pressed { transform: scale(.975); }
.qf-seg.is-on.is-pressed { transform: scale(1.01); }
.qf-seg.is-empty { fill: var(--paper, #F6F3EE); stroke: var(--paper, #F6F3EE); }
.qf-seg-more { fill: var(--control, #EEE8DE); stroke: var(--control, #EEE8DE); }
.qf-seg-more.is-on { fill: var(--ink, #191510); stroke: var(--ink, #191510); }
.qf-sheen { pointer-events: none; transition: opacity .12s ease; }

/* The evidence ring round the middle: solid is a strong guess, dashed a thin
   one, a faint hairline nothing at all. */
.qf-ev { fill: none; stroke: var(--dashed, #D7CDBD); stroke-width: 2.9; transition: stroke .16s ease; }
.qf-ev.is-thin { stroke-dasharray: 2.9 2.35; }
.qf-ev.is-none { stroke: var(--dashed, #D7CDBD) !important; stroke-width: 1.3; stroke-dasharray: 2 2.6; }

/* The bead: coral, white-rimmed, riding just outside the rim by the
   highlighted segment, clear of every label. */
.qf-bead-arm { transform-box: view-box; transform-origin: 0 0;
  transition: transform .2s cubic-bezier(.3,1.45,.5,1), opacity .14s ease; }
.qf-bead-arm.is-instant { transition: opacity .14s ease; }
.qf-bead-arm.is-off { opacity: 0; }
.qf-bead { fill: var(--coral, #FF5A2D); stroke: #fff; stroke-width: 1.7;
  filter: drop-shadow(0 1px 1.4px rgba(25,21,16,.38)); }

/* Labels: always horizontal, the topic in small caps over the subtopic. */
.qf-labels { position: absolute; inset: 0; pointer-events: none; }
.qf-lab { position: absolute; width: 24%; transform: translate(-50%, -50%); display: flex; flex-direction: column;
  align-items: center; gap: 1px; color: var(--qf-ink, var(--ink-2, #5B554D)); line-height: 1.12; transition: color .14s ease; }
.qf-lab small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 800 clamp(8.5px, 3cqw, 10.5px)/1.15 var(--font-body); letter-spacing: .055em; text-transform: uppercase; opacity: .8; }
.qf-lab b { max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere; font: 650 clamp(10.5px, 3.8cqw, 13px)/1.14 var(--font-body); }
.qf-lab b.qf-solo { font-weight: 750; }
.qf-lab.is-on { color: #fff; }
.qf-lab-more { color: var(--ink-2, #5B554D); gap: 3px; }
.qf-lab-more .qf-mag { display: block; width: clamp(13px, 4.6cqw, 17px); height: clamp(13px, 4.6cqw, 17px); }
.qf-lab-more b { font-weight: 700; }
.qf-badge { position: absolute; top: -9px; right: 4%; font-style: normal; font-size: 12px; line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(25,21,16,.25)); }

/* The listbox lies over the ring: it takes focus, pointers and keys. */
.qf-list { position: absolute; inset: 0; z-index: 1; border-radius: 50%; clip-path: circle(50%); touch-action: none;
  outline: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.qf-dial:has(.qf-list:focus-visible)::after { content: ""; position: absolute; inset: -6px; border-radius: 50%;
  box-shadow: 0 0 0 3px var(--coral, #FF5A2D); pointer-events: none; }
.qf-opt, .qf-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* The middle: a raised paper button with the topic's clay picture in it. */
.qf-hub { position: absolute; left: 29%; top: 29%; z-index: 2; width: 42%; height: 42%; padding: 0; border: 0;
  border-radius: 50%; background: var(--surface, #fff); color: var(--ink, #191510); overflow: hidden;
  display: grid; place-items: center; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -2px 6px rgba(25,21,16,.05),
    0 12px 22px -12px rgba(25,21,16,.5), 0 0 0 1px rgba(25,21,16,.06);
  transition: transform .1s ease, background-color .18s ease; }
.qf-hub:active { transform: scale(.95); }
.qf-hub:focus-visible { outline: 3px solid var(--coral, #FF5A2D); outline-offset: 3px; }
.qf-hub-in { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 84%; padding-top: 1%; }
.qf-art { position: relative; flex: 0 0 auto; width: clamp(38px, 16.5cqw, 56px); aspect-ratio: 1; margin-bottom: 4%;
  border-radius: 50%; overflow: hidden; display: grid; place-items: center; color: var(--ink-2, #5B554D);
  background: color-mix(in srgb, var(--qf-art-bg, #EEE8DE) 50%, #fff);
  box-shadow: inset 0 0 0 1px rgba(25,21,16,.05); }
.qf-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.3);
  mix-blend-mode: multiply; }
.qf-ini { font: 800 clamp(15px, 6cqw, 22px)/1 var(--font-head); font-style: normal; }
/* The letter is only the fallback: the clay multiplies, so it would show through. */
.qf-art:has(img:not([hidden])) .qf-ini { visibility: hidden; }
.qf-art .qf-mag { display: none; width: 46%; height: 46%; }
.qf-mag { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.qf-art.is-more .qf-mag { display: block; }
.qf-art.is-none { background: var(--paper, #F6F3EE); box-shadow: inset 0 0 0 1.5px var(--dashed, #D7CDBD); }
.qf-art.is-none .qf-ini { color: var(--meta, #8A8378); font-size: clamp(18px, 7cqw, 26px); }
.qf-hub-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 800 clamp(14px, 5.6cqw, 19px)/1.06 var(--font-head); letter-spacing: -.02em; }
.qf-hub-name.is-long { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  font-size: clamp(12px, 4.3cqw, 15.5px); line-height: 1.04; }
.qf-hub-sub { max-width: 100%; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 600 clamp(10.5px, 3.8cqw, 13px)/1.15 var(--font-body); color: var(--ink-2, #5B554D); }
.qf-hub-tip { margin-top: 5px; font: 800 clamp(7.5px, 2.6cqw, 9.5px)/1 var(--font-body); letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent-text, #C93A12); }
.qf-hub.is-none .qf-hub-name { font-size: clamp(12px, 4.3cqw, 15px); color: var(--ink-2, #5B554D); }
.qf-hub-done { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 3px;
  color: #fff; opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.qf-hub-done svg { width: 38%; height: auto; fill: none; stroke: currentColor; stroke-width: 2.6;
  stroke-linecap: round; stroke-linejoin: round; }
.qf-hub-done path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.qf-hub-done b { font: 800 clamp(12px, 4.2cqw, 15px)/1 var(--font-head); letter-spacing: -.01em; }

/* Under the dial: why, the subtopics, and anything that arrived late. */
.qf-reason { min-height: 1.45em; max-width: 100%; margin: 18px 0 0; padding: 0 8px;
  color: var(--ink-2, #5B554D); font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.qf-reason.is-filed { color: #1F7A4D; font-weight: 700; }
.qf-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; max-width: 100%; min-height: 36px; margin-top: 9px; }
.qf-chip { max-width: 100%; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font: 650 13px/1 var(--font-body); cursor: pointer;
  background: color-mix(in srgb, var(--qf-c, var(--control, #EEE8DE)) var(--qf-rest), var(--qf-white)); }
.qf-chip-just { background: var(--surface, #fff); color: var(--ink-2, #5B554D); box-shadow: inset 0 0 0 1px var(--hairline, #EAE4DA); }
.qf-also-row:not(:empty) { margin-top: 8px; }
.qf-also { height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer; background: var(--tint, #FFE9E1);
  border: 1.5px dashed color-mix(in srgb, var(--coral, #FF5A2D) 50%, transparent); color: var(--accent-text, #C93A12);
  font: 650 13px/1 var(--font-body); }
.qf-also i { font-style: normal; }
.qf-also b { font-weight: 800; }
.qf-help { margin: 8px 0 0; color: var(--meta, #8A8378); font-size: 12px; transition: opacity .2s ease; }
.qf.is-touched .qf-help { opacity: 0; }
.qf[data-mode="triage"] .qf-help { display: none; }   /* the deck says it once, over the cards */

/* Filed: the ring folds into the middle, which fills and ticks. */
.qf.is-filed .qf-seg { transform: scale(.82); opacity: 0; transition: transform .16s ease-in, opacity .16s ease-in; }
.qf.is-filed .qf-lab, .qf.is-filed .qf-bead-arm, .qf.is-filed .qf-sheen { opacity: 0; transition: opacity .1s ease; }
.qf.is-filed .qf-hub { background: var(--qf-filled, var(--ink, #191510)); transform: none; }
.qf.is-filed .qf-hub-in { opacity: 0; transition: opacity .1s ease; }
.qf.is-filed .qf-hub-done { opacity: 1; }
.qf.is-filed .qf-hub-done path { animation: qf-check .22s .05s cubic-bezier(.2,.7,.2,1) forwards; }
.qf.is-filed.is-instant .qf-hub-done path { animation: none; stroke-dashoffset: 0; }
.qf.is-filed .qf-ev { stroke: var(--qf-filled, var(--ink)) !important; stroke-dasharray: none; stroke-width: 3.4; }
.qf.is-filed .qf-chips, .qf.is-filed .qf-also-row, .qf.is-filed .qf-help { visibility: hidden; }
.qf.is-filed .qf-list { cursor: default; }
@keyframes qf-check { to { stroke-dashoffset: 0; } }
@keyframes qf-seg-in { from { transform: scale(.9); opacity: 0; } }
@keyframes qf-hub-in { from { transform: scale(.92); opacity: 0; } }
@keyframes qf-fade { from { opacity: 0; } }

@media (prefers-reduced-motion: no-preference) {
  .qf.is-in .qf-seg { animation: qf-seg-in .26s cubic-bezier(.32,.78,.3,1.12) backwards; animation-delay: calc(var(--i) * 18ms); }
  .qf.is-in .qf-lab { animation: qf-fade .2s ease-out backwards; animation-delay: calc(70ms + var(--i) * 18ms); }
  .qf.is-in .qf-hub { animation: qf-hub-in .26s cubic-bezier(.32,.78,.3,1.12) backwards; }
  .qf-chip, .qf-also { transition: transform .12s ease; }
  .qf-chip:active, .qf-also:active { transform: scale(.96); }
}
/* Reduced motion: crossfades of 120 ms, nothing scales, the check is just there. */
@media (prefers-reduced-motion: reduce) {
  .qf-seg { transition: fill .12s ease, stroke .12s ease, opacity .12s ease; }
  .qf-seg.is-on, .qf-seg.is-pressed, .qf-seg.is-on.is-pressed, .qf.is-filed .qf-seg { transform: none; }
  .qf-bead-arm { transition: opacity .12s ease; }
  .qf-hub:active { transform: none; }
  .qf.is-filed .qf-hub-done path { animation: none; stroke-dashoffset: 0; }
}
.qf-reduced .qf-seg { transition: fill .12s ease, stroke .12s ease, opacity .12s ease; }
.qf-reduced .qf-seg.is-on, .qf-reduced .qf-seg.is-pressed, .qf-reduced .qf.is-filed .qf-seg { transform: none; }
.qf-reduced .qf-bead-arm { transition: opacity .12s ease; }
.qf-reduced .qf-hub:active { transform: none; }
.qf-reduced .qf.is-in .qf-seg, .qf-reduced .qf.is-in .qf-hub, .qf-reduced .qf.is-in .qf-lab { animation: qf-fade .12s ease-out backwards; }
.qf-reduced .qf.is-filed .qf-hub-done path { animation: none; stroke-dashoffset: 0; }

/* Under 300 px there is no room for a ring: the same listbox, as a ranked list. */
@container qf (max-width: 299px) {
  .qf-dial { width: 100%; aspect-ratio: auto; }
  .qf-dial::before, .qf-ring, .qf-labels, .qf-hub, .qf-help { display: none; }
  .qf-list { position: static; display: flex; flex-direction: column; gap: 6px; padding: 3px; border-radius: 16px;
    clip-path: none; touch-action: auto; }
  .qf-list:focus-visible { outline: 2px solid var(--coral, #FF5A2D); outline-offset: 2px; }
  .qf-opt { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; clip-path: none;
    white-space: normal; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px;
    border-radius: 14px; background: var(--surface, #fff); box-shadow: inset 0 0 0 1px var(--hairline, #EAE4DA); text-align: left; }
  .qf-opt[aria-selected="true"] { box-shadow: inset 0 0 0 2px var(--ink, #191510); }
  .qf-opt[hidden] { display: none; }
}
.qf-list-mode .qf-dial { width: 100%; aspect-ratio: auto; }
.qf-list-mode .qf-dial::before, .qf-list-mode .qf-ring, .qf-list-mode .qf-labels, .qf-list-mode .qf-hub, .qf-list-mode .qf-help { display: none; }
.qf-list-mode .qf-list { position: static; display: flex; flex-direction: column; gap: 6px; padding: 3px; border-radius: 16px;
  clip-path: none; touch-action: auto; }
.qf-list-mode .qf-list:focus-visible { outline: 2px solid var(--coral, #FF5A2D); outline-offset: 2px; }
.qf-list-mode .qf-opt { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; clip-path: none;
  white-space: normal; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px;
  border-radius: 14px; background: var(--surface, #fff); box-shadow: inset 0 0 0 1px var(--hairline, #EAE4DA); text-align: left; }
.qf-list-mode .qf-opt[aria-selected="true"] { box-shadow: inset 0 0 0 2px var(--ink, #191510); }
.qf-list-mode .qf-opt[hidden] { display: none; }
.qf-opt-dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; }
.qf-opt-dot.qf-opt-more { width: 22px; height: 22px; display: grid; place-items: center; background: var(--control, #EEE8DE); }
.qf-opt-dot .qf-mag { width: 13px; height: 13px; }
.qf-opt-t { display: flex; flex-direction: column; min-width: 0; }
.qf-opt-t b { font-size: 14px; font-weight: 700; }
.qf-opt-t b span { color: var(--ink-2, #5B554D); font-weight: 600; }
.qf-opt-t small { color: var(--meta, #8A8378); font-size: 12px; }
.qf-opt .qf-badge { position: static; margin-left: auto; }

/* ── The Add sheet, once the link is saved ────────────────────────────── */
#add-dialog .add-saved { display: flex; align-items: center; gap: 12px; margin-top: 2px; padding: 10px; border-radius: 18px; }
#add-dialog .add-saved .cover { flex: 0 0 64px; width: 64px; height: 64px; max-height: none; border-radius: 14px; }
#add-dialog .add-saved .cover img { transition: opacity .2s ease; }
#add-dialog .add-saved .cover-glyph .pg { width: 22px; height: 22px; }
#add-dialog .add-saved .badge { left: 4px; top: 4px; width: 19px; height: 19px; border-radius: 6px; }
#add-dialog .add-saved .badge .pg { width: 10px; height: 10px; }
#add-dialog .add-saved .dur { top: auto; bottom: 4px; right: 4px; height: 17px; padding: 0 5px; font-size: 9.5px; }
#add-dialog .add-saved .add-card-body { flex: 1; min-width: 0; padding: 0; }
#add-dialog .add-saved .add-card-title { -webkit-line-clamp: 2; font-size: 14.5px; line-height: 1.28; }
.add-ok { display: inline-flex; align-items: center; gap: 4px; height: 20px; margin-bottom: 4px; padding: 0 8px;
  border-radius: 999px; background: #E3F4EA; color: #1F7A4D; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.add-filing-h { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 14px 0 2px;
  color: var(--accent-text, #C93A12); font-size: 13px; font-weight: 800; }
#add-dial { margin: 0 auto; padding-top: 18px; }   /* room for the bead at twelve o'clock */
.add-more { margin-top: 14px; border-top: 1px solid var(--hairline, #EAE4DA); }
.add-more > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 46px; cursor: pointer;
  color: var(--ink-2, #5B554D); font-size: 13.5px; font-weight: 700; }
.add-more > summary::-webkit-details-marker { display: none; }
.add-more > summary::after { content: ""; width: 8px; height: 8px; margin: 0 4px 0 auto; border: solid currentColor;
  border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-2px, -2px); transition: transform .16s ease; }
.add-more[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.add-more .sorted { margin-top: 4px; }
#add-remove { background: var(--surface, #fff); color: var(--destructive, #C0392B); box-shadow: inset 0 0 0 1px var(--hairline, #EAE4DA); }

/* ── "Drop to bork it": a link dragged over the page ──────────────────── */
#drop-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--paper, #F6F3EE) 84%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
#drop-overlay::before { content: ""; position: absolute; inset: 14px; border-radius: 30px;
  border: 2.5px dashed color-mix(in srgb, var(--coral, #FF5A2D) 70%, transparent); }
.drop-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 22px 34px 26px; border-radius: 30px; background: var(--surface, #fff); text-align: center;
  box-shadow: 0 34px 70px -30px rgba(25,21,16,.5), 0 0 0 1px var(--hairline, #EAE4DA); }
.drop-card img { width: 176px; height: 176px; margin-bottom: 6px; border-radius: 26px; object-fit: cover; }
.drop-card b { font: 800 27px/1.1 var(--font-head); letter-spacing: -.025em; }
.drop-card span { color: var(--ink-2, #5B554D); font-size: 14px; }
@media (prefers-reduced-motion: no-preference) {
  #drop-overlay:not([hidden]) { animation: qf-fade .16s ease-out; }
  #drop-overlay:not([hidden]) .drop-card { animation: drop-pop .3s cubic-bezier(.3,1.4,.5,1); }
  #drop-overlay .drop-card img { animation: drop-bob 1.5s ease-in-out infinite alternate; }
}
@keyframes drop-pop { from { transform: scale(.93); } }
@keyframes drop-bob { to { transform: translateY(-6px) rotate(-1.5deg); } }

/* ── "Sort your borks" ────────────────────────────────────────────────── */
dialog.triage { width: min(1080px, calc(100vw - 32px)); height: min(880px, calc(100dvh - 32px)); max-height: none;
  padding: 0; overflow: hidden; background: var(--paper, #F6F3EE); border-radius: 28px; }
dialog.triage[open] { display: flex; flex-direction: column; }
dialog.triage::backdrop { background: rgba(25,21,16,.5); }
.tri-top { flex: 0 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 14px 18px 8px; }
.tri-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px;
  border: 0; border-radius: 999px; background: var(--surface, #fff); color: var(--ink, #191510); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--hairline, #EAE4DA); font: 700 14px/1 var(--font-body); white-space: nowrap; }
.tri-btn[disabled] { opacity: .45; cursor: default; }
.tri-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tri-btn kbd { font: 700 10.5px/1 var(--font-body); padding: 3px 5px; border-radius: 5px; background: var(--control, #EEE8DE); color: var(--ink-2, #5B554D); }
.tri-done { justify-self: start; background: var(--ink, #191510); color: var(--paper, #F6F3EE); box-shadow: none; }
.tri-undo { justify-self: end; }
.tri-title { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.tri-title h2 { margin: 0; font: 800 21px/1.1 var(--font-head); letter-spacing: -.025em; white-space: nowrap; }
.tri-count { display: flex; align-items: center; gap: 9px; color: var(--meta, #8A8378); font-size: 12.5px; font-weight: 700;
  font-variant-numeric: tabular-nums; }
.tri-bar { width: 120px; height: 5px; border-radius: 999px; background: var(--hairline, #EAE4DA); overflow: hidden; }
.tri-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--coral, #FF5A2D);
  transition: width .24s var(--ease-out, ease); }
.tri-decks { flex: 0 0 auto; display: flex; gap: 3px; width: min(440px, calc(100% - 36px)); margin: 6px auto 0; padding: 3px;
  border-radius: 999px; background: var(--control, #EEE8DE); }
.tri-decks button { flex: 1; min-width: 0; height: 36px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  color: var(--ink-2, #5B554D); font: 650 13.5px/1 var(--font-body); white-space: nowrap; }
.tri-decks button[aria-selected="true"] { background: var(--surface, #fff); color: var(--ink, #191510); box-shadow: 0 1px 2px rgba(25,21,16,.08); }
.tri-decks .n { margin-left: 4px; opacity: .55; font-weight: 600; }
.tri-tally { flex: 0 0 auto; display: flex; justify-content: center; gap: 6px; min-height: 30px; margin: 12px 18px 0;
  overflow-x: auto; scrollbar-width: none; }
.tri-tally::-webkit-scrollbar { display: none; }
.tri-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 4px;
  border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.tri-chip img, .tri-chip .tri-chip-ini { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; mix-blend-mode: multiply;
  background: rgba(255,255,255,.55); }
.tri-chip .tri-chip-ini { display: grid; place-items: center; mix-blend-mode: normal; font: 800 11px/1 var(--font-head); }
.tri-chip b { font-weight: 800; font-variant-numeric: tabular-nums; }
.tri-hint { margin: 0; color: var(--meta, #8A8378); font-size: 12.5px; font-weight: 600; align-self: center; }
.tri-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center; gap: clamp(20px, 4vw, 56px); padding: 8px clamp(18px, 4vw, 48px) 20px; overflow-y: auto; }
.tri-stack { position: relative; justify-self: end; width: min(360px, 100%); display: grid; }
.tri-stack > * { grid-area: 1 / 1; }
.tri-peek { align-self: end; height: 80px; border-radius: 22px; background: var(--surface, #fff);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--hairline, #EAE4DA); transform-origin: 50% 100%;
  transform: translateY(calc(var(--k) * 11px)) scale(calc(1 - var(--k) * .05)); opacity: calc(1 - var(--k) * .28); }
.tri-card { position: relative; z-index: 2; overflow: hidden; border-radius: 22px; background: var(--surface, #fff);
  box-shadow: 0 1px 2px rgba(25,21,16,.05), 0 22px 44px -22px rgba(25,21,16,.4), 0 0 0 1px var(--hairline, #EAE4DA); }
.tri-cover { position: relative; aspect-ratio: 7 / 8; max-height: 260px; width: 100%; overflow: hidden; }
.tri-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.tri-card .badge { z-index: 1; }
.tri-dur { position: absolute; right: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 999px; background: rgba(25,21,16,.66); color: #fff; font-size: 10.5px; font-weight: 800; }
.tri-card-body { padding: 14px 16px 16px; }
.tri-who { display: flex; align-items: center; gap: 6px; color: var(--meta, #8A8378); font-size: 12px; font-weight: 700; min-width: 0; }
.tri-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tri-who .pg { width: 12px; height: 12px; flex: 0 0 auto; }
.tri-title-t { margin-top: 5px; font: 700 16px/1.3 var(--font-body); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere; }
.tri-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; color: var(--meta, #8A8378); font-size: 12px; font-weight: 600; }
.tri-filed { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 750; }
.tri-filed.is-none { background: var(--paper, #F6F3EE); color: var(--ink-2, #5B554D); box-shadow: inset 0 0 0 1px var(--dashed, #D7CDBD); }
/* A poster: no picture, so the topic's tint and a clay stamp do the work. */
.tri-poster { display: flex; flex-direction: column; min-height: 230px; padding: 18px 18px 16px;
  background: radial-gradient(120% 80% at 15% 0%, rgba(255,255,255,.55), transparent 60%), var(--tri-tint, #F1EBE1); color: var(--tri-deep, #5B554D); }
.tri-poster.is-unfiled { background: radial-gradient(120% 80% at 15% 0%, rgba(255,255,255,.7), transparent 60%), #F1EBE1;
  box-shadow: 0 1px 2px rgba(25,21,16,.05), 0 22px 44px -22px rgba(25,21,16,.4), inset 0 0 0 1.5px var(--dashed, #D7CDBD); }
.tri-poster-top { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750; min-width: 0; }
.tri-poster-top .badge { position: static; flex: 0 0 auto; }
.tri-poster-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tri-poster-title { flex: 1; margin: 18px 0 16px; color: var(--ink, #191510); font: 800 22px/1.14 var(--font-head);
  letter-spacing: -.02em; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tri-poster-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.tri-stamp { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.6); display: grid; place-items: center; }
.tri-stamp img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.3); mix-blend-mode: multiply; }
.tri-stamp .pg { width: 14px; height: 14px; }
.tri-poster-foot .when { margin-left: auto; opacity: .75; }
/* The platform's mark, large and faint in the corner: a poster, not an empty box. */
.tri-wm { position: absolute; right: -14px; bottom: -18px; width: 138px; height: 138px; display: grid; place-items: center;
  color: var(--tri-deep, #5B554D); opacity: .07; pointer-events: none; }
.tri-wm .pg { width: 100%; height: 100%; }
.tri-wm .pg-txt { font-size: 64px; }
.tri-poster > :not(.tri-wm) { position: relative; }
.tri-side { justify-self: start; width: min(380px, 100%); display: flex; flex-direction: column; align-items: center; }
.tri-head { margin: 0 0 20px; color: var(--accent-text, #C93A12); font-size: 13px; font-weight: 800; }
.tri-dial { width: 100%; }
.tri-actions { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.tri-remove { color: var(--destructive, #C0392B); }
/* The end: the compass, and how long it took. */
.tri-end { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 24px; text-align: center; }
.tri-end-art { width: min(220px, 52vw); aspect-ratio: 1; border-radius: 32px; object-fit: cover; margin-bottom: 10px;
  box-shadow: 0 24px 48px -26px rgba(25,21,16,.45); }
.tri-end h2 { margin: 0; font: 800 clamp(26px, 4vw, 34px)/1.08 var(--font-head); letter-spacing: -.03em; }
.tri-end-sub { margin: 2px 0 14px; color: var(--ink-2, #5B554D); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tri-end-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tri-end-acts .btn { width: auto; min-width: 180px; padding: 0 22px; }
.tri-end-acts .btn.ghost { background: var(--surface, #fff); color: var(--ink, #191510); box-shadow: inset 0 0 0 1px var(--hairline, #EAE4DA); }

@media (prefers-reduced-motion: no-preference) {
  .tri-card.is-rising { animation: tri-rise .18s var(--ease-out, ease-out); }
  .tri-btn:active, .tri-decks button:active { transform: scale(.96); }
  .tri-btn, .tri-decks button { transition: transform .12s ease, background-color .14s ease; }
  .tri-end:not([hidden]) .tri-end-art { animation: tri-end-in .34s cubic-bezier(.3,1.3,.5,1) backwards; }
  .tri-end:not([hidden]) h2, .tri-end:not([hidden]) .tri-end-sub, .tri-end:not([hidden]) .tri-end-acts { animation: qf-fade .3s .08s ease-out backwards; }
}
@keyframes tri-rise { from { transform: translateY(14px) scale(.96); opacity: .5; } }
@keyframes tri-end-in { from { transform: scale(.88) rotate(-3deg); opacity: 0; } }
:root.tri-vt::view-transition-old(root), :root.tri-vt::view-transition-new(root) { animation: none; }
::view-transition-group(tri-fly) { animation-duration: .26s; animation-timing-function: cubic-bezier(.4,0,.2,1); }
::view-transition-old(tri-fly) { animation: tri-vt-out .26s ease-in both; }
::view-transition-new(tri-fly) { animation: tri-vt-in .26s ease-out both; }
@keyframes tri-vt-out { to { opacity: 0; } }
@keyframes tri-vt-in { from { opacity: 0; } }

@media (max-width: 900px) {
  .tri-body { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 14px; padding: 8px 16px 18px; }
  .tri-stack, .tri-side { justify-self: center; }
  .tri-stack { width: min(340px, 100%); margin-bottom: 14px; }   /* the peeking cards hang below it */
  .tri-cover { max-height: min(220px, 27dvh); aspect-ratio: auto; height: min(220px, 27dvh); }
  .tri-poster { min-height: 0; }
  .tri-poster-title { -webkit-line-clamp: 3; font-size: 19px; margin: 12px 0 12px; }
  .tri-card-body { padding: 11px 14px 13px; }
  .tri-title-t { -webkit-line-clamp: 2; font-size: 15px; }
  .tri-peek { height: 50px; }
}
@media (max-width: 760px) {
  dialog.triage { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0;
    padding: 0 0 env(safe-area-inset-bottom); }
  .tri-top { padding: calc(10px + env(safe-area-inset-top)) 12px 4px; gap: 8px; }
  .tri-title h2 { font-size: 18px; }
  .tri-bar { width: 84px; }
  .tri-btn { height: 40px; padding: 0 13px; }
  .tri-decks button { font-size: 12.5px; height: 38px; }
  .tri-tally { justify-content: flex-start; margin: 10px 12px 0; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(tri-fly), ::view-transition-old(tri-fly), ::view-transition-new(tri-fly) { animation-duration: .12s; }
}
