/* Shared components (apps/web/packages/ui). Every value comes from tokens.css. */
body:has(.e-page) {
  background: var(--e-bg);
  color: var(--e-text);
}
.e-page {
  min-height: 100dvh;
  padding: var(--e-space-xxxl) var(--e-gutter);
  background: var(--e-bg);
  color: var(--e-text);
  font-size: var(--e-font-body);
  line-height: var(--e-leading-body);
}
@media (min-width: 768px) {
  .e-page {
    padding: var(--e-space-xxxl) var(--e-gutter-wide);
  }
}
.e-column {
  max-width: var(--e-column-max);
  margin: 0 auto;
}
.e-wide {
  max-width: var(--e-page-max);
  margin: 0 auto;
}
.e-column > form {
  display: grid;
  gap: var(--e-space-m);
}
.e-header {
  display: grid;
  gap: var(--e-space-l);
  margin-bottom: var(--e-space-xxl);
}
.e-header-mark {
  justify-items: center;
  text-align: center;
}
.e-mark {
  display: block;
  width: var(--e-space-xxl);
  height: var(--e-space-xxl);
}
.e-title {
  margin: 0;
  font-size: var(--e-font-title);
  line-height: var(--e-leading-title);
  font-weight: var(--e-weight-title);
  color: var(--e-text);
  text-wrap: balance;
}
.e-section + .e-section {
  margin-top: var(--e-section-gap);
}
.e-section-title {
  margin: 0 0 var(--e-heading-gap);
  font-size: var(--e-font-headline);
  line-height: var(--e-leading-headline);
  font-weight: var(--e-weight-headline);
}
.e-section > * + *:not(.e-section-title) {
  margin-top: var(--e-grid-gap);
}
.e-card {
  padding: var(--e-card-padding);
  border-radius: var(--e-radius-card);
  background: var(--e-surface);
  color: var(--e-text);
}
.e-card-compact {
  padding: var(--e-card-padding-compact);
}
.e-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: var(--e-radius-card);
  background: var(--e-surface);
  overflow: hidden;
}
.e-list-item {
  position: relative;
}
.e-list-item + .e-list-item::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: var(--e-card-padding);
  border-top: 1px solid var(--e-line);
}
.e-row {
  display: flex;
  align-items: center;
  gap: var(--e-space-m);
  width: 100%;
  min-height: var(--e-row);
  margin: 0;
  padding: var(--e-space-s) var(--e-card-padding);
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
}
.e-row-two-line {
  min-height: var(--e-row-two-line);
}
.e-row-text {
  display: grid;
  flex: 1;
  min-width: 0;
}
.e-row-title {
  font-size: var(--e-font-body);
  line-height: var(--e-leading-body);
}
.e-row-meta,
.e-row-trailing,
.e-meta,
.e-hint {
  margin: 0;
  font-size: var(--e-font-footnote);
  line-height: var(--e-leading-footnote);
  color: var(--e-text-muted);
}
.e-row-chevron {
  width: var(--e-space-s);
  height: var(--e-space-s);
  border-top: 2px solid var(--e-line-strong);
  border-right: 2px solid var(--e-line-strong);
  transform: rotate(45deg);
}
button.e-row,
a.e-row {
  cursor: pointer;
}
.e-field {
  display: grid;
  gap: var(--e-space-s);
}
.e-field + .e-field {
  margin-top: var(--e-space-xs);
}
.e-field + .e-button {
  margin-top: var(--e-space-m);
}
.e-label {
  font-size: var(--e-font-footnote);
  line-height: var(--e-leading-footnote);
  font-weight: var(--e-weight-medium-value);
  color: var(--e-text);
}
.e-input {
  width: 100%;
  min-height: var(--e-control);
  margin: 0;
  padding: 0 var(--e-space-l);
  border: 1px solid var(--e-line-strong);
  border-radius: var(--e-radius-card);
  color: var(--e-text);
  background: var(--e-bg);
  font-size: var(--e-font-body);
  line-height: var(--e-leading-body);
  font-weight: var(--e-weight-regular-value);
}
textarea.e-input {
  padding: var(--e-space-m) var(--e-space-l);
}
.e-page .e-input:focus,
.e-page .e-button:focus-visible,
.e-page .e-row:focus-visible {
  outline: 2px solid var(--e-accent);
  outline-offset: 2px;
}
.e-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--e-control);
  margin: 0;
  padding: 0 var(--e-space-l);
  border: 0;
  border-radius: var(--e-radius-card);
  font-size: var(--e-font-body);
  line-height: var(--e-leading-body);
  font-weight: var(--e-weight-semibold-value);
  cursor: pointer;
}
.e-button:disabled {
  opacity: 0.5;
  cursor: default;
}
.e-button-primary {
  background: var(--e-accent);
  color: var(--e-on-accent);
}
.e-button-brand {
  background: var(--e-brand-action);
  color: var(--e-on-brand-action);
}
.e-button-secondary {
  background: var(--e-surface);
  color: var(--e-text);
}
.e-card .e-button-secondary,
.e-list .e-button-secondary {
  background: var(--e-bg);
}
.e-button-quiet {
  width: auto;
  min-height: var(--e-target);
  padding: 0 var(--e-space-s);
  background: none;
  color: var(--e-accent);
}
.e-button-loading {
  opacity: 1;
  cursor: wait;
}
.e-button-loading .e-button-label {
  visibility: hidden;
}
.e-button-loading::after {
  content: "";
  position: absolute;
  width: var(--e-space-l);
  height: var(--e-space-l);
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: var(--e-radius-full);
  animation: e-spin 0.8s linear infinite;
}
@keyframes e-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .e-button-loading::after {
    animation-duration: 2.4s;
  }
}
.e-button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--e-space-s);
  margin-top: var(--e-space-m);
}
.e-status {
  font-size: var(--e-font-footnote);
  line-height: var(--e-leading-footnote);
  color: var(--e-danger);
}
.e-status:empty {
  display: none;
}
.e-banner {
  display: flex;
  align-items: center;
  gap: var(--e-space-m);
  padding: var(--e-card-padding-compact) var(--e-card-padding);
  border-radius: var(--e-radius-card);
  background: var(--e-surface);
}
.e-banner-text {
  flex: 1;
  margin: 0;
  font-size: var(--e-font-footnote);
  line-height: var(--e-leading-footnote);
}
.e-banner-success {
  background: var(--e-success-surface);
  color: var(--e-success);
}
.e-banner-warning {
  background: var(--e-warning-surface);
  color: var(--e-warning);
}
.e-banner-danger {
  background: var(--e-danger-surface);
  color: var(--e-danger);
}
.e-state-page {
  display: grid;
  place-items: center;
}
.e-state {
  display: grid;
  justify-items: center;
  width: 100%;
  max-width: var(--e-state-max);
  margin: 0 auto;
  text-align: center;
}
.e-state-mark {
  width: var(--e-space-xxxl);
  height: var(--e-space-xxxl);
  margin-bottom: var(--e-space-l);
}
.e-state-title {
  margin: 0;
  font-size: var(--e-font-title);
  line-height: var(--e-leading-title);
  font-weight: var(--e-weight-title);
  color: var(--e-text);
  text-wrap: balance;
}
.e-state-body {
  margin: var(--e-space-s) 0 0;
  font-size: var(--e-font-body);
  line-height: var(--e-leading-body);
  color: var(--e-text-muted);
  text-wrap: pretty;
}
.e-state .e-state-action {
  margin-top: var(--e-space-xl);
}
.e-state-reference {
  margin: var(--e-space-l) 0 0;
  font-size: var(--e-font-footnote);
  line-height: var(--e-leading-footnote);
  color: var(--e-text-muted);
  font-variant-numeric: tabular-nums;
  user-select: all;
}
