/*
 * HAi1Y Design System for the web: the same components as hai1y-design-android. The whole palette is HAi1Y; each app
 * adds one brand through the --h-brand-* tokens (Gringotts: gold and vault navy, in gringotts-web's brand/gringotts.css).
 * Color carries meaning (Chris, 2026-10-23): blue (--h-primary) is only what can be tapped; purple (--h-hai1y) is HAi1Y
 * itself, never an action; values are text, bold with fixed-width digits; teal is calm information.
 * Put class "h-theme" on <html> (or any container). Light by default; dark with the viewer's system setting,
 * data-theme="dark" on the root, or the h-dark class.
 */
.h-theme {
  --h-bg: #FBFAFF; --h-surface: #FFFFFF; --h-c1: #F7F4FE; --h-c2: #F2EEFC; --h-c3: #EDE8FA; --h-c4: #E8E2F8;
  --h-fg: #000000; --h-fg2: #1C1726; --h-outline: #6E6680; --h-line: #CFC7E0;
  --h-primary: #1D4ED8; --h-on-primary: #FFFFFF; --h-primary-c: #DCE7FE; --h-on-primary-c: #000000;
  --h-tonal-text: #1D4ED8;   /* 5.4:1 on the tinted button */
  /* HAi1Y's own purple: its identity and states (section tints, headings, its badges, your chat bubbles), never an
     action. Brighter than the active color's container in dark mode, so information stands out (Chris, 2026-10-23). Stays purple if an app makes another color the active one (--h-primary). */
  --h-hai1y: #4E1DA2; --h-on-hai1y: #FFFFFF; --h-hai1y-c: #D9CCF8; --h-on-hai1y-c: #000000;
  --h-value: var(--h-fg);
  --h-calm: #0F766E; --h-calm-c: #CCFBF1;
  --h-error: #B4232C; --h-error-c: #FEE2E2;
  --h-gain: #15692D; --h-loss: #B4232C; --h-cash: #64748B;
  --h-s1: #4E1DA2; --h-s2: #1D4ED8; --h-s3: #B45309; --h-s4: #0F766E; --h-s5: #BE185D;
  /* the same in both modes */
  --h-brand-a: #6528CC; --h-brand-b: #1D4ED8; --h-on-brand: #FFFFFF; --h-alert-a: #DC2626; --h-alert-b: #991B1B;
  /* where an app's brand goes: HAi1Y's own by default */
  --h-brand-fill: #AB96EE; --h-brand-track: #3A1672; --h-brand-surface: #3A1672;
  --h-brand-on-surface: #FFFFFF; --h-brand-knob-a: #E2D9F8; --h-brand-knob-b: #AB96EE;
  --h-brand-on-knob: #3A1672; --h-brand-chosen: #AB96EE; --h-brand-on-chosen: #000000;
  --h-font: "Atkinson Hyperlegible", Verdana, "Segoe UI", sans-serif;
  --h-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --h-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  background: var(--h-bg); color: var(--h-fg); font-family: var(--h-font); font-variant-numeric: tabular-nums;
}
.h-theme.h-dark, :root[data-theme="dark"] .h-theme, :root[data-theme="dark"].h-theme {
  --h-bg: #120B1F; --h-surface: #120B1F; --h-c1: #1A1129; --h-c2: #1F1530; --h-c3: #261A3A; --h-c4: #2E2145;
  --h-fg: #FFFFFF; --h-fg2: #EAE4F5; --h-outline: #9B91B0; --h-line: #44395A;
  --h-primary: #6CB0FF; --h-on-primary: #000000; --h-primary-c: #1E3A8A; --h-on-primary-c: #FFFFFF; --h-tonal-text: #A9D0FF;
  --h-hai1y: #C4B3F5; --h-on-hai1y: #000000; --h-hai1y-c: #45208A; --h-on-hai1y-c: #FFFFFF;
  --h-value: #DADAE0; --h-calm: #5EEAD4; --h-calm-c: #134E4A;
  --h-error: #FF8A8A; --h-error-c: #5F1414; --h-gain: #5BE38A; --h-loss: #FF8A8A; --h-cash: #94A3B8;
  --h-s1: #AB96EE; --h-s2: #6CB0FF; --h-s3: #FBBF24; --h-s4: #2DD4BF; --h-s5: #F472B6; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .h-theme:not(.h-light), :root:not([data-theme="light"]).h-theme:not(.h-light) {
    --h-bg: #120B1F; --h-surface: #120B1F; --h-c1: #1A1129; --h-c2: #1F1530; --h-c3: #261A3A; --h-c4: #2E2145;
    --h-fg: #FFFFFF; --h-fg2: #EAE4F5; --h-outline: #9B91B0; --h-line: #44395A;
    --h-primary: #6CB0FF; --h-on-primary: #000000; --h-primary-c: #1E3A8A; --h-on-primary-c: #FFFFFF; --h-tonal-text: #A9D0FF;
    --h-hai1y: #C4B3F5; --h-on-hai1y: #000000; --h-hai1y-c: #45208A; --h-on-hai1y-c: #FFFFFF;
    --h-value: #DADAE0; --h-calm: #5EEAD4; --h-calm-c: #134E4A;
    --h-error: #FF8A8A; --h-error-c: #5F1414; --h-gain: #5BE38A; --h-loss: #FF8A8A; --h-cash: #94A3B8;
    --h-s1: #AB96EE; --h-s2: #6CB0FF; --h-s3: #FBBF24; --h-s4: #2DD4BF; --h-s5: #F472B6; color-scheme: dark;
  }
}
/* OnBlack: a chart on true black in either mode */
h-on-black, .h-on-black { display: block; background: #000000; color: #FFFFFF; border-radius: 16px; padding: 12px;
  --h-fg: #FFFFFF; --h-fg2: #EAE4F5; --h-line: #44395A; --h-outline: #9B91B0; --h-surface: #000000; --h-c2: #1F1530;
  --h-primary: #6CB0FF; --h-on-primary: #000000; --h-hai1y: #C4B3F5; --h-on-hai1y: #000000; --h-value: #DADAE0; --h-gain: #5BE38A; --h-loss: #FF8A8A;
  --h-s1: #AB96EE; --h-s2: #6CB0FF; --h-s3: #FBBF24; --h-s4: #2DD4BF; --h-s5: #F472B6 }

.h-theme *, .h-theme *::before, .h-theme *::after { box-sizing: border-box }
.h-theme :focus-visible { outline: 3px solid var(--h-primary); outline-offset: 2px }
.h-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.h-btn { font: 700 15px var(--h-font); border-radius: 99px; min-height: 44px; padding: 8px 18px; cursor: pointer; border: 0;
  background: var(--h-primary); color: var(--h-on-primary) }
/* The secondary button (Chris, 2026-10-23): action-blue text on a pale blue fill, as HAi1Y's reply buttons; it reads
   as a button on any surface and stays quieter than the solid one. (.h-outline kept as its old name.) */
.h-btn.h-outline, .h-btn.h-tonal { background: var(--h-primary-c); color: var(--h-tonal-text); border: 0 }
.h-btn.h-text { background: transparent; color: var(--h-primary); padding-inline: 10px }
.h-iconbtn { width: 44px; height: 44px; display: inline-grid; place-items: center; background: none; border: 0; border-radius: 50%;
  color: var(--h-primary); cursor: pointer; flex: none }
.h-iconbtn svg { width: 20px; height: 20px }
.h-value { color: var(--h-value); font-weight: 600; font-variant-numeric: tabular-nums }

/* Heading, Spinner, Problem */
.h-heading { font: 700 18px/1.25 var(--h-font); margin: 0; color: var(--h-fg) }
.h-spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--h-c4); border-top-color: var(--h-hai1y);
  animation: h-spin 0.9s linear infinite; display: inline-block }
