/*
 * Family Passport — estilos.
 * Tokens del sistema de marca de la web (design-system/MASTER.md): fondos blancos, colores
 * planos sin degradados, rojo solo para acciones, acentos y foco; menta para apoyo; texto
 * smoke, nunca negro puro. Texto base de 16 px (UX-05), foco sólido de 3 px (UX-06).
 */
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-wght-normal.3100e775e8.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/nunito-latin-wght-normal.ba344451ea.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --surface: #ffffff;
  --surface-muted: #f6f8f9;
  --brand-red: #f24452;
  --action-red: #d93646;
  --action-red-strong: #bf2f3d;
  --red-soft: #fde7e9;
  --smoke: #34373c;
  --smoke-muted: #62666d;
  --mint: #a7e3d4;
  --mint-light: #ddf3ec;
  --mint-strong: #6fc7b4;
  --mint-text: #1f6b5a;
  --amber-soft: #fdf3dc;
  --amber-text: #7a4b00;
  --border: #e6e8eb;
  --border-strong: #c9ced4;
  --focus: #b32136;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(52 55 60 / 6%), 0 4px 16px rgb(52 55 60 / 6%);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Nunito", "Inter", system-ui, sans-serif;
  --nav-h: 72px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* El foco nunca queda tapado por la barra inferior (UX-34). */
  scroll-padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  scroll-padding-top: 16px;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--smoke);
  background: var(--surface);
  overscroll-behavior-y: contain;
}
h1,
h2,
h3,
h4 {
  font-family: var(--display);
  line-height: 1.25;
  margin: 0 0 0.5rem;
  color: var(--smoke);
}
h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem);
  font-weight: 800;
}
h2 {
  font-size: 1.3rem;
  font-weight: 800;
}
h3 {
  font-size: 1.1rem;
  font-weight: 700;
}
h4 {
  font-size: 1rem;
  font-weight: 700;
}
p {
  margin: 0 0 0.75rem;
}
a {
  color: var(--action-red-strong);
}
img,
svg {
  max-width: 100%;
}
.ic {
  flex: none;
  vertical-align: -0.2em;
}
code,
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.muted,
.meta,
.hint,
.fineprint {
  color: var(--smoke-muted);
}
.hint,
.meta,
.fineprint {
  font-size: 0.9375rem;
}
.lead {
  font-size: 1.0625rem;
  color: var(--smoke-muted);
  max-width: 62ch;
}

/* Foco visible y con contraste 3:1 en todos los controles (UX-06, WCAG 1.4.11). */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}
[tabindex="-1"]:focus {
  outline: none;
}
.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--smoke);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

/* ── Botones (44 px) ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  color: var(--smoke);
  white-space: normal;
}
.btn.primary {
  background: var(--action-red);
  color: #fff;
}
.btn.primary:hover {
  background: var(--action-red-strong);
}
.btn.outline {
  border-color: var(--border-strong);
  background: var(--surface);
}
.btn.outline:hover,
.btn.ghost:hover {
  background: var(--surface-muted);
}
.btn.ghost {
  border-color: transparent;
}
.btn.danger {
  background: var(--action-red-strong);
  color: #fff;
}
.btn.danger-outline,
.btn.ghost.danger {
  border-color: var(--action-red-strong);
  color: var(--action-red-strong);
  background: var(--surface);
}
.btn.ghost.danger {
  border-color: transparent;
}
.btn.small {
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  font-size: 0.9375rem;
}
.btn.full {
  width: 100%;
}
.btn:disabled,
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
a.text-link {
  color: var(--action-red-strong);
  text-underline-offset: 3px;
}
button.text-link {
  background: none;
  border: 0;
  padding: 0.25rem 0;
  min-height: 44px;
  font: inherit;
  color: var(--action-red-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.row-actions,
.quick-actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0.75rem 0;
}
.item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

/* ── Formularios ─────────────────────────────────────────────────────────────── */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
.form-grid .full-col {
  grid-column: 1 / -1;
}
@media (min-width: 720px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.field > label,
fieldset > legend {
  font-weight: 600;
}
.field .hint {
  margin: 0;
}
input[type="text"],
input[type="password"],
input[type="date"],
input[type="search"],
input[type="number"],
input:not([type]),
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--smoke);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
textarea {
  resize: vertical;
}
[aria-invalid="true"] {
  border-color: var(--action-red-strong) !important;
  background: #fffafa;
}
.field-error,
.form-error {
  color: var(--action-red-strong);
  font-weight: 600;
  margin: 0;
}
.form-error {
  background: var(--red-soft);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
  min-width: 0;
}
fieldset > legend {
  padding: 0;
  margin-bottom: 0.5rem;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.35rem 0;
  cursor: pointer;
}
.check input {
  inline-size: 22px;
  block-size: 22px;
  margin: 0.15rem 0 0;
  flex: none;
  accent-color: var(--action-red);
}
.checks {
  display: grid;
  gap: 0 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: flex-end;
  margin-top: 0.75rem;
}
.inline-form .field {
  flex: 1 1 220px;
}
.inline-form .form-error {
  flex-basis: 100%;
}
.mini {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 600;
}

