/*
 * LihonT site: Material Design 3.
 *
 * Colour roles, type scale, shape and elevation follow the Material 3 specification.
 * Light and dark schemes follow the system and can be forced with data-theme on <html>.
 * An accent swaps the colour roles of one page: data-accent="rose" (LihonB), "gold" (support).
 * No third-party code, fonts or images are loaded.
 */

/* ---------- colour roles: purple scheme (default) ---------- */

:root {
  color-scheme: light dark;

  --md-sys-color-primary: #6750a4;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #eaddff;
  --md-sys-color-on-primary-container: #21005d;
  --md-sys-color-secondary: #625b71;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #e8def8;
  --md-sys-color-on-secondary-container: #1d192b;
  --md-sys-color-tertiary: #7d5260;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #ffd8e4;
  --md-sys-color-on-tertiary-container: #31111d;
  --md-sys-color-error: #b3261e;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #f9dedc;
  --md-sys-color-on-error-container: #410e0b;
  --md-sys-color-surface: #fef7ff;
  --md-sys-color-on-surface: #1d1b20;
  --md-sys-color-on-surface-variant: #49454f;
  --md-sys-color-outline: #79747e;
  --md-sys-color-outline-variant: #cac4d0;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f7f2fa;
  --md-sys-color-surface-container: #f3edf7;
  --md-sys-color-surface-container-high: #ece6f0;
  --md-sys-color-surface-container-highest: #e6e0e9;
  --md-sys-color-inverse-surface: #322f35;
  --md-sys-color-inverse-on-surface: #f5eff7;
  --md-sys-color-inverse-primary: #d0bcff;
  --md-sys-color-success: #1b6d3c;
  --md-sys-color-success-container: #b5f2c5;
  --md-sys-color-on-success-container: #00210c;
  --md-sys-color-warning-container: #ffdeae;
  --md-sys-color-on-warning-container: #281900;
  --md-sys-color-scrim: #000000;

  --md-sys-shape-xs: 4px;
  --md-sys-shape-sm: 8px;
  --md-sys-shape-md: 12px;
  --md-sys-shape-lg: 16px;
  --md-sys-shape-xl: 28px;
  --md-sys-shape-full: 9999px;

  --md-sys-elevation-1: 0 1px 2px rgb(0 0 0 / 0.3), 0 1px 3px 1px rgb(0 0 0 / 0.15);
  --md-sys-elevation-2: 0 1px 2px rgb(0 0 0 / 0.3), 0 2px 6px 2px rgb(0 0 0 / 0.15);
  --md-sys-elevation-3: 0 1px 3px rgb(0 0 0 / 0.3), 0 4px 8px 3px rgb(0 0 0 / 0.15);

  --md-sys-motion-easing: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);

  --font-sans: Roboto, "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --page-gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --md-sys-color-primary: #d0bcff;
    --md-sys-color-on-primary: #381e72;
    --md-sys-color-primary-container: #4f378b;
    --md-sys-color-on-primary-container: #eaddff;
    --md-sys-color-secondary: #ccc2dc;
    --md-sys-color-on-secondary: #332d41;
    --md-sys-color-secondary-container: #4a4458;
    --md-sys-color-on-secondary-container: #e8def8;
    --md-sys-color-tertiary: #efb8c8;
    --md-sys-color-on-tertiary: #492532;
    --md-sys-color-tertiary-container: #633b48;
    --md-sys-color-on-tertiary-container: #ffd8e4;
    --md-sys-color-error: #f2b8b5;
    --md-sys-color-on-error: #601410;
    --md-sys-color-error-container: #8c1d18;
    --md-sys-color-on-error-container: #f9dedc;
    --md-sys-color-surface: #141218;
    --md-sys-color-on-surface: #e6e0e9;
    --md-sys-color-on-surface-variant: #cac4d0;
    --md-sys-color-outline: #938f99;
    --md-sys-color-outline-variant: #49454f;
    --md-sys-color-surface-container-lowest: #0f0d13;
    --md-sys-color-surface-container-low: #1d1b20;
    --md-sys-color-surface-container: #211f26;
    --md-sys-color-surface-container-high: #2b2930;
    --md-sys-color-surface-container-highest: #36343b;
    --md-sys-color-inverse-surface: #e6e0e9;
    --md-sys-color-inverse-on-surface: #322f35;
    --md-sys-color-inverse-primary: #6750a4;
    --md-sys-color-success: #99d6a9;
    --md-sys-color-success-container: #00531f;
    --md-sys-color-on-success-container: #b5f2c5;
    --md-sys-color-warning-container: #5e4200;
    --md-sys-color-on-warning-container: #ffdeae;
  }
}

