/* =============================================================================
   Trazia - hoja de estilos unica
   -----------------------------------------------------------------------------
   1.  Tokens de marca
   2.  Reset y base
   3.  Tipografia
   4.  Marca (simbolo y wordmark)
   5.  Botones y controles
   6.  Formularios
   7.  Estructura: landing y auth
   8.  Estructura: shell de la aplicacion
   9.  Bloques de contenido
   10. Componentes de seccion
   11. Dialogos, hojas y avisos
   12. Estados: carga, vacio, error
   13. Movimiento
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. Tokens de marca
   -------------------------------------------------------------------------- */
:root {
  /* Paleta */
  --navy: #172554;
  --blue: #4056b5;
  --blue-deep: #35499b;
  --lavender: #a99be8;
  --lavender-soft: #ece8fa;
  --coral: #f47f68;
  --coral-deep: #d9573e;
  --coral-soft: #fdeae5;
  --cream: #faf7f0;
  --cream-deep: #f3eee2;
  --white: #ffffff;
  --grey: #5f6472;

  /* Roles */
  --ink: var(--navy);
  --ink-soft: #33406b;
  --muted: var(--grey);
  --muted-light: #8b909d;
  --page: var(--cream);
  --surface: var(--white);
  --surface-alt: #fdfbf6;
  --line: rgba(23, 37, 84, 0.11);
  --line-strong: rgba(23, 37, 84, 0.2);
  --focus-ring: rgba(64, 86, 181, 0.45);
  --danger: #c0392b;
  --danger-soft: #fbeceb;

  /* Colores de asignatura */
  --c-indigo: #4056b5;
  --c-lavanda: #8c7ad6;
  --c-coral: #e8674b;
  --c-marino: #172554;
  --c-cielo: #3f7fb8;
  --c-ciruela: #7b4b8a;
  --c-frambuesa: #c04d78;
  --c-salvia: #4f7f6f;

  /* Tipografia */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-ui: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-brand: "Nunito", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  /* Espaciado y forma */
  --gutter: 20px;
  --content: 940px;
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 16px;
  --nav-h: 62px;

  /* Movimiento */
  --ease: cubic-bezier(0.22, 0.72, 0.24, 1);
  --fast: 130ms;
  --mid: 200ms;
}

@media (min-width: 768px) {
  :root { --gutter: 32px; }
}

/* -----------------------------------------------------------------------------
   2. Reset y base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.55;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { padding: 0; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2.5px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: var(--lavender-soft); color: var(--navy); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--r-sm);
  transition: top var(--fast) var(--ease);
}
.skip-link:focus { top: 12px; }

.wrap {
  width: min(100%, calc(var(--content) + var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* -----------------------------------------------------------------------------
   3. Tipografia
   -------------------------------------------------------------------------- */
.display, h1, h2, .section-title, .stat-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "SOFT" 0, "WONK" 0;
  letter-spacing: -0.018em;
  line-height: 1.1;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.35rem); }
h2 { font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.85rem); }

h3 {
  font-family: var(--font-ui);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.008em;
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--coral { color: var(--coral-deep); }

.lede {
  font-size: clamp(1.02rem, 0.96rem + 0.4vw, 1.18rem);
  color: var(--muted);
  line-height: 1.6;
}

.small { font-size: 0.85rem; }
.muted { color: var(--muted); }
.muted-light { color: var(--muted-light); }
.num { font-variant-numeric: tabular-nums; }

/* -----------------------------------------------------------------------------
   4. Marca
   -------------------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 10px; }

.brand__symbol { width: 30px; height: 30px; flex: none; }
.brand__symbol--lg { width: 52px; height: 52px; }
.brand__symbol--sm { width: 22px; height: 22px; }

.brand__word {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.36rem;
  letter-spacing: -0.012em;
  color: var(--ink);
  line-height: 1;
  text-transform: lowercase;
}
.brand__symbol--lg + .brand__word { font-size: 2.1rem; }
.brand__symbol--sm + .brand__word { font-size: 1.06rem; }
.brand--light .brand__word { color: var(--white); }

/* El punto de la i va en coral: usamos una i sin punto y dibujamos el nuestro. */
.brand__i { position: relative; display: inline-block; }
.brand__tittle {
  position: absolute;
  left: 50%;
  top: 0.02em;
  width: 0.2em;
  height: 0.2em;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--coral);
}

