:root {
  --bg: #f3f1ec;
  --card: #fffdf9;
  --ink: #1c1b19;
  --soft: rgba(28, 27, 25, 0.56);
  --line: rgba(28, 27, 25, 0.12);
  --accent: #2f6df6;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 8px 12px;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.sc { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); width: min(356px, 100%); padding: 14px 14px 10px; border-radius: 24px; background: var(--card); box-shadow: 0 0 0 1px var(--line), inset 0 1px 0 #ffffff, 0 34px 50px -34px rgba(50, 40, 20, 0.45), 0 4px 10px -6px rgba(50, 40, 20, 0.2); }

.sc__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 0 2px; }
.sc__title { display: grid; gap: 1px; }
.sc__title strong { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc__state { display: block; height: 15px; overflow: hidden; font-size: 11.5px; line-height: 15px; color: var(--soft); white-space: nowrap; }
.sc__state span { display: block; }
.sc__ring { position: relative; display: grid; place-items: center; width: 44px; height: 44px; }
.sc__ring svg { position: absolute; inset: 0; width: 44px; height: 44px; transform: rotate(-90deg); fill: none; stroke-width: 4; }
.sc__rail { stroke: rgba(28, 27, 25, 0.1); }
.sc__arc { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 0 100; }
.sc__ring b { position: relative; font-size: 11.5px; font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* the page */
.sc__page { position: relative; margin-top: 10px; padding: 11px 13px; border-radius: 14px; background: #f7f4ee; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.sc__text { font-size: clamp(11.5px, 3.300vh, 13px); line-height: 1.52; color: rgba(28, 27, 25, 0.86); }
.sc__text mark { --p: 0%; --c: #f3b33d; color: inherit; border-radius: 3px; padding: 1px 0; background: linear-gradient(color-mix(in srgb, var(--c) 46%, transparent), color-mix(in srgb, var(--c) 46%, transparent)) 0 0 / var(--p) 100% no-repeat; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: opacity 0.25s; }
.sc__text mark[data-mark="1"] { --c: #5aa9e6; }
.sc__text mark[data-mark="2"] { --c: #e8798d; }
.sc[data-focus="0"] mark:not([data-mark="0"]), .sc[data-focus="1"] mark:not([data-mark="1"]), .sc[data-focus="2"] mark:not([data-mark="2"]) { opacity: 0.3; }
.sc__scan { position: absolute; left: 0; right: 0; top: 0; height: 38px; margin-top: -38px; background: linear-gradient(rgba(47, 109, 246, 0), rgba(47, 109, 246, 0.16)); border-bottom: 1.500px solid var(--accent); opacity: 0; pointer-events: none; }

/* the sources */
.sc__sources { list-style: none; display: grid; margin-top: 6px; }
.sc__sources button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; height: clamp(26px, 7.400vh, 30px); padding: 0 6px; border-radius: 9px; text-align: left; font-size: 12.5px; opacity: 0.35; transition: background-color 0.2s; }
.sc__sources i { display: block; width: 14px; height: 8px; border-radius: 3px; background: var(--c); }
.sc__sources span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc__sources b { font-weight: 700; font-variant-numeric: tabular-nums; }
.sc__sources b span { overflow: visible; }
.sc__sources button[aria-pressed="true"] { background: rgba(28, 27, 25, 0.07); }
.sc__sources button:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
@media (hover: hover) { .sc__sources button:hover { background: rgba(28, 27, 25, 0.05); } }

.sc__again { justify-self: start; display: flex; align-items: center; gap: 7px; height: 32px; margin-top: 2px; padding: 0 8px 0 6px; border-radius: 9px; font-size: 12.5px; font-weight: 660; color: var(--accent); }
.sc__spin { display: grid; place-items: center; flex: none; width: 16px; height: 16px; }
.sc__again svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.600; stroke-linecap: round; stroke-linejoin: round; }
.sc__again:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }

.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #17171a; stroke: #ffffff; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); z-index: 6; }

@media (prefers-reduced-motion: reduce) { .sc__text mark, .sc__sources button { transition: none; } }
