/**
 * Shared interactive primitives.
 * Feature composition and feature-specific variants belong elsewhere.
 */

.btn {
  min-width: var(--control-height);
  max-width: 100%;
  min-height: var(--control-height-field);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), box-shadow var(--transition-fast);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn:hover,
.btn:active {
  transform: none;
}

.btn-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: none;
}

.btn-primary:hover:not(:disabled) {
  border-color: var(--foreground-strong);
  background: var(--foreground-strong);
}

.btn-danger {
  border-color: var(--destructive-border);
  background: var(--destructive-soft);
  color: var(--destructive);
}

.btn-danger:hover:not(:disabled) {
  border-color: var(--destructive);
  background: color-mix(in oklch, var(--destructive) 18%, var(--surface));
}

.btn-secondary,
.btn-outline {
  border-color: var(--border);
  background: var(--surface);
  color: var(--foreground);
}

.btn-secondary:hover:not(:disabled),
.btn-outline:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.btn-sm {
  min-height: var(--control-height);
  padding: 0.45rem 0.8rem;
  font-size: 0.8125rem;
}

.btn-xs {
  min-height: var(--control-height-xs);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.btn-lg {
  min-height: var(--control-height-touch);
  padding: 0.65rem 1.25rem;
  font-size: var(--font-size-control);
}

.form-control {
  min-width: 0;
  max-width: 100%;
  min-height: var(--control-height-touch);
  padding: 0.68rem 0.88rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  outline: none;
  background: var(--field-background);
  color: var(--foreground);
  font: inherit;
  font-size: var(--font-size-control);
  font-weight: 400;
  box-shadow: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

.form-control::placeholder {
  color: var(--muted-foreground);
  opacity: 1;
}

.form-control:disabled {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--muted-foreground);
  -webkit-text-fill-color: var(--muted-foreground);
  opacity: 1;
  cursor: not-allowed;
}

.form-control[readonly]:enabled {
  background: var(--surface-subtle);
}

textarea.form-control {
  resize: vertical;
}

.form-control[type="file"] {
  padding: 0.25rem 0.5rem;
}
input[type="file"]::file-selector-button {
  min-height: var(--control-height-touch);
  margin-right: var(--space-3);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--foreground);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
input[type="file"]:enabled::file-selector-button:hover {
  background: var(--surface-subtle);
}
input[type="file"]:disabled::file-selector-button {
  color: var(--muted-foreground);
  cursor: not-allowed;
}

.form-control:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px var(--ring-soft);
}

.form-control:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.form-control:user-invalid,
.form-control[aria-invalid="true"] {
  border-color: var(--destructive);
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--foreground);
  caret-color: var(--foreground);
  /* Paint the current theme over the Chrome autofill surface, including after a
     live theme change; a long background transition kept light fill in dark mode. */
  box-shadow: 0 0 0 1000px var(--field-background) inset;
}

.form-control-sm {
  min-height: var(--control-height-sm);
  padding: 0.4rem 0.6rem;
  font-size: 0.8125rem;
}

@media (max-width: 900px), (any-pointer: coarse) {
  .form-control-sm {
    font-size: var(--font-size-control);
  }
}

.form-group {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  color: var(--foreground-soft);
  font-size: 0.8125rem;
  font-weight: 600;
}

.form-help {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  line-height: 1.45;
}

.context-eyebrow {
  display: block;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-aprobada {
  border-color: var(--status-aprobada-border);
  background: var(--status-aprobada-bg);
  color: var(--status-aprobada-text);
}
.badge-cursando {
  border-color: var(--status-cursando-border);
  background: var(--status-cursando-bg);
  color: var(--status-cursando-text);
}
.badge-bloqueada {
  border-color: var(--status-bloqueada-border);
  background: var(--status-bloqueada-bg);
  color: var(--status-bloqueada-text);
}

/* Compact controls shared by editor and operational surfaces. */
.icon-button {
  width: var(--icon-button-size, var(--control-height));
  height: var(--icon-button-size, var(--control-height));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--muted-foreground);
  font: inherit;
  font-size: var(--icon-button-font-size, 0.8125rem);
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast),
    color var(--transition-fast);
}

.icon-button:hover:enabled {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
  color: var(--foreground);
}

