/* =====================================================================
   GT Dynamics — components.css
   Every shared UI component (DESIGN.md §5–§6) + site chrome rendered by
   layout.js (header, drawer, footer, announcement bar).
   Owner: web-design-system. Values ONLY from tokens.css (var(--…)).
   Live reference with class names: styleguide.html
   ---------------------------------------------------------------------
    1. Icons                    14. Spec table
    2. Buttons                  15. Tabs · Segmented
    3. Badges                   16. Form fields · input-group · stepper
    4. Chips · Tags             17. Range · Toggle · Checkbox · Radio
    5. Cards                    18. Swatch · Color input · Dropzone
    6. Stat                     19. Tooltip · Toast · Modal
    7. Panel · Side list        20. Callout · Empty state
    8. Message (Discord)        21. Breadcrumb · Accordion · Dropdown
    9. Eyebrow · Section head   22. Steps · Plate · Timeline
   10. Page head                23. Hash · Kbd · Key-value
   11. Engineering motifs       24. Site header · Drawer
   12. Lists (check, specline)  25. Announcement bar
   13. Link "more" · Socials    26. Site footer
                                27. CTA band
                                28. Device bezel (round AMOLED)
                                29. Dealer card
                                30. Lite performance tier
                                31. Accounts: avatar, skeleton, header
                                    account menu, sign-in dialog, provider
                                    buttons (auth.js · layout.js)
   ===================================================================== */

/* ===================== 1. Icons ===================== */
.icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  overflow: visible;
}
.icon-tile {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: var(--sp-10);
  height: var(--sp-10);
  border-radius: var(--r-md);
  background: var(--bg-5);
  color: var(--text-1);
}
.icon-tile--sm { width: var(--sp-8); height: var(--sp-8); border-radius: var(--r-sm); }
.icon-tile--lg { width: var(--sp-12); height: var(--sp-12); border-radius: var(--r-lg); }
.icon-tile--brand { background: var(--brand-soft); color: var(--brand); }
.icon-tile--ghost { background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text-2); }

/* ===================== 2. Buttons ===================== */
.btn {
  --btn-h: var(--sp-10);
  --btn-px: var(--sp-4);
  --btn-bg: var(--bg-5);
  --btn-fg: var(--text-1);
  --btn-bd: transparent;
  --btn-bg-hover: var(--bg-6);
  --btn-fg-hover: var(--btn-fg);
  --btn-bd-hover: var(--btn-bd);
  --btn-spinner: var(--btn-fg);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--btn-h);
  min-width: var(--btn-h);
  padding: 0 var(--btn-px);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-md);
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease),
    color var(--dur-1) var(--ease),
    box-shadow var(--dur-2) var(--ease),
    transform var(--dur-1) var(--ease);
}
.btn:hover {
  background-color: var(--btn-bg-hover);
  color: var(--btn-fg-hover);
  border-color: var(--btn-bd-hover);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn .icon { width: 16px; height: 16px; }
.btn--lg .icon, .btn--icon .icon { width: 18px; height: 18px; }
.btn--sm.btn--icon .icon { width: 16px; height: 16px; }
.btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--dur-2) var(--ease);
}
/* trailing icon (→) nudges forward on hover */
.btn:hover .btn__icon:last-child:not(:first-child) { transform: translateX(2px); }
.btn:hover .btn__icon--ext:last-child:not(:first-child) { transform: translate(1px, -1px); }
.btn__badge { margin-left: var(--sp-1); }

/* Variants */
.btn--primary {
  --btn-bg: var(--brand);
  --btn-fg: var(--brand-ink);
  --btn-bg-hover: var(--brand-hi);
  --btn-spinner: var(--brand-ink);
}
.btn--primary:hover { box-shadow: var(--brand-glow); }
.btn--primary:active { background-color: var(--brand-lo); box-shadow: none; }
.btn--primary:focus-visible { box-shadow: var(--ring); }

.btn--secondary {
  --btn-bg: var(--bg-5);
  --btn-fg: var(--text-1);
  --btn-bg-hover: var(--bg-6);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text-1);
  --btn-bd: var(--line-2);
  --btn-bg-hover: var(--bg-4);
  --btn-bd-hover: var(--line-3);
}

/* quiet: toolbar / icon actions without a frame */
.btn--quiet {
  --btn-bg: transparent;
  --btn-fg: var(--text-2);
  --btn-bg-hover: var(--bg-4);
  --btn-fg-hover: var(--text-1);
}

.btn--link {
  --btn-bg: transparent;
  --btn-bg-hover: transparent;
  --btn-fg: var(--text-1);
  height: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  transition: color var(--dur-1) var(--ease), text-decoration-color var(--dur-2) var(--ease);
}
.btn--link:hover { text-decoration-color: var(--brand); }
.btn--link:active { transform: none; }
.btn--link:focus-visible {
  box-shadow: none;
  outline: 2px solid var(--brand);
  outline-offset: 4px;
  border-radius: var(--r-xs);
}

.btn--danger {
  --btn-bg: var(--danger-soft);
  --btn-fg: var(--danger);
  --btn-bd: color-mix(in srgb, var(--danger) 35%, transparent);
  --btn-bg-hover: var(--danger);
  --btn-fg-hover: var(--bg-1);
  --btn-bd-hover: var(--danger);
  --btn-spinner: var(--danger);
}

/* Sizes & shapes */
.btn--sm { --btn-h: var(--sp-8); --btn-px: var(--sp-3); font-size: calc(var(--fs-sm) - 1px); }
.btn--lg { --btn-h: var(--sp-12); --btn-px: var(--sp-6); font-size: var(--fs-base); gap: var(--sp-3); }
.btn--icon { width: var(--btn-h); padding: 0; }
.btn--block { display: flex; width: 100%; }
.btn--pill { border-radius: var(--r-pill); }

/* States (after variants so they win) */
.btn:disabled, .btn.is-disabled, .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  border-color: var(--btn-bd);
  box-shadow: none;
  transform: none;
}
.btn:disabled .btn__icon, .btn.is-disabled .btn__icon, .btn[aria-disabled="true"] .btn__icon { transform: none; }
.btn--link:disabled, .btn--link[aria-disabled="true"] { text-decoration-color: transparent; }

.btn.is-loading { pointer-events: none; color: transparent; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--btn-spinner);
  border-right-color: transparent;
  animation: gtd-spin var(--dur-4) linear infinite;
}

.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.btn-row--end { justify-content: flex-end; }

/* Spinner (standalone) */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-3);
  border-top-color: var(--brand);
  animation: gtd-spin var(--dur-4) linear infinite;
}

/* ===================== 3. Badges ===================== */
.badge {
  --badge-c: var(--text-2);
  --badge-bg: var(--bg-5);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding-inline: var(--sp-2);
  border-radius: var(--r-xs);
  border: 1px solid color-mix(in srgb, var(--badge-c) 24%, transparent);
  background: var(--badge-bg);
  /* text slightly lifted toward --text-1 → ≥ 4.5:1 on cards (--bg-3) for every status */
  color: color-mix(in srgb, var(--badge-c) 78%, var(--text-1));
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
.badge--neutral { --badge-c: var(--text-2); --badge-bg: var(--bg-5); }
.badge--ok      { --badge-c: var(--ok);     --badge-bg: var(--ok-soft); }
.badge--info    { --badge-c: var(--info);   --badge-bg: var(--info-soft); }
.badge--warn    { --badge-c: var(--warn);   --badge-bg: var(--warn-soft); }
.badge--danger  { --badge-c: var(--danger); --badge-bg: var(--danger-soft); }
.badge--brand   { --badge-c: var(--brand);  --badge-bg: var(--brand-soft); }
.badge--cyan    { --badge-c: var(--cyan);   --badge-bg: var(--cyan-soft); }
.badge--solid   { --badge-bg: var(--badge-c); color: var(--bg-1); border-color: transparent; }
.badge--xs { height: 18px; padding-inline: var(--sp-1); gap: var(--sp-1); font-size: calc(var(--fs-2xs) - 1px); letter-spacing: 0.06em; }
.badge--lg { height: 26px; padding-inline: var(--sp-3); font-size: var(--fs-xs); }
.badge__dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--badge-c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--badge-c) 18%, transparent);
}
.badge--solid .badge__dot { background: currentColor; box-shadow: none; }
.badge__dot--pulse { animation: gtd-pulse calc(var(--dur-4) * 3) var(--ease) infinite; }

/* ===================== 4. Chips (filters) · Tags (static) ===================== */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips--scroll::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: var(--sp-8);
  padding-inline: var(--sp-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease),
    color var(--dur-1) var(--ease);
}
.chip .icon { width: 16px; height: 16px; color: var(--text-3); transition: color var(--dur-1) var(--ease); }
.chip:hover { background: var(--bg-4); border-color: var(--line-3); color: var(--text-1); }
.chip:hover .icon { color: var(--text-1); }
.chip:active { background: var(--bg-5); }
.chip.is-active, .chip[aria-pressed="true"], .chip[aria-selected="true"] {
  background: var(--brand-soft);
  border-color: var(--brand-line);
  color: var(--brand);
}
.chip.is-active .icon, .chip[aria-pressed="true"] .icon, .chip[aria-selected="true"] .icon { color: var(--brand); }
.chip:disabled, .chip[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.chip__count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 18px;
  padding-inline: 6px;
  border-radius: var(--r-pill);
  background: var(--bg-5);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
}
.chip.is-active .chip__count, .chip[aria-pressed="true"] .chip__count { background: var(--brand-soft-2); color: var(--brand); }
.chip--sm { height: 28px; padding-inline: 10px; font-size: var(--fs-xs); }

.tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none; margin: 0; padding: 0; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding-inline: var(--sp-2);
  border-radius: var(--r-xs);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tag .icon { width: 14px; height: 14px; color: var(--text-3); }
.tag--lg { height: var(--sp-8); padding-inline: var(--sp-3); font-size: var(--fs-xs); }
.tag--muted { color: var(--text-3); border-style: dashed; background: transparent; }
.tag__soon { color: var(--info); font-weight: 600; letter-spacing: 0.08em; }

