/* ============================================================
   Birthday Notify — Web
   Design system (mirrors the Android "Fresh Green" theme)
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Brand accents (shared) */
  --green:          #148EA3;
  --green-bright:   #41BDC1;
  --green-deep:     #0E6E80;
  --coral:          #EF7D6F;
  --peach:          #F2B330;
  --amber:          #F2B330;
  --mint:           #41BDC1;
  --green-info:     #0E7C90;

  /* Light scheme ("Fresh Teal" — brand #148EA3) */
  --bg-top:         #148EA3;
  --bg-bottom:      #41BDC1;
  --surface:        #FFFFFF;
  --surface-elev:   #F1F8F9;
  --surface-variant:#E3F1F3;
  --on-surface:     #37474F;
  --on-surface-var: #5E7C82;
  --on-background:  #FFFFFF;   /* text drawn over the gradient */
  --primary:        #148EA3;
  --on-primary:     #FFFFFF;
  --primary-container: #E3F1F3;
  --on-primary-container: #0E5A67;
  --secondary:      #0E6E80;
  --outline:        #DCEAEC;
  --error:          #B3261E;

  /* Bottom nav */
  --nav-active:     #0E7C90;
  --nav-inactive:   #7A8A8F;
  --nav-indicator:  #E3F1F3;

  /* Gradients */
  --brand-top:      #148EA3;
  --brand-bottom:   #0E6E80;
  /* 135deg = fixed 45° down-right, matching the app's Offset.Zero -> Infinite
     gradient direction (vector (1,1)). Keep both in sync. */
  --grad-ground:    linear-gradient(135deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  --grad-brand:     linear-gradient(135deg, var(--brand-top) 0%, var(--brand-bottom) 100%);
  --grad-badge:     linear-gradient(135deg, #41BDC1 0%, #148EA3 45%, #EF7D6F 100%);

  /* Shape */
  --r-card:   20px;
  --r-btn:    18px;
  --r-field:  16px;
  --r-pill:   999px;
  --shadow-card: 0 4px 16px rgba(14,110,128,.10), 0 1px 3px rgba(14,110,128,.08);
  --shadow-soft: 0 2px 10px rgba(14,110,128,.08);

  /* Layout */
  --maxw: 560px;               /* mobile-first, capped on desktop */
  --pad:  16px;
  --nav-h: 64px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg-top:         #0C3A44;
  --bg-bottom:      #06222A;
  --surface:        #10333B;
  --surface-elev:   #17414A;
  --surface-variant:#163C44;
  --on-surface:     #E6F0F1;
  --on-surface-var: #9BBEC3;
  --on-background:  #E6F0F1;
  --primary:        #45C7CB;
  --on-primary:     #06222A;
  --primary-container: #163C44;
  --on-primary-container: #B7E6EA;
  --secondary:      #58D0D3;
  --outline:        #2C4A52;
  --error:          #F2B8B5;

  --nav-active:     #45C7CB;
  --nav-inactive:   #7A8A8F;
  --nav-indicator:  #163C44;

  --shadow-card: 0 4px 16px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.30);
  --shadow-soft: 0 2px 10px rgba(0,0,0,.28);
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--on-surface);
  background: var(--grad-ground);
  background-attachment: fixed;
  min-height: 100dvh;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* Constrain everything to a phone-width column, centered on desktop */
.app-shell, .page, .landing-wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
}

/* ---------- Typography ---------- */
.h-display { font-size: 2rem;   font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.h1        { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.h2        { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; }
.h3        { font-size: 1.075rem; font-weight: 700; }
.title     { font-size: 1rem;   font-weight: 700; }
.body      { font-size: .95rem; font-weight: 400; }
.small     { font-size: .82rem; font-weight: 400; }
.muted     { color: var(--on-surface-var); }
.on-ground { color: var(--on-background); }
.section-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--on-background);
}
/* Inside a card the label sits on a light surface, so it stays muted.
   On the ground (outside any card) it must be light to read on the teal. */
.card .section-label { color: var(--on-surface-var); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
}
.card + .card { margin-top: 12px; }
/* In a horizontal row the vertical stacking margin doesn't apply — it would
   otherwise offset the sibling stat cards and break their alignment. */