:root[data-theme="dark"] {
  --md-sys-color-primary: #d0bcff;
  --md-sys-color-on-primary: #381e72;
  --md-sys-color-primary-container: #4f378b;
  --md-sys-color-on-primary-container: #eaddff;
  --md-sys-color-secondary: #ccc2dc;
  --md-sys-color-on-secondary: #332d41;
  --md-sys-color-secondary-container: #4a4458;
  --md-sys-color-on-secondary-container: #e8def8;
  --md-sys-color-tertiary: #efb8c8;
  --md-sys-color-on-tertiary: #492532;
  --md-sys-color-tertiary-container: #633b48;
  --md-sys-color-on-tertiary-container: #ffd8e4;
  --md-sys-color-error: #f2b8b5;
  --md-sys-color-on-error: #601410;
  --md-sys-color-error-container: #8c1d18;
  --md-sys-color-on-error-container: #f9dedc;
  --md-sys-color-surface: #141218;
  --md-sys-color-on-surface: #e6e0e9;
  --md-sys-color-on-surface-variant: #cac4d0;
  --md-sys-color-outline: #938f99;
  --md-sys-color-outline-variant: #49454f;
  --md-sys-color-surface-container-lowest: #0f0d13;
  --md-sys-color-surface-container-low: #1d1b20;
  --md-sys-color-surface-container: #211f26;
  --md-sys-color-surface-container-high: #2b2930;
  --md-sys-color-surface-container-highest: #36343b;
  --md-sys-color-inverse-surface: #e6e0e9;
  --md-sys-color-inverse-on-surface: #322f35;
  --md-sys-color-inverse-primary: #6750a4;
  --md-sys-color-success: #99d6a9;
  --md-sys-color-success-container: #00531f;
  --md-sys-color-on-success-container: #b5f2c5;
  --md-sys-color-warning-container: #5e4200;
  --md-sys-color-on-warning-container: #ffdeae;
}

/* ---------- accent: rose (LihonB) ---------- */

:root[data-accent="rose"] {
  --md-sys-color-primary: #9a405f;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #ffd9e1;
  --md-sys-color-on-primary-container: #3f001a;
  --md-sys-color-secondary: #74565d;
  --md-sys-color-secondary-container: #f4dde1;
  --md-sys-color-on-secondary-container: #2b151b;
  --md-sys-color-tertiary: #7c5733;
  --md-sys-color-tertiary-container: #ffddb8;
  --md-sys-color-on-tertiary-container: #2b1700;
  --md-sys-color-surface: #fff8f8;
  --md-sys-color-on-surface: #22191b;
  --md-sys-color-on-surface-variant: #524346;
  --md-sys-color-outline: #857375;
  --md-sys-color-outline-variant: #d7c1c4;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #fff0f2;
  --md-sys-color-surface-container: #fceaec;
  --md-sys-color-surface-container-high: #f6e4e6;
  --md-sys-color-surface-container-highest: #f0dee0;
  --md-sys-color-inverse-surface: #382e30;
  --md-sys-color-inverse-on-surface: #ffecee;
  --md-sys-color-inverse-primary: #ffb1c6;
}

@media (prefers-color-scheme: dark) {
  :root[data-accent="rose"]:not([data-theme="light"]) {
    --md-sys-color-primary: #ffb1c6;
    --md-sys-color-on-primary: #5f1132;
    --md-sys-color-primary-container: #7c2948;
    --md-sys-color-on-primary-container: #ffd9e1;
    --md-sys-color-secondary: #e2bdc5;
    --md-sys-color-secondary-container: #5b3f47;
    --md-sys-color-on-secondary-container: #ffd9e1;
    --md-sys-color-tertiary: #f0bd93;
    --md-sys-color-tertiary-container: #613f20;
    --md-sys-color-on-tertiary-container: #ffddb8;
    --md-sys-color-surface: #1a1113;
    --md-sys-color-on-surface: #f0dee0;
    --md-sys-color-on-surface-variant: #d7c1c4;
    --md-sys-color-outline: #9f8c8f;
    --md-sys-color-outline-variant: #524346;
    --md-sys-color-surface-container-lowest: #140c0e;
    --md-sys-color-surface-container-low: #22191b;
    --md-sys-color-surface-container: #261d1f;
    --md-sys-color-surface-container-high: #312829;
    --md-sys-color-surface-container-highest: #3c3234;
    --md-sys-color-inverse-surface: #f0dee0;
    --md-sys-color-inverse-on-surface: #22191b;
    --md-sys-color-inverse-primary: #9a405f;
  }
}

