/* Ether core components. Tokens only. Prefix eth- so docs chrome stays intact. */

/* ----- Demo chrome ----- */
.eth-demo {
  margin: var(--space-4) 0 var(--space-6);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  color: var(--fg);
}
.eth-demo + .eth-demo { margin-top: calc(-1 * var(--space-4)); }
.eth-demo-label {
  display: block;
  margin: 0 0 var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-label-size);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.eth-demo h3.eth-demo-label { margin: 0 0 var(--space-3); }
.eth-demo-block { margin-bottom: var(--space-5); }
.eth-demo-block:last-child { margin-bottom: 0; }
.eth-demo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.eth-demo-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}
.eth-demo ul, .eth-demo ol, .eth-demo dl { margin: 0; }
.eth-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (min-width: 841px) {
  .shell:has(.subnav[aria-label="Components"]) .subnav {
    position: sticky;
    top: var(--header-h);
    max-height: calc(100vh - var(--header-h));
    overflow: auto;
  }
}

/* ----- Shared icon (Tabler webfont) ----- */
.eth-icon,
.icon,
.ti.eth-icon,
.ti.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 24px;
  width: 24px;
  height: 24px;
  line-height: 1;
  color: inherit;
  speak: never;
}
.eth-icon--16,
.icon--16,
.ti.eth-icon--16,
.ti.icon--16 { font-size: 16px; width: 16px; height: 16px; }
.eth-icon--20,
.icon--20,
.ti.eth-icon--20,
.ti.icon--20 { font-size: 20px; width: 20px; height: 20px; }
.eth-icon--24,
.icon--24,
.ti.eth-icon--24,
.ti.icon--24 { font-size: 24px; width: 24px; height: 24px; }

[dir="rtl"] .ti-chevron-right,
[dir="rtl"] .ti-chevron-left {
  transform: scaleX(-1);
}
[dir="rtl"] .eth-acc-item.is-open .eth-acc-chevron {
  transform: scaleX(-1) rotate(90deg);
}

/* ----- Button ----- */
.eth-btn {
  --control-h: var(--control-h-md);
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin: 0;
  padding: 0 var(--control-pad-x);
  height: var(--control-h);
  min-width: var(--control-h);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: var(--text-ui-tracking);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border-radius: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg);
  transition:
    transform var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    opacity var(--dur-fast) var(--ease-out);
}
.eth-btn .eth-icon,
.eth-btn .ti {
  font-size: 16px;
  width: 16px;
  height: 16px;
}
.eth-btn::after {
  content: "";
  position: absolute;
  pointer-events: auto;
  inset: calc((var(--hit) - var(--control-h)) / -2);
}
.eth-btn--sm { --control-h: var(--control-h-sm); padding: 0 var(--control-pad-x-sm); font-size: 0.8125rem; }
.eth-btn--md { --control-h: var(--control-h-md); }
.eth-btn--lg { --control-h: var(--control-h-lg); font-size: 0.9375rem; }
.eth-btn--lg .eth-icon,
.eth-btn--lg .ti { font-size: 20px; width: 20px; height: 20px; }
.eth-btn--icon { padding: 0; width: var(--control-h); }

.eth-btn--primary {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--action-fg);
}
.eth-btn--primary:hover { filter: brightness(1.05); color: var(--action-fg); }
.eth-btn--secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--fg);
}
.eth-btn--secondary:hover { border-color: var(--fg); color: var(--fg); }
.eth-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--fg);
}
.eth-btn--ghost:hover { background: var(--bg-inset); color: var(--fg); }
.eth-btn--danger {
  background: transparent;
  border-color: transparent;
  color: var(--fg-critical);
}
.eth-btn--danger:hover { background: var(--critical-muted); color: var(--fg-critical); }

