/* Dům bez výčitek — territorio «Před omítkou». Sin sombras, sin degradés decorativos, radio 4px.
   Naranja #FF6B1A: una sola cosa por pantalla (el vencimiento más cercano o el total). */
:root {
  --bg: #EDEBE7; --alt: #E1DED8; --card: #F7F6F3; --line: #C9C4BB; --night: #2A2A28;
  --blue: #2E5E8A; --blue-d: #224A6E; --orange: #FF6B1A; --brick: #B9654A; --joint: #8E4A36;
  --ink: #1F1F1D; --body: #3A3936; --mute: #6E6A63; --red: #B3261E;
  --cond: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', Arial, sans-serif;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--body); font-family: 'Source Sans 3', 'Segoe UI', Arial, sans-serif; font-size: 17px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
body.ob { padding-bottom: 0; }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); }
@media (min-width: 600px) { #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }

.bar { position: sticky; top: 0; z-index: 5; min-height: 60px; padding: env(safe-area-inset-top) 18px 0; background: var(--night); color: var(--bg); display: flex; align-items: center; gap: 12px; font-family: var(--cond); font-weight: 700; font-size: 22px; line-height: 1.1; }
.bar .back { background: none; border: 0; color: #A9A59D; font-size: 30px; line-height: 1; padding: 4px 8px 6px 0; cursor: pointer; font-family: inherit; }
.bar .tt { flex: 1; padding: 16px 0; }
.in { padding: 20px 18px 28px; }
.lbl { font-family: var(--cond); font-weight: 600; font-size: 14px; letter-spacing: .10em; text-transform: uppercase; color: var(--mute); margin-bottom: 8px; }
h1 { font-family: var(--cond); font-weight: 700; font-size: 34px; line-height: 1.05; color: var(--ink); margin-bottom: 10px; }
h2 { font-family: var(--cond); font-weight: 700; font-size: 27px; line-height: 1.1; color: var(--ink); margin-bottom: 8px; }
h3 { font-family: var(--cond); font-weight: 700; font-size: 21px; line-height: 1.15; color: var(--ink); margin: 22px 0 8px; }
p { margin-bottom: 12px; }
.mute { color: var(--mute); font-size: 15px; }
.or { color: var(--orange) !important; font-weight: 600; }

/* motivo: la línea del revoque */
.emb { display: inline-block; width: 40px; height: 40px; position: relative; border: 1px solid var(--line); vertical-align: middle;
  background: linear-gradient(135deg, transparent 49.4%, var(--card) 49.6%), repeating-linear-gradient(0deg, var(--joint) 0 1px, transparent 1px 8px), repeating-linear-gradient(90deg, var(--joint) 0 1px, var(--brick) 1px 14px); }
.emb:after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--orange); }

/* onboarding */
.dots { display: flex; gap: 6px; margin: 4px 0 18px; }
.dots i { flex: 1; height: 5px; background: var(--line); }
.dots i.on { background: var(--blue); }
.opt { width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 15px 16px; margin-bottom: 10px; font: inherit; font-size: 18px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 12px; cursor: pointer; }
.opt small { display: block; font-weight: 400; font-size: 14.5px; color: var(--mute); }
.opt .r { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--blue); flex: 0 0 22px; }
.opt.multi .r { border-radius: 3px; }
.opt.sel { border: 2px solid var(--blue); padding: 14px 15px; }
.opt.sel .r { background: radial-gradient(var(--blue) 0 45%, var(--card) 50%); }
.opt.multi.sel .r { background: var(--blue); box-shadow: inset 0 0 0 4px var(--card); }

.btn { display: block; width: 100%; background: var(--blue); border: 0; border-bottom: 3px solid var(--blue-d); color: var(--card); text-align: center; font: inherit; font-weight: 600; font-size: 18px; padding: 14px; border-radius: 4px; margin-top: 14px; cursor: pointer; text-decoration: none; }
.btn:active { background: var(--blue-d); }
.btn.o { background: var(--card); color: var(--blue); border: 1px solid var(--blue); border-bottom: 3px solid var(--blue); }
.btn.sm { display: inline-block; width: auto; font-size: 15.5px; padding: 9px 14px; margin-top: 8px; }
.btn[disabled] { opacity: .45; }
.link { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0; }