.row > .card + .card { margin-top: 0; }
.card-tap { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.card-tap:active { transform: scale(.985); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--r-btn); cursor: pointer;
  font-weight: 700; font-size: .98rem; letter-spacing: .01em;
  padding: 14px 20px; min-height: 52px; width: 100%;
  transition: transform .1s ease, filter .1s ease, background .1s ease;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(1.03); }
.btn-brand   { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-soft); }
.btn-white   { background: var(--surface); color: var(--green-deep); box-shadow: var(--shadow-soft); }
.btn-outline { background: transparent; color: var(--on-surface); border: 1.5px solid var(--outline); }
.btn-ghost   { background: transparent; color: var(--green-deep); box-shadow: none; min-height: 44px; }
/* Ghost button for the teal ground: white outline + white text. */
.btn-ghost-w { background: rgba(255,255,255,.10); color: #fff; border: 1.5px solid rgba(255,255,255,.5); }
.btn-ghost-w:hover { background: rgba(255,255,255,.18); }
/* Active (marked) state: solid white + teal text + check. */
.btn-ghost-w.on { background: #fff; color: var(--green-deep); border-color: #fff; }

/* Month calendar: cap the grid width so the aspect-ratio cells don't blow up
   on the wide desktop content column. Full width on the narrow phone column. */
.cal-grid-card { max-width: 440px; margin-inline: auto; }

/* Year divider in the upcoming list: a thin rule with the year centred. */
.year-divider { display: flex; align-items: center; gap: 12px; margin: 16px 2px 8px; }
.year-divider .line { flex: 1; height: 1px; background: rgba(255,255,255,.3); }
.year-divider .yr { color: #fff; font-weight: 800; font-size: 1rem; letter-spacing: .02em; }
.btn-danger  { background: transparent; color: #C0392B; box-shadow: none; }
.btn-sm      { min-height: 40px; padding: 8px 14px; width: auto; font-size: .88rem; }
.btn-block   { width: 100%; }

/* ---------- Text fields ---------- */
.field { margin-bottom: 12px; }
.field > label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--on-surface-var); margin: 0 0 6px 2px;
}
.input, .textarea, select.input {
  width: 100%; border: 1.5px solid transparent;
  background: var(--surface-variant); color: var(--on-surface);
  border-radius: var(--r-field); padding: 13px 14px; font-size: 1rem;
  transition: border-color .12s ease, background .12s ease;
}
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--on-surface) 45%, transparent); }
.input:focus, .textarea:focus, select.input:focus {
  outline: none; border-color: var(--green); background: var(--surface-elev);
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.45; }
.field.error .input, .field.error .textarea { border-color: var(--error); }
/* The three date dropdowns must always fit on one row: let them shrink below
   their content width and trim the horizontal padding so the placeholders
   (Día/Mes/Año) don't force a wrap. */
.bdate-row > select.input { min-width: 0; padding-left: 10px; padding-right: 6px; text-overflow: ellipsis; }
.field .hint { font-size: .76rem; color: var(--on-surface-var); margin: 5px 2px 0; }
.field.error .hint { color: var(--error); }

/* ---------- Chips / pills ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--r-pill); padding: 8px 14px;
  background: var(--surface); color: var(--on-surface);
  font-size: .85rem; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--outline); white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
}
.chip.selected { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.chip-soft { background: var(--surface-variant); color: var(--green-info); border-color: transparent; }
/* Chips that sit on the teal ground (home tabs, people filters): inactive is a
   ghost outline, active is a solid white pill — so the SELECTED one pops instead
   of the unselected white one drowning out the teal-filled selection. */