/* ===================== 5. Cards ===================== */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  color: var(--text-2);
  transition:
    background-color var(--dur-2) var(--ease),
    border-color var(--dur-2) var(--ease),
    transform var(--dur-2) var(--ease),
    box-shadow var(--dur-2) var(--ease);
}
.card--pad { padding: var(--sp-6); }
.card--flat { background: var(--bg-2); border-color: var(--line-1); }
.card__body { display: flex; flex-direction: column; gap: var(--sp-2); flex: 1 1 auto; padding: var(--sp-6); min-width: 0; }
.card__kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-3);
}
.card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-display);
  color: var(--text-1);
}
.card__text { margin: 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); }
.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--line-1);
}

/* Interactive cards lift; static cards (feature/stat) only firm up the border */
:is(.card--link, .card--product, .card--hover, a.card):hover {
  background: var(--bg-4);
  border-color: var(--line-3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
:is(.card--link, a.card) { cursor: pointer; text-decoration: none; color: var(--text-2); }
a.card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Stretched link: <h3 class="card__title"><a class="card__link" href>…</a></h3> */
.card__link { color: inherit; text-decoration: none; }
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: var(--r-lg);
}
.card__link:focus-visible { outline: none; }
.card__link:focus-visible::after { outline: 2px solid var(--brand); outline-offset: 2px; }
.card__raise { position: relative; z-index: 3; } /* interactive bits above the stretched link */

/* Product card */
.card--product { overflow: hidden; }
.card__media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--bg-2);
  background-image: var(--dot-grid);
  background-size: var(--grid-size) var(--grid-size);
  border-bottom: 1px solid var(--line-1);
}
.card__media > img, .card__media > svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--sp-6);
  transition: transform var(--dur-3) var(--ease-out);
}
.card__media > img.is-photo { object-fit: cover; padding: 0; }
.card--product:hover .card__media > img, .card--product:hover .card__media > svg { transform: scale(1.03); }
.card__badge { position: absolute; top: var(--sp-3); left: var(--sp-3); z-index: 1; }
.card__coord { position: absolute; right: var(--sp-3); bottom: var(--sp-3); z-index: 1; }
.card__specs { margin-top: auto; padding-top: var(--sp-3); }
.card--product .card__foot { padding-block: var(--sp-3); }

/* Feature card */
.card--feature { padding: var(--sp-6); gap: var(--sp-3); }
.card--feature .card__icon {
  display: grid;
  place-items: center;
  width: var(--sp-10);
  height: var(--sp-10);
  margin-bottom: var(--sp-1);
  border-radius: var(--r-md);
  background: var(--bg-5);
  color: var(--text-1);
}
.card--feature .card__icon .icon { width: 20px; height: 20px; }
.card--feature .card__title { font-size: var(--fs-md); }
.card--feature:hover { border-color: var(--line-3); }

/* Stat card */
.card--stat { padding: var(--sp-5) var(--sp-6); gap: var(--sp-2); justify-content: space-between; }

/* ===================== 6. Stat (big telemetry number) ===================== */
.stat { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.stat__value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.25em;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}
.stat__value--brand { color: var(--brand); }
.stat__value--mono { font-family: var(--font-mono); letter-spacing: -0.02em; }
.stat__unit { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 500; color: var(--text-3); letter-spacing: 0.04em; }
.stat__label { font-size: var(--fs-sm); line-height: 1.45; color: var(--text-3); }
.stat--sm .stat__value { font-size: var(--fs-xl); }
.stat--lg .stat__value { font-size: var(--fs-3xl); }

/* ===================== 7. Panel (Discord) · Side list ===================== */
.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.panel--raised { background: var(--bg-3); border-color: var(--line-2); }
.panel__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: var(--sp-12);
  padding-inline: var(--sp-4);
  border-bottom: 1px solid var(--line-1);
  flex-shrink: 0;
}
.panel__title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-3);
}
/* "# channel" title */
.panel__title--channel {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-1);
}
.panel__title--channel::before {
  content: "#";
  content: "#" / "";
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: 500;
  color: var(--text-4);
}
.panel__actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.panel__body { padding: var(--sp-4); min-height: 0; }
.panel__body--flush { padding: 0; }
.panel__body--scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--bg-6) transparent; }
.panel__foot {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--line-1);
}

.side-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: var(--sp-2);
  list-style: none;
}
.side-group + .side-group { margin-top: var(--sp-3); }
.side-group__title {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-2) var(--sp-1);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-3);
}
.side-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  min-height: calc(var(--sp-8) + var(--sp-1));
  padding: 6px var(--sp-2);
  border-radius: var(--r-sm);
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.side-item .icon { width: 18px; height: 18px; color: var(--text-4); transition: color var(--dur-1) var(--ease); }
.side-item:hover { background: var(--bg-4); color: var(--text-2); }
.side-item:hover .icon { color: var(--text-3); }
.side-item.is-active, .side-item[aria-current="page"], .side-item[aria-current="true"], .side-item[aria-selected="true"] {
  background: var(--bg-5);
  color: var(--text-1);
}
.side-item.is-active .icon, .side-item[aria-current] .icon, .side-item[aria-selected="true"] .icon { color: var(--text-2); }
.side-item.is-active::before, .side-item[aria-current="page"]::before, .side-item[aria-current="true"]::before, .side-item[aria-selected="true"]::before {
  content: "";
  position: absolute;
  left: calc(var(--sp-2) * -1);
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.side-item:focus-visible { outline-offset: -2px; }
.side-item__hash { font-family: var(--font-mono); font-size: var(--fs-md); line-height: 1; color: var(--text-4); width: 18px; text-align: center; }
.side-item__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item__count {
  margin-left: auto;
  min-width: 20px;
  height: 18px;
  padding-inline: 6px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--bg-6);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
}

/* ===================== 8. Message (Discord-style feed item) ===================== */
.message {
  display: grid;
  grid-template-columns: var(--sp-10) minmax(0, 1fr);
  gap: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  transition: background-color var(--dur-1) var(--ease);
}
.message:hover { background: color-mix(in srgb, var(--bg-0) 22%, transparent); }
.message--divided + .message--divided { border-top: 1px solid var(--line-1); border-radius: 0; }
.message__avatar {
  display: grid;
  place-items: center;
  width: var(--sp-10);
  height: var(--sp-10);
  border-radius: var(--r-lg);
  background: var(--bg-5);
  color: var(--text-1);
}
.message__avatar .icon { width: 20px; height: 20px; }
.message__avatar--brand { background: var(--brand-soft); color: var(--brand); }
.message__body { min-width: 0; }
.message__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); }
.message__author { font-weight: 600; color: var(--text-1); font-size: var(--fs-base); }
.message__title { margin: 0; font-family: var(--font-display); font-size: var(--fs-md); font-weight: 600; color: var(--text-1); }
.message__time { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); letter-spacing: 0.04em; }
.message__content { margin-top: var(--sp-2); font-size: var(--fs-sm); line-height: 1.6; color: var(--text-2); }
.message__content :where(ul, ol) { margin: var(--sp-1) 0 0; padding-left: 1.15em; }
.message__content :where(li + li) { margin-top: 2px; }
.message__content :where(li)::marker { color: var(--text-4); }
.message__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); }

/* ===================== 9. Eyebrow · Section head ===================== */
/* <p class="eyebrow"><span class="eyebrow__num">02</span> Software</p> → // 02 — SOFTWARE */
.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 1ch;
  width: fit-content;
  margin: 0 0 var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow::before {
  content: "//";
  content: "//" / "";
  color: var(--text-4);
  letter-spacing: 0;
}
.eyebrow__num { color: var(--brand); font-weight: 600; }
.eyebrow__num::after {
  content: " \2014";
  content: " \2014" / "";
  color: var(--text-4);
}
.eyebrow--plain::before { content: none; }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--sp-8);
  align-items: end;
  margin-bottom: var(--sp-10);
}
.section-head > :not(.section-head__actions) { grid-column: 1; }
.section-head :where(h1, h2, .h2) { margin: 0; }
.section-head :where(h2) { font-size: var(--fs-2xl); }
.section-head .lead { margin-top: var(--sp-3); }
.section-head__actions {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.section-head--center { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
.section-head--center .lead { margin-inline: auto; }
.section-head--center .section-head__actions { grid-column: 1; grid-row: auto; margin-top: var(--sp-6); justify-content: center; }
.section-head--sm { margin-bottom: var(--sp-6); }
.section-head--sm :where(h2) { font-size: var(--fs-xl); }
@media (max-width: 720px) {
  .section-head { grid-template-columns: minmax(0, 1fr); }
  .section-head__actions { grid-column: 1; grid-row: auto; margin-top: var(--sp-5); }
}

/* ===================== 10. Page head (inner pages) ===================== */
.page-head {
  position: relative;
  overflow: hidden;
  padding-block: calc(var(--section-y) * 0.7) calc(var(--section-y) * 0.55);
  background-color: var(--bg-1);
  background-image: var(--dot-grid);
  background-size: var(--grid-size) var(--grid-size);
  border-bottom: 1px solid var(--line-1);
}
.page-head::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--bg-1) 70%, transparent));
  pointer-events: none;
}
.page-head > * { position: relative; z-index: 1; }
.page-head :where(h1) { margin: 0; font-size: var(--fs-3xl); }
.page-head .lead { margin-top: var(--sp-4); }
.page-head .breadcrumb { margin-bottom: var(--sp-6); }
.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-8); }
.page-head__coord { position: absolute; top: var(--sp-4); right: var(--gutter); z-index: 1; }

