@charset "UTF-8";
/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Color Scheme ──────────────────────────────────────── */
:root {
  color-scheme: light dark;
}

[data-theme=light] {
  color-scheme: light;
}

[data-theme=dark] {
  color-scheme: dark;
}

/* 
html { -webkit-tap-highlight-color: transparent; } 
*/
:root {
  /* All of this are of TYPE color */
  --color-bg: light-dark(#F5F4F0, #111110);
  --color-bg-soft: light-dark(#8f8f8f14, #c4c4c42d);
  --color-surface: light-dark(#FFFFFF, #1C1B19);
  --color-surface-2: light-dark(#F0EFE9, #26241F);
  --color-border: light-dark(rgba(0,0,0,0.08), rgba(255,255,255,0.08));
  --color-border-strong: light-dark(rgba(0,0,0,0.14), rgba(255,255,255,0.14));
  --color-text-primary: light-dark(#1A1814, #EDECEA);
  --color-text-secondary: light-dark(#6B6760, #9B9893);
  --color-text-muted: light-dark(#A09D98, #5C5A56);
  --color-text-over-black: rgba(255, 255, 255, 0.9);
  --color-divider: light-dark(rgba(0,0,0,0.12), rgba(255,255,255,0.12));
  --color-button-bg: var(--color-surface);
  --color-button-text: var(--color-text-primary);
  --color-button-border: transparent;
  --color-input-bg: light-dark(rgba(255, 255, 255, 1), rgba(48, 48, 46, 1));
  --color-input-text: var(--color-text-primary);
  --color-accent: light-dark(#2D5BE3, #6B8FF0);
  --color-accent-light: light-dark(#EEF2FD, #1A2340);
  --color-attention: light-dark(#7C3AED, #A78BFA);
  --color-attention-light: light-dark(#F3E8FF, #2A174A);
  --color-success: light-dark(#1A7F54, #34C47C);
  --color-success-light: light-dark(#E6F6EE, #0D2B1E);
  --color-warning: light-dark(#B45309, #F59E4A);
  --color-warning-light: light-dark(#FEF3C7, #2C1A05);
  --color-danger: light-dark(#C0392B, #E8645A);
  --color-danger-light: light-dark(#FEF3C7, #2C1A05);
}

/* ─── Color Utilities ───────────────────────────────────── */
.ui-color--success {
  color: var(--color-success);
}

.ui-color--warning {
  color: var(--color-warning);
  background: var(--color-warning-light);
}

.ui-color--rnd0 {
  background: light-dark(#FFF5F5, #2A1018);
  color: light-dark(#9B2335, #F28B9A);
}

.ui-color--rnd1 {
  background: light-dark(#EEF2FD, #111E3D);
  color: light-dark(#2D5BE3, #6B8FF0);
}

.ui-color--rnd2 {
  background: light-dark(#E6F6EE, #0D2B1E);
  color: light-dark(#1A7F54, #34C47C);
}

.ui-color--rnd3 {
  background: light-dark(#FEF3C7, #2C1A05);
  color: light-dark(#B45309, #F59E4A);
}

.ui-color--rnd4 {
  background: light-dark(#FDF4FF, #200D33);
  color: light-dark(#7E22CE, #C084FC);
}

.ui-color--rnd5 {
  background: light-dark(#FFF1F0, #2A0F0D);
  color: light-dark(#C0392B, #E8645A);
}

.ui-color--rnd6 {
  background: light-dark(#FFF7ED, #2C1505);
  color: light-dark(#C2410C, #F97316);
}

.ui-color--rnd7 {
  background: light-dark(#F0F9FF, #051E30);
  color: light-dark(#0369A1, #38BDF8);
}

.ui-color--rnd8 {
  background: light-dark(#F0FDF4, #072014);
  color: light-dark(#15803D, #4ADE80);
}

.ui-color--rnd9 {
  background: light-dark(#FAFAFA, #1A1A1A);
  color: light-dark(#374151, #9CA3AF);
}

:root {
  --easing-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --easing-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

:root {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', Times, serif;
  --font-size-xs: 0.75rem; /* 12px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-md: 1rem; /* 16px */
  --font-size-lg: 1.125rem; /* 18px */
  --font-size-xl: 1.25rem; /* 20px */
  --font-size-2xl: 1.5rem; /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem; /* 36px */
  --font-size-5xl: 3rem; /* 48px */
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
}

:root {
  --radius-xs: 1px;
  --radius-sm: 3px;
  --radius-md: 7px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

:root {
  --shadow-sm: 0 1px 3px light-dark(rgba(0,0,0,0.06), rgba(0,0,0,0.3)), 0 4px 16px light-dark(rgba(0,0,0,0.05), rgba(0,0,0,0.25));
  --shadow-md: 0 2px 8px light-dark(rgba(0,0,0,0.06), rgba(0,0,0,0.4)), 0 12px 40px light-dark(rgba(0,0,0,0.10), rgba(0,0,0,0.4));
  --shadow-lg: 0 4px 16px light-dark(rgba(0,0,0,0.06), rgba(0,0,0,0.5)), 0 24px 80px light-dark(rgba(0,0,0,0.15), rgba(0,0,0,0.5));
}

:root {
  --spacing-xs: 4px;
  --spacing-sm: 10px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 40px;
}

.ui-attachment {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.2;
  max-width: 100%;
  min-width: 0;
}

.ui-attachment:hover {
  background: var(--color-surface-alt, var(--color-surface));
}

.ui-attachment__icon {
  flex: 0 0 auto;
  font-size: 1.25rem;
  opacity: 0.75;
}

.ui-attachment__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  gap: 0.0625rem;
}

.ui-attachment__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: break-all;
}

.ui-attachment__size {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  opacity: 0.85;
}

/* Image variant: thumbnail on top, caption underneath. The card sheds its
   padding and border so the image reads as its own object, not a chip. */
.ui-attachment.--image {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--spacing-xs);
  padding: 0;
  background: transparent;
  border: 0;
  max-width: 16rem;
}

.ui-attachment.--image:hover {
  background: transparent;
}

.ui-attachment__thumb {
  display: block;
  width: 100%;
  max-height: 12rem;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--color-surface-alt, var(--color-surface));
}

.ui-attachment.--image .ui-attachment__meta {
  padding: 0 var(--spacing-xs);
}

.ui-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--ui-icon-size, 40px);
  height: var(--ui-icon-size, 40px);
  border-radius: var(--radius-sm);
  object-fit: cover;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
}

.ui-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  padding: var(--spacing-xl) var(--spacing-lg);
  text-align: center;
}
.ui-empty > i, .ui-empty > .mdi {
  font-size: 72px;
  line-height: 1;
  color: var(--color-text-muted);
  opacity: 0.5;
}
.ui-empty > strong {
  font-size: var(--font-size-lg, 1.125rem);
  font-weight: var(--font-weight-medium, 500);
  color: var(--color-text-primary);
}
.ui-empty > span, .ui-empty > p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm, 0.875rem);
  max-width: 240px;
  line-height: 1.5;
}

.ui-button {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  background: var(--color-button-bg);
  color: var(--color-button-text);
  border: 0;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  letter-spacing: 0.01em;
}
.ui-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.ui-button:active {
  transform: scale(0.97);
}
.ui-button__label {
  white-space: nowrap;
}

/* Primary button (default) */
.ui-button {
  --color-button-bg: var(--color-accent);
  --color-button-text: var(--color-text-over-black);
}

.ui-button.--secondary {
  --color-button-bg: var(--color-accent-light);
  --color-button-text: var(--color-accent);
}

.ui-button.--danger {
  --color-button-bg: var(--color-danger-light);
  --color-button-text: var(--color-danger);
  border: 0;
}

.ui-button.--waiting {
  pointer-events: none;
}
.ui-button.--waiting::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: ui-button-spin 0.7s linear infinite;
}
.ui-button.--waiting:hover {
  transform: none;
  box-shadow: none;
}
.ui-button.--waiting:active {
  transform: none;
}

@keyframes ui-button-spin {
  to {
    transform: rotate(360deg);
  }
}
.ui-button.--invalid {
  opacity: 0.5;
}

.ui-card {
  display: block;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.ui-card .ui-item {
  padding: var(--spacing-md);
}

.ui-card > .ui-list {
  gap: 0;
}

.ui-card > .ui-list > .ui-item {
  border-top: 1px solid var(--color-divider);
}

.ui-card.--selected {
  border-bottom: 2px solid var(--color-accent);
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
}

/* A message rendered as its own card (e.g. Home messages group) */
.ui-card > .ui-message {
  padding: var(--spacing-md);
}

/* Imply clickability now that the trailing chevron is gone */
a.ui-card,
.ui-card:has(> a) {
  cursor: pointer;
  transition: box-shadow 0.15s var(--easing-smooth), transform 0.1s var(--easing-smooth);
}

a.ui-card:hover,
.ui-card:has(> a):hover {
  box-shadow: var(--shadow-md);
}

a.ui-card:active,
.ui-card:has(> a):active {
  transform: scale(0.99);
}

.ui-card-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin: var(--spacing-lg) 0;
}
.ui-card-group > * {
  animation: listItemIn 0.4s var(--easing-spring) both;
}
.ui-card-group > *:nth-child(1) {
  animation-delay: 0s;
}
.ui-card-group > *:nth-child(2) {
  animation-delay: 0.05s;
}
.ui-card-group > *:nth-child(3) {
  animation-delay: 0.1s;
}
.ui-card-group > *:nth-child(4) {
  animation-delay: 0.15s;
}
.ui-card-group > *:nth-child(5) {
  animation-delay: 0.2s;
}
.ui-card-group > *:nth-child(6) {
  animation-delay: 0.25s;
}
.ui-card-group > *:nth-child(7) {
  animation-delay: 0.3s;
}
.ui-card-group > *:nth-child(8) {
  animation-delay: 0.35s;
}
.ui-card-group > *:nth-child(9) {
  animation-delay: 0.4s;
}
.ui-card-group > *:nth-child(10) {
  animation-delay: 0.45s;
}

/* Horizontally-scrollable variant: lays the group out as a swipeable row of
   fixed-width card tiles instead of a vertical stack. Mirrors the scroll-snap
   pattern used by .ui-tabs. On desktop the tiles simply wrap onto multiple
   rows instead of scrolling. */
.ui-card-group.--carousel {
  flex-direction: row;
  flex-wrap: nowrap;
  gap: var(--spacing-sm);
  margin: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Hide scrollbar but keep scrolling functional */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ui-card-group.--carousel::-webkit-scrollbar {
  display: none;
}
.ui-card-group.--carousel {
  /* Children must not stretch; each consumer sets its own tile width. */
}
.ui-card-group.--carousel > * {
  flex: 1;
  min-width: 140px;
  max-width: 200px;
  scroll-snap-align: start;
}
.ui-card-group.--carousel {
  /* Desktop: there's room for everything, so wrap instead of scrolling. */
}
@media (min-width: 1024px) {
  .ui-card-group.--carousel {
    flex-wrap: wrap;
    overflow-x: visible;
    scroll-snap-type: none;
  }
}

.ui-card-group__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding: 0 var(--spacing-xs); /* slight inset so the label aligns with card content */
}

.ui-card-group__action { /* the "See all →" link */
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
  white-space: nowrap;
}

/*
Document Renderer wrappers — emitted by:
  - Nawi\Document\Components\LayoutPage  → .ui-document-page + __title + __footer
  - Nawi\Document\Components\LayoutGroup → .ui-document-group + __title
  - Nawi\Document\Renderer (v-if wrap)   → .ui-document-vif
  - Nawi\Document\Components\InputSelect (select-buttons) → .ui-button-group
    with .ui-button.--secondary toggle children; active one carries .--selected.

Field-level styles live in `field.scss`.
*/
.ui-document-page {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin: 0 auto;
  box-sizing: border-box;
  min-width: 0;
  overflow-x: hidden;
}

.ui-document-page__title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0 0 var(--spacing-sm);
}

.ui-document-page__footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: var(--spacing-md);
  margin-top: var(--spacing-sm);
  border-top: 1px solid var(--color-divider);
}

.ui-document-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin: var(--spacing-md) 0;
}

.ui-document-group__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  margin: 0;
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--color-divider);
}

.ui-document-vif {
  display: contents;
}
.ui-document-vif[hidden] {
  display: none;
}

.ui-button-group {
  display: inline-flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  align-items: stretch;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
}
.ui-button-group > .ui-button {
  margin: 0;
  position: relative;
  cursor: pointer;
}
.ui-button-group .ui-button__control {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}
.ui-button-group > .ui-button:has(.ui-button__control:checked) {
  --color-button-bg: var(--color-accent);
  --color-button-text: var(--color-text-over-black);
}
.ui-button-group > .ui-button:has(.ui-button__control:focus-visible) {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.ui-button-group:has(.ui-button__control:required:invalid) {
  box-shadow: inset 0 0 0 1px transparent;
}

.ui-button.--selected {
  --color-button-bg: var(--color-accent);
  --color-button-text: var(--color-text-over-black);
}

.ui-document img,
.ui-document video,
.ui-document iframe,
.ui-document svg,
.ui-document canvas {
  max-width: 100%;
  height: auto;
  display: block;
}
.ui-document table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}
.ui-document pre {
  overflow-x: auto;
  max-width: 100%;
}

/*
Form field wrapper used by the Nawi Document Renderer.

Emitted markup (do not change here — these are the only shapes we style):

  <label class="ui-field">
    <span class="ui-field__label">EPS del estudiante</span>
    <input class="ui-field__input" type="text" name="..." required>
    <span class="ui-field-error">Required</span>
  </label>

  <label class="ui-field ui-field--checkbox">
    <input class="ui-field__input" type="checkbox" name="..." required>
    <span class="ui-field__label">He leído las instrucciones</span>
    <span class="ui-field-error">Debes aceptar</span>
  </label>

  <div class="ui-field ui-field--select">
    <span class="ui-field__label">Tipo de Sangre</span>
    <select class="ui-field__input">...</select>
    <span class="ui-field-error">...</span>
  </div>

Document-level wrappers (.ui-document-page, .ui-document-group,
.ui-document-vif, .ui-button-group) live in `document.scss`.
*/
.ui-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-md);
  box-sizing: border-box;
}
.ui-field:has([required]) > .ui-field__label::after {
  content: " *";
  color: var(--color-danger);
}

.ui-field__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 0 var(--spacing-xs);
  margin: 0;
}

.ui-field__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--color-input-text);
  padding: var(--spacing-sm) var(--spacing-md);
  min-height: 44px;
  background-color: var(--color-input-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.ui-field__input::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}
.ui-field__input:focus, .ui-field__input:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}
.ui-field__input:disabled {
  background-color: var(--color-bg-soft);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}
.ui-field__input:invalid:not(:focus):not(:placeholder-shown), .ui-field__input[aria-invalid=true]:not(:focus) {
  border-color: var(--color-danger);
  background-color: var(--color-danger-light);
}

select.ui-field__input {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--spacing-md) center;
  padding-right: calc(var(--spacing-md) * 2 + 12px);
}

input[type=checkbox].ui-field__input,
input[type=radio].ui-field__input {
  display: inline-block;
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  border-radius: 0;
  accent-color: var(--color-accent);
  box-shadow: none;
  cursor: pointer;
  flex: 0 0 auto;
}

.ui-field-error {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-danger);
  margin-top: var(--spacing-xs);
  padding-left: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='7' stroke='currentColor' stroke-width='1.5' fill='none'/%3E%3Cpath d='M8 4v5' stroke='currentColor' stroke-width='1.5' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11' r='0.75' fill='currentColor'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 16px 16px;
}

.ui-field--checkbox {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-sm);
}
.ui-field--checkbox > .ui-field__label {
  flex: 1 1 auto;
  padding: 0;
  cursor: pointer;
  user-select: none;
  color: var(--color-text-primary);
  font-weight: 400;
}
.ui-field--checkbox > .ui-field-error {
  flex-basis: 100%;
}
.ui-field--checkbox:has([required]) > .ui-field__label::after {
  content: " *";
  color: var(--color-danger);
}

.ui-fill {
  flex: 1;
  min-width: 0;
}

.ui-fill.--truncate {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ui-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  background: var(--color-bg-soft);
  color: var(--color-accent);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  font-variant-numeric: tabular-nums;
}

.ui-grade.--failing {
  border-color: var(--color-danger);
  background: var(--color-danger-light);
  color: var(--color-danger);
}

.ui-grade.--empty {
  border-color: var(--color-border-strong);
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
}

.ui-hero {
  --ui-hero-icon-size: 56px;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  padding-top: var(--spacing-sm);
  padding-bottom: calc(var(--spacing-lg) + var(--spacing-xl));
  background: var(--color-accent);
  color: white;
}
.ui-hero > .ui-icon,
.ui-hero > .ui-avatar {
  width: var(--ui-hero-icon-size);
  height: var(--ui-hero-icon-size);
  font-size: var(--font-size-xl);
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.2);
  color: white;
}
.ui-hero > .ui-avatar {
  object-fit: cover;
}
.ui-hero h1, .ui-hero h2, .ui-hero h3 {
  color: inherit;
  line-height: 1.15;
}
.ui-hero h1 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
}
.ui-hero h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
}
.ui-hero h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
}
.ui-hero p, .ui-hero small, .ui-hero .ui-label {
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--font-size-sm);
  margin: 0;
}

.ui-hero-cards {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: calc(-1 * var(--spacing-xl));
  margin-bottom: var(--spacing-md);
}
.ui-hero-cards > .ui-card {
  flex: 1;
}

.ui-stat h1 {
  font-size: 2em;
}
.ui-stat h2 {
  font-size: 1.5em;
}
.ui-stat h3 {
  font-size: 1.25em;
}
.ui-stat sup {
  font-size: 0.75em;
  color: var(--color-accent);
}

:root {
  --ui-icon-size: 36px;
}

.ui-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--ui-icon-size, 36px);
  height: var(--ui-icon-size, 36px);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
  object-fit: contain;
}

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

.ui-icon.ui-color--empty {
  background: var(--surface-2);
  color: var(--text-muted);
}

.ui-icon.--attention {
  color: var(--color-attention);
}

.ui-icon.--success {
  color: var(--color-success);
}

.ui-icon.--warning {
  color: var(--color-warning);
}

.ui-icon.--danger {
  color: var(--color-danger);
}

.ui-input {
  --ui-input-padding: var(--spacing-sm);
  --ui-input-radius: var(--radius-md);
  --ui-input-border: 1.5px solid var(--color-button-border);
  --ui-input-font: inherit;
  --ui-input-size: 0.95em;
  --ui-input-weight: 400;
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--ui-input-font);
  font-size: var(--ui-input-size);
  font-weight: var(--ui-input-weight);
  color: var(--color-input-text);
  padding: var(--ui-input-padding);
  border: var(--ui-input-border);
  border-radius: var(--ui-input-radius);
  background-color: var(--color-input-bg);
}
.ui-input::placeholder {
  opacity: 1;
}
.ui-input:disabled {
  background-color: var(--color-background-secondary);
  border-color: var(--color-border-primary);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}
.ui-input:invalid:not(:focus):not(:placeholder-shown), .ui-input[aria-invalid=true]:not(:focus) {
  border: 1px solid var(--color-danger);
  background-color: var(--color-danger-light);
}

.ui-input--textarea {
  min-height: 80px;
  resize: vertical;
}

.ui-input--select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 32px;
}

.ui-item {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
}

.ui-item.--wrap {
  flex-wrap: wrap;
}

.ui-item.--align-start {
  align-items: flex-start;
}

.ui-item.--stretch {
  align-items: stretch;
}

/* View inside lists */
.ui-list > .ui-item {
  border-top: 1px solid var(--border);
  padding: var(--spacing-sm) var(--spacing-md);
}

.ui-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.ui-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}
.ui-list > * {
  animation: listItemIn 0.4s var(--easing-spring) both;
  animation-delay: 0.45s;
}
.ui-list > *:nth-child(1) {
  animation-delay: 0s;
}
.ui-list > *:nth-child(2) {
  animation-delay: 0.05s;
}
.ui-list > *:nth-child(3) {
  animation-delay: 0.1s;
}
.ui-list > *:nth-child(4) {
  animation-delay: 0.15s;
}
.ui-list > *:nth-child(5) {
  animation-delay: 0.2s;
}
.ui-list > *:nth-child(6) {
  animation-delay: 0.25s;
}
.ui-list > *:nth-child(7) {
  animation-delay: 0.3s;
}
.ui-list > *:nth-child(8) {
  animation-delay: 0.35s;
}
.ui-list > *:nth-child(9) {
  animation-delay: 0.4s;
}
.ui-list > *:nth-child(10) {
  animation-delay: 0.45s;
}

@keyframes listItemIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ui-list > * {
    animation: none;
  }
}
.ui-menu {
  position: relative;
  display: inline-block;
}
.ui-menu__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: inherit;
  font-size: 1.375rem;
  list-style: none;
  user-select: none;
  transition: background 0.15s ease;
}
.ui-menu__trigger::-webkit-details-marker {
  display: none;
}
.ui-menu__trigger:hover, .ui-menu__trigger:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}
.ui-menu__list {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + var(--spacing-xs));
  z-index: 200;
  min-width: 12rem;
  padding: var(--spacing-xs);
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ui-menu__item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 0.9375rem;
  white-space: nowrap;
  cursor: pointer;
}
.ui-menu__item .mdi {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
}
.ui-menu__item:hover, .ui-menu__item:focus-visible {
  background: var(--color-surface-2);
  outline: none;
}
.ui-menu__item.--danger {
  color: var(--color-danger, #e24b4a);
}
.ui-menu__item.--danger .mdi {
  color: inherit;
}

.ui-message {
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: var(--spacing-md);
  padding: var(--spacing-sm);
  min-width: 0;
}
.ui-message__header,
.ui-message header {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}
.ui-message__header h1, .ui-message__header h2, .ui-message__header h3, .ui-message__header h4,
.ui-message header h1,
.ui-message header h2,
.ui-message header h3,
.ui-message header h4 {
  font-size: 15px;
  font-weight: 500;
}
.ui-message__header time,
.ui-message header time {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
}
.ui-message__preview,
.ui-message p {
  font-size: 13px;
  font-weight: 400;
}

.ui-message.--unread {
  position: relative;
}
.ui-message.--unread::after {
  content: var(--ui-message-unread-count, "");
  position: absolute;
  top: var(--spacing-md);
  left: 8px;
  width: 12px;
  height: 12px;
  background-color: var(--color-attention);
  border-radius: 50%;
  color: var(--color-attention-light);
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ui-message.--truncate .ui-message__preview, .ui-message.--truncate p {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* View inside lists */
.ui-list > .ui-message {
  border-top: 1px solid var(--color-border);
  padding: var(--spacing-md);
}

/**
 * ui-modal
 *
 * CSS-only modal using hidden checkbox for state.
 *
 * Usage:
 * <div class="ui-modal">
 *   <input type="checkbox" id="modal-id" class="ui-modal__toggle" />
 *   <label for="modal-id" class="ui-modal__backdrop"></label>
 *   <div class="ui-modal__dialog">
 *     <header class="ui-modal__header">
 *       <h3 class="ui-modal__title">Title</h3>
 *       <label for="modal-id" class="ui-modal__close"></label>
 *     </header>
 *     <section class="ui-modal__body">Content</section>
 *     <footer class="ui-modal__footer">Actions</footer>
 *   </div>
 * </div>
 */
:root {
  --ui-modal-width-sm: 400px;
  --ui-modal-width-md: 600px;
  --ui-modal-width-lg: 800px;
  --ui-modal-width-xl: 1000px;
  --ui-modal-max-height: 90vh;
}

/* Base */
.ui-modal {
  position: relative;
}

/* Hidden checkbox toggle */
.ui-modal__toggle, .ui-modal > input[type=checkbox] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* Backdrop */
.ui-modal__backdrop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .ui-modal__backdrop {
    transition: none;
  }
}

.ui-modal__toggle:checked ~ .ui-modal__backdrop, .ui-modal > input[type=checkbox]:checked ~ .ui-modal__backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Dialog */
.ui-modal__dialog, .ui-modal > div:not(.ui-modal__backdrop) {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: var(--_modal-tf, translate(-50%, -50%) scale(0.95));
  z-index: 1400;
  width: calc(100% - var(--spacing-lg) * 2);
  max-width: var(--ui-modal-width-md);
  max-height: var(--ui-modal-max-height);
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .ui-modal__dialog, .ui-modal > div:not(.ui-modal__backdrop) {
    transition: none;
  }
}

.ui-modal__toggle:checked ~ .ui-modal__dialog, .ui-modal > .ui-modal__toggle:checked ~ div:not(.ui-modal__backdrop), .ui-modal > input[type=checkbox]:checked ~ .ui-modal__dialog, .ui-modal > input[type=checkbox]:checked ~ div:not(.ui-modal__backdrop),
.ui-modal__toggle:checked ~ * .ui-modal__dialog,
.ui-modal__toggle:checked ~ .ui-modal > div:not(.ui-modal__backdrop),
.ui-modal > input[type=checkbox]:checked ~ * .ui-modal__dialog,
.ui-modal > input[type=checkbox]:checked ~ .ui-modal > div:not(.ui-modal__backdrop) {
  opacity: 1;
  pointer-events: auto;
  transform: var(--_modal-tf-open, translate(-50%, -50%) scale(1));
}

/* Header */
.ui-modal__header, .ui-modal > div:not(.ui-modal__backdrop) > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.ui-modal__title, .ui-modal > div:not(.ui-modal__backdrop) > header > h1, .ui-modal > div:not(.ui-modal__backdrop) > header > h2, .ui-modal > div:not(.ui-modal__backdrop) > header > h3, .ui-modal > div:not(.ui-modal__backdrop) > header > h4, .ui-modal > div:not(.ui-modal__backdrop) > header > h5, .ui-modal > div:not(.ui-modal__backdrop) > header > h6 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.4;
}

/* Close button */
.ui-modal__close, .ui-modal > div:not(.ui-modal__backdrop) > header > label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease;
}
.ui-modal__close::before, .ui-modal > div:not(.ui-modal__backdrop) > header > label::before {
  content: "×";
  font-size: 28px;
  line-height: 1;
  font-weight: 300;
}
.ui-modal__close:hover, .ui-modal > div:not(.ui-modal__backdrop) > header > label:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-2);
}
.ui-modal__close:focus-visible, .ui-modal > div:not(.ui-modal__backdrop) > header > label:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Body */
.ui-modal__body, .ui-modal > div:not(.ui-modal__backdrop) > section {
  padding: var(--spacing-lg);
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
  color: var(--color-text-primary);
  line-height: 1.6;
}

