:root {
  --hb-space-1: .25rem;
  --hb-space-2: .5rem;
  --hb-space-3: .75rem;
  --hb-space-4: 1rem;
  --hb-space-5: 1.25rem;
  --hb-space-6: 1.5rem;
  --hb-space-8: 2rem;
  --hb-space-10: 2.5rem;
  --hb-space-12: 3rem;
  --hb-radius-sm: .375rem;
  --hb-radius: .625rem;
  --hb-radius-lg: .875rem;
  --hb-radius-pill: 999px;
  --hb-target: 44px;
  --hb-sidebar-width: 242px;
  --hb-topbar-height: 64px;
  --hb-form-width: 55rem;
  --hb-content-width: 100rem;
  --hb-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hb-title-size: clamp(1.625rem, 1.35rem + 1vw, 2.125rem);
  --hb-section-size: 1.125rem;
  --hb-body-size: .9375rem;
  --hb-small-size: .8125rem;
  --hb-label-size: .75rem;
  --hb-value-size: clamp(1.25rem, 1rem + 1vw, 1.875rem);
  --hb-line-tight: 1.2;
  --hb-line-body: 1.55;
  --hb-on-primary: #fff;
  --hb-on-danger: #fff;
  --hb-paper: #fff;
  --hb-ink: #000;
  --hb-scrim: rgb(7 11 17 / 65%);
  --bs-body-bg: var(--hb-bg);
  --bs-body-color: var(--hb-text);
  --bs-border-color: var(--hb-border);
  --bs-secondary-color: var(--hb-muted);
  --bs-tertiary-bg: var(--hb-surface-2);
  --bs-emphasis-color: var(--hb-text);
  --bs-link-color: var(--hb-link);
  --bs-link-hover-color: var(--hb-link-hover);
  --bs-primary-bg-subtle: var(--hb-primary-soft);
}

:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --hb-bg: #12171f;
  --hb-bg-soft: #151b24;
  --hb-sidebar: #151b24;
  --hb-surface: #1a222d;
  --hb-surface-2: #202a36;
  --hb-surface-3: #293545;
  --hb-border: #354151;
  --hb-border-strong: #6d7d90;
  --hb-text: #f1f4f8;
  --hb-text-soft: #c6cfdb;
  --hb-muted: #a6b4c5;
  --hb-sidebar-text: var(--hb-text);
  --hb-sidebar-muted: var(--hb-muted);
  --hb-brand: #b34135;
  --hb-brand-soft: #3e2829;
  --hb-primary: #2873ad;
  --hb-primary-hover: #205e93;
  --hb-primary-edge: #6aaaf0;
  --hb-primary-soft: #203950;
  --hb-accent: #f5a498;
  --hb-link: #a8cbfb;
  --hb-link-hover: #d7e9ff;
  --hb-focus: #9ac9ff;
  --hb-success: #91ddb4;
  --hb-success-surface: #19362b;
  --hb-warning: #f7ce82;
  --hb-warning-surface: #40321d;
  --hb-danger: #ffb1ab;
  --hb-danger-surface: #46282c;
  --hb-danger-action: #bc3041;
  --hb-danger-action-hover: #9b2736;
  --hb-danger-action-ink: #ff8289;
  --hb-danger-action-edge: var(--hb-danger-action-ink);
  --hb-info: #a7cef9;
  --hb-info-surface: #1e344c;
  --hb-neutral: #c6cfdb;
  --hb-neutral-surface: #2c3745;
  --hb-shadow-sm: 0 1px 2px rgb(0 0 0 / 20%);
  --hb-shadow: 0 8px 24px rgb(0 0 0 / 23%);
}

html[data-theme="light"] {
  color-scheme: light;
  --hb-bg: #f3f5f8;
  --hb-bg-soft: #edf1f5;
  --hb-sidebar: #fbfcfd;
  --hb-surface: #fff;
  --hb-surface-2: #f6f8fb;
  --hb-surface-3: #edf1f5;
  --hb-border: #d8dee6;
  --hb-border-strong: #788698;
  --hb-text: #172231;
  --hb-text-soft: #34455a;
  --hb-muted: #506277;
  --hb-sidebar-text: var(--hb-text);
  --hb-sidebar-muted: var(--hb-muted);
  --hb-brand: #a5372c;
  --hb-brand-soft: #f8ebe8;
  --hb-primary: #235c92;
  --hb-primary-hover: #194979;
  --hb-primary-edge: var(--hb-primary);
  --hb-primary-soft: #e6f0fb;
  --hb-accent: #8e2c24;
  --hb-link: #23558d;
  --hb-link-hover: #163c69;
  --hb-focus: #2864a5;
  --hb-success: #1c6042;
  --hb-success-surface: #e6f3ec;
  --hb-warning: #684510;
  --hb-warning-surface: #fff1d8;
  --hb-danger: #8e2a2c;
  --hb-danger-surface: #fbe9ea;
  --hb-danger-action: #b42332;
  --hb-danger-action-hover: #941c2a;
  --hb-danger-action-ink: #a52131;
  --hb-danger-action-edge: var(--hb-danger-action);
  --hb-info: #235786;
  --hb-info-surface: #e7f0fb;
  --hb-neutral: #445467;
  --hb-neutral-surface: #edf1f5;
  --hb-shadow-sm: 0 1px 2px rgb(18 36 56 / 7%);
  --hb-shadow: 0 8px 24px rgb(18 36 56 / 12%);
}

@media screen {
  html { font-size: 16px; }
  body.app-body {
    font-family: var(--hb-font);
    font-size: var(--hb-body-size);
    line-height: var(--hb-line-body);
    font-variant-numeric: tabular-nums;
  }
  .app-main-content h1 {
    color: var(--hb-text);
    font-size: var(--hb-title-size);
    line-height: var(--hb-line-tight);
    font-weight: 680;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
  }
  .app-main-content :is(h2, h3, legend) {
    font-size: var(--hb-section-size);
    line-height: var(--hb-line-tight);
    font-weight: 650;
  }
}