:root[data-accent="rose"][data-theme="dark"] {
  --md-sys-color-primary: #ffb1c6;
  --md-sys-color-on-primary: #5f1132;
  --md-sys-color-primary-container: #7c2948;
  --md-sys-color-on-primary-container: #ffd9e1;
  --md-sys-color-secondary: #e2bdc5;
  --md-sys-color-secondary-container: #5b3f47;
  --md-sys-color-on-secondary-container: #ffd9e1;
  --md-sys-color-tertiary: #f0bd93;
  --md-sys-color-tertiary-container: #613f20;
  --md-sys-color-on-tertiary-container: #ffddb8;
  --md-sys-color-surface: #1a1113;
  --md-sys-color-on-surface: #f0dee0;
  --md-sys-color-on-surface-variant: #d7c1c4;
  --md-sys-color-outline: #9f8c8f;
  --md-sys-color-outline-variant: #524346;
  --md-sys-color-surface-container-lowest: #140c0e;
  --md-sys-color-surface-container-low: #22191b;
  --md-sys-color-surface-container: #261d1f;
  --md-sys-color-surface-container-high: #312829;
  --md-sys-color-surface-container-highest: #3c3234;
  --md-sys-color-inverse-surface: #f0dee0;
  --md-sys-color-inverse-on-surface: #22191b;
  --md-sys-color-inverse-primary: #9a405f;
}

/* ---------- accent: gold (support page) ---------- */

:root[data-accent="gold"] {
  --md-sys-color-primary: #765b00;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #ffdf9e;
  --md-sys-color-on-primary-container: #241a00;
  --md-sys-color-secondary: #6b5d3f;
  --md-sys-color-secondary-container: #f4e0bb;
  --md-sys-color-on-secondary-container: #241a04;
  --md-sys-color-surface: #fff8f1;
  --md-sys-color-on-surface: #1f1b13;
  --md-sys-color-on-surface-variant: #4d4639;
  --md-sys-color-outline: #7f7667;
  --md-sys-color-outline-variant: #d0c5b4;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #fff2dc;
  --md-sys-color-surface-container: #faecd6;
  --md-sys-color-surface-container-high: #f4e6d0;
  --md-sys-color-surface-container-highest: #eee0cb;
  --md-sys-color-inverse-surface: #353027;
  --md-sys-color-inverse-on-surface: #f9efe2;
  --md-sys-color-inverse-primary: #e9c349;
}

@media (prefers-color-scheme: dark) {
  :root[data-accent="gold"]:not([data-theme="light"]) {
    --md-sys-color-primary: #e9c349;
    --md-sys-color-on-primary: #3e2e00;
    --md-sys-color-primary-container: #5b4300;
    --md-sys-color-on-primary-container: #ffdf9e;
    --md-sys-color-secondary: #d7c4a0;
    --md-sys-color-secondary-container: #52452a;
    --md-sys-color-on-secondary-container: #f4e0bb;
    --md-sys-color-surface: #17130b;
    --md-sys-color-on-surface: #eae1d4;
    --md-sys-color-on-surface-variant: #d0c5b4;
    --md-sys-color-outline: #998f80;
    --md-sys-color-outline-variant: #4d4639;
    --md-sys-color-surface-container-lowest: #110e07;
    --md-sys-color-surface-container-low: #1f1b13;
    --md-sys-color-surface-container: #231f17;
    --md-sys-color-surface-container-high: #2e2921;
    --md-sys-color-surface-container-highest: #39342b;
    --md-sys-color-inverse-surface: #eae1d4;
    --md-sys-color-inverse-on-surface: #353027;
    --md-sys-color-inverse-primary: #765b00;
  }
}