/* ===================== 11. Engineering motifs ===================== */
/* Crop-mark brackets: 4 corners 12×12, --line-3 → --brand on hover */
@property --bracket-c {
  syntax: "<color>";
  inherits: true;
  initial-value: transparent;
}
.brackets {
  --bracket-c: var(--line-3);
  --bracket-s: 12px;
  --bracket-w: 1px;
  --bracket-o: 0px;
  position: relative;
}
.brackets::before {
  content: "";
  position: absolute;
  inset: var(--bracket-o);
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(var(--bracket-c) 0 0) left top / var(--bracket-s) var(--bracket-w),
    linear-gradient(var(--bracket-c) 0 0) left top / var(--bracket-w) var(--bracket-s),
    linear-gradient(var(--bracket-c) 0 0) right top / var(--bracket-s) var(--bracket-w),
    linear-gradient(var(--bracket-c) 0 0) right top / var(--bracket-w) var(--bracket-s),
    linear-gradient(var(--bracket-c) 0 0) left bottom / var(--bracket-s) var(--bracket-w),
    linear-gradient(var(--bracket-c) 0 0) left bottom / var(--bracket-w) var(--bracket-s),
    linear-gradient(var(--bracket-c) 0 0) right bottom / var(--bracket-s) var(--bracket-w),
    linear-gradient(var(--bracket-c) 0 0) right bottom / var(--bracket-w) var(--bracket-s);
  background-repeat: no-repeat;
  transition: --bracket-c var(--dur-2) var(--ease);
}
.brackets:hover, .brackets:focus-within { --bracket-c: var(--brand); }
.brackets--out { --bracket-o: calc(var(--sp-2) * -1); }
.brackets--lg { --bracket-s: 20px; }
.brackets--brand { --bracket-c: var(--brand-line); }
.brackets--static:hover, .brackets--static:focus-within { --bracket-c: var(--line-3); }

/* Hazard stripe (max 1–2 per site) */
.hazard { display: block; height: 6px; background: var(--hazard); border: 0; margin: 0; }
.hazard--thin { height: 4px; }

/* Ruler: minor tick every 8 px, major every 40 px */
.ruler {
  display: block;
  height: 12px;
  background-image:
    linear-gradient(to right, var(--line-3) 1px, transparent 1px),
    linear-gradient(to right, var(--line-2) 1px, transparent 1px);
  background-size: 40px 12px, 8px 6px;
  background-repeat: repeat-x;
  background-position: left bottom, left bottom;
  border-bottom: 1px solid var(--line-2);
}
/* Labeled ruler: majors follow the labels. <div class="ruler ruler--labeled" style="--ruler-n:5"><span>0</span>…</div> */
.ruler--labeled {
  --ruler-n: 5;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  height: 30px;
  padding-bottom: 14px;
  background-size: calc(100% / var(--ruler-n)) 12px, 8px 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  line-height: 1;
  color: var(--text-4);
  letter-spacing: 0.06em;
}
.ruler--labeled > * { padding-left: 6px; white-space: nowrap; overflow: hidden; }

/* Coordinate mark: X 233 · Y 233 / REV 1.0 */
.coord {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.coord--tl, .coord--tr, .coord--bl, .coord--br { position: absolute; z-index: 1; }
.coord--tl { top: var(--sp-3); left: var(--sp-3); }
.coord--tr { top: var(--sp-3); right: var(--sp-3); }
.coord--bl { bottom: var(--sp-3); left: var(--sp-3); }
.coord--br { bottom: var(--sp-3); right: var(--sp-3); }

/* ===================== 12. Lists ===================== */
.list-check { display: grid; gap: var(--sp-3); margin: 0; padding: 0; list-style: none; }
.list-check > li { display: flex; align-items: flex-start; gap: var(--sp-3); color: var(--text-2); }
.list-check > li::before {
  content: "";
  flex-shrink: 0;
  width: 11px;
  height: 6px;
  margin: 0.5em 3px 0 3px;
  border-left: 2px solid var(--ok);
  border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg);
}
.list-check--brand > li::before { border-color: var(--brand); }

.list-icon { display: grid; gap: var(--sp-4); margin: 0; padding: 0; list-style: none; }
.list-icon > li { display: flex; align-items: flex-start; gap: var(--sp-3); }
.list-icon > li > .icon { margin-top: 2px; color: var(--text-3); }

/* Mono spec line: 466×466 AMOLED · ESP-NOW · 100 MS */
.specline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.specline > * + *::before {
  content: "\00B7";
  content: "\00B7" / "";
  margin-right: var(--sp-3);
  color: var(--text-4);
}
.specline--sm { font-size: var(--fs-2xs); gap: 2px var(--sp-2); }
.specline--sm > * + *::before { margin-right: var(--sp-2); }

/* ===================== 13. "More" link · Socials ===================== */
.more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--dur-1) var(--ease);
}
.more .icon { width: 16px; height: 16px; transition: transform var(--dur-2) var(--ease); }
.more:hover { color: var(--brand); }
.more:hover .icon, .card:hover .more .icon { transform: translateX(2px); }

.social-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.social-btn {
  display: grid;
  place-items: center;
  width: var(--sp-10);
  height: var(--sp-10);
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--text-2);
  text-decoration: none;
  transition:
    background-color var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease),
    color var(--dur-1) var(--ease),
    transform var(--dur-1) var(--ease);
}
.social-btn .icon { width: 18px; height: 18px; }
.social-btn:hover { background: var(--bg-4); border-color: var(--line-3); color: var(--text-1); transform: translateY(-1px); }
.social-btn:active { transform: none; }

/* Large social tile (contact page) */
.social-tile {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--text-1);
  text-decoration: none;
  transition: background-color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.social-tile:hover { background: var(--bg-4); border-color: var(--line-3); transform: translateY(-2px); }
.social-tile__label { font-weight: 600; color: var(--text-1); line-height: 1.2; }
.social-tile__handle { display: block; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3); }
.social-tile > .icon:last-child { margin-left: auto; color: var(--text-4); }

