/* Cuaderno de Campo — Lanzarote.
   Identidad (02/12/2026): la casa de Lanzarote sobre el picón. Paredes de cal blanca, la carpintería verde de
   puertas y ventanas, el negro del picón de La Geria, y el ocre y el rojo de Timanfaya solo como señal;
   el azul del mar para lo que informa. La banda de arriba sigue siendo La Geria vista desde el aire (zocos).
   Letra Commissioner (va dentro de la app, en /letras): recta para leer y con los remates abiertos, como
   tallados en piedra, en los títulos. Marcos finos y botones lisos; todo grande y con mucho contraste,
   porque se usa al sol y con las manos de trabajar. */

@font-face {
  font-family: "Commissioner";
  src: url("/letras/commissioner-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --papel: #ffffff;         /* cal */
  --gris: #f4f2ef;          /* ceniza clara: el suelo sobre el que van las fichas */
  --gris-hondo: #e9e5e0;
  --rofe: #1c1a19;          /* picón */
  --piedra: #5f5955;
  --linea: #dad5cf;
  --linea-fuerte: #6f6863;  /* borde de los campos: se tiene que ver al sol */
  --verde: #0f6b47;         /* la carpintería */
  --verde-hondo: #0a5236;
  --verde-claro: #e2f0e8;
  --ocre: #d99a2b;          /* Timanfaya */
  --ocre-claro: #fbf1dc;
  --rojo: #ad3a1e;          /* Montañas del Fuego */
  --rojo-claro: #f9e7e0;
  --azul: #1a5f8f;          /* el mar */
  --azul-claro: #e4eff7;
  --radio: 12px;
  --radio-chico: 8px;
  --borde: 1px solid var(--linea);
  --borde-fuerte: 1.5px solid var(--rofe);
  --barra: 70px;
  --zocos: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='76' height='76'%3E%3Cg fill='none' stroke='%2334302e' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M8 30a17 17 0 0 1 34 0'/%3E%3Cpath d='M46 68a17 17 0 0 1 34 0'/%3E%3Cpath d='M-30 68a17 17 0 0 1 34 0'/%3E%3C/g%3E%3Cg fill='%231d6a48'%3E%3Ccircle cx='25' cy='31' r='3'/%3E%3Ccircle cx='63' cy='69' r='3'/%3E%3C/g%3E%3C/svg%3E");
  font-size: 18px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--gris); color: var(--rofe);
  font: 450 1rem/1.45 "Commissioner", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
/* Los títulos, con los remates abiertos de la misma letra (eje FLAR). */
h1, h2 { font-variation-settings: "FLAR" 100; letter-spacing: -.005em; }
h1 { font-size: 1.7rem; line-height: 1.14; font-weight: 700; }
h2 { font-size: 1.22rem; line-height: 1.22; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
b, strong { font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ocre); outline-offset: 2px; }
.suave { color: var(--piedra); }
.cargando { padding: 40vh 24px 0; text-align: center; color: var(--piedra); }

/* ---------- Armazón: banda de picón arriba, ceniza clara debajo ---------- */
.pantalla { max-width: 560px; margin: 0 auto; padding-bottom: calc(var(--barra) + 28px + env(safe-area-inset-bottom)); min-height: 100dvh; }
/* Los zocos se ven sobre todo a la derecha: donde va el texto, el picón queda liso. */
.banda { background: linear-gradient(100deg, var(--rofe) 34%, rgba(28, 26, 25, 0) 96%), var(--zocos) var(--rofe); color: #fff; padding: 24px 18px 22px; }
.banda p { color: #d3ccc6; }
.banda.hoy { padding-bottom: 112px; background: linear-gradient(180deg, var(--rofe) 30%, rgba(28, 26, 25, 0) 100%), var(--zocos) var(--rofe); }
/* La demostración: una tira ocre arriba, para que nadie la confunda con un cuaderno de verdad. */
.demo { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ocre); color: var(--rofe); padding: 6px 18px; font-size: .8rem; font-weight: 600; line-height: 1.2; }
.demo button, .demo a { flex: none; border: 1.5px solid var(--rofe); background: none; border-radius: var(--radio-chico); padding: 4px 10px; min-height: 34px; font-size: .78rem; font-weight: 600; color: var(--rofe); text-decoration: none; display: inline-flex; align-items: center; }
.cuerpo { padding: 20px 18px 0; }
.cuerpo > * + * { margin-top: 20px; }
@media (min-width: 561px) { body { background: var(--gris-hondo); } .pantalla { background: var(--gris); border-inline: var(--borde); } }

.barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--rofe); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
.barra div { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; max-width: 560px; }
.barra button { height: var(--barra); border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: .74rem; font-weight: 600; color: #b3aaa4; padding: 0 2px; border-top: 3px solid transparent; }
.barra svg { width: 26px; height: 26px; }
.barra button[aria-current="page"] { color: #fff; border-top-color: var(--ocre); }

/* ---------- Botones: lisos, grandes, de borde fino ---------- */
.boton {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 10px 16px;
  border: var(--borde-fuerte); border-radius: var(--radio); background: var(--papel);
  font-weight: 650; font-size: 1.05rem; text-align: center; text-decoration: none; color: var(--rofe);
  transition: background-color .12s, transform .06s;
}
.boton:active { transform: scale(.985); background: var(--gris); }
.boton.si { background: var(--verde); border-color: var(--verde); color: #fff; }
.boton.si:active { background: var(--verde-hondo); border-color: var(--verde-hondo); }
.boton.negro { background: var(--rofe); color: #fff; }
.boton.negro:active { background: #34302e; }
.boton.peligro { color: var(--rojo); border-color: var(--rojo); }
.boton.peligro:active { background: var(--rojo-claro); }
.boton.llano { border-color: transparent; background: none; text-decoration: underline; text-underline-offset: 4px; font-weight: 600; min-height: 48px; }
.boton:disabled { opacity: .4; }
.fila { display: flex; gap: 12px; }
.fila > * { flex: 1; }

.pastillas { display: flex; flex-wrap: wrap; gap: 8px; }
.pastilla { min-height: 48px; padding: 6px 14px; border: 1.5px solid var(--linea-fuerte); border-radius: var(--radio); background: var(--papel); font-weight: 600; font-size: 1rem; transition: background-color .12s; }
.pastilla[aria-pressed="true"] { background: var(--rofe); border-color: var(--rofe); color: #fff; }
.pastilla[aria-pressed="true"]::before { content: "✓ "; color: var(--ocre); }
.pastilla.atajo { border-color: var(--rofe); }
.pastilla.atajo:active { background: var(--gris); }

/* ---------- El hoyo: el botón de dictar, a caballo entre el picón y la ceniza ---------- */
.dictar { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.cuerpo > .dictar.grande { margin-top: -112px; }
.hoyo { width: 184px; height: 184px; border: 0; background: none; padding: 0; border-radius: 50%; }
.dictar.chico .hoyo { width: 120px; height: 120px; }
.hoyo svg { width: 100%; height: 100%; display: block; overflow: visible; }
.hoyo .zoco { fill: none; stroke: #b9b0a9; stroke-width: 11; stroke-linecap: round; stroke-dasharray: 16 10; }
.dictar.chico .zoco { stroke: var(--piedra); }
.hoyo .sombra { fill: rgba(28, 26, 25, .22); }
.hoyo .fondo { fill: var(--verde); stroke: #fff; stroke-width: 6; transition: fill .15s; }
.hoyo .micro { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.hoyo:active .fondo { transform: translateY(3px); }
.hoyo.oyendo .fondo { fill: var(--ocre); }
.hoyo.oyendo .micro { stroke: var(--rofe); }
.hoyo .onda { fill: none; stroke: var(--ocre); stroke-width: 5; opacity: 0; transform-origin: 100px 104px; }
.hoyo.oyendo .onda { animation: onda 1.3s ease-out infinite; }
@keyframes onda { from { opacity: .9; transform: scale(.8); } to { opacity: 0; transform: scale(1.14); } }
.hoyo.pensando .fondo { fill: var(--piedra); }
.hoyo:disabled .fondo { fill: var(--linea); }
.dictar .dicho { min-height: 2.9em; font-size: 1.12rem; font-weight: 600; max-width: 27ch; display: flex; align-items: center; }
.dictar .dicho.suave { font-weight: 450; }
@media (prefers-reduced-motion: reduce) { .hoyo.oyendo .onda { animation: none; opacity: .7; } .boton, .pastilla { transition: none; } }

.escribir { display: flex; gap: 10px; align-items: flex-start; }
.escribir input { flex: 1; min-width: 0; }
.escribir .boton { width: auto; min-height: 54px; }

/* ---------- Avisos: una ficha con su señal ---------- */
.nota { position: relative; border: 1px solid var(--ocre); background: var(--ocre-claro); border-radius: var(--radio); padding: 13px 14px 13px 52px; }
.nota::before { content: "!"; position: absolute; left: 13px; top: 13px; width: 28px; height: 28px; border-radius: 50%; background: var(--ocre); color: var(--rofe); font-weight: 700; display: grid; place-items: center; line-height: 1; }
.nota.error { border-color: var(--rojo); background: var(--rojo-claro); }
.nota.error::before { background: var(--rojo); color: #fff; content: "✕"; font-size: .85rem; }
.nota.bien { border-color: var(--verde); background: var(--verde-claro); }
.nota.bien::before { background: var(--verde); color: #fff; content: "✓"; font-size: .9rem; }
.nota.info { border-color: var(--azul); background: var(--azul-claro); }
.nota.info::before { background: var(--azul); color: #fff; content: "i"; }
.nota b { display: block; font-weight: 700; }
.nota .porque { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(28, 26, 25, .18); }
.nota .boton { margin-top: 10px; }
.nota ul { margin: 6px 0 0; padding: 0; list-style: none; }
.nota li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; padding: 5px 0; border-top: 1px solid rgba(28, 26, 25, .18); }
.nota li span:last-child { font-weight: 700; }
.notas > * + * { margin-top: 10px; }

/* ---------- El cuaderno: renglones de tabla, como la hoja oficial ---------- */
.renglones { list-style: none; margin: 0; padding: 0; border: var(--borde); border-radius: var(--radio); overflow: hidden; background: var(--papel); }
.renglones li + li { border-top: var(--borde); }
.renglon { display: grid; grid-template-columns: 58px 1fr auto; align-items: stretch; width: 100%; padding: 0; border: 0; background: none; text-align: left; min-height: 64px; }
.renglon:active { background: var(--gris); }
.renglon > * { padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; }
.renglon .dia { text-align: center; align-items: center; line-height: 1; border-right: var(--borde); padding: 8px 4px; }
.renglon .dia b { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.renglon .dia span { font-size: .78rem; margin-top: 3px; color: var(--piedra); }
.renglon .que b { font-weight: 650; }
.renglon .que span { color: var(--piedra); font-size: .92rem; }
.renglon .marca { align-self: center; margin-right: 10px; font-size: .76rem; font-weight: 700; padding: 4px 10px; border: 1px solid transparent; border-radius: 999px; white-space: nowrap; }
.marca.borrador { background: var(--ocre-claro); border-color: var(--ocre); }
.marca.ojo { background: var(--rojo); color: #fff; }
.marca.falta { background: var(--gris); color: var(--piedra); border-color: var(--linea); }
.mes { margin: 0 0 8px; font-size: 1.05rem; font-weight: 700; }
.mes::first-letter { text-transform: uppercase; }
.vacio { padding: 8px 0; color: var(--piedra); }
.titulo-seccion { margin-bottom: 10px; }

/* ---------- Hoja que sube (confirmar, formularios) ---------- */
.hoja { position: fixed; inset: 0; z-index: 20; background: rgba(28, 26, 25, .56); display: flex; align-items: flex-end; justify-content: center; }
.hoja[hidden] { display: none; }
.hoja .papel { background: var(--gris); width: 100%; max-width: 560px; max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 36px rgba(28, 26, 25, .22); padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); animation: sube .2s ease-out; }
.hoja .papel > * + * { margin-top: 18px; }
@keyframes sube { from { transform: translateY(36px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hoja .papel { animation: none; } }
.hoja .tope { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cerrar { width: 48px; height: 48px; border-radius: 50%; border: var(--borde); background: var(--papel); font-size: 1.1rem; font-weight: 700; line-height: 1; flex: none; }
.cerrar:active { background: var(--gris-hondo); }

.propuesta { border: var(--borde); border-radius: var(--radio); overflow: hidden; background: var(--papel); }
.propuesta + .propuesta { margin-top: 18px; }
.propuesta .tipo { display: flex; justify-content: space-between; align-items: center; background: var(--rofe); color: #fff; padding: 9px 14px; font-weight: 700; }
.propuesta .tipo span { background: var(--ocre); color: var(--rofe); padding: 2px 10px; border-radius: 999px; font-size: .86rem; font-weight: 600; }
.propuesta .dentro { padding: 14px; }
.propuesta .dentro > * + * { margin-top: 14px; }
.propuesta h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.2; font-variation-settings: "FLAR" 100; }
.propuesta dl { margin: 0; }
.propuesta dl div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: var(--borde); }
.propuesta dt { color: var(--piedra); flex: none; }
.propuesta dd { margin: 0; font-weight: 650; text-align: right; }
.pregunta { background: var(--papel); border: 1.5px dashed var(--piedra); border-radius: var(--radio); padding: 14px; }
.pregunta > * + * { margin-top: 12px; }
.pregunta h3 { font-size: 1.12rem; font-weight: 700; }

/* ---------- Formularios ---------- */
.campo { display: block; }
.campo > span, .campo > legend { display: block; font-weight: 650; margin-bottom: 6px; padding: 0; }
.campo small { display: block; color: var(--piedra); margin-top: 6px; font-size: .9rem; }
fieldset.campo { border: 0; padding: 0; margin-inline: 0; margin-bottom: 0; min-width: 0; }   /* sin tocar el margen de arriba: lo pone quien lo contiene */
input[type="text"], input[type="tel"], input[type="number"], input[type="date"], input[type="search"], input[type="email"], select, textarea {
  width: 100%; min-height: 54px; padding: 10px 14px; border: 1.5px solid var(--linea-fuerte); border-radius: var(--radio); background: var(--papel); font-size: 1.08rem; font-weight: 600;
}
input::placeholder, textarea::placeholder { color: #8a827d; font-weight: 450; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--ocre); outline-offset: 0; border-color: var(--rofe); }
.con-unidad { display: grid; gap: 8px; }
.tres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.formulario > * + * { margin-top: 18px; }
details.mas { border-top: var(--borde); padding-top: 8px; }
details.mas summary { font-weight: 700; min-height: 48px; display: flex; align-items: center; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
details.mas > * + * { margin-top: 18px; }
.resultados { list-style: none; margin: 8px 0 0; padding: 0; border: var(--borde); border-radius: var(--radio); overflow: hidden; }
.resultados:empty { display: none; }
.resultados li + li { border-top: var(--borde); }
.resultados button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; background: var(--papel); min-height: 54px; font-weight: 650; }
.resultados button:active { background: var(--verde-claro); }
.resultados small { display: block; color: var(--piedra); font-weight: 450; }

/* ---------- Dosis ---------- */
.cuenta { border: var(--borde); border-radius: var(--radio); overflow: hidden; background: var(--papel); }
.cuenta .grande { background: linear-gradient(100deg, var(--rofe) 40%, rgba(28, 26, 25, 0) 100%), var(--zocos) var(--rofe); color: #fff; padding: 16px 16px 18px; }
.cuenta .grande span { display: block; color: #d3ccc6; }
.cuenta .grande b { display: inline-block; font-size: 2rem; font-weight: 700; line-height: 1.12; margin-top: 4px; color: var(--ocre); font-variant-numeric: tabular-nums; }
.cuenta .resto { padding: 14px 16px; }
.cuenta .resto > * + * { margin-top: 10px; }

/* ---------- Entrar ---------- */
.entrar { min-height: 100dvh; max-width: 560px; margin: 0 auto; background: var(--gris); }
.entrar .banda { padding: 44px 22px 30px; }
.entrar .banda > * + * { margin-top: 14px; }
.entrar .cuerpo { padding: 24px 22px 32px; }
.entrar .sello { width: 96px; height: 96px; display: block; }
.entrar input.codigo { font-size: 2rem; letter-spacing: .28em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.entrar input.movil { font-size: 1.5rem; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
@media (min-width: 561px) { .entrar { border-inline: var(--borde); } }

.tostada { position: fixed; left: 50%; bottom: calc(var(--barra) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; background: var(--rofe); color: #fff; padding: 12px 18px; border-radius: var(--radio); box-shadow: 0 8px 24px rgba(28, 26, 25, .28); font-weight: 600; width: max-content; max-width: min(92vw, 520px); text-align: center; }
.tostada[hidden] { display: none; }

.ficha > * + * { margin-top: 12px; }
.ficha .pares { border: var(--borde); border-radius: var(--radio); overflow: hidden; background: var(--papel); }
.par { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 14px; }
.par + .par { border-top: var(--borde); }
.par span:first-child { color: var(--piedra); }
.par span:last-child { font-weight: 650; text-align: right; }

/* ---------- La parcela en el SIGPAC (página aparte: /api/sigpac/ver/<código>) ---------- */
.recinto { max-width: 860px; min-height: 100dvh; margin: 0 auto; padding-bottom: 36px; background: var(--gris); }
.recinto .banda { padding: 30px 22px 26px; }
.recinto .banda h1 { margin-top: 6px; font-size: clamp(1.5rem, 7.2vw, 2.7rem); letter-spacing: .01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.recinto .cuerpo { padding: 22px 22px 0; }
.partes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; border: var(--borde); border-radius: var(--radio); overflow: hidden; background: var(--linea); }
.partes div { padding: 10px 14px 12px; background: var(--papel); }
.partes dt { font-size: .86rem; font-weight: 600; color: var(--piedra); }
.partes dd { margin: 0; font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.aerea { margin-inline: 0; }
.aerea .marco { position: relative; overflow: hidden; border: var(--borde); border-radius: var(--radio); background: var(--rofe); }
.aerea img { position: absolute; display: block; max-width: none; }
.aerea svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.aerea path { fill: rgba(217, 154, 43, .22); fill-rule: evenodd; stroke: #f0b548; stroke-width: 3.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.aerea figcaption { margin-top: 8px; font-size: .86rem; color: var(--piedra); }
@media (min-width: 861px) { .recinto { border-inline: var(--borde); } }

@media (min-width: 700px) { :root { font-size: 19px; } }
