@import url("../tokens/fonts.css");

/* ==========================================================================
   Refresh: an e-ink design system.
   Sixteen greys, 1-bit icons, ordered dither, matte paper. Changes arrive in
   frames: a full refresh flashes (ink, then the inverse, then content), a
   partial refresh leaves a faint ghost of what was there.
   Colours, spacing, radii and shadows come from tokens.css; motion lives here.
   Rules: transform/opacity for movement; entrance animations fill BACKWARDS;
   colour changes only on one element's own state.
   ========================================================================== */

:root {
  --rf-line: 1.5px;                                   /* the 1-bit outline */
  /* named easings (tokens: easing-*) */
  --rf-snap: steps(1, end);                           /* on/off, nothing between */
  --rf-wave: steps(4, end);                           /* appearing in four grey levels */
  --rf-turn: cubic-bezier(.65, 0, .35, 1);            /* page-edge sweeps */
  --rf-ghost-e: cubic-bezier(.05, .8, .3, 1);         /* residue: drops fast, then lingers */
  --rf-settle: cubic-bezier(.2, .8, .2, 1);           /* small nudges */
  /* durations (tokens: duration-*) */
  --rf-t-snap: var(--duration-snap, 90ms);
  --rf-t-settle: var(--duration-settle, 240ms);
  --rf-t-flash: var(--duration-flash, 300ms);
  --rf-t-turn: var(--duration-turn, 320ms);
  --rf-t-ghost: var(--duration-ghost, 700ms);
  --rf-t-shimmer: var(--duration-shimmer, 1600ms);
  --rf-fg: var(--ink);
  --rf-fg-soft: var(--ink-soft);
  color-scheme: light;
}
[data-theme="dark"] { color-scheme: dark; }