/* ===================== 14. Spec table ===================== */
.spec-group + .spec-group { margin-top: var(--sp-8); }
.spec-group__title {
  margin: 0 0 var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-3);
}
table.spec-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.spec-table :where(th, td) {
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--line-1);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}
.spec-table tr:last-child > * { border-bottom: 1px solid var(--line-1); }
.spec-table th { width: 42%; padding-right: var(--sp-4); font-weight: 400; color: var(--text-3); }
.spec-table td {
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.spec-table tbody tr { transition: background-color var(--dur-1) var(--ease); }
.spec-table tbody tr:hover > * { background: color-mix(in srgb, var(--bg-0) 18%, transparent); }
/* <dl class="spec-table"><dt>…</dt><dd>…</dd>…</dl> */
dl.spec-table { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); margin: 0; font-size: var(--fs-sm); }
dl.spec-table > dt, dl.spec-table > dd {
  margin: 0;
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--line-1);
  line-height: 1.5;
}
dl.spec-table > dt { padding-right: var(--sp-4); color: var(--text-3); }
dl.spec-table > dd { color: var(--text-1); font-family: var(--font-mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
dl.spec-table > dt:nth-last-of-type(1), dl.spec-table > dd:nth-last-of-type(1) { border-bottom: 1px solid var(--line-1); }

/* ===================== 15. Tabs · Segmented ===================== */
.tabs {
  display: flex;
  gap: var(--sp-1);
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: inset 0 -1px 0 var(--line-2);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
  height: calc(var(--sp-10) + var(--sp-1));
  padding-inline: var(--sp-3);
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease);
}
.tab .icon { width: 16px; height: 16px; }
.tab::after {
  content: "";
  position: absolute;
  left: var(--sp-3);
  right: var(--sp-3);
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--brand);
  transform: scaleX(0);
  transition: transform var(--dur-2) var(--ease-out);
}
.tab:hover { color: var(--text-1); }
.tab[aria-selected="true"], .tab.is-active, .tab[aria-current="page"], .tab[aria-current="true"] { color: var(--text-1); }
.tab[aria-selected="true"]::after, .tab.is-active::after, .tab[aria-current="page"]::after, .tab[aria-current="true"]::after { transform: scaleX(1); }
.tab:focus-visible { outline-offset: -6px; border-radius: var(--r-sm); }
.tab:disabled, .tab[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.tab__count {
  min-width: 20px;
  height: 18px;
  padding-inline: 6px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--bg-5);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
}
.tabs--sticky {
  position: sticky;
  top: var(--header-h);
  z-index: calc(var(--z-header) - 1);
  background: color-mix(in srgb, var(--bg-0) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
/* equal-width tabs across the container (sign-in dialog: Sign in | Create account) */
.tabs--block > .tab { flex: 1 1 0; min-width: 0; justify-content: center; }

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  max-width: 100%;
  overflow-x: auto;              /* long JA labels on 360 px scroll inside, never the page */
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented > * { flex-shrink: 0; }
.segmented > :where(button, a), .segmented__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--sp-8);
  padding-inline: var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.segmented > :where(button, a) .icon, .segmented__item .icon { width: 16px; height: 16px; }
.segmented > :where(button, a):hover, .segmented__item:hover { color: var(--text-1); }
.segmented > :where(button, a):is([aria-pressed="true"], [aria-checked="true"], [aria-selected="true"], [aria-current="page"], .is-active),
.segmented__item:is([aria-pressed="true"], [aria-checked="true"], [aria-selected="true"], .is-active) {
  background: var(--bg-5);
  color: var(--text-1);
  box-shadow: var(--shadow-1);
}
.segmented > :where(button, a):focus-visible, .segmented__item:focus-visible { outline-offset: 0; }
.segmented > :where(button, a):disabled { opacity: 0.45; cursor: not-allowed; }
.segmented--sm { padding: 2px; }
.segmented--sm > :where(button, a), .segmented--sm .segmented__item { height: 26px; padding-inline: 10px; font-size: var(--fs-xs); }
.segmented--block { display: flex; width: 100%; }
.segmented--block > :where(button, a), .segmented--block .segmented__item { flex: 1 1 0; min-width: 0; }

/* ===================== 16. Form fields ===================== */
.field { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.field__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.field__label { font-size: var(--fs-sm); font-weight: 500; line-height: 1.3; color: var(--text-1); }
.field__label--mono {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-3);
}
.field__req { color: var(--text-3); font-weight: 400; margin-left: 2px; }
.field__value { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-1); font-variant-numeric: tabular-nums; }
.field__hint { font-size: var(--fs-xs); line-height: 1.45; color: var(--text-3); }
.field__error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: color-mix(in srgb, var(--danger) 80%, var(--text-1));
}
.field__error .icon { width: 14px; height: 14px; margin-top: 1px; }
.field:not(.is-invalid) > .field__error:empty { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
.form-grid > .field--full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.input, .select, .textarea {
  display: block;
  width: 100%;
  min-width: 0;
  height: var(--sp-10);
  padding: 0 var(--sp-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background-color: var(--bg-2);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color var(--dur-1) var(--ease),
    box-shadow var(--dur-2) var(--ease),
    background-color var(--dur-1) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: 1; } /* --text-3: AA on --bg-2 */
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus,
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft-2);
}
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.5; cursor: not-allowed; }
.input[readonly] { background-color: var(--bg-1); }
.input:is([aria-invalid="true"], :user-invalid), .select[aria-invalid="true"], .textarea:is([aria-invalid="true"], :user-invalid),
.field.is-invalid :is(.input, .select, .textarea) { border-color: var(--danger); }
.input[aria-invalid="true"]:focus, .textarea[aria-invalid="true"]:focus, .field.is-invalid :is(.input, .select, .textarea):focus {
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.input--sm, .select--sm { height: var(--sp-8); font-size: calc(var(--fs-sm) - 1px); }
.input--lg { height: var(--sp-12); font-size: var(--fs-base); padding-inline: var(--sp-4); }
.input--mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.textarea { height: auto; min-height: 120px; padding: var(--sp-3); line-height: var(--lh-body); resize: vertical; }
.input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.input[type="number"]::-webkit-inner-spin-button, .input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.select {
  padding-right: var(--sp-10);
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 1px), calc(100% - 13px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.select option, .select optgroup { background-color: var(--bg-2); color: var(--text-1); }

/* Input with leading icon / trailing slot */
.input-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.input-wrap > .icon, .input-wrap__icon {
  position: absolute;
  left: var(--sp-3);
  width: 18px;
  height: 18px;
  color: var(--text-3);
  pointer-events: none;
}
.input-wrap > .icon ~ .input, .input-wrap__icon ~ .input { padding-left: calc(var(--sp-3) + 18px + var(--sp-2)); }
.input-wrap:focus-within > .icon { color: var(--text-1); }
.input-wrap__end { position: absolute; right: 6px; display: flex; align-items: center; gap: var(--sp-1); }
.input-wrap__end ~ .input, .input-wrap--end > .input { padding-right: calc(var(--sp-10) + var(--sp-2)); }

/* Input + unit addon */
.input-group { display: flex; align-items: stretch; min-width: 0; }
.input-group > .input, .input-group > .select { flex: 1 1 auto; position: relative; }
.input-group > :is(.input, .select):not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > :is(.input, .select):not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > :is(.input, .select):focus { z-index: 1; }
.input-group__addon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-inline: var(--sp-3);
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
}
.input-group__addon:last-child { border-left: 0; border-radius: 0 var(--r-md) var(--r-md) 0; }
.input-group__addon:first-child { border-right: 0; border-radius: var(--r-md) 0 0 var(--r-md); }
.input-group > .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* Stepper: − [value] + */
.stepper {
  display: inline-flex;
  align-items: stretch;
  height: var(--sp-10);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--bg-2);
  overflow: hidden;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.stepper:hover { border-color: var(--line-3); }
.stepper:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft-2); }
.stepper__btn {
  display: grid;
  place-items: center;
  width: calc(var(--sp-8) + var(--sp-1));
  color: var(--text-2);
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.stepper__btn .icon { width: 16px; height: 16px; }
.stepper__btn:hover { background: var(--bg-4); color: var(--text-1); }
.stepper__btn:active { background: var(--bg-5); }
.stepper__btn:focus-visible { outline-offset: -3px; border-radius: var(--r-sm); }
.stepper__btn:disabled { opacity: 0.4; }
.stepper__input {
  width: 64px;
  min-width: 0;
  border: 0;
  border-inline: 1px solid var(--line-1);
  background: transparent;
  color: var(--text-1);
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper__input:focus, .stepper__input:focus-visible { outline: none; }
.stepper__input::-webkit-inner-spin-button, .stepper__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper--sm { height: var(--sp-8); }
.stepper--sm .stepper__btn { width: var(--sp-8); }
.stepper--sm .stepper__input { width: 52px; font-size: var(--fs-xs); }

/* ===================== 17. Range · Toggle · Checkbox · Radio ===================== */
/* <input type="range" class="range"> — fill via --val (set by GTD.ui) */
.range {
  --val: 50%;
  display: block;
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.range:focus, .range:focus-visible { outline: none; }
.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: var(--r-pill);
  background: linear-gradient(to right, var(--brand) 0 var(--val), var(--bg-5) var(--val) 100%);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  border: 3px solid var(--brand);
  background: var(--text-1);
  box-shadow: 0 0 0 0 var(--brand-soft-2), var(--shadow-1);
  transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.range:hover::-webkit-slider-thumb { box-shadow: 0 0 0 6px var(--brand-soft-2), var(--shadow-1); }
.range:active::-webkit-slider-thumb { transform: scale(1.12); }
.range:focus-visible::-webkit-slider-thumb { box-shadow: var(--ring); }
.range::-moz-range-track { height: 4px; border-radius: var(--r-pill); background: var(--bg-5); border: 0; }
.range::-moz-range-progress { height: 4px; border-radius: var(--r-pill); background: var(--brand); }
.range::-moz-range-thumb {
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--brand);
  background: var(--text-1);
  box-shadow: 0 0 0 0 var(--brand-soft-2), var(--shadow-1);
  transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.range:hover::-moz-range-thumb { box-shadow: 0 0 0 6px var(--brand-soft-2), var(--shadow-1); }
.range:active::-moz-range-thumb { transform: scale(1.12); }
.range:focus-visible::-moz-range-thumb { box-shadow: var(--ring); }
.range:disabled { opacity: 0.45; cursor: not-allowed; }

/* Label wrapper for toggle / checkbox / radio */
.check {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 28px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
  transition: color var(--dur-1) var(--ease);
}
.check:hover { color: var(--text-1); }
.check--top { align-items: flex-start; }
.check--top > input { margin-top: 2px; }
.check--between { display: flex; justify-content: space-between; width: 100%; }
.check:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.check__text { display: flex; flex-direction: column; gap: 2px; }
.check__hint { font-size: var(--fs-xs); color: var(--text-3); }

/* <input type="checkbox" class="toggle"> — 36×20 */
.toggle {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  margin: 0;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--bg-6);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.toggle::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-2);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease);
}
.toggle:hover { border-color: var(--line-3); }
.toggle:hover::before { background: var(--text-1); }
.toggle:checked { background: var(--brand); border-color: var(--brand); }
.toggle:checked::before { transform: translateX(16px); background: var(--brand-ink); }
.toggle:checked:hover { background: var(--brand-hi); border-color: var(--brand-hi); }
.toggle:disabled { opacity: 0.45; cursor: not-allowed; }

/* <input type="checkbox" class="checkbox"> · <input type="radio" class="radio"> */
.checkbox, .radio {
  display: inline-grid;
  place-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--line-3);
  background: var(--bg-2);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
.checkbox { border-radius: var(--r-xs); }
.radio { border-radius: 50%; }
.checkbox::before {
  content: "";
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform var(--dur-1) var(--ease-out);
}
.radio::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  transform: scale(0);
  transition: transform var(--dur-1) var(--ease-out);
}
.checkbox:hover, .radio:hover { border-color: var(--text-3); }
.checkbox:checked, .radio:checked { border-color: var(--brand); background: var(--brand-soft); }
.checkbox:checked::before { transform: translateY(-1px) rotate(-45deg) scale(1); }
.radio:checked::before { transform: scale(1); }
.checkbox:indeterminate { border-color: var(--brand); background: var(--brand-soft); }
.checkbox:indeterminate::before { width: 8px; height: 0; border-left: 0; transform: none; }
.checkbox:disabled, .radio:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===================== 18. Swatch · Color input · Dropzone ===================== */
.swatches { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
/* <button class="swatch" style="--c: #FFE000" aria-label="Cyber yellow" aria-pressed="true"> */
.swatch {
  --c: var(--brand);
  position: relative;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px var(--line-2);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.swatch:hover { transform: scale(1.08); }
.swatch:active { transform: scale(0.96); }
.swatch.is-active, .swatch[aria-pressed="true"], .swatch[aria-checked="true"], .swatch[aria-selected="true"] {
  box-shadow: inset 0 0 0 1px var(--line-2), 0 0 0 2px var(--bg-0), 0 0 0 4px var(--text-1);
}
.swatch:focus-visible { outline: 2px solid var(--brand); outline-offset: 5px; }
.swatch--sm { width: 20px; height: 20px; }
.swatch--lg { width: 36px; height: 36px; }
.swatch--custom {
  background: conic-gradient(
    var(--dev-racing-red), var(--dev-neon-orange), var(--dev-cyber-yellow), var(--dev-track-green),
    var(--dev-hot-cyan), var(--dev-ice-blue), var(--dev-violet-purple), var(--dev-racing-red)
  );
}
.swatch--none {
  background:
    linear-gradient(135deg, transparent calc(50% - 1px), var(--danger) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    var(--bg-2);
}

/* <input type="color" class="color-input"> */
.color-input {
  flex-shrink: 0;
  width: var(--sp-10);
  height: var(--sp-10);
  padding: 4px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--bg-2);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--dur-1) var(--ease);
}
.color-input:hover { border-color: var(--line-3); }
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: 0; border-radius: var(--r-sm); }
.color-input::-moz-color-swatch { border: 0; border-radius: var(--r-sm); }
.color-field { display: flex; align-items: center; gap: var(--sp-2); }
.color-field > .input { flex: 1 1 auto; font-family: var(--font-mono); text-transform: uppercase; }

/* Dropzone: <label class="dropzone"><input type="file" class="dropzone__input">…</label> */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-8) var(--sp-6);
  border: 1.5px dashed var(--line-3);
  border-radius: var(--r-lg);
  background: var(--bg-2);
  color: var(--text-2);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.dropzone:hover { border-color: var(--text-4); background: color-mix(in srgb, var(--bg-2) 60%, var(--bg-3)); }