:root[data-accent="gold"][data-theme="dark"] {
  --md-sys-color-primary: #e9c349;
  --md-sys-color-on-primary: #3e2e00;
  --md-sys-color-primary-container: #5b4300;
  --md-sys-color-on-primary-container: #ffdf9e;
  --md-sys-color-secondary: #d7c4a0;
  --md-sys-color-secondary-container: #52452a;
  --md-sys-color-on-secondary-container: #f4e0bb;
  --md-sys-color-surface: #17130b;
  --md-sys-color-on-surface: #eae1d4;
  --md-sys-color-on-surface-variant: #d0c5b4;
  --md-sys-color-outline: #998f80;
  --md-sys-color-outline-variant: #4d4639;
  --md-sys-color-surface-container-lowest: #110e07;
  --md-sys-color-surface-container-low: #1f1b13;
  --md-sys-color-surface-container: #231f17;
  --md-sys-color-surface-container-high: #2e2921;
  --md-sys-color-surface-container-highest: #39342b;
  --md-sys-color-inverse-surface: #eae1d4;
  --md-sys-color-inverse-on-surface: #353027;
  --md-sys-color-inverse-primary: #765b00;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.5px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: var(--md-sys-color-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code, pre { font-family: var(--font-mono); }
code {
  padding: 1px 6px;
  border-radius: var(--md-sys-shape-xs);
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
  font-size: 0.875em;
  letter-spacing: 0;
}
strong { font-weight: 600; }
::selection { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }

:focus-visible {
  outline: 3px solid var(--md-sys-color-secondary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 16px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: var(--md-sys-shape-full);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- type scale (Material 3) ---------- */

.t-display-lg { font-size: clamp(40px, 7vw, 57px); line-height: 1.12; letter-spacing: -0.25px; font-weight: 400; }
.t-display-md { font-size: clamp(34px, 5.6vw, 45px); line-height: 1.16; letter-spacing: 0; font-weight: 400; }
.t-headline-lg { font-size: clamp(26px, 4vw, 32px); line-height: 1.25; letter-spacing: 0; font-weight: 400; }
.t-headline-md { font-size: 28px; line-height: 36px; letter-spacing: 0; font-weight: 400; }
.t-headline-sm { font-size: 24px; line-height: 32px; letter-spacing: 0; font-weight: 400; }
.t-title-lg { font-size: 22px; line-height: 28px; letter-spacing: 0; font-weight: 400; }
.t-title-md { font-size: 16px; line-height: 24px; letter-spacing: 0.15px; font-weight: 500; }
.t-title-sm { font-size: 14px; line-height: 20px; letter-spacing: 0.1px; font-weight: 500; }
.t-body-lg { font-size: 16px; line-height: 24px; letter-spacing: 0.5px; }
.t-body-md { font-size: 14px; line-height: 20px; letter-spacing: 0.25px; }
.t-body-sm { font-size: 12px; line-height: 16px; letter-spacing: 0.4px; }
.t-label-lg { font-size: 14px; line-height: 20px; letter-spacing: 0.1px; font-weight: 500; }
.t-label-md { font-size: 12px; line-height: 16px; letter-spacing: 0.5px; font-weight: 500; }
.t-muted { color: var(--md-sys-color-on-surface-variant); }
.t-primary { color: var(--md-sys-color-primary); }

/* ---------- layout ---------- */

.page {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.section { padding-block: clamp(40px, 7vw, 80px); }

.section__head {
  display: grid;
  gap: 12px;
  max-width: 720px;
  margin-bottom: clamp(24px, 4vw, 40px);
}
.section__head--center { margin-inline: auto; text-align: center; justify-items: center; }
.section__head .t-label-lg { color: var(--md-sys-color-primary); }

main { display: block; }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

.stack { display: grid; gap: 16px; }
.cluster { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- icons ---------- */

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  font-size: 24px;
  fill: currentColor;
  flex: none;
}
.icon--18 { font-size: 18px; }
.icon--20 { font-size: 20px; }
.icon--32 { font-size: 32px; }

/* ---------- state layer and ripple ---------- */

/* Every interactive surface carries a state layer in its own content colour (hover 8%, focus and press 10%). */
.state, .btn, .icon-btn, .tabs a, .drawer__list a, a.list__item, .download, .accordion summary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.fab { overflow: hidden; isolation: isolate; }
.state::before, .btn::before, .icon-btn::before, .tabs a::before, .drawer__list a::before,
a.list__item::before, .download::before, .accordion summary::before, .fab::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: currentColor;
  opacity: 0;
  transition: opacity 150ms var(--md-sys-motion-easing);
  pointer-events: none;
}
.state:hover::before, .btn:hover::before, .icon-btn:hover::before, .tabs a:hover::before,
.drawer__list a:hover::before, a.list__item:hover::before, .download:hover::before,
.accordion summary:hover::before, .fab:hover::before { opacity: 0.08; }
.state:focus-visible::before, .btn:focus-visible::before, .icon-btn:focus-visible::before,
.tabs a:focus-visible::before, .drawer__list a:focus-visible::before, a.list__item:focus-visible::before,
.download:focus-visible::before, .accordion summary:focus-visible::before, .fab:focus-visible::before,
.btn:active::before, .icon-btn:active::before, .fab:active::before { opacity: 0.1; }

.ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.12;
  transform: scale(0);
  pointer-events: none;
  animation: ripple 450ms var(--md-sys-motion-easing) forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--md-sys-shape-full);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.1px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 200ms var(--md-sys-motion-easing);
}
.btn:hover { text-decoration: none; }
.btn .icon { font-size: 18px; }
.btn--icon-lead { padding-inline: 16px 24px; }
.btn--filled { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.btn--filled:hover { box-shadow: var(--md-sys-elevation-1); }
.btn--tonal { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.btn--tonal:hover { box-shadow: var(--md-sys-elevation-1); }
.btn--elevated { background: var(--md-sys-color-surface-container-low); color: var(--md-sys-color-primary); box-shadow: var(--md-sys-elevation-1); }
.btn--elevated:hover { box-shadow: var(--md-sys-elevation-2); }
.btn--outlined { background: transparent; color: var(--md-sys-color-primary); box-shadow: inset 0 0 0 1px var(--md-sys-color-outline); }
.btn--text { background: transparent; color: var(--md-sys-color-primary); padding-inline: 12px; }
.btn--lg { min-height: 56px; padding-inline: 32px; font-size: 16px; line-height: 24px; letter-spacing: 0.15px; }
.btn--lg .icon { font-size: 24px; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--md-sys-shape-full);
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
}
.icon-btn--tonal { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }

.fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 20px 0 16px;
  border-radius: var(--md-sys-shape-lg);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  box-shadow: var(--md-sys-elevation-3);
  font-size: 14px;
  letter-spacing: 0.1px;
  font-weight: 500;
  text-decoration: none;
  opacity: 0;
  transform: translateY(24px) scale(0.9);
  pointer-events: none;
  transition: opacity 250ms var(--md-sys-motion-easing), transform 250ms var(--md-sys-motion-easing);
}
.fab[data-visible] { opacity: 1; transform: none; pointer-events: auto; }
@media (min-width: 840px) { .fab { display: none; } }

/* ---------- chips, badges ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--md-sys-shape-sm);
  box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant);
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.1px;
  font-weight: 500;
  white-space: nowrap;
}
.chip .icon { font-size: 18px; color: var(--md-sys-color-primary); }
.chip--tonal { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); box-shadow: none; }
.chip--primary { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); box-shadow: none; }
.chip--success { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); box-shadow: none; }
.chip--success .icon { color: inherit; }

/* ---------- cards ---------- */

.card {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 24px;
  border-radius: var(--md-sys-shape-xl);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
}
.card--filled { background: var(--md-sys-color-surface-container-highest); }
.card--outlined { background: var(--md-sys-color-surface); box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant); }
.card--elevated { background: var(--md-sys-color-surface-container-low); box-shadow: var(--md-sys-elevation-1); }
.card--primary { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.card--tertiary { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }
.card--primary .t-muted, .card--tertiary .t-muted { color: inherit; opacity: 0.85; }
.card__head { display: flex; align-items: center; gap: 16px; }

/* ---------- flower badge (brand shape) ---------- */

.flower {
  --flower-size: 48px;
  --flower-bg: var(--md-sys-color-primary-container);
  --flower-fg: var(--md-sys-color-on-primary-container);
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--flower-size);
  height: var(--flower-size);
  color: var(--flower-bg);
}
.flower > svg:first-child { position: absolute; inset: 0; width: 100%; height: 100%; fill: currentColor; }
.flower > .icon { position: relative; font-size: calc(var(--flower-size) * 0.5); color: var(--flower-fg); }
.flower--lg { --flower-size: 72px; }
.flower--sm { --flower-size: 40px; }
.flower--secondary { --flower-bg: var(--md-sys-color-secondary-container); --flower-fg: var(--md-sys-color-on-secondary-container); }
.flower--tertiary { --flower-bg: var(--md-sys-color-tertiary-container); --flower-fg: var(--md-sys-color-on-tertiary-container); }
.flower--solid { --flower-bg: var(--md-sys-color-primary); --flower-fg: var(--md-sys-color-on-primary); }