@keyframes h-spin { to { transform: rotate(360deg) } }
h-loading { display: grid; place-items: center; min-height: 120px; padding: 24px }
.h-problem { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 16px }

/* ProgressBar, Waiting */
h-progress, h-waiting { display: block }
.h-progress { display: grid; gap: 6px }
.h-progress .h-title { font: 700 15px var(--h-font) }
.h-progress .h-track { height: 10px; border-radius: 5px; background: var(--h-brand-track); overflow: hidden }
.h-progress .h-fill { height: 100%; border-radius: 5px; background: var(--h-brand-fill); transition: width 0.4s ease }
.h-progress .h-row { display: flex; gap: 10px; font-size: 14px; flex-wrap: wrap }
.h-progress .h-left { color: var(--h-fg2) }
.h-progress .h-done { color: var(--h-gain); font-weight: 700 }
.h-progress .h-stop { color: var(--h-error); font-weight: 700 }
.h-progress.h-run .h-fill { width: 30%; animation: h-slide 1.6s ease-in-out infinite }
@keyframes h-slide { from { transform: translateX(-110%) } to { transform: translateX(360%) } }

/* PeriodPicker, SegmentedSetting */
.h-period { display: flex; border: 1px solid var(--h-line); border-radius: 99px; padding: 3px; gap: 3px; background: var(--h-c1) }
.h-period button { flex: 1; min-height: 40px; border: 0; border-radius: 99px; background: none; font: 700 14px var(--h-font); color: var(--h-fg); cursor: pointer }
.h-period button[aria-checked="true"] { background: var(--h-primary); color: var(--h-on-primary) }
.h-seg { display: grid; gap: 8px }
.h-seg .h-bar { display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--h-brand-surface) }
.h-seg .h-bar button { flex: 1; min-height: 44px; border: 0; border-radius: 99px; background: none; font: 700 14px var(--h-font);
  color: var(--h-brand-on-surface); cursor: pointer; padding: 6px 8px }