.chip-onground { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.chip-onground .count-pill { background: rgba(255,255,255,.22); color: #fff; }
.chip-onground.selected { background: #fff; color: var(--green-deep); border-color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.chip-onground.selected .count-pill { background: var(--primary-container); color: var(--on-primary-container); }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }

/* Segmented control (e.g. calendar Lista / Calendario) — sits on the ground
   header, so it uses a translucent white track with a white active pill. */
.seg {
  display: inline-flex; gap: 2px; padding: 4px;
  background: rgba(255,255,255,.16); border-radius: var(--r-pill);
}
.seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; box-sizing: border-box;   /* fixed height so a count badge doesn't grow one tab */
  border: none; background: transparent; cursor: pointer;
  padding: 0 16px; border-radius: var(--r-pill);
  font-size: .9rem; font-weight: 600; color: rgba(255,255,255,.88);
  transition: background .15s, color .15s;
}
.seg-btn svg { width: 18px; height: 18px; }
.seg-btn.active { background: #fff; color: var(--green-deep); box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.seg-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 9px; font-size: .72rem; font-weight: 800;
  background: rgba(255,255,255,.25); color: #fff;
}
.seg-btn.active .seg-count { background: var(--primary-container); color: var(--on-primary-container); }

/* Small overflow menu (⋮) for the secondary greet actions. */
.menu-wrap { position: relative; flex: none; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 170px; background: var(--surface); border: 1px solid var(--outline);
  border-radius: 12px; box-shadow: var(--shadow-card); overflow: hidden; padding: 4px;
}
.menu button {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  color: var(--on-surface); font-size: .92rem; font-weight: 600; padding: 11px 12px;
  border-radius: 8px; cursor: pointer;
}
.menu button:hover { background: var(--surface-variant); }

/* Countdown pill */
.count-pill {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill); padding: 6px 12px; font-weight: 700; font-size: .85rem;
  background: var(--surface-variant); color: var(--green-info);
}
.count-pill.today { background: var(--primary); color: var(--on-primary); }

/* ---------- Language selector ---------- */
/* Language picker — clean vertical list, coherent with the landing menu. */
.lang-list { display: flex; flex-direction: column; }
.lang-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 10px; border-radius: 12px; cursor: pointer;
  border: none; background: transparent; text-align: left;
  color: var(--on-surface); font-weight: 600; font-size: 1rem;
  transition: background .12s;
}
.lang-row + .lang-row { border-top: 1px solid var(--outline); }
.lang-row:active { background: var(--surface-variant); }
.lang-row .flag { font-size: 1.5rem; line-height: 1; flex: none; }
.lang-row .nm { flex: 1; }
.lang-row.sel { color: var(--primary); }
.lang-row .chk { margin-left: auto; color: var(--primary); font-weight: 800; }

/* ---------- Avatar ---------- */
.avatar {
  border-radius: 50%; overflow: hidden; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; background: var(--green-deep);
  width: 48px; height: 48px; font-size: 1.1rem;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.4rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 2rem; }
.avatar.sm { width: 36px; height: 36px; font-size: .9rem; }

/* ---------- Rows ---------- */
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.person-row { display: flex; align-items: center; gap: 12px; }
.person-row .meta { flex: 1; min-width: 0; }
.person-row .name { font-weight: 700; color: var(--on-surface); }
.person-row .sub  { font-size: .82rem; color: var(--on-surface-var); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Confetti (hero card) ---------- */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: var(--r-card); }
.confetti span {
  position: absolute; top: -14px; border-radius: 2px; opacity: 0;
  animation-name: confetti-fall; animation-iteration-count: infinite; animation-timing-function: linear;
}
@keyframes confetti-fall {
  0% { transform: translateY(-14px) rotate(0deg); opacity: 0; }
  12% { opacity: .85; }
  100% { transform: translateY(160px) rotate(400deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

/* ---------- Empty state ---------- */
.empty {
  /* On the ground (outside a card) text must be light to read on the teal;
     inside a card it sits on a light surface, so it goes dark. */
  text-align: center; padding: 40px 20px; color: var(--on-background);
}
.card .empty { color: var(--on-surface); }
.empty .circle {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 16px;
  /* on-primary-container pairs with primary-container in BOTH themes;
     green-deep isn't redefined in dark, so the icon vanished there. */
  background: var(--primary-container); color: var(--on-primary-container);
  display: flex; align-items: center; justify-content: center; font-size: 2.6rem;
}
.empty .t { font-weight: 700; margin-bottom: 4px; }
.empty .s { font-size: .9rem; opacity: .85; }
.card .empty .s { color: var(--on-surface-var); opacity: 1; }

/* ---------- Brand badge (auth / onboarding) ---------- */
.brand-badge {
  width: 84px; height: 84px; border-radius: 24px; margin: 0 auto;
  overflow: hidden; box-shadow: var(--shadow-soft);
}
/* The isologo already carries the brand background, so it fills the rounded
   square directly (no white frame). */
.brand-badge img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--surface); box-shadow: 0 -2px 14px rgba(14,110,128,.10);
  padding: 8px max(env(safe-area-inset-left),8px) calc(6px + env(safe-area-inset-bottom)) max(env(safe-area-inset-right),8px);
  display: flex; justify-content: center;
}
.bottom-nav .inner { width: 100%; max-width: var(--maxw); display: flex; }
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; color: var(--nav-inactive); font-size: .68rem; font-weight: 600;
  background: none; border: none; cursor: pointer;
}
.nav-item .ico {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 30px; border-radius: var(--r-pill);
  transition: background .15s ease;
}
.nav-item svg { width: 24px; height: 24px; }
.nav-item.active { color: var(--nav-active); font-weight: 700; }
.nav-item.active .ico { background: var(--nav-indicator); }

