/* Layout: una columna de trabajo (máx. 760px) pensada para iPhone; cabecera fija con rol y navegación; el informe se compone como una hoja. */
:root {
  --bg: #eef3f4;
  --surface: #ffffff;
  --surface-2: #f5f8f9;
  --ink: #13242c;
  --muted: #55666e;
  --line: #d3dde0;
  --accent: #0f5fa8;
  --accent-ink: #ffffff;
  --accent-soft: #e2edf8;
  --ok: #17794a;
  --ok-soft: #def3e7;
  --warn: #8f5200;
  --warn-soft: #fcefd9;
  --bad: #b3261e;
  --bad-soft: #fbe4e1;
  --info: #5a49b0;
  --info-soft: #ece9fa;
  --neutral: #5f6f76;
  --neutral-soft: #e7edef;
  --shadow: 0 1px 2px rgba(19, 36, 44, .06), 0 4px 14px rgba(19, 36, 44, .06);
  --font-display: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d161a; --surface: #15232a; --surface-2: #1b2c34; --ink: #e4eef1; --muted: #9db0b7; --line: #2c414a;
    --accent: #66adf0; --accent-ink: #07131b; --accent-soft: #17324a;
    --ok: #55c98f; --ok-soft: #143327; --warn: #f0b552; --warn-soft: #3a2a10; --bad: #f28a80; --bad-soft: #3e1c19;
    --info: #ad9ff4; --info-soft: #28223f; --neutral: #9db0b7; --neutral-soft: #22333b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d161a; --surface: #15232a; --surface-2: #1b2c34; --ink: #e4eef1; --muted: #9db0b7; --line: #2c414a;
  --accent: #66adf0; --accent-ink: #07131b; --accent-soft: #17324a;
  --ok: #55c98f; --ok-soft: #143327; --warn: #f0b552; --warn-soft: #3a2a10; --bad: #f28a80; --bad-soft: #3e1c19;
  --info: #ad9ff4; --info-soft: #28223f; --neutral: #9db0b7; --neutral-soft: #22333b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5; overflow-x: hidden; }
body.modal-open { overflow: hidden; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: .005em; }
h1 { font-size: 1.85rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.12rem; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .88rem; }
.err { color: var(--bad); font-size: .9rem; font-weight: 700; }
.label, .eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.eyebrow { color: var(--accent); }
.sub { color: var(--muted); font-size: .92rem; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-s { display: flex; flex-direction: column; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.ico { flex: none; }

/* Cabecera */
.topbar { position: relative; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; max-width: 760px; width: 100%; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: .01em; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; border-radius: 999px; min-height: 38px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.tabs { display: flex; gap: 2px; }
.tabs button { border: 0; background: transparent; min-height: 44px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.demo-note { display: flex; gap: 8px; align-items: flex-start; font-size: .82rem; color: var(--warn); background: var(--warn-soft); margin: 0 -16px; padding: 7px 16px; }
.demo-note > span { max-width: 728px; }
.demo-note .ico { margin-top: 2px; }
@media (max-width: 430px) {
  .tabs button span { font-size: .9rem; }
  .tabs button { padding: 0 7px; }
  .seg button { padding: 0 11px; }
}

.wrap { max-width: 760px; margin: 0 auto; padding-inline: 16px; padding-block: 18px 96px; }

@media (min-width: 700px) and (min-height: 700px) { .topbar { position: sticky; top: env(safe-area-inset-top, 0px); } }
@media (max-width: 599px) {
  .photo-grid.edit { grid-template-columns: 1fr; }
  .photo-grid.edit .photo { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: start; }
}
/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; text-align: center; line-height: 1.2; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.btn-ghost-danger { color: var(--bad); border-color: transparent; background: transparent; }
.btn-ghost-danger:hover { border-color: var(--bad); }
.btn-small { min-height: 40px; padding: 0 12px; font-size: .92rem; }
.icon-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--r); border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { border-color: var(--line); color: var(--ink); }
.icon-btn.danger:hover { color: var(--bad); border-color: var(--bad); }
.back { align-self: flex-start; border: 0; background: none; color: var(--accent); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0; cursor: pointer; }
.action-bar { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 520px) { .action-bar > .btn { flex: 1 1 100%; } }

/* Tarjetas, avisos y estados */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; box-shadow: var(--shadow); min-width: 0; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); border: 1px solid currentColor; align-items: flex-start; }
.notice > .ico { margin-top: 2px; }
.notice > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--ink); }
.notice ul { list-style: disc; padding-left: 20px; }
.notice.tone-info { color: var(--info); background: var(--info-soft); }
.notice.tone-ok { color: var(--ok); background: var(--ok-soft); }
.notice.tone-warn { color: var(--warn); background: var(--warn-soft); }
.notice.tone-bad { color: var(--bad); background: var(--bad-soft); }
.quote { font-style: italic; font-size: 1.05rem; }
.badge, .chip, .rtag, .itag { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.badge { padding: 4px 10px; font-size: .85rem; }
.chip { padding: 3px 9px; font-size: .8rem; }
.rtag { padding: 2px 9px; font-size: .84rem; }
.itag { padding: 2px 9px; font-size: .82rem; color: var(--warn); background: var(--warn-soft); border-radius: 6px; }
.tone-accent { color: var(--accent); background: var(--accent-soft); }
.tone-ok { color: var(--ok); background: var(--ok-soft); }
.tone-warn { color: var(--warn); background: var(--warn-soft); }
.tone-bad { color: var(--bad); background: var(--bad-soft); }
.tone-info { color: var(--info); background: var(--info-soft); }
.tone-neutral { color: var(--neutral); background: var(--neutral-soft); }
.tone-muted { color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field > label, .field > legend, .label-like { font-weight: 700; padding: 0; }
.req { color: var(--bad); }
.opt { color: var(--muted); font-weight: 400; font-size: .88rem; }
input:not([type="radio"]):not([type="checkbox"]):not([type="file"]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 16px; min-width: 0;
}
textarea { resize: vertical; line-height: 1.45; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
.has-error input, .has-error textarea, input.invalid { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.readonly-text { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Lista */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filters { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .filters { grid-template-columns: 1fr 230px; } }
.search { position: relative; display: block; }
.search .ico { position: absolute; left: 12px; top: 14px; color: var(--muted); }
.search input { padding-left: 40px !important; }
.job-list { display: flex; flex-direction: column; gap: 12px; }
.job-card { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow); }
.job-card:hover { border-color: var(--accent); }
.job-card.is-returned { border-color: var(--info); box-shadow: inset 4px 0 0 var(--info), var(--shadow); }
.job-card.is-closed { background: var(--surface-2); box-shadow: none; }
.job-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.ref { font-family: var(--font-mono); font-weight: 500; font-size: .92rem; letter-spacing: .02em; color: var(--muted); }
.job-client { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; overflow-wrap: anywhere; }
.job-addr { color: var(--ink); overflow-wrap: anywhere; }
.job-date { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.job-card .chips { margin-top: 6px; }
.job-go { margin-top: 6px; color: var(--accent); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; align-self: flex-end; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* Editor */
.template { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--surface-2); }
.toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; }
.toggle.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.room-edit-list { display: flex; flex-direction: column; gap: 14px; }
.room-edit { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.room-edit-head { display: flex; gap: 8px; align-items: flex-end; }
.room-edit-head .field { flex: 1; }
.task-edit-list { display: flex; flex-direction: column; gap: 8px; }
.task-edit { display: flex; gap: 6px; align-items: center; }
.task-edit input { flex: 1; }

/* Detalle */
.job-head { display: flex; flex-direction: column; gap: 4px; }
.job-head h1 { overflow-wrap: anywhere; }
.counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.counters > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: .8rem; color: var(--muted); }
.counters .num { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.h-section { font-size: 1.15rem; }
.room-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.room-tabs button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 52px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; text-align: left; }
.room-tabs button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.room-tab-meta { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); font-weight: 400; }
.scroll-anchor { scroll-margin-top: 16px; }
@media (min-width: 700px) and (min-height: 700px) { .scroll-anchor { scroll-margin-top: 190px; } }
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.task.result-sin_evaluar { border-style: dashed; }
.task.result-no_realizada { border-color: var(--bad); }
.task-name { font-weight: 700; overflow-wrap: anywhere; }
.result-sel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 600px) { .result-sel { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.result-sel .opt { min-height: 44px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-weight: 700; font-size: .9rem; padding: 0 6px; }
.result-sel .opt.on { border-width: 2px; }
.result-sel .opt.on.tone-ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok); }
.result-sel .opt.on.tone-bad { color: var(--bad); background: var(--bad-soft); border-color: var(--bad); }
.result-sel .opt.on.tone-muted { color: var(--ink); background: var(--neutral-soft); border-color: var(--neutral); }
.result-sel .opt.on.tone-neutral { color: var(--ink); background: var(--surface-2); border-color: var(--neutral); }
.inc-list { display: flex; flex-direction: column; gap: 10px; }
.inc { border-left: 3px solid var(--warn); background: var(--surface-2); padding: 10px 12px; border-radius: 0 10px 10px 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; overflow-wrap: anywhere; }
.inc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.missing { list-style: none !important; padding: 0 !important; display: flex; flex-direction: column; gap: 10px; margin: 6px 0; }
.missing > li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface); border-radius: 10px; padding: 10px 12px; }
.missing ul { list-style: disc; padding-left: 18px; font-size: .92rem; }
.summary-box { background: var(--surface-2); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.summary-box ul { list-style: disc; padding-left: 18px; }
.radio-cards { display: flex; flex-direction: column; gap: 8px; }
.radio-card { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.radio-card.on { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { width: 20px; height: 20px; accent-color: var(--accent); }
.history summary { cursor: pointer; font-weight: 700; min-height: 30px; }
.history ol { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.history li { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; }
.history .h-at { color: var(--muted); font-variant-numeric: tabular-nums; grid-row: span 2; }
.history .h-role { color: var(--muted); font-size: .8rem; }
.history h3 { margin-top: 14px; }
.comments { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.ro-tasks { display: flex; flex-direction: column; }
.ro-tasks li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ro-tasks li span:first-child { min-width: 0; overflow-wrap: anywhere; }

/* Fotos */
.upload { display: flex; flex-direction: column; gap: 6px; }
.upload .btn { align-self: flex-start; }
.loading { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 700; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 600px) { .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.photo-grid.small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.photo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.thumb { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 0; overflow: hidden; aspect-ratio: 4 / 3; max-width: 100%; background: var(--surface-2); cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sample-tag { position: absolute; top: 6px; left: 6px; background: var(--warn-soft); color: var(--warn); font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; letter-spacing: .05em; }
.photo-fields { display: flex; flex-direction: column; gap: 6px; }
.photo-fields input, .photo-fields select { min-height: 42px; font-size: 16px; padding: 8px 10px; }
.caption { font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }
.viewer { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.viewer img { width: 100%; max-height: 70vh; object-fit: contain; background: var(--surface-2); border-radius: 8px; }
.viewer figcaption { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* Modal y toast */
.overlay { position: fixed; inset: 0; background: rgba(8, 18, 24, .55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; padding: 12px; padding-top: max(12px, env(safe-area-inset-top, 0px)); }
@media (min-width: 600px) { .overlay { align-items: center; } }
.modal { background: var(--surface); color: var(--ink); width: 100%; max-width: 520px; max-height: 92vh; border-radius: 16px; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.modal-wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 12px 8px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.25rem; overflow-wrap: anywhere; }
.modal-body { padding: 16px 18px; overflow-y: auto; overflow-wrap: anywhere; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
@media (max-width: 520px) { .modal-foot .btn { flex: 1 1 40%; } }
.toast-area { position: fixed; left: 0; right: 0; bottom: 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; pointer-events: none; z-index: 60; }
.toast { pointer-events: auto; display: flex; gap: 8px; align-items: flex-start; max-width: 520px; padding: 12px 14px; border-radius: 12px; border: 1px solid currentColor; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); font-weight: 700; }
.toast > span, .toast { overflow-wrap: anywhere; }

/* Ayuda */
.help-steps { display: flex; flex-direction: column; gap: 12px; }
.help-steps li { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.help-steps h2 { font-size: 1.2rem; margin-bottom: 4px; }
.step-n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.bullets { list-style: disc; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Ajustes */
.logo-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.logo { width: 72px; height: 72px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.logo-empty { display: grid; place-items: center; font-size: .8rem; color: var(--muted); }

/* Informe */
.report { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 22px 18px; display: flex; flex-direction: column; gap: 20px; box-shadow: var(--shadow); min-width: 0; }
.provisional { display: flex; gap: 8px; align-items: center; color: var(--warn); background: var(--warn-soft); border: 2px dashed var(--warn); padding: 8px 12px; border-radius: 8px; font-weight: 700; text-transform: uppercase; font-size: .85rem; letter-spacing: .04em; }
.report-head { display: flex; gap: 14px; align-items: center; border-bottom: 2px solid var(--ink); padding-bottom: 14px; }
.report-head .logo { width: 64px; height: 64px; }
.company { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; overflow-wrap: anywhere; }
.company-contact { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.report-title { font-size: 1.6rem; }
.meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
.meta > div { min-width: 0; }
.meta dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.meta dd { margin: 2px 0 0; overflow-wrap: anywhere; }
@media (max-width: 430px) { .meta { grid-template-columns: 1fr; } }
.report-sec { display: flex; flex-direction: column; gap: 10px; }
.report-sec h2 { font-size: 1.2rem; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.report-sec ul { list-style: disc; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.pend { background: var(--bad-soft); border: 1px solid var(--bad); border-radius: 10px; padding: 14px; }
.pend h2 { border-color: var(--bad); color: var(--bad); }
.ok-line, .warn-line { display: flex; gap: 6px; align-items: center; font-weight: 700; }
.ok-line { color: var(--ok); }
.warn-line { color: var(--warn); }
.report-room { display: flex; flex-direction: column; gap: 6px; break-inside: avoid; }
.report-room table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.report-room th, .report-room td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.report-room .col-result { width: 1%; white-space: nowrap; padding-left: 10px; }
.report-room th { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.report-inc { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.report-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.report-photos figure { margin: 0; break-inside: avoid; display: flex; flex-direction: column; gap: 4px; }
.report-photos img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; background: var(--surface-2); border-radius: 6px; border: 1px solid var(--line); }
.photo-missing { display: grid; place-items: center; aspect-ratio: 4 / 3; max-width: 100%; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); font-size: .85rem; }
.report-photos figcaption { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.report-close { break-inside: avoid; }
.report-foot { border-top: 2px solid var(--ink); padding-top: 10px; font-size: .85rem; font-weight: 700; }

@media print {
  :root, :root[data-theme="dark"] {
    --bg: #ffffff; --surface: #ffffff; --surface-2: #f4f6f7; --ink: #000000; --muted: #444444; --line: #bbbbbb;
    --ok: #0f6b3e; --ok-soft: #e6f4ec; --warn: #7a4600; --warn-soft: #fbf0dc; --bad: #a11c15; --bad-soft: #fbe8e6;
    --info: #4a3c99; --info-soft: #eeebfa; --accent: #0f5fa8; --accent-soft: #e5eef8; --neutral: #444; --neutral-soft: #eee;
    color-scheme: light;
  }
  @page { margin: 14mm 12mm; }
  body { background: #fff; font-size: 11pt; }
  .no-print, .topbar, .toast-area, .overlay, .back, .action-bar, button.icon-btn { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  /* Bloques en flujo normal: Chromium fragmenta mal los contenedores flex entre páginas. */
  .wrap, .wrap > .stack, #root { display: block; }
  .report { display: block; border: 0; box-shadow: none; padding: 0; }
  .report > * + * { margin-top: 12pt; }
  .report-sec, .report-room { display: block; }
  .report-sec > * + *, .report-room > * + * { margin-top: 6pt; }
  .report-room { break-inside: avoid; }
  .report-room table { font-size: 10pt; }
  .report-room .col-result { width: 1%; white-space: nowrap; }
  .rtag, .itag, .badge { border: 1px solid currentColor; }
  .report-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8pt; }
  .report-photos figure { break-inside: avoid; }
  .report-photos img { max-height: 90mm; width: 100%; height: auto; object-fit: contain; }
  .report-sec h2, .report-room h3 { break-after: avoid; }
  .pend, .report-close { break-inside: avoid; }
  .report-foot { break-before: avoid; break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Piloto: sesión, guardado automático y carga de imágenes privadas */
.who { font-size: .9rem; min-width: 0; overflow-wrap: anywhere; }
.auth { max-width: 460px; display: flex; flex-direction: column; gap: 16px; }
.auth-brand { padding-top: 12px; }
.save-state { font-size: .8rem; color: var(--muted); min-height: 1.2em; }
.save-state.saved { color: var(--ok); }
.save-state.error { color: var(--bad); font-weight: 700; }
.thumb-loading { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); font-size: .8rem; }
.linklike { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 700; text-decoration: underline; cursor: pointer; font-size: inherit; }
.save-summary { display: flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); min-height: 1.4em; flex-wrap: wrap; }
.save-summary.saved { color: var(--ok); }
.save-summary.error { color: var(--bad); font-weight: 700; }
.save-summary .spinner { width: 14px; height: 14px; border-width: 2px; }
.task.save-error { border-color: var(--bad); border-style: solid; box-shadow: 0 0 0 1px var(--bad); }
.unsaved-dot { color: var(--bad); font-weight: 700; }
.thumb-state { display: grid; place-items: center; gap: 6px; padding: 8px; text-align: center; font-size: .82rem; color: var(--muted); cursor: default; }
.thumb-state.photo-error { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.photo-missing.photo-error { color: var(--bad); border-color: var(--bad); }