/* ── Piezas ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
@media (min-width: 720px) {
  .card {
    padding: 1.5rem;
  }
}
.grid-2 {
  display: grid;
  gap: 1rem;
}
@media (min-width: 900px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.head-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.pill,
.tag,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--surface-muted);
  color: var(--smoke);
  border: 1px solid var(--border);
}
.pill {
  margin: 0;
}
.chip {
  background: var(--mint-light);
  border-color: var(--mint);
  color: var(--mint-text);
}
.chip.is-sensitive,
.tag.warn {
  background: var(--amber-soft);
  border-color: #f0d9a8;
  color: var(--amber-text);
}
.tag.mint {
  background: var(--mint-light);
  color: var(--mint-text);
}
.chip.big {
  font-size: 0.9375rem;
  padding: 0.3rem 0.4rem 0.3rem 0.8rem;
}
.chip-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip-remove {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.chip-remove:hover {
  background: rgb(255 255 255 / 60%);
}
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin: 0 0 1rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}
.notice > p,
.notice > span,
.notice > div {
  flex: 1 1 240px;
  margin: 0;
}
.notice.warn {
  background: var(--amber-soft);
  border-color: #f0d9a8;
  color: var(--amber-text);
}
.notice.ok,
.notice.soft {
  background: var(--mint-light);
  border-color: var(--mint);
  color: var(--smoke);
}
.empty {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--smoke-muted);
  margin-bottom: 1rem;
}
.empty-title {
  font-weight: 700;
  color: var(--smoke);
}
.plain {
  list-style: none;
  padding: 0;
  margin: 0;
}
.plain > li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.plain > li:last-child {
  border-bottom: 0;
}
.counts li,
.activity li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}
.or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--smoke-muted);
  margin: 0.75rem 0;
}
.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
details > summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.clamp > summary {
  display: block;
  list-style: none;
}
.clamp > summary::-webkit-details-marker {
  display: none;
}
.clamp[open] > summary {
  display: none;
}
.clamp-preview {
  display: block;
}

/* ── Aviso de modo (uno solo, plegable: UX-31) ───────────────────────────────── */
.mode-banner {
  background: var(--amber-soft);
  color: var(--amber-text);
  border-bottom: 1px solid #f0d9a8;
  padding: 0.25rem 1rem;
  font-size: 0.9375rem;
}
.mode-banner p {
  margin: 0 0 0.5rem;
}

/* ── Puerta de entrada (UX-14, PRD-23) ───────────────────────────────────────── */
.gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.gate-top {
  padding: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.gate-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  display: grid;
  gap: 1.5rem;
  align-content: start;
}
@media (min-width: 900px) {
  .gate-main {
    grid-template-columns: 1.1fr 1fr;
    align-items: start;
    padding-top: 2rem;
  }
  .gate-main > .notice {
    grid-column: 1 / -1;
  }
}
.gate-intro h1 {
  font-size: clamp(1.9rem, 1.4rem + 2.2vw, 3rem);
}
.pills {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pills li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
.pills .ic {
  color: var(--mint-text);
}
.example-choice .hint {
  margin-top: 0.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand > div {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
}
.brand-sub {
  font-size: 0.875rem;
  color: var(--smoke-muted);
}
.boot-fail {
  max-width: 640px;
  margin: 3rem auto;
  padding: 1.5rem;
}

/* ── Estructura con navegación ───────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  display: none;
}
.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.top-label {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-weight: 600;
}
.top-label .muted {
  font-weight: 400;
}
.top-actions {
  display: flex;
  gap: 0.25rem;
}
.content {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem calc(var(--nav-h) + env(safe-area-inset-bottom) + 1.5rem);
}
.screen-head {
  margin-bottom: 1.25rem;
}
.mobile-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.mobile-nav button {
  width: 100%;
  min-height: var(--nav-h);
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--smoke-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  cursor: pointer;
}
.mobile-nav button.active {
  color: var(--smoke);
  box-shadow: inset 0 3px 0 var(--brand-red);
}
/* Al escribir, la barra inferior se oculta para no tapar el campo (UX-34). */
body:has(
    input:focus:not(
        [type="checkbox"],
        [type="radio"],
        [type="button"],
        [type="submit"],
        [type="file"]
      ),
    textarea:focus
  )
  .mobile-nav {
  display: none;
}
@media (min-width: 900px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 260px;
    flex: none;
    padding: 1.25rem 1rem;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
  .sidebar nav {
    flex: 1;
  }
  .sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    font: inherit;
    font-weight: 600;
    color: var(--smoke);
    text-decoration: none;
    cursor: pointer;
  }
  .nav-link:hover {
    background: var(--surface-muted);
  }
  .nav-link.active {
    background: var(--mint-light);
    box-shadow: inset 3px 0 0 var(--brand-red);
  }
  .mobile-nav {
    display: none;
  }
  .content {
    padding: 2rem 2rem 3rem;
  }
}
.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--smoke);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover,
.menu-item.active {
  background: var(--surface-muted);
}
.legal-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1rem calc(var(--nav-h) + env(safe-area-inset-bottom) + 1rem);
  font-size: 0.9375rem;
  color: var(--smoke-muted);
  text-align: center;
}
.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.5rem;
}
/* Objetivo táctil de 44 px también en los enlaces del pie (WCAG 2.5.8 y guía de marca). */
.legal-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.5rem;
}
.gate .legal-footer {
  padding-bottom: 1rem;
}
@media (min-width: 900px) {
  .legal-footer {
    padding-bottom: 1rem;
  }
}