.h-seg .h-bar button[aria-checked="true"] { background: var(--h-brand-chosen); color: var(--h-brand-on-chosen) }
.h-titlerow { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700 }

/* CollapsibleCard, CollapsibleGroup, InfoRow, ChoiceRow */
.h-card { border: 1px solid var(--h-line); border-radius: 16px; background: var(--h-c1); overflow: hidden }
.h-card > .h-head { display: flex; width: 100%; align-items: center; gap: 12px; padding: 14px 16px; background: none; border: 0;
  text-align: left; cursor: pointer; color: var(--h-fg); font: inherit }
.h-card > .h-head .h-t { flex: 1; min-width: 0; display: grid; gap: 2px }
.h-card > .h-head .h-t b { font-size: 16px }
.h-card.h-large > .h-head .h-t b { font-size: 19px }
.h-card > .h-head .h-t small { color: var(--h-fg2); font-size: 13px }
.h-card .h-chev { color: var(--h-primary); transition: transform 0.2s; display: grid }
.h-card[data-open="true"] .h-chev { transform: rotate(180deg) }
.h-card > .h-body { padding: 0 16px 14px; display: grid; gap: 4px }
.h-card[data-open="false"] > .h-body { display: none }
.h-inforow { display: flex; align-items: center; min-height: 48px; gap: 8px; border-top: 1px solid var(--h-line) }
.h-inforow:first-child { border-top: 0 }
.h-inforow span { flex: 1 }
.h-choice { display: flex; align-items: center; gap: 6px }
.h-choice > button.h-pick { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 16px; border-radius: 99px;
  border: 1.5px solid var(--h-primary); background: var(--h-primary-c); color: var(--h-fg); font: 700 15px var(--h-font); cursor: pointer; text-align: left }
.h-choice > button.h-pick span { flex: 1 }
.h-choice[data-dim="true"] > button.h-pick { opacity: 0.55 }

/* Notice */
.h-notice { border-radius: 16px; padding: 14px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start }
.h-notice .h-badge { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; grid-row: span 3 }
.h-notice .h-badge svg { width: 20px; height: 20px }
.h-notice h3 { margin: 0; font: 700 16px var(--h-font) }
.h-notice p { margin: 0; font-size: 15px; color: var(--h-fg2) }
.h-notice .h-btn { justify-self: start; margin-top: 6px }
.h-notice.h-brand { background: var(--h-hai1y-c) } .h-notice.h-brand .h-badge { background: var(--h-hai1y); color: var(--h-on-hai1y) }
.h-notice.h-info { background: var(--h-calm-c) } .h-notice.h-info .h-badge { background: var(--h-calm); color: var(--h-surface) }
.h-notice.h-caution { background: var(--h-error-c) } .h-notice.h-caution .h-badge { background: var(--h-error); color: var(--h-surface) }
.h-notice.h-quiet { background: var(--h-c2) } .h-notice.h-quiet .h-badge { background: var(--h-c4); color: var(--h-fg) }

/* Hai1yPromptField */
.h-prompt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 16px 6px 6px; border-radius: 99px;
  border: 2px solid var(--h-primary); background: var(--h-surface); color: var(--h-fg2); font: 16px var(--h-font); cursor: pointer; text-align: left }
.h-prompt span { flex: 1 }
.h-prompt svg.h-search { width: 20px; height: 20px; color: var(--h-primary) }

/* RichText */
.h-rich { display: grid; gap: 6px; font-size: 16px; line-height: 1.5 }
.h-rich p { margin: 0 }
.h-rich ul, .h-rich ol { margin: 0; padding-left: 1.4em; display: grid; gap: 4px }