/* Motivo de marca: trazos diagonales muy sutiles de fondo. */
.trace-motif {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
  opacity: 0.9;
}
.trace-motif::before,
.trace-motif::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  transform: rotate(-45deg);
  transform-origin: center;
}
.trace-motif::before {
  width: 26px; height: 300px;
  right: 4%; top: -70px;
  background: rgba(169, 155, 232, 0.22);
}
.trace-motif::after {
  width: 26px; height: 200px;
  right: 15%; top: 30px;
  background: rgba(244, 127, 104, 0.2);
}

/* -----------------------------------------------------------------------------
   5. Botones y controles
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--navy);
  --btn-fg: var(--white);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1.5px solid var(--btn-border);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: 0.94rem;
  letter-spacing: -0.005em;
  text-align: center;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
    border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn:hover { --btn-bg: var(--ink-soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn--primary { --btn-bg: var(--blue); }
.btn--primary:hover { --btn-bg: var(--blue-deep); }

.btn--coral { --btn-bg: var(--coral); --btn-fg: #4a1508; }
.btn--coral:hover { --btn-bg: var(--coral-deep); --btn-fg: var(--white); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-border: var(--line-strong); }
.btn--ghost:hover { --btn-bg: rgba(23, 37, 84, 0.05); --btn-border: var(--ink); }

.btn--quiet { --btn-bg: transparent; --btn-fg: var(--muted); min-height: 38px; padding: 0 10px; }
.btn--quiet:hover { --btn-bg: rgba(23, 37, 84, 0.05); --btn-fg: var(--ink); }

.btn--danger { --btn-bg: transparent; --btn-fg: var(--danger); --btn-border: rgba(192, 57, 43, 0.4); }
.btn--danger:hover { --btn-bg: var(--danger-soft); --btn-border: var(--danger); }

.btn--light { --btn-bg: var(--white); --btn-fg: var(--navy); }
.btn--light:hover { --btn-bg: var(--cream-deep); }

.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 0.87rem; }

.btn__spinner {
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 620ms linear infinite;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.icon-btn:hover { background: rgba(23, 37, 84, 0.06); color: var(--ink); }
.icon-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn svg { width: 19px; height: 19px; }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--blue);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(64, 86, 181, 0.35);
  transition: text-decoration-color var(--fast) var(--ease);
}
.link-btn:hover { text-decoration-color: currentColor; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row--end { justify-content: flex-end; }

/* -----------------------------------------------------------------------------
   6. Formularios
   -------------------------------------------------------------------------- */
.field { display: block; margin-bottom: 16px; }
.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}
.field__hint { margin-top: 6px; font-size: 0.8rem; color: var(--muted); }

.input, .select, .textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.97rem;
  font-weight: 600;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-light); font-weight: 500; }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(23, 37, 84, 0.34); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3.5px rgba(64, 86, 181, 0.16);
}
.textarea { min-height: 132px; resize: vertical; line-height: 1.6; }

.select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F6472' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 17px;
}

.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3.5px rgba(192, 57, 43, 0.12);
}