/* ── Inicio ──────────────────────────────────────────────────────────────────── */
.tiles {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}
.tile {
  width: 100%;
  min-height: 96px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 0.25rem 0.5rem;
  text-align: left;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  font: inherit;
  color: var(--smoke);
  cursor: pointer;
}
.tile strong {
  grid-column: 1 / -1;
  font-family: var(--display);
  font-size: 1.1rem;
}
.tile:hover {
  background: var(--mint-light);
}
.first-steps ol {
  margin: 0;
  padding-left: 1.25rem;
}
.first-steps li.is-done {
  list-style: none;
  margin-left: -1.25rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  min-height: 44px;
  color: var(--mint-text);
}
.recent {
  list-style: none;
  padding: 0;
  margin: 0;
}
.recent li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.recent li:last-child {
  border-bottom: 0;
}
.appt-next {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.appt-next > div {
  flex: 1 1 220px;
}
.closing {
  color: var(--smoke-muted);
  max-width: 65ch;
}

/* ── Su mundo ────────────────────────────────────────────────────────────────── */
.dim-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.dim-btn {
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--smoke);
}
.dim-btn.chosen {
  background: var(--mint-light);
  border-color: var(--mint-strong);
}
.dim-panel {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.how-we-talk {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* ── Momentos, datos y listas ────────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin: 0.5rem 0 1rem;
}
.filters .field {
  flex: 1 1 180px;
}
.filters .pill {
  min-height: 44px;
}
.month > h3 {
  position: sticky;
  top: 0;
  background: var(--surface);
  padding: 0.5rem 0;
  margin: 0;
  z-index: 1;
}
.moment-list,
.fact-list,
.goal-list,
.appt-list,
.team-list,
.proposal-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.moment,
.fact {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  content-visibility: auto;
  contain-intrinsic-size: auto 160px;
}
.support {
  background: var(--mint-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}
.goal h3,
.appt h3,
.member h3 {
  margin-top: 0.25rem;
}
.step {
  font-weight: 700;
  color: var(--smoke-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.875rem;
  margin: 0;
}
.ai-notice {
  border-color: #f0d9a8;
  background: var(--amber-soft);
}
.ai-notice h2 {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--amber-text);
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.4rem 1rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}
.choice:has(input:checked) {
  background: var(--mint-light);
  border-color: var(--mint-strong);
}
.provider-note {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.btn.upload {
  position: relative;
}
.sticky-actions {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  padding: 0.5rem 0;
}

/* ── Compartir ───────────────────────────────────────────────────────────────── */
.share-layout {
  display: grid;
  gap: 1rem;
}
@media (min-width: 1100px) {
  .share-layout {
    grid-template-columns: minmax(340px, 420px) 1fr;
    align-items: start;
  }
  .report-preview {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
  }
}
.presets {
  display: grid;
  gap: 0.5rem;
}
.preset {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.preset input {
  inline-size: 22px;
  block-size: 22px;
  margin-top: 0.15rem;
  accent-color: var(--action-red);
}
.preset span {
  display: flex;
  flex-direction: column;
}
.preset small {
  color: var(--smoke-muted);
  font-size: 0.9375rem;
}
.preset.chosen,
.preset:has(input:checked) {
  border-color: var(--mint-strong);
  background: var(--mint-light);
}
.history {
  margin-top: 1rem;
}
.report-controls .form-grid,
.report-controls .form-grid.compact {
  grid-template-columns: 1fr;
}
.report-preview {
  background: var(--surface-muted);
  border-radius: var(--radius);
  padding: 1rem;
}
.report-paper {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  color: var(--smoke);
  font-size: 1rem;
}
.report-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 2px solid var(--brand-red);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.report-title {
  font-size: 1.5rem;
}
.report-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.25rem 1rem;
  margin: 0 0 1rem;
}
.report-meta dt {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--smoke-muted);
}
.report-meta dd {
  margin: 0;
}
.report-note {
  font-size: 0.9375rem;
  color: var(--smoke-muted);
}
.report-section {
  margin-top: 1.25rem;
}
.report-section h3 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}
.report-item {
  padding: 0.5rem 0;
  break-inside: avoid;
}
.report-item p {
  margin: 0 0 0.25rem;
}
.report-src {
  font-size: 0.9375rem;
  color: var(--smoke-muted);
}
.report-essentials div {
  margin-bottom: 0.6rem;
  break-inside: avoid;
}
.report-essentials dt {
  font-weight: 700;
}
.report-essentials dd {
  margin: 0;
  white-space: pre-wrap;
}
.report-section blockquote {
  margin: 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--mint-strong);
  white-space: pre-wrap;
}
.report-sensitive,
.report-watermark {
  font-weight: 700;
  color: var(--amber-text);
}
.report-watermark {
  text-transform: uppercase;
  border: 2px dashed #e4b866;
  padding: 0.5rem;
  text-align: center;
  border-radius: var(--radius-sm);
}
.report-empty,
.report-more {
  color: var(--smoke-muted);
  font-style: italic;
}
.report-footer {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  font-size: 0.9375rem;
}

