/* ==========================================================================
   Components: glass surfaces, cards, lists, chips, controls, sheets, toasts
   Markup for each is shown on #/styleguide and built by helpers in js/ui.js.
   ========================================================================== */

/* ---------- Glass material ---------- */
.glass, .card, .list, .sheet, .toast, .tabbar, .app-header__bar, .icon-btn--glass, .segmented--glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur)) saturate(var(--saturate));
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 0 .5px var(--glass-stroke), var(--glass-shadow);
}
/* Thicker tint behind dense text (long notes, forms, sheets) */
.glass--thick, .sheet, .toast { background: var(--glass-bg-thick); }
.glass--thin { background: var(--glass-bg-thin); }
.glass--flat { box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 0 .5px var(--glass-stroke); }

/* ---------- Card ---------- */
.card {
  position: relative;
  display: block;
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  color: var(--text);
  text-align: left;
  width: 100%;
}
.card--thick { background: var(--glass-bg-thick); }
.card--flush { padding: 0; overflow: hidden; }
.card--interactive {
  cursor: pointer; text-decoration: none;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease);
  font: inherit;
}
.card--interactive:hover { text-decoration: none; box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 0 .5px var(--glass-stroke), var(--glass-shadow-lg); }
.card--interactive:active { transform: scale(.985); }
/* Accent stripe on the leading edge, coloured by data-accent / data-block */
.card--accent { padding-left: calc(var(--sp-4) + 6px); }
.card--accent::before {
  content: ""; position: absolute; left: 7px; top: 14px; bottom: 14px; width: 4px;
  border-radius: 4px; background: var(--accent);
}
.card__header { display: flex; align-items: center; gap: var(--sp-3); }
.card__heading { display: block; flex: 1 1 auto; min-width: 0; }
.card__title { display: block; font-size: var(--fs-headline); font-weight: 600; line-height: 1.3; }
.card__subtitle { display: block; font-size: var(--fs-subhead); color: var(--text-2); margin-top: 2px; }
.card__trailing { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.card__body { display: block; margin-top: var(--sp-3); font-size: var(--fs-callout); }
.card__header + .card__body:empty { display: none; }
.card__footer { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-4); flex-wrap: wrap; }

/* ---------- Icon tile (rounded square holding an icon, tinted by accent) ---------- */
.icon-tile {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.icon-tile--sm { width: 28px; height: 28px; border-radius: 8px; }
.icon-tile--lg { width: 48px; height: 48px; border-radius: 14px; }
.icon-tile--xl { width: 64px; height: 64px; border-radius: 18px; }
.icon-tile--solid { background: var(--accent); color: var(--accent-on); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }

/* ---------- Avatar ---------- */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--avatar-bg, var(--blue)); color: #fff;
  font-size: 15px; font-weight: 600; letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 0 2px var(--glass-border);
  user-select: none;
}
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar--lg { width: 56px; height: 56px; font-size: 20px; }

/* ---------- Grouped list ---------- */
.list { border-radius: var(--r-lg); overflow: hidden; padding: 0; }
.list > li + li > .list-row::before {
  content: ""; position: absolute; top: 0; right: 0; left: var(--sep-inset, 16px);
  border-top: 1px solid var(--separator);
}
.list-row {
  position: relative;
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; min-height: 56px;
  padding: var(--sp-3) var(--sp-4);
  background: transparent; border: 0; border-radius: 0;
  color: var(--text); text-align: left; text-decoration: none; font: inherit;
}
.list-row:has(.list-row__lead) { --sep-inset: 64px; }
a.list-row, button.list-row { cursor: pointer; transition: background var(--dur-fast) var(--ease); }
a.list-row:hover, button.list-row:hover { background: var(--fill-1); text-decoration: none; }
a.list-row:active, button.list-row:active { background: var(--fill-2); }
.list-row:focus-visible { outline-offset: -3px; border-radius: var(--r-sm); }
.list-row__lead { display: flex; flex: none; }
.list-row__body { display: block; flex: 1 1 auto; min-width: 0; }
.list-row__title { display: block; font-size: var(--fs-body); font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row__subtitle { display: block; font-size: var(--fs-subhead); color: var(--text-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row__trail { display: flex; align-items: center; gap: var(--sp-2); flex: none; color: var(--text-2); font-size: var(--fs-subhead); }
.list-row__chevron { color: var(--text-3); flex: none; }
.list-row--wrap .list-row__title, .list-row--wrap .list-row__subtitle { white-space: normal; }

/* ---------- Section ---------- */
.section { display: flex; flex-direction: column; gap: var(--sp-2); }
.section__header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); padding: 0 var(--sp-1); min-height: 32px; }
.section__title { font-size: var(--fs-title3); font-weight: 700; letter-spacing: -0.01em; }
.section__footer { font-size: var(--fs-footnote); color: var(--text-3); padding: 0 var(--sp-1); }

/* ---------- Page header (inside a view) ---------- */
.page-header { display: flex; flex-direction: column; gap: var(--sp-1); padding-top: var(--sp-2); }
.page-header__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: var(--tap); }
.page-header__actions { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.page-header__title { font-size: var(--fs-largetitle); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.page-header__subtitle { font-size: var(--fs-subhead); color: var(--text-2); }
.page-header__eyebrow { font-size: var(--fs-footnote); font-weight: 600; color: var(--accent-ink); letter-spacing: .02em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: 0 var(--sp-5);
  border-radius: var(--r-pill); border: 1px solid transparent;
  font-size: var(--fs-callout); font-weight: 600; line-height: 1; white-space: nowrap;
  text-decoration: none; user-select: none;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur-fast);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn--primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff) 0%, var(--accent) 100%);
  color: var(--accent-on);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn--primary:hover { filter: brightness(1.05); }