.dropzone:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.dropzone.is-drag { border-color: var(--brand); border-style: solid; background: var(--brand-soft); color: var(--text-1); }
.dropzone__icon {
  display: grid;
  place-items: center;
  width: var(--sp-12);
  height: var(--sp-12);
  margin-bottom: var(--sp-1);
  border-radius: var(--r-lg);
  background: var(--bg-4);
  color: var(--text-1);
  transition: color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.dropzone__icon .icon { width: 22px; height: 22px; }
.dropzone.is-drag .dropzone__icon { color: var(--brand); transform: translateY(-2px); }
.dropzone__title { font-weight: 600; color: var(--text-1); font-size: var(--fs-sm); }
.dropzone__hint { font-size: var(--fs-xs); color: var(--text-3); }
.dropzone__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone--sm { padding: var(--sp-5) var(--sp-4); }

/* ===================== 19. Tooltip · Toast · Modal ===================== */
/* CSS-only tooltip: <button data-tip="Undo" data-tip-pos="bottom"> */
:where([data-tip]) { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 50;
  width: max-content;
  max-width: 240px;
  padding: 6px var(--sp-2);
  border-radius: var(--r-sm);
  background: var(--bg-6);
  color: var(--text-1);
  box-shadow: var(--shadow-2);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: calc(var(--dur-2) + 100ms);
}
[data-tip-pos="bottom"]::after { top: calc(100% + 8px); bottom: auto; transform: translate(-50%, -4px); }
[data-tip-pos="right"]::after { left: calc(100% + 8px); top: 50%; bottom: auto; transform: translate(-4px, -50%); }
[data-tip-pos="right"]:is(:hover, :focus-visible)::after { transform: translate(0, -50%); }
[data-tip-pos="left"]::after { left: auto; right: calc(100% + 8px); top: 50%; bottom: auto; transform: translate(4px, -50%); }
[data-tip-pos="left"]:is(:hover, :focus-visible)::after { transform: translate(0, -50%); }
[data-tip=""]::after { display: none; }
@media (hover: none) { [data-tip]::after { display: none; } }

/* Toasts — GTD.toast(message, { type }) */
.toast-stack {
  position: fixed;
  right: var(--sp-6);
  bottom: var(--sp-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-2);
  width: min(400px, calc(100vw - var(--sp-6) * 2));
  pointer-events: none;
}
.toast {
  --toast-c: var(--info);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) var(--sp-2) var(--sp-3) var(--sp-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--bg-4);
  box-shadow: inset 3px 0 0 var(--toast-c), var(--shadow-3);
  color: var(--text-1);
  font-size: var(--fs-sm);
  line-height: 1.45;
  pointer-events: auto;
  animation: gtd-rise-in var(--dur-3) var(--ease-out);
}
.toast.is-leaving { animation: gtd-pop-out var(--dur-2) var(--ease) forwards; }
.toast--info { --toast-c: var(--info); }
.toast--ok { --toast-c: var(--ok); }
.toast--warn { --toast-c: var(--warn); }
.toast--danger { --toast-c: var(--danger); }
.toast__icon { display: flex; flex-shrink: 0; padding-top: 1px; color: var(--toast-c); }
.toast__icon .icon { width: 18px; height: 18px; }
.toast__msg { flex: 1 1 auto; min-width: 0; padding-top: 1px; overflow-wrap: anywhere; }
.toast__action {
  flex-shrink: 0;
  align-self: center;
  padding: 4px var(--sp-2);
  border-radius: var(--r-sm);
  color: var(--text-1);
  font-weight: 600;
  font-size: var(--fs-xs);
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 3px;
}
.toast__action:hover { text-decoration-color: var(--brand); }
.toast__close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
  color: var(--text-3);
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.toast__close .icon { width: 14px; height: 14px; }
.toast__close:hover { background: var(--bg-5); color: var(--text-1); }
@media (max-width: 480px) {
  .toast-stack { left: var(--sp-3); right: var(--sp-3); bottom: var(--sp-3); width: auto; align-items: stretch; }
}

/* Modal — <dialog class="modal"><div class="modal__box">…</div></dialog>
   The dialog itself is the dimmed overlay (works without ::backdrop vars). */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: var(--gutter);
  border: 0;
  background: color-mix(in srgb, var(--bg-0) 72%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--text-2);
  overflow: hidden;
  overscroll-behavior: contain;
}
.modal:not([open]), .drawer:not([open]) { display: none; } /* also for browsers without <dialog> */
.modal[open] { display: grid; place-items: center; animation: gtd-fade-in var(--dur-2) var(--ease); }
.modal::backdrop { background: transparent; }
.modal__box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 560px);
  max-height: calc(100vh - var(--gutter) * 2);
  max-height: calc(100dvh - var(--gutter) * 2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background: var(--bg-3);
  box-shadow: var(--shadow-3);
  animation: gtd-pop-in var(--dur-3) var(--ease-out);
}
.modal--sm .modal__box { width: min(100%, 420px); }
.modal--lg .modal__box { width: min(100%, 820px); }
.modal.is-closing { animation: gtd-fade-out var(--dur-2) var(--ease) forwards; }
.modal.is-closing .modal__box { animation: gtd-pop-out var(--dur-2) var(--ease) forwards; }
.modal__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-4) var(--sp-4) var(--sp-6);
  flex-shrink: 0;
}
.modal__title { flex: 1 1 auto; margin: 0; font-size: var(--fs-lg); }
.modal__close { margin-left: auto; }
.modal__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 var(--sp-6) var(--sp-6);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-6) transparent;
}
.modal__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--line-1);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  background: color-mix(in srgb, var(--bg-2) 55%, var(--bg-3));
  flex-shrink: 0;
}
.modal__foot--between { justify-content: space-between; }
@keyframes gtd-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes gtd-sheet-out { from { transform: none; } to { transform: translateY(100%); } }
@media (max-width: 720px) {
  .modal--sheet { padding: 0; }
  .modal--sheet[open] { place-items: end stretch; }
  .modal--sheet .modal__box {
    width: 100%;
    max-height: 88vh;
    max-height: 88dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-bottom: 0;
    animation: gtd-sheet-in var(--dur-3) var(--ease-out);
  }
  .modal--sheet.is-closing .modal__box { animation: gtd-sheet-out var(--dur-2) var(--ease) forwards; }
  .modal--sheet .modal__foot { border-radius: 0; }
}

/* ===================== 20. Callout · Empty state ===================== */
.callout {
  --callout-c: var(--text-3);
  --callout-bg: var(--bg-3);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5) var(--sp-4) var(--sp-4);
  border: 1px solid var(--line-1);
  border-left: 3px solid var(--callout-c);
  border-radius: var(--r-md);
  background: var(--callout-bg);
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.callout--info { --callout-c: var(--info); --callout-bg: var(--info-soft); }
.callout--ok { --callout-c: var(--ok); --callout-bg: var(--ok-soft); }
.callout--warn { --callout-c: var(--warn); --callout-bg: var(--warn-soft); }
.callout--danger { --callout-c: var(--danger); --callout-bg: var(--danger-soft); }
.callout--brand { --callout-c: var(--brand); --callout-bg: var(--brand-soft); }
.callout__icon { display: flex; flex-shrink: 0; margin-top: 1px; color: var(--callout-c); }
.callout__icon .icon { width: 18px; height: 18px; }
.callout__body { flex: 1 1 auto; min-width: 0; }
.callout__title { display: block; margin: 0 0 2px; color: var(--text-1); font-size: var(--fs-sm); font-weight: 600; font-family: var(--font-body); }
.callout__text { margin: 0; }
.callout__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-3); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-16) var(--sp-6);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--bg-1) 60%, transparent);
  text-align: center;
}
.empty--plain { border: 0; background: transparent; }
.empty__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--sp-2);
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--text-3);
}
.empty__icon .icon { width: 24px; height: 24px; }
.empty__title { margin: 0; font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; color: var(--text-1); }
.empty__text { margin: 0; max-width: 46ch; font-size: var(--fs-sm); color: var(--text-2); }
.empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); margin-top: var(--sp-3); }

/* ===================== 21. Breadcrumb · Accordion · Dropdown menu ===================== */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--text-3);
}
.breadcrumb li { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.breadcrumb li + li::before { content: "/"; content: "/" / ""; color: var(--text-4); }
.breadcrumb a { color: var(--text-3); text-decoration: none; border-radius: var(--r-xs); transition: color var(--dur-1) var(--ease); }
.breadcrumb a:hover { color: var(--text-1); }
.breadcrumb [aria-current="page"] { color: var(--text-1); }

/* <div class="accordion"><details class="accordion__item"><summary class="accordion__head">Q<span class="accordion__icon"></span></summary><div class="accordion__body">A</div></details></div> */
.accordion { border-top: 1px solid var(--line-2); }
.accordion__item { border-bottom: 1px solid var(--line-2); }
.accordion__item::details-content {
  height: 0;
  overflow: clip;
  transition: height var(--dur-3) var(--ease), content-visibility var(--dur-3) allow-discrete;
}
.accordion__item[open]::details-content { height: auto; }
.accordion__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) 0;
  list-style: none;
  color: var(--text-1);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: color var(--dur-1) var(--ease);
}
.accordion__head::-webkit-details-marker { display: none; }
.accordion__head::marker { content: ""; }
.accordion__head:hover { color: var(--text-1); }
.accordion__head:focus-visible { outline-offset: 4px; }
.accordion__icon {
  position: relative;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  color: var(--text-3);
  transition: transform var(--dur-2) var(--ease-out), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
.accordion__icon::before, .accordion__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1.75px;
  border-radius: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.accordion__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.accordion__head:hover .accordion__icon { color: var(--text-1); border-color: var(--line-3); background: var(--bg-4); }
.accordion__item[open] > .accordion__head .accordion__icon { transform: rotate(45deg); color: var(--text-1); }
.accordion__body { padding: 0 var(--sp-10) var(--sp-6) 0; max-width: 76ch; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-body); }
.accordion__body > * + * { margin-top: 0.8em; }
.accordion--boxed { border: 0; display: grid; gap: var(--sp-2); }
.accordion--boxed .accordion__item { border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--bg-3); padding-inline: var(--sp-5); transition: border-color var(--dur-2) var(--ease); }
.accordion--boxed .accordion__item[open] { border-color: var(--line-3); }