.field__error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--danger);
}
.field__error::before {
  content: "";
  flex: none;
  width: 15px; height: 15px;
  margin-top: 2px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm0 5a1 1 0 011 1v5a1 1 0 11-2 0V8a1 1 0 011-1zm0 9.2a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.field-row { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .field-row--2 { grid-template-columns: 1fr 1fr; } }

.password-field { position: relative; }
.password-field .input { padding-right: 46px; }
.password-field .icon-btn { position: absolute; right: 4px; top: 32px; }

.strength { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.strength__bar { flex: 1; display: flex; gap: 3px; }
.strength__seg {
  height: 4px; flex: 1;
  border-radius: 999px;
  background: var(--line);
  transition: background var(--mid) var(--ease);
}
.strength__seg.is-on { background: var(--blue); }
.strength[data-level="1"] .strength__seg.is-on { background: var(--coral-deep); }
.strength[data-level="2"] .strength__seg.is-on { background: var(--coral); }
.strength__label { font-size: 0.76rem; font-weight: 800; color: var(--muted); white-space: nowrap; }

/* Casillas y opciones tipo tarjeta plana */
.choice-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }

.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-weight: 700;
  font-size: 0.92rem;
  text-align: left;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease),
    color var(--fast) var(--ease);
}
.choice:hover { border-color: var(--blue); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice.is-selected, .choice:has(input:checked) {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}
.choice__tick {
  flex: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  transition: all var(--fast) var(--ease);
}
.choice.is-selected .choice__tick, .choice:has(input:checked) .choice__tick {
  border-color: var(--coral);
  background: var(--coral)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.6 4.5L19 7'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.weekday-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.weekday {
  position: relative;
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  transition: all var(--fast) var(--ease);
}
.weekday input { position: absolute; opacity: 0; pointer-events: none; }
.weekday:has(input:checked) { border-color: var(--navy); background: var(--navy); color: var(--white); }

.color-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatch {
  position: relative;
  width: 34px; height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--swatch);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.color-swatch::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid transparent;
  border-radius: 50%;
  transition: border-color var(--fast) var(--ease);
}
.color-swatch:hover { transform: scale(1.08); }
.color-swatch[aria-pressed="true"]::after { border-color: var(--ink); }
.color-swatch[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px var(--white),
    inset 0 0 0 3px rgba(255, 255, 255, 0.6);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.92rem;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  position: relative;
  width: 44px; height: 25px;
  flex: none;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background var(--mid) var(--ease);
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--white);
  transition: transform var(--mid) var(--ease);
}
.switch input:checked + .switch__track { background: var(--blue); }
.switch input:checked + .switch__track::after { transform: translateX(19px); }
.switch input:focus-visible + .switch__track { outline: 2.5px solid var(--focus-ring); outline-offset: 2px; }

/* -----------------------------------------------------------------------------
   7. Landing y autenticacion
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 247, 240, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--mid) var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.site-header__actions { display: flex; align-items: center; gap: 6px; }
.site-header__actions .btn { min-height: 40px; padding: 0 16px; font-size: 0.88rem; }

.hero { padding: clamp(40px, 7vw, 84px) 0 clamp(48px, 8vw, 92px); }
.hero__inner { display: grid; gap: 44px; }
@media (min-width: 940px) {
  .hero__inner { grid-template-columns: 1.06fr 0.94fr; align-items: center; gap: 64px; }
}
.hero__copy { min-width: 0; }
.hero__art { display: none; min-width: 0; }
@media (min-width: 940px) { .hero__art { display: block; } }
.hero__art svg { width: 100%; height: auto; }
.hero__symbol { width: 60px; height: 60px; margin-bottom: 26px; }
@media (min-width: 940px) { .hero__symbol { display: none; } }
.hero__title { max-width: 15ch; }
.hero__title em {
  font-style: normal;
  color: var(--blue);
  position: relative;
}
.hero__title .dot { color: var(--coral); }
.hero__lede { max-width: 46ch; margin-top: 20px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__cta .btn { min-width: 168px; }
.hero__note { margin-top: 18px; font-size: 0.85rem; color: var(--muted); }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.section { padding: clamp(44px, 6vw, 76px) 0; }
.section__head { max-width: 52ch; margin-bottom: 34px; }
.section__head .eyebrow { display: block; margin-bottom: 12px; }

.feature-list { border-top: 1px solid var(--line); }
.feature {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 4px 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  transition: background var(--mid) var(--ease);
}
.feature:hover { background: rgba(255, 255, 255, 0.6); }
.feature__num {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--lavender);
  padding-top: 2px;
}
.feature__title { font-size: 1.06rem; font-weight: 800; letter-spacing: -0.012em; }
.feature__text { grid-column: 2; color: var(--muted); font-size: 0.94rem; max-width: 58ch; }
@media (min-width: 860px) {
  .feature { grid-template-columns: 64px 260px 1fr; align-items: baseline; padding: 26px 0; }
  .feature__text { grid-column: 3; }
}

.band {
  position: relative;
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
}
.band .wrap { position: relative; z-index: 1; padding-block: clamp(48px, 7vw, 84px); }
.band h2 { color: var(--white); }
.band p { color: rgba(255, 255, 255, 0.76); }
.band__grid { display: grid; gap: 28px; margin-top: 36px; }
@media (min-width: 760px) { .band__grid { grid-template-columns: repeat(3, 1fr); gap: 36px; } }
.band__item { border-top: 1px solid rgba(255, 255, 255, 0.22); padding-top: 16px; }
.band__item h3 { color: var(--white); margin-bottom: 6px; }
.band__item p { font-size: 0.92rem; }

.site-footer { padding: 40px 0 48px; border-top: 1px solid var(--line); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Autenticacion */
.auth-layout { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 940px) { .auth-layout { grid-template-columns: 42% 1fr; } }