.btn--secondary {
  background: var(--glass-bg-thick); color: var(--accent-ink); border-color: var(--glass-border);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur)) saturate(var(--saturate));
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 0 .5px var(--glass-stroke), 0 2px 8px rgba(20,30,60,.06);
}
.btn--tinted { background: var(--accent-soft); color: var(--accent-ink); }
.btn--tinted:hover { background: color-mix(in srgb, var(--accent-soft) 100%, var(--accent) 8%); }
.btn--plain { background: transparent; color: var(--accent-ink); padding: 0 var(--sp-3); }
.btn--plain:hover { background: var(--fill-1); }
.btn--danger { background: var(--red); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.btn--danger-plain { background: var(--red-soft); color: var(--red-ink); }
.btn--sm { min-height: 36px; padding: 0 var(--sp-4); font-size: var(--fs-subhead); }
.btn--sm { position: relative; }
.btn--sm::after, .icon-btn--sm::after, .chip::after { content: ""; position: absolute; inset: -4px; } /* keep 44px hit area */
.btn--lg { min-height: 54px; padding: 0 var(--sp-6); font-size: var(--fs-headline); }
.btn--block { display: flex; width: 100%; }

/* ---------- Icon buttons ---------- */
.icon-btn {
  position: relative;
  display: inline-grid; place-items: center; flex: none;
  width: var(--tap); height: var(--tap); padding: 0;
  border-radius: 50%; border: 1px solid transparent;
  background: var(--fill-1); color: var(--accent-ink);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--fill-2); text-decoration: none; }
.icon-btn:active { transform: scale(.92); }
.icon-btn[disabled] { opacity: .4; pointer-events: none; }
.icon-btn--glass { background: var(--glass-bg-thick); }
.icon-btn--plain { background: transparent; }
.icon-btn--plain:hover { background: var(--fill-1); }
.icon-btn--tinted { background: var(--accent-soft); }
.icon-btn--primary { background: var(--accent); color: var(--accent-on); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.icon-btn--neutral { color: var(--text); }
.icon-btn--sm { width: 36px; height: 36px; }
.icon-btn--lg { width: 64px; height: 64px; }
.icon-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-on); }