/* Footer */
.ui-modal__footer, .ui-modal > div:not(.ui-modal__backdrop) > footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

/* Size variants */
.ui-modal__dialog--sm {
  max-width: var(--ui-modal-width-sm);
}

.ui-modal__dialog--lg {
  max-width: var(--ui-modal-width-lg);
}

.ui-modal__dialog--xl {
  max-width: var(--ui-modal-width-xl);
}

.ui-modal__dialog--fullscreen {
  width: calc(100% - var(--spacing-xl) * 2);
  max-width: none;
  height: calc(100% - var(--spacing-xl) * 2);
  max-height: none;
}
@media (max-width: 640px) {
  .ui-modal__dialog--fullscreen {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

/* Panel sheet variants — --bottom / --top */
.ui-modal--bottom {
  --_modal-tf: translateY(100%);
  --_modal-tf-open: translateY(0);
}
.ui-modal--bottom > .ui-modal__dialog,
.ui-modal--bottom > div:not(.ui-modal__backdrop) {
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding-bottom: env(safe-area-inset-bottom);
}
.ui-modal--bottom > .ui-modal__dialog::before,
.ui-modal--bottom > div:not(.ui-modal__backdrop)::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  background: var(--color-border);
  border-radius: 99px;
  margin: 0 auto var(--spacing-md);
  flex-shrink: 0;
}

.ui-modal--top {
  --_modal-tf: translateY(-100%);
  --_modal-tf-open: translateY(0);
}
.ui-modal--top > .ui-modal__dialog,
.ui-modal--top > div:not(.ui-modal__backdrop) {
  top: 0;
  bottom: auto;
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding-top: env(safe-area-inset-top);
}
.ui-modal--top > .ui-modal__dialog::after,
.ui-modal--top > div:not(.ui-modal__backdrop)::after {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  background: var(--color-border);
  border-radius: 99px;
  margin: var(--spacing-md) auto 0;
  flex-shrink: 0;
}

/* Type variants */
.ui-modal__dialog--alert .ui-modal__body, .ui-modal__dialog--alert .ui-modal > div:not(.ui-modal__backdrop) > section {
  text-align: center;
}
.ui-modal__dialog--alert .ui-modal__footer, .ui-modal__dialog--alert .ui-modal > div:not(.ui-modal__backdrop) > footer {
  justify-content: center;
}

.ui-modal__dialog--confirm .ui-modal__footer, .ui-modal__dialog--confirm .ui-modal > div:not(.ui-modal__backdrop) > footer {
  justify-content: space-between;
}

.ui-modal__dialog--danger .ui-modal__header, .ui-modal__dialog--danger .ui-modal > div:not(.ui-modal__backdrop) > header {
  border-bottom-color: var(--color-danger-light);
}
.ui-modal__dialog--danger .ui-modal__title, .ui-modal__dialog--danger .ui-modal > div:not(.ui-modal__backdrop) > header > h1, .ui-modal__dialog--danger .ui-modal > div:not(.ui-modal__backdrop) > header > h2, .ui-modal__dialog--danger .ui-modal > div:not(.ui-modal__backdrop) > header > h3, .ui-modal__dialog--danger .ui-modal > div:not(.ui-modal__backdrop) > header > h4, .ui-modal__dialog--danger .ui-modal > div:not(.ui-modal__backdrop) > header > h5, .ui-modal__dialog--danger .ui-modal > div:not(.ui-modal__backdrop) > header > h6 {
  color: var(--color-danger);
}
.ui-modal__dialog--danger .ui-modal__footer, .ui-modal__dialog--danger .ui-modal > div:not(.ui-modal__backdrop) > footer {
  border-top-color: var(--color-danger);
}

/* Responsive */
@media (max-width: 640px) {
  .ui-modal__header, .ui-modal > div:not(.ui-modal__backdrop) > header,
  .ui-modal__body,
  .ui-modal > div:not(.ui-modal__backdrop) > section,
  .ui-modal__footer,
  .ui-modal > div:not(.ui-modal__backdrop) > footer {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }
  .ui-modal__footer, .ui-modal > div:not(.ui-modal__backdrop) > footer {
    flex-direction: column-reverse;
  }
  .ui-modal__footer > button, .ui-modal > div:not(.ui-modal__backdrop) > footer > button,
  .ui-modal__footer > .ui-button,
  .ui-modal > div:not(.ui-modal__backdrop) > footer > .ui-button {
    width: 100%;
  }
  .ui-modal__dialog--lg,
  .ui-modal__dialog--xl {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }
}
/* Scroll lock */
body:has(.ui-modal__toggle:checked, .ui-modal > input[type=checkbox]:checked) {
  overflow: hidden;
}

/* Glue pattern — simplified HTML */
.ui-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--color-surface-2);
  color: var(--color-text-primary);
}