.auth-aside {
  position: relative;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px;
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
}
@media (min-width: 940px) { .auth-aside { display: flex; } }
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside__title {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  max-width: 12ch;
}
.auth-aside__text { margin-top: 18px; max-width: 34ch; color: rgba(255, 255, 255, 0.74); }
.auth-aside__foot { font-size: 0.84rem; color: rgba(255, 255, 255, 0.55); }

.auth-main {
  display: flex;
  flex-direction: column;
  padding: 24px var(--gutter) 48px;
}
.auth-main__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-card { width: 100%; max-width: 412px; margin: auto; padding-block: 36px; }
.auth-card h1 { font-size: clamp(1.75rem, 1.5rem + 1.2vw, 2.3rem); }
.auth-card__sub { margin-top: 10px; color: var(--muted); }
.auth-form { margin-top: 28px; }
.auth-alt {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}
.auth-forgot { display: flex; justify-content: flex-end; margin: -6px 0 18px; }

.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-light);
}
.divider-text::before, .divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.provider-note {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  color: var(--muted);
}

.notice {
  display: flex;
  gap: 11px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-size: 0.9rem;
  line-height: 1.5;
}
.notice__icon { flex: none; width: 19px; height: 19px; margin-top: 1px; }
.notice strong { display: block; margin-bottom: 2px; }
.notice--error { border-color: rgba(192, 57, 43, 0.35); background: var(--danger-soft); color: #7d2318; }
.notice--success { border-color: rgba(64, 86, 181, 0.3); background: #eef1fb; color: var(--blue-deep); }
.notice--info { background: var(--cream-deep); }
.notice + .notice { margin-top: 10px; }
.form-notice { margin-bottom: 18px; }

/* Pantalla de configuracion pendiente */
.setup-screen { min-height: 100dvh; display: grid; place-items: center; padding: 32px var(--gutter); }
.setup-screen__inner { max-width: 560px; }
.setup-screen code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--cream-deep);
}
.setup-screen ol { margin: 18px 0 0; padding-left: 20px; list-style: decimal; }
.setup-screen ol li { margin-bottom: 8px; color: var(--muted); }

/* -----------------------------------------------------------------------------
   8. Shell de la aplicacion
   -------------------------------------------------------------------------- */
.app-shell { display: grid; grid-template-columns: 1fr; min-height: 100dvh; }
@media (min-width: 1024px) { .app-shell { grid-template-columns: 236px 1fr; } }

.sidebar {
  display: none;
  position: sticky;
  top: 0;
  height: 100dvh;
  flex-direction: column;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  background: var(--surface-alt);
}
@media (min-width: 1024px) { .sidebar { display: flex; } }
.sidebar__brand { padding: 0 10px 22px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav__group {
  margin: 18px 0 6px;
  padding: 0 10px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-light);
}
.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-soft);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.side-link svg { width: 19px; height: 19px; flex: none; color: var(--muted); transition: color var(--fast) var(--ease); }
.side-link:hover { background: rgba(23, 37, 84, 0.055); }
.side-link:hover svg { color: var(--ink-soft); }
.side-link.is-active { background: var(--navy); color: var(--white); }
.side-link.is-active svg { color: var(--lavender); }

.sidebar__foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  text-align: left;
  transition: background var(--fast) var(--ease);
}
.side-user:hover { background: rgba(23, 37, 84, 0.055); }
.side-user__name {
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-user__meta { font-size: 0.76rem; color: var(--muted); }

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--lavender-soft);
  color: var(--blue-deep);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.avatar--lg { width: 56px; height: 56px; font-size: 1.15rem; }

.app-main {
  min-width: 0;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}