/* Rows */
.h-switchrow { display: flex; align-items: center; gap: 12px; min-height: 56px; width: 100%; background: none; border: 0; text-align: left;
  color: var(--h-fg); font: inherit; cursor: pointer; padding: 0 }
.h-switchrow .h-t { flex: 1 } .h-switchrow .h-t small { display: block; font-size: 13px; color: var(--h-fg2) }
.h-switch { width: 52px; height: 32px; border-radius: 99px; background: var(--h-c4); border: 2px solid var(--h-outline); position: relative; flex: none; transition: background 0.2s }
.h-switch::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--h-outline); top: 6px; left: 6px; transition: all 0.2s }
[aria-checked="true"] .h-switch { background: var(--h-primary); border-color: var(--h-primary) }
[aria-checked="true"] .h-switch::after { width: 24px; height: 24px; top: 2px; left: 22px; background: var(--h-on-primary) }
.h-detail { display: flex; gap: 12px; font-size: 15px }
.h-detail > span:first-child { width: 110px; flex: none; color: var(--h-fg2) }
.h-soon { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--h-surface) 50%, transparent); color: var(--h-outline) }
.h-soon > div { flex: 1 } .h-soon small { display: block }
.h-initials { border-radius: 50%; background: var(--h-hai1y); color: var(--h-on-hai1y); display: inline-grid; place-items: center; font-weight: 700 }
/* A gain or loss: ▲ green / ▼ red on a tint of the same; the arrow carries it without color */
.h-change { display: inline-block; font: 700 14px var(--h-font); padding: 2px 10px; border-radius: 99px; white-space: nowrap; font-variant-numeric: tabular-nums }
.h-change.h-up { color: var(--h-gain); background: color-mix(in srgb, var(--h-gain) 14%, transparent) }
.h-change.h-down { color: var(--h-loss); background: color-mix(in srgb, var(--h-loss) 14%, transparent) }
.h-pill { display: inline-block; font: 700 14px var(--h-font); padding: 3px 10px; border-radius: 99px; border: 1.5px solid currentColor }
.h-pill.h-filled { border-color: transparent; background: color-mix(in srgb, currentColor 14%, transparent) }
.h-stat b { display: block; font: 700 20px var(--h-font); font-variant-numeric: tabular-nums }
.h-stat small { font-size: 13px; color: var(--h-fg2) }

/* Section */
.h-section { border-radius: 18px; background: var(--h-c1); overflow: hidden; display: grid }
.h-section::before { content: ""; height: 4px; background: linear-gradient(90deg, var(--h-brand-a), var(--h-brand-b)) }
.h-section > .h-shead { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px }
.h-section > .h-shead h3 { margin: 0; flex: 1; font: 700 17px var(--h-font); color: var(--h-hai1y) }
.h-section > .h-sbody { padding: 6px 16px 16px; display: grid; gap: 10px }
.h-section.h-highlight { background: var(--h-hai1y-c); border: 2px solid transparent;
  background-image: linear-gradient(var(--h-hai1y-c), var(--h-hai1y-c)), linear-gradient(90deg, var(--h-brand-a), var(--h-brand-b));
  background-origin: border-box; background-clip: padding-box, border-box; box-shadow: 0 10px 28px -14px var(--h-brand-a) }

/* SettingsTable, NameValueTable, StagedSettings, BasicsAndExpert */
.h-table { border: 1px solid var(--h-outline); border-radius: 12px; overflow: hidden; background: var(--h-surface) }
.h-table .h-r { display: flex; align-items: center; min-height: 48px; padding-left: 12px; gap: 12px; border-top: 1px solid var(--h-line) }
.h-table .h-r:first-child { border-top: 0 }
.h-table .h-n { flex: 1; font-size: 15px; display: grid }
.h-table .h-n small { font-size: 11px; font-weight: 700; color: var(--h-fg2); text-transform: none }
.h-table .h-v { color: var(--h-value); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums }
.h-table .h-gap { width: 12px; flex: none }
.h-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px }