/* <div class="dropdown" data-dropdown><button data-dropdown-toggle aria-expanded="false">…</button><div class="menu" role="menu">…</div></div> */
.dropdown { position: relative; display: inline-flex; }
.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: calc(var(--z-header) + 5);
  min-width: 200px;
  max-width: min(320px, calc(100vw - var(--sp-6)));
  padding: var(--sp-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--bg-1);
  box-shadow: var(--shadow-3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top right;
  transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), visibility 0s linear var(--dur-1);
}
.dropdown.is-open > .menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), visibility 0s;
}
.menu--left { left: 0; right: auto; transform-origin: top left; }
.menu--up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom right; }
.menu__item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  min-height: 34px;
  padding: 6px var(--sp-2);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.menu__item .icon { width: 16px; height: 16px; color: var(--text-3); }
.menu__item:hover, .menu__item:focus-visible { background: var(--bg-4); color: var(--text-1); outline: none; }
.menu__item:focus-visible { box-shadow: inset 0 0 0 1px var(--brand-line); }
.menu__item:hover .icon, .menu__item:focus-visible .icon { color: var(--text-1); }
.menu__item:disabled, .menu__item[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; background: transparent; }
.menu__item--danger { color: var(--danger); }
.menu__item--danger .icon { color: var(--danger); }
.menu__item--danger:hover { background: var(--danger-soft); color: var(--danger); }
.menu__hint { margin-left: auto; padding-left: var(--sp-3); font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); }
.menu__sep { height: 1px; margin: var(--sp-1) 0; background: var(--line-1); border: 0; }
.menu__label {
  padding: var(--sp-2) var(--sp-2) var(--sp-1);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-3);
}

/* ===================== 22. Steps · Plate · Timeline ===================== */
/* Race-number plate */
.plate {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: var(--sp-12);
  height: var(--sp-12);
  border-radius: var(--r-sm);
  border: 1px solid var(--line-3);
  background: var(--bg-2);
  box-shadow: inset 0 0 0 3px var(--bg-2), inset 0 0 0 4px var(--line-1);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.plate--brand { border-color: var(--brand-line); background: var(--brand-soft); box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px var(--brand-soft-2); color: var(--brand); }
.plate--sm { width: var(--sp-8); height: var(--sp-8); font-size: var(--fs-xs); box-shadow: none; }
.plate--lg { width: var(--sp-16); height: var(--sp-16); font-size: var(--fs-xl); }

/* <ol class="steps"><li class="step"><span class="plate">01</span><div class="step__body"><h3 class="step__title">…</h3><p class="step__text">…</p></div></li></ol> */
.steps {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--sp-6);
  margin: 0;
  padding: 0;
  list-style: none;
}
.step { position: relative; display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(var(--sp-12) / 2);
  left: calc(var(--sp-12) + var(--sp-3));
  right: calc(var(--sp-3) * -1);
  height: 1px;
  background: repeating-linear-gradient(to right, var(--line-3) 0 4px, transparent 4px 8px);
}
.step__body { display: flex; flex-direction: column; gap: var(--sp-2); }
.step__title { margin: 0; font-family: var(--font-display); font-size: var(--fs-md); font-weight: 600; line-height: var(--lh-snug); color: var(--text-1); }
.step__text { margin: 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); }
.step.is-current .plate { border-color: var(--brand-line); color: var(--brand); }
.steps--vertical { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); }
.steps--vertical .step { flex-direction: row; gap: var(--sp-4); }
.steps--vertical .step:not(:last-child)::after {
  top: calc(var(--sp-12) + var(--sp-2));
  bottom: calc(var(--sp-6) * -1 + var(--sp-2));
  left: calc(var(--sp-12) / 2);
  right: auto;
  width: 1px;
  height: auto;
  background: repeating-linear-gradient(to bottom, var(--line-3) 0 4px, transparent 4px 8px);
}
.steps--vertical .step__body { padding-top: var(--sp-2); }
@media (max-width: 720px) {
  .steps { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); }
  .steps .step { flex-direction: row; gap: var(--sp-4); }
  .steps .step:not(:last-child)::after {
    top: calc(var(--sp-12) + var(--sp-2));
    bottom: calc(var(--sp-6) * -1 + var(--sp-2));
    left: calc(var(--sp-12) / 2);
    right: auto;
    width: 1px;
    height: auto;
    background: repeating-linear-gradient(to bottom, var(--line-3) 0 4px, transparent 4px 8px);
  }
  .steps .step__body { padding-top: var(--sp-2); }
}

/* <ol class="timeline"><li class="timeline__item is-done"><time class="timeline__date">2025</time><h3 class="timeline__title">…</h3><p class="timeline__text">…</p></li></ol> */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--line-2);
}
.timeline__item { position: relative; display: grid; gap: var(--sp-1); padding-left: var(--sp-10); }
.timeline__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--line-3);
  background: var(--bg-0);
}
.timeline__item.is-done::before { border-color: var(--text-3); background: var(--bg-5); }
.timeline__item.is-current::before { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft-2); }
.timeline__item.is-future::before { border-style: dashed; }
.timeline__date {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-3);
}
.timeline__item.is-current .timeline__date { color: var(--brand); }
.timeline__title { margin: 0; font-family: var(--font-display); font-size: var(--fs-md); font-weight: 600; line-height: var(--lh-snug); color: var(--text-1); }
.timeline__text { margin: 0; max-width: 60ch; font-size: var(--fs-sm); line-height: 1.6; color: var(--text-2); }
.timeline__item.is-future :is(.timeline__title, .timeline__text) { color: var(--text-3); }

/* ===================== 23. Hash · Kbd · Key-value ===================== */
/* <div class="hash"><span class="hash__label">SHA-256</span><code class="hash__value">…</code><button class="hash__copy" data-copy="…" aria-label="Copy">…</button></div> */
.hash {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  padding: 6px 6px 6px var(--sp-3);
  border: 1px solid var(--line-1);
  border-radius: var(--r-md);
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--text-2);
}
.hash__label {
  flex-shrink: 0;
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.hash__value {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-1);
  font-size: inherit;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.hash__copy {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  color: var(--text-3);
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.hash__copy .icon { width: 16px; height: 16px; }
.hash__copy:hover { background: var(--bg-4); color: var(--text-1); }
.hash__copy.is-copied, [data-copy].is-copied { color: var(--ok); }

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  background: var(--bg-3);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.kv { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }
.kv__k { font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.kv__v { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-1); font-variant-numeric: tabular-nums; }

/* ===================== 24. Site header · Drawer (layout.js) ===================== */
.site-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--brand);
  text-decoration: none;
  border-radius: var(--r-xs);
  transition: color var(--dur-1) var(--ease);
}
.site-logo:hover { color: var(--brand-hi); }
.site-logo:focus-visible { outline-offset: 6px; }
.site-logo svg { display: block; height: 22px; width: auto; aspect-ratio: 1600 / 261; }
.site-logo--lg svg { height: 28px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  border-bottom: 1px solid var(--line-1);
  background: color-mix(in srgb, var(--bg-1) 85%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  transition: box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: var(--bg-1); }
}
.site-header.is-scrolled {
  box-shadow: var(--shadow-2);
  border-bottom-color: var(--line-2);
  background: color-mix(in srgb, var(--bg-1) 92%, transparent);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  height: 100%;
}
.site-nav { display: flex; flex: 1 1 auto; min-width: 0; height: 100%; overflow: hidden; }
.site-nav__list { display: flex; align-items: stretch; gap: var(--sp-1); height: 100%; margin: 0; padding: 0; list-style: none; }
.site-nav__list > li { display: flex; }
.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 100%;
  padding-inline: var(--sp-3);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--dur-1) var(--ease);
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: var(--sp-3);
  right: var(--sp-3);
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--line-3);
  transform: scaleX(0);
  transition: transform var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease);
}
.site-nav__link:hover { color: var(--text-1); }
.site-nav__link:hover::after { transform: scaleX(1); }
.site-nav__link[aria-current="page"] { color: var(--text-1); }
.site-nav__link[aria-current="page"]::after { transform: scaleX(1); background: var(--brand); }
.site-nav__link:focus-visible { outline-offset: -14px; border-radius: var(--r-md); }
.site-header__actions { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; margin-left: auto; }
.site-burger { display: none; }

/* compact desktop (961–1279): tighter rhythm so EN and JA both fit (header uses .container--wide) */
@media (min-width: 961px) and (max-width: 1279px) {
  .site-header__inner { gap: var(--sp-4); }
  .site-nav__link { padding-inline: var(--sp-2); }
  .site-nav__link::after { left: var(--sp-2); right: var(--sp-2); }
  .site-header__cta .btn__icon { display: none; }
  /* JA labels are wider (ソフトウェア, お問い合わせ) — a bit less padding keeps the menu up as long as in EN */
  html[lang="ja"] .site-nav__link { padding-inline: var(--sp-1); }
  html[lang="ja"] .site-nav__link::after { left: var(--sp-1); right: var(--sp-1); }
}
@media (max-width: 960px) {
  .site-nav, .site-header .lang-switch { display: none; }
  .site-burger { display: inline-flex; }
}
/* JS fallback: layout.js adds .is-collapsed when the menu does not fit */
.site-header.is-collapsed .site-nav, .site-header.is-collapsed .lang-switch { display: none; }
.site-header.is-collapsed .site-burger { display: inline-flex; }
@media (max-width: 480px) {
  .site-header__cta { display: none; }
  .site-header__inner { gap: var(--sp-3); }
}

/* Drawer — <dialog class="drawer"> with overlay + panel */
.drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-2);
  overflow: hidden;
}
.drawer[open] { display: block; }
.drawer::backdrop { background: transparent; }
.drawer__overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg-0) 64%, transparent);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease);
}
.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(380px, 88vw);
  border-left: 1px solid var(--line-2);
  background: var(--bg-2);
  box-shadow: var(--shadow-3);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform var(--dur-3) var(--ease-out);
}
.drawer.is-open .drawer__overlay { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-shrink: 0;
  height: var(--header-h);
  padding-inline: var(--sp-5) var(--sp-3);
  border-bottom: 1px solid var(--line-1);
}
.drawer__nav { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3); }
.drawer__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 52px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.drawer__link:hover { background: var(--bg-4); color: var(--text-1); }
.drawer__link[aria-current="page"] { background: var(--bg-5); color: var(--text-1); }
.drawer__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: calc(var(--sp-3) * -1);
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.drawer__link:focus-visible { outline-offset: -2px; }
.drawer__num { width: 22px; font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 500; color: var(--text-4); letter-spacing: 0.04em; }
.drawer__link[aria-current="page"] .drawer__num { color: var(--brand); }
.drawer__link > .icon:last-child { margin-left: auto; width: 18px; height: 18px; color: var(--text-4); }
.drawer__label {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-3);
}
.drawer__foot {
  display: grid;
  gap: var(--sp-4);
  margin-top: auto;
  padding: var(--sp-5);
  border-top: 1px solid var(--line-1);
}
.drawer__row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.drawer__contact { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-2); font-size: var(--fs-sm); text-decoration: none; overflow-wrap: anywhere; }
.drawer__contact:hover { color: var(--text-1); }
.drawer__contact .icon { color: var(--text-3); }

