/* ==========================================================================
   Coordinación · AMPA Las Castañeras
   Lenguaje de iOS (listas agrupadas, barra inferior translúcida, títulos
   grandes en SF Pro Rounded) con los colores de las letras del logo.
   ========================================================================== */

:root {
  color-scheme: light dark;

  --co-bg: #F2F2F7;
  --co-card: #FFFFFF;
  --co-fill: rgba(118, 118, 128, .12);
  --co-label: #1C1C1E;
  --co-label-2: rgba(60, 60, 67, .64);
  --co-label-3: rgba(60, 60, 67, .32);
  --co-sep: rgba(60, 60, 67, .18);
  --co-tint: #9E6C0D;         /* ámbar del logo oscurecido: texto e iconos sobre blanco */
  --co-amber: #D8A028;        /* ámbar del logo: botón principal */
  --co-on-amber: #1C1C1E;
  --co-danger: #D0342C;
  --co-ok: #2E8540;
  --co-inactive: #8E8E93;
  --co-bar: rgba(249, 249, 251, .84);
  --co-glass: rgba(255, 255, 255, .72);
  --co-glass-solid: rgba(255, 255, 255, .96);
  --co-glass-edge: rgba(0, 0, 0, .08);
  --co-glass-hi: rgba(255, 255, 255, .75);
  --co-glass-ring: rgba(255, 255, 255, .9);
  --co-tab-on: rgba(158, 108, 13, .12);
  --co-seg-on: #FFFFFF;
  --co-r: 14px;

  /* Letras del logo del AMPA: A azul, M ámbar, P verde, A rosa */
  --co-l1: #4098D0;
  --co-l2: #D8A028;
  --co-l3: #B8C068;
  --co-l4: #B84068;

  --co-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --co-round: ui-rounded, "SF Pro Rounded", "Nunito", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --co-safe-t: env(safe-area-inset-top, 0px);
  --co-safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --co-bg: #000000;
    --co-card: #1C1C1E;
    --co-fill: rgba(118, 118, 128, .24);
    --co-label: #FFFFFF;
    --co-label-2: rgba(235, 235, 245, .62);
    --co-label-3: rgba(235, 235, 245, .3);
    --co-sep: rgba(84, 84, 88, .62);
    --co-tint: #EBB84A;
    --co-amber: #E2AC34;
    --co-danger: #FF5A52;
    --co-ok: #3CCB5B;
    --co-inactive: #8D8D93;
    --co-bar: rgba(22, 22, 24, .82);
    --co-glass: rgba(40, 40, 43, .7);
    --co-glass-solid: rgba(40, 40, 43, .97);
    --co-glass-edge: rgba(255, 255, 255, .1);
    --co-glass-hi: rgba(255, 255, 255, .08);
    --co-glass-ring: rgba(40, 40, 43, .9);
    --co-tab-on: rgba(235, 184, 74, .16);
    --co-seg-on: #636366;
  }
}

/* --- Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.co {
  margin: 0;
  min-height: 100vh;
  background: var(--co-bg);
  color: var(--co-label);
  font: 17px/1.35 var(--co-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
/* Resets con especificidad cero (:where) para no pisar a los componentes */
:where(.co) a { color: inherit; text-decoration: none; }
:where(.co) :is(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.co) p { margin: 0; }
.co [hidden] { display: none !important; }
.co :focus-visible { outline: 3px solid var(--co-amber); outline-offset: 2px; border-radius: 6px; }
.co-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.co-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.co-main {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--co-safe-t) + 12px) 16px calc(var(--co-safe-b) + 108px);
}
body.co--bare .co-main { padding-bottom: calc(var(--co-safe-b) + 32px); }