/* ---------- top app bar and navigation ---------- */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--md-sys-color-surface);
  transition: background-color 250ms var(--md-sys-motion-easing);
}
.top-bar[data-scrolled] { background: var(--md-sys-color-surface-container); }
.top-bar__inner { display: flex; align-items: center; gap: 8px; min-height: 64px; }
.top-bar__menu { margin-inline-start: -8px; }
.top-bar__actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.top-bar__actions .btn { display: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  font-size: 22px;
  line-height: 28px;
  font-weight: 500;
  letter-spacing: 0;
}
.brand:hover { text-decoration: none; }
.brand img, .brand svg { width: 32px; height: 32px; }
.brand b { color: var(--md-sys-color-primary); font-weight: 500; }

.tabs { display: none; gap: 4px; margin-inline: 24px auto; }
.tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--md-sys-shape-full);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.1px;
  font-weight: 500;
  text-decoration: none;
}
.tabs a::after {
  content: "";
  position: absolute;
  inset: auto 16px 4px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--md-sys-color-primary);
  transform: scaleX(0);
  transition: transform 250ms var(--md-sys-motion-easing);
}
.tabs a[aria-current="true"] { color: var(--md-sys-color-primary); }
.tabs a[aria-current="true"]::after { transform: scaleX(1); }