/* ── Privacidad ──────────────────────────────────────────────────────────────── */
.recovery-guide ol {
  padding-left: 1.25rem;
}
.danger-zone {
  border-color: #f3c5ca;
}
.safety-footer {
  color: var(--smoke-muted);
  font-size: 0.9375rem;
}

/* ── Avisos flotantes, diálogos y aviso de inactividad ───────────────────────── */
.toast-root {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
}
@media (min-width: 900px) {
  .toast-root {
    bottom: 24px;
  }
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--smoke);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.6rem 0.6rem 1rem;
  box-shadow: 0 8px 24px rgb(52 55 60 / 25%);
}
.toast p {
  margin: 0;
  flex: 1;
}
.toast.is-error {
  background: var(--action-red-strong);
}
.toast .btn.outline {
  background: transparent;
  color: #fff;
  border-color: rgb(255 255 255 / 70%);
}
.toast-close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  flex: none;
}
.toast :focus-visible {
  outline-color: #fff;
}
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(52 55 60 / 55%);
}
.modal-card {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 16px 48px rgb(52 55 60 / 30%);
}
.modal-card h2 {
  padding-right: 3rem;
}
.dialog-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--smoke);
  cursor: pointer;
}
.dialog-close:hover {
  background: var(--surface-muted);
}
.dialog-body ul {
  padding-left: 1.25rem;
}
.modal-card textarea[readonly] {
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
}
.idle-warning {
  position: fixed;
  z-index: 70;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 24px));
  background: var(--surface);
  border: 2px solid var(--action-red-strong);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: 0 16px 48px rgb(52 55 60 / 30%);
}

/* Ocultar el contenido en la vista de apps recientes. */
.is-concealed #app,
.is-concealed #modal,
.is-concealed .toast-root {
  visibility: hidden;
}

/* ── Impresión: solo el informe (#print-root) ───────────────────────────────── */
.print-root {
  display: none;
}
@page {
  margin: 16mm 14mm 18mm;
  @bottom-right {
    content: "Página " counter(page) " de " counter(pages);
    font-size: 9pt;
    color: #62666d;
  }
  @bottom-left {
    content: "Información confidencial · Family Passport";
    font-size: 9pt;
    color: #62666d;
  }
}
@media print {
  body.printing-report > *:not(.print-root) {
    display: none !important;
  }
  body.printing-report .print-root {
    display: block;
  }
  .report-paper {
    border: 0;
    padding: 0;
    font-size: 11pt;
  }
  .report-section h3 {
    break-after: avoid;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
}

/* Alto contraste del sistema. */
@media (forced-colors: active) {
  .btn,
  .chip,
  .tag,
  .pill,
  .dim-btn,
  .choice,
  .preset {
    border: 1px solid CanvasText;
  }
  .mobile-nav button.active,
  .nav-link.active {
    outline: 2px solid Highlight;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