/* SettingInfo, SettingEditor, FullTextOverlay (dialogs) */
dialog.h-panel { border: 0; border-radius: 24px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--h-c3); color: var(--h-fg) }
dialog.h-panel::backdrop { background: rgb(0 0 0 / 0.45) }
dialog.h-panel .h-pbody { padding: 22px; display: grid; gap: 12px; max-height: 80vh; overflow: auto }
dialog.h-panel h2 { margin: 0; font: 700 20px var(--h-font) }
dialog.h-panel h4 { margin: 6px 0 0; font: 700 14px var(--h-font) }
dialog.h-panel p { margin: 0 }
dialog.h-panel input[type="range"] { width: 100%; accent-color: var(--h-primary) }
dialog.h-panel select { font: 16px var(--h-font); min-height: 44px; border-radius: 10px; padding: 0 10px }
dialog.h-full { border: 0; background: transparent; max-width: min(560px, calc(100vw - 32px)) }
dialog.h-full::backdrop { background: rgb(0 0 0 / 0.6) }
dialog.h-full div { background: var(--h-surface, #fff); color: var(--h-fg, #000); padding: 20px; border-radius: 18px; font-size: 17px }

/* Truncated */
.h-trunc { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; background: none; border: 0; padding: 0; text-align: left;
  font: inherit; color: inherit; width: 100% }
button.h-trunc { cursor: pointer }

/* Toggles: SlideToConfirm, SlideSwitch */
.h-slide { display: grid; gap: 8px }
.h-track { position: relative; height: 56px; border-radius: 99px; background: var(--h-brand-surface); color: var(--h-brand-on-surface);
  display: grid; place-items: center; font: 700 14px var(--h-font); user-select: none; touch-action: none; border: 1px solid var(--h-line); cursor: pointer }
.h-knob { position: absolute; top: 5px; left: 5px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--h-brand-knob-a), var(--h-brand-knob-b)); color: var(--h-brand-on-knob); font-size: 20px;
  box-shadow: 0 4px 12px -4px var(--h-brand-knob-b); transition: transform 0.25s ease }
.h-track.h-dragging .h-knob { transition: none }
.h-slide .h-state { font-size: 14px; color: var(--h-fg2) }

/* Chat: ChatBubble, ReplyButtons, Hai1yButton */
.h-bubble-wrap { display: flex }
.h-bubble-wrap.h-you { justify-content: flex-end }
.h-bubble { max-width: min(520px, 86%); border-radius: 16px; padding: 10px 12px; background: var(--h-c3); font-size: 16px }
.h-you .h-bubble { background: var(--h-hai1y-c); color: var(--h-on-hai1y-c) }
.h-bubble > small { display: block; font-size: 12px; margin-bottom: 2px }
.h-replies { display: grid; gap: 8px }
.h-replies button { min-height: 52px; border-radius: 16px; border: 2px solid var(--h-primary); background: var(--h-primary-c);
  color: var(--h-on-primary-c); font: 700 16px var(--h-font); padding: 6px 16px; text-align: left; cursor: pointer }
.h-hb { position: relative; width: 64px; height: 64px; border-radius: 50%; border: 0; padding: 0; background: none; cursor: pointer }
.h-hb .h-count { position: absolute; top: -2px; right: -4px; min-width: 22px; padding: 3px 6px; border-radius: 99px; background: var(--h-error);
  color: #FFFFFF; font: 700 12px/1 var(--h-font) }
.h-nudge { display: flex; align-items: center; gap: 10px; padding: 8px 4px 8px 8px; border-radius: 32px; color: var(--h-on-brand);
  background: linear-gradient(135deg, var(--h-brand-a), var(--h-brand-b)); box-shadow: 0 12px 24px -12px var(--h-brand-b) }
.h-nudge > button.h-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: inherit; text-align: left; font: inherit; cursor: pointer }
.h-nudge .h-t { display: grid; font-size: 14px; line-height: 1.3 } .h-nudge .h-t b { font-size: 13px }
.h-nudge .h-iconbtn { color: #FFFFFF }

/* Charts */
.h-chart { display: grid; gap: 8px }
.h-chart .h-sum { font-size: 15px; color: var(--h-fg2) }
.h-chart svg { width: 100%; height: auto; display: block; overflow: visible }
.h-chart svg text { font-family: var(--h-font); fill: var(--h-fg2) }
.h-chart .h-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px }
.h-chart table, .h-cmp-table table { border-collapse: collapse; width: 100%; font-size: 14px }
.h-chart th, .h-chart td, .h-cmp-table th, .h-cmp-table td { padding: 6px 8px; border-top: 1px solid var(--h-line); text-align: right; font-variant-numeric: tabular-nums }
.h-chart th:first-child, .h-chart td:first-child, .h-cmp-table th:first-child, .h-cmp-table td:first-child { text-align: left }
.h-cmp-table { overflow-x: auto }
.h-gainrow { display: grid; grid-template-columns: 64px 1fr 76px; align-items: center; gap: 8px; font-size: 14px; min-height: 30px }
.h-gainrow .h-barbox { position: relative; height: 16px }
.h-gainrow .h-barbox::before { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--h-line) }
.h-gainrow .h-b { position: absolute; top: 0; height: 16px; border-radius: 4px }
.h-gainrow .h-amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums }
.h-readout { display: grid; gap: 4px; background: var(--h-surface); border: 1px solid var(--h-line); border-radius: 14px; padding: 10px 12px }
.h-readout .h-when { font-size: 13px; color: var(--h-fg2) }
.h-readout .h-rrow { display: grid; grid-template-columns: 10px 1fr auto auto auto; align-items: center; gap: 8px; font-size: 14px }
.h-readout .h-rrow .h-value { text-align: right; white-space: nowrap }
.h-readout .h-rrow b { min-width: 52px }
.h-chip { border-radius: 8px; padding: 1px 7px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; min-width: 76px }
.h-chip.h-o { border: 1.5px solid currentColor } .h-chip.h-t { background: color-mix(in srgb, currentColor 15%, transparent) }
.h-steps { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; pointer-events: none; padding: 0 4px;
  opacity: 0; transition: opacity 0.4s }