/* ===================== 25. Announcement bar ===================== */
.announce {
  position: relative;
  border-bottom: 1px solid var(--line-1);
  background: var(--bg-2);
  font-size: var(--fs-sm);
}
.announce__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  min-height: var(--sp-10);
  padding-block: 6px;
  padding-right: calc(var(--gutter) + var(--sp-8));
}
.announce__link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  color: var(--text-1);
  text-decoration: none;
}
.announce__link .icon { width: 14px; height: 14px; color: var(--text-3); transition: transform var(--dur-2) var(--ease), color var(--dur-1) var(--ease); }
.announce__link:hover .icon { transform: translateX(2px); color: var(--brand); }
.announce__text { overflow-wrap: anywhere; }
.announce__close {
  position: absolute;
  top: 50%;
  right: var(--gutter);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  color: var(--text-3);
  transform: translateY(-50%);
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.announce__close .icon { width: 14px; height: 14px; }
.announce__close:hover { background: var(--bg-4); color: var(--text-1); }
@media (max-width: 480px) { .announce .badge { display: none; } .announce__inner { justify-content: flex-start; } }

/* ===================== 26. Site footer ===================== */
.site-footer {
  margin-top: auto;
  padding-top: var(--sp-16);
  border-top: 1px solid var(--line-1);
  background: var(--bg-1);
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--sp-12);
}
.site-footer__brand { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-5); }
.site-footer__brand .site-logo svg { height: 24px; }
.site-footer__desc { margin: 0; max-width: 38ch; color: var(--text-3); line-height: 1.6; }
.site-footer__email {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-2);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color var(--dur-1) var(--ease);
}
.site-footer__email .icon { width: 16px; height: 16px; color: var(--text-3); }
.site-footer__email:hover { color: var(--text-1); }
.site-footer__contact { display: grid; gap: var(--sp-2); }
.site-footer__location { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-3); }
.site-footer__location .icon { width: 16px; height: 16px; color: var(--text-4); }
.site-footer__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-8); }
.site-footer__title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-1);
}
.site-footer__links { display: grid; gap: var(--sp-3); margin: var(--sp-4) 0 0; padding: 0; list-style: none; }
.site-footer__links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  text-decoration: none;
  border-radius: var(--r-xs);
  transition: color var(--dur-1) var(--ease);
}
.site-footer__links a:hover { color: var(--text-1); }
.site-footer__links a[aria-current="page"] { color: var(--text-1); }
.site-footer__links .badge { margin-left: 2px; }
.site-footer .ruler { margin-top: var(--sp-12); }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3) var(--sp-6);
  padding-block: var(--sp-6) var(--sp-8);
}
.site-footer__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-5); }
.site-footer__copy, .site-footer__made { margin: 0; }
.site-footer__made { color: var(--text-2); }
.site-footer__tech {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-4);
}
/* Preferences: graphics mode (GTD.perf) + language — rendered by layout.js
   <div class="site-footer__prefs">
     <div class="perf-switch"> span.perf-switch__label (.icon + text) ·
       .segmented.segmented--sm > button[data-set-perf="auto|high|lite"]
       (Auto also holds .perf-switch__tier > [data-perf-tier] — visible only while Auto is pressed) </div>
     .segmented.lang-switch </div> */
.site-footer__prefs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5); min-width: 0; max-width: 100%; }
.perf-switch { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); min-width: 0; max-width: 100%; }
.perf-switch__label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}
.perf-switch__label .icon { width: 14px; height: 14px; color: var(--text-4); }
.perf-switch [data-set-perf="auto"] { gap: var(--sp-1); }
.perf-switch__tier { display: inline-flex; align-items: center; gap: var(--sp-1); font-weight: 500; color: var(--text-2); }
.perf-switch [data-set-perf="auto"]:not([aria-pressed="true"]) .perf-switch__tier { display: none; }

@media (max-width: 960px) {
  .site-footer__top { grid-template-columns: minmax(0, 1fr); gap: var(--sp-10); }
  .site-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-8) var(--sp-6); }
}
@media (max-width: 720px) {
  .site-footer { padding-top: var(--sp-12); }
  .site-footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* ===================== 27. CTA band (Home, About) ===================== */
/* <div class="cta-band brackets brackets--lg brackets--static">
     <span class="coord coord--tr">PIT LANE · OPEN</span>
     <div class="cta-band__copy"> .eyebrow · h2.cta-band__title · .lead </div>
     <div class="cta-band__side"> .btn-row · p.cta-band__mail </div>
   </div>
   Two columns (copy | actions) → one column ≤ 960 px. */
.cta-band {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: end;
  gap: var(--sp-10);
  padding: clamp(var(--sp-8), 5vw, var(--sp-16));
  border: 1px solid var(--line-2);
  border-radius: var(--r-2xl);
  background-color: var(--bg-1);
  background-image:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 55%),
    var(--dot-grid);
  background-size: auto, var(--grid-size) var(--grid-size);
}
.cta-band__title { max-width: 22ch; font-size: var(--fs-2xl); }
.cta-band .lead { margin-top: var(--sp-4); }
.cta-band__side { display: grid; gap: var(--sp-5); justify-items: start; }
.cta-band__mail { font-size: var(--fs-sm); color: var(--text-3); overflow-wrap: anywhere; }
@media (max-width: 960px) {
  .cta-band { grid-template-columns: minmax(0, 1fr); gap: var(--sp-8); }
}

/* ===================== 28. Device bezel (round AMOLED: Home, 404, styleguide) ===================== */
/* <div class="device [device--sm]"><div class="device__screen"><canvas | svg></div></div>
   Width comes from the parent or a page class; the screen is always 1:1.
   Tuning per page: --device-pad (bezel width, % of own width) · --device-drop (cast shadow). */
.device {
  --device-pad: 4.5%;
  --device-drop: 0 40px 90px -30px var(--bg-0);
  position: relative;
  border-radius: 50%;
  padding: var(--device-pad);
  background:
    conic-gradient(from 210deg, var(--bg-6), var(--bg-3) 18%, var(--text-4) 32%, var(--bg-4) 46%, var(--bg-6) 62%, var(--bg-3) 80%, var(--bg-6));
  box-shadow:
    inset 0 0 0 1px var(--line-3),
    0 0 0 1px var(--line-1),
    var(--device-drop),
    var(--shadow-3);
}
.device::before { /* inner chamfer */
  content: "";
  position: absolute;
  inset: 3.2%;
  border-radius: 50%;
  background: var(--bg-1);
  box-shadow: inset 0 2px 6px var(--bg-0);
}
.device__screen {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-0);
  box-shadow: 0 0 0 2px var(--bg-0);
  isolation: isolate;
}
.device__screen > canvas,
.device__screen > svg { display: block; width: 100%; height: 100%; }
.device__screen::after { /* glass reflection */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(120% 80% at 28% 12%, color-mix(in srgb, var(--text-1) 7%, transparent), transparent 46%);
}
.device--sm { --device-pad: 5%; }

/* ===================== 29. Dealer card (Dealers, Product → Where to buy) ===================== */
/* <article class="card dealer-card">
     <div class="card__body">
       <div class="dealer-card__head"> .icon-tile + .dealer-card__badges (.badge…) </div>
       h3.card__title · p.dealer-card__loc (.icon + span)
       [.dealer-card__carries > .card__kicker + ul.tags > li.tag[.is-match]]
     </div>
     <div class="card__foot"> span.meta.dealer-card__host + a.btn.btn--ghost.btn--sm </div>
   </article> */
.dealer-card .card__body { gap: var(--sp-3); }
.dealer-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-1); }
.dealer-card__badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); }
.dealer-card__loc { display: flex; align-items: center; gap: var(--sp-2); margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
.dealer-card__loc .icon { color: var(--text-3); }
.dealer-card__carries { margin-top: auto; padding-top: var(--sp-3); }
.dealer-card__carries .card__kicker { margin-bottom: var(--sp-2); }
.dealer-card .tag.is-match { border-color: var(--brand-line); color: var(--text-1); }
.dealer-card__host { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0.02em; }

/* ===================== 30. Lite performance tier (html[data-perf="lite"], GTD.perf) ===================== */
/* Same look, cheaper paint (DESIGN.md §13). Global part (tokens, blur, reveal) — base.css §15. */
/* blurred translucent surfaces → solid, same tokens */
html[data-perf="lite"] .site-header { background: var(--bg-1); }
html[data-perf="lite"] .tabs--sticky { background: var(--bg-0); }
/* overlays keep the dim (a bit deeper instead of the blur) */
html[data-perf="lite"] .modal { background: color-mix(in srgb, var(--bg-0) 84%, transparent); }
html[data-perf="lite"] .drawer__overlay { background: color-mix(in srgb, var(--bg-0) 76%, transparent); }
/* device bezel: short cast shadow (pages may tune --device-drop, lite wins) */
html[data-perf="lite"] .device { --device-drop: 0 16px 32px -16px var(--bg-0); }
/* hover zoom re-rasterises the product illustration every frame */
html[data-perf="lite"] .card--product:hover .card__media > :is(img, svg) { transform: none; }
/* no infinite decorative animation (functional spinners stay) */
html[data-perf="lite"] .badge__dot--pulse { animation: none; }
html[data-perf="lite"] .is-skeleton { animation: none; }

/* ===================== 31. Accounts (auth.js · layout.js · account.html) ===================== */
/* Avatar — <span class="avatar avatar--xs|sm|md|lg|xl"><span class="avatar__initials">DD</span><img class="avatar__img"></span>
   GTD.Auth.avatarHTML(user, { size }) renders it: the image (https only, referrerpolicy="no-referrer")
   covers the initials; a broken image is removed by auth.js and the initials stay. */
.avatar {
  --avatar-size: var(--sp-8);
  position: relative;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-6);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: calc(var(--avatar-size) * 0.4);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  user-select: none;
}
.avatar--xs { --avatar-size: var(--sp-6); }
.avatar--sm { --avatar-size: var(--sp-8); }
.avatar--md { --avatar-size: var(--sp-10); }
.avatar--lg { --avatar-size: var(--sp-16); }
.avatar--xl { --avatar-size: var(--sp-24); }
.avatar__initials { pointer-events: none; }
.avatar__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar > .icon { width: 55%; height: 55%; color: var(--text-2); }
html[lang="ja"] .avatar { font-family: var(--font-body); font-weight: 700; }