.co-ico {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* --- Cabeceras ------------------------------------------------------------ */
.co-head { margin: 8px 4px 20px; }
.co-head--row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.co-eyebrow {
  display: block; margin-bottom: 2px;
  font-size: 13px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  color: var(--co-label-2);
}
.co-title {
  margin: 0;
  font-family: var(--co-round); font-weight: 800; font-size: 34px; line-height: 1.08;
  letter-spacing: -.012em;
}

.co-navbar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 44px; margin: -4px -6px 0;
}
.co-back {
  display: inline-flex; align-items: center; gap: 1px;
  padding: 8px 6px; font-size: 17px; color: var(--co-tint) !important;
}
.co-back .co-ico { width: 22px; height: 22px; stroke-width: 2.4; margin-left: -4px; }
.co-navbar__action { padding: 8px 6px; font-size: 17px; font-weight: 600; color: var(--co-tint) !important; }

/* --- Secciones y listas agrupadas ---------------------------------------- */
.co-section { margin-top: 26px; }
.co-head + .co-section, .co-nudge + .co-section,
.co-head + form > .co-section:first-of-type { margin-top: 0; }
.co-section-h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 0 16px 7px;
  font-size: 13px; font-weight: 400; letter-spacing: .02em; text-transform: uppercase;
  color: var(--co-label-2);
}
.co-section-h__link { text-transform: none; font-size: 15px; letter-spacing: 0; color: var(--co-tint) !important; }
.co-count { font-variant-numeric: tabular-nums; }
.co-footnote { margin: 7px 16px 0; font-size: 13px; line-height: 1.38; color: var(--co-label-2); }
.co-quiet { margin: 0 16px; font-size: 15px; color: var(--co-label-2); }

.co-group { background: var(--co-card); border-radius: var(--co-r); overflow: hidden; }
.co-gap { margin-top: 12px; }

/* Separadores finos, sangrados como en iOS */
.co-group > * { position: relative; }
.co-group > * + *::before {
  content: ""; position: absolute; top: 0; right: 0; left: var(--sep, 16px);
  border-top: .5px solid var(--co-sep);
}

.co-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 11px 16px;
  background: var(--co-card);
}
a.co-row, summary.co-row { cursor: pointer; transition: background-color .15s; }
a.co-row:active, summary.co-row:active { background: var(--co-fill); }
.co-row__label { flex: 1; min-width: 0; }
.co-row__chev { width: 14px; height: 14px; color: var(--co-label-3); stroke-width: 2.8; }