.eth-btn:active { transform: scale(0.97); }
.eth-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.eth-btn:disabled,
.eth-btn[aria-disabled="true"] {
  color: var(--fg-disabled);
  background: transparent;
  border-color: var(--border);
  cursor: not-allowed;
  transform: none;
  filter: none;
}
.eth-btn.is-loading { pointer-events: none; }
.eth-btn .eth-btn-spinner { width: 1em; height: 1em; }

/* ----- Link ----- */
.eth-link {
  color: var(--fg-signal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  font: inherit;
  cursor: pointer;
}
.eth-link:hover { color: var(--fg); }
.eth-link .eth-icon { display: inline-flex; vertical-align: -0.2em; margin-inline-start: 0.2em; }
.eth-link[aria-disabled="true"] {
  color: var(--fg-disabled);
  text-decoration: none;
  pointer-events: none;
  cursor: not-allowed;
}

/* ----- Accordion ----- */
.eth-acc { border-top: 1px solid var(--border); width: 100%; }
.eth-acc-item { border-bottom: 1px solid var(--border); }
.eth-acc-item h3 { margin: 0; font-size: inherit; font-weight: inherit; }
.eth-acc-trigger {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--control-h-lg);
  padding: var(--space-2) 0;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  text-align: start;
}
.eth-acc-trigger:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.eth-acc-chevron {
  flex-shrink: 0;
  transition: transform 160ms var(--ease-out);
}
.eth-acc-item.is-open .eth-acc-chevron { transform: rotate(90deg); }
.eth-acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 160ms var(--ease-out);
}
.eth-acc-item.is-open .eth-acc-panel {
  grid-template-rows: 1fr;
  transition-duration: 280ms;
}
.eth-acc-panel-inner {
  overflow: hidden;
  min-height: 0;
  color: var(--fg-muted);
  padding-bottom: 0;
}
.eth-acc-item.is-open .eth-acc-panel-inner { padding-bottom: var(--space-3); }

/* ----- Alert ----- */
.eth-alert {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: start;
  padding: var(--space-3);
  border: 1px solid var(--border);
  width: 100%;
}
.eth-alert--info { background: var(--info-muted); color: var(--fg-info); }
.eth-alert--caution { background: var(--caution-muted); color: var(--fg-caution); }
.eth-alert--critical { background: var(--critical-muted); color: var(--fg-critical); }
.eth-alert--positive { background: var(--positive-muted); color: var(--fg-positive); }
.eth-alert-body { color: inherit; }
.eth-alert-body strong { display: block; color: inherit; font-weight: 600; margin-bottom: 0.15rem; }
.eth-alert-body p { margin: 0; color: var(--fg); }
.eth-alert-actions { display: flex; align-items: center; gap: var(--space-1); }
@media (max-width: 767px) {
  .eth-alert { border-inline: 0; }
}

/* ----- Avatar ----- */
.eth-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  --hue: 160;
  background: hsl(var(--hue) 32% 28%);
  color: var(--fg-inverse);
  flex-shrink: 0;
  vertical-align: middle;
}
html.dark .eth-avatar {
  background: hsl(var(--hue) 28% 72%);
}
.demo-surface[data-surface="ink"] .eth-avatar {
  background: hsl(var(--hue) 28% 72%);
}
.eth-avatar--person { border-radius: 50%; }
.eth-avatar--org { border-radius: 8px; }
.eth-avatar--24 { width: 24px; height: 24px; font-size: 0.625rem; }
.eth-avatar--32 { width: 32px; height: 32px; font-size: 0.75rem; }
.eth-avatar--40 { width: 40px; height: 40px; font-size: 0.8125rem; }
.eth-avatar--64 { width: 64px; height: 64px; font-size: 1.125rem; }
.eth-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eth-avatar-initials {
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}
.eth-avatar-group { display: inline-flex; align-items: center; }
.eth-avatar-group .eth-avatar { box-shadow: 0 0 0 2px var(--bg-surface); }
.eth-avatar-group .eth-avatar + .eth-avatar { margin-inline-start: -8px; }
.eth-avatar-overflow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-inline-start: -8px;
  border-radius: 50%;
  background: var(--bg-inset);
  color: var(--fg);
  font-size: 0.75rem;
  font-weight: 500;
  box-shadow: 0 0 0 2px var(--bg-surface);
}