.ui-pill.--active {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.ui-pill.--success {
  background: var(--color-success-light);
  color: var(--color-success);
}

.ui-pill.--warning {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.ui-pill.--danger {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

button.ui-pill {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
button.ui-pill.--active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text-over-black);
}

.ui-pill__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-md);
  font-size: 0.75em;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
}
button.ui-pill:not(.--active) .ui-pill__badge {
  background: var(--color-accent);
  color: var(--color-text-over-black);
}

.ui-switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--color-border-tertiary, #ccc);
  border: 0.5px solid var(--color-border-secondary, transparent);
  cursor: pointer;
  transition: background 0.22s ease;
  vertical-align: middle;
  flex-shrink: 0;
}

.ui-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-background-primary, #fff);
  transition: transform 0.22s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.ui-switch:checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.ui-switch:checked::after {
  transform: translateX(18px);
}

.ui-switch:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 30%, transparent);
}

.ui-switch:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ui-table-container {
  width: 100%;
  overflow: auto;
}
.ui-table-container > table {
  all: revert;
  width: 100%;
  border-collapse: collapse;
}
.ui-table-container > table thead tr th {
  text-align: left;
  font-weight: 500;
  background-color: #d1dae8;
  white-space: nowrap;
}
.ui-table-container > table thead tr th:nth-child(1) {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.ui-table-container > table thead tr th:nth-last-child(1) {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.ui-table-container > table tr td,
.ui-table-container > table tr th {
  border: none;
  padding: var(--spacing-sm);
}
.ui-table-container > table tr {
  border-bottom: 1px solid #d1dae8;
}
.ui-table-container > table tr:nth-last-child(1) {
  border-bottom: none;
}

.ui-table-container table th:first-child,
.ui-table-container table td:first-child {
  left: 0;
  z-index: 1;
  position: sticky;
}

.ui-table-container table thead th:first-child {
  z-index: 2;
}

.ui-table-container table tbody td:first-child {
  background-color: white;
}

.ui-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--spacing-sm);
  overflow-x: auto;
  color: var(--color-accent);
  user-select: none;
  border: 1px solid var(--ui-color-border-primary);
  border-radius: var(--radius-md);
  padding: var(--spacing-xs);
  padding-right: var(--spacing-xl);
  /* Breathing room so the last tab isn't clipped by the fade */
  /* Hide scrollbar visually, keep it functional */
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Smooth momentum scrolling on iOS */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  /* Snap tabs into place as you scroll */
  scroll-snap-type: x mandatory;
  /* Fade hint on the right edge to signal more content */
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}
.ui-tabs::-webkit-scrollbar {
  display: none;
}