@media (min-width: 960px) {
  .top-bar__menu { display: none; }
  .tabs { display: flex; }
  .top-bar__actions .btn { display: inline-flex; }
}

/* theme toggle: show the icon of the scheme you would switch to */
.theme-toggle .icon-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-light { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-dark { display: block; }
}
:root[data-theme="dark"] .theme-toggle .icon-light { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-dark { display: block; }
:root[data-theme="light"] .theme-toggle .icon-light { display: block; }
:root[data-theme="light"] .theme-toggle .icon-dark { display: none; }

/* ---------- modal navigation drawer ---------- */

.drawer {
  width: min(360px, 88vw);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 12px;
  border: 0;
  border-radius: 0 var(--md-sys-shape-xl) var(--md-sys-shape-xl) 0;
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  inset: 0 auto 0 0;
}
.drawer::backdrop { background: rgb(0 0 0 / 0.32); }
.drawer[open] { animation: drawer-in 300ms var(--md-sys-motion-easing-emphasized-decelerate); }
@keyframes drawer-in { from { transform: translateX(-24px); opacity: 0; } }
.drawer__title { display: flex; align-items: center; gap: 12px; padding: 16px 16px 20px; }
.drawer__list { display: grid; gap: 4px; }
.drawer__list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 24px 0 16px;
  border-radius: var(--md-sys-shape-full);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.1px;
  font-weight: 500;
  text-decoration: none;
}
.drawer__list a[aria-current="true"] { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }

/* ---------- lists ---------- */

.list { display: grid; }
.list__item {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 8px 16px;
  color: inherit;
  text-decoration: none;
}
.list__item--two { min-height: 72px; }
.list__text { display: grid; flex: 1; min-width: 0; }
.list__headline { font-size: 16px; line-height: 24px; letter-spacing: 0.5px; overflow-wrap: anywhere; }
.list__supporting { font-size: 14px; line-height: 20px; letter-spacing: 0.25px; color: var(--md-sys-color-on-surface-variant); overflow-wrap: anywhere; }
.list__trailing { color: var(--md-sys-color-on-surface-variant); }
.list--check .list__item { align-items: flex-start; min-height: 0; padding: 6px 0; }
.list--check .icon { color: var(--md-sys-color-primary); margin-top: 2px; }

.download {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 12px 12px 20px;
  border-radius: var(--md-sys-shape-lg);
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
}
.download:hover { text-decoration: none; }
.download__text { display: grid; flex: 1; min-width: 0; }
.download__title { font-size: 14px; line-height: 20px; letter-spacing: 0.1px; font-weight: 500; }
.download__meta { font-family: var(--font-mono); font-size: 12px; line-height: 16px; letter-spacing: 0; color: var(--md-sys-color-on-surface-variant); overflow-wrap: anywhere; }
.download .icon-btn { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); pointer-events: none; }

.divider { height: 1px; border: 0; margin: 0; background: var(--md-sys-color-outline-variant); }

/* ---------- accordion (FAQ) ---------- */

.accordion {
  overflow: hidden;
  border-radius: var(--md-sys-shape-xl);
  background: var(--md-sys-color-surface-container-low);
}
.accordion details + details { border-top: 1px solid var(--md-sys-color-outline-variant); }
.accordion summary {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 12px 24px;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.15px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary > span:first-child { flex: 1; }
.accordion summary .icon { transition: transform 250ms var(--md-sys-motion-easing); color: var(--md-sys-color-on-surface-variant); }
.accordion details[open] { background: var(--md-sys-color-surface-container); }
.accordion details[open] summary .icon { transform: rotate(180deg); }
.accordion__answer { padding: 0 24px 20px; color: var(--md-sys-color-on-surface-variant); font-size: 14px; line-height: 22px; letter-spacing: 0.25px; max-width: 68ch; }

/* ---------- footer ---------- */

.footer {
  margin-top: 40px;
  padding-block: 40px 56px;
  background: var(--md-sys-color-surface-container);
}
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.footer__links .btn { min-height: 40px; }
.footer__note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--md-sys-color-outline-variant); color: var(--md-sys-color-on-surface-variant); font-size: 12px; line-height: 16px; letter-spacing: 0.4px; }

/* ---------- hero and device preview ---------- */