/* ----- Badge ----- */
.eth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 12px;
  line-height: 1.125rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--bg-inset);
  color: var(--fg);
}
.eth-badge--sm { padding: 0 0.4rem; font-size: 11px; }
.eth-badge--info { background: var(--info-muted); color: var(--fg-info); }
.eth-badge--caution { background: var(--caution-muted); color: var(--fg-caution); }
.eth-badge--critical { background: var(--critical-muted); color: var(--fg-critical); }
.eth-badge--positive { background: var(--positive-muted); color: var(--fg-positive); }
.eth-badge--signal { background: var(--signal-muted); color: var(--fg-signal); }
.eth-badge--outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--fg);
}
.eth-badge--count {
  background: var(--fg);
  color: var(--fg-inverse);
  min-width: 1.25rem;
  justify-content: center;
  padding-inline: 0.35rem;
}
.eth-badge-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  min-width: 44px;
  min-height: 44px;
  margin: -14px -10px -14px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.eth-badge-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fg-critical);
  top: 0;
  inset-inline-end: 0;
  box-shadow: 0 0 0 2px var(--bg-surface);
}
.eth-avatar-wrap { position: relative; display: inline-block; }

/* ----- Breadcrumbs ----- */
/* Kill docs-prose list styles (.content ol padding, .content li + li margin-top)
   that otherwise drop every crumb after the first. Tabler chevrons stay. */
.eth-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.eth-crumbs li,
.eth-crumbs li + li {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.eth-crumbs li::marker { content: none; }
.eth-crumbs li[hidden] { display: none; }
.eth-crumbs a,
.eth-crumbs [aria-current="page"],
.eth-crumbs [data-eth-crumbs-more] {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: var(--text-ui-tracking);
  line-height: 1.25;
  color: var(--fg-signal);
  text-decoration: none;
  box-shadow: none;
}
.eth-crumbs a {
  text-decoration: underline;
  text-underline-offset: 0.12em;
  text-decoration-thickness: 1px;
}
.eth-crumbs a:hover { color: var(--fg); }
.eth-crumbs [aria-current="page"] {
  color: var(--fg);
  font-weight: 500;
}
.eth-crumbs [data-eth-crumbs-more] {
  color: var(--fg);
  cursor: pointer;
}
.eth-crumbs [data-eth-crumbs-more]:hover { color: var(--fg-signal); }
.eth-crumbs-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  margin-inline: 0.25em;
  color: var(--fg-muted);
  flex-shrink: 0;
}
.eth-crumbs-sep .ti,
.eth-crumbs [data-eth-crumbs-more] .ti {
  display: block;
  width: 1em;
  height: 1em;
  font-size: 1em;
  line-height: 1;
}
[dir="rtl"] .eth-crumbs-sep .ti-chevron-right { transform: scaleX(-1); }

