/*
 * 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 iron, in gringotts-web's brand/gringotts.css).
 * Color carries meaning (Chris, 2026-10-23): blue (--h-primary) is only what can be tapped; navy and teal (--h-hai1y, from its logo) are HAi1Y
 * itself, never an action; values are text, bold with fixed-width digits; violet 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: #F9FAFB; --h-surface: #FFFFFF; --h-c1: #F5F7F9; --h-c2: #F0F2F5; --h-c3: #EBEEF1; --h-c4: #E7EAEE;
  --h-fg: #000000; --h-fg2: #1F242B; --h-outline: #5F6773; --h-line: #CBD2DA;
  --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 navy (teal in dark mode): 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 HAi1Y's if an app makes another color the active one (--h-primary). */
  --h-hai1y: #022A69; --h-on-hai1y: #FFFFFF; --h-hai1y-c: #CDF3F2; --h-on-hai1y-c: #000000;
  --h-value: var(--h-fg);
  --h-calm: #4E1DA2; --h-calm-c: #D9CCF8;
  --h-error: #B4232C; --h-error-c: #FEE2E2;
  --h-gain: #15692D; --h-loss: #B4232C; --h-cash: #64748B;
  --h-s1: #027894; --h-s2: #1D4ED8; --h-s3: #B45309; --h-s4: #4E1DA2; --h-s5: #BE185D;
  /* the same in both modes */
  --h-brand-a: #022A69; --h-brand-b: #027894; --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: #03C4BF; --h-brand-track: #022A69; --h-brand-surface: #022A69;
  --h-brand-on-surface: #FFFFFF; --h-brand-knob-a: #CDF3F2; --h-brand-knob-b: #03C4BF;
  --h-brand-on-knob: #022A69; --h-brand-chosen: #03C4BF; --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: #111418; --h-surface: #111418; --h-c1: #171B20; --h-c2: #1C2026; --h-c3: #232830; --h-c4: #2B313A;
  --h-fg: #FFFFFF; --h-fg2: #E6E8EB; --h-outline: #9AA3AE; --h-line: #3A414B;
  --h-primary: #6CB0FF; --h-on-primary: #000000; --h-primary-c: #1E3A8A; --h-on-primary-c: #FFFFFF; --h-tonal-text: #A9D0FF;
  --h-hai1y: #03C4BF; --h-on-hai1y: #000000; --h-hai1y-c: #024E7C; --h-on-hai1y-c: #FFFFFF;
  --h-value: #DADAE0; --h-calm: #C4B3F5; --h-calm-c: #45208A;
  --h-error: #FF8A8A; --h-error-c: #5F1414; --h-gain: #5BE38A; --h-loss: #FF8A8A; --h-cash: #94A3B8;
  --h-s1: #03C4BF; --h-s2: #6CB0FF; --h-s3: #FBBF24; --h-s4: #AB96EE; --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: #111418; --h-surface: #111418; --h-c1: #171B20; --h-c2: #1C2026; --h-c3: #232830; --h-c4: #2B313A;
    --h-fg: #FFFFFF; --h-fg2: #E6E8EB; --h-outline: #9AA3AE; --h-line: #3A414B;
    --h-primary: #6CB0FF; --h-on-primary: #000000; --h-primary-c: #1E3A8A; --h-on-primary-c: #FFFFFF; --h-tonal-text: #A9D0FF;
    --h-hai1y: #03C4BF; --h-on-hai1y: #000000; --h-hai1y-c: #024E7C; --h-on-hai1y-c: #FFFFFF;
    --h-value: #DADAE0; --h-calm: #C4B3F5; --h-calm-c: #45208A;
    --h-error: #FF8A8A; --h-error-c: #5F1414; --h-gain: #5BE38A; --h-loss: #FF8A8A; --h-cash: #94A3B8;
    --h-s1: #03C4BF; --h-s2: #6CB0FF; --h-s3: #FBBF24; --h-s4: #AB96EE; --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-bg: #000000; --h-fg: #FFFFFF; --h-fg2: #E6E8EB; --h-line: #3A414B; --h-outline: #9AA3AE; --h-surface: #000000; --h-c2: #1C2026;
  --h-primary: #6CB0FF; --h-on-primary: #000000; --h-hai1y: #03C4BF; --h-on-hai1y: #000000; --h-value: #DADAE0; --h-gain: #5BE38A; --h-loss: #FF8A8A;
  --h-s1: #03C4BF; --h-s2: #6CB0FF; --h-s3: #FBBF24; --h-s4: #AB96EE; --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 }   /* solid, as on Android: the pale button vanished on a tinted notice (1.05:1) */