.hero { padding-block: clamp(32px, 6vw, 72px) clamp(40px, 7vw, 88px); }
.hero__grid { display: grid; gap: clamp(32px, 6vw, 64px); align-items: center; }
@media (min-width: 960px) { .hero__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); } }
.hero__copy { display: grid; gap: 24px; justify-items: start; }
.hero__copy .t-body-lg { max-width: 56ch; }
.hero__title em { font-style: normal; color: var(--md-sys-color-primary); }
.hero__chips { display: flex; flex-wrap: wrap; gap: 8px; }

.stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 48px) 16px;
  border-radius: var(--md-sys-shape-xl);
  background: var(--md-sys-color-primary-container);
  overflow: hidden;
}
.stage__flower {
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  inset: auto -18% -30% auto;
  color: var(--md-sys-color-surface);
  opacity: 0.35;
}
.stage__flower svg { width: 100%; height: 100%; fill: currentColor; }

.device {
  position: relative;
  width: min(100%, 320px);
  padding: 10px;
  border-radius: 44px;
  background: var(--md-sys-color-inverse-surface);
  box-shadow: var(--md-sys-elevation-3);
}
.device__screen {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 500px;
  padding: 14px 12px 20px;
  border-radius: 34px;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
}
.device__status { display: flex; justify-content: space-between; padding: 2px 12px 6px; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.4px; }
.device__bar { display: flex; align-items: center; gap: 12px; padding: 4px 4px 12px; font-size: 18px; line-height: 24px; font-weight: 500; letter-spacing: 0; }
.device__label { padding: 8px 12px 4px; font-size: 12px; line-height: 16px; letter-spacing: 0.5px; font-weight: 500; color: var(--md-sys-color-primary); }
.device__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 10px;
  border-radius: var(--md-sys-shape-xl);
  background: var(--md-sys-color-surface-container-high);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.1px;
  font-weight: 500;
}
.device__row > span:nth-child(2) { flex: 1; }
.device__row .icon { color: var(--md-sys-color-on-surface-variant); font-size: 20px; }
.device__row--active { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.device__row--active .icon { color: inherit; }
.device__row .flower { --flower-size: 36px; }

/* ---------- spotlight, editions, features, comments ---------- */

.spotlight { grid-template-columns: auto 1fr auto; align-items: center; gap: 24px 32px; }
@media (max-width: 899px) {
  .spotlight { grid-template-columns: auto 1fr; }
  .spotlight > .btn { grid-column: 1 / -1; justify-self: stretch; }
}
@media (max-width: 599px) {
  .spotlight { grid-template-columns: 1fr; justify-items: start; }
}

.edition .card__head h3 { margin: 0; }
.edition .t-label-md { color: var(--md-sys-color-primary); }
.edition__downloads { display: grid; gap: 8px; margin-top: 8px; }

.feature { align-content: start; }
.feature p { color: var(--md-sys-color-on-surface-variant); }

.comments { overflow: hidden; border-radius: var(--md-sys-shape-xl); background: var(--md-sys-color-surface-container-low); }
.comment { display: flex; gap: 16px; align-items: flex-start; padding: 16px 20px; }
.comment + .comment { border-top: 1px solid var(--md-sys-color-outline-variant); }
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--md-sys-shape-full);
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
}
.comment__body { flex: 1; min-width: 0; }
.comment__author { display: flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px; }
.comment__author img { width: 16px; height: 16px; }
.comment__text { margin-top: 2px; font-size: 14px; line-height: 20px; letter-spacing: 0.25px; }
.comment__meta { margin-top: 4px; font-size: 12px; line-height: 16px; letter-spacing: 0.4px; color: var(--md-sys-color-on-surface-variant); }
.comment__likes { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; letter-spacing: 0.5px; font-weight: 500; color: var(--md-sys-color-tertiary); }
.comment__likes .icon { font-size: 18px; }

/* ---------- stats, table, code, callout (LihonB) ---------- */

.stat { gap: 4px; }
.stat__value { font-size: clamp(28px, 4vw, 36px); line-height: 1.2; font-weight: 500; letter-spacing: 0; color: var(--md-sys-color-primary); }
.stat__label { font-size: 14px; line-height: 20px; letter-spacing: 0.25px; color: var(--md-sys-color-on-surface-variant); }