/* ----- Calendar ----- */
.eth-cal { width: 100%; }
.eth-cal-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.eth-cal-months {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
@media (min-width: 768px) {
  .eth-cal--wide .eth-cal-months { grid-template-columns: 1fr 1fr; }
}
.eth-cal-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.eth-cal-grid th {
  font-size: var(--text-caption-size);
  font-weight: 500;
  color: var(--fg-muted);
  padding: var(--space-2) 0;
  text-align: center;
}
.eth-cal-day {
  appearance: none;
  width: 100%;
  aspect-ratio: 1;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.eth-cal-day:hover { background: var(--bg-inset); }
.eth-cal-day.is-today { box-shadow: inset 0 0 0 1px var(--fg-signal); }
.eth-cal-day.is-inrange { background: var(--signal-muted); color: var(--fg); }
.eth-cal-day.is-selected {
  background: var(--signal);
  color: var(--action-fg);
}
.eth-cal-day.is-outside { color: var(--fg-disabled); }
.eth-cal-caption {
  font-weight: 600;
  margin: 0 0 var(--space-2);
  font-size: 0.9375rem;
}

/* ----- Card ----- */
.eth-card {
  background: var(--elev-1-bg);
  box-shadow: var(--shadow-1);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.eth-card-header { padding: var(--space-3) var(--space-3) 0; }
.eth-card-header h3 { margin: 0; font-family: var(--font-sans); font-size: 1rem; }
.eth-card-header a { color: var(--fg); text-decoration: none; }
.eth-card-header a:hover { color: var(--fg-signal); text-decoration: underline; text-underline-offset: 0.18em; }
.eth-card-media { overflow: hidden; background: var(--bg-inset); }
.eth-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eth-card-media--top { aspect-ratio: 16 / 9; }
.eth-card-body { padding: var(--space-2) var(--space-3) var(--space-3); color: var(--fg-muted); }
.eth-card-body p { margin: 0; }
.eth-card-actions {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--space-3) var(--space-3);
}
.eth-card--split {
  display: grid;
  grid-template-columns: 40% 1fr;
}
.eth-card--split .eth-card-media { aspect-ratio: auto; min-height: 100%; }
@media (max-width: 767px) {
  .eth-card { width: 100%; }
  .eth-card--split { grid-template-columns: 1fr; }
}
.eth-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: var(--space-4);
  width: 100%;
}

/* ----- Carousel ----- */
.eth-carousel { position: relative; width: 100%; }
.eth-carousel-strip {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--space-4);
  padding-block: var(--space-2);
  -webkit-overflow-scrolling: touch;
}
.eth-carousel-item {
  flex: 0 0 calc(100% - 24px);
  scroll-snap-align: start;
  min-width: 0;
}
@media (min-width: 768px) {
  .eth-carousel-item { flex-basis: calc(50% - 12px - 12px); }
}
.eth-carousel-nav {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* ----- Checkbox / Radio / Switch ----- */
.eth-field-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h-md);
  cursor: pointer;
  font: inherit;
  color: var(--fg);
}
.eth-field-row input[type="checkbox"],
.eth-field-row input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--signal);
  flex-shrink: 0;
}
.eth-field-row.is-error { color: var(--fg-critical); }
.eth-field-row.is-disabled,
.eth-field-row:has(input:disabled) { color: var(--fg-disabled); cursor: not-allowed; }
.eth-fieldset {
  border: 1px solid var(--border);
  padding: var(--space-2) var(--space-3);
  margin: 0;
  min-inline-size: 0;
  width: 100%;
}
.eth-fieldset legend {
  padding: 0 var(--space-2);
  font-weight: 600;
  font-size: 0.9375rem;
}
.eth-field-error { color: var(--fg-critical); font-size: 0.875rem; margin: var(--space-2) 0 0; }

.eth-switch {
  appearance: none;
  position: relative;
  width: 44px;
  height: 24px;
  min-width: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-inset);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.eth-switch::before {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--fg);
  transition: transform var(--dur-fast) var(--ease-out);
}
.eth-switch[aria-checked="true"] {
  background: var(--signal);
  box-shadow: none;
}
.eth-switch[aria-checked="true"]::before {
  transform: translateX(20px);
  background: var(--action-fg);
}
[dir="rtl"] .eth-switch[aria-checked="true"]::before { transform: translateX(-20px); }
.eth-switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ----- Divider ----- */
.eth-hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-4) 0;
  width: 100%;
}
.eth-vr {
  width: 1px;
  align-self: stretch;
  min-height: 2.75rem;
  background: var(--border);
  border: 0;
}