@media (min-width: 1024px) { .app-main { padding-bottom: 56px; } }

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding-inline: var(--gutter);
  background: rgba(250, 247, 240, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--mid) var(--ease);
}
.topbar.is-stuck { border-bottom-color: var(--line); }
.topbar__title { font-size: 1rem; font-weight: 800; letter-spacing: -0.01em; }
.topbar__actions { display: flex; align-items: center; gap: 4px; }
@media (min-width: 1024px) { .topbar { display: none; } }

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
@media (min-width: 1024px) { .bottom-nav { display: none; } }
.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: color var(--fast) var(--ease);
}
.bottom-nav__item svg { width: 22px; height: 22px; transition: transform var(--fast) var(--ease); }
.bottom-nav__item.is-active { color: var(--navy); }
.bottom-nav__item.is-active svg { transform: translateY(-1px); }
.bottom-nav__item.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 26px; height: 2.5px;
  border-radius: 0 0 3px 3px;
  background: var(--coral);
}
.bottom-nav__item { position: relative; }

/* -----------------------------------------------------------------------------
   9. Bloques de contenido
   -------------------------------------------------------------------------- */
.view { padding-top: 22px; }
@media (min-width: 1024px) { .view { padding-top: 40px; } }

.view__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.view__head .eyebrow { display: block; margin-bottom: 8px; }
.view__title { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.1rem); }
.view__sub { margin-top: 8px; color: var(--muted); max-width: 56ch; font-size: 0.93rem; }

.block { margin-top: 34px; }
.block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1.5px solid var(--ink);
}
.block__title { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.block__aside { font-size: 0.82rem; font-weight: 700; color: var(--muted); }

/* Panel de saludo del inicio */
.greeting {
  position: relative;
  overflow: hidden;
  margin-top: 6px;
  padding: 26px 24px 22px;
  border-radius: var(--r-lg);
  background: var(--navy);
  color: var(--white);
}
@media (min-width: 700px) { .greeting { padding: 34px 32px 28px; } }
.greeting > * { position: relative; z-index: 1; }
.greeting__date { color: var(--lavender); }
.greeting__title {
  margin-top: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.62rem, 1.3rem + 1.7vw, 2.3rem);
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--white);
  max-width: 18ch;
}
.greeting__line { margin-top: 10px; color: rgba(255, 255, 255, 0.72); font-size: 0.95rem; max-width: 44ch; }
.greeting__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 0;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
@media (min-width: 620px) { .greeting__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; } }
.greeting__stat { padding-inline: 18px; border-right: 1px solid rgba(255, 255, 255, 0.2); }
.greeting__stat:first-child { padding-left: 0; }
.greeting__stat:nth-child(2n) { border-right: 0; }
@media (min-width: 620px) {
  .greeting__stat:nth-child(2n) { border-right: 1px solid rgba(255, 255, 255, 0.2); }
  .greeting__stat:last-child { border-right: 0; padding-right: 0; }
}
.greeting__stat dt {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
}
.greeting__stat dd {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 600;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.greeting__stat dd small {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-family: var(--font-ui);
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
}

/* Rejilla de secciones del inicio */
.home-grid { display: grid; gap: 0; }
@media (min-width: 1000px) {
  .home-grid { grid-template-columns: 1.28fr 1fr; gap: 0 44px; }
  .home-grid > * { min-width: 0; }
}

/* -----------------------------------------------------------------------------
   10. Componentes de seccion
   -------------------------------------------------------------------------- */
.list { display: block; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  transition: background var(--fast) var(--ease);
}
.row:last-child { border-bottom: 0; }
.row--button { width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; background: none; }
.row--interactive { cursor: pointer; }
.row--interactive:hover { background: rgba(23, 37, 84, 0.035); }
.row.is-done .row__title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }

.row__bar { flex: none; width: 3px; align-self: stretch; min-height: 32px; border-radius: 2px; background: var(--row-color, var(--lavender)); }
.row__time {
  flex: none;
  width: 52px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.row__time small { display: block; font-family: var(--font-ui); font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.row__main { display: block; flex: 1; min-width: 0; }
.row__title { display: block; font-weight: 700; letter-spacing: -0.008em; overflow-wrap: anywhere; }
.row__meta { display: block; margin-top: 2px; font-size: 0.82rem; color: var(--muted); }
.row__side { flex: none; text-align: right; }
.row__value {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.row__actions { flex: none; display: flex; gap: 0; }
@media (hover: hover) and (min-width: 700px) {
  .row__actions { opacity: 0; transition: opacity var(--fast) var(--ease); }
  .row:hover .row__actions, .row:focus-within .row__actions { opacity: 1; }
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  background: var(--cream-deep);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.tag--subject { background: color-mix(in srgb, var(--row-color, var(--lavender)) 14%, white); color: var(--row-color, var(--ink)); }
.tag--exam { background: var(--coral-soft); color: var(--coral-deep); }
.tag--done { background: #e9f0ea; color: #3d6b4a; }
.tag--pending { background: var(--cream-deep); color: var(--muted); }
.tag__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.chip-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
}
.chip-scroll::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 7px 13px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: all var(--fast) var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip:disabled, .chip[aria-disabled="true"] {
  border-style: dashed;
  color: var(--muted-light);
  background: transparent;
  cursor: default;
}
.chip:disabled:hover, .chip[aria-disabled="true"]:hover { border-color: var(--line-strong); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--navy); border-color: var(--navy); color: var(--white); }

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
}
.segmented button {
  border: 0;
  border-radius: var(--r-sm);
  padding: 6px 15px;
  background: none;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--muted);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.segmented button[aria-selected="true"] { background: var(--navy); color: var(--white); }

/* Barra de dias / navegador de fecha */
.date-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.date-nav__label { font-weight: 800; font-size: 0.98rem; letter-spacing: -0.01em; text-transform: capitalize; }
.date-nav__label span { display: block; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: none; }

/* Rejilla semanal (escritorio) */
.week-grid {
  display: grid;
  grid-template-columns: 46px repeat(var(--days, 5), minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.week-grid__head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 6px;
  background: var(--page);
  border-bottom: 1.5px solid var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}
.week-grid__head.is-today { color: var(--coral-deep); }
.week-grid__hours { position: relative; }
.week-grid__hour {
  position: absolute;
  left: 0; right: 6px;
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted-light);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.week-col {
  position: relative;
  border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    to bottom,
    var(--line) 0 1px,
    transparent 1px var(--slot-h)
  );
}
.week-event {
  position: absolute;
  left: 3px; right: 3px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 1px;
  padding: 5px 7px;
  border-radius: var(--r-xs);
  border-left: 3px solid var(--row-color, var(--blue));
  background: color-mix(in srgb, var(--row-color, var(--blue)) 12%, white);
  color: var(--ink);
  overflow: hidden;
  text-align: left;
  transition: filter var(--fast) var(--ease);
}
.week-event:hover { filter: brightness(0.96); }
.week-event__title { font-size: 0.78rem; font-weight: 800; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-event__meta {
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.week-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--coral); z-index: 3; }
.week-now::before {
  content: "";
  position: absolute;
  left: -4px; top: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--coral);
}

/* Medidor */
.meter { position: relative; height: 8px; border-radius: 999px; background: var(--cream-deep); overflow: hidden; }
.meter__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--meter-color, var(--blue));
  width: 0;
  transition: width 620ms var(--ease);
}
.meter-goal { position: relative; height: 8px; border-radius: 999px; background: var(--cream-deep); }
.meter-goal__fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--blue); transition: width 620ms var(--ease); }
.meter-goal__mark { position: absolute; top: -4px; width: 2px; height: 16px; border-radius: 1px; background: var(--coral); }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 18px;
}
.stat {
  padding: 16px 18px 16px 0;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: 0; }