/* ---------- FAB ---------- */
.fab {
  position: fixed; z-index: 45;
  right: max(16px, calc((100vw - var(--maxw))/2 + 16px));
  bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  width: 58px; height: 58px; border-radius: 18px; border: none; cursor: pointer;
  background: var(--grad-brand); color: #fff; box-shadow: 0 6px 18px rgba(14,110,128,.35);
  display: flex; align-items: center; justify-content: center;
}
.fab svg { width: 28px; height: 28px; }

/* ---------- Page scaffold ---------- */
.page { padding: 0 var(--pad) calc(var(--nav-h) + 28px); }
.page-scroll { min-height: 100dvh; }
.appbar {
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 14px) 2px 10px;
}
.appbar .title { color: var(--on-background); font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
.appbar .spacer { flex: 1; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.18); color: var(--on-background);
  display: flex; align-items: center; justify-content: center;
}
:root[data-theme="dark"] .icon-btn { background: rgba(255,255,255,.08); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- Modal / bottom sheet ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 60; background: rgba(20,40,32,.45);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-width: var(--maxw); background: var(--surface);
  border-radius: 24px 24px 0 0; padding: 20px var(--pad) calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 30px rgba(0,0,0,.25);
  transform: translateY(24px); transition: transform .2s ease;
  max-height: 88dvh; overflow-y: auto;
}
.scrim.open .sheet { transform: translateY(0); }
.sheet .grip { width: 40px; height: 4px; border-radius: 3px; background: var(--outline); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 4px; }
.dialog {
  width: 100%; max-width: 400px; margin: auto; background: var(--surface);
  border-radius: 24px; padding: 22px;
}
.scrim.center { align-items: center; padding: 0 20px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 20px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: #263A31; color: #fff; padding: 12px 18px; border-radius: 14px;
  font-size: .9rem; box-shadow: 0 6px 20px rgba(0,0,0,.3); max-width: 90vw;
  animation: toast-in .22s ease;
}
.toast.err { background: #7a2620; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Collapsible "reminders for this person" block (person detail). */
.pr-toggle summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pr-toggle summary::-webkit-details-marker { display: none; }
.pr-toggle .pr-caret { transition: transform .18s ease; }
.pr-toggle[open] .pr-caret { transform: rotate(90deg); }

/* Calendar day badge: number of birthdays when a day has more than one. */
.cal-badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: var(--coral, #EF7D6F); color: #fff;
  font-size: .62rem; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.35); pointer-events: none;
}

/* ---------- Photo lightbox ---------- */
.photo-modal {
  position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0,0,0,.72); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .18s ease; cursor: zoom-out;
}
.photo-modal.show { opacity: 1; }
.photo-modal img {
  width: min(82vw, 82vh, 460px); height: min(82vw, 82vh, 460px);
  border-radius: 50%; object-fit: cover; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  transform: scale(.94); transition: transform .18s ease;
}
.photo-modal.show img { transform: scale(1); }
.avatar.tappable { cursor: zoom-in; }

/* ---------- Spinner ---------- */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
.spinner.dark { border-color: rgba(14,110,128,.25); border-top-color: var(--green-deep); }
@keyframes spin { to { transform: rotate(360deg); } }
.overlay {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center; flex-direction: column; gap: 14px;
  background: rgba(14,110,128,.90); color: #fff;
}
.overlay.show { display: flex; }
.overlay .spinner { width: 40px; height: 40px; border-width: 4px; }