/* ----- Dropdown ----- */
.eth-dd { position: relative; display: inline-block; }
.eth-dd-menu {
  position: absolute;
  z-index: var(--z-dropdown);
  inset-inline-start: 0;
  top: calc(100% + 4px);
  min-width: 12rem;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  background: var(--elev-2-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  display: none;
}
.eth-dd.is-open .eth-dd-menu { display: block; }
.eth-dd-menu[data-flip="up"] {
  top: auto;
  bottom: calc(100% + 4px);
}
.eth-dd-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--control-h-md);
  padding: 0 var(--control-pad-x);
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.eth-dd-item:hover,
.eth-dd-item:focus { background: var(--bg-inset); outline: none; }
.eth-dd-item.is-danger { color: var(--fg-critical); }
@media (max-width: 767px) {
  .eth-dd.is-open .eth-dd-menu[data-sheet] {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    min-width: 0;
    width: 100%;
    z-index: var(--z-overlay);
    padding: var(--space-3) var(--space-3) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
    box-shadow: var(--shadow-3);
  }
}

/* ----- Image ----- */
.eth-img {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--bg-inset);
  width: 100%;
}
.eth-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eth-img--thumb { width: 120px; height: 80px; }
.eth-img-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  background: var(--bg-inset);
}
.eth-img.is-fallback .eth-img-fallback { display: flex; }
.eth-img.is-fallback img { visibility: hidden; }

/* ----- List ----- */
.eth-list { padding: 0; margin: 0; list-style: none; }
.eth-list li + li,
.eth-list .eth-list-item + .eth-list-item { margin-top: var(--space-2); }
.eth-list--ul { list-style: disc; padding-inline-start: 1.25rem; }
.eth-list--ol { list-style: decimal; padding-inline-start: 1.25rem; }
.eth-dl { margin: 0; }
.eth-dl div { display: grid; grid-template-columns: 8rem 1fr; gap: var(--space-2); min-height: 1.75rem; }
.eth-dl div + div { margin-top: var(--space-2); }
.eth-dl dt { color: var(--fg-muted); font-weight: 500; }
.eth-dl dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ----- Loading ----- */
.eth-spin {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--border);
  border-top-color: var(--signal);
  border-radius: 50%;
  animation: eth-spin 700ms linear infinite;
  color: var(--signal);
}
.eth-spin--16 { width: 16px; height: 16px; }
.eth-spin--24 { width: 24px; height: 24px; }
.eth-spin--32 { width: 32px; height: 32px; }
.eth-spin--current { border-top-color: currentColor; color: currentColor; }
@keyframes eth-spin { to { transform: rotate(360deg); } }
.eth-loading-slot { min-height: 2rem; display: flex; align-items: center; gap: var(--space-2); }

/* ----- Modal ----- */
.eth-modal-root[hidden] { display: none !important; }
.eth-modal-root {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.eth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(14 20 27 / 40%);
}
html.dark .eth-modal-backdrop { background: rgb(0 0 0 / 55%); }
.eth-modal {
  position: relative;
  z-index: 1;
  background: var(--elev-3-bg);
  box-shadow: var(--shadow-3);
  border: 1px solid var(--border);
  max-height: 90vh;
  overflow: auto;
  width: min(100%, 560px);
  display: flex;
  flex-direction: column;
}
.eth-modal--sm { width: min(100%, 400px); }
.eth-modal--md { width: min(100%, 560px); }
.eth-modal--lg { width: min(100%, 720px); }
.eth-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-2);
}
.eth-modal-head h2 { margin: 0; font-family: var(--font-sans); font-size: var(--text-heading-size); }
.eth-modal-body { padding: 0 var(--space-4) var(--space-3); color: var(--fg); }
.eth-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4) var(--space-4);
}
@media (max-width: 767px) {
  .eth-modal-root { align-items: flex-end; padding: 0; }
  .eth-modal {
    width: 100%;
    max-height: 90vh;
    border-inline: 0;
    border-block-end: 0;
  }
}