/* Registro en lista */
.co-row--entry { align-items: flex-start; --sep: 60px; padding-top: 12px; padding-bottom: 12px; }
.co-row--entry .co-row__chev { align-self: center; }
.co-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.co-row__top { display: flex; align-items: baseline; gap: 8px; }
.co-row__title { flex: 1; min-width: 0; font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-row__meta { flex: none; font-size: 15px; color: var(--co-label-2); font-variant-numeric: tabular-nums; }
.co-row__sub { font-size: 14px; color: var(--co-label-2); }
.co-row__text {
  margin-top: 5px; font-size: 15px; line-height: 1.42; white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.co-row__photos { display: flex; gap: 6px; margin-top: 9px; }
.co-row__photos img, .co-more {
  width: 56px; height: 56px; border-radius: 9px; object-fit: cover; background: var(--co-fill);
}
.co-more { display: grid; place-items: center; font-size: 14px; font-weight: 600; color: var(--co-label-2); }

/* Recuadros de color con icono blanco, como en Ajustes de iOS */
.co-tile {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--k, var(--co-inactive)); color: #fff;
}
.co-tile .co-ico { width: 19px; height: 19px; stroke-width: 2; }
.co-tile--sm { width: 24px; height: 24px; border-radius: 6px; }
.co-tile--sm .co-ico { width: 15px; height: 15px; stroke-width: 2.3; }
.co-tile--lg { width: 48px; height: 48px; border-radius: 12px; }
.co-tile--lg .co-ico { width: 28px; height: 28px; stroke-width: 1.9; }

/* --- Vacíos --------------------------------------------------------------- */
.co-empty {
  padding: 34px 24px 28px; text-align: center;
  background: var(--co-card); border-radius: var(--co-r);
}
.co-empty__ico { display: block; width: 44px; height: 44px; margin: 0 auto 12px; color: var(--co-label-3); stroke-width: 1.5; }
.co-empty__title { margin-bottom: 5px !important; font-size: 17px; font-weight: 600; }
.co-empty__text { max-width: 34ch; margin: 0 auto 18px !important; font-size: 15px; line-height: 1.42; color: var(--co-label-2); }
.co-empty .co-btn { max-width: 300px; margin: 0 auto; }

/* --- Botones -------------------------------------------------------------- */
.co-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; padding: 0 20px;
  border: 0; border-radius: var(--co-r);
  background: var(--co-amber); color: var(--co-on-amber) !important;
  font-size: 17px; font-weight: 600; cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.co-btn:active { transform: scale(.985); opacity: .86; }
.co-btn[disabled] { opacity: .5; pointer-events: none; }
.co-btn .co-ico { width: 20px; height: 20px; stroke-width: 2.1; }
.co-btn--quiet { background: var(--co-card); color: var(--co-tint) !important; }
.co-btn--danger { background: var(--co-card); color: var(--co-danger) !important; }
.co-btn--sm { width: auto; min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 15px; }
.co-btn--sm .co-ico { width: 17px; height: 17px; }
.co-link {
  padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 15px; color: var(--co-tint);
}
.co-link--danger { color: var(--co-danger); }
.co-submit { margin-top: 28px; }

/* --- Campos --------------------------------------------------------------- */
.co-field {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 50px; padding: 6px 12px 6px 16px;
  background: var(--co-card);
}
.co-field__label { flex: none; font-size: 17px; }
.co-field__label--icon { display: flex; align-items: center; gap: 12px; }
.co-optional { font-size: 13px; color: var(--co-label-2); margin-left: 4px; }
.co-field input[type="date"], .co-field input[type="time"] {
  min-height: 36px; padding: 4px 10px; border: 0; border-radius: 8px;
  background: var(--co-fill); font-size: 17px; color: var(--co-label);
}
.co-select { position: relative; display: inline-flex; align-items: center; min-width: 0; max-width: 66%; }
.co-select select {
  max-width: 100%; padding: 8px 22px 8px 4px; border: 0; background: transparent;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  font-size: 17px; color: var(--co-label-2); text-align: right; text-align-last: right;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.co-select .co-ico { position: absolute; right: 0; width: 16px; height: 16px; color: var(--co-label-3); stroke-width: 2.3; pointer-events: none; }

.co-input-row { display: block; }
.co-input {
  display: block; width: 100%; padding: 14px 16px; border: 0; background: transparent;
  font-size: 17px; color: var(--co-label);
}
.co-input::placeholder { color: var(--co-label-3); }
.co-input:focus { outline: none; }
.co-group:has(.co-input:focus) { box-shadow: 0 0 0 2px var(--co-amber); }
.co-form-error { margin: 10px 16px 0; font-size: 15px; color: var(--co-danger); }

/* Tipo: botones de un toque en vez de desplegable */
.co-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.co-kind {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 10px 12px;
  background: var(--co-card); border-radius: 12px; cursor: pointer;
  font-size: 15px; font-weight: 600; line-height: 1.2;
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: box-shadow .15s ease, background-color .15s ease;
}
.co-kind input { position: absolute; opacity: 0; pointer-events: none; }
.co-kind.is-checked, .co-kind:has(input:checked) {
  box-shadow: inset 0 0 0 2px var(--k);
  background: color-mix(in srgb, var(--k) 11%, var(--co-card));
}
.co-kind:has(input:focus-visible) { outline: 3px solid var(--co-amber); outline-offset: 2px; }

/* Control segmentado */
.co-seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  padding: 2px; border-radius: 10px; background: var(--co-fill);
}
.co-seg label, .co-seg a {
  position: relative; display: block; padding: 7px 6px; border-radius: 8px;
  text-align: center; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background-color .2s ease, box-shadow .2s ease;
}
.co-seg input { position: absolute; opacity: 0; pointer-events: none; }
.co-seg .is-on, .co-seg label:has(input:checked) {
  background: var(--co-seg-on);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 1px 1px rgba(0, 0, 0, .04);
}
.co-seg label:has(input:focus-visible) { outline: 3px solid var(--co-amber); outline-offset: 1px; }
.co-seg--nav { margin-bottom: 4px; }
.co-seg--nav + .co-section { margin-top: 20px; }

/* --- Texto con dictado ---------------------------------------------------- */
.co-textarea-wrap { position: relative; background: var(--co-card); border-radius: var(--co-r); }
.co-textarea-wrap:focus-within { box-shadow: 0 0 0 2px var(--co-amber); }
.co-textarea {
  display: block; width: 100%; min-height: 150px; padding: 14px 16px 64px;
  border: 0; background: transparent; resize: none;
  font-size: 17px; line-height: 1.45; color: var(--co-label);
}
.co-textarea::placeholder { color: var(--co-label-3); }
.co-textarea:focus { outline: none; }
.co-interim {
  position: absolute; left: 16px; right: 150px; bottom: 20px;
  font-size: 14px; font-style: italic; line-height: 1.3; color: var(--co-label-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}

/* El micrófono: al escuchar se convierte en una cápsula con las cuatro
   letras del logo moviéndose al ritmo de la voz. */
.co-mic {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px 0 12px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--co-fill); color: var(--co-tint);
  font-size: 15px; font-weight: 600;
  transition: background-color .25s ease, color .25s ease, padding .25s ease;
}
.co-mic .co-ico { width: 22px; height: 22px; stroke-width: 2; }
.co-mic__off, .co-mic__meter { display: none !important; }
.co-mic.is-on { background: var(--co-label); color: var(--co-bg); padding-left: 16px; }
.co-mic.is-on .co-mic__on { display: none; }
.co-mic.is-on .co-mic__off { display: block !important; width: 18px; height: 18px; }
.co-mic.is-on .co-mic__meter { display: inline-flex !important; }
.co-mic__meter { align-items: center; gap: 3px; height: 20px; }
.co-mic__meter i {
  display: block; width: 4px; height: 6px; border-radius: 2px;
  background: var(--c); transform-origin: center;
  animation: co-voice var(--d) ease-in-out infinite alternate;
}
.co-mic__meter i:nth-child(1) { --c: var(--co-l1); --d: .46s; }
.co-mic__meter i:nth-child(2) { --c: var(--co-l2); --d: .62s; animation-delay: -.2s; }
.co-mic__meter i:nth-child(3) { --c: var(--co-l3); --d: .38s; animation-delay: -.1s; }
.co-mic__meter i:nth-child(4) { --c: var(--co-l4); --d: .54s; animation-delay: -.3s; }
@keyframes co-voice { from { height: 5px; } to { height: 20px; } }

/* --- Fotos ---------------------------------------------------------------- */
.co-photos {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px;
  padding: 12px; background: var(--co-card); border-radius: var(--co-r);
}
.co-photo, .co-photo-add { position: relative; aspect-ratio: 1; border-radius: 11px; overflow: hidden; }
.co-photo { background: var(--co-fill); }
.co-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.co-photo.is-busy::after {
  content: ""; position: absolute; inset: 50% auto auto 50%;
  width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  border: 2.5px solid var(--co-label-3); border-top-color: var(--co-tint);
  animation: co-spin .8s linear infinite;
}
@keyframes co-spin { to { transform: rotate(360deg); } }
.co-photo__rm {
  position: absolute; top: 5px; right: 5px; display: grid; place-items: center;
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(0, 0, 0, .55); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.co-photo__rm .co-ico { width: 14px; height: 14px; stroke-width: 2.8; }
.co-photo-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: var(--co-fill); color: var(--co-tint); cursor: pointer;
  font-size: 12px; font-weight: 600;
}
.co-photo-add .co-ico { width: 27px; height: 27px; }
.co-photo-add:focus-within { outline: 3px solid var(--co-amber); outline-offset: 2px; }

.co-draftbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 18px; padding: 11px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--co-amber) 16%, var(--co-card));
  font-size: 14px; line-height: 1.35;
}