/* ---------- Utilities ---------- */
.stack > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 8px; }
.hidden { display: none !important; }
.center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.divider { height: 1px; background: var(--outline); margin: 12px 0; border: none; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); display: inline-block; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--outline); border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch .track::before { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { transform: translateX(20px); }

/* On phones, full-screen sub-pages (person detail, groups, reminders) take over
   and hide the tab bar; on desktop the sidebar stays (see the desktop block). */
@media (max-width: 979px) {
  #app.subpage .bottom-nav { display: none; }
}

/* =========================================================
   DESKTOP LAYOUT (#75)
   On wide screens the phone column becomes a real app layout:
   a fixed teal sidebar on the left + a centered content area.
   Scoped with :has(.bottom-nav) so the pre-auth login screen
   (which has no nav) stays as a centered narrow card.
   ========================================================= */
.side-brand { display: none; }

@media (min-width: 980px) {
  :root { --sidebar-w: 252px; --content-w: 860px; }

  /* Content region: offset by the sidebar, page centered within it */
  #app.app-shell:has(.bottom-nav) {
    max-width: none; margin: 0; padding-left: var(--sidebar-w);
  }
  #app:has(.bottom-nav) .page {
    max-width: var(--content-w); margin-inline: auto;
    padding: 0 28px 48px;
  }
  #app:has(.bottom-nav) .appbar {
    padding-top: 22px; padding-bottom: 8px;
  }
  /* The sidebar already carries the wordmark; drop the duplicate in home */
  .home-mark { display: none; }

  /* Bottom nav -> left sidebar */
  .bottom-nav {
    top: 0; bottom: 0; right: auto; width: var(--sidebar-w);
    flex-direction: column; justify-content: flex-start; align-items: stretch;
    background: var(--grad-brand);
    box-shadow: 1px 0 0 rgba(255,255,255,.06), 4px 0 24px rgba(14,110,128,.16);
    padding: 26px 16px 22px;
  }
  .bottom-nav .inner {
    flex-direction: column; max-width: none; width: 100%; gap: 4px;
  }
  .side-brand {
    display: flex; align-items: center; padding: 4px 10px 22px;
  }
  .side-brand img { height: 30px; width: auto; }

  .bottom-nav .nav-item {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 14px;
    padding: 12px 14px; border-radius: 14px;
    font-size: .98rem; font-weight: 600;
    color: rgba(255,255,255,.82);
    transition: background .15s ease, color .15s ease;
  }
  .bottom-nav .nav-item:hover { background: rgba(255,255,255,.10); color: #fff; }
  .bottom-nav .nav-item .ico {
    width: 26px; height: 26px; border-radius: 0; background: none !important;
  }
  .bottom-nav .nav-item svg { width: 24px; height: 24px; }
  .bottom-nav .nav-item.active { color: #fff; font-weight: 700; background: rgba(255,255,255,.18); }
  .bottom-nav .nav-item.active .ico { background: none; }

  /* FAB sits at the bottom-right of the centered content area */
  .fab {
    left: auto; bottom: 30px;
    right: max(24px, calc((100vw - var(--sidebar-w) - var(--content-w)) / 2 + 12px));
  }

  /* Toasts centered over the content region, not the whole viewport */
  .toast-wrap { left: var(--sidebar-w); right: 0; bottom: 28px; }

  /* Modals/sheets: center over the content region (right of the sidebar)
     and present bottom-sheets as centered rounded dialogs on wide screens. */
  .scrim { align-items: center; padding: 0 20px 0 calc(var(--sidebar-w) + 20px); }
  .sheet { border-radius: 24px; max-height: 84dvh; transform: translateY(12px); }
  .sheet .grip { display: none; }
}

/* Large desktops: a touch more breathing room */
@media (min-width: 1400px) {
  :root { --content-w: 960px; }
}

/* Skeleton loading lines (Regalos y otras cargas): pulso suave, sin salto visual. */
.sk-line { height: 14px; border-radius: 7px; background: var(--outline); animation: skPulse 1.4s ease-in-out infinite; }
@keyframes skPulse { 0%, 100% { opacity: .38; } 50% { opacity: .8; } }

/* Editor de plantillas con variables como pills dentro del texto. */
.tok-editor { min-height: 80px; padding: 12px 14px; overflow-y: auto; line-height: 1.7; }
.tok-editor:empty::before { content: attr(data-ph); color: var(--on-surface-var); opacity: .6; }
.tok-pill {
  display: inline-block; background: color-mix(in srgb, var(--coral) 20%, transparent);
  color: var(--coral); border-radius: var(--r-pill); padding: 0 8px; margin: 0 1px;
  font-weight: 700; font-size: .85em; line-height: 1.5; user-select: none; white-space: nowrap;
}