/* ---------- dither: 4x4 Bayer, 2px dots, 17 levels (0 = paper, 16 = solid ink) ---------- */
.rf-d-0 { --rf-dm: var(--rf-dm-0); }
.rf-d-1 { --rf-dm: var(--rf-dm-1); }
.rf-d-2 { --rf-dm: var(--rf-dm-2); }
.rf-d-3 { --rf-dm: var(--rf-dm-3); }
.rf-d-4 { --rf-dm: var(--rf-dm-4); }
.rf-d-5 { --rf-dm: var(--rf-dm-5); }
.rf-d-6 { --rf-dm: var(--rf-dm-6); }
.rf-d-7 { --rf-dm: var(--rf-dm-7); }
.rf-d-8 { --rf-dm: var(--rf-dm-8); }
.rf-d-9 { --rf-dm: var(--rf-dm-9); }
.rf-d-10 { --rf-dm: var(--rf-dm-10); }
.rf-d-11 { --rf-dm: var(--rf-dm-11); }
.rf-d-12 { --rf-dm: var(--rf-dm-12); }
.rf-d-13 { --rf-dm: var(--rf-dm-13); }
.rf-d-14 { --rf-dm: var(--rf-dm-14); }
.rf-d-15 { --rf-dm: var(--rf-dm-15); }
.rf-d-16 { --rf-dm: var(--rf-dm-16); }
:root {
  --rf-dm-0: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3C/svg%3E");
  --rf-dm-1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM4 4h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM4 0h2v2h-2zM4 4h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-4: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM4 0h2v2h-2zM0 4h2v2h-2zM4 4h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-5: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM4 0h2v2h-2zM2 2h2v2h-2zM0 4h2v2h-2zM4 4h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-6: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM4 0h2v2h-2zM2 2h2v2h-2zM0 4h2v2h-2zM4 4h2v2h-2zM6 6h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-7: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM4 0h2v2h-2zM2 2h2v2h-2zM6 2h2v2h-2zM0 4h2v2h-2zM4 4h2v2h-2zM6 6h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-8: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM4 0h2v2h-2zM2 2h2v2h-2zM6 2h2v2h-2zM0 4h2v2h-2zM4 4h2v2h-2zM2 6h2v2h-2zM6 6h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-9: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM2 0h2v2h-2zM4 0h2v2h-2zM2 2h2v2h-2zM6 2h2v2h-2zM0 4h2v2h-2zM4 4h2v2h-2zM2 6h2v2h-2zM6 6h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-10: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM2 0h2v2h-2zM4 0h2v2h-2zM2 2h2v2h-2zM6 2h2v2h-2zM0 4h2v2h-2zM4 4h2v2h-2zM6 4h2v2h-2zM2 6h2v2h-2zM6 6h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-11: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM2 0h2v2h-2zM4 0h2v2h-2zM6 0h2v2h-2zM2 2h2v2h-2zM6 2h2v2h-2zM0 4h2v2h-2zM4 4h2v2h-2zM6 4h2v2h-2zM2 6h2v2h-2zM6 6h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-12: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM2 0h2v2h-2zM4 0h2v2h-2zM6 0h2v2h-2zM2 2h2v2h-2zM6 2h2v2h-2zM0 4h2v2h-2zM2 4h2v2h-2zM4 4h2v2h-2zM6 4h2v2h-2zM2 6h2v2h-2zM6 6h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-13: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM2 0h2v2h-2zM4 0h2v2h-2zM6 0h2v2h-2zM0 2h2v2h-2zM2 2h2v2h-2zM6 2h2v2h-2zM0 4h2v2h-2zM2 4h2v2h-2zM4 4h2v2h-2zM6 4h2v2h-2zM2 6h2v2h-2zM6 6h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-14: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM2 0h2v2h-2zM4 0h2v2h-2zM6 0h2v2h-2zM0 2h2v2h-2zM2 2h2v2h-2zM6 2h2v2h-2zM0 4h2v2h-2zM2 4h2v2h-2zM4 4h2v2h-2zM6 4h2v2h-2zM2 6h2v2h-2zM4 6h2v2h-2zM6 6h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-15: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM2 0h2v2h-2zM4 0h2v2h-2zM6 0h2v2h-2zM0 2h2v2h-2zM2 2h2v2h-2zM4 2h2v2h-2zM6 2h2v2h-2zM0 4h2v2h-2zM2 4h2v2h-2zM4 4h2v2h-2zM6 4h2v2h-2zM2 6h2v2h-2zM4 6h2v2h-2zM6 6h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-16: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v2h-2zM2 0h2v2h-2zM4 0h2v2h-2zM6 0h2v2h-2zM0 2h2v2h-2zM2 2h2v2h-2zM4 2h2v2h-2zM6 2h2v2h-2zM0 4h2v2h-2zM2 4h2v2h-2zM4 4h2v2h-2zM6 4h2v2h-2zM0 6h2v2h-2zM2 6h2v2h-2zM4 6h2v2h-2zM6 6h2v2h-2z'/%3E%3C/svg%3E");
  --rf-dm-shimmer: var(--rf-dm-6);
}
:root { --rf-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 -.2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url%28%23n%29'/%3E%3C/svg%3E"); }
[data-theme="dark"] { --rf-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .42 -.17'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url%28%23n%29'/%3E%3C/svg%3E"); }

/* ---------- page ---------- */
body {
  margin: 0;
  background-color: var(--paper);
  background-image: var(--rf-grain);
  background-size: 200px 200px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.rf-root, .rf-root *, .rf-root *::before, .rf-root *::after,
[class^="rf-"], [class^="rf-"]::before, [class^="rf-"]::after { box-sizing: border-box; }
.rf-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rf-rel { position: relative; }

/* ---------- type ---------- */
.rf-display { font: 350 56px/60px var(--font-serif); letter-spacing: -0.015em; font-optical-sizing: auto; margin: 0; }
.rf-numeral { font: 250 96px/96px var(--font-serif); letter-spacing: -0.02em; font-variant-numeric: tabular-nums lining-nums; margin: 0; }
.rf-title { font: 450 32px/38px var(--font-serif); letter-spacing: -0.01em; margin: 0; }
.rf-heading { font: 600 20px/26px var(--font-serif); margin: 0; }
.rf-reading { font: 400 18px/30px var(--font-serif); margin: 0; }
.rf-body { font: 400 15px/22px var(--font-sans); margin: 0; }
.rf-label { font: 600 13px/16px var(--font-sans); letter-spacing: 0.01em; margin: 0; }
.rf-overline { font: 700 11px/14px var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--rf-fg-soft); margin: 0; }
.rf-muted { color: var(--rf-fg-soft); }
.rf-tnum { font-variant-numeric: tabular-nums; }
.rf-link { color: inherit; text-decoration: underline dotted 1.5px; text-underline-offset: 3px; }
.rf-link:hover { text-decoration-style: solid; }
.rf-hl { background: var(--tint-wash); color: var(--ink); padding: 0 .12em; border-radius: 1px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.rf-rule { height: 0; border: 0; border-top: 1px solid var(--rule-soft); margin: var(--space-4) 0; }
.rf-rule--dots { border-top: 2px dotted var(--rule); }

/* ---------- icons: 16x16 1-bit bitmaps, drawn at 16 or 32 px ---------- */
.rf-icon { display: inline-block; flex: none; width: 16px; height: 16px; fill: currentColor; shape-rendering: crispEdges; vertical-align: -3px; }

/* ---------- focus: paper gap then a 2px ink ring ---------- */
.rf-focusable:focus-visible,
[class^="rf-"]:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ---------- dither ---------- */
.rf-dz {
  display: block;
  background-color: var(--rf-dc, var(--ink));
  -webkit-mask-image: var(--rf-dm); mask-image: var(--rf-dm);
  -webkit-mask-size: 8px 8px; mask-size: 8px 8px;
  -webkit-mask-repeat: repeat; mask-repeat: repeat;
}
.rf-dfill { position: relative; isolation: isolate; }
.rf-dfill::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background-color: var(--rf-dc, var(--ink));
  -webkit-mask-image: var(--rf-dm); mask-image: var(--rf-dm);
  -webkit-mask-size: 8px 8px; mask-size: 8px 8px;
}

/* ---------- motion primitives ---------- */
/* entrance: ink settles in four grey steps with a 4px rise. Fill BACKWARDS only. */
.rf-enter { animation: rf-settle var(--rf-t-settle) var(--rf-wave) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rf-settle { from { opacity: 0; transform: translateY(4px); } }
@keyframes rf-appear { from { opacity: 0; } }

/* opt-in flash overlay (mode: 'flash'): ink -> inverse -> settle (frames switched by JS) */
.rf-flash {
  position: absolute; inset: 0; z-index: 60; pointer-events: none; border-radius: inherit;
  background: var(--flash);
}
.rf-flash.is-inverse { background: #ffffff; mix-blend-mode: difference; }
.rf-flash.is-settle { background: var(--paper); mix-blend-mode: normal; opacity: .55; }
.rf-flash.is-settle2 { background: var(--paper); mix-blend-mode: normal; opacity: .2; }

/* settle (the default refresh): a light paper veil lifting in 3 frames + one sparse dither sweep, on the changed element only */
.rf-settle { position: absolute; inset: 0; z-index: 56; pointer-events: none; border-radius: inherit; overflow: hidden; }
.rf-settle::before { content: ""; position: absolute; inset: 0; background: var(--paper); opacity: 0; animation: rf-veil 240ms steps(3, end); }
@keyframes rf-veil { from { opacity: .42; } to { opacity: 0; } }
.rf-settle__band { display: none; }
.rf-settle--band .rf-settle__band {
  display: block; position: absolute; top: 0; bottom: 0; left: 0; width: 34%; opacity: 0;
  background-color: var(--ink);
  -webkit-mask-image: var(--rf-dm-2); mask-image: var(--rf-dm-2); -webkit-mask-size: 8px 8px; mask-size: 8px 8px;
  animation: rf-settle-sweep 420ms steps(10, end);
}
@keyframes rf-settle-sweep { from { opacity: .4; transform: translateX(-100%); } to { opacity: .4; transform: translateX(300%); } }

/* partial refresh: the previous state, left behind for a moment */
.rf-ghost {
  position: absolute !important; z-index: 55; pointer-events: none !important; margin: 0 !important;
  background: transparent !important; box-shadow: none !important; border-color: transparent !important;
  opacity: 0; animation: rf-ghost var(--rf-t-ghost) var(--rf-ghost-e) backwards;
  overflow: hidden; transform: none !important;
}
.rf-ghost * { animation: none !important; transition: none !important; }
@keyframes rf-ghost { from { opacity: .3; } }

/* page-turn shimmer (loading): a dithered band sweeping across in frames */
.rf-shimmer { position: relative; overflow: hidden; isolation: isolate; }
.rf-shimmer::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; pointer-events: none;
  background-color: var(--rf-dc, var(--ink));
  -webkit-mask-image: var(--rf-dm-shimmer); mask-image: var(--rf-dm-shimmer);
  -webkit-mask-size: 8px 8px; mask-size: 8px 8px;
  opacity: .5;
  animation: rf-sweep var(--rf-t-shimmer) steps(14, end) infinite;
}
@keyframes rf-sweep { from { transform: translateX(-110%); } to { transform: translateX(240%); } }

@media (prefers-reduced-motion: reduce) {
  .rf-enter, .rf-ghost, .rf-shimmer::after { animation: none !important; }
  .rf-ghost, .rf-flash, .rf-settle { display: none !important; }
  .rf-shimmer::after { transform: none; opacity: .25; }
}

/* ---------- layout helpers for previews and screens ---------- */
.rf-stage { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-6); }
.rf-stage > .rf-overline { width: 100%; margin-top: var(--space-2); }
.rf-stage > .rf-overline:first-child { margin-top: 0; }
.rf-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.rf-col { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.rf-grid { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
@media (max-width: 560px) { .rf-stage { padding: var(--space-4); } }

/* ==========================================================================
   Controls
   ========================================================================== */

/* ---------- Button: dither on hover, INVERTS on press, leaves a ghost ---------- */
.rf-btn {
  --rf-bg: var(--sheet); --rf-c: var(--ink); --rf-bd: var(--ink);
  --rf-pbg: var(--ink); --rf-pc: var(--on-ink);               /* pressed = inverted */
  --rf-hov: var(--rule); --rf-ghost-c: var(--ink);
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 40px; padding: 0 var(--space-4); min-width: 40px;
  border: var(--rf-line) solid var(--rf-bd); border-radius: var(--radius-sm);
  background: var(--rf-bg); color: var(--rf-c);
  font: 600 14px/1 var(--font-sans); letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.rf-btn::before {            /* hover: a sparse 1-bit dot fill */
  content: ""; position: absolute; inset: 2px; z-index: -1; border-radius: 2px; pointer-events: none;
  background-color: var(--rf-hov);
  -webkit-mask-image: var(--rf-dm-2); mask-image: var(--rf-dm-2); -webkit-mask-size: 8px 8px; mask-size: 8px 8px;
  opacity: 0;
}
.rf-btn::after {             /* the ghost left behind after a press */
  content: ""; position: absolute; inset: -1.5px; border-radius: inherit; pointer-events: none;
  background: var(--rf-ghost-c); opacity: 0;
}
.rf-btn:hover::before { opacity: 1; }
.rf-btn.is-pressed { background: var(--rf-pbg); color: var(--rf-pc); border-color: var(--rf-pbg); transform: translateY(1px); }
.rf-btn.is-pressed::before { opacity: 0; }
.rf-btn.is-ghost::after { animation: rf-btn-ghost var(--rf-t-ghost) var(--rf-ghost-e); }
@keyframes rf-btn-ghost { from { opacity: .26; } to { opacity: 0; } }
.rf-btn .rf-icon { margin: 0 -2px; }

.rf-btn--primary { --rf-bg: var(--ink); --rf-c: var(--on-ink); --rf-bd: var(--ink); --rf-pbg: var(--sheet); --rf-pc: var(--ink); --rf-hov: var(--shade); --rf-ghost-c: var(--on-ink); }
.rf-btn--primary.is-pressed { border-color: var(--ink); }
.rf-btn--ghost { --rf-bg: transparent; --rf-bd: transparent; }
.rf-btn--danger { --rf-c: var(--tint); --rf-bd: var(--tint); --rf-pbg: var(--tint); --rf-pc: var(--sheet); --rf-hov: var(--tint); --rf-ghost-c: var(--tint); }
.rf-btn--sm { height: 32px; padding: 0 var(--space-3); font-size: 13px; min-width: 32px; }
.rf-btn--lg { height: 48px; padding: 0 var(--space-6); font-size: 15px; }
.rf-btn--block { display: flex; width: 100%; }
.rf-btn[disabled], .rf-btn[aria-disabled="true"]:not(.is-loading) {
  cursor: not-allowed; color: var(--ink-soft); border-color: var(--rule-soft); background: var(--sunk);
  border-style: dashed;
}
.rf-btn[disabled]::before, .rf-btn[aria-disabled="true"]::before { opacity: 0; }
.rf-btn.is-loading { cursor: progress; }
.rf-btn.is-loading > :not(.rf-btn__spin) { visibility: hidden; }
.rf-btn .rf-btn__spin { display: none; position: absolute; inset: 0; margin: auto; }
.rf-btn.is-loading .rf-btn__spin { display: block; }

/* ---------- the page-turn spinner: a tiny book flipping a page in frames ---------- */
.rf-turnspin { position: relative; display: inline-block; width: 18px; height: 12px; flex: none; color: inherit; }
.rf-turnspin::before, .rf-turnspin::after { content: ""; position: absolute; top: 0; height: 12px; width: 8px; border: 1.5px solid currentColor; }
.rf-turnspin::before { left: 0; border-right-width: .75px; }
.rf-turnspin::after { left: 9px; border-left-width: .75px; background: currentColor; transform-origin: -1px 50%; animation: rf-flip 1100ms steps(6, end) infinite; }
@keyframes rf-flip { 0% { transform: scaleX(1); } 50%, 100% { transform: scaleX(-1); } }
.rf-btn__spin.rf-turnspin { position: absolute; }

/* ---------- IconButton ---------- */
.rf-ib { padding: 0; width: 40px; }
.rf-ib.rf-btn--sm { width: 32px; }
.rf-ib.rf-btn--lg { width: 48px; }
.rf-ib--round { border-radius: var(--radius-full); }
.rf-ib[aria-pressed="true"] { --rf-bg: var(--ink); --rf-c: var(--on-ink); --rf-pbg: var(--sheet); --rf-pc: var(--ink); --rf-hov: var(--on-ink); }
.rf-ib__count {
  position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-full); background: var(--tint); color: var(--sheet);
  font: 700 11px/18px var(--font-sans); text-align: center; box-shadow: 0 0 0 2px var(--paper);
}

/* ---------- Toggle: 1-bit snap, the old knob stays as a ghost ---------- */
.rf-switch { position: relative; display: inline-flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; color: var(--rf-fg); }
.rf-switch__input { position: absolute; left: 0; top: 0; width: 44px; height: 24px; margin: 0; opacity: 0; cursor: inherit; }
.rf-switch__track {
  position: relative; flex: none; width: 44px; height: 24px; border-radius: var(--radius-full);
  border: var(--rf-line) solid var(--ink); background: var(--sheet);
}
.rf-switch__knob { position: absolute; top: 3px; width: 15px; height: 15px; border-radius: 50%; }
.rf-switch__knob--off { left: 3px; background: var(--ink); opacity: 1; }
.rf-switch__knob--on { right: 3px; background: var(--ghost); opacity: 0; transition: opacity var(--rf-t-ghost) var(--rf-ghost-e); }
.rf-switch__tick { position: absolute; left: 6px; top: 3px; color: var(--on-ink); opacity: 0; }
.rf-switch__tick .rf-icon { width: 13px; height: 13px; display: block; }
.rf-switch__input:checked + .rf-switch__track { background: var(--ink); }
.rf-switch__input:checked + .rf-switch__track .rf-switch__knob--on { background: var(--on-ink); opacity: 1; transition: none; }
.rf-switch__input:checked + .rf-switch__track .rf-switch__knob--off { background: var(--shade); opacity: 0; transition: opacity var(--rf-t-ghost) var(--rf-ghost-e); }
.rf-switch__input:checked + .rf-switch__track .rf-switch__tick { opacity: 1; }
.rf-switch:hover .rf-switch__track { box-shadow: 0 0 0 3px var(--sunk); }
.rf-switch__input:focus-visible + .rf-switch__track { box-shadow: var(--shadow-focus); }
.rf-switch__text { display: flex; flex-direction: column; gap: 2px; padding-top: 2px; min-width: 0; }
.rf-switch__label { font: 500 15px/20px var(--font-sans); }
.rf-switch__desc { font-size: 13px; line-height: 18px; color: var(--rf-fg-soft); }
.rf-switch.is-disabled { cursor: not-allowed; opacity: .55; }

/* ---------- Checkbox + Radio ---------- */
.rf-check, .rf-radio { position: relative; display: inline-flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; color: var(--rf-fg); }
.rf-check__input, .rf-radio__input { position: absolute; left: 0; top: 1px; width: 20px; height: 20px; margin: 0; opacity: 0; cursor: inherit; }
.rf-check__box {
  position: relative; flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: var(--radius-xs);
  border: var(--rf-line) solid var(--ink); background: var(--sheet); color: var(--on-ink);
  display: grid; place-items: center;
  transition: background-color var(--rf-t-ghost) var(--rf-ghost-e);
}
.rf-check__box .rf-icon { opacity: 0; transition: opacity var(--rf-t-ghost) var(--rf-ghost-e); }
.rf-check__box .rf-check__dash { display: none; }
.rf-check__input:checked + .rf-check__box,
.rf-check__input:indeterminate + .rf-check__box { background: var(--ink); transition: none; }
.rf-check__input:checked + .rf-check__box .rf-check__tick { opacity: 1; transition: none; }
.rf-check__input:indeterminate + .rf-check__box .rf-check__tick { display: none; }
.rf-check__input:indeterminate + .rf-check__box .rf-check__dash { display: block; opacity: 1; transition: none; }
.rf-check:hover .rf-check__box, .rf-radio:hover .rf-radio__dot { box-shadow: 0 0 0 3px var(--sunk); }
.rf-check__input:focus-visible + .rf-check__box, .rf-radio__input:focus-visible + .rf-radio__dot { box-shadow: var(--shadow-focus); }
.rf-check__text, .rf-radio__text { display: flex; flex-direction: column; gap: 2px; padding-top: 1px; min-width: 0; }
.rf-check__label, .rf-radio__label { font: 500 15px/22px var(--font-sans); }
.rf-check__hint, .rf-radio__hint { font-size: 13px; line-height: 18px; color: var(--rf-fg-soft); }
.rf-check.is-done .rf-check__label { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--rf-fg-soft); }
.rf-check.is-disabled, .rf-radio.is-disabled { opacity: .55; cursor: not-allowed; }

.rf-radio__dot {
  position: relative; flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  border: var(--rf-line) solid var(--ink); background: var(--sheet);
}
.rf-radio__dot::after {
  content: ""; position: absolute; inset: 3.5px; border-radius: 50%; background: var(--ink);
  opacity: 0; transition: opacity var(--rf-t-ghost) var(--rf-ghost-e);
}
.rf-radio__input:checked + .rf-radio__dot::after { opacity: 1; transition: none; }
.rf-radios { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.rf-radios--inline { flex-direction: row; flex-wrap: wrap; gap: var(--space-3) var(--space-6); }
.rf-radios > legend { padding: 0; margin-bottom: var(--space-3); font: 600 13px/16px var(--font-sans); }

/* ---------- TextField ---------- */
.rf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--rf-fg); }
.rf-field__label { font: 600 13px/16px var(--font-sans); display: flex; justify-content: space-between; gap: var(--space-2); }
.rf-field__count { font-weight: 500; color: var(--rf-fg-soft); font-variant-numeric: tabular-nums; }
.rf-field__control {
  position: relative; display: flex; align-items: center; gap: var(--space-2);
  min-height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-sm);
  border: var(--rf-line) solid var(--rule); background: var(--sheet); color: var(--ink);
}
.rf-field__control:hover { border-color: var(--ink); }
.rf-field__control:focus-within { border-color: var(--ink); box-shadow: var(--shadow-focus); }
.rf-field__control > .rf-icon { color: var(--ink-soft); }
.rf-field__input {
  flex: 1; min-width: 0; height: 37px; border: 0; padding: 0; margin: 0; background: transparent; color: inherit;
  font: 400 15px/22px var(--font-sans); outline: none; caret-color: var(--ink);
}
.rf-field__input::placeholder { color: var(--ink-soft); opacity: 1; }
textarea.rf-field__input { height: auto; min-height: 96px; padding: 9px 0; resize: vertical; }
.rf-field--serif .rf-field__input { font: 400 17px/27px var(--font-serif); }
.rf-field__hint { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; line-height: 18px; color: var(--rf-fg-soft); min-height: 0; }
.rf-field__hint:empty { display: none; }
.rf-field__hint .rf-icon { margin-top: 1px; }
.rf-field.is-error .rf-field__control { border-color: var(--tint); }
.rf-field.is-error .rf-field__hint { color: var(--tint); font-weight: 500; }
.rf-field.is-error .rf-field__control::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 28px; pointer-events: none; border-radius: 0 3px 3px 0;
  background-color: var(--tint);
  -webkit-mask-image: var(--rf-dm-4); mask-image: var(--rf-dm-4); -webkit-mask-size: 8px 8px; mask-size: 8px 8px;
}
.rf-field.is-disabled .rf-field__control { background: var(--sunk); border-style: dashed; color: var(--ink-soft); }