/* --- Avisos --------------------------------------------------------------- */
.co-notice { display: flex; gap: 14px; padding: 14px 16px; background: var(--co-card); }
.co-notice.is-pending { box-shadow: inset 4px 0 0 var(--co-amber); }
.co-notice__time {
  flex: none; width: 58px; padding-top: 1px;
  font-family: var(--co-round); font-weight: 800; font-size: 21px; line-height: 1.1;
  letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}
.co-notice__notime {
  display: block; padding-top: 4px;
  font-family: var(--co-font); font-size: 12px; font-weight: 600; line-height: 1.2;
  color: var(--co-label-2);
}
.co-notice__body { flex: 1; min-width: 0; }
.co-notice__head { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 14px; font-weight: 600; }
.co-notice__target { font-weight: 400; color: var(--co-label-2); }
.co-notice__text { margin: 6px 0 5px !important; font-size: 16px; line-height: 1.42; white-space: pre-line; overflow-wrap: anywhere; }
.co-notice__foot, .co-notice__wait { font-size: 13px; line-height: 1.35; color: var(--co-label-2); }
.co-notice__wait { margin-top: 6px !important; font-style: italic; }
.co-seen { display: flex; align-items: flex-start; gap: 5px; margin-top: 8px !important; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--co-ok); }
.co-seen .co-ico { width: 16px; height: 16px; margin-top: 1px; stroke-width: 2.6; }
.co-notice__acts { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 11px; }
.co-notice__acts form { margin: 0; }
.co-notice__state { margin-top: 8px !important; font-size: 13px; font-weight: 600; color: var(--co-danger); }
.co-notice.is-cancelled .co-notice__time,
.co-notice.is-cancelled .co-notice__text { color: var(--co-label-3); text-decoration: line-through; }
.co-notice.is-cancelled .co-tile { opacity: .45; }