.table-wrap {
  overflow-x: auto;
  border-radius: var(--md-sys-shape-xl);
  background: var(--md-sys-color-surface-container-low);
}
.table-wrap:focus-visible { outline-offset: -3px; }
.data-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 14px; line-height: 20px; letter-spacing: 0.25px; }
.data-table caption { text-align: start; padding: 20px 24px 8px; color: var(--md-sys-color-on-surface-variant); }
.data-table th, .data-table td { padding: 14px 24px; text-align: start; vertical-align: middle; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.data-table thead th { font-weight: 500; letter-spacing: 0.1px; color: var(--md-sys-color-on-surface-variant); background: var(--md-sys-color-surface-container); }
.data-table tbody tr:last-child td, .data-table tbody tr:last-child th { border-bottom: 0; }
.data-table tbody th { font-weight: 500; }
.data-table .is-us { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.data-table thead .is-us { font-weight: 500; }
.cell { display: inline-flex; align-items: center; gap: 8px; }
.cell .icon { font-size: 20px; }
.cell--yes .icon { color: var(--md-sys-color-success); }
.cell--no .icon { color: var(--md-sys-color-error); }
.cell--warn .icon { color: #9a6a00; }
:root[data-theme="dark"] .cell--warn .icon { color: #f2c35b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cell--warn .icon { color: #f2c35b; } }
.is-us .cell--yes .icon { color: inherit; }

.code {
  margin: 0;
  padding: 20px 24px;
  overflow-x: auto;
  border-radius: var(--md-sys-shape-lg);
  background: var(--md-sys-color-surface-container-highest);
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 0;
}

.split { display: grid; gap: clamp(24px, 5vw, 56px); align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }

.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--md-sys-shape-xl);
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}
.callout > div { max-width: 640px; display: grid; gap: 12px; }
.callout .btn--filled { background: var(--md-sys-color-tertiary); color: var(--md-sys-color-on-tertiary); }

/* ---------- narrow pages (badge, support) ---------- */

.narrow { max-width: 720px; margin-inline: auto; padding-block: clamp(32px, 6vw, 64px) 40px; display: grid; gap: 16px; }
.narrow__hero { display: grid; gap: 16px; justify-items: center; text-align: center; margin-bottom: 16px; }
.narrow__hero .t-body-lg { max-width: 56ch; }

/* ---------- forms and banners (portal) ---------- */

.form { display: grid; gap: 20px; }

.field { --field-bg: var(--md-sys-color-surface); position: relative; display: block; }
.card--filled .field { --field-bg: var(--md-sys-color-surface-container-highest); }
.card--elevated .field { --field-bg: var(--md-sys-color-surface-container-low); }
.field input {
  display: block;
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--md-sys-shape-xs);
  background: transparent;
  color: var(--md-sys-color-on-surface);
  caret-color: var(--md-sys-color-primary);
  font: inherit;
  box-shadow: inset 0 0 0 1px var(--md-sys-color-outline);
  transition: box-shadow 150ms var(--md-sys-motion-easing);
}
.field input:hover { box-shadow: inset 0 0 0 1px var(--md-sys-color-on-surface); }
.field input:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--md-sys-color-primary); }
.field label {
  position: absolute;
  inset-inline-start: 12px;
  top: 16px;
  padding-inline: 4px;
  background: var(--field-bg);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.5px;
  pointer-events: none;
  transition: top 150ms var(--md-sys-motion-easing), font-size 150ms var(--md-sys-motion-easing), line-height 150ms var(--md-sys-motion-easing);
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label { top: -8px; font-size: 12px; line-height: 16px; letter-spacing: 0.4px; }
.field input:focus + label { color: var(--md-sys-color-primary); }
.field__hint { margin: 4px 16px 0; font-size: 12px; line-height: 16px; letter-spacing: 0.4px; color: var(--md-sys-color-on-surface-variant); }

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--md-sys-shape-md);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.25px;
}
.alert .icon { flex: none; margin-top: 0; }
.alert--error { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.alert--success { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); }
.alert a { color: inherit; }

.top-bar__actions .btn--always { display: inline-flex; }
.section-label { margin-top: 8px; padding-inline: 8px; color: var(--md-sys-color-primary); }
.card--flush { padding: 8px; gap: 0; }
.list--divided .list__item { flex-wrap: wrap; padding-block: 12px; }
.list--divided .list__item + .list__item { border-top: 1px solid var(--md-sys-color-outline-variant); }
.list--divided .list__text { flex: 1 1 160px; }
.list--divided .list__trailing { margin-inline-start: auto; }
.grid--pair { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.btn--error { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.btn--error:hover { box-shadow: var(--md-sys-elevation-1); }
.btn--sm { min-height: 36px; padding-inline: 16px; }

.icon-btn[data-copied] { color: var(--md-sys-color-primary); }
.hash { display: block; padding: 12px 16px; border-radius: var(--md-sys-shape-md); background: var(--md-sys-color-surface); font-family: var(--font-mono); font-size: 12px; line-height: 16px; letter-spacing: 0; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