/* ---------- Select + Menu: a 1-bit popover ---------- */
.rf-select { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rf-select__trigger {
  position: relative; display: flex; align-items: center; gap: var(--space-2); width: 100%;
  height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-sm);
  border: var(--rf-line) solid var(--rule); background: var(--sheet); color: var(--ink);
  font: 400 15px/22px var(--font-sans); text-align: left; cursor: pointer;
}
.rf-select__trigger:hover { border-color: var(--ink); }
.rf-select__trigger[aria-expanded="true"] { border-color: var(--ink); }
.rf-select__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; }
.rf-pop {
  position: absolute; z-index: 40; left: 0; top: calc(100% + 6px); min-width: 100%;
  padding: 4px; margin: 0; list-style: none;
  background: var(--sheet); color: var(--ink); border: var(--rf-line) solid var(--ink); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hard);
  animation: rf-appear 160ms var(--rf-wave) backwards;
  max-height: 280px; overflow-y: auto;
}
.rf-pop[hidden] { display: none; }
.rf-pop--right { left: auto; right: 0; }
.rf-opt {
  position: relative; isolation: isolate; display: flex; align-items: center; gap: var(--space-2);
  min-height: 36px; padding: 6px 10px; border-radius: 2px; cursor: pointer; white-space: nowrap;
  font: 400 15px/20px var(--font-sans); border: 0; background: none; color: inherit; width: 100%; text-align: left;
}
.rf-opt__label { flex: 1; min-width: 0; }
.rf-opt__hint { color: var(--ink-soft); font-size: 13px; }
.rf-opt .rf-opt__tick { opacity: 0; }
.rf-opt[aria-selected="true"] .rf-opt__tick { opacity: 1; }
.rf-opt[aria-selected="true"] { font-weight: 600; }
.rf-opt.is-active, .rf-opt:hover, .rf-opt:focus-visible { background: var(--ink); color: var(--on-ink); outline: none; box-shadow: none; }
.rf-opt.is-active .rf-opt__hint, .rf-opt:hover .rf-opt__hint { color: var(--on-ink); }
.rf-opt--danger { color: var(--tint); }
.rf-opt--danger:hover, .rf-opt--danger.is-active { background: var(--tint); color: var(--sheet); }
.rf-pop__sep { height: 0; margin: 4px 6px; border-top: 1px dotted var(--rule); }
.rf-menu { position: relative; display: inline-block; }