.stat dt { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.stat dd {
  margin: 5px 0 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.stat dd small { font-family: var(--font-ui); font-size: 0.78rem; font-weight: 700; color: var(--muted); }

/* Habitos */
.habit-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.habit-check {
  flex: none;
  position: relative;
  width: 42px; height: 42px;
  border: 2px solid var(--habit-color, var(--lavender));
  border-radius: 50%;
  background: transparent;
  color: var(--habit-color, var(--lavender));
  display: grid;
  place-items: center;
  transition: background var(--mid) var(--ease), transform var(--fast) var(--ease),
    border-color var(--mid) var(--ease);
}
.habit-check svg { width: 20px; height: 20px; opacity: 0; transform: scale(0.6); transition: all var(--mid) var(--ease); }
.habit-check:hover { transform: scale(1.05); }
.habit-check[aria-pressed="true"] { background: var(--habit-color, var(--lavender)); color: var(--white); }
.habit-check[aria-pressed="true"] svg { opacity: 1; transform: scale(1); color: #fff; }
.habit-check.is-celebrating { animation: pop 420ms var(--ease); }
.habit-row.is-off { opacity: 0.55; }
.streak { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; font-weight: 800; color: var(--coral-deep); }
.streak__dots { display: inline-flex; gap: 2px; }
.streak__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.streak__dot.is-on { background: var(--coral); }

/* Concentracion */
.focus-stage { display: grid; place-items: center; gap: 26px; padding: 26px 0 8px; }
.focus-ring { position: relative; width: min(300px, 78vw); aspect-ratio: 1; }
.focus-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.focus-ring__track { fill: none; stroke: var(--cream-deep); stroke-width: 7; }
.focus-ring__progress {
  fill: none;
  stroke: var(--blue);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 320ms linear, stroke var(--mid) var(--ease);
}
.focus-ring.is-break .focus-ring__progress { stroke: var(--coral); }
.focus-ring__inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 4px;
}
.focus-time {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 2rem + 4.5vw, 3.6rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}
.focus-phase { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.focus-controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* Cuenta atras */
.countdown-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.countdown-num {
  flex: none;
  min-width: 74px;
  font-family: var(--font-display);
  font-size: 2.05rem;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
}
.countdown-num small { display: block; font-family: var(--font-ui); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.countdown-row.is-past .countdown-num { color: var(--muted-light); }
.countdown-row.is-soon .countdown-num { color: var(--coral-deep); }

/* Diario */
.entry { padding: 22px 0; border-bottom: 1px solid var(--line); }
.entry__date { color: var(--blue); }
.entry__title { margin-top: 8px; font-family: var(--font-display); font-size: 1.28rem; font-weight: 600; letter-spacing: -0.02em; }
.entry__body { margin-top: 8px; color: var(--ink-soft); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.68; }
.entry__body.is-clamped { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.entry__foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }

/* Ajustes */
.settings-group { margin-top: 34px; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row__label { font-weight: 700; }
.setting-row__value { font-size: 0.86rem; color: var(--muted); margin-top: 2px; }
.setting-row__main { min-width: 0; }

/* -----------------------------------------------------------------------------
   11. Dialogos, hojas y avisos
   -------------------------------------------------------------------------- */
dialog.sheet {
  width: 100%;
  max-width: 100%;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface);
  color: var(--ink);
  overflow: visible;
}
dialog.sheet::backdrop { background: rgba(15, 23, 51, 0.44); backdrop-filter: blur(2px); }
dialog.sheet[open] { animation: sheet-in 240ms var(--ease); }
@media (min-width: 700px) {
  dialog.sheet {
    max-width: 520px;
    margin: auto;
    border-radius: var(--r-lg);
  }
  dialog.sheet[open] { animation: dialog-in 180ms var(--ease); }
}
dialog.sheet--wide { max-width: 660px; }

.sheet__inner { display: flex; flex-direction: column; max-height: 92dvh; }
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.sheet__title { font-family: var(--font-display); font-size: 1.24rem; font-weight: 600; letter-spacing: -0.02em; }
.sheet__body { padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet__foot {
  display: flex;
  gap: 10px;
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.sheet__foot .btn { flex: 1; }
@media (min-width: 700px) { .sheet__foot { justify-content: flex-end; } .sheet__foot .btn { flex: none; min-width: 120px; } }

.menu-list { display: flex; flex-direction: column; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  font-size: 0.98rem;
  font-weight: 700;
  text-align: left;
  transition: background var(--fast) var(--ease);
}
.menu-item:last-child { border-bottom: 0; }
.menu-item:hover { background: rgba(23, 37, 84, 0.04); }
.menu-item svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.menu-item.is-active { color: var(--blue); }
.menu-item.is-active svg { color: var(--blue); }
.menu-item__chev { margin-left: auto; color: var(--muted-light); }

.toast-region {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 80;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 28px));
  pointer-events: none;
}
@media (min-width: 1024px) { .toast-region { left: auto; right: 24px; bottom: 24px; transform: none; } }

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--r-md);
  background: var(--navy);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(15, 23, 51, 0.18);
  animation: toast-in 220ms var(--ease);
  pointer-events: auto;
}
.toast.is-leaving { animation: toast-out 180ms var(--ease) forwards; }
.toast svg { width: 18px; height: 18px; flex: none; color: var(--lavender); }
.toast--error { background: #7d2318; }
.toast--error svg { color: #ffc9bf; }

/* -----------------------------------------------------------------------------
   12. Estados
   -------------------------------------------------------------------------- */
.empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 30px 0 28px;
}
/* Acento de marca: un trazo corto, sin repetir el simbolo en cada hueco. */
.empty__rule {
  width: 26px;
  height: 3px;
  margin-bottom: 12px;
  border-radius: 2px;
  background: var(--lavender);
  transform: skewX(-38deg);
}
.empty--center .empty__rule { justify-self: center; }
.empty__title { font-family: var(--font-display); font-size: 1.16rem; font-weight: 600; letter-spacing: -0.02em; }
.empty__text { color: var(--muted); font-size: 0.92rem; max-width: 42ch; }
.empty .btn { margin-top: 12px; }
.empty--center { justify-items: center; text-align: center; padding: 48px 0; }

.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--cream-deep) 25%, #fbf9f4 50%, var(--cream-deep) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.skeleton-row__bar { width: 3px; height: 34px; }
.skeleton-row__main { flex: 1; display: grid; gap: 7px; }

.loading-screen {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 60dvh;
  text-align: center;
}
.loading-screen .brand__symbol { animation: breathe 1.7s ease-in-out infinite; }

.error-state {
  padding: 18px;
  border: 1.5px solid rgba(192, 57, 43, 0.3);
  border-radius: var(--r-md);
  background: var(--danger-soft);
  color: #7d2318;
}
.error-state h3 { margin-bottom: 4px; }
.error-state p { font-size: 0.9rem; }
.error-state .btn { margin-top: 12px; }

/* -----------------------------------------------------------------------------
   13. Onboarding
   -------------------------------------------------------------------------- */
.onboarding { display: flex; flex-direction: column; min-height: 100dvh; }
.onboarding__bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--page);
}
.onboarding__progress { height: 3px; background: var(--cream-deep); }
.onboarding__progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--coral);
  transition: width 340ms var(--ease);
}
.onboarding__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
}
.onboarding__step { font-size: 0.76rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.onboarding__body { flex: 1; display: flex; }
.onboarding__panel {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 52px) 0 32px;
}
.onboarding__panel h1 { font-size: clamp(1.7rem, 1.4rem + 1.6vw, 2.4rem); max-width: 16ch; }
.onboarding__panel .lede { margin-top: 14px; }
.onboarding__section { margin-top: 30px; }