.icon-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Repeated compact academic facts; feature styles own their geometry. */
.skeleton {
  display: block;
  height: 1rem;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
}

.fact-list {
  margin: 0;
}
.fact-list > div {
  min-width: 0;
}
.fact-list dt {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
}
.fact-list dd {
  margin: var(--space-1) 0 0;
  overflow-wrap: anywhere;
  color: var(--foreground);
  font-size: 0.8125rem;
  font-weight: 700;
}

/* Shared editorial page lead. Surfaces retain their responsive breakpoint and summary treatment. */

.ruled-pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: var(--status-dot-gap, var(--space-2));
}
.status-dot::before {
  content: "";
  width: var(--status-dot-size, var(--status-dot-diameter));
  height: var(--status-dot-size, var(--status-dot-diameter));
  flex: 0 0 auto;
  border-radius: var(--radius-full);
  background: currentColor;
}

.segmented-tabs {
  --segmented-tabs-gap: var(--space-2);
  --segmented-tabs-padding: var(--space-1);
  --segmented-tabs-width: auto;
  --segmented-tab-padding: 0 0.95rem;
  display: flex;
  gap: var(--segmented-tabs-gap, var(--space-2));
  padding: var(--segmented-tabs-padding, var(--space-1));
  width: var(--segmented-tabs-width, auto);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}
.segmented-tabs [role="tab"] {
  min-height: var(--control-height);
  padding: var(--segmented-tab-padding, 0 0.95rem);
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast),
    box-shadow var(--transition-fast);
}
.segmented-tabs [role="tab"]:hover:not(:disabled) {
  color: var(--foreground);
}
.segmented-tabs [role="tab"][aria-selected="true"] {
  background: var(--navigation-active-background);
  color: var(--navigation-active-foreground);
  box-shadow: 0 0 0 1px var(--navigation-active-border) inset;
}
.segmented-tabs [role="tab"][aria-selected="true"]:focus-visible {
  outline-offset: -3px;
  outline-color: var(--navigation-active-foreground);
}

.choice-modal-summary {
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(1rem, 4vw, 3.5rem);
  align-items: end;
  margin-bottom: 0;
  padding: 0.15rem 0 1.15rem;
  border-bottom: 1px solid var(--border-strong);
}
.choice-modal-summary strong {
  display: block;
  margin-top: 0.28rem;
  color: var(--foreground);
  font-size: 0.9375rem;
  line-height: 1.35;
}
.choice-modal-summary p {
  max-width: 680px;
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  line-height: 1.55;
}
.choice-option-list {
  display: grid;
  gap: 0;
  max-height: 430px;
  overflow-y: auto;
  border-bottom: 1px solid var(--border-strong);
}
.choice-option {
  min-width: 0;
  border-bottom: 1px solid var(--border);
}
.choice-option:last-child {
  border-bottom: 0;
}
.choice-option-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto 1.25rem;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 64px;
  padding: 0.72rem 0.18rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--foreground);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.choice-option-row:hover {
  background: var(--surface-muted);
}
.choice-option-requirements {
  padding: 0 0.18rem 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}