/* ---------- Tabs: underline snaps, the old one ghosts out ---------- */
.rf-tabs { display: flex; flex-direction: column; min-width: 0; }
.rf-tabs__list { position: relative; display: flex; gap: var(--space-1); border-bottom: 1px solid var(--rule-soft); overflow-x: auto; scrollbar-width: none; }
.rf-tabs__list::-webkit-scrollbar { display: none; }
.rf-tab {
  position: relative; display: inline-flex; align-items: center; gap: var(--space-2); flex: none;
  height: 44px; padding: 0 var(--space-3); border: 0; background: none; cursor: pointer;
  font: 600 14px/1 var(--font-sans); color: var(--rf-fg-soft); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.rf-tab::before {
  content: ""; position: absolute; inset: 6px 2px; z-index: -1; border-radius: 2px; pointer-events: none;
  background-color: var(--ink); -webkit-mask-image: var(--rf-dm-2); mask-image: var(--rf-dm-2); -webkit-mask-size: 8px 8px; mask-size: 8px 8px; opacity: 0;
}
.rf-tab { isolation: isolate; }
.rf-tab:hover::before { opacity: 1; }
.rf-tab::after {
  content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: -1px; height: 3px; background: var(--ink);
  opacity: 0; transition: opacity var(--rf-t-ghost) var(--rf-ghost-e);
}
.rf-tab[aria-selected="true"] { color: var(--rf-fg); }
.rf-tab[aria-selected="true"]::after { opacity: 1; transition: none; }
.rf-tab__count { font: 600 11px/18px var(--font-sans); min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-full); border: 1px solid currentColor; text-align: center; }
.rf-tabs__panel { position: relative; padding-top: var(--space-4); min-width: 0; }

/* ---------- SegmentedControl: the chosen segment inverts ---------- */
.rf-seg {
  display: inline-flex; gap: 2px; padding: 2px; max-width: 100%;
  border: var(--rf-line) solid var(--ink); border-radius: var(--radius-sm); background: var(--sheet);
}
.rf-seg--block { display: flex; }
.rf-seg__opt {
  position: relative; isolation: isolate; flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 var(--space-3); border: 0; border-radius: 2px; background: none; cursor: pointer;
  font: 600 13px/1 var(--font-sans); color: var(--ink); white-space: nowrap;
}
.rf-seg__opt::before {  /* the ink fill: instant on, ghosts off */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--ink);
  opacity: 0; transition: opacity var(--rf-t-ghost) var(--rf-ghost-e);
}
.rf-seg__opt::after {   /* hover dots */
  content: ""; position: absolute; inset: 2px; z-index: -2; border-radius: inherit; pointer-events: none;
  background-color: var(--ink); -webkit-mask-image: var(--rf-dm-2); mask-image: var(--rf-dm-2); -webkit-mask-size: 8px 8px; mask-size: 8px 8px; opacity: 0;
}
.rf-seg__opt:hover::after { opacity: 1; }
.rf-seg__opt[aria-checked="true"] { color: var(--on-ink); }
.rf-seg__opt[aria-checked="true"]::before { opacity: 1; transition: none; }
.rf-seg--sm .rf-seg__opt { height: 26px; font-size: 12px; padding: 0 var(--space-2); }