/* fases */
.ph { width: 100%; text-align: left; font: inherit; display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 11px 14px; margin-bottom: 7px; cursor: pointer; color: inherit; }
.ph b { font-family: var(--cond); font-weight: 700; font-size: 22px; color: var(--ink); width: 30px; flex: 0 0 30px; }
.ph .t { flex: 1; font-size: 16.5px; font-weight: 600; color: var(--ink); }
.ph .t small { display: block; font-weight: 400; font-size: 13.5px; color: var(--mute); }
.ph .p { width: 64px; height: 6px; background: var(--line); position: relative; flex: 0 0 64px; }
.ph .p i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--blue); }
.ph.cur { border: 2px solid var(--ink); padding: 10px 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); display: inline-block; margin-left: 4px; }

/* tarjetas */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 13px 14px; margin-bottom: 9px; display: flex; gap: 12px; align-items: flex-start; }
.card .body { flex: 1; cursor: pointer; min-width: 0; }
.ck { width: 26px; height: 26px; border: 2px solid var(--blue); border-radius: 3px; flex: 0 0 26px; margin-top: 1px; background: var(--card); cursor: pointer; }
.ck.on { background: var(--blue); box-shadow: inset 0 0 0 4px var(--card); }
.card .t { font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.card.done .t { color: var(--mute); text-decoration: line-through; text-decoration-color: var(--line); }
.card .d { font-size: 14px; color: var(--mute); margin-top: 3px; }
.card .n { font-size: 14px; color: var(--body); margin-top: 4px; font-style: italic; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 14px; margin: 12px 0; }
.box.night { background: var(--night); color: #D6D3CD; border-color: var(--night); }
.box.night b { color: var(--bg); }
.box.warn { border-left: 4px solid var(--brick); }

/* detalle */
.sec { border-top: 1px solid var(--line); padding: 12px 0; }
.sec .lbl { margin-bottom: 3px; }
.sec p { margin: 0; font-size: 16.5px; }
textarea, input[type=text], input[type=search], select { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--card); border: 1px dashed var(--line); border-radius: 4px; padding: 10px; }
textarea { min-height: 76px; resize: vertical; }
input[type=search], select { border-style: solid; }
.chip { display: inline-block; background: var(--alt); border-radius: 3px; padding: 3px 9px; font-size: 13px; font-weight: 600; color: var(--body); margin: 0 6px 6px 0; }

/* kalkulačka */
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 16.5px; }
.row input { width: 112px; flex: 0 0 112px; text-align: right; border-style: solid; font-weight: 600; padding: 6px 8px; }
.tot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 16px; }
.tot .n { font-family: var(--cond); font-weight: 700; font-size: 50px; line-height: 1; color: var(--orange); white-space: nowrap; }

/* listas varias */
.li { width: 100%; text-align: left; font: inherit; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 14px; margin-bottom: 8px; color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; }
.li small { display: block; font-weight: 400; color: var(--mute); font-size: 14px; }
.li:after { content: "›"; color: var(--mute); font-size: 24px; line-height: 1; }
.empty { color: var(--mute); padding: 14px 0; }

/* navegación inferior */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; z-index: 10; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; min-width: 0; white-space: nowrap; background: none; border: 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--mute); padding: 8px 2px 9px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.tabs button.on { color: var(--blue); }
.ic { width: 22px; height: 22px; display: block; border: 2px solid currentColor; border-radius: 3px; position: relative; }
.ic-stavba { border-radius: 0; border-width: 2px 2px 2px 2px; background: linear-gradient(135deg, transparent 48%, currentColor 48% 56%, transparent 56%); }
.ic-tyden:after { content: ""; position: absolute; left: 3px; right: 3px; top: 4px; height: 2px; background: currentColor; box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor; }
.ic-schuzka { border-radius: 50%; }
.ic-schuzka:after { content: ""; position: absolute; left: 8px; top: 3px; width: 2px; height: 8px; background: currentColor; box-shadow: 3px 6px 0 -0px transparent; }
.ic-kalk:after { content: "="; position: absolute; inset: 0; text-align: center; font-weight: 700; font-size: 16px; line-height: 17px; }
.ic-vice { border: 0; }
.ic-vice:after { content: "···"; position: absolute; inset: 0; text-align: center; font-weight: 700; font-size: 22px; line-height: 12px; letter-spacing: 1px; }

.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--night); color: var(--bg); padding: 10px 16px; border-radius: 4px; font-size: 15px; z-index: 20; max-width: 90%; text-align: center; }

/* imprimir (Kontrola pozemku) */
@media print {
  body { padding: 0; background: #fff; }
  .tabs, .bar .back, .noprint, .toast { display: none !important; }
  .bar { position: static; background: #fff; color: #000; border-bottom: 2px solid #000; }
  #app { max-width: none; border: 0; background: #fff; }
  .card { break-inside: avoid; }
}