.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: HAi1Y's logo grown long (.h-long, with the chat button), collapsing to its bubble (.h-hb) */
.h-compose { width: 100%; cursor: text }
.h-compose .h-cbox { flex: 1; min-width: 0; display: grid; padding: 10px 0 }
.h-compose textarea, .h-compose .h-ph { grid-area: 1 / 1; font: 16px/1.4 var(--h-font); color: #FFFFFF }
.h-compose textarea { resize: none; border: 0; padding: 0; background: none; max-height: 7em; overflow-y: auto; caret-color: #03C4BF; outline: none }
.h-compose .h-ph { color: rgba(255, 255, 255, 0.78); pointer-events: none }
.h-compose:has(textarea:focus-visible) { outline: 3px solid var(--h-primary); outline-offset: 2px } .h-compose textarea:focus-visible { outline: none }
.h-compose textarea:disabled { opacity: 0.6 }
.h-compose .h-send { flex: none; align-self: flex-end; width: 48px; height: 48px; margin: 0 0 6px; border-radius: 50%; border: 0; display: grid;
  place-items: center; background: #FFFFFF; color: #0A1330; cursor: pointer }
/* Send appears once there's something to send; until then the words run to the end */
.h-compose:not(:has(.h-send:not([hidden]))) { padding-right: 20px } .h-compose .h-send:not([hidden]) { animation: h-pop 0.15s ease-out }
@keyframes h-pop { from { transform: scale(0.6); opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .h-compose .h-send { animation: none !important } }

/* 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 */
/* GroupedTable: items in groups, compared on the same columns, in one table. A group opens with a full-width heading row
   (one header cell spanning every column, so it has no column bars); item rows keep theirs. */
.h-gtable-wrap { overflow-x: auto; border: 1px solid var(--h-outline); border-radius: 12px; background: var(--h-surface) }
.h-gtable-wrap:focus-visible { outline: 3px solid var(--h-primary); outline-offset: 2px }
.h-gtable { width: 100%; border-collapse: collapse; font-size: 15px }
.h-gtable th, .h-gtable td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--h-line); border-left: 1px solid var(--h-line) }
.h-gtable tr > :first-child { border-left: 0 }
.h-gtable thead th { border-top: 0; font-size: 13px; font-weight: 700; color: var(--h-fg2) }
.h-gtable .h-gtable-group th { background: var(--h-c2); color: var(--h-fg); font: 800 15px var(--h-display); border-left: 0 }
.h-gtable td { color: var(--h-fg) }
/* SettingsTable, NameValueTable: a real table holding information only (each name a row header, its value bold); what
   people can do with it sits in a short summary right after it (.h-table-sum), never in a cell */
.h-table { border: 1px solid var(--h-outline); border-radius: 12px; overflow: hidden; background: var(--h-surface) }
.h-table table { width: 100%; border-collapse: collapse }
.h-table th, .h-table td { padding: 13px 12px; border-top: 1px solid var(--h-line); font-size: 15px; vertical-align: middle }
.h-table tr:first-child > * { border-top: 0 }
.h-table th { text-align: left; font-weight: 400; color: var(--h-fg) }
.h-table th small { display: block; font-size: 11px; font-weight: 700; color: var(--h-fg2) }
.h-table td { text-align: right; color: var(--h-value); font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere }
.h-table-sum { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px }
[data-basics] .h-table-sum { margin-top: -2px }
.h-btn.h-change { display: inline-flex; align-items: center; gap: 6px; padding-inline: 14px 18px }
.h-btn.h-change svg { width: 18px; height: 18px; flex: none }
/* An ⓘ with its words: the action color, no fill (it opens a thought bubble) */
.h-infobtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 8px; border: 0; border-radius: 99px;
  background: none; color: var(--h-primary); font: 700 15px var(--h-font); cursor: pointer; text-align: left }
.h-infobtn svg { width: 20px; height: 20px; flex: none }
.h-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px }

/* ThoughtBubble: an ⓘ's words beside it, a tail of small circles back to it; placed by hai1y.js (fixed to the window,
   so no scrolling box cuts it off); scrolls inside when longer than the window */
.h-thought { position: absolute; width: 0; height: 0; overflow: visible; z-index: 1000 }
.h-thought-body { position: fixed; z-index: 1000; width: max-content; overflow: auto; overscroll-behavior: contain;
  padding: 14px 16px; border-radius: 22px; background: var(--h-c3); color: var(--h-fg); border: 1.5px solid var(--h-outline);
  box-shadow: 0 12px 28px -14px rgb(0 0 0 / 0.5); font: 15px/1.45 var(--h-font); text-align: left; white-space: normal }