/* ---------- Slider: a stepped track, a square 1-bit thumb ---------- */
.rf-slider { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; color: var(--rf-fg); }
.rf-slider__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.rf-slider__label { font: 600 13px/16px var(--font-sans); }
.rf-slider__val { font: 450 20px/24px var(--font-serif); font-variant-numeric: tabular-nums; }
.rf-slider__input {
  --pct: 50%;
  -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer;
}
.rf-slider__input::-webkit-slider-runnable-track {
  height: 10px; border: var(--rf-line) solid var(--ink); border-radius: var(--radius-xs);
  background: linear-gradient(to right, var(--ink) var(--pct), transparent var(--pct)), var(--rf-ticks, none), var(--sheet);
}
.rf-slider__input::-moz-range-track {
  height: 10px; border: var(--rf-line) solid var(--ink); border-radius: var(--radius-xs);
  background: linear-gradient(to right, var(--ink) var(--pct), transparent var(--pct)), var(--rf-ticks, none), var(--sheet);
}
.rf-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 22px; margin-top: -7.5px; border-radius: 2px;
  background: var(--sheet); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--sheet), inset 0 0 0 7px var(--ink);
}
.rf-slider__input::-moz-range-thumb {
  width: 10px; height: 18px; border-radius: 2px;
  background: var(--sheet); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--sheet), inset 0 0 0 7px var(--ink);
}
.rf-slider__input:active::-webkit-slider-thumb { background: var(--ink); box-shadow: inset 0 0 0 2px var(--sheet); }
.rf-slider__input:active::-moz-range-thumb { background: var(--ink); box-shadow: inset 0 0 0 2px var(--sheet); }
.rf-slider__input:focus-visible { outline: none; box-shadow: none; }
.rf-slider__input:focus-visible::-webkit-slider-thumb { box-shadow: inset 0 0 0 2px var(--sheet), inset 0 0 0 7px var(--ink), 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.rf-slider__input:focus-visible::-moz-range-thumb { box-shadow: inset 0 0 0 2px var(--sheet), inset 0 0 0 7px var(--ink), 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.rf-slider__scale { display: flex; justify-content: space-between; font-size: 12px; line-height: 16px; color: var(--rf-fg-soft); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .rf-btn.is-pressed { transform: none; }
  .rf-btn.is-ghost::after { animation: none; }
  .rf-turnspin::after { animation-duration: 3s; }
}

/* ==========================================================================
   Display + feedback
   ========================================================================== */

/* ---------- Card: a sheet on the page, a stack when it can be picked up ---------- */
.rf-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--sheet); color: var(--ink); border-radius: var(--radius-md);
  box-shadow: var(--shadow-page);
  --rf-fg: var(--ink); --rf-fg-soft: var(--ink-soft);
}
.rf-card__media { position: relative; overflow: hidden; border-radius: var(--radius-md) var(--radius-md) 0 0; border-bottom: 1px solid var(--rule-soft); }
.rf-card__body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-6); flex: 1; min-width: 0; }
.rf-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.rf-card__title { font: 600 20px/26px var(--font-serif); margin: 0; }
.rf-card__text { margin: 0; color: var(--rf-fg-soft); }
.rf-card__foot { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-6); border-top: 1px dotted var(--rule); }
.rf-card__foot > .rf-progress { flex: 1; }
.rf-card--flat { box-shadow: var(--shadow-hair); }
.rf-card--stack { box-shadow: var(--shadow-stack); }
.rf-card--ink { background: var(--ink); color: var(--on-ink); --rf-fg: var(--on-ink); --rf-fg-soft: var(--on-ink); box-shadow: none; }
.rf-card--ink .rf-card__foot { border-top-color: var(--on-ink); }
.rf-card--dense .rf-card__body { padding: var(--space-4); }
.rf-card--interactive { cursor: pointer; transition: transform 160ms var(--rf-settle); }
.rf-card--interactive::after { content: ""; position: absolute; left: 0; top: 0; right: -4px; bottom: -6px; z-index: -1; }
.rf-card--interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-stack); }
.rf-card--interactive:active { transform: translateY(0); }
.rf-card--interactive.is-pressed { background: var(--ink); color: var(--on-ink); --rf-fg: var(--on-ink); --rf-fg-soft: var(--on-ink); }
@media (max-width: 560px) { .rf-card__body { padding: var(--space-4); } .rf-card__foot { padding: var(--space-3) var(--space-4); } }

/* ---------- Badge + Tag ---------- */
.rf-badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; flex: none;
  border-radius: var(--radius-xs); border: 1px solid var(--ink); background: transparent; color: var(--ink);
  font: 600 12px/1 var(--font-sans); letter-spacing: .02em; white-space: nowrap; vertical-align: middle;
}
.rf-badge .rf-icon { width: 12px; height: 12px; margin-left: -2px; }
.rf-badge--solid { background: var(--ink); color: var(--on-ink); }
.rf-badge--tint { background: var(--tint-wash); border-color: transparent; color: var(--ink); }
.rf-badge--tint .rf-badge__dot { background: var(--tint); }
.rf-badge--alert { border-color: var(--tint); color: var(--tint); }
.rf-badge--soft { border-color: var(--rule-soft); color: var(--ink-soft); background: var(--sheet); }
.rf-badge__dot { width: 6px; height: 6px; background: currentColor; flex: none; }
.rf-badge__dither { width: 10px; height: 10px; flex: none; margin-left: -2px; }
.rf-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-full); background: var(--ink); color: var(--on-ink); font: 700 11px/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.rf-count--tint { background: var(--tint); color: var(--sheet); }