/* ----- Pagination ----- */
.eth-page {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.eth-page a, .eth-page span.eth-page-num, .eth-page button.eth-page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--control-h-md);
  min-height: var(--control-h-md);
  padding: 0 var(--space-2);
  color: var(--fg-signal);
  text-decoration: none;
  font: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.eth-page [aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
  cursor: default;
}
.eth-page [aria-disabled="true"] { color: var(--fg-disabled); pointer-events: none; }

/* ----- Progress ----- */
.eth-progress { width: 100%; }
.eth-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  font-size: 0.875rem;
}
.eth-progress-val { font-variant-numeric: tabular-nums; color: var(--fg-muted); }
.eth-progress-track {
  height: 8px;
  background: var(--bg-inset);
  overflow: hidden;
}
.eth-progress-track--4 { height: 4px; }
.eth-progress-bar {
  height: 100%;
  background: var(--signal);
  width: 0%;
  transition: width var(--dur-base) var(--ease-out);
}
.eth-progress.is-indeterminate .eth-progress-bar {
  width: 40%;
  animation: eth-pulse 180ms var(--ease-out) infinite alternate;
}
@keyframes eth-pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* ----- Select / fields ----- */
.eth-field { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-1); width: 100%; max-width: 24rem; }
.eth-label { font-size: 0.875rem; font-weight: 500; color: var(--fg); }
.eth-helper { font-size: 0.8125rem; color: var(--fg-muted); margin: 0; }
.eth-control {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  min-height: var(--control-h-md);
  padding: 0 var(--control-pad-x-sm);
}
.eth-control:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.eth-control input,
.eth-control textarea,
.eth-control select {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  line-height: 1.25;
  width: 100%;
  min-width: 0;
  outline: none;
}
.eth-control textarea { padding: var(--space-2) 0; resize: vertical; min-height: 4rem; height: auto; line-height: 1.5; }
.eth-control:has(textarea) { height: auto; }
.eth-field--sm .eth-control { min-height: var(--control-h-sm); }
.eth-field--md .eth-control { min-height: var(--control-h-md); }
.eth-field--lg .eth-control { min-height: var(--control-h-lg); }
.eth-field.is-error .eth-control { border-color: var(--fg-critical); }
.eth-field.is-error .eth-helper { color: var(--fg-critical); }
.eth-field.is-disabled .eth-control,
.eth-control:has(:disabled) { color: var(--fg-disabled); background: var(--bg-inset); }
.eth-prefix { color: var(--fg-muted); font-variant-numeric: tabular-nums; }
select.eth-select {
  min-height: var(--control-h-md);
  height: var(--control-h-md);
  padding: 0 var(--control-pad-x-sm);
  font: inherit;
  font-size: 16px;
  background: var(--bg-canvas);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  width: 100%;
  max-width: 24rem;
}

/* ----- Skeleton ----- */
.eth-skel {
  display: block;
  background: var(--bg-inset);
  position: relative;
  overflow: hidden;
}
.eth-skel--text { height: 1rem; width: 12rem; }
.eth-skel--metric { height: 2.25rem; width: 6rem; }
.eth-skel--panel { height: 6rem; width: 100%; }
.eth-skel--avatar { width: 40px; height: 40px; border-radius: 50%; }
.eth-skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(255 252 247 / 35%), transparent);
  transform: translateX(-100%);
  animation: eth-shimmer 1.2s linear infinite;
}
html.dark .eth-skel::after {
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 6%), transparent);
}
@keyframes eth-shimmer { to { transform: translateX(100%); } }