.h-steps[data-show="true"] { opacity: 1 }
.h-steps .h-col { display: grid; gap: 6px; pointer-events: auto }
.h-steps button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--h-primary); color: var(--h-on-primary); font: 700 18px var(--h-font); cursor: pointer }
.h-steps button:disabled { opacity: 0.35; cursor: default }
.h-donut { display: flex; gap: 18px; align-items: center; flex-wrap: wrap }
.h-donut svg { width: 140px; height: 140px; flex: none }
.h-legend { display: grid; gap: 6px; font-size: 14px; min-width: 0 }
.h-legend .h-li { display: flex; gap: 8px; align-items: center }
.h-legend .h-dot { width: 12px; height: 12px; border-radius: 50%; flex: none }
.h-legend .h-li span:nth-child(2) { flex: 1 }

@media (prefers-reduced-motion: reduce) { .h-progress.h-run .h-fill, .h-spinner { animation: none } .h-progress.h-run .h-fill { width: 45% } }

/* SheetScroll (staysInSheet): a scroll area inside a sheet that never drags the sheet itself */
.h-sheet-scroll { overflow: auto; overscroll-behavior: contain }

/* MarkdownText (h-markdown): HAi1Y's Markdown */
.h-md { display: grid; gap: 8px; font-size: 16px; line-height: 1.5 }
.h-md p, .h-md ul, .h-md ol, .h-md blockquote, .h-md .h-md-h { margin: 0 }
.h-md ul, .h-md ol { padding-left: 1.4em; display: grid; gap: 4px }
.h-md .h-md-sub { margin-left: 1.2em }
.h-md .h-md-h { font: 700 17px var(--h-font) }
.h-md a { color: var(--h-primary); text-decoration: underline }
.h-md code { font-family: var(--h-mono); font-size: 0.9em; background: var(--h-c4); padding: 1px 5px; border-radius: 6px }
.h-md .h-md-code { font-family: var(--h-mono); font-size: 14px; background: var(--h-c4); padding: 10px; border-radius: 10px; overflow-x: auto; margin: 0 }
.h-md blockquote { border-left: 3px solid var(--h-line); padding-left: 10px; color: var(--h-fg2) }
.h-md .h-md-table { overflow-x: auto; border: 1px solid var(--h-outline); border-radius: 12px }
.h-md table { border-collapse: collapse; width: 100%; font-size: 15px }
.h-md th, .h-md td { padding: 8px 12px; text-align: left; border-top: 1px solid var(--h-line) }
.h-md thead th { border-top: 0; font-weight: 700 }
.h-md tbody th { font-weight: 400 }
.h-md td { color: var(--h-value); font-weight: 600; font-variant-numeric: tabular-nums }
.h-readout .h-rrow.h-plotted { grid-template-columns: 10px 1fr auto }

/* ViewBanner (h-view-banner) */
h-view-banner { display: block; position: sticky; top: 0; z-index: 10 }
.h-view-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; background: var(--h-surface);
  transition: transform 0.25s ease }
.h-view-banner.h-away { transform: translateY(-100%) }
.h-view-banner h1 { margin: 0; font: 700 22px var(--h-font) }
@media (prefers-reduced-motion: reduce) { .h-view-banner { transition: none } }