.rf-tag {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 10px; flex: none;
  border-radius: var(--radius-xs); background: var(--sheet); color: var(--ink); box-shadow: var(--shadow-hair);
  font: 500 13px/1 var(--font-sans);
}
.rf-tag:not(:has(.rf-tag__x)) { padding-right: 10px; }
.rf-tag__x { display: grid; place-items: center; width: 22px; height: 22px; border: 0; padding: 0; border-radius: 2px; background: none; color: var(--ink-soft); cursor: pointer; }
.rf-tag__x:hover { background: var(--ink); color: var(--on-ink); }
.rf-tag.is-leaving { animation: rf-leave 360ms var(--rf-wave) forwards; pointer-events: none; }
@keyframes rf-leave { from { opacity: .4; } to { opacity: 0; } }
.rf-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---------- Avatar: a dithered portrait ---------- */
.rf-avatar {
  --s: 40px; position: relative; display: inline-block; flex: none; width: var(--s); height: var(--s);
  border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 var(--rf-line) var(--ink);
  vertical-align: middle;
}
.rf-avatar__clip { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.rf-avatar__clip > i { position: absolute; inset: 0; }
.rf-avatar__solid { background: var(--paper); }
.rf-avatar__initials {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%;
  font: 500 calc(var(--s) * .4)/1 var(--font-serif); color: var(--ink); background: var(--sheet); letter-spacing: -.02em;
}
.rf-avatar__status {
  position: absolute; right: -1px; bottom: -1px; width: calc(var(--s) * .3); height: calc(var(--s) * .3); min-width: 9px; min-height: 9px;
  border-radius: 2px; border: 1.5px solid var(--ink); background: var(--sheet); box-shadow: 0 0 0 2px var(--paper);
}
.rf-avatar__status--online { background: var(--ink); }
.rf-avatar__status--away { background: var(--sheet); }
.rf-avatar__status--away::after { content: ""; position: absolute; inset: 0; background: var(--ink); -webkit-mask-image: var(--rf-dm-8); mask-image: var(--rf-dm-8); -webkit-mask-size: 8px 8px; mask-size: 8px 8px; }
.rf-avatars { display: inline-flex; align-items: center; }
.rf-avatars > .rf-avatar + .rf-avatar { margin-left: calc(var(--s) * -.28); }
.rf-avatars > .rf-avatar { box-shadow: 0 0 0 var(--rf-line) var(--ink), 0 0 0 4px var(--sheet); }
.rf-avatars__more { display: inline-grid; place-items: center; font: 600 12px/1 var(--font-sans); background: var(--ink); color: var(--on-ink); }

/* ---------- Tooltip ---------- */
.rf-tip {
  position: fixed; z-index: 90; max-width: 240px; padding: 6px 10px; pointer-events: none;
  background: var(--ink); color: var(--on-ink); border-radius: var(--radius-sm);
  font: 500 12px/16px var(--font-sans);
  animation: rf-appear 160ms var(--rf-wave) backwards;
}
.rf-tip[hidden] { display: none; }
.rf-tip::after {
  content: ""; position: absolute; left: var(--ax, 50%); bottom: -5px; width: 10px; height: 5px; margin-left: -5px;
  background: var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.rf-tip--below::after { bottom: auto; top: -5px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.rf-tip kbd { font: 600 11px/1 var(--font-sans); padding: 1px 4px; border: 1px solid var(--on-ink); border-radius: 2px; margin-left: 4px; }

/* ---------- Toast: arrives with a refresh flash, leaves a ghost ---------- */
.rf-toasts {
  position: fixed; z-index: 80; right: var(--space-6); bottom: var(--space-6);
  display: flex; flex-direction: column-reverse; gap: var(--space-3); width: min(380px, calc(100vw - 32px)); pointer-events: none;
}
@media (max-width: 560px) { .rf-toasts { right: 16px; left: 16px; bottom: 16px; width: auto; } }
.rf-toast {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-3); align-items: start;
  padding: var(--space-3) var(--space-3) var(--space-4) var(--space-4); pointer-events: auto;
  background: var(--sheet); color: var(--ink); border: var(--rf-line) solid var(--ink); border-radius: var(--radius-md);
  box-shadow: var(--shadow-hard);
}
.rf-toast > .rf-icon { margin-top: 3px; }
.rf-toast__title { font: 600 14px/20px var(--font-sans); margin: 0; }
.rf-toast__msg { font-size: 14px; line-height: 20px; color: var(--ink-soft); margin: 0; }
.rf-toast__actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.rf-toast__close { margin: -4px -4px 0 0; }
.rf-toast--alert { border-color: var(--tint); }
.rf-toast--alert > .rf-icon { color: var(--tint); }
.rf-toast__timer { position: absolute; left: var(--space-4); right: var(--space-4); bottom: 6px; display: flex; gap: 3px; }
.rf-toast__timer i { flex: 1; height: 3px; background: var(--ink); border-radius: 1px; animation: rf-tick var(--d, 1000ms) steps(1, end) forwards; animation-delay: calc(var(--n) * var(--d, 1000ms)); }
@keyframes rf-tick { to { opacity: .12; } }
.rf-toast:hover .rf-toast__timer i { animation-play-state: paused; }
.rf-toast.is-leaving { animation: rf-leave 520ms var(--rf-ghost-e) forwards; pointer-events: none; }

/* ---------- Modal: dithered scrim, the sheet arrives with a full refresh ---------- */
.rf-modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: var(--space-4); }
.rf-modal[hidden] { display: none; }
.rf-modal__scrim {
  position: absolute; inset: 0; background-color: var(--ink);
  -webkit-mask-image: var(--rf-dm-6); mask-image: var(--rf-dm-6); -webkit-mask-size: 8px 8px; mask-size: 8px 8px;
  animation: rf-appear 200ms var(--rf-wave) backwards;
}
.rf-modal__frame { position: relative; z-index: 1; display: flex; width: min(520px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.rf-modal__drop {  /* a dithered 1-bit drop shadow */
  position: absolute; inset: 0; transform: translate(8px, 8px); border-radius: var(--radius-md); pointer-events: none;
  background-color: var(--rf-drop, #000); -webkit-mask-image: var(--rf-dm-10); mask-image: var(--rf-dm-10); -webkit-mask-size: 8px 8px; mask-size: 8px 8px;
}
[data-theme="dark"] .rf-modal__drop { --rf-drop: var(--ink); -webkit-mask-image: var(--rf-dm-4); mask-image: var(--rf-dm-4); }
.rf-modal__panel {
  position: relative; display: flex; flex-direction: column; width: 100%; max-height: 100%; min-height: 0;
  background: var(--sheet); color: var(--ink); border-radius: var(--radius-md);
  box-shadow: 0 0 0 var(--rf-line) var(--ink);
  --rf-fg: var(--ink); --rf-fg-soft: var(--ink-soft);
}
.rf-modal--sm .rf-modal__frame { width: min(400px, 100%); }
.rf-modal--lg .rf-modal__frame { width: min(760px, 100%); }
.rf-modal--full .rf-modal__frame { width: min(980px, 100%); height: calc(100vh - 32px); height: calc(100dvh - 32px); }
.rf-modal--full .rf-modal__panel, .rf-modal--full .rf-modal__drop { border-radius: var(--radius-device); }
.rf-modal__head { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-6) var(--space-6) var(--space-2); }
.rf-modal__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rf-modal__title { font: 450 26px/32px var(--font-serif); margin: 0; letter-spacing: -.01em; }
.rf-modal__body { padding: var(--space-2) var(--space-6) var(--space-6); overflow-y: auto; min-height: 0; flex: 1; }
.rf-modal__foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-4) var(--space-6); border-top: 1px dotted var(--rule); }
.rf-modal.is-leaving { animation: rf-leave 300ms var(--rf-wave) forwards; }
@media (max-width: 560px) {
  .rf-modal__head { padding: var(--space-4) var(--space-4) var(--space-2); }
  .rf-modal__body { padding: var(--space-2) var(--space-4) var(--space-4); }
  .rf-modal__foot { padding: var(--space-3) var(--space-4); }
  .rf-modal__foot .rf-btn { flex: 1; }
}

/* ---------- Progress ---------- */
.rf-progress { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; color: var(--rf-fg); }
.rf-progress__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); font: 600 13px/16px var(--font-sans); }
.rf-progress__val { font: 450 15px/16px var(--font-serif); font-variant-numeric: tabular-nums; color: var(--rf-fg-soft); }
.rf-bar { position: relative; height: 10px; border: var(--rf-line) solid var(--ink); border-radius: var(--radius-xs); overflow: hidden; background: var(--sheet); }
.rf-bar__fill { position: absolute; inset: 1px; background: var(--ink); transform-origin: left center; transform: scaleX(var(--v, 0)); transition: transform 360ms steps(6, end); border-radius: 1px; }
.rf-bar--indeterminate .rf-bar__fill { transform: none; background: transparent; }
.rf-bar--indeterminate { --rf-dm-shimmer: var(--rf-dm-16); }
.rf-segs { display: flex; gap: 3px; height: 14px; }
.rf-segs__cell { position: relative; flex: 1; min-width: 3px; border: var(--rf-line) solid var(--ink); border-radius: 1px; background: var(--sheet); overflow: hidden; }
.rf-segs__cell > i { position: absolute; inset: 1px; }
.rf-segs__cell.is-full > i { background: var(--ink); }
.rf-segs__cell.is-new > i { animation: rf-appear 240ms var(--rf-wave) backwards; }
.rf-segs--thin { height: 8px; gap: 2px; }
.rf-segs--thin .rf-segs__cell { border-width: 1px; }
.rf-segs--tall { height: 22px; gap: 4px; }