.ui-tab,
.ui-tabs > a {
  display: block;
  padding: var(--spacing-sm) var(--spacing-xl);
  white-space: nowrap;
  font-weight: 500;
  border-radius: var(--radius-md);
  /* Each tab snaps cleanly to the left edge */
  scroll-snap-align: start;
}
.ui-tab--active,
.ui-tabs > a--active {
  background-color: var(--color-accent);
  color: var(--color-accent);
}

.ui-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  line-height: 1.4;
  font-weight: var(--font-weight-medium);
  background: var(--color-bg-soft);
  color: var(--color-text-secondary);
  border: 0;
  white-space: nowrap;
  max-width: 100%;
}
.ui-tag i.mdi {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}
.ui-tag > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-tag.--student {
  background: light-dark(#EEF2FD, #111E3D);
  color: light-dark(#2D5BE3, #6B8FF0);
  border-color: transparent;
}

.ui-tag.--subject {
  background: light-dark(#FDF4FF, #200D33);
  color: light-dark(#7E22CE, #C084FC);
  border-color: transparent;
}

.ui-tag.--period {
  background: light-dark(#E6F6EE, #0D2B1E);
  color: light-dark(#1A7F54, #34C47C);
  border-color: transparent;
}

.ui-tag.--event {
  background: light-dark(#FFF7ED, #2C1505);
  color: light-dark(#C2410C, #F97316);
  border-color: transparent;
}

.ui-tag.--topic {
  background: var(--color-bg-soft);
  color: var(--color-text-secondary);
}

.ui-tag.--director {
  background: light-dark(#FEF3C7, #2A1F05);
  color: light-dark(#A16207, #FBBF24);
  border-color: transparent;
  font-weight: var(--font-weight-semibold);
}

.ui-tag.--relative {
  background: light-dark(#FFE4E6, #2B0D14);
  color: light-dark(#BE123C, #FB7185);
  border-color: transparent;
}

.ui-tag.--personal {
  border-radius: 999px;
}

.ui-tag.--personal.--c-rose {
  background: light-dark(#FFE4E6, #2B0D14);
  color: light-dark(#BE123C, #FB7185);
  border-color: transparent;
}

.ui-tag.--personal.--c-amber {
  background: light-dark(#FEF3C7, #2A1F05);
  color: light-dark(#A16207, #FBBF24);
  border-color: transparent;
}

.ui-tag.--personal.--c-emerald {
  background: light-dark(#E6F6EE, #0D2B1E);
  color: light-dark(#1A7F54, #34C47C);
  border-color: transparent;
}

.ui-tag.--personal.--c-sky {
  background: light-dark(#E0F2FE, #082338);
  color: light-dark(#0369A1, #38BDF8);
  border-color: transparent;
}

.ui-tag.--personal.--c-violet {
  background: light-dark(#FDF4FF, #200D33);
  color: light-dark(#7E22CE, #C084FC);
  border-color: transparent;
}

.ui-tag.--personal.--c-slate {
  background: var(--color-bg-soft);
  color: var(--color-text-secondary);
}

a.ui-tag,
button.ui-tag {
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
a.ui-tag:hover,
button.ui-tag:hover {
  border-color: var(--color-border-strong);
}
a.ui-tag.--active,
button.ui-tag.--active {
  background: var(--color-accent);
  color: var(--color-text-over-black);
  border-color: var(--color-accent);
}

.ui-tag-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
}

/* Embedded video (YouTube). The frame holds a 16:9 responsive iframe; the
   caption (optional title + description) sits underneath, mirroring the
   image attachment layout. */
.ui-video {
  /* Block layout, NOT flex: a flex column makes the 16:9 frame a flex item
     whose main-axis (height) is resolved from in-flow content. The iframe is
     absolutely positioned (out of flow), so that content height is 0 and the
     `aspect-ratio` height never applies — the frame, and the iframe, collapse
     to 0px. Block layout lets `aspect-ratio` size the frame from its width. */
  display: block;
  margin: 0;
  /* `width: 100%` is REQUIRED, not just cosmetic. The figure is often a flex
     item in a column container with `align-items: flex-start` (e.g.
     .conversation__attachments), which shrink-wraps items on the cross axis
     (width). The frame's `width: 100%` then has nothing definite to resolve
     against → 0 width → `padding-bottom: 56.25%` (a % of width) → 0 height →
     the iframe collapses. An explicit width gives the frame a definite basis. */
  width: 100%;
  max-width: 32rem;
}

.ui-video__frame {
  /* Intrinsic-ratio padding hack rather than `aspect-ratio`. As a grid item,
     the frame's width is resolved during the grid's intrinsic-sizing pass, and
     `aspect-ratio` needs a *definite* width to derive height from — it resolves
     to 0 here and the frame collapses. Percentage padding always resolves
     against the containing block's width, so `padding-bottom: 56.25%` (9/16)
     reliably produces the 16:9 height in any layout context. */
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-alt, var(--color-surface));
}

.ui-video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ui-video__caption {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
  margin-top: var(--spacing-xs);
  padding: 0 var(--spacing-xs);
}

.ui-video__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.ui-video__description {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/*# sourceMappingURL=index.css.map */