/* ----- Tabs ----- */
.eth-tabs { width: 100%; }
.eth-tablist {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}
.eth-tab {
  appearance: none;
  background: none;
  border: 0;
  min-height: var(--control-h-md);
  padding: 0 var(--control-pad-x);
  font: inherit;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.eth-tab:hover { color: var(--fg); }
.eth-tab[aria-selected="true"] { color: var(--fg); }
.eth-tabs--underline .eth-tab[aria-selected="true"] {
  box-shadow: inset 0 -2px 0 var(--fg-signal);
}
.eth-tabs--underline .eth-tablist { border-bottom: 1px solid var(--border); }
.eth-tabs--pill .eth-tab[aria-selected="true"] {
  background: var(--bg-inverse);
  color: var(--fg-inverse);
}
.eth-tabs--equal .eth-tab { flex: 1; justify-content: center; }
.eth-tab[aria-disabled="true"] { color: var(--fg-disabled); cursor: not-allowed; }
.eth-tabpanel { padding: var(--space-3) 0; }
.eth-tabpanel[hidden] { display: none; }

/* ----- Toast ----- */
.eth-toasts {
  position: fixed;
  z-index: var(--z-toast);
  inset-block-end: var(--space-4);
  inset-inline-end: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}
.eth-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  background: var(--elev-4-bg);
  box-shadow: var(--shadow-4);
  border: 1px solid var(--border);
}
.eth-toast--info { background: var(--info-muted); color: var(--fg-info); }
.eth-toast--caution { background: var(--caution-muted); color: var(--fg-caution); }
.eth-toast--critical { background: var(--critical-muted); color: var(--fg-critical); }
.eth-toast--positive { background: var(--positive-muted); color: var(--fg-positive); }
.eth-toast p { margin: 0; color: var(--fg); font-size: 0.9375rem; }
@media (max-width: 767px) {
  .eth-toasts { inset-inline: var(--space-3); width: auto; }
}

/* ----- Tooltip ----- */
.eth-tip-wrap { position: relative; display: inline-flex; }
.eth-tip {
  position: absolute;
  z-index: var(--z-dropdown);
  bottom: calc(100% + 8px);
  inset-inline-start: 50%;
  transform: translateX(-50%);
  background: var(--bg-inverse);
  color: var(--fg-inverse);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  padding: var(--space-1) var(--space-2);
  max-width: 16rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  white-space: normal;
}
.eth-tip.is-open { opacity: 1; visibility: visible; }
.eth-tip[data-flip="down"] {
  bottom: auto;
  top: calc(100% + 8px);
}

/* ----- Misc ----- */
.eth-metric { font-size: var(--text-metric-size); font-weight: 500; font-variant-numeric: tabular-nums; line-height: var(--text-metric-lh); color: var(--fg); }
.eth-caption { font-size: var(--text-caption-size); color: var(--fg-muted); }


@media (max-width: 767px) {
  .eth-control { min-height: var(--hit); }
  .eth-control:has(textarea) { height: auto; }
  select.eth-select { min-height: var(--hit); height: var(--hit); }
  .eth-dd-item,
  .eth-tab,
  .eth-field-row,
  .eth-acc-trigger { min-height: var(--hit); }
  .eth-page a,
  .eth-page span.eth-page-num,
  .eth-page button.eth-page-num {
    min-width: var(--hit);
    min-height: var(--hit);
  }
}

@media (prefers-reduced-motion: reduce) {
  .eth-acc-panel, .eth-acc-chevron { transition: none; }
  .eth-spin { animation: none; border-top-color: var(--signal); opacity: 1; }
  .eth-progress.is-indeterminate .eth-progress-bar { animation: none; opacity: 0.7; }
  .eth-skel::after { animation: none; display: none; }
  .eth-btn:active { transform: none; }
  .eth-switch::before { transition: none; }
}

.eth-demo ul:not(.eth-list--ul):not(.eth-dd-menu),
.eth-demo ol:not(.eth-list--ol):not(.eth-crumbs ol) {
  padding-inline-start: 0;
  list-style: none;
}
.eth-crumbs ol { padding-inline-start: 0; list-style: none; }
.eth-demo .eth-list--ul,
.eth-demo .eth-list--ol { padding-inline-start: 1.25rem; }
.eth-demo p { margin: 0.35rem 0; }
.eth-card-body .eth-metric { margin: 0 0 var(--space-2); }