.rf-battery { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--rf-fg); }
.rf-battery__body { position: relative; display: flex; gap: 2px; width: 46px; height: 22px; padding: 2px; border: var(--rf-line) solid var(--ink); border-radius: 3px; background: var(--sheet); }
.rf-battery__body::after { content: ""; position: absolute; right: -5px; top: 6px; width: 3px; height: 7px; background: var(--ink); border-radius: 0 1px 1px 0; }
.rf-battery__cell { position: relative; flex: 1; border-radius: 1px; overflow: hidden; }
.rf-battery__cell > i { position: absolute; inset: 0; }
.rf-battery__cell.is-full > i { background: var(--ink); }
.rf-battery__val { font: 500 15px/1 var(--font-serif); font-variant-numeric: tabular-nums; }
.rf-battery__bolt { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink); }
.rf-battery__bolt .rf-icon { filter: drop-shadow(1px 0 0 var(--sheet)) drop-shadow(-1px 0 0 var(--sheet)); }
.rf-battery.is-low .rf-battery__body { border-color: var(--tint); }
.rf-battery.is-low .rf-battery__body::after, .rf-battery.is-low .rf-battery__cell.is-full > i { background: var(--tint); }
.rf-battery.is-low .rf-battery__cell > .rf-dz { --rf-dc: var(--tint); }
.rf-battery.is-low .rf-battery__val { color: var(--tint); }
.rf-battery--sm .rf-battery__body { width: 30px; height: 15px; padding: 1.5px; gap: 1.5px; border-width: 1.25px; }
.rf-battery--sm .rf-battery__body::after { right: -4px; top: 4px; width: 2px; height: 5px; }
.rf-battery--sm .rf-battery__val { font: 600 12px/1 var(--font-sans); }
.rf-battery--lg .rf-battery__body { width: 76px; height: 34px; padding: 3px; gap: 3px; border-width: 2px; border-radius: 4px; }
.rf-battery--lg .rf-battery__body::after { right: -7px; top: 10px; width: 4px; height: 12px; }
.rf-battery--lg .rf-battery__val { font: 400 28px/1 var(--font-serif); }