.h-thought-body > * + * { margin-top: 8px }
.h-thought-body p { margin: 0 }
.h-thought-body dl { margin: 0; display: grid; gap: 10px }
.h-thought-body dt { font-weight: 700 }
.h-thought-body dd { margin: 2px 0 0 }
.h-thought-dot { position: fixed; z-index: 1000; border-radius: 50%; background: var(--h-c3); border: 1.5px solid var(--h-outline) }

/* 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 }
/* Confirmed: locked at the end with a check, saying what happened */
.h-track.h-locked { cursor: default } .h-track.h-locked > span:first-child { padding: 0 60px 0 20px }
.h-track.h-locked .h-knob { left: auto; right: 5px } .h-track.h-locked .h-knob svg { width: 24px; height: 24px }
.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 }
/* The chat button: HAi1Y's mark (Chris, 2026-10-28), its circle lined up with the edge and its speech tail hanging past it;
   the button grows into the pill, the mark staying in its end. 72px marks: the circle's outer edge is 64px across. */
.h-hb { position: relative; width: 64px; height: 64px; border-radius: 50%; border: 0; padding: 0; background: none; display: grid; place-items: center;
  cursor: pointer; box-shadow: 0 10px 22px -12px #022A69 }
.h-hbmark { flex: none; width: 60px; height: 60px; display: grid; place-items: center }
.h-hbmark svg { margin: -6px; transform: translate(-1.44px, .72px) }
.h-hb .h-hbmark { width: 64px; height: 64px } .h-hb .h-hbmark svg { margin: -4px }
/* The corner (Chris, 2026-10-29): what a HAi1Y bubble is for, at its top right, an icon or a count; white, ringed in the logo's teal */
.h-corner { position: absolute; top: -4px; right: -4px; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 13px; display: grid;
  place-items: center; background: #FFFFFF; color: #0A1330; border: 2px solid #03C4BF; font: 700 12px/1 var(--h-font) }
.h-corner svg { width: 14px; height: 14px }
.h-compose .h-send svg { width: 22px; height: 22px }
/* HAi1Y's logo grown long (Chris, 2026-10-28): the mark's navy carried along a pill edged in its teal, the mark (open)
   in the round end with its tail hanging past the edge. The chat button's preview, and the prompt field. */
.h-long { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 0 4px 0 0; border-radius: 32px; color: #FFFFFF;
  background: linear-gradient(90deg, #0A1330 62px, #024E7C 55%, var(--h-brand-b)); border: 2px solid #03C4BF; box-shadow: 0 12px 24px -12px var(--h-brand-b) }
.h-long .h-hbmark { align-self: flex-end }
.h-nudge { gap: 4px }
.h-nudge > button.h-open { flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; gap: 8px; padding: 0; background: none; border: 0; color: inherit; text-align: left; font: inherit; cursor: pointer }
.h-nudge .h-t { display: grid; padding: 8px 0; font-size: 14px; line-height: 1.3 }
.h-nudge .h-name { display: flex; align-items: center; gap: 8px; font-size: 13px }
.h-nudge .h-new { padding: 1px 8px; border-radius: 99px; background: #FFFFFF; color: #022A69; font: 700 12px/1.4 var(--h-font) }
.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 } }

/* HAi1Y's mark, spinning (h-sphere spin): its symbol turns like a globe twice, under 5 seconds (WCAG 2.2.2), and again on
   hover; with reduced motion it stays still */
.h-spin .h-globe { transform-box: fill-box; transform-origin: center; animation: h-globe 2.4s ease-in-out 2 }
.h-spin:hover .h-globe { animation: h-globe-again 2.4s ease-in-out 1 }
@keyframes h-globe { 0% { transform: scaleX(1) } 50% { transform: scaleX(-1) } 100% { transform: scaleX(1) } }
@keyframes h-globe-again { 0% { transform: scaleX(1) } 50% { transform: scaleX(-1) } 100% { transform: scaleX(1) } }
@media (prefers-reduced-motion: reduce) { .h-spin .h-globe, .h-spin:hover .h-globe { animation: none } }

/* SlideSwitch's handle (Chris, 2026-10-28): the 👍 emoji on a dark circle (the brand's track end) ringed in the knob's
   color; it turns from down to up (still with reduced motion) */
.h-slide [role="switch"] .h-knob { background: var(--h-brand-surface); border: 3px solid var(--h-brand-knob-b) }
.h-slide .h-knob .h-thumb { font-size: 22px; line-height: 1; transform: rotate(180deg); transition: transform 0.35s ease }
.h-slide [aria-checked="true"] .h-knob .h-thumb { transform: rotate(0deg) }
.h-track.h-dragging .h-knob .h-thumb { transition: none }   /* while dragged, the thumb follows the finger */
@media (prefers-reduced-motion: reduce) { .h-slide .h-knob .h-thumb { transition: none } }
