/* =====================================================================
   ing.cmae · Gestor de obras · portal/css/portal-fotos.css
   Fotos con protocolo (#/fotos/<ítem>) y visor de la cámara de la app.
   Va DESPUÉS de css/styles.css y css/portal.css: usa sus variables
   (--navy, --gold, --rejilla, --celda, --cab, --ok, --alerta, --reg,
   --pend, --texto-2, --toque, --cajetin-alto…) y sus piezas (.cuadro,
   .campo, .seg, .sello, .org, .confirma, .falta, .btn-gold, .btn-sec).
   Todo va bajo clases «fot-»: no cambia ninguna otra pantalla.
   Reglas: Montserrat ≤ 700 + IBM Plex Mono; esquinas 4 px; dorado solo
   para la acción principal (abrir la cámara, tomar la foto o guardar la
   serie); objetivos táctiles ≥ 48 px (principales 56-64); alto contraste;
   cortes en «em» para que respondan también a la letra ampliada.
   ===================================================================== */

/* El atributo hidden manda aunque la pieza tenga display propio */
:is(.fot-prot, .fot-serie, .fot-guardadas, .fot-visor) [hidden] { display: none !important; }

/* ---------- Protocolo del rubro: cuadro fase × tipo ---------- */
.fot-p-cab, .fot-p-f { display: grid; grid-template-columns: minmax(6rem, 1.25fr) repeat(2, minmax(0, 1fr)) minmax(5.6rem, auto); gap: 1px; background: var(--rejilla); }
.fot-p-cab { border-bottom: 1px solid var(--rejilla); }
.fot-p-cab span { padding: .35rem .55rem; background: var(--cab); font-family: var(--mono); font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); }
.fot-p { list-style: none; margin: 0; padding: 0; }
.fot-p-f { border-bottom: 1px solid var(--rejilla); }
.fot-p-f > span { display: flex; flex-direction: column; justify-content: center; gap: .05rem; min-width: 0; min-height: 56px; padding: .4rem .55rem; background: var(--celda); }
.fot-p-n { font-size: .92rem; font-weight: 700; line-height: 1.25; color: var(--navy); }
.fot-p-n small { font-family: var(--mono); font-size: .75rem; font-weight: 500; letter-spacing: .02em; color: var(--texto-2); }
.fot-p-q { display: flex; align-items: baseline; gap: .3rem; font-family: var(--mono); white-space: nowrap; }
.fot-p-q b { font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.fot-p-q small, .fot-p-c--na small, .fot-p-mas { font-family: var(--mono); font-size: .75rem; color: var(--texto-2); letter-spacing: .02em; }
.fot-p-c.ok .fot-p-q b { color: var(--ok); }
.fot-p-c.ok .fot-p-q::after { content: "✓"; font-size: .95rem; font-weight: 600; color: var(--ok); }
.fot-p-mas { color: var(--pend); font-weight: 600; }
.fot-p-e { align-items: flex-end; }
/* La etiqueta de cada celda solo se ve cuando el cuadro pierde su cabecera (pantalla angosta o letra grande) */
.fot-p-k { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fot-p-tot { padding: .45rem .65rem .55rem; border-top: 1px solid var(--rejilla); font-family: var(--mono); font-size: .75rem; letter-spacing: .03em; color: var(--texto-2); line-height: 1.45; }
.fot-guia { border-top-style: solid; }
/* Pantalla angosta o letra grande: cada fase en dos filas (fase · estado / general · detalle) */
@media (max-width: 23em) {
  .fot-p-cab { display: none; }
  .fot-p-f { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "n e" "g d"; }
  .fot-p-f > :nth-child(1) { grid-area: n; }
  .fot-p-f > :nth-child(2) { grid-area: g; }
  .fot-p-f > :nth-child(3) { grid-area: d; }
  .fot-p-f > :nth-child(4) { grid-area: e; }
  .fot-p-n, .fot-p-e { min-height: 44px !important; background: var(--cab) !important; }
  .fot-p-k { position: static; width: auto; height: auto; overflow: visible; clip-path: none; font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-2); }
}
@media (max-width: 15em) { .fot-p-f { grid-template-columns: minmax(0, 1fr); grid-template-areas: "n" "e" "g" "d"; } .fot-p-e { align-items: flex-start; } }
html[data-contraste="alto"] :is(.fot-p-n, .fot-p-e) { background: #fff; }

/* ---------- Serie en curso: fase, medición, ubicación, rubros, referencia ---------- */
.fot-form { display: grid; gap: .8rem; }
.fot-bloque { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: .45rem; }
.fot-bloque > legend { padding: 0; margin-bottom: .35rem; font-family: var(--mono); font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
.fot-fase button { min-height: 56px; font-size: .95rem; }
.fot-fase button[disabled] { opacity: .45; cursor: not-allowed; }
.fot-form .campo-ayuda { margin-top: .1rem; }
.fot-form .campo-in select { appearance: auto; }

.fot-rub-pri { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; padding: .45rem .55rem; border: 1px solid var(--rejilla); background: var(--paper); font-size: .875rem; font-weight: 600; line-height: 1.35; color: var(--navy); }
.fot-rub-pri .card-code { position: static; padding: .05rem .3rem; border: 1px solid var(--rejilla); background: var(--cab); font-family: var(--mono); font-size: .75rem; font-weight: 600; letter-spacing: .06em; color: var(--ink); }
.fot-rub-sel { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fot-rub-sel li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem; padding: .25rem .25rem .25rem .55rem; border: 1px solid var(--rejilla); background: #fff; font-size: .85rem; font-weight: 600; line-height: 1.3; color: var(--navy); }
.fot-rub > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: var(--toque); padding: .35rem .55rem; border: 1px dashed var(--rejilla); cursor: pointer; font-family: var(--mono); font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); line-height: 1.35; }
.fot-rub > summary::-webkit-details-marker { display: none; }
.fot-rub > summary::after { content: "+"; flex: none; font-size: 1.2rem; line-height: 1; }
.fot-rub[open] > summary { border-style: solid; background: var(--cab); }
.fot-rub[open] > summary::after { content: "−"; }
.fot-rub-in { display: grid; gap: .45rem; padding: .5rem 0 0; }
.fot-rub-in .buscar-campo input { width: 100%; min-height: var(--toque); padding: .6rem .9rem .6rem 2.8rem; border: 1px solid rgba(10, 26, 43, .45); border-radius: var(--r); background: #fff; color: var(--ink); font-family: var(--sans); font-size: 1rem; }
.fot-rub-in .buscar-campo svg { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: none; stroke: var(--navy); stroke-width: 2; pointer-events: none; }
.fot-rub-lista { display: grid; gap: 4px; max-height: min(26rem, 60vh); overflow: auto; overscroll-behavior: contain; padding-right: 2px; }
.fot-rub-op { grid-template-columns: 24px minmax(0, 1fr); }

.fot-ref-b { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem .65rem; align-items: start; padding: .55rem; border: 1px solid var(--rejilla); border-left: 3px solid var(--reg); background: #fff; }
.fot-ref-b > :not(.fot-ref-mini) { grid-column: 2; }
.fot-ref-b > .campo { grid-column: 1 / -1; }
.fot-ref-mini { grid-row: 1 / span 2; width: 6rem; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--rejilla); background: var(--cab); }
.fot-ref-b p { font-size: .85rem; line-height: 1.4; color: var(--ink); }
.fot-ref-b p b { display: block; margin-bottom: .1rem; font-family: var(--mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--reg); }
.fot-ref-nota { font-family: var(--mono); font-size: .75rem !important; color: var(--texto-2) !important; }
.fot-ref-b--falta { grid-template-columns: minmax(0, 1fr); border-left-color: var(--alerta); background: #fff8f7; }
.fot-ref-b--falta > * { grid-column: 1 !important; }
.fot-ref-b--falta p b { color: var(--alerta); }

/* ---------- Fotos de la serie (aún sin guardar) ---------- */
.fot-serie-l { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rejilla); }
.fot-sf { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .5rem .65rem; padding: .65rem; border-bottom: 1px solid var(--rejilla); background: var(--celda); }
.fot-sf-img { position: relative; align-self: start; border: 1px solid var(--navy); background: #000; }
.fot-sf-img img { width: 100%; height: auto; }
.fot-sf-n, .fot-g-img .fot-sf-n { position: absolute; left: 0; top: 0; padding: .05rem .3rem; background: var(--navy); color: var(--gold); font-family: var(--mono); font-size: .75rem; font-weight: 600; letter-spacing: .06em; }
.fot-sf-d { display: grid; gap: .2rem; align-content: start; min-width: 0; }
.fot-sf-cab { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-2); }
.fot-sf-cab b { font-size: .85rem; color: var(--navy); }
.fot-sf-meta { font-family: var(--mono); font-size: .75rem; letter-spacing: .02em; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.fot-sf-meta .neg { color: var(--alerta); font-weight: 600; }
.fot-sf-campos { grid-column: 1 / -1; display: grid; gap: .45rem; min-width: 0; }
.fot-sf-quitar { justify-self: start; }
/* Textos sugeridos: etiquetas livianas (48 px de toque, 36 px de dibujo), no una cuadrícula de botones */
.fot-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .4rem; margin-top: -.2rem; }
.fot-chips-k { font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-2); margin-right: .1rem; }
.fot-chips button { position: relative; isolation: isolate; min-height: 48px; padding: .2rem .6rem; border: 0; background: transparent; color: var(--navy); font-family: var(--sans); font-size: .8125rem; font-weight: 600; line-height: 1.2; text-align: left; cursor: pointer; }
.fot-chips button::before { content: ""; position: absolute; inset: 6px 0; z-index: -1; border: 1px dashed rgba(10, 26, 43, .55); border-radius: var(--r); background: #fff; }
.fot-chips button:hover::before { background: #fbf6ea; }
.fot-chips button span { color: var(--gold-ink); }
.fot-desv { padding: .3rem .45rem; border-left: 3px solid var(--ok); background: rgba(23, 102, 58, .07); font-family: var(--mono); font-size: .75rem; line-height: 1.4; color: var(--ink); }
.fot-desv b { margin-right: .35rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ok); }
.fot-desv--mal { border-left-color: var(--alerta); background: #fff8f7; }
.fot-desv--mal b { color: var(--alerta); }
.fot-desv--duda { border-left-color: var(--pend); background: #fff8ea; }
.fot-desv--duda b { color: var(--pend); }
.fot-avisos { padding: .45rem .65rem; border-top: 1px solid var(--rejilla); }
.fot-serie .confirma { border-bottom: 1px solid var(--rejilla); }
@media (max-width: 24em) { .fot-sf { grid-template-columns: 5.25rem minmax(0, 1fr); } }
@media (max-width: 15em) { .fot-sf { grid-template-columns: minmax(0, 1fr); } .fot-sf-img { max-width: 9rem; } }

/* ---------- Cámara no disponible: explicación (nunca la galería) ---------- */
.fot-permiso { display: grid; gap: .45rem; margin: 0 .65rem .7rem; padding: .6rem .65rem; border: 2px solid var(--alerta); border-radius: var(--r); background: #fff8f7; font-size: .9rem; line-height: 1.45; color: var(--ink); }
.fot-permiso-t { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; }
.fot-permiso-t b { font-size: .95rem; color: var(--alerta); }
.fot-permiso ol { margin: 0; padding-left: 1.2rem; display: grid; gap: .25rem; }
.fot-permiso-n { font-family: var(--mono); font-size: .75rem; color: var(--texto-2); }
.fot-permiso .btn-sec { justify-self: start; }
.fot-permiso--previo { border: 0; padding: 0; background: transparent; }      /* la tarjeta previa de permisos lleva su propio marco */
.fot-permiso--previo .btn-sec { justify-self: stretch; }

/* ---------- Fotos registradas (bloqueadas) ---------- */
.fot-g-fase { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding: .4rem .65rem; border-top: 1px solid var(--rejilla); border-bottom: 1px solid var(--rejilla); background: var(--cab); font-family: var(--mono); font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--navy); }
.cuadro-tit + .fot-g-fase { border-top: 0; }
.fot-g-fase small { font-size: .75rem; font-weight: 500; letter-spacing: .06em; color: var(--texto-2); }
.fot-g { border-bottom: 1px solid var(--rejilla); }
.fot-gl > .fot-g:last-child { border-bottom: 0; }
.fot-g > details > summary { list-style: none; display: grid; grid-template-columns: 5.25rem minmax(0, 1fr) auto; align-items: center; gap: 0 .65rem; min-height: 72px; padding: .45rem .6rem; cursor: pointer; background: var(--celda); }
.fot-g > details > summary::-webkit-details-marker { display: none; }
.fot-g > details > summary:hover { background: #fbf6ea; }
.fot-g > details[open] > summary { background: var(--cab); }
.fot-g-img { position: relative; display: block; border: 1px solid var(--navy); background: #000; }
.fot-g-img img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.fot-g-t { display: flex; flex-direction: column; gap: .05rem; min-width: 0; }
.fot-g-t small { font-family: var(--mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--texto-2); }
.fot-g-t b { font-size: .9rem; font-weight: 700; line-height: 1.3; color: var(--navy); overflow-wrap: anywhere; }
.fot-g-t > span { font-family: var(--mono); font-size: .75rem; line-height: 1.35; color: var(--ink); }
.fot-g-s { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.fot-g-det { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--rejilla); }
.fot-g-full { width: 100%; height: auto; background: #000; border-bottom: 1px solid var(--rejilla); }
.fot-g-det .ficha-datos { border-bottom: 1px solid var(--rejilla); }
.fot-v-txt { font-family: var(--sans) !important; font-size: .85rem !important; line-height: 1.3; }
.fot-huella { display: grid; gap: .1rem; padding: .45rem .65rem; border-bottom: 1px solid var(--rejilla); font-family: var(--mono); font-size: .75rem; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.fot-huella span { letter-spacing: .1em; text-transform: uppercase; color: var(--texto-2); }
.fot-sin-img { min-height: 3.9rem; background: repeating-linear-gradient(45deg, var(--cab) 0 6px, #fff 6px 12px) !important; }
@media (max-width: 24em) {
  .fot-g > details > summary { grid-template-columns: 4.25rem minmax(0, 1fr); }
  .fot-g-s { grid-column: 2; align-items: flex-start; margin-top: .3rem; }
  .fot-g-img { grid-row: 1 / span 2; align-self: start; }
}

/* ---------- Alto contraste (lectura al sol) ---------- */
html[data-contraste="alto"] :is(.fot-rub-pri, .fot-sf, .fot-p-f > span) { background: #fff; }
html[data-contraste="alto"] .fot-rub > summary { border: 2px solid var(--navy); }
html[data-contraste="alto"] .fot-chips button::before { border: 2px solid var(--navy); }
html[data-contraste="alto"] .fot-rub-in .buscar-campo input { border: 2px solid var(--navy); }
html[data-contraste="alto"] .fot-ref-b, html[data-contraste="alto"] .fot-sf-img, html[data-contraste="alto"] .fot-g-img { border-width: 2px; }
html[data-contraste="alto"] .fot-desv { background: #fff; border-left-width: 5px; }

/* =====================================================================
   VISOR DE LA CÁMARA
   Ocupa la pantalla sobre la lámina y deja a la vista el cajetín con
   EMERGENCIA. Fondo oscuro (la imagen manda); lecturas en vivo de GPS,
   rumbo, inclinación y hora; la acción principal (tomar) en dorado y en
   la zona del pulgar, junto al tipo GENERAL | DETALLE.
   ===================================================================== */
html.fot-visor-abierto, html.fot-visor-abierto body { overflow: hidden; }
/* Con el visor abierto, los avisos breves salen arriba: abajo taparían el disparador */
html.fot-visor-abierto .aviso-demo { top: calc(env(safe-area-inset-top) + 56px); bottom: auto; transform: translate(-50%, -8px); }
html.fot-visor-abierto .aviso-demo.ver { transform: translate(-50%, 0); }
.fot-visor { position: fixed; z-index: 51; top: 0; left: 0; right: 0; bottom: var(--cajetin-alto); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(min(11rem, 34vh), 1fr) auto auto auto; grid-template-areas: "cab" "zona" "instr" "op" "pie"; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); background: #040b14; color: #fff; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.fot-v-cab { grid-area: cab; display: flex; align-items: center; justify-content: space-between; gap: .4rem .6rem; min-height: 48px; padding: .3rem .6rem; background: var(--navy); border-bottom: 1px solid var(--line-l); }
.fot-v-t { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; min-width: 0; font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: #c6d4e2; line-height: 1.3; }
.fot-v-t b { font-size: .9rem; font-weight: 600; color: var(--gold); letter-spacing: .1em; }
.fot-v-lin { flex: none; min-height: 48px; padding: 0 .7rem; border: 1px solid rgba(255, 255, 255, .6); border-radius: var(--r); background: transparent; color: #fff; font-family: var(--mono); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.fot-v-lin[aria-pressed="true"] { background: #fff; color: var(--navy); }

.fot-v-zona { grid-area: zona; position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; }
.fot-v-cuadro { position: relative; width: 100%; height: 100%; background: #000; overflow: hidden; }
.fot-visor .fot-v-cuadro video, .fot-visor .fot-v-ref { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.fot-v-ref { pointer-events: none; }
/* Retícula de tercios con marcas de esquina, como un visor de nivel */
.fot-v-ret { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(33.333% - .5px), rgba(255, 255, 255, .32) calc(33.333% - .5px) calc(33.333% + .5px), transparent calc(33.333% + .5px) calc(66.666% - .5px), rgba(255, 255, 255, .32) calc(66.666% - .5px) calc(66.666% + .5px), transparent calc(66.666% + .5px)),
    linear-gradient(180deg, transparent calc(33.333% - .5px), rgba(255, 255, 255, .32) calc(33.333% - .5px) calc(33.333% + .5px), transparent calc(33.333% + .5px) calc(66.666% - .5px), rgba(255, 255, 255, .32) calc(66.666% - .5px) calc(66.666% + .5px), transparent calc(66.666% + .5px)); }
.fot-v-ret::before { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%);
  background: linear-gradient(var(--gold), var(--gold)) center / 2px 100% no-repeat, linear-gradient(var(--gold), var(--gold)) center / 100% 2px no-repeat; opacity: .9; }
.fot-v-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.fot-v-flash.va { animation: fot-flash .24s ease-out; }
@keyframes fot-flash { from { opacity: .75; } to { opacity: 0; } }
.fot-v-estado { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); padding: 0 1rem; text-align: center; font-family: var(--mono); font-size: .85rem; letter-spacing: .06em; color: #c6d4e2; }
.fot-v-estado:empty { display: none; }
.fot-v-desv { position: absolute; left: .4rem; right: .4rem; top: .4rem; display: flex; flex-wrap: wrap; gap: .15rem .7rem; padding: .35rem .55rem; border-left: 4px solid var(--gold); border-radius: 2px; background: rgba(10, 26, 43, .88); font-family: var(--mono); font-size: .8125rem; font-weight: 600; line-height: 1.35; color: #fff; }
.fot-v-desv.bien { border-left-color: #48c47c; }
.fot-v-desv.mal { border-left-color: #ff8a7a; background: rgba(120, 22, 14, .92); }
.fot-v-desv-ref { font-weight: 500; color: #c6d4e2; }

.fot-v-instr { grid-area: instr; display: flex; flex-wrap: wrap; gap: 1px; background: var(--line-l); border-top: 1px solid var(--line-l); }
.fot-v-instr > span { flex: 1 1 4.6rem; display: flex; flex-direction: column; justify-content: center; min-width: 0; min-height: 48px; padding: .25rem .5rem; background: var(--navy); font-family: var(--mono); line-height: 1.2; }
.fot-v-instr b { font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; white-space: nowrap; }
.fot-v-instr b.mal { color: #ffb4ab; }
.fot-v-instr b.duda { color: var(--gold-l); }
/* Estados en palabras («Sin rumbo», «Buscando», «calibre la brújula») sí se parten en 320-360 px, en horizontal y con letra
   ampliada; las cifras (±m, grados, hora) siguen sin partirse */
.fot-v-instr b.mal, .fot-v-instr b.duda { white-space: normal; overflow-wrap: anywhere; }
.fot-v-instr small { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: #c6d4e2; }

.fot-v-op { grid-area: op; display: flex; flex-wrap: wrap; align-items: center; gap: 0 .6rem; padding: 0 .6rem; background: var(--navy); border-top: 1px solid var(--line-l); font-family: var(--mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: #c6d4e2; }
.fot-v-op span { padding-top: .35rem; }
.fot-v-op input { flex: 1 1 5.5rem; min-width: 0; width: 100%; min-height: 48px; margin: 0; accent-color: var(--gold); cursor: pointer; }

.fot-v-pie { grid-area: pie; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "tipo tipo tipo" "listo disp ult"; align-items: center; gap: .5rem; padding: .5rem .6rem .55rem; background: var(--navy); border-top: 1px solid var(--line-l); }
.fot-v-pie .fot-v-tipo { grid-area: tipo; grid-auto-flow: column; border-color: rgba(255, 255, 255, .75); background: rgba(255, 255, 255, .75); }
.fot-v-tipo button { min-height: 48px; background: var(--navy); color: #fff; font-family: var(--mono); font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase; }
.fot-v-tipo button[aria-pressed="true"] { background: #fff; color: var(--navy); }
.fot-v-listo { grid-area: listo; min-height: 56px; min-width: 4.6rem; padding: 0 .75rem; border: 1px solid rgba(255, 255, 255, .7); border-radius: var(--r); background: transparent; color: #fff; font-family: var(--mono); font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.fot-v-disparo { grid-area: disp; display: flex; min-height: 64px; width: 100%; padding: .4rem .7rem; gap: .5rem; font-size: 1rem; box-shadow: none; }
.fot-v-disparo svg { width: 28px; height: 28px; }
.fot-v-disparo:hover { transform: none; }
.fot-v-disparo:disabled { opacity: .55; cursor: progress; }
.fot-v-ult { grid-area: ult; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; align-items: center; column-gap: .4rem; min-width: 3.4rem; font-family: var(--mono); }
.fot-visor .fot-v-ult img { grid-row: 1 / span 2; width: 48px; height: 48px; object-fit: cover; border: 1px solid rgba(255, 255, 255, .7); }
.fot-v-ult b { font-size: 1.05rem; font-weight: 600; color: var(--gold); line-height: 1; }
.fot-v-ult small { font-size: .75rem; color: #c6d4e2; line-height: 1.1; }
/* Teléfono angosto (320-336 px): el disparador sin ícono para que quepa junto a «Listo» */
@media (max-width: 21em) {
  .fot-v-disparo svg { display: none; }
  .fot-v-disparo { padding: .4rem .5rem; font-size: .95rem; }
  .fot-v-listo { min-width: 0; padding: 0 .55rem; }
  .fot-v-ult { min-width: 0; }
  .fot-v-ult small { display: none; }
  .fot-visor .fot-v-ult img { width: 44px; height: 44px; }
}
/* Letra muy grande en un teléfono angosto: el disparador ocupa su propia fila */
@media (max-width: 15em) {
  .fot-v-pie { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tipo tipo" "disp disp" "listo ult"; }
  .fot-v-instr > span { flex-basis: 45%; }
}
/* Teléfono en horizontal: la imagen a la izquierda y los controles en una columna a la derecha.
   La hora ya está en el cajetín (en horizontal muestra fecha y hora) y la cuenta de fotos, en el título. */
@media (orientation: landscape) and (max-height: 31em) {
  .fot-visor { grid-template-columns: minmax(0, 1fr) minmax(15rem, 40%); grid-template-rows: auto auto auto minmax(0, 1fr); grid-template-areas: "zona cab" "zona instr" "zona op" "zona pie"; }
  .fot-v-zona { min-height: 0; }
  .fot-v-pie { align-self: end; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "tipo tipo" "listo disp"; }
  .fot-v-ult { display: none; }
  .fot-v-instr > span:last-child { display: none; }
  .fot-v-instr > span { flex-basis: 30%; }
}
@media (orientation: landscape) and (max-height: 31em) and (max-width: 47em) { .fot-v-disparo svg { display: none; } }
/* Tableta: el visor no se estira más de lo necesario en los controles */
@media (min-width: 48em) and (orientation: portrait) {
  .fot-v-pie { grid-template-columns: auto minmax(0, 22rem) auto; justify-content: center; }
}
html[data-contraste="alto"] .fot-v-instr small, html[data-contraste="alto"] .fot-v-t { color: #fff; }
html[data-contraste="alto"] :is(.fot-v-listo, .fot-v-lin) { border-width: 2px; border-color: #fff; }
html[data-contraste="alto"] .fot-v-tipo { border-width: 2px; border-color: #fff; background: #fff; gap: 2px; }
html[data-contraste="alto"] .fot-v-desv { background: #0A1A2B; }

@media (prefers-reduced-motion: reduce) {
  .fot-v-flash.va { animation: none; }
}