/* --- Histórico ------------------------------------------------------------ */
.co-search { position: relative; display: block; margin: 0 0 12px; }
.co-search input {
  width: 100%; height: 38px; padding: 0 12px 0 36px; border: 0; border-radius: 10px;
  background: var(--co-fill); font-size: 17px; color: var(--co-label);
  -webkit-appearance: none; appearance: none;
}
.co-search input::placeholder { color: var(--co-label-2); }
.co-search .co-ico { position: absolute; left: 10px; top: 9px; width: 20px; height: 20px; color: var(--co-label-2); stroke-width: 2.1; }
.co-chips {
  display: flex; gap: 8px; margin: 0 -16px 8px; padding: 2px 16px 6px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.co-chips::-webkit-scrollbar { display: none; }
.co-chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 13px; border-radius: 999px;
  background: var(--co-card); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.co-chip.is-on { background: var(--co-label); color: var(--co-bg) !important; }
.co-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--k); }
.co-more-wrap { margin-top: 20px; }
[data-days] > .co-section:first-child { margin-top: 18px; }

/* --- Ficha de registro ---------------------------------------------------- */
.co-detail-head { display: flex; align-items: center; gap: 14px; margin: 8px 4px 20px; }
.co-detail-head h1 { margin: 0; font-family: var(--co-round); font-weight: 800; font-size: 28px; line-height: 1.1; }
.co-detail-head p { margin-top: 3px; font-size: 15px; color: var(--co-label-2); }
.co-prose {
  padding: 14px 16px; border-radius: var(--co-r); background: var(--co-card);
  font-size: 17px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere;
}
.co-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.co-gallery a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: var(--co-fill); }
.co-gallery img { display: block; width: 100%; height: 100%; object-fit: cover; }
.co-kv { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; font-size: 16px; }
.co-kv span:last-child { color: var(--co-label-2); text-align: right; }
.co-lockline { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 14px 16px 0 !important; font-size: 13px; color: var(--co-label-2); text-align: center; }
.co-lockline .co-ico { width: 15px; height: 15px; stroke-width: 2.2; }

