/* mobile — phone and tablet parity with the Android app (LiaNavigationBar, TabHeader, liaGlass, LiaTabs,
   PendingRow, MeetingsCalendar). Sizes are the Compose dp/sp values at the 1.1 font scale the phones run,
   so a screen here and its Android twin line up. Wide screens (>= 980px) never see any of this. */

@media (max-width: 979.98px) {
  :root { --glass-card: #FBF7EC; --glass-edge: #E0D5BF; --shadow-card: 0 0 #0000; }
  :root[data-tema="oscuro"] { --glass-card: #241E16; --glass-edge: #413728; --shadow-card: 0 0 #0000; }

  /* ---- Tab header: serif title, quiet actions, the avatar; 8px from the top, 56px tall ---- */
  .pantalla { padding-top: calc(8px + env(safe-area-inset-top)); }
  .cabecera { min-height: 56px; margin-bottom: 12px; gap: 2px; margin-right: -4px; }
  .titulo, .ajustes .cabecera .titulo { font-size: 35px; line-height: 1.19; letter-spacing: -.2px; }
  .cabecera .avatar { margin-left: 2px; }

  /* The avatar: a flat stone disc with a hairline, initials in medium weight. */
  .avatar { background: var(--surface-var); border: 1px solid var(--line); box-shadow: none; font-weight: 600; font-size: 16px; letter-spacing: .1px; }

  /* ---- Nav: liquid glass without a cast shadow, a petal behind the chosen icon, a seed under its name ---- */
  .nav {
    bottom: calc(8px + env(safe-area-inset-bottom)); width: calc(100% - 24px); padding: 4px 6px; gap: 2px; border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, 0) 55%), rgba(254, 253, 249, .55);
    border: 1px solid; border-color: rgba(255, 255, 255, .85) rgba(224, 213, 191, .55) rgba(224, 213, 191, .35);
    backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: none;
  }
  :root[data-tema="oscuro"] .nav {
    background: linear-gradient(180deg, rgba(255, 255, 255, .10) 0%, rgba(255, 255, 255, 0) 55%), rgba(34, 29, 23, .62);
    border-color: rgba(255, 255, 255, .22) rgba(65, 55, 40, .45) rgba(65, 55, 40, .35);
    box-shadow: none;
  }
  .nav button { min-height: 56px; padding: 6px 0 4px; gap: 0; }
  .navIcono { position: relative; width: 56px; height: 34px; border-radius: 0; }
  .navIcono::before {
    content: ""; position: absolute; inset: 0; background: var(--surface-var); opacity: 0; transform: scale(.88);
    clip-path: path("M28 34C2.24 27.88 0 10.2 28 0C56 10.2 53.76 27.88 28 34Z"); transition: opacity .3s var(--ease), transform .35s var(--ease);
  }
  .navIcono .icono { position: relative; }
  .nav button.activa .navIcono { background: none; box-shadow: none; }
  .nav button.activa .navIcono::before { opacity: 1; transform: none; }
  /* Icons only, in a short pill: the names were noise once the places are known. */
  .navNombre { display: none; }
  .nav { width: auto; padding: 6px 10px; gap: 6px; }
  .nav button { flex: 0 0 60px; min-height: 48px; }
  .nav button.activa .navNombre { font-weight: 600; }
  .nav .punto { margin-top: 3px; }

  /* ---- Inicio ---- */
  .inicioPagina { padding-top: calc(8px + env(safe-area-inset-top)); }
  .arriba { min-height: 56px; margin-right: -4px; }
  .fecha { font-size: 15.5px; font-weight: 600; letter-spacing: .1px; }
  .fecha .clima { font-weight: 400; }
  .saludo { margin-top: 8px; }
  .resumenDia { margin-top: 16px; }
  .asaInicio { padding: 22px 40px 22px; }
  .asaInicio i { width: 36px; height: 4px; border-radius: 2px; background: var(--line); opacity: 1; }
  /* Typing is a quiet door here, not a button: the sphere is the way to talk. */
  .cielo > .botonIcono.vidrio { width: 48px; height: 48px; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; color: var(--ink-2); }

  /* ---- Cards: cream glass with a visible edge and a warm, low shadow ---- */
  .tarjeta {
    background: var(--glass-card); border: 1.5px solid var(--glass-edge); border-radius: 24px; box-shadow: var(--shadow-card);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .tarjeta > * + * { border-top-color: color-mix(in srgb, var(--glass-edge) 70%, transparent); }
  .subtitulo { align-items: center; margin: 20px 0 10px; }
  .subtitulo .seccion { font-size: 18.5px; font-weight: 600; line-height: 26px; }
  .subtitulo .cuenta { font-size: 15.5px; font-weight: 500; color: var(--ink-2); }

  /* ---- Tabs (LiaTabs): a stone track with soft corners; the chosen tab lifts as a card ---- */
  .segmentado:not(.chips) { padding: 4px; gap: 2px; border-radius: 16px; background: var(--surface-var); box-shadow: none; }
  .segmentado:not(.chips) button { min-height: 48px; border-radius: 12px; font-size: 16.5px; font-weight: 600; }
  .segmentado:not(.chips) .pildora { border-radius: 12px; background: var(--surface-hi); border: 0; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 80%, transparent); }
  .pendientes > .segmentado { margin-top: 0; }

  /* ---- Por responder (PendingRow): mark, who and when on one 40px line; the words under it, flush left ---- */
  .grupoApp { padding: 12px 20px 2px; font-size: 13px; font-weight: 600; letter-spacing: .2px; }
  .bandeja { display: block; padding: 0 0 14px 20px; }
  .bandeja + .bandeja::before { content: ""; display: block; height: 1px; margin-bottom: 0; background: color-mix(in srgb, var(--glass-edge) 70%, transparent); }
  .bandejaCab { display: flex; align-items: center; gap: 8px; height: 40px; width: 100%; text-align: left; }
  .bandejaCab .quien { display: flex; align-items: center; flex: 1; min-width: 0; font-size: 15.5px; line-height: 20px; color: var(--ink-2); }
  .bandejaCab .quien b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .bandejaCab .quien span { flex: none; white-space: nowrap; }
  .bandejaCab .burbuja { min-width: 0; height: auto; padding: 1px 7px; margin-left: 8px; border-radius: 999px; font-size: 13px; line-height: 16px; font-weight: 500; color: var(--ink-2); }
  .bandejaCab .abre { flex: none; display: grid; place-items: center; width: 48px; color: var(--ink-2); }
  .bandejaCab .sinAbre { flex: none; width: 16px; }
  .bandejaCuerpo { display: flex; align-items: flex-start; gap: 12px; padding-right: 16px; }
  .bandejaCuerpo > button:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
  .bandejaCuerpo .texto { font-size: 17.5px; line-height: 25px; color: var(--ink); }
  .bandejaCuerpo .miniatura { width: 56px; height: 56px; border-radius: 12px; align-self: flex-start; }
  .bandeja.abierta .bandejaCuerpo { flex-wrap: wrap; }
  .marcaWa { flex: none; display: block; color: var(--ink-2); }
  .bandejaCab .marcaApp { width: 16px; height: 16px; border-radius: 4px; background: none; border: 0; color: var(--ink-2); }
  .adjuntoFila { font-size: 15.5px; font-weight: 400; margin: 0; }
  .verMas { padding: 12px 20px 14px; font-weight: 500; font-size: 15.5px; }
  .flotante { bottom: calc(102px + env(safe-area-inset-bottom)); right: 22px; min-height: 56px; padding: 0 24px 0 20px; font-size: 17.5px; font-weight: 500; }

  /* ---- Agenda (MeetingsCalendar) ---- */
  .semana .dia { border-radius: 16px; padding: 8px 0; gap: 0; }
  .dia .pequeno { font-size: 13px; line-height: 16px; letter-spacing: .2px; }
  .dia b { font-size: 22px; line-height: 28px; }
  .dia i { margin-top: 2px; }
  .dia.marca i { background: color-mix(in srgb, var(--ink-2) 60%, transparent); }
  .dia.elegido.marca i { background: color-mix(in srgb, var(--bg) 60%, transparent); }
  .dia.hoy:not(.elegido) b { color: var(--orange); }
  .mes .filaTitulo, .mesBoton { font-weight: 500; }
  .evento { grid-template-columns: 76px 1.5px 1fr auto; gap: 0; padding: 0 0 0 8px; min-height: 76px; }
  .evento .hora { padding: 15px 14px 0 0; font-size: 17.5px; line-height: 22px; }
  .evento .hora small { font-size: 13px; line-height: 16px; margin-top: 0; }
  .evento .nodo::before { top: 0; bottom: 0; width: 1.5px; }
  .evento .nodo { justify-content: center; }
  .evento .nodo i { position: absolute; top: 19.5px; left: 50%; margin: 0 0 0 -4.5px; width: 9px; height: 9px; }
  .evento.cal .nodo i { background: var(--bg); border: 1.5px solid color-mix(in srgb, var(--ink-2) 70%, transparent); }
  .evento > span:nth-child(3) { padding: 12px 4px 12px 18px; align-self: center; }
  .evento .filaTitulo { font-size: 18.5px; line-height: 24px; }
  .evento.pasado { opacity: 1; }
  .evento.pasado .hora, .evento.pasado .filaTitulo { color: var(--ink-2); }
  .evento > .icono, .evento > .giratorio, .evento > .boton { margin-right: 4px; }
  .ahora { grid-template-columns: 76px 1fr; gap: 0; padding: 4px 0 4px 8px; font-size: 14px; }
  .ahora span { padding-right: 14px; }
  .ahora i { display: none; }
  .ahora b { position: relative; height: 1.5px; }
  .ahora b::before { content: ""; position: absolute; left: -3.75px; top: -3.75px; width: 9px; height: 9px; border-radius: 50%; background: var(--orange); }

  /* ---- Biblioteca: a 52px glass field with soft corners, the search glyph, a square "go" ---- */
  .pantalla > .buscador { min-height: 52px; padding: 0 6px 0 16px; gap: 0; border-radius: 16px; background: var(--glass-card); border: 1.5px solid var(--glass-edge); box-shadow: var(--shadow-card); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .buscador .ir { flex: none; width: 40px; height: 40px; border-radius: 12px; }
  .buscador .botonIcono:not(.ir) { flex: none; }
  .buscador .campo { min-width: 0; }
  .buscador > .lupa { display: block; color: var(--ink-2); }
  .buscador .campo::placeholder { color: var(--ink-2); }
  .buscador .campo { padding: 10px 10px; }

  .estante { margin-top: 28px; gap: 28px 22px; }

  /* ---- Ajustes (LiaTopBar + SettingsScreen): a bare back arrow, a 28sp title, sentence-case section names,
     cards without inner rules ---- */
  .ajustes .cabecera { margin-left: -12px; gap: 4px; }
  .ajustes .cabecera .botonIcono.vidrio { background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; color: var(--ink); }
  .ajustes .cabecera .titulo { font-size: 28px; line-height: 34px; padding-left: 8px; }
  .ajustes h2.seccion { margin: 28px 0 10px; font-size: 18.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
  .ajustes .tarjeta > * + * { border-top: 0; }
  .ajustes .tarjeta { border-radius: 24px; }

  .diaCabecera { margin-top: 30px; }

  /* Sheets (LiaBottomSheet): the stone handle sits 14px down, 6px above the content. */
  .asa { height: 24px; place-items: end center; padding-bottom: 6px; }

  /* Outlined tab glyphs, as on the phone (the rail keeps its filled ones). */
  .nav .icono.lleno { display: none; }
  .nav .icono.linea { display: block; }
}