/* Skeleton placeholder (same box as the control it stands for) — .is-skeleton on .avatar / .btn / blocks */
.is-skeleton {
  pointer-events: none;
  user-select: none;
  animation: gtd-pulse calc(var(--dur-4) * 2.5) var(--ease) infinite;
}
.avatar.is-skeleton { background: var(--bg-4); box-shadow: none; }
.btn.is-skeleton { --btn-bg: var(--bg-4); --btn-bd: transparent; color: transparent; }
.btn.is-skeleton > * { visibility: hidden; }

/* Header account control — layout.js renders into .site-header__actions:
   .site-account[data-account-slot] >
     button.btn.btn--ghost.btn--sm.site-account__signin[data-auth-signin]          signed out
     .dropdown.site-account__dd > button.site-account__btn (.avatar--sm)            signed in
       + .menu.site-account__menu > .site-account__who (.avatar--md + .site-account__id > __name, __email)
         · .menu__sep · a.menu__item (My designs, Account) · .menu__sep · button.menu__item[data-auth-signout] */
.site-account { display: flex; align-items: center; flex-shrink: 0; }
.site-account__dd { display: flex; }
.site-account__btn {
  display: inline-grid;
  place-items: center;
  width: var(--sp-8);
  height: var(--sp-8);
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.site-account__btn:hover { box-shadow: 0 0 0 2px var(--line-3); }
.site-account__btn[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--text-3); }
.site-account__btn:active { transform: scale(0.95); }
.site-account__btn:focus-visible { outline: none; box-shadow: var(--ring); }
.site-account__menu { min-width: 248px; }
.site-account__who { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; padding: var(--sp-2) var(--sp-2) var(--sp-3); }
.site-account__id { display: grid; gap: 2px; min-width: 0; }
.site-account__name,
.site-account__email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.site-account__name { color: var(--text-1); font-size: var(--fs-sm); font-weight: 600; }
.site-account__email { color: var(--text-3); font-size: var(--fs-xs); }
.site-account__status { display: inline-flex; align-items: center; gap: var(--sp-1); margin-top: 2px; color: var(--warn); font-size: var(--fs-xs); line-height: 1.3; }
.site-account__status .icon { width: 14px; height: 14px; }
/* signed in, but the session can't be refreshed right now (GTD.Auth.isOffline()) */
.site-account__btn.is-offline { position: relative; }
.site-account__btn.is-offline::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 2px var(--bg-1);
}
.menu__item[aria-current="page"] { color: var(--text-1); background: var(--bg-3); }
.menu__item[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

/* Drawer (≤ 960 px): same account block between the menu and the footer */
.drawer__account-slot { padding: 0 var(--sp-3) var(--sp-3); }
.drawer__account {
  display: grid;
  gap: 2px;
  padding: var(--sp-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-lg);
  background: var(--bg-1);
}
.drawer__account.is-skeleton { min-height: var(--sp-12); border-color: transparent; background: var(--bg-3); }
.drawer__account--out { padding: 0; border: 0; background: none; }
.drawer__account-who { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; padding: var(--sp-2); }
.drawer__account-links { display: grid; gap: 2px; }
.drawer__account-links .menu__item { min-height: 44px; }
.drawer__account-links .menu__sep { margin-inline: var(--sp-2); }

/* Sign-in dialog — auth.js builds dialog.modal.modal--sm.auth-modal#gtd-auth > .modal__box.auth:
   .modal__head (.auth__back · h2.auth__title · .modal__close) · .modal__body.auth__body >
   p.auth__lead[data-auth-reason] · section.auth__view[data-auth-view=main|forgot|magic|sent|newpw]
   main: .auth__providers > .auth-provider · .auth__or · .tabs.tabs--block.auth__tabs ·
         form.auth__form (.field … .auth-pw · .auth__alert > .callout.auth__callout (+ details.auth__tech) · .auth__submit) */
.auth-modal .modal__box { width: min(100%, 440px); }
.auth__head { gap: var(--sp-2); }
.auth__back { margin-left: calc(var(--sp-2) * -1); }
.auth__title { min-width: 0; }
.auth__title:focus { outline: none; }
.auth__body { display: grid; gap: var(--sp-5); }
.auth__lead {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line-1);
  border-radius: var(--r-md);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.auth__lead .icon { flex-shrink: 0; margin-top: 1px; color: var(--text-3); }
.auth__view { display: grid; gap: var(--sp-5); min-width: 0; animation: gtd-fade-in var(--dur-2) var(--ease); }
.auth__providers { display: grid; gap: var(--sp-2); animation: gtd-fade-in var(--dur-2) var(--ease); }
.auth__or {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1;
}
.auth__or::before, .auth__or::after { content: ""; flex: 1 1 0; height: 1px; background: var(--line-2); }
.auth__email { display: grid; gap: var(--sp-5); }
.auth__form { display: grid; gap: var(--sp-4); min-width: 0; }
.auth__text { margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.55; }
.auth__text strong, .auth__sent-text strong { color: var(--text-1); font-weight: 600; overflow-wrap: anywhere; }
.auth__forgot { font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); text-underline-offset: 4px; }
.auth__forgot:hover { color: var(--text-1); }
.auth__submit { margin-top: var(--sp-1); }
.auth__alt {
  height: auto;
  min-height: var(--sp-10);
  padding-block: var(--sp-2);
  color: var(--text-2);
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  text-align: center;
}
.auth__fine { margin: 0; color: var(--text-3); font-size: var(--fs-xs); line-height: 1.5; text-align: center; }
.auth__callout { padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-3); }
.auth__callout .callout__actions { margin-top: var(--sp-2); }
.auth__tech { margin-top: var(--sp-2); font-size: var(--fs-xs); }
.auth__tech > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  border-radius: var(--r-xs);
  color: var(--text-3);
  list-style: none;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease);
}
.auth__tech > summary::-webkit-details-marker { display: none; }
.auth__tech > summary::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--dur-1) var(--ease);
}
.auth__tech[open] > summary::before { margin-top: -4px; transform: rotate(45deg); }
.auth__tech > summary:hover { color: var(--text-1); }
.auth__tech pre {
  max-height: 160px;
  margin: var(--sp-2) 0 0;
  padding: var(--sp-2) var(--sp-3);
  overflow: auto;
  border-radius: var(--r-sm);
  background: var(--bg-1);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.auth__sent { justify-items: center; gap: var(--sp-4); padding-top: var(--sp-2); text-align: center; }
.auth__sent-text { max-width: 38ch; margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; }
.auth__sent-actions { display: grid; gap: var(--sp-2); width: 100%; margin-top: var(--sp-2); }
.auth__sent .auth__alert { width: 100%; text-align: left; }
.auth-pw__toggle[aria-pressed="true"] { color: var(--text-1); }

/* Provider buttons. Google = its brand "dark" theme: fill ≈ #131314 (--bg-0), 1 px stroke ≈ #8E918F (--text-3),
   label ≈ #E3E3E3 (--text-1), the standard-colour "G" at 18 px, 12 px inset, pill shape, label "Continue with Google".
   Other providers share the shape; Apple uses its white style (dark backgrounds). */
.auth-provider {
  --prov-bg: var(--bg-0);
  --prov-fg: var(--text-1);
  --prov-bd: var(--text-3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--sp-10);
  padding: 0 calc(var(--sp-6) + 18px);
  border: 1px solid var(--prov-bd);
  border-radius: var(--r-pill);
  background-color: var(--prov-bg);
  color: var(--prov-fg);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.auth-provider:hover { background-color: color-mix(in srgb, var(--prov-fg) 8%, var(--prov-bg)); }
.auth-provider:active { background-color: color-mix(in srgb, var(--prov-fg) 12%, var(--prov-bg)); transform: translateY(1px); }
.auth-provider:focus-visible { outline: none; box-shadow: var(--ring); }
.auth-provider:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.auth-provider.is-loading:disabled { opacity: 1; cursor: progress; }
.auth-provider__mark {
  position: absolute;
  top: 50%;
  left: var(--sp-3);
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
}
.auth-provider__mark > svg { display: block; width: 18px; height: 18px; }
.auth-provider__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-provider.is-loading .auth-provider__mark > * { visibility: hidden; }
.auth-provider.is-loading .auth-provider__mark::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  border: 2px solid var(--prov-fg);
  border-right-color: transparent;
  animation: gtd-spin var(--dur-4) linear infinite;
}
.auth-provider--apple { --prov-bg: var(--text-1); --prov-fg: var(--bg-0); --prov-bd: var(--text-1); }
@media (max-width: 480px) {
  .site-account__menu { min-width: 232px; }
}

/* ===================== Japanese: translated mono labels use the body stack ===================== */
html[lang="ja"] :is(
  .badge, .breadcrumb ol, .card__kicker, .site-footer__title, .spec-group__title,
  .panel__title, .side-group__title, .menu__label, .timeline__date, .drawer__label,
  .field__label--mono, .chip__count, .eyebrow--ja, .perf-switch__label
) {
  font-family: var(--font-body);
  letter-spacing: 0.04em;
}
html[lang="ja"] .badge { font-weight: 700; }
html[lang="ja"] .btn--link { text-underline-offset: 7px; }