/* ---------- Chips and badges ---------- */
.chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 var(--sp-3);
  border-radius: var(--r-pill); border: 1px solid transparent;
  background: var(--fill-1); color: var(--text);
  font-size: var(--fs-subhead); font-weight: 500; line-height: 1; white-space: nowrap;
}
button.chip { cursor: pointer; transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
button.chip:hover { background: var(--fill-2); }
button.chip:active { transform: scale(.96); }
.chip--accent, .chip[data-accent], .chip[data-block] { background: var(--accent-soft); color: var(--accent-ink); }
.chip--selected, .chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-on); }
.chip--outline { background: transparent; border-color: var(--separator); }
.chip--sm { min-height: 24px; padding: 0 var(--sp-2); font-size: var(--fs-footnote); gap: 4px; }
.chip::after { inset: -6px -2px; }
.chip--sm::after { inset: -10px -2px; }
.chip--lg { min-height: 40px; padding: 0 var(--sp-4); font-size: var(--fs-callout); }
span.chip::after { display: none; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: var(--fs-caption); font-weight: 600; letter-spacing: .01em; white-space: nowrap;
}
.badge--solid { background: var(--accent); color: var(--accent-on); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---------- Segmented control ---------- */
.segmented {
  position: relative;
  display: inline-flex; align-items: stretch; gap: 2px;
  padding: 3px; border-radius: var(--r-pill);
  background: var(--fill-1);
}
.segmented--glass { padding: 3px; }
.segmented--fill { display: flex; width: 100%; }
.segmented--fill .segmented__option { flex: 1 1 0; }
.segmented__option {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 var(--sp-4);
  border: 0; border-radius: var(--r-pill); background: transparent;
  color: var(--text-2); font-size: var(--fs-subhead); font-weight: 600; white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.segmented__option:hover { color: var(--text); }
.segmented__option[aria-checked="true"] {
  background: var(--glass-bg-thick); color: var(--text);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 1px 3px rgba(15,23,42,.12), 0 4px 12px rgba(15,23,42,.08);
}
@media (prefers-color-scheme: dark) {
  .segmented__option[aria-checked="true"] { background: rgba(255,255,255,.16); }
}
.segmented--sm .segmented__option { min-height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-footnote); }
.segmented--sm .segmented__option { position: relative; }
.segmented--sm .segmented__option::after { content: ""; position: absolute; inset: -6px 0; }

/* ---------- Stepper ---------- */
.stepper {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: 3px; border-radius: var(--r-pill); background: var(--fill-1);
}
.stepper__btn {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: var(--glass-bg-thick); color: var(--accent-ink);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 1px 3px rgba(15,23,42,.10);
  transition: transform var(--dur-fast) var(--ease);
}
.stepper__btn { position: relative; }
.stepper__btn::after { content: ""; position: absolute; inset: -2px; }
.stepper__btn:active { transform: scale(.9); }
.stepper__btn[disabled] { opacity: .35; pointer-events: none; }
.stepper__value {
  min-width: 64px; padding: 0 var(--sp-1); text-align: center;
  font-family: var(--font-rounded); font-size: var(--fs-title3); font-weight: 600; font-variant-numeric: tabular-nums;
}
.stepper__unit { font-size: var(--fs-footnote); font-weight: 500; color: var(--text-2); margin-left: 2px; font-family: var(--font-sans); }
.stepper--lg .stepper__btn { width: 52px; height: 52px; }
.stepper--lg .stepper__value { min-width: 96px; font-size: var(--fs-title1); }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: var(--fs-subhead); font-weight: 600; color: var(--text); padding-left: 2px; }
.field__hint { font-size: var(--fs-footnote); color: var(--text-3); padding-left: 2px; }
.field__error { font-size: var(--fs-footnote); color: var(--red-ink); padding-left: 2px; }
.input, .textarea, .select {
  width: 100%; min-height: var(--tap);
  padding: 10px var(--sp-4);
  border-radius: var(--r-sm); border: 1px solid var(--separator);
  background: var(--glass-bg-thick); color: var(--text);
  font-size: var(--fs-body);
  box-shadow: inset 0 1px 2px rgba(15,23,42,.05);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: 1; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 25%, transparent); outline: none; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23808796' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.input--search { padding-left: 40px; border-radius: var(--r-pill); }
.search-field { position: relative; display: block; }
.search-field > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-group { display: flex; align-items: center; gap: var(--sp-2); }
.input-group > .input { flex: 1 1 auto; }
.input-group__unit { color: var(--text-2); font-size: var(--fs-subhead); }

/* Switch (checkbox with role="switch") */
.switch { display: inline-flex; align-items: center; gap: var(--sp-3); min-height: var(--tap); cursor: pointer; }
.switch__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  position: relative; flex: none; width: 51px; height: 31px; border-radius: var(--r-pill);
  background: var(--fill-3); transition: background var(--dur) var(--ease);
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2), 0 0 0 .5px rgba(0,0,0,.04);
  transition: transform var(--dur) var(--ease-spring);
}
.switch__input:checked + .switch__track { background: var(--brand); }
.switch__input:checked + .switch__track::after { transform: translateX(20px); }
.switch__input:focus-visible + .switch__track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch__label { font-size: var(--fs-body); }

/* ---------- Empty state ---------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--sp-3); padding: var(--sp-8) var(--sp-5);
}
.empty-state__title { font-size: var(--fs-title3); font-weight: 700; }
.empty-state__message { font-size: var(--fs-callout); color: var(--text-2); max-width: 34ch; }
.empty-state .btn { margin-top: var(--sp-2); }

/* ---------- Progress ---------- */
.progress { position: relative; height: 8px; border-radius: var(--r-pill); background: var(--fill-2); overflow: hidden; }
.progress__bar { position: absolute; inset: 0 auto 0 0; width: var(--value, 0%); border-radius: inherit; background: var(--accent); transition: width var(--dur-slow) var(--ease); }