.onboarding__foot {
  position: sticky;
  bottom: 0;
  padding: 14px 0 calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--page) 72%, rgba(250, 247, 240, 0));
}
.onboarding__foot-inner { display: flex; align-items: center; gap: 12px; }
.onboarding__foot .btn--primary { flex: 1; }
@media (min-width: 700px) { .onboarding__foot .btn--primary { flex: none; min-width: 200px; } }

.summary-list { border-top: 1px solid var(--line); margin-top: 26px; }
.summary-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.summary-item dt { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; color: var(--muted); }
.summary-item dd { margin: 0; font-weight: 700; text-align: right; }

.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--row-color, var(--lavender)) 15%, white);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--row-color, var(--lavender)); flex: none; }
.pill__remove { border: 0; background: none; padding: 0 0 0 2px; color: var(--muted); display: grid; place-items: center; }
.pill__remove svg { width: 13px; height: 13px; }
.pill__remove:hover { color: var(--danger); }

.inline-add { display: flex; gap: 8px; margin-top: 12px; }
.inline-add .input { flex: 1; }

/* -----------------------------------------------------------------------------
   14. Movimiento
   -------------------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(0.94); } }
@keyframes pop {
  0% { transform: scale(1); }
  38% { transform: scale(1.18); }
  70% { transform: scale(0.96); }
  100% { transform: scale(1); }
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@keyframes sheet-in { from { transform: translateY(22px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dialog-in { from { transform: scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.view-enter { animation: fade-up 240ms var(--ease); }
.row-enter { animation: row-in 260ms var(--ease); }
.is-saved { animation: pop 380ms var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -----------------------------------------------------------------------------
   15. Utilidades
   -------------------------------------------------------------------------- */
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 24px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 18px; }
.mt-lg { margin-top: 32px; }
.text-right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