.choice-option-requirements summary {
  display: flex;
  align-items: center;
  min-height: var(--control-height-touch);
  gap: 0.5rem;
  cursor: pointer;
  color: var(--foreground-soft);
}
.choice-option-requirements summary::before {
  content: "+";
}
.choice-option-requirements[open] summary::before {
  content: "−";
}
.choice-option-requirements summary:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
.choice-option-requirements p {
  margin: 0 0 0.5rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.choice-option-index {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
}
.choice-option-copy {
  min-width: 0;
}
.choice-option-copy strong {
  display: block;
  font-size: 0.875rem;
  line-height: 1.35;
}
.choice-option-row small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  line-height: 1.35;
}
.choice-option-state {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.choice-option-state.is-aprobada {
  color: var(--status-aprobada-text);
}
.choice-option-state.is-cursando {
  color: var(--status-cursando-text);
}
.choice-option-state.is-disponible {
  color: var(--foreground-soft);
}
.choice-option-state.is-bloqueada {
  color: var(--status-bloqueada-text);
}
.choice-option-arrow {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  transition: transform var(--transition-fast), color var(--transition-fast);
}
.choice-option-row:hover .choice-option-arrow {
  color: var(--foreground);
  transform: translateX(2px);
}
.free-choice-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.free-choice-form label {
  display: grid;
  gap: 0.3rem;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 700;
}

.choice-option-row:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .choice-modal-summary {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }
  .choice-option-row {
    grid-template-columns: 1.6rem minmax(0, 1fr) 1rem;
  }
  .choice-option-state {
    grid-column: 2;
    grid-row: 2;
    white-space: normal;
  }
  .choice-option-arrow {
    grid-column: 3;
    grid-row: 1 / 3;
  }
  .free-choice-form {
    grid-template-columns: 1fr;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .free-choice-form {
    grid-template-columns: 1fr;
  }
  .free-choice-form label {
    grid-template-columns: minmax(6rem, 10rem) minmax(0, 1fr);
    align-items: center;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: color-mix(in srgb, var(--neutral-1000) 68%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

[data-theme="light"] .modal-overlay {
  background: color-mix(in srgb, var(--neutral-1000) 48%, transparent);
}

.modal-overlay.active,
.modal-overlay[style*="display: flex"] {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  min-width: 0;
  width: 100%;
  max-width: 820px;
  max-height: min(90dvh, calc(100dvh - 2rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 92%, transparent);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modalPop var(--transition-normal) cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay-confirm {
  z-index: 2000;
}
.confirm-dialog-card {
  max-width: 440px;
}
.confirm-dialog-body {
  color: var(--foreground);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.confirm-dialog-actions {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.modal-header {
  min-width: 0;
  min-height: 64px;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.modal-title {
  min-width: 0;
  margin: 0;
  color: var(--foreground);
  font-size: 1.0625rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* Native dialogs use the same modal primitives, available before route CSS. */
.native-dialog {
  --native-dialog-width: 560px;
  --native-dialog-inline-padding: var(--space-5);
  width: min(var(--native-dialog-width), calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  color: var(--foreground);
  overscroll-behavior: contain;
}
.native-dialog:not([open]) {
  display: none;
}
.native-dialog[open] {
  display: flex;
}
.native-dialog::backdrop {
  background: color-mix(in srgb, var(--neutral-1000) 60%, transparent);
}
.native-dialog > .modal-header {
  align-items: start;
  gap: var(--space-4);
  padding: var(--space-4) var(--native-dialog-inline-padding);
}
.modal-heading {
  display: grid;
  min-width: 0;
  gap: var(--space-2);
}
.modal-context {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  line-height: 1.4;
}
.modal-description {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.native-dialog > .modal-body {
  padding: var(--space-4) var(--native-dialog-inline-padding);
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}
.native-dialog-footer {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--native-dialog-inline-padding);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
@media (max-width: 560px) {
  .native-dialog {
    --native-dialog-inline-padding: var(--space-3);
  }
}
.native-dialog-footer.is-split {
  justify-content: space-between;
}
.native-dialog-footer .btn {
  min-height: var(--control-height-touch);
}
@media (max-height: 560px) {
  .native-dialog[open] {
    display: block;
    overflow-y: auto;
  }
  .native-dialog > .modal-body {
    overflow: visible;
  }
  .native-dialog > .modal-header,
  .native-dialog > .modal-body,
  .native-dialog-footer {
    padding: var(--space-3);
  }
}

.btn-close-modal {
  width: var(--control-height-touch);
  height: var(--control-height-touch);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--muted-foreground);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.btn-close-modal:hover {
  border-color: color-mix(in srgb, var(--muted-foreground) 50%, var(--border));
  background: var(--surface-muted);
  color: var(--foreground);
}
.btn-close-modal svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  padding: 1.25rem 1.35rem 1.4rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.modal-open {
  overflow: hidden;
}

.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}

.ui-icon {
  width: 1rem;
  height: 1rem;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
}

.ui-icon svg {
  width: 100%;
  height: 100%;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast-pill {
  min-width: 280px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--foreground);
  box-shadow: var(--shadow-md);
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: auto;
  transform: translateX(120%);
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.toast-content {
  flex: 1;
  overflow-wrap: anywhere;
  font-weight: 500;
  line-height: 1.35;
}
.toast-pill.toast-show {
  opacity: 1;
  transform: translateX(0);
}
.toast-pill.toast-hide {
  opacity: 0;
  transform: translateX(120%);
}
.toast-pill.toast-success {
  border-left: 4px solid var(--success);
}
.toast-pill.toast-warning {
  border-left: 4px solid var(--warning);
}
.toast-pill.toast-error {
  border-left: 4px solid var(--destructive);
}
.toast-pill.toast-info {
  border-left: 4px solid var(--info);
}
.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.toast-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.toast-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--control-height);
  height: var(--control-height);
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}
.toast-close svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.toast-close:hover {
  color: var(--foreground);
}

.app-loading-state {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.85rem;
  background: var(--background);
  color: var(--foreground);
}

.loading-orbit {
  width: 34px;
  height: 34px;
  border: 3px solid color-mix(in srgb, var(--neutral-400) 25%, transparent);
  border-top-color: var(--ring);
  border-radius: var(--radius-full);
  animation: loading-orbit 0.8s linear infinite;
}

.app-state-error {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
  width: min(1100px, calc(100% - 2rem));
  margin: 0.65rem auto 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--destructive-border);
  border-radius: var(--radius-sm);
  background: var(--destructive-soft);
  color: var(--status-bloqueada-text);
  font-size: 0.875rem;
}

.app-state-error p {
  margin: 0;
}

@keyframes modalPop {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes loading-orbit {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .modal-card {
    max-height: calc(100dvh - 2rem);
    border-radius: var(--radius-md);
  }

  .modal-header,
  .modal-body {
    padding: 0.9rem;
  }
  .section-heading {
    flex-direction: column;
  }
  .modal-footer-actions {
    flex-wrap: wrap;
    padding-top: 0.75rem;
  }
  .modal-footer-actions .btn {
    min-width: 0;
    min-height: var(--control-height-touch);
    flex: 1 1 150px;
  }
}

@media (max-width: 430px) {
  .toast-container {
    right: 0.75rem;
    inset-inline: 0.75rem;
  }
  .toast-pill {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-orbit {
    animation-duration: 1.8s;
  }
}

/* Empty pages share the planner's restrained, native composition. */
.page-empty {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100%;
  padding: var(--space-5);
}
.page-empty-content {
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  width: min(100%, 480px);
  text-align: center;
}
.page-empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  color: var(--brand);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.page-empty-icon svg {
  width: 28px;
  height: 28px;
}
.page-empty-content > h2 {
  max-width: 24ch;
  margin: 0;
  font-size: var(--font-size-page-title);
  font-weight: 600;
  line-height: 1.3;
}
.page-empty-content > p {
  max-width: 36ch;
  margin: 0;
  color: var(--muted-foreground);
  font-size: 1rem;
  line-height: 1.6;
}
.page-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  max-width: 100%;
}
.page-empty-actions .btn,
.page-empty-content > .btn {
  min-height: var(--control-height-touch);
  white-space: normal;
}
.page-empty-actions svg {
  width: 18px;
  height: 18px;
}
.page-empty-note {
  margin: 0;
  max-width: 42ch;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.page-empty-note:empty {
  display: none;
}
@media (max-height: 480px) {
  .page-empty-content {
    gap: var(--space-2);
  }
  .page-empty-icon {
    width: 48px;
    height: 48px;
  }
}

/* Slow reading feedback: mounted only after 700 ms, removed as soon as ready. */
.reading-loader {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: inherit;
  padding: var(--space-6);
  color: var(--muted-foreground);
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.55;
}
.reading-loader-mark {
  display: block;
  width: 112px;
  height: 84px;
  color: var(--brand);
}
.reading-loader-bed {
  fill: currentColor;
  fill-opacity: 0.08;
}
.reading-loader-fill {
  fill: currentColor;
  fill-opacity: 0.28;
  animation: reading-fill 3.2s ease-in-out infinite;
}
.reading-loader-curve {
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}
.reading-loader-axis {
  stroke: currentColor;
  stroke-opacity: 0.25;
  stroke-width: 1;
}
.reading-loader-label {
  max-width: 32ch;
}
@keyframes reading-fill {
  0%,
  100% {
    clip-path: inset(90% 0 0);
  }
  55%,
  75% {
    clip-path: inset(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .reading-loader-fill {
    animation: none;
  }
}