/* ---------- Stat ---------- */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat__value { font-family: var(--font-rounded); font-size: var(--fs-title2); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat__label { font-size: var(--fs-footnote); color: var(--text-2); display: flex; align-items: center; gap: 4px; }

.divider { height: 1px; background: var(--separator); border: 0; margin: var(--sp-2) 0; }

/* ---------- Block summary line (icon + label + description) ---------- */
.block-line { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.block-line__text { display: block; min-width: 0; }
.block-line__type { display: block; font-size: var(--fs-footnote); font-weight: 600; color: var(--accent-ink); }
.block-line__desc { display: block; font-size: var(--fs-callout); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Sheet (bottom sheet on phones, centred dialog from 640px) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  background: var(--scrim);
  animation: fade-in var(--dur) var(--ease);
}
.sheet {
  position: relative;
  width: 100%; max-width: 560px; max-height: calc(100dvh - 40px);
  display: flex; flex-direction: column;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-bottom: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow-lg);
  animation: sheet-up var(--dur-slow) var(--ease);
  -webkit-backdrop-filter: blur(var(--blur-strong)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-strong)) saturate(var(--saturate));
}
.sheet--full { height: calc(100dvh - 40px); }
.sheet__grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-3); margin: 8px auto 0; flex: none; }
.sheet__header { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-5); min-height: 56px; flex: none; }
.sheet__title { flex: 1 1 auto; font-size: var(--fs-headline); font-weight: 700; }
.sheet__body { flex: 1 1 auto; overflow-y: auto; padding: var(--sp-2) var(--sp-5) var(--sp-5); overscroll-behavior: contain; }
.sheet__actions { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5) var(--sp-5); flex: none; }
.sheet__actions--row { flex-direction: row-reverse; }
.sheet__actions--row .btn { flex: 1 1 0; }
.sheet-backdrop.is-closing { animation: fade-out var(--dur) var(--ease) forwards; }
.sheet-backdrop.is-closing .sheet { animation: sheet-down var(--dur) var(--ease) forwards; }
@media (min-width: 640px) {
  .sheet-backdrop { align-items: center; padding: var(--sp-6); }
  .sheet { border-radius: var(--r-xl); border-bottom: 1px solid var(--glass-border); max-height: calc(100dvh - 80px); animation: dialog-in var(--dur) var(--ease); }
  .sheet__grabber { display: none; }
  .sheet__header { padding-top: var(--sp-3); }
  .sheet-backdrop.is-closing .sheet { animation: dialog-out var(--dur-fast) var(--ease) forwards; }
}

/* ---------- Toast ---------- */
.toast-region {
  position: fixed; left: 0; right: 0; z-index: 200;
  bottom: calc(var(--tabbar-clearance) - 8px);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: 0 var(--gutter); pointer-events: none;
}
body.no-tabbar .toast-region { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  max-width: 440px; min-height: 48px; padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  border-radius: var(--r-pill);
  font-size: var(--fs-subhead); font-weight: 500;
  pointer-events: auto;
  animation: toast-in var(--dur-slow) var(--ease-spring);
}
.toast:not(:has(.btn)) { padding-right: var(--sp-5); }
.toast > .icon { color: var(--accent-ink); }
.toast.is-leaving { animation: toast-out var(--dur) var(--ease) forwards; }

/* ---------- Animations ---------- */
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes dialog-in { from { opacity: 0; transform: scale(.96) translateY(8px); } }
@keyframes dialog-out { to { opacity: 0; transform: scale(.97); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Fallbacks ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .card, .list, .sheet, .toast, .tabbar, .app-header__bar, .icon-btn--glass, .segmented--glass, .btn--secondary { background: var(--glass-bg-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .glass--thin, .glass--thick, .card, .list, .sheet, .toast, .tabbar, .app-header__bar, .icon-btn--glass, .segmented--glass, .btn--secondary, .input, .textarea, .select, .stepper__btn {
    background-color: var(--glass-bg-solid);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  body::before { opacity: .35; }
}
@media (forced-colors: active) {
  .card, .list, .sheet, .tabbar, .chip, .btn, .icon-btn, .segmented__option[aria-checked="true"] { border: 1px solid CanvasText; }
}