/* reading-progress dots */
.rf-dots { display: inline-flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; color: var(--rf-fg); max-width: 100%; }
.rf-dots__row { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.rf-dot {
  position: relative; display: grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 0; background: none; color: inherit;
}
button.rf-dot { cursor: pointer; border-radius: 50%; }
.rf-dot > i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--rule); background: transparent; transition: background-color var(--rf-t-ghost) var(--rf-ghost-e), border-color var(--rf-t-ghost) var(--rf-ghost-e); }
.rf-dot.is-read > i { background: var(--ink); border-color: var(--ink); transition: none; }
.rf-dot.is-current > i { width: 10px; height: 10px; background: var(--tint); border-color: var(--tint); transition: none; }
button.rf-dot:hover > i { border-color: var(--ink); }
.rf-dots__text { font: 500 13px/16px var(--font-sans); color: var(--rf-fg-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* skeleton: sunk lines with the page-turn shimmer */
.rf-skel { display: flex; flex-direction: column; gap: 10px; }
.rf-skel__line { height: 12px; border-radius: 2px; background: var(--sunk); }
.rf-skel__line--title { height: 20px; width: 55%; margin-bottom: 4px; }
.rf-skel__media { aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: var(--sunk); }
.rf-skel .rf-shimmer::after { --rf-dc: var(--ink); opacity: .22; }

@media (prefers-reduced-motion: reduce) {
  .rf-bar__fill { transition: none; }
  .rf-segs__cell.is-new > i { animation: none; }
  .rf-turnspin::after { animation: none; }
  .rf-card--interactive { transition: none; }
  .rf-card--interactive:hover { transform: none; }
  .rf-toast.is-leaving, .rf-tag.is-leaving, .rf-modal.is-leaving { animation-duration: 1ms; }
}

/* ==========================================================================
   Signature: Dither, RefreshTransition, Reader
   ========================================================================== */

/* ---------- Dither: images built from 17 levels of 1-bit dots ---------- */
.rf-dither { position: relative; display: block; overflow: hidden; isolation: isolate; aspect-ratio: var(--ar, 4 / 3); background: var(--paper); color: var(--ink); }
.rf-dither--framed { box-shadow: 0 0 0 var(--rf-line) var(--ink); border-radius: var(--radius-sm); }
.rf-dither--round { border-radius: 50%; }
.rf-layer { position: absolute; inset: 0; background: var(--paper); }
.rf-layer > .rf-dz { position: absolute; inset: 0; }
.rf-layer--ink { background: var(--ink); }
.rf-layer--clear { background: transparent; }
.rf-dither__canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.rf-dither__cap { position: absolute; left: 8px; bottom: 8px; z-index: 2; padding: 3px 6px; border-radius: 2px; background: var(--sheet); color: var(--ink); font: 600 11px/14px var(--font-sans); box-shadow: 0 0 0 1px var(--ink); }
.rf-ramp { width: 100%; display: grid; grid-template-columns: repeat(17, minmax(0, 1fr)); gap: 0; border: var(--rf-line) solid var(--ink); border-radius: var(--radius-xs); overflow: hidden; background: var(--paper); }
.rf-ramp > span { position: relative; height: 40px; }
.rf-ramp > span > i { position: absolute; inset: 0; }
.rf-ramp--labels > span::after { content: attr(data-l); position: absolute; left: 0; right: 0; bottom: -18px; text-align: center; font: 500 10px/12px var(--font-sans); color: var(--rf-fg-soft); }
.rf-ramp--labels { margin-bottom: 20px; overflow: visible; }

/* ---------- RefreshTransition frame ---------- */
.rf-rt { position: relative; }
.rf-rt__stage { position: relative; }

/* ---------- Reader: paginated, turns with ghosts, full refresh every few pages ---------- */
.rf-reader {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--sheet); color: var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-page);
  --rf-fg: var(--ink); --rf-fg-soft: var(--ink-soft);
}
.rf-reader--device { border-radius: var(--radius-device); box-shadow: 0 0 0 var(--rf-line) var(--ink), 0 0 0 10px var(--paper), 0 0 0 11.5px var(--ink); margin: 12px; }
.rf-reader__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-6); border-bottom: 1px dotted var(--rule); }
.rf-reader__run { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rf-reader__book { font: italic 400 14px/18px var(--font-serif); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-reader__tools { display: flex; align-items: center; gap: var(--space-1); }
.rf-reader__page { position: relative; height: var(--rf-reader-h, 440px); overflow: hidden; outline: none; }
.rf-reader__page:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.rf-reader__flow {
  position: absolute; top: 28px; bottom: 28px; left: 48px; width: calc(100% - 96px);
  column-gap: 96px; column-fill: auto;
  font: 400 var(--rf-fs, 18px)/1.66 var(--font-serif); font-optical-sizing: auto;
  text-align: justify; hyphens: auto; -webkit-hyphens: auto;
  will-change: transform;
}
.rf-reader__flow p { margin: 0; text-indent: 1.5em; }
.rf-reader__flow h3 + p, .rf-reader__flow .rf-reader__break + p { text-indent: 0; }
.rf-reader__flow h3 + p::first-letter { float: left; font-size: 3.4em; line-height: .82; padding: .06em .08em 0 0; font-weight: 500; }
.rf-reader__flow h3 { margin: 1.2em 0 1em; text-align: center; font: 400 1.5em/1.2 var(--font-serif); letter-spacing: -.01em; break-after: avoid; }
.rf-reader__flow h3 small { display: block; margin-bottom: .6em; font: 700 11px/14px var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.rf-reader__break { text-align: center; margin: .7em 0; letter-spacing: .6em; color: var(--ink-soft); }
.rf-reader__zone { position: absolute; top: 0; bottom: 0; width: 30%; z-index: 5; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rf-reader__zone--prev { left: 0; cursor: w-resize; }
.rf-reader__zone--next { right: 0; cursor: e-resize; }
.rf-reader__zone:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.rf-reader__edge {
  position: absolute; top: 0; bottom: 0; left: 0; width: 18px; z-index: 6; pointer-events: none; opacity: 0;
  background-color: var(--ink); -webkit-mask-image: var(--rf-dm-8); mask-image: var(--rf-dm-8); -webkit-mask-size: 8px 8px; mask-size: 8px 8px;
}
.rf-reader__edge.is-next { animation: rf-edge-next var(--rf-t-turn) steps(8, end); }
.rf-reader__edge.is-prev { animation: rf-edge-prev var(--rf-t-turn) steps(8, end); }
@keyframes rf-edge-next { from { opacity: 1; transform: translateX(var(--w, 600px)); } to { opacity: 1; transform: translateX(-20px); } }
@keyframes rf-edge-prev { from { opacity: 1; transform: translateX(-20px); } to { opacity: 1; transform: translateX(var(--w, 600px)); } }
.rf-reader__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-6) var(--space-4); border-top: 1px dotted var(--rule); }
.rf-reader__left { font: 500 13px/16px var(--font-sans); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .rf-reader__flow { left: 22px; width: calc(100% - 44px); column-gap: 44px; top: 20px; bottom: 20px; }
  .rf-reader__head { padding-left: var(--space-4); }
  .rf-reader__foot { padding: var(--space-3) var(--space-4); }
  .rf-reader--device { margin: 10px; }
}
@media (prefers-reduced-motion: reduce) { .rf-reader__edge { display: none; } .rf-reader__flow { will-change: auto; } }

/* ==========================================================================
   Widgets
   ========================================================================== */

/* ---------- StatTile ---------- */
.rf-stat .rf-card__body { gap: var(--space-3); }
.rf-stat__top { display: flex; align-items: center; gap: var(--space-2); }
.rf-stat__top .rf-overline { flex: 1; }
.rf-stat__num { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.rf-stat__value { font: 350 44px/44px var(--font-serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums lining-nums; position: relative; }
.rf-stat__unit { font: 500 15px/20px var(--font-sans); color: var(--rf-fg-soft); }
.rf-stat__delta { display: inline-flex; align-items: center; gap: 4px; font: 600 13px/16px var(--font-sans); }
.rf-stat__delta--down { color: var(--tint); }
.rf-stat__spark { display: flex; align-items: flex-end; gap: 3px; height: 44px; }
.rf-stat__spark > span { position: relative; flex: 1; min-width: 3px; border-top: var(--rf-line) solid var(--ink); }
.rf-stat__spark > span > i { position: absolute; inset: 0; }
.rf-stat__spark > span.is-last { background: var(--ink); }
.rf-stat__foot { font-size: 13px; line-height: 18px; color: var(--rf-fg-soft); }

/* ---------- HeatGrid: sixteen greys, one square a day ---------- */
.rf-heat { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.rf-heat__wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; }
.rf-heat__days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; font: 500 10px/1 var(--font-sans); color: var(--rf-fg-soft); }
.rf-heat__days span { display: flex; align-items: center; }
.rf-heat__grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.rf-heat__cell { position: relative; aspect-ratio: 1; min-width: 0; border-radius: 1px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule-soft); }
.rf-heat__cell > i { position: absolute; inset: 0; border-radius: 1px; }
.rf-heat__cell.is-today { box-shadow: 0 0 0 1.5px var(--tint); z-index: 1; }
.rf-heat__cell.is-future { background: transparent; box-shadow: inset 0 0 0 1px var(--rule-soft); opacity: .5; }
.rf-heat__cell:hover { box-shadow: 0 0 0 1.5px var(--ink); z-index: 2; }
.rf-heat__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; font-size: 12px; line-height: 16px; color: var(--rf-fg-soft); }
.rf-heat__legend { display: inline-flex; align-items: center; gap: 3px; }
.rf-heat__legend .rf-heat__cell { width: 12px; }
.rf-heat__detail { position: relative; font-variant-numeric: tabular-nums; }

/* ---------- Book cover + NowReading ---------- */
.rf-book { position: relative; display: block; flex: none; width: var(--bw, 120px); aspect-ratio: 2 / 3; border-radius: 2px 4px 4px 2px; background: var(--sheet); color: var(--ink); box-shadow: 0 0 0 var(--rf-line) var(--ink), 3px 3px 0 0 var(--rule-soft); overflow: hidden; }
.rf-book .rf-dither { position: absolute; left: 0; right: 0; top: 0; height: 64%; aspect-ratio: auto; }
.rf-book__plate { position: absolute; left: 0; right: 0; bottom: 0; height: 36%; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 10px; border-top: var(--rf-line) solid var(--ink); background: var(--sheet); }
.rf-book__title { font: 500 calc(var(--bw, 120px) * .115)/1.15 var(--font-serif); letter-spacing: -.01em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rf-book__author { font: 600 calc(var(--bw, 120px) * .062)/1.2 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-book::before { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 1px; background: var(--rule-soft); z-index: 3; }
.rf-now { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.rf-now__info { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.rf-now__title { font: 450 26px/32px var(--font-serif); letter-spacing: -.01em; margin: 0; }
.rf-now__author { font: italic 400 16px/22px var(--font-serif); color: var(--rf-fg-soft); margin: 0; }
.rf-now__meta { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; margin-top: var(--space-2); }
.rf-now__progress { margin-top: var(--space-2); }
.rf-now__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
@media (max-width: 480px) { .rf-now { grid-template-columns: 1fr; } .rf-now .rf-book { --bw: 120px !important; } }

/* ---------- Forecast: the e-ink weather station ---------- */
.rf-wx__now { display: flex; align-items: center; gap: var(--space-4); }
.rf-wx__now .rf-icon { width: 48px; height: 48px; }
.rf-wx__temp { font: 300 56px/56px var(--font-serif); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.rf-wx__temp sup { font-size: .4em; vertical-align: top; position: relative; top: .35em; margin-left: 2px; }
.rf-wx__cond { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rf-wx__cond b { font: 600 15px/20px var(--font-sans); }
.rf-wx__cond span { font-size: 13px; line-height: 18px; color: var(--rf-fg-soft); }
.rf-wx__days { display: flex; flex-direction: column; margin-top: var(--space-2); }
.rf-wx__day { display: grid; grid-template-columns: 40px 20px 30px minmax(0, 1fr) 30px; align-items: center; gap: var(--space-2); height: 32px; border-top: 1px dotted var(--rule-soft); font-variant-numeric: tabular-nums; font-size: 14px; }
.rf-wx__day b { font-weight: 600; }
.rf-wx__lo { color: var(--rf-fg-soft); text-align: right; }
.rf-wx__hi { text-align: left; font-weight: 600; }
.rf-wx__range { position: relative; height: 8px; border-radius: 1px; background: var(--sunk); }
.rf-wx__range > i { position: absolute; top: 0; bottom: 0; left: var(--a); right: var(--b); border-radius: 1px; }
.rf-wx__range > b { position: absolute; top: -2px; bottom: -2px; width: 2px; left: var(--now); background: var(--tint); }