.co-viewer { position: fixed; inset: 0; z-index: 200; background: #000; }
.co-viewer__track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.co-viewer__track::-webkit-scrollbar { display: none; }
.co-viewer figure { flex: 0 0 100%; margin: 0; display: grid; place-items: center; scroll-snap-align: center; }
.co-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.co-viewer__close {
  position: absolute; top: calc(var(--co-safe-t) + 12px); right: 14px;
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: rgba(255, 255, 255, .18); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.co-viewer__close .co-ico { width: 18px; height: 18px; stroke-width: 2.6; }

/* --- Aviso para activar notificaciones ------------------------------------ */
.co-nudge {
  display: flex; align-items: center; gap: 12px; margin-bottom: 22px;
  padding: 12px 10px 12px 14px; border-radius: var(--co-r); background: var(--co-card);
}
.co-nudge__text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; line-height: 1.3; }
.co-nudge__text span { color: var(--co-label-2); }
.co-nudge__x {
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--co-label-3); cursor: pointer;
}
.co-nudge__x .co-ico { width: 16px; height: 16px; stroke-width: 2.4; }

/* --- Ajustes -------------------------------------------------------------- */
.co-profile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--co-r); background: var(--co-card); }
.co-avatar {
  display: grid; place-items: center; flex: none; width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(180deg, #A9A9AF, #85858B); color: #fff;
  font-family: var(--co-round); font-weight: 800; font-size: 22px; letter-spacing: .02em;
}
.co-profile__name { font-size: 20px; font-weight: 600; }
.co-profile__sub { margin-top: 2px !important; font-size: 14px; color: var(--co-label-2); }
.co-disclosure summary { list-style: none; }
.co-disclosure summary::-webkit-details-marker { display: none; }
.co-disclosure[open] .co-row__chev { transform: rotate(90deg); }
.co-row__chev { transition: transform .2s ease; }
.co-disclosure .co-row { --sep: 52px; }
.co-group > .co-row--link { --sep: 52px; }
.co-howto { padding: 2px 16px 16px 52px; font-size: 15px; line-height: 1.45; color: var(--co-label-2); }
.co-howto p + p { margin-top: 8px; }
.co-howto .co-btn { margin-top: 12px; }
.co-inline-ico { width: 17px; height: 17px; vertical-align: -3px; color: var(--co-tint); }
.co-signoff { margin-top: 18px; text-align: center; }

.co-switch { position: relative; flex: none; width: 51px; height: 31px; }
.co-switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.co-switch span {
  position: absolute; inset: 0; border-radius: 999px;
  background: rgba(120, 120, 128, .2); transition: background-color .25s ease;
}
.co-switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .08);
  transition: transform .25s cubic-bezier(.3, .7, .4, 1);
}
.co-switch input:checked + span { background: #34C759; }
.co-switch input:checked + span::after { transform: translateX(20px); }
.co-switch input:disabled + span { opacity: .5; }
.co-switch input:focus-visible + span { outline: 3px solid var(--co-amber); outline-offset: 2px; }

/* --- Acceso --------------------------------------------------------------- */
body.co--login .co-main {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 100vh; min-height: 100svh; max-width: 420px;
  padding-top: calc(var(--co-safe-t) + 24px); padding-bottom: calc(var(--co-safe-b) + 24px);
}
.co-login__brand { margin-bottom: 30px; text-align: center; }
.co-appicon {
  display: block; width: 104px; height: 104px; margin: 0 auto 18px;
  border-radius: 23.5px; background: #fff; overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .06);
}
.co-appicon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.co-login__title { margin: 0; font-family: var(--co-round); font-weight: 800; font-size: 32px; letter-spacing: -.01em; }
.co-login__sub { margin-top: 4px !important; font-size: 15px; color: var(--co-label-2); }
.co-login__submit { margin-top: 20px; }
.co-login__help { margin-top: 18px; text-align: center; }
.co-offline { margin-top: 20vh; }

/* --- Barra inferior flotante (como la de iOS 26) ------------------------- */
/* Cápsula de cristal separada del borde. Al bajar leyendo se encoge (solo
   iconos, más estrecha) y al subir vuelve; mientras se escribe se esconde. */
.co-tabbar {
  --ease: cubic-bezier(.32, .72, .24, 1);
  /* Ancho explícito y centrada con márgenes: con left: 50% una barra fija
     solo puede ocupar la mitad derecha de la pantalla, y en el móvil las
     pestañas se salían de la cápsula. */
  position: fixed; left: 0; right: 0; bottom: calc(var(--co-safe-b) + 12px); z-index: 50;
  width: min(100vw - 32px, 440px); margin: 0 auto;
  display: flex; align-items: center; padding: 6px;
  border-radius: 999px;
  background: var(--co-glass);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, .14), 0 2px 8px rgba(0, 0, 0, .06),
    inset 0 0 0 .5px var(--co-glass-edge), inset 0 1px 0 var(--co-glass-hi);
  transition: width .4s var(--ease), padding .4s var(--ease), transform .4s var(--ease), opacity .25s ease;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .co-tabbar { background: var(--co-glass-solid); }
}
.co-tab {
  position: relative; isolation: isolate;
  display: flex; flex: 1 1 0; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  height: 54px; border-radius: 999px; color: var(--co-inactive) !important;
  font-size: 10px; font-weight: 600; letter-spacing: .01em;
  transition: height .4s var(--ease), color .2s ease;
}
/* La pastilla que marca la pestaña activa */
.co-tab.is-active::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--co-tab-on);
}
.co-tab.is-active { color: var(--co-tint) !important; }
.co-tab__ico { width: 26px; height: 26px; stroke-width: 1.8; transition: transform .15s ease, width .4s var(--ease), height .4s var(--ease); }
.co-tab:active .co-tab__ico { transform: scale(.88); }
.co-tab__label {
  max-height: 14px; line-height: 14px; overflow: hidden; white-space: nowrap;
  transition: opacity .2s ease, max-height .4s var(--ease);
}
.co-cal-num { font: 700 8.6px var(--co-font); fill: currentColor; stroke: none; }
.co-badge {
  position: absolute; top: 4px; left: calc(50% + 5px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #FF3B30; color: #fff; box-shadow: 0 0 0 2px var(--co-glass-ring);
  font-size: 12px; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
  transition: top .4s var(--ease), left .4s var(--ease);
}

/* Cada pestaña es una página nueva: sin animaciones mientras carga, para
   que la barra aparezca ya en su sitio y no "crezca" al cambiar de sección. */
.co-preload .co-tabbar, .co-preload .co-tabbar * { transition: none !important; }

/* Encogida: solo iconos */
.co-tabbar.is-min { width: calc(var(--tabs, 4) * 48px + 8px); padding: 4px; }
.co-tabbar.is-min .co-tab { height: 42px; }
.co-tabbar.is-min .co-tab__ico { width: 24px; height: 24px; }
.co-tabbar.is-min .co-tab__label { opacity: 0; max-height: 0; }
.co-tabbar.is-min .co-badge { top: 0; left: calc(50% + 3px); }

/* Escondida mientras se escribe (el teclado de Android la subiría encima del texto) */
.co-tabbar.is-away {
  transform: translateY(calc(100% + 24px + var(--co-safe-b)));
  opacity: 0; pointer-events: none;
}

/* --- Aviso flotante ------------------------------------------------------- */
.co-toast {
  position: fixed; left: 50%; top: calc(var(--co-safe-t) + 10px); z-index: 300;
  max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 999px;
  background: var(--co-label); color: var(--co-bg);
  font-size: 15px; font-weight: 600; line-height: 1.3; text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .2);
  transform: translate(-50%, calc(-100% - 20px - var(--co-safe-t)));
  opacity: 0; visibility: hidden;
  transition: transform .4s cubic-bezier(.2, .9, .3, 1.15), opacity .25s ease, visibility 0s linear .4s;
  pointer-events: none;
}
.co-toast.is-on {
  transform: translate(-50%, 0); opacity: 1; visibility: visible;
  transition: transform .4s cubic-bezier(.2, .9, .3, 1.15), opacity .2s ease, visibility 0s;
}
.co-toast.is-error { background: var(--co-danger); color: #fff; }

/* --- Pantallas grandes: nada de barras de 1.400 px ------------------------ */
@media (min-width: 700px) {
  .co-kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .co *, .co *::before, .co *::after { transition-duration: .01ms !important; }
  .co-mic__meter i { animation: none; height: 12px; }
  .co-photo.is-busy::after { animation-duration: 2.4s; }
  .co-toast { transition: none; }
}
