:root {
  --accent: #285247;
  --accent-dark: #16362e;
  --accent-soft: #e7f0ec;
  --accent-pale: #f2f7f4;
  --highlight: #eff166;
  --ink: #1f2933;
  --muted: #66737f;
  --surface: #ffffff;
  --background: #f4f6f8;
  --border: #dce2e7;
  --danger: #a92d2d;
  --success: #247044;
  --space-page-inline: 1rem;
  --space-card: 1rem;
  --touch-target: 2.75rem;
  color: var(--ink);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}
html { min-height: 100%; background: var(--background); }
body { min-height: 100vh; min-height: 100dvh; margin: 0; padding-bottom: 5rem; background: var(--background); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 100;
  border-radius: .5rem;
  background: white;
  padding: .75rem 1rem;
}
.skip-link:focus { top: .75rem; }

.offline-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #7a4b00;
  padding: .45rem 1rem;
  color: white;
  font-size: .8rem;
  font-weight: 800;
  text-align: center;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 3.8rem;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .96);
  padding: .5rem max(var(--space-page-inline), env(safe-area-inset-left));
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: none;
}
.brand img { flex: 0 0 auto; border-radius: .65rem; }
.header-actions { display: flex; align-items: center; gap: .25rem; }
.header-actions form { margin: 0; }
.workspace-badge {
  display: none;
  border-radius: 999px;
  background: var(--accent-soft);
  padding: .35rem .65rem;
  color: var(--accent-dark);
  font-size: .75rem;
  font-weight: 800;
}
.link-button {
  appearance: none;
  min-height: var(--touch-target);
  border: 0;
  background: transparent;
  padding: .55rem .65rem;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.preventive-map-shell {
  position: relative;
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #dfe6e8;
  box-shadow: 0 5px 20px rgba(31, 41, 51, .08);
}
.preventive-map { width: 100%; height: min(64vh, 38rem); min-height: 25rem; }
.preventive-map.leaflet-touch .leaflet-bar a {
  width: var(--touch-target);
  height: var(--touch-target);
  line-height: var(--touch-target);
}
.preventive-map-overlay-controls { position: absolute; z-index: 800; inset: 0; pointer-events: none; }
.preventive-map-floating-control { position: absolute; z-index: 1; top: .75rem; right: .75rem; width: auto; max-width: min(22rem, calc(100% - 5rem)); pointer-events: auto; }
.preventive-map-floating-control > summary { display: flex; width: max-content; max-width: 100%; align-items: center; gap: .45rem; border: 1px solid rgba(79, 91, 99, .35); border-radius: .7rem; background: rgba(255, 255, 255, .96); padding: .55rem .7rem; box-shadow: 0 4px 16px rgba(31, 41, 51, .18); font-size: .78rem; font-weight: 850; cursor: pointer; list-style: none; }
.preventive-map-floating-control > summary::-webkit-details-marker { display: none; }
.preventive-map-floating-control[open] { width: min(20rem, calc(100% - 5rem)); }
.preventive-map-floating-control[open] > summary { margin-left: auto; border-radius: .7rem .7rem 0 0; border-bottom-color: transparent; }
.preventive-map-layer-controls { display: grid; width: 100%; min-width: 0; max-height: min(55vh, 26rem); overflow-y: auto; grid-template-columns: 1fr; gap: .45rem; margin: 0; border: 1px solid rgba(79, 91, 99, .35); border-radius: .7rem 0 .7rem .7rem; background: rgba(255, 255, 255, .98); padding: .65rem; box-shadow: 0 8px 24px rgba(31, 41, 51, .2); }
.preventive-map-layer-controls legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.preventive-map-layer-toggle { display: inline-flex; min-width: 0; max-width: 100%; min-height: 2.7rem; align-items: center; gap: .4rem; margin: 0; border: 1px solid var(--border); border-radius: 999px; background: white; padding: .45rem .7rem; font-size: .78rem; line-height: 1.15; overflow-wrap: anywhere; cursor: pointer; }
.preventive-map-layer-toggle:has(input:disabled) { opacity: .55; cursor: default; }
.preventive-map-layer-toggle input { width: 1rem; height: 1rem; min-height: 1rem; margin: 0; accent-color: var(--accent); }
.preventive-map-layer-toggle > span { display: inline-grid; width: 1.7rem; height: 1.7rem; flex: 0 0 auto; place-items: center; border-radius: 50%; color: white; background: #64748b; font-size: .65rem; font-weight: 900; }
.preventive-map-layer-toggle.planned > span { background: #a75d00; }
.preventive-map-layer-toggle.active > span { background: #19578b; }
.preventive-map-layer-toggle.submitted > span { background: #72508f; }
.preventive-map-layer-toggle.validated > span { background: var(--success); }
.preventive-map-status { margin: .5rem .2rem 1rem; }
.preventive-map-list { margin-top: 1rem; }
.preventive-map-symbol {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #64748b;
  font-size: .72rem;
  font-weight: 900;
}
.preventive-map-symbol.planned { background: #a75d00; }
.preventive-map-symbol.active { background: #19578b; }
.preventive-map-symbol.submitted { background: #72508f; }
.preventive-map-symbol.validated { background: var(--success); }
.preventive-map-symbol.has-findings { box-shadow: 0 0 0 3px #c73535, 0 2px 8px rgba(31, 41, 51, .3); }
.preventive-map-pin { display: grid !important; place-items: center; border: 0; background: transparent; }
.preventive-map-pin > span { position: relative; display: grid; width: 34px; height: 34px; place-items: center; border: 3px solid white; border-radius: 50%; color: white; background: #64748b; font-size: .68rem; font-weight: 900; box-shadow: 0 2px 8px rgba(31, 41, 51, .38); }
.preventive-map-pin.planned > span { background: #a75d00; }
.preventive-map-pin.active > span { background: #19578b; }
.preventive-map-pin.submitted > span { background: #72508f; }
.preventive-map-pin.validated > span { background: var(--success); }
.preventive-map-pin.has-findings > span { box-shadow: 0 0 0 4px #c73535, 0 3px 10px rgba(31, 41, 51, .45); }
.preventive-map-pin.severity-major > span { box-shadow: 0 0 0 4px #c08012, 0 3px 10px rgba(31, 41, 51, .45); }
.preventive-map-pin.severity-minor > span { box-shadow: 0 0 0 4px #57788d, 0 3px 10px rgba(31, 41, 51, .45); }
.preventive-map-pin i { position: absolute; top: -10px; right: -10px; display: grid; min-width: 20px; height: 20px; place-items: center; border: 2px solid white; border-radius: 999px; background: #9f2525; padding: 0 4px; color: white; font-size: 10px; font-style: normal; line-height: 1; box-shadow: 0 2px 5px rgba(31, 41, 51, .35); }
.preventive-map-pin.severity-major i { background: #9a6200; }
.preventive-map-pin.severity-minor i { background: #45697e; }
.preventive-map-popup { display: grid; min-width: 12rem; gap: .3rem; }
.preventive-map-popup strong { color: var(--ink); font-size: .92rem; }
.preventive-map-popup span { color: var(--muted); font-size: .78rem; }
.preventive-map-popup a { margin-top: .2rem; color: var(--accent-dark); font-weight: 850; }
.preventive-map-finding-summary { display: grid; gap: .18rem; margin-top: .35rem; border-left: 4px solid #c73535; border-radius: .55rem; background: #fff2f2; padding: .55rem .65rem; }
.preventive-map-finding-summary.severity-major { border-left-color: #c08012; background: #fff7e5; }
.preventive-map-finding-summary.severity-minor { border-left-color: #57788d; background: #eef5f8; }
.preventive-map-finding-summary strong { font-size: .8rem; }
.preventive-map-finding-summary a { margin-top: .1rem; font-size: .78rem; }
.preventive-map-finding-line { color: #842424 !important; font-weight: 800; }
.finding-map-scope { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .8rem; padding: .75rem .85rem; }
.finding-map-scope > span { display: flex; min-width: 0; flex-direction: column; gap: .15rem; }
.finding-map-scope small { color: var(--muted); }
.page-shell.wide-map-page { width: min(100%, 72rem); }

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  border-top: 1px solid var(--border);
  background: white;
  padding: .3rem max(.5rem, env(safe-area-inset-right)) max(.3rem, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 18px rgba(0, 0, 0, .06);
}
.bottom-nav a {
  display: flex;
  min-width: 0;
  min-height: var(--touch-target);
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .08rem;
  padding: .2rem;
  color: #48545e;
  font-size: .68rem;
  font-weight: 700;
  text-decoration: none;
}
.bottom-nav span { color: var(--accent); font-size: 1.2rem; line-height: 1; }

.page-shell { width: min(100%, 52rem); min-width: 0; max-width: 100%; margin: 0 auto; padding: .9rem var(--space-page-inline) 1.5rem; }
.page-shell > * { min-width: 0; max-width: 100%; }

h1 { margin: .1rem 0 .5rem; font-size: clamp(1.5rem, 1.2rem + 1.35vw, 2rem); line-height: 1.08; }
h2 { margin: .3rem 0 .5rem; font-size: 1.08rem; line-height: 1.2; }
h3 { margin: .25rem 0 .4rem; font-size: 1rem; }
h1, h2, h3, .task-main, .page-heading { overflow-wrap: anywhere; }
p { line-height: 1.42; }
.muted, .lead, .help-text { color: var(--muted); }
.lead { margin: 0; }
.eyebrow {
  color: var(--accent-dark);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow a { text-decoration: none; }

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .9rem;
}
.hero > div, .page-heading > div { min-width: 0; }
.hero p, .page-heading p { margin: .35rem 0 0; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; margin-bottom: .85rem; }
.page-heading.compact { margin-bottom: .85rem; }
.page-heading h1 { margin-bottom: .5rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.workspace-section { margin-bottom: 1rem; }

.panel, .auth-card, .empty-state, .compact-task-list, .model-form, .table-wrap {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 5px 20px rgba(31, 41, 51, .05);
}

.auth-card { max-width: 28rem; margin: 4vh auto 0; padding: 1.25rem; }
.auth-card .muted { margin: .3rem 0 .8rem; }
.configuration-scope-note { margin-top: 1rem; padding: 1rem; }
.configuration-scope-note h2 { margin: .35rem 0; font-size: 1.15rem; }
.configuration-scope-note p { margin: .35rem 0 .8rem; color: var(--muted); }
.stacked-form { display: grid; gap: .65rem; }

.next-step-card {
  margin-bottom: .8rem;
  border: 1px solid #9ec0b2;
  border-radius: 1rem;
  background: linear-gradient(160deg, #fff, var(--accent-pale));
  padding: 1rem;
  box-shadow: 0 8px 28px rgba(22, 54, 46, .08);
}
.next-step-card h2 { margin-top: .55rem; font-size: 1.17rem; }
.next-step-card p { margin: .35rem 0; }
.next-step-card.ready-card { border-color: #a9cfb7; background: linear-gradient(160deg, #fff, #edf8f1); }
.ready-mark {
  display: inline-grid;
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 2.4rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 1.3rem;
  font-weight: 900;
}

.compact-task-list { overflow: hidden; }
.pass-list-empty { padding: 1rem; }
.pass-list-empty p { margin: .25rem 0 0; color: var(--muted); }
.internal-reference { margin: -.45rem 0 1.25rem; color: var(--muted); font-size: .78rem; }
.task-row {
  display: flex;
  min-height: 4.25rem;
  align-items: center;
  gap: .7rem;
  border-bottom: 1px solid var(--border);
  padding: .65rem .8rem;
  text-decoration: none;
}
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #f9fbfa; }
.task-row > span:last-child { margin-left: auto; color: var(--accent); font-size: 1.4rem; }
.task-main { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: .2rem; }
.task-main strong { line-height: 1.25; }
.task-main small { color: var(--muted); line-height: 1.35; }
.task-count {
  display: inline-grid;
  min-width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: .75rem;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 900;
}
.task-count.neutral { background: #e2f1fc; color: #19578b; }
.task-count.quiet { background: #edf0f2; color: #53606a; }
.asset-kind-mark {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: .75rem;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 900;
}
.asset-kind-mark.quiet { background: #edf0f2; color: #53606a; }

.all-clear { display: flex; align-items: center; gap: .75rem; padding: .9rem; text-align: left; }
.all-clear div { display: flex; flex-direction: column; gap: .2rem; }
.all-clear h3, .all-clear p { margin: 0; }
.all-clear p, .all-clear small { color: var(--muted); }
.tools-panel { margin-top: .8rem; border: 1px solid var(--border); border-radius: 1rem; background: white; padding: .85rem; }
.tools-panel > summary { cursor: pointer; font-weight: 850; }
.tools-panel[open] > summary { margin-bottom: .8rem; }
details > summary { display: flex; min-height: var(--touch-target); align-items: center; box-sizing: border-box; }
.context-help { width: fit-content; max-width: min(100%, 52rem); margin: .5rem 0 .85rem; border: 1px solid transparent; border-radius: .75rem; }
.context-help > summary { display: inline-flex; min-height: var(--touch-target); align-items: center; gap: .42rem; border-radius: .65rem; padding: .35rem .55rem; color: var(--accent-dark); font-size: .74rem; font-weight: 850; cursor: pointer; list-style: none; }
.context-help > summary::-webkit-details-marker { display: none; }
.context-help > summary:hover, .context-help > summary:focus-visible { background: var(--accent-pale); }
.context-help > summary > span { display: inline-grid; width: 1.35rem; height: 1.35rem; flex: 0 0 1.35rem; place-items: center; border-radius: 50%; background: var(--accent); color: white; font-size: .72rem; }
.context-help[open] { width: 100%; border-color: #b8d5ca; background: var(--accent-pale); }
.context-help[open] > summary { border-bottom-right-radius: 0; border-bottom-left-radius: 0; }
.context-help-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; border-top: 1px solid #c8ddd5; padding: .65rem .75rem .75rem; }
.context-help-body p { display: flex; min-width: 0; flex-direction: column; gap: .12rem; margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.context-help-body strong { color: var(--accent-dark); font-size: .68rem; letter-spacing: .035em; text-transform: uppercase; }
.field-help { margin: 0; color: var(--muted); font-size: .86rem; }
.tool-link-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.tool-link-grid a { display: flex; min-width: 0; flex-direction: column; gap: .2rem; border: 1px solid var(--border); border-radius: .75rem; padding: .8rem; text-decoration: none; }
.tool-link-grid a:hover { border-color: #9eb9ae; background: var(--accent-pale); }
.tool-link-grid small { color: var(--muted); }
.offline-state { display: block; max-width: 36rem; margin: 8vh auto 0; padding: 2rem; text-align: center; }
.offline-state p { color: var(--muted); }
.empty-symbol { display: grid; width: 2.8rem; height: 2.8rem; margin: 0 auto .8rem; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-weight: 900; }

label { margin-top: .35rem; font-weight: 750; }
.field { display: flex; min-width: 0; flex-direction: column; gap: .35rem; }
.field label { font-size: .84rem; }
input, select, textarea {
  width: 100%;
  min-height: var(--touch-target);
  border: 1px solid #abb6bf;
  border-radius: .65rem;
  background: white;
  padding: .65rem .7rem;
  color: var(--ink);
  font: inherit;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 3px solid rgba(40, 82, 71, .2); }
.help-text { margin: 0; font-size: .8rem; line-height: 1.4; }
.errorlist { margin: 0; padding-left: 1.2rem; color: var(--danger); font-size: .82rem; }

.button {
  display: inline-flex;
  min-height: var(--touch-target);
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: .7rem;
  padding: .55rem .9rem;
  font: inherit;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button.primary, .button-primary { background: var(--accent); color: white; }
.button.primary:hover, .button-primary:hover { background: var(--accent-dark); }
.button.secondary, .button-secondary { border-color: #9eb9ae; background: var(--accent-pale); color: var(--accent-dark); }
.button.danger { background: var(--danger); color: white; }
.button.danger-outline { border-color: #d9a0a0; background: #fff7f7; color: var(--danger); }
.button.full, .button-wide { width: 100%; margin-top: .5rem; }
.button-quiet { background: transparent; color: var(--muted); }
.compact-button { min-height: var(--touch-target); padding: .45rem .75rem; font-size: .82rem; }

.alert { margin: .65rem 0; border-radius: .7rem; padding: .8rem 1rem; }
.alert-error { background: #fbe2e2; color: #6c2525; }
.alert-success { background: #e3f4e9; color: var(--success); }
.alert-info { background: #e2f1fc; color: #19578b; }
.alert-warning { background: #fff0c7; color: #704600; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.message-stack { margin-bottom: 1rem; }

.row { display: flex; align-items: center; gap: .6rem; }
.between { justify-content: space-between; }
.inventory-search {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(8rem, .4fr) auto;
  align-items: end;
  gap: .7rem;
  margin-bottom: .8rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: white;
  padding: .85rem;
}
.inventory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.inventory-card {
  display: flex;
  min-width: 0;
  min-height: 9rem;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: white;
  padding: .9rem;
  box-shadow: 0 5px 20px rgba(31, 41, 51, .05);
  text-decoration: none;
}
.inventory-card:hover { border-color: #9eb9ae; background: #fbfdfc; }
.inventory-code { color: var(--accent-dark); font-size: .8rem; font-weight: 900; letter-spacing: .04em; }
.inventory-card h3 { margin: .7rem 0 .25rem; font-size: 1rem; }
.inventory-card p { margin: 0 0 .75rem; color: var(--muted); font-size: .86rem; }
.inventory-summary { display: flex; gap: .8rem; margin-top: auto; border-top: 1px solid var(--border); padding-top: .65rem; color: var(--muted); font-size: .78rem; }
.inventory-summary strong { color: var(--ink); }
.inventory-empty { grid-column: 1 / -1; display: flex; align-items: center; gap: .85rem; padding: 1.2rem; text-align: left; }
.inventory-empty p { margin: .2rem 0 0; color: var(--muted); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; color: var(--muted); font-size: .8rem; }
.breadcrumbs a { color: var(--accent-dark); font-weight: 750; text-decoration: none; }
.asset-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .65rem; margin-bottom: 1rem; }
.asset-overview > div { display: flex; min-width: 0; flex-direction: column; gap: .35rem; border: 1px solid var(--border); border-radius: .75rem; background: white; padding: .8rem; }
.asset-overview small { color: var(--muted); font-size: .75rem; }
.asset-overview strong { overflow-wrap: anywhere; font-size: .88rem; }
.child-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.child-actions .button { min-height: var(--touch-target); padding: .45rem .7rem; font-size: .82rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: 1rem; color: var(--muted); font-size: .82rem; }
.pagination .button { min-height: var(--touch-target); padding: .45rem .7rem; }

.filter-bar {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) repeat(2, minmax(8rem, .55fr)) auto;
  align-items: end;
  gap: .7rem;
  margin-bottom: .8rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: white;
  padding: .85rem;
}

.table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { background: #f0f3f4; padding: .65rem .75rem; color: #53606a; font-size: .7rem; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
td { border-top: 1px solid var(--border); padding: .75rem; vertical-align: middle; }
td small { display: block; margin-top: .2rem; color: var(--muted); }
tbody tr:hover { background: #fafbfb; }
.code-link { color: var(--accent-dark); font-weight: 800; text-decoration: none; }
.code-link:hover { text-decoration: underline; }
.status { display: inline-flex; border-radius: 999px; background: #edf0f2; padding: .24rem .52rem; font-size: .72rem; font-weight: 800; }
.status-active { background: #e3f4e9; color: var(--success); }
.status-inactive { color: #53606a; }
.status-reserve { background: #fff0c7; color: #7a4b00; }
.status-open, .status-assigned, .status-in_progress { background: #e2f1fc; color: #19578b; }
.status-planned, .status-returned { background: #fff0c7; color: #704600; }
.status-completed, .status-validated, .status-submitted, .status-closed { background: #e3f4e9; color: var(--success); }
.status-cancelled { background: #edf0f2; color: #53606a; }
.status-ended { background: #edf0f2; color: #53606a; }
.status-warning { background: #fff0c7; color: #704600; }
.next-step-card.warning-card { border-color: #e3c68d; background: #fffaf0; }
.table-empty { padding: 2rem 1rem; color: var(--muted); text-align: center; }
.table-note { color: var(--muted); font-size: .8rem; }

.model-form { padding: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.field-wide { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; margin-top: .85rem; border-top: 1px solid var(--border); padding-top: .85rem; }

.profile-toolbar { margin-bottom: 1rem; }
.profile-toolbar a { display: flex; flex-direction: column; gap: .2rem; border: 1px solid var(--border); border-radius: .8rem; background: white; padding: .85rem 1rem; text-decoration: none; }
.profile-toolbar a:hover { border-color: #9eb9ae; background: var(--accent-pale); }
.profile-toolbar small { color: var(--muted); }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.profile-card { display: flex; min-width: 0; flex-direction: column; border: 1px solid var(--border); border-radius: 1rem; background: white; padding: .9rem; box-shadow: 0 5px 20px rgba(31, 41, 51, .05); }
.profile-card.system { border-top: 4px solid var(--accent); }
.profile-card h2 { margin-top: .75rem; font-size: 1.08rem; }
.profile-card > p { flex: 1; color: var(--muted); font-size: .88rem; }
.profile-kind { color: var(--accent-dark); font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.profile-card-meta { display: flex; gap: 1rem; border-top: 1px solid var(--border); padding-top: .75rem; color: var(--muted); font-size: .78rem; }
.profile-card-meta strong { color: var(--ink); }
.status-draft { background: #fff0c7; color: #7a4b00; }
.profile-summary { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .8rem; margin-bottom: .8rem; padding: .85rem; }
.profile-summary > div { min-width: 0; }
.profile-summary small { color: var(--muted); font-size: .75rem; }
.profile-summary p { margin: .25rem 0 0; font-size: .88rem; }
.profile-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1.3rem; }
.profile-actions form { margin: 0; }
.check-groups { display: grid; gap: .65rem; }
.check-group { overflow: hidden; border: 1px solid var(--border); border-radius: .85rem; background: white; }
.check-group > summary { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .75rem .85rem; cursor: pointer; font-weight: 850; }
.check-group > summary::after { content: '+'; font-size: 1.2rem; }
.check-group[open] > summary::after { content: '−'; }
.bottom-nav a[aria-current="page"] { background: var(--accent-soft, #e1eee8); color: var(--accent); box-shadow: inset 0 -3px var(--accent); font-weight: 850; }
.evidence-preview { max-width: min(94vw, 70rem); max-height: 92dvh; border: 1px solid var(--border); border-radius: .8rem; padding: 1rem; }
.evidence-preview::backdrop { background: rgb(0 0 0 / .65); }
.evidence-preview img { display: block; max-width: 100%; max-height: 75dvh; object-fit: contain; margin-top: .7rem; }
.finding-evidence-strip a { display: grid; gap: .25rem; font-size: .875rem; }
.order-installations { margin: .4rem 0; }
@media (max-width: 759px) {
  .pass-essential-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .capture-form .capture-group-body { padding: .25rem; gap: .4rem; }
  .capture-form .response-list { padding: .2rem; }
  .capture-form .field-help, .capture-form .help-text, .capture-form .response-heading small { font-size: .875rem; line-height: 1.4; }
  .capture-form .capture-step-tabs { flex-wrap: wrap; }
  .capture-form .capture-step-tabs button { flex: 1 1 9rem; min-width: 0; }
}
.check-group > summary small { color: var(--muted); font-size: .75rem; font-weight: 650; }
.check-group[open] > summary { border-bottom: 1px solid var(--border); background: #f8faf9; }
.check-list, .catalog-list { display: grid; }
.check-row { display: grid; grid-template-columns: 7.3rem minmax(0, 1fr) 2.5rem; align-items: center; gap: .65rem; border-bottom: 1px solid var(--border); padding: .75rem 1rem; }
.check-row:last-child, .catalog-row:last-child { border-bottom: 0; }
.check-row small, .catalog-check small { display: block; margin-top: .2rem; color: var(--muted); font-size: .76rem; font-weight: 500; }
.check-code { color: var(--accent-dark); font-size: .78rem; font-weight: 900; }
.check-order { color: var(--muted); font-size: .75rem; text-align: right; }
.version-history { margin-top: 1.2rem; }
.version-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.version-links a { border: 1px solid var(--border); border-radius: 999px; padding: .45rem .7rem; color: var(--muted); font-size: .8rem; text-decoration: none; }
.version-links a.current { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; }
.profile-metadata { margin-bottom: 1.3rem; }
.composition-editor { margin-bottom: 5.5rem; }
.catalog-row { display: grid; grid-template-columns: 2rem minmax(0, 1fr) 10rem auto auto; align-items: center; gap: .65rem; border-bottom: 1px solid var(--border); padding: .7rem .8rem; }
.catalog-check { display: flex; align-items: flex-start; gap: .7rem; margin: 0; cursor: pointer; }
.catalog-check input { width: 1.25rem; min-height: 1.25rem; flex: 0 0 auto; margin: .15rem 0 0; }
.catalog-controls { display: flex; min-width: 0; gap: .4rem; }
.catalog-controls label { margin: 0; color: var(--muted); font-size: .68rem; }
.catalog-controls input, .catalog-controls select { width: 100%; min-height: 2.35rem; margin-top: .2rem; padding: .45rem; font-size: .78rem; }
.sortable-check-list { overflow: hidden; margin-bottom: 1.5rem; border: 1px solid var(--border); border-radius: .85rem; background: white; }
.sortable-check-row.is-selected { background: white; }
.sortable-check-row.is-dragging { position: relative; z-index: 2; background: var(--accent-pale); opacity: .7; }
.sortable-check-row:not(.is-selected) .drag-handle, .sortable-check-row:not(.is-selected) .order-buttons, .sortable-check-row:not(.is-selected) .catalog-controls { display: none; }
.drag-handle { width: 2rem; min-height: 2.5rem; border: 0; background: transparent; color: var(--accent); font-size: 1.5rem; cursor: grab; touch-action: none; }
.drag-handle:active { cursor: grabbing; }
.catalog-check-text { min-width: 0; }
.catalog-check-text small { display: block; margin-top: .2rem; color: var(--muted); font-size: .74rem; }
.order-buttons { display: flex; gap: .2rem; }
.order-buttons button { display: grid; width: var(--touch-target); min-height: var(--touch-target); place-items: center; border: 1px solid var(--border); border-radius: .45rem; background: white; color: var(--accent-dark); cursor: pointer; }
.order-buttons button:disabled { opacity: .3; cursor: default; }
.check-toggle { min-height: 2.35rem; border: 1px solid #9eb9ae; border-radius: .55rem; background: var(--accent-pale); padding: .4rem .65rem; color: var(--accent-dark); font-weight: 800; cursor: pointer; }
.is-selected .check-toggle { border-color: #d9a0a0; background: #fff7f7; color: var(--danger); }
.compact-empty { margin: .7rem; padding: 1rem; color: var(--muted); text-align: center; }
.catalog-heading { margin-top: 1.4rem; }
.sticky-form-actions { position: fixed; right: 0; bottom: 4.6rem; left: 0; z-index: 25; display: flex; justify-content: center; gap: .6rem; border-top: 1px solid var(--border); background: rgba(255, 255, 255, .96); padding: .7rem 1rem; box-shadow: 0 -4px 18px rgba(0, 0, 0, .06); backdrop-filter: blur(10px); }
.catalog-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; padding: .8rem; }
.catalog-card { border: 1px solid var(--border); border-radius: .7rem; padding: .8rem; }
.catalog-card h3 { margin-top: .7rem; }
.catalog-card > p { color: var(--muted); font-size: .82rem; }
.catalog-card dl { display: grid; gap: .45rem; margin: .8rem 0 0; border-top: 1px solid var(--border); padding-top: .7rem; }
.catalog-card dl div { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: .5rem; font-size: .75rem; }
.catalog-card dt { color: var(--muted); }
.catalog-card dd { margin: 0; }
.catalog-card-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.catalog-card-actions form { margin: 0; }
.catalog-card-actions .button { min-height: var(--touch-target); padding: .4rem .65rem; font-size: .75rem; }
.form-section + .form-section { margin-top: 1.3rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.page-actions form { margin: 0; }
.report-preview-page-actions:has(> form), .report-preview-page-actions:has(> a.primary) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}
.report-preview-page-actions > form { display: flex; }
.report-preview-page-actions > .button, .report-preview-page-actions > form > .button { width: 100%; height: 100%; }
.inventory-heading-actions { flex: 0 0 auto; justify-content: flex-end; margin-left: auto; }
.confirm-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; padding: 1.2rem; }
.confirm-card h1 { margin-top: .5rem; }
.danger-mark { display: grid; width: 2.6rem; height: 2.6rem; place-items: center; border-radius: 50%; background: #fbe2e2; color: var(--danger); font-size: 1.3rem; font-weight: 900; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
.import-guidance { margin-bottom: 1rem; padding: 1rem 1.15rem; }
.import-guidance p { margin: .4rem 0; color: var(--muted); }
.import-steps { display: grid; gap: .45rem; margin: .8rem 0 1rem; padding-left: 1.25rem; }
.column-guide { margin-top: .9rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.column-guide summary, .secondary-metadata summary { cursor: pointer; color: var(--accent-dark); font-weight: 850; }
.column-guide dl, .secondary-metadata dl { display: grid; gap: .5rem; margin: .75rem 0 0; }
.column-guide dl > div, .secondary-metadata dl > div { display: grid; grid-template-columns: minmax(8rem, .35fr) minmax(0, 1fr); gap: .65rem; }
.column-guide dt, .secondary-metadata dt { font-weight: 800; }
.column-guide dt b { color: var(--success); font-size: .68rem; text-transform: uppercase; }
.column-guide dd, .secondary-metadata dd { margin: 0; overflow-wrap: anywhere; color: var(--muted); }
.import-form { margin-bottom: 1.4rem; }
.import-history { margin-top: 1.5rem; }
.status-import-uploaded { background: #edf0f2; color: #53606a; }
.status-import-validated { background: #fff0c7; color: #7a4b00; }
.status-import-applied { background: #e3f4e9; color: var(--success); }
.status-import-failed { background: #fbe2e2; color: var(--danger); }
.import-metadata { grid-template-columns: 1.5fr .6fr 1fr; }
.import-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin-bottom: .8rem; }
.cleanup-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.import-stat-grid > div, .import-breakdown > div { display: flex; min-width: 0; flex-direction: column; gap: .25rem; border: 1px solid var(--border); border-radius: .8rem; background: white; padding: .9rem; }
.import-stat-grid small, .import-breakdown small { color: var(--muted); font-size: .75rem; }
.import-stat-grid strong { font-size: 1.45rem; }
.import-breakdown { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .55rem; margin-bottom: .8rem; padding: .7rem; }
.import-breakdown strong { font-size: 1.05rem; }
.import-failure, .import-safety { margin-bottom: 1rem; padding: 1rem 1.15rem; }
.import-failure { border-color: #d9a0a0; }
.import-failure p, .import-safety p { margin: .4rem 0; }
.issue-row { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: .8rem; border-bottom: 1px solid var(--border); padding: .8rem 1rem; font-size: .86rem; }
.issue-row:last-child { border-bottom: 0; }
.issue-row strong { color: var(--accent-dark); }
.issue-row span { color: var(--muted); }
.import-changes { margin-bottom: 1rem; }
.import-change-totals { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .65rem; }
.import-change-totals span { border: 1px solid var(--border); border-radius: 999px; background: white; padding: .35rem .65rem; color: var(--muted); font-size: .78rem; }
.import-change-row { grid-template-columns: 9rem minmax(0, 1fr); }
.import-change-row strong small { color: var(--muted); font-weight: 500; }
.issue-row .field-change { display: block; overflow-wrap: anywhere; }
.field-change + .field-change { margin-top: .25rem; }
.import-actions { justify-content: flex-end; }
.import-actions form { margin: 0; }

.task-row-more { min-height: 3.6rem; background: #f8faf9; }
.order-form { display: grid; gap: .1rem; }
.selection-count { border-radius: 999px; background: var(--accent-soft); padding: .35rem .65rem; color: var(--accent-dark); font-size: .78rem; }
.center-picker { display: grid; gap: .8rem; }
.center-search-results:empty { display: none; }
.center-search-results { overflow: hidden; border: 1px solid var(--border); border-radius: .75rem; background: white; }
.center-result-row { display: flex; align-items: center; gap: .75rem; border-bottom: 1px solid var(--border); padding: .7rem .8rem; }
.center-result-row:last-child { border-bottom: 0; }
.center-result-row > div { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: .15rem; }
.center-result-row small { overflow-wrap: anywhere; color: var(--muted); font-size: .76rem; }
.center-result-empty { margin: 0; padding: .8rem; color: var(--muted); font-size: .84rem; }
.overlap-warning { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .9rem; margin-bottom: 1rem; border-color: #dfbf82; padding: 1rem; }
.overlap-warning h2 { margin-top: .15rem; }
.overlap-warning p { color: var(--muted); }
.overlap-warning ul { margin-bottom: .25rem; padding-left: 1.2rem; }
.inline-note { margin: 0; padding: .9rem 1rem; color: var(--muted); }
.compact-alert { margin: .5rem 0 0; padding: .6rem .7rem; font-size: .78rem; }
.equipment-reminder { display: flex; flex-direction: column; gap: .2rem; margin: .65rem 0; border-left: .25rem solid var(--highlight); background: #fbfbdc; padding: .7rem .8rem; }
.equipment-reminder span { color: var(--muted); font-size: .82rem; }
.order-filters { grid-template-columns: minmax(14rem, 1fr) minmax(10rem, .45fr) auto; }
.order-summary, .inspection-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; overflow: hidden; margin-bottom: 1rem; }
.order-summary > div, .inspection-overview > div { display: flex; min-width: 0; flex-direction: column; gap: .25rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .7rem .8rem; }
.order-summary > div:nth-child(3n), .inspection-overview > div:nth-child(3n) { border-right: 0; }
.order-summary small, .inspection-overview small, .order-reason small { color: var(--muted); font-size: .73rem; }
.order-summary strong, .inspection-overview strong { overflow-wrap: anywhere; font-size: .86rem; }
.order-summary .order-motive { grid-column: 1 / -1; border: 0; }
.order-motive p, .order-reason p { margin: 0; }
.compact-search { display: grid; grid-template-columns: minmax(12rem, 1fr) auto; align-items: end; gap: .6rem; margin-bottom: .7rem; }
.bulk-assignment-form { display: grid; grid-template-columns: minmax(12rem, 1fr) auto; align-items: end; gap: .6rem; margin-bottom: .7rem; padding: .8rem; }
.compact-search .field span { font-size: .84rem; font-weight: 750; }
.inline-assignment-form { display: flex; align-items: center; gap: .45rem; }
.inline-assignment-form select { min-width: 12rem; min-height: var(--touch-target); padding: .45rem .6rem; }
.cancellation-panel { margin-top: 1.4rem; }
.inspection-row .status { flex: 0 0 auto; }
.inspection-overview { margin-bottom: 1rem; }
.order-summary.operational-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inspection-overview.operational-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.secondary-metadata { margin: -.35rem 0 1rem; border: 1px solid var(--border); border-radius: .75rem; background: #fbfcfc; padding: .7rem .85rem; font-size: .8rem; }
.asset-location-link { margin: .75rem 0 1rem; white-space: normal; overflow-wrap: anywhere; }
.tool-page-grid { margin-bottom: 1rem; }
.tools-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.tool-action-card { display: flex; min-width: 0; min-height: 8rem; flex-direction: column; justify-content: flex-start; gap: .15rem; border: 1px solid var(--border); border-radius: .9rem; background: var(--surface); padding: .8rem; color: var(--ink); text-decoration: none; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.tool-action-card:hover { border-color: #8bb5a6; background: var(--accent-pale); transform: translateY(-1px); }
.tool-action-icon { display: grid; width: 2.5rem; height: 2.5rem; flex: 0 0 2.5rem; place-items: center; margin-bottom: .3rem; border-radius: .75rem; background: var(--accent-soft); color: var(--accent-dark); font-size: 1.3rem; font-weight: 900; line-height: 1; }
.tool-action-card strong { font-size: 1rem; line-height: 1.2; }
.tool-action-card small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.finalization-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; }
.finalization-card p { max-width: 48rem; margin: .3rem 0 0; color: var(--muted); }
.finalization-card form { flex: 0 0 auto; }
.finalization-panel { margin-top: .8rem; }
.order-reason { padding: 1rem; }
.table-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.choice-card-field #id_scope_mode, #id_asset_scope_mode, .scope-block-choices > div { display: grid; gap: .5rem; }
.choice-card-field #id_scope_mode > div, #id_asset_scope_mode > div, .scope-block-choices > div > div { border: 1px solid var(--border); border-radius: .7rem; background: #fbfcfc; padding: .65rem .75rem; }
.choice-card-field label, #id_asset_scope_mode label, .scope-block-choices label { display: flex; align-items: center; gap: .6rem; margin: 0; cursor: pointer; }
.choice-card-field input[type="radio"], #id_asset_scope_mode input[type="radio"], .scope-block-choices input[type="checkbox"] { width: 1.2rem; min-height: 1.2rem; flex: 0 0 auto; margin: 0; padding: 0; }
.custom-scope { display: grid; gap: 1rem; margin-top: .85rem; padding: 1rem; }
.custom-scope[hidden], #selected-assets-panel[hidden] { display: none; }
#selected-assets-panel { display: grid; gap: .8rem; }
.scope-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.scope-summary-grid .panel { padding: 1rem; }
.plain-scope-list { display: grid; gap: .45rem; margin: .7rem 0 0; padding-left: 1.25rem; }
.plain-scope-list small { display: block; margin-top: .15rem; color: var(--muted); }
.push-settings-card { margin-bottom: .8rem; padding: 1.1rem; }
.push-unavailable-card { padding: 1.1rem; }
.push-unavailable-card p { margin: .35rem 0 0; color: var(--muted); }

.capture-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  margin-bottom: .8rem;
}
.capture-overview .capture-heading { grid-column: 1; margin: 0; }
.capture-overview .asset-location-link { width: auto; max-width: 100%; grid-column: 2; margin: 0; }
.capture-overview .capture-progress { grid-column: 1 / -1; margin: 0; }
.capture-heading { align-items: center; }
.capture-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: .8rem;
}
.capture-progress > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: .25rem;
  border-right: 1px solid var(--border);
  padding: .7rem .8rem;
}
.capture-progress > div:last-child { border-right: 0; }
.capture-progress small { color: var(--muted); font-size: .72rem; }
.capture-progress strong { font-size: 1.12rem; }
.capture-feedback { margin-bottom: .8rem; }
.capture-feedback p { margin: 0 0 .35rem; }
.capture-feedback ul { margin: 0; padding-left: 1.25rem; }
.capture-feedback a { color: inherit; display: inline-flex; align-items: center; min-height: 2.75rem; }
.response-card.capture-invalid, .earth-assessment-card.capture-invalid, .pass-context-card.capture-invalid { border-color: #c73535; box-shadow: 0 0 0 2px rgba(199, 53, 53, .1); }
.capture-inline-error { margin: .55rem .8rem 0; border-radius: .55rem; background: #fff0f0; padding: .55rem .65rem; color: var(--danger); font-size: .78rem; font-weight: 800; line-height: 1.4; }
.pass-context-card .capture-inline-error { margin: .35rem 0 0; }
[aria-invalid="true"] { border-color: #c73535 !important; box-shadow: 0 0 0 2px rgba(199, 53, 53, .12); }
.capture-form { display: grid; gap: .7rem; }
.pass-context-card { display: grid; grid-template-columns: .8fr 1.2fr; gap: .7rem; padding: .85rem; }
.pass-context-card.single-field { grid-template-columns: 1fr; }
.capture-group { overflow: hidden; border: 1px solid var(--border); border-radius: 1rem; background: white; box-shadow: 0 5px 20px rgba(31, 41, 51, .05); }
.capture-step-tabs { display: flex; gap: .45rem; overflow-x: auto; padding: .2rem 0 .65rem; scrollbar-width: thin; }
.capture-step-tabs button { display: flex; min-width: 9rem; min-height: 3.3rem; flex: 0 0 auto; align-items: center; gap: .4rem; border: 1px solid var(--border); border-radius: .7rem; background: white; padding: .5rem .65rem; color: var(--muted); font-size: .74rem; font-weight: 800; text-align: left; cursor: pointer; }
.capture-step-tabs button > span { display: grid; min-width: 1.55rem; height: 1.55rem; place-items: center; border-radius: 50%; background: var(--background); color: var(--accent-dark); }
.capture-step-tabs button small { margin-left: auto; color: #8a5700; font-size: .65rem; }
.capture-step-tabs button.active { border-color: var(--accent); background: var(--accent-pale); color: var(--accent-dark); }
.capture-step-tabs button.active > span { background: var(--accent); color: white; }
.capture-first-pending { justify-self: start; min-height: 2.4rem; margin-bottom: .2rem; padding: .35rem .55rem; font-size: .74rem; }
.capture-group-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); background: #f8faf9; padding: .8rem 1rem; }
.capture-group-title h2 { margin: .15rem 0 0; }
.capture-group-title > small { color: var(--muted); font-size: .75rem; }
.capture-group-body { display: grid; gap: .8rem; padding: .8rem; }
.capture-group-wide { grid-column: 1 / -1; min-width: 0; }
.capture-group-bulk { display: flex; align-items: center; justify-content: space-between; gap: .7rem; border-top: 1px solid var(--border); background: #f8faf9; padding: .7rem .8rem; }
.capture-group-bulk small { color: var(--muted); font-size: .7rem; }
.capture-step-controls { display: grid; grid-template-columns: minmax(8rem, 1fr) auto minmax(8rem, 1fr); align-items: center; gap: .6rem; }
.capture-step-controls [data-capture-next] { justify-self: stretch; }
.capture-step-controls [data-capture-previous] { justify-self: stretch; }
.capture-step-controls span { color: var(--muted); font-size: .78rem; font-weight: 800; }
.capture-final-step { display: grid; gap: .8rem; }
.capture-final-step[hidden], .capture-step[hidden] { display: none; }
.general-notes-final { padding: .9rem; }
.general-notes-final label { display: flex; flex-direction: column; gap: .15rem; font-weight: 800; }
.general-notes-final label small { color: var(--muted); font-size: .7rem; font-weight: 500; }
.capture-asset { overflow: hidden; border: 1px solid var(--border); border-radius: .8rem; background: #fbfcfc; }
.capture-asset-heading { display: flex; align-items: center; justify-content: space-between; gap: .8rem; border-bottom: 1px solid var(--border); padding: .8rem; }
.capture-asset-heading small { color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.capture-asset-heading h2 { margin: .2rem 0 0; font-size: .95rem; }
.response-list { display: grid; gap: .65rem; padding: .65rem; }
.response-card { overflow: hidden; border: 1px solid var(--border); border-left: 4px solid #b8c2c9; border-radius: .7rem; background: white; }
.response-card.outcome-conforming { border-left-color: var(--success); }
.response-card.outcome-nonconforming { border-left-color: var(--danger); }
.response-card.outcome-unable { border-left-color: #9a6900; }
.response-card.outcome-recorded { border-left-color: #397ba5; }
.automatic-evaluation-summary { margin: .65rem .8rem .8rem; border: 1px solid #e2b6b6; border-radius: .65rem; background: #fff5f5; padding: .65rem .75rem; }
.automatic-evaluation-summary strong { color: var(--danger); }
.automatic-evaluation-summary p { margin: .25rem 0 0; color: var(--text); font-size: .8rem; }
.response-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; padding: .75rem .8rem .45rem; }
.response-heading > div { display: flex; min-width: 0; flex-direction: column; gap: .18rem; }
.response-heading small { color: var(--muted); font-size: .7rem; }
.response-card fieldset { min-width: 0; margin: 0; border: 0; padding: .35rem .8rem .8rem; }
.response-card fieldset:disabled { opacity: .78; }
.sampling-note { display: flex; flex-direction: column; gap: .18rem; margin: 0 0 .65rem; border: 1px solid #b8d5ca; border-radius: .6rem; background: var(--accent-pale); padding: .65rem; color: var(--accent-dark); }
.sampling-note span, .sampling-note small { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.earth-assessment-panel { margin-bottom: 1rem; }
.earth-assessment-list { display: grid; gap: .75rem; margin-top: .85rem; }
.earth-assessment-card { border: 1px solid var(--border); border-radius: .75rem; background: #fbfcfc; padding: .85rem; }
.earth-assessment-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.earth-assessment-heading div { display: flex; min-width: 0; flex-direction: column; }
.earth-assessment-heading small, .earth-assessment-heading > span, .earth-reference { color: var(--muted); font-size: .72rem; }
.earth-reference { margin: .45rem 0 .65rem; }
.earth-state-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.earth-state-options label { display: flex; min-height: 3.2rem; align-items: center; gap: .45rem; margin: 0; border: 1px solid var(--border); border-radius: .6rem; background: white; padding: .55rem; font-size: .76rem; cursor: pointer; }
.earth-state-options input { width: 1rem; min-height: 1rem; flex: 0 0 auto; margin: 0; }
.earth-state-options label:has(input:checked) { border-color: #79af8d; background: var(--accent-pale); color: var(--accent-dark); }
.earth-assessment-notes { display: block; margin-top: .65rem; font-size: .76rem; }
.earth-assessment-notes small { color: var(--muted); font-weight: 400; }
.earth-assessment-notes textarea { margin-top: .25rem; }
.earth-assessment-card:not(:has(input[value="not_continuous"]:checked)):not(:has(input[value="undetermined"]:checked)) .earth-assessment-notes { display: none; }
.quick-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.quick-result { display: flex; min-height: 3rem; align-items: center; gap: .45rem; margin: 0; border: 1px solid var(--border); border-radius: .6rem; padding: .55rem; font-size: .78rem; cursor: pointer; }
.quick-result > span { display: flex; min-width: 0; flex-direction: column; gap: .08rem; }
.quick-result > span small { color: inherit; font-size: .64rem; font-weight: 500; line-height: 1.25; }
.quick-result input { width: 1rem; min-height: 1rem; flex: 0 0 auto; margin: 0; padding: 0; }
.quick-result.success:has(input:checked) { border-color: #79af8d; background: #e8f5ec; color: #155b33; }
.quick-result.danger:has(input:checked) { border-color: #d99c9c; background: #fff0f0; color: #842424; }
.quick-result.muted:has(input:checked) { border-color: #d0ad65; background: #fff5dc; color: #704600; }
.measurement-row { display: flex; align-items: end; gap: .65rem; }
.measurement-row > .field, .measurement-row > .inline-value-grid, .measurement-row > .measurement-value { flex: 1; }
.measurement-value { position: relative; display: flex; min-width: 0; flex-direction: column; gap: .3rem; font-size: .8rem; }
.measurement-value input { padding-right: 4rem; }
.measurement-value span { position: absolute; right: .75rem; bottom: .95rem; color: var(--muted); font-size: .78rem; }
.unable-toggle { display: flex; min-height: 3rem; align-items: center; gap: .45rem; margin: 0; border: 1px solid var(--border); border-radius: .6rem; padding: .55rem .7rem; font-size: .76rem; font-weight: 700; }
.unable-toggle input { width: 1.05rem; min-height: 1.05rem; flex: 0 0 auto; margin: 0; padding: 0; }
.inline-value-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.inline-value-grid label { display: flex; min-width: 0; flex-direction: column; gap: .3rem; font-size: .78rem; }
.standard-choice-field { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: .3rem; font-size: .78rem; }
[data-other-value] { margin-top: .25rem; }
.anomaly-options { margin-top: .65rem; border-top: 1px dashed var(--border); padding-top: .65rem; }
.anomaly-options > span { color: var(--muted); font-size: .74rem; font-weight: 800; }
.reason-chip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; margin-top: .45rem; }
.reason-chip-grid label { display: flex; align-items: flex-start; gap: .4rem; margin: 0; border: 1px solid var(--border); border-radius: .55rem; padding: .5rem; font-size: .74rem; font-weight: 650; }
.reason-chip-grid input { width: 1rem; min-height: 1rem; flex: 0 0 auto; margin: .1rem 0 0; padding: 0; }
.response-details { margin-top: .65rem; border-top: 1px dashed var(--border); padding-top: .65rem; }
.response-details[hidden], .anomaly-options[hidden], .immediate-resolution[hidden], .resolution-fields[hidden], [data-other-value][hidden] { display: none; }
.response-explanation { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: .3rem; margin-top: .65rem; color: var(--muted); font-size: .72rem; }
.response-explanation textarea { min-height: 4rem; padding: .55rem; font-size: .82rem; }
.response-explanation textarea { width: 100%; }
.field-label-line { display: flex; align-items: center; justify-content: space-between; gap: .55rem; }
.field-label-line > label { font-weight: 700; }
.quick-text-field { display: flex; min-width: 0; flex-direction: column; gap: .3rem; }
.text-suggestion { display: flex; min-height: var(--touch-target); align-items: flex-start; flex-direction: column; gap: .12rem; border: 1px solid #a9c9bc; border-radius: .55rem; background: var(--accent-pale); padding: .5rem .65rem; color: var(--accent-dark); text-align: left; cursor: pointer; }
.text-suggestion:hover { border-color: var(--accent); background: var(--accent-soft); }
.text-suggestion.compact { display: inline-flex; min-height: var(--touch-target); flex: 0 0 auto; justify-content: center; padding: .3rem .5rem; font-size: .68rem; font-weight: 800; }
.text-suggestion small { color: var(--muted); font-size: .69rem; font-weight: 500; line-height: 1.35; }
.immediate-resolution { margin-top: .7rem; border: 1px solid #afd1bd; border-radius: .65rem; background: #edf7f1; padding: .65rem; }
.immediate-resolution > p { margin: .2rem 0 .55rem; color: var(--muted); font-size: .72rem; }
.resolution-toggle { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); align-items: start; gap: .55rem; margin: 0; cursor: pointer; }
.resolution-toggle input { width: 1.1rem; min-height: 1.1rem; margin: .15rem 0 0; padding: 0; accent-color: var(--success); }
.resolution-toggle span { display: flex; min-width: 0; flex-direction: column; gap: .12rem; }
.resolution-toggle small { color: var(--muted); font-weight: 500; line-height: 1.35; }
.resolution-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(10rem, .6fr); gap: .55rem; margin-top: .65rem; border-top: 1px solid #c9dfd1; padding-top: .65rem; }
.resolution-fields label { display: flex; min-width: 0; flex-direction: column; gap: .3rem; margin: 0; color: #315b45; font-size: .74rem; }
.resolution-fields textarea, .resolution-fields input { min-height: 2.7rem; padding: .55rem; font-size: .82rem; }
.photo-field { display: flex; flex-direction: column; gap: .3rem; margin-top: .65rem; color: var(--muted); font-size: .74rem; }
.photo-field input { min-height: 2.75rem; padding: .55rem; font-size: .78rem; }
.photo-field small { font-weight: 500; }
.evidence-strip { display: flex; flex-wrap: wrap; gap: .55rem; border-top: 1px solid var(--border); padding: .65rem .8rem; }
.evidence-history-note { width: 100%; color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.evidence-thumb { display: flex; width: 5.5rem; flex-direction: column; gap: .25rem; }
.evidence-thumb img { display: block; width: 5.5rem; height: 4rem; border-radius: .45rem; object-fit: cover; }
.evidence-thumb .link-button { min-height: var(--touch-target); padding: .2rem; color: var(--danger); font-size: .7rem; }
.capture-save-actions { position: sticky; right: auto; bottom: 4.6rem; left: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: .2rem calc(-1 * var(--space-page-inline)) 0; }
.capture-save-actions .button { width: 100%; margin: 0; }
.save-pass-status { grid-column: 1 / -1; border-radius: .55rem; padding: .35rem .55rem; font-size: .76rem; font-weight: 800; text-align: center; }
.save-pass-status.neutral { color: var(--muted); background: var(--background); }
.save-pass-status.pending { color: #704600; background: #fff0c7; }
.save-pass-status.success { color: var(--success); background: #e3f4e9; }
.save-pass-status.error { color: #6c2525; background: #fbe2e2; }
.close-pass-section { margin-top: 1.5rem; }
.signature-card { padding: 1rem; }
.signature-card > p { margin-top: 0; color: var(--muted); }
.signature-card canvas { display: block; width: 100%; height: min(12rem, 38vw); border: 1px dashed #7c8c85; border-radius: .7rem; background: white; touch-action: none; }
.signature-actions { display: flex; justify-content: flex-end; gap: .55rem; margin-top: .65rem; }
.closure-warning { margin-bottom: .8rem; border: 1px solid #dfbf82; border-radius: .7rem; background: #fff7df; padding: .8rem; color: #704600; }
.closure-warning ul { margin: .45rem 0 0; padding-left: 1.2rem; font-size: .8rem; }
.closed-pass-summary { display: flex; align-items: flex-start; gap: .85rem; margin-top: 1rem; padding: 1rem; }
.closed-pass-summary p { margin: .25rem 0; color: var(--muted); }
.closed-pass-summary a { color: var(--accent-dark); font-size: .82rem; font-weight: 800; }

.filter-tabs { display: flex; gap: .45rem; overflow-x: auto; margin: 0 0 1rem; padding: .2rem 0 .55rem; scrollbar-width: none; scroll-snap-type: x proximity; }
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tabs a { flex: 0 0 auto; border: 1px solid var(--border); border-radius: 999px; background: white; padding: .5rem .75rem; color: var(--muted); font-size: .78rem; font-weight: 750; text-decoration: none; }
.filter-tabs a { scroll-snap-align: start; }
.filter-tabs a.active { border-color: var(--accent); background: var(--accent); color: white; }
.finding-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; margin-bottom: 1rem; }
.finding-summary-grid > a, .finding-summary-grid > div { display: flex; min-width: 0; flex-direction: column; gap: .25rem; border-right: 1px solid var(--border); padding: .9rem; text-decoration: none; }
.finding-summary-grid > a:last-child, .finding-summary-grid > div:last-child { border-right: 0; }
.finding-summary-grid > a:hover { background: #f7faf8; }
.finding-summary-grid > a.active { background: var(--accent-pale); box-shadow: inset 0 -.2rem 0 var(--accent); }
.finding-summary-grid small { color: var(--muted); font-size: .7rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.finding-summary-grid strong { overflow-wrap: anywhere; }
.task-deadline { margin-top: .15rem; font-weight: 850; }
.task-main .task-deadline.overdue { color: var(--danger); }
.task-main .task-deadline.soon { color: #8a5700; }
.task-main .task-deadline.on-time { color: var(--accent-dark); }
.finding-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: .75rem; border-bottom: 1px solid var(--border); padding: .85rem 1rem; }
.finding-card:last-child { border-bottom: 0; }
.finding-card-main { display: flex; min-width: 0; flex-direction: column; gap: .25rem; }
.finding-card-link { color: var(--ink); text-decoration: none; }
.finding-card-link:hover { color: var(--accent-dark); text-decoration: underline; }
.finding-card-main p { margin: .1rem 0; color: #425466; font-size: .86rem; white-space: pre-wrap; }
.finding-card-main small { color: var(--muted); line-height: 1.35; }
.finding-deadline { display: flex; flex-direction: column; gap: .12rem; margin-top: .25rem; border-left: .2rem solid #9eb0a8; padding-left: .55rem; }
.finding-deadline > strong { font-size: .78rem; }
.finding-deadline.overdue { border-left-color: var(--danger); color: var(--danger); }
.finding-deadline.soon { border-left-color: #c08012; color: #704600; }
.finding-deadline.on-time { border-left-color: var(--success); color: var(--success); }
.finding-deadline.neutral { color: var(--muted); }
.finding-evidence-strip { display: flex; grid-column: 2 / -1; flex-wrap: wrap; gap: .45rem; }
.finding-evidence-strip:empty { display: none; }
.finding-evidence-strip a { display: block; border-radius: .4rem; }
.finding-evidence-strip img { display: block; width: 5rem; height: 3.75rem; border: 1px solid var(--border); border-radius: .4rem; object-fit: cover; }
.finding-evidence-strip a:focus-visible { outline: 3px solid rgba(40,82,71,.25); outline-offset: 2px; }
.severity-mark { display: inline-grid; min-width: 2.65rem; min-height: 2.4rem; place-items: center; border-radius: .65rem; background: #edf0f2; color: #53606a; font-size: .68rem; font-weight: 900; text-transform: uppercase; }
.severity-mark.major { background: #fff0c7; color: #704600; }
.severity-mark.critical { background: #fbe2e2; color: #842424; }
.status-open_findings { background: #fbe2e2; color: #842424; }
.status-favorable_origin, .status-favorable_after_correction { background: #e3f4e9; color: var(--success); }
.status-inconclusive, .status-pending { background: #fff0c7; color: #704600; }
.status-conforming { background: #e3f4e9; color: var(--success); }
.status-nonconforming { background: #fbe2e2; color: var(--danger); }
.status-offered { background: #e2f1fc; color: #19578b; }
.status-declined { background: #fff0c7; color: #704600; }
.status-available { background: #e3f4e9; color: var(--success); }
.availability-row { flex-wrap: wrap; }
.availability-row > form { margin-left: auto; }
.availability-state-card { margin-bottom: .75rem; padding: 1rem; }
.availability-state-card p { margin: .4rem 0; }
.availability-state-card details { margin-top: .8rem; }
.availability-state-card summary { cursor: pointer; font-weight: 800; }
.availability-history-list { display: grid; gap: .35rem; margin: .65rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: .82rem; }
.availability-form-card { padding: 1rem; }
.proposal-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: .7rem; }
.proposal-actions > form { margin: 0; }
.decline-offer-panel { min-width: 0; flex: 1 1 22rem; margin: 0; }
.decline-offer-panel > summary { display: inline-flex; min-height: var(--touch-target); align-items: center; justify-content: center; list-style: none; border: 1px solid #d7a2a2; border-radius: .7rem; background: transparent; padding: .65rem 1rem; color: var(--danger); font-size: .82rem; font-weight: 850; cursor: pointer; }
.decline-offer-panel > summary::-webkit-details-marker { display: none; }
.decline-offer-panel > summary:hover, .decline-offer-panel > summary:focus-visible { outline: 0; border-color: var(--danger); background: #fff5f5; }
.decline-offer-panel[open] { flex-basis: 100%; }
.decline-offer-panel[open] > summary { margin-bottom: .65rem; }
.decline-offer-panel form { width: min(100%, 32rem); min-width: 0; margin: 0; border: 1px solid var(--border); border-radius: .7rem; background: white; padding: .8rem; }
.decline-offer-panel .field, .decline-offer-panel textarea { width: 100%; min-width: 0; }
.decline-offer-panel .button { width: 100%; margin-top: .65rem; }

.finding-resolution-list { display: grid; gap: .7rem; }
.finding-resolution-choice { overflow: hidden; border: 1px solid var(--border); border-radius: .8rem; background: white; }
.finding-resolution-choice.selected { border-color: #83ac9a; box-shadow: 0 0 0 2px rgba(40,82,71,.08); }
.finding-resolution-selector { display: grid; grid-template-columns: 1.2rem minmax(0, 1fr); align-items: start; gap: .65rem; margin: 0; padding: .8rem; cursor: pointer; }
.finding-resolution-selector > input { width: 1.2rem; min-height: 1.2rem; margin: .2rem 0 0; padding: 0; accent-color: var(--accent); }
.finding-resolution-selector > span { display: flex; min-width: 0; flex-direction: column; gap: .2rem; }
.finding-resolution-selector small { color: var(--muted); font-weight: 500; }
.finding-resolution-fields { display: grid; grid-template-columns: minmax(9rem, .45fr) minmax(0, 1fr); gap: .65rem; border-top: 1px solid var(--border); background: var(--accent-pale); padding: .8rem; }
.finding-resolution-fields .field-wide { grid-column: 1 / -1; }
.local-signature-block { margin-top: 1rem; padding: 1rem; }
.local-signature-block canvas { display: block; width: 100%; height: min(12rem, 38vw); border: 1px dashed #7c8c85; border-radius: .7rem; background: white; touch-action: none; }

.closure-success-heading { display: flex; align-items: center; gap: .9rem; }
.completion-check { display: inline-grid; width: 3rem; height: 3rem; flex: 0 0 auto; place-items: center; border-radius: 50%; color: white; background: var(--success); font-size: 1.55rem; font-weight: 900; box-shadow: 0 5px 16px rgba(36,112,68,.2); }
.work-report-preview { overflow: hidden; border: 1px solid #cfd8de; border-radius: .45rem; background: white; box-shadow: 0 10px 32px rgba(31,41,51,.09); }
.report-preview-header { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 1rem; border-left: .35rem solid var(--accent); background: #172a3a; padding: 1.1rem 1rem; color: white; }
.report-preview-header > div { display: flex; min-width: 0; flex-direction: column; gap: .12rem; }
.report-preview-header strong { font-size: 1.05rem; letter-spacing: .02em; }
.report-preview-header small { color: #cad5dd; font-size: .68rem; text-transform: uppercase; }
.report-preview-reference { align-items: flex-end; text-align: right; }
.report-preview-reference span { display: block; max-width: 14rem; overflow: hidden; color: #cad5dd; font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.report-preview-body { padding: 1rem; }
.report-preview-status { display: flex; align-items: center; justify-content: space-between; gap: .75rem; border: 1px solid #a9c9bc; background: var(--accent-pale); padding: .8rem; color: var(--accent-dark); font-size: .8rem; text-transform: uppercase; }
.report-preview-status span { color: var(--ink); font-weight: 900; text-align: right; text-transform: none; }
.report-preview-location { padding: 1rem .65rem .65rem; }
.report-preview-location small, .report-preview-details dt { color: var(--muted); font-size: .68rem; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.report-preview-location h2 { margin: .3rem 0 0; font-size: 1.35rem; overflow-wrap: anywhere; }
.report-preview-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border: 1px solid #d8e0e5; background: #f2f6f8; }
.report-preview-details div { min-width: 0; border-right: 1px solid white; border-bottom: 1px solid white; padding: .75rem; }
.report-preview-details div:nth-child(2n) { border-right: 0; }
.report-preview-details dd { margin: .25rem 0 0; overflow-wrap: anywhere; font-size: .86rem; }
.report-preview-section { margin-top: 1.15rem; }
.report-preview-section h3 { margin: 0 0 .5rem; border-left: .25rem solid var(--accent); padding-left: .65rem; font-size: .88rem; text-transform: uppercase; }
.report-action-list { overflow: hidden; border: 1px solid #d8e0e5; }
.report-action { padding: .85rem; color: #425466; }
.report-action:nth-child(even) { background: #f2f6f8; }
.report-action + .report-action { border-top: 1px solid #d8e0e5; }
.report-action-heading { display: flex; justify-content: space-between; gap: .75rem; color: var(--ink); }
.report-action-heading span { color: var(--accent-dark); font-size: .75rem; font-weight: 900; }
.report-action p { margin: .45rem 0; white-space: pre-wrap; }
.report-action dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem .8rem; margin: .55rem 0 0; font-size: .78rem; }
.report-action dt { color: var(--muted); font-weight: 800; }
.report-action dd { margin: .12rem 0 0; }
.report-evidence-strip { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .65rem; }
.report-evidence-strip img { width: 6rem; height: 4.5rem; border: 1px solid #d8e0e5; border-radius: .35rem; object-fit: cover; }
.report-signature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(8rem, .55fr); align-items: center; gap: .75rem; margin-top: .7rem; border: 1px solid #afd1bd; background: #edf7f1; padding: .7rem; }
.report-signature p { margin: 0; }
.report-signature small { color: var(--muted); }
.report-signature img { display: block; width: 100%; max-height: 5rem; border: 1px solid #d8e0e5; background: white; object-fit: contain; }
.closure-preview-actions { display: grid; gap: .25rem; margin-top: 1rem; }
.report-document-summary { display: grid; gap: .3rem; }
.report-document-summary small { min-width: 0; overflow-wrap: anywhere; }
.report-document-summary code { font-size: .72rem; }
.document-version-list { overflow: hidden; border: 1px solid #d8e0e5; border-radius: .4rem; }
.document-version-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem .8rem; }
.document-version-row + .document-version-row { border-top: 1px solid #d8e0e5; }
.document-version-row > div { display: grid; min-width: 0; gap: .15rem; }
.document-version-row small { color: var(--muted); }
.document-history-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
.document-history-summary > div { display: grid; min-width: 0; gap: .2rem; padding: .85rem 1rem; }
.document-history-summary > div:nth-child(odd) { border-right: 1px solid var(--border); }
.document-history-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
.document-history-summary small, .document-history-metadata dt, .document-hash-list small { color: var(--muted); font-size: .68rem; font-weight: 850; letter-spacing: .025em; text-transform: uppercase; }
.document-history-summary strong { overflow-wrap: anywhere; }
.document-history-notice { margin-top: 1rem; }
.document-history-group { margin-top: 1.35rem; }
.document-history-list { display: grid; gap: .75rem; }
.document-history-card { overflow: hidden; border: 1px solid var(--border); border-radius: .75rem; background: white; }
.document-history-card.latest { border-color: #9eb9ae; box-shadow: 0 5px 18px rgba(40,82,71,.08); }
.document-history-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; border-bottom: 1px solid var(--border); background: #f5f8f7; padding: .8rem .9rem; }
.document-history-card-heading small { color: var(--muted); font-size: .7rem; }
.document-history-card-heading h3 { margin: .12rem 0 0; }
.document-history-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.document-history-metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.document-history-metadata > div { min-width: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .7rem .9rem; }
.document-history-metadata > div:nth-child(2n) { border-right: 0; }
.document-history-metadata dd { margin: .2rem 0 0; overflow-wrap: anywhere; font-size: .8rem; }
.document-hash-list { display: grid; gap: .55rem; padding: .8rem .9rem; }
.document-hash-list > div { display: grid; min-width: 0; gap: .2rem; }
.document-hash-list code { overflow-wrap: anywhere; color: var(--accent-dark); font-size: .7rem; }
.compact-document-alert { margin: 0 .9rem .8rem; padding: .7rem .8rem; }
.document-history-actions { display: flex; flex-wrap: wrap; gap: .45rem; border-top: 1px solid var(--border); padding: .75rem .9rem; }
.document-history-actions .button { min-height: var(--touch-target); padding: .45rem .7rem; font-size: .76rem; }
.download-feedback { width: 100%; flex: 1 0 100%; margin: .45rem 0 0; border-radius: .65rem; background: #e3f4e9; padding: .6rem .7rem; color: var(--success); font-size: .78rem; font-weight: 750; }
.closure-preview-actions > form, .closure-preview-actions > form > .button { width: 100%; }
.inspection-report-preview { max-width: 72rem; margin-inline: auto; }
.report-status-warning { border-color: #e3c68d; background: #fff8e8; color: #7a4b00; }
.report-custom-copy { margin: 1rem 0; border-left: .25rem solid var(--accent); background: #f2f6f8; padding: .8rem; color: #425466; white-space: normal; }
.report-purpose p, .report-final-result p { margin: .4rem 0 0; color: #425466; }
.report-pass-list { display: grid; gap: 1rem; }
.report-pass { overflow: hidden; border: 1px solid #cfd8de; border-radius: .4rem; }
.report-pass-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; border-bottom: 1px solid #d8e0e5; background: #eaf1f4; padding: .75rem; }
.report-pass-heading div { display: flex; min-width: 0; flex-direction: column; }
.report-pass-heading h4 { margin: .1rem 0 0; font-size: 1rem; }
.report-pass-heading small, .report-pass-heading > span { color: var(--muted); font-size: .72rem; }
.report-pass-meta, .report-action-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid #d8e0e5; }
.report-pass-meta div, .report-action-meta div { min-width: 0; padding: .65rem .75rem; }
.report-pass-meta dt, .report-action-meta dt { color: var(--muted); font-size: .66rem; font-weight: 850; text-transform: uppercase; }
.report-pass-meta dd, .report-action-meta dd { margin: .18rem 0 0; overflow-wrap: anywhere; font-size: .78rem; }
.report-scope { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; border-bottom: 1px solid #d8e0e5; padding: .75rem; font-size: .76rem; }
.report-scope ul { margin: .35rem 0 0; padding-left: 1.15rem; color: #425466; }
.report-earth-assessments, .report-general-notes { margin: .75rem; border: 1px solid #afd1bd; background: #edf7f1; padding: .7rem; font-size: .76rem; }
.report-earth-assessments p { margin: .35rem 0 0; }
.report-earth-assessments span { font-weight: 850; }
.report-response-groups { display: grid; gap: .8rem; padding: .75rem; }
.report-response-group { border: 1px solid #d8e0e5; }
.report-response-group h5 { margin: 0; background: #f2f6f8; padding: .55rem .7rem; font-size: .78rem; text-transform: uppercase; }
.report-response-row { border-left: .22rem solid #84929c; padding: .65rem .7rem; color: #425466; }
.report-response-row + .report-response-row { border-top: 1px solid #d8e0e5; }
.report-response-row.outcome-conforming { border-left-color: var(--success); }
.report-response-row.outcome-nonconforming { border-left-color: var(--danger); }
.report-response-row.outcome-unable { border-left-color: #9a6900; }
.report-response-row.outcome-recorded { border-left-color: #397ba5; }
.report-response-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.report-response-heading div { display: flex; min-width: 0; flex-direction: column; }
.report-response-heading small { color: var(--muted); font-size: .68rem; }
.report-response-heading > span { color: var(--ink); font-size: .72rem; font-weight: 900; text-align: right; }
.report-response-row p { margin: .4rem 0 0; font-size: .76rem; white-space: pre-wrap; }
.report-captured-value { display: flex; align-items: baseline; gap: .5rem; }
.report-captured-value small { color: var(--muted); text-transform: uppercase; }
.report-captured-value strong { color: var(--ink); font-size: .92rem; }
.report-selection-note, .report-rule { color: var(--muted); }
.report-calculation-list, .report-finding-list { display: grid; gap: .55rem; }
.report-calculation, .report-finding { border: 1px solid #d8e0e5; padding: .75rem; color: #425466; }
.report-calculation:nth-child(even), .report-finding:nth-child(even) { background: #f7f9fa; }
.report-calculation.unavailable { border-style: dashed; color: var(--muted); }
.report-calculation p { margin: .4rem 0; }
.report-calculation-value { display: flex; align-items: center; justify-content: space-between; gap: .75rem; color: var(--ink); font-size: 1rem; font-weight: 900; }
.report-calculation-value .status { font-size: .68rem; }
.report-finding-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.report-finding-heading > div { display: flex; min-width: 0; flex-direction: column; gap: .2rem; }
.report-finding-heading > div:last-child { align-items: flex-end; }
.report-finding-heading small { color: var(--muted); font-size: .68rem; }
.report-finding > p { margin: .55rem 0; white-space: pre-wrap; }
.report-action-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #d8e0e5; }
.report-finding-actions { display: grid; gap: .45rem; margin-top: .65rem; }
.report-finding-actions > div { border-left: .22rem solid var(--success); background: var(--accent-pale); padding: .65rem; }
.report-finding-actions p { margin: .35rem 0; }
.report-empty-copy { margin: 0; border: 1px dashed #cfd8de; padding: .75rem; color: var(--muted); }
.report-final-result { border: 1px solid #a9c9bc; background: var(--accent-pale); padding: .8rem; }
.report-final-result > strong { color: var(--accent-dark); font-size: 1.15rem; }
.report-custom-footer { margin-bottom: 0; }

@media (max-width: 680px) {
  :root { --space-page-inline: .8rem; }
  .context-help { width: 100%; }
  .context-help > summary { width: 100%; }
  .context-help-body { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  body { padding-bottom: 5rem; }
  .app-header { gap: .5rem; padding-right: max(.8rem, env(safe-area-inset-right)); padding-left: max(.8rem, env(safe-area-inset-left)); }
  .brand { gap: .5rem; font-size: 1rem; }
  .brand img { width: 32px; height: 32px; }
  .link-button { padding: .55rem .65rem; }
  .preventive-map { height: min(62vh, 31rem); min-height: 21rem; }
  .preventive-map-floating-control { top: .5rem; right: .5rem; max-width: calc(100% - 4.5rem); }
  .preventive-map-floating-control[open] { width: min(17rem, calc(100% - 4.5rem)); }
  .preventive-map-layer-toggle { padding-right: .5rem; padding-left: .5rem; font-size: .74rem; }
  .finding-map-scope { align-items: stretch; flex-direction: column; }
  .finding-map-scope .button { width: 100%; }
  .page-shell { padding: .9rem var(--space-page-inline) 1.5rem; }
  .hero { gap: .8rem; margin-bottom: .9rem; }
  .hero p, .page-heading p { font-size: .94rem; }
  .hero .button { flex: 0 0 auto; }
  .page-heading { flex-direction: column; gap: .65rem; margin-bottom: .85rem; }
  .page-heading > .button { width: 100%; }
  .page-heading .page-actions { display: grid; width: 100%; grid-template-columns: 1fr; }
  .page-heading .page-actions .button, .page-heading .page-actions form, .page-heading .page-actions form .button { width: 100%; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: .65rem; }
  .section-heading > .button { width: 100%; }
  .next-step-card { padding: .9rem; }
  .tools-panel { padding: .85rem; }
  .task-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .3rem .65rem; min-height: 4.25rem; padding: .65rem .8rem; }
  .task-row > .task-count, .task-row > .asset-kind-mark { grid-column: 1; grid-row: 1; }
  .task-row > .task-main { grid-column: 2; grid-row: 1; }
  .task-row > .task-main:first-child { grid-column: 1 / 3; }
  .task-row > .status { grid-column: 2; grid-row: 2; justify-self: start; margin: 0; }
  .task-row > span:last-child:not(.status) { grid-column: 3; grid-row: 1 / span 2; margin-left: 0; }
  .all-clear { align-items: flex-start; padding: .9rem; }
  .inventory-search, .inventory-grid { grid-template-columns: 1fr; }
  .inventory-card { min-height: 0; }
  .inventory-children-heading { align-items: stretch; flex-direction: column; }
  .child-actions { justify-content: stretch; }
  .child-actions .button { width: 100%; }
  .filter-bar { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .tool-link-grid { grid-template-columns: 1fr; }
  .tools-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .tool-action-card { min-height: 7.15rem; align-items: center; padding: .7rem .55rem; text-align: center; }
  .tool-action-icon { width: 2.45rem; height: 2.45rem; flex-basis: 2.45rem; margin: 0 auto .35rem; font-size: 1.4rem; }
  .tool-action-card strong { line-height: 1.2; }
  .tool-action-card small { margin-top: .2rem; font-size: .78rem; line-height: 1.25; }
  .profile-grid, .catalog-cards { grid-template-columns: 1fr; }
  .profile-summary { grid-template-columns: 1fr; }
  .profile-actions { flex-direction: column; }
  .profile-actions .button, .profile-actions form, .profile-actions form .button { width: 100%; }
  .check-row { grid-template-columns: 1fr 2.5rem; }
  .check-row .check-code { grid-column: 1 / -1; }
  .catalog-row { grid-template-columns: 2rem minmax(0, 1fr) auto; }
  .catalog-row .catalog-controls { grid-column: 2; flex-direction: column; }
  .catalog-row .order-buttons { grid-column: 2; grid-row: 3; }
  .catalog-row .check-toggle { grid-column: 3; grid-row: 1 / span 3; }
  .sortable-check-row:not(.is-selected) { grid-template-columns: minmax(0, 1fr) auto; }
  .sortable-check-row:not(.is-selected) .catalog-check-text { grid-column: 1; }
  .sortable-check-row:not(.is-selected) .check-toggle { grid-column: 2; grid-row: 1; }
  .page-actions { width: 100%; }
  .page-actions .button, .page-actions form { flex: 1 1 12rem; }
  .page-actions form .button { width: 100%; }
  .report-preview-page-actions:has(> form), .report-preview-page-actions:has(> a.primary) { grid-template-columns: 1fr; }
  .inventory-heading-actions { align-self: stretch; margin-left: 0; }
  .confirm-card { grid-template-columns: 1fr; }
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions .button { width: 100%; }
  .import-metadata, .import-stat-grid, .import-breakdown { grid-template-columns: 1fr; }
  .issue-row { grid-template-columns: 1fr; gap: .25rem; }
  .import-actions form, .import-actions form .button { width: 100%; }
  .center-result-row { align-items: stretch; flex-direction: column; }
  .center-result-row .button { width: 100%; }
  .overlap-warning { grid-template-columns: 1fr; }
  .order-summary, .inspection-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-summary.operational-summary, .inspection-overview.operational-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-summary > div, .inspection-overview > div, .order-summary > div:nth-child(3n), .inspection-overview > div:nth-child(3n) { border-right: 1px solid var(--border); }
  .order-summary > div:nth-child(2n), .inspection-overview > div:nth-child(2n) { border-right: 0; }
  .table-wrap:has(.responsive-table) { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .responsive-table, .responsive-table tbody { display: block; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .responsive-table tbody { display: grid; gap: .75rem; }
  .responsive-table tr { display: grid; overflow: hidden; border: 1px solid var(--border); border-radius: 1rem; background: white; box-shadow: 0 5px 20px rgba(31, 41, 51, .05); }
  .responsive-table td { display: grid; min-width: 0; grid-template-columns: minmax(6.5rem, .42fr) minmax(0, 1fr); align-items: start; gap: .7rem; border-top: 1px solid var(--border); padding: .7rem .85rem; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); font-size: .7rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
  .responsive-table td > .status { justify-self: start; }
  .responsive-table td:first-child { display: block; border-top: 0; padding-top: .85rem; padding-bottom: .85rem; }
  .responsive-table td:first-child::before { display: block; margin-bottom: .35rem; }
  .responsive-table td.table-actions { display: grid; grid-template-columns: minmax(6.5rem, .42fr) minmax(0, 1fr); }
  .responsive-table td.table-actions .button { width: 100%; }
  .responsive-table .table-empty { display: block; padding: 1.25rem; }
  .responsive-table .table-empty::before { content: none; }
  .finalization-card { align-items: stretch; flex-direction: column; }
  .finalization-card .button { width: 100%; }
  .compact-search { grid-template-columns: 1fr; }
  .bulk-assignment-form { grid-template-columns: 1fr; }
  .inline-assignment-form { align-items: stretch; flex-direction: column; }
  .inline-assignment-form select, .inline-assignment-form .button { width: 100%; }
  .inspection-row { align-items: center; }
  .scope-summary-grid { grid-template-columns: 1fr; }
  .table-actions { flex-direction: column; }
  .capture-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capture-progress > div:nth-child(2) { border-right: 0; }
  .capture-progress > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .pass-context-card, .quick-result-grid, .earth-state-options, .reason-chip-grid, .resolution-fields, .finding-resolution-fields { grid-template-columns: 1fr; }
  .finding-resolution-fields .field-wide { grid-column: auto; }
  .finding-summary-grid { grid-template-columns: repeat(3, minmax(6.5rem, 1fr)); overflow-x: auto; }
  .finding-summary-grid > a, .finding-summary-grid > div { padding: .7rem; }
  .finding-card { grid-template-columns: auto minmax(0, 1fr); }
  .finding-card > .status { grid-column: 2; justify-self: start; }
  .report-preview-details, .report-action dl, .report-signature, .report-pass-meta, .report-scope, .report-action-meta, .document-history-metadata { grid-template-columns: 1fr; }
  .document-history-metadata > div { border-right: 0; }
  .document-history-card-heading { flex-direction: column; }
  .document-history-badges { justify-content: flex-start; }
  .report-response-heading, .report-finding-heading, .report-calculation-value { align-items: flex-start; flex-direction: column; }
  .report-finding-heading > div:last-child { align-items: flex-start; }
  .capture-asset-heading, .measurement-row { align-items: stretch; flex-direction: column; }
  .capture-group-title, .capture-group-bulk { align-items: stretch; flex-direction: column; }
  .capture-group-bulk .button { width: 100%; }
  .capture-step-controls { grid-template-columns: 1fr 1fr; }
  .capture-step-controls span { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .capture-step-tabs button { min-width: 8rem; }
  .capture-asset-heading .button { width: 100%; }
  .signature-actions { flex-direction: column-reverse; }
  .signature-actions .button { width: 100%; }
  .proposal-actions { display: grid; grid-template-columns: 1fr; }
  .proposal-actions > form, .proposal-actions > form .button, .decline-offer-panel, .decline-offer-panel > summary, .decline-offer-panel form { width: 100%; }
  .pagination { flex-wrap: wrap; }
  .capture-save-actions { bottom: calc(4.6rem + env(safe-area-inset-bottom)); }

  .capture-overview { grid-template-columns: minmax(0, 1fr); gap: .45rem; margin-bottom: .55rem; }
  .capture-overview .capture-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: .25rem .5rem;
  }
  .capture-overview .capture-heading h1 { margin: .08rem 0 .12rem; font-size: 1.15rem; line-height: 1.08; }
  .capture-overview .capture-heading p { margin-top: 0; font-size: .74rem; line-height: 1.2; }
  .capture-overview .capture-heading .eyebrow { font-size: .62rem; }
  .capture-overview .capture-heading .status { align-self: start; }
  .capture-overview .asset-location-link { min-height: var(--touch-target); grid-column: 1; justify-self: start; padding: .35rem .65rem; font-size: .76rem; }
  .capture-overview .capture-progress { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-column: 1; }
  .capture-overview .capture-progress > div { gap: .08rem; border-right: 1px solid var(--border); border-bottom: 0; padding: .4rem .35rem; }
  .capture-overview .capture-progress > div:nth-child(2) { border-right: 1px solid var(--border); }
  .capture-overview .capture-progress > div:last-child { border-right: 0; }
  .capture-overview .capture-progress small { font-size: .61rem; line-height: 1.12; }
  .capture-overview .capture-progress strong { font-size: .96rem; }
  .capture-group-title { align-items: center; flex-direction: row; gap: .55rem; padding: .55rem .65rem; }
  .capture-group-title h2 { font-size: .96rem; }
  .capture-group-title > small { flex: 0 0 auto; }
}
@media (max-width: 759px) {
  .focused-flow { padding-bottom: 1rem; }
  .focused-flow .bottom-nav { display: none; }
  .focused-flow .capture-save-actions { bottom: 0; padding-bottom: max(.7rem, env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .order-summary, .inspection-overview { grid-template-columns: 1fr; }
  .order-summary.operational-summary, .inspection-overview.operational-summary { grid-template-columns: 1fr; }
  .order-summary > div, .inspection-overview > div, .order-summary > div:nth-child(2n), .inspection-overview > div:nth-child(2n) { border-right: 0; }
  .responsive-table td, .responsive-table td.table-actions { grid-template-columns: 1fr; gap: .3rem; }
  .responsive-table td.table-actions::before { margin-bottom: .2rem; }
  .capture-group > summary, .response-heading, .earth-assessment-heading, .closed-pass-summary { align-items: flex-start; flex-direction: column; }
}

@media (min-width: 760px) {
  body { padding-bottom: 1rem; }
  .app-header { position: static; }
  .workspace-badge { display: inline-flex; }
  .bottom-nav { position: static; justify-content: center; gap: 2rem; box-shadow: none; }
  .bottom-nav a { min-width: 4.4rem; flex: 0 0 auto; flex-direction: row; font-size: .9rem; }
  .bottom-nav span { font-size: 1.1rem; }
  .sticky-form-actions { bottom: 0; }
  .capture-save-actions { bottom: 0; }
}

/* Un teléfono girado dispone de anchura, pero de muy poca altura. Esta capa
   mantiene densidad y objetivos táctiles reales sin tratarlo como escritorio. */
@media (orientation: landscape) and (max-height: 540px) and (max-width: 960px) {
  :root { --space-page-inline: .75rem; --space-card: .72rem; }
  body { padding-bottom: calc(3.25rem + env(safe-area-inset-bottom)); }
  .app-header { position: sticky; min-height: 3.1rem; gap: .5rem; padding: .3rem max(.75rem, env(safe-area-inset-right)) .3rem max(.75rem, env(safe-area-inset-left)); }
  .brand { gap: .45rem; font-size: .95rem; }
  .brand img { width: 30px; height: 30px; border-radius: .55rem; }
  .workspace-badge { display: none; }
  .link-button { min-height: var(--touch-target); padding: .4rem .55rem; }
  .bottom-nav { position: fixed; justify-content: stretch; gap: 0; padding: .15rem max(.35rem, env(safe-area-inset-right)) max(.15rem, env(safe-area-inset-bottom)) max(.35rem, env(safe-area-inset-left)); box-shadow: 0 -4px 18px rgba(0, 0, 0, .06); }
  .bottom-nav a { min-width: 0; min-height: var(--touch-target); flex: 1 1 0; flex-direction: row; justify-content: center; gap: .28rem; padding: .2rem .3rem; font-size: .72rem; }
  .bottom-nav span { font-size: 1rem; }
  .focused-flow { padding-bottom: 0; }
  .focused-flow .bottom-nav { display: none; }
  .focused-flow .page-shell { padding-bottom: .75rem; }

  .focused-flow .page-shell { padding-top: .35rem; }
  .capture-overview {
    grid-template-columns: minmax(12rem, 1.35fr) auto minmax(18rem, 1fr);
    gap: .45rem;
    margin-bottom: .35rem;
  }
  .capture-overview .capture-heading { grid-column: 1; grid-row: 1; }
  .capture-overview .asset-location-link { min-height: var(--touch-target); grid-column: 2; grid-row: 1; padding: .4rem .6rem; }
  .capture-overview .capture-progress { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-column: 3; grid-row: 1; }
  .capture-overview .capture-heading h1 { margin: .05rem 0 .1rem; font-size: 1.05rem; }
  .capture-overview .capture-heading p { font-size: .68rem; }
  .capture-overview .capture-progress > div { padding: .32rem .3rem; }
  .capture-overview .capture-progress small { font-size: .56rem; }
  .capture-overview .capture-progress strong { font-size: .9rem; }
  .capture-step-tabs { padding: .05rem 0 .35rem; }
  .capture-step-tabs button { min-width: 7.5rem; min-height: var(--touch-target); padding: .35rem .5rem; font-size: .69rem; }
  .capture-step-tabs button > span { min-width: 1.4rem; height: 1.4rem; }
  .capture-first-pending { margin-bottom: 0; }
  .capture-group-title { padding: .45rem .55rem; }

  .page-shell { padding-top: .55rem; padding-bottom: .9rem; }
  h1 { margin: 0 0 .35rem; font-size: 1.45rem; line-height: 1.05; }
  h2 { margin: .2rem 0 .4rem; font-size: 1rem; }
  p { line-height: 1.35; }
  .eyebrow { font-size: .7rem; letter-spacing: .07em; }
  .hero { align-items: center; margin-bottom: .55rem; }
  .hero p, .page-heading p { margin-top: .2rem; font-size: .84rem; line-height: 1.3; }
  .preventive-map { height: min(52vh, 20rem); min-height: 12rem; }
  .preventive-map-floating-control { top: .35rem; max-width: min(25rem, calc(100% - 4.6rem)); }
  .preventive-map-floating-control[open] { width: min(25rem, calc(100% - 4.6rem)); }
  .preventive-map-floating-control > summary { min-height: var(--touch-target); padding: .45rem .6rem; }
  .preventive-map-layer-controls { max-height: calc(100dvh - 7rem); grid-template-columns: repeat(3, minmax(0, 1fr)); padding: .35rem; }
  .preventive-map-layer-toggle { position: relative; min-height: var(--touch-target); gap: .25rem; padding: .3rem; border-radius: .65rem; font-size: .67rem; overflow-wrap: normal; }
  .preventive-map-layer-toggle input { position: absolute; width: 1px; height: 1px; min-height: 1px; overflow: hidden; opacity: 0; }
  .preventive-map-layer-toggle:has(input:checked) { border-color: var(--accent); background: var(--accent-pale); }
  .preventive-map-layer-toggle > span { width: 1.35rem; height: 1.35rem; font-size: .6rem; }
  .page-heading { align-items: center; gap: .65rem; margin-bottom: .55rem; }
  .page-heading.compact { margin-bottom: .55rem; }
  .section-heading { margin-bottom: .45rem; }
  .workspace-section { margin-bottom: .65rem; }
  .panel, .empty-state, .compact-task-list, .model-form, .table-wrap, .next-step-card, .inventory-card, .profile-card, .capture-group { border-radius: .8rem; }
  .next-step-card { margin-bottom: .55rem; padding: .75rem; }
  .next-step-card h2 { margin-top: .35rem; font-size: 1.05rem; }
  .next-step-card p { margin: .25rem 0; font-size: .86rem; line-height: 1.32; }
  .ready-mark { width: 2rem; height: 2rem; flex-basis: 2rem; font-size: 1.05rem; }
  .task-row { min-height: var(--touch-target); gap: .55rem; padding: .45rem .65rem; }
  .task-main { gap: .08rem; }
  .task-main small { font-size: .73rem; }
  .task-count, .asset-kind-mark { min-width: 2rem; width: 2rem; height: 2rem; font-size: .9rem; }
  .all-clear { padding: .65rem; }
  .inventory-search, .filter-bar { gap: .5rem; margin-bottom: .65rem; padding: .65rem; }
  .inventory-grid, .profile-grid, .catalog-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .inventory-card, .profile-card { min-height: 0; padding: .7rem; }
  .inventory-card h3, .profile-card h2 { margin-top: .45rem; }
  .inventory-summary { padding-top: .45rem; }
  .asset-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-bottom: .65rem; }
  .asset-overview > div { padding: .55rem; }
  .stacked-form, .capture-form { gap: .5rem; }
  .model-form { padding: .75rem; }
  .form-grid { gap: .6rem; }
  .form-actions { margin-top: .65rem; padding-top: .65rem; }
  .tools-panel { margin-top: .65rem; padding: .7rem; }
  .tool-link-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .tool-link-grid a { padding: .65rem; }
  .tools-action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .tool-action-card { display: grid; min-height: 4.75rem; grid-template-columns: 2.35rem minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; align-items: center; gap: .08rem .55rem; padding: .55rem .65rem; text-align: left; }
  .tool-action-icon { width: 2.35rem; height: 2.35rem; grid-row: 1 / 3; margin: 0; font-size: 1.25rem; }
  .tool-action-card strong { align-self: end; font-size: .92rem; line-height: 1.15; }
  .tool-action-card small { align-self: start; margin: 0; font-size: .7rem; line-height: 1.2; }
  .profile-summary { grid-template-columns: 2fr 1fr 1fr; gap: .5rem; padding: .65rem; }
  .profile-actions { margin-bottom: .65rem; }
  .check-groups { gap: .5rem; }
  .check-group > summary, .capture-group > summary { padding: .55rem .7rem; }
  .check-row { padding: .5rem .65rem; }
  .catalog-row { padding: .55rem .65rem; }
  .order-summary, .inspection-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: .65rem; }
  .order-summary > div, .inspection-overview > div { padding: .55rem .65rem; }
  .pass-context-card { grid-template-columns: .8fr 1.2fr; gap: .55rem; padding: .65rem; }
  .capture-progress { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: .55rem; }
  .capture-progress > div { padding: .5rem .6rem; }
  .capture-progress strong { font-size: 1.05rem; }
  .capture-group-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; padding: .55rem; }
  .capture-asset-heading { padding: .55rem; }
  .response-list { gap: .5rem; padding: .5rem; }
  .response-heading { padding: .55rem .6rem .35rem; }
  .response-card fieldset { padding: .3rem .6rem .6rem; }
  .earth-assessment-panel, .earth-assessment-card, .signature-card { padding: .7rem; }
  .earth-assessment-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .capture-save-actions { bottom: 0; }
  .capture-save-actions { grid-template-columns: minmax(10rem, 1fr) repeat(2, minmax(8rem, .7fr)); align-items: center; }
  .capture-save-actions .save-pass-status { grid-column: auto; min-height: var(--touch-target); display: grid; place-items: center; }
  .signature-card canvas, .local-signature-block canvas { height: 7rem; }
  .report-preview-body { padding: .7rem; }
  .report-preview-details, .report-action dl, .report-signature, .report-pass-meta, .report-scope, .document-history-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-pass-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .report-action-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* El acceso presenta el producto sin arrastrar la carcasa de una sesión. */
body.auth-page {
  padding-bottom: 0;
  background: #edf1f3;
}
.auth-page .offline-banner {
  position: fixed;
  z-index: 60;
  right: 0;
  left: 0;
}
.auth-shell {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  padding: clamp(1rem, 3vw, 2rem);
  isolation: isolate;
}
.auth-shell::before,
.auth-shell::after {
  position: absolute;
  z-index: -1;
  width: min(35rem, 54vw);
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  filter: blur(2px);
}
.auth-shell::before { top: -24%; right: -13%; background: rgba(40, 82, 71, .11); }
.auth-shell::after { bottom: -35%; left: -16%; background: rgba(43, 69, 87, .08); }
.auth-shell > .message-stack {
  position: fixed;
  z-index: 10;
  top: 1rem;
  right: 1rem;
  width: min(28rem, calc(100% - 2rem));
}
.auth-layout {
  display: grid;
  width: min(100%, 70rem);
  min-height: min(42rem, calc(100dvh - 2rem));
  grid-template-columns: minmax(22rem, .95fr) minmax(24rem, 1.05fr);
  overflow: hidden;
  border: 1px solid rgba(62, 76, 87, .12);
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 28px 75px rgba(31, 41, 51, .18);
}
.auth-brand-panel {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(1.6rem, 3.5vw, 3.25rem);
  color: #fff;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 255, 255, .16), transparent 28%),
    linear-gradient(145deg, #397568 0%, #285247 52%, #16362e 100%);
}
.auth-brand-lockup { position: relative; z-index: 2; display: flex; align-items: center; gap: .85rem; }
.auth-brand-lockup img { width: 3.15rem; height: 3.15rem; border: 2px solid rgba(255, 255, 255, .68); border-radius: .9rem; box-shadow: 0 7px 20px rgba(6, 39, 31, .25); }
.auth-product-name { display: flex; flex-direction: column; line-height: 1.05; }
.auth-product-name strong { font-size: 1.38rem; letter-spacing: -.02em; }
.auth-product-name span { margin-top: .18rem; color: rgba(255, 255, 255, .78); font-size: .78rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.auth-brand-copy { position: relative; z-index: 2; max-width: 28rem; margin: auto 0; padding-bottom: 6.5rem; }
.auth-brand-copy .eyebrow { color: #d7eee6; }
.auth-brand-copy h1 { max-width: 25rem; margin: .65rem 0 .9rem; color: #fff; font-size: clamp(2.2rem, 3.2vw, 3.35rem); line-height: 1.02; letter-spacing: -.045em; }
.auth-brand-copy h1 span { display: block; }
.auth-brand-copy p { max-width: 25rem; margin: 0; color: rgba(255, 255, 255, .83); font-size: 1rem; line-height: 1.55; }
.auth-brand-visual { display: block; flex-shrink: 0; width: calc(100% + 2 * clamp(1.6rem, 3.5vw, 3.25rem)); max-width: none; height: auto; margin: auto calc(0px - clamp(1.6rem, 3.5vw, 3.25rem)) 0; object-fit: contain; pointer-events: none; }
.auth-brand-pulse { position: absolute; z-index: 2; top: calc(clamp(1.6rem, 3.5vw, 3.25rem) + .75rem); right: clamp(1.6rem, 3.5vw, 3.25rem); display: block; width: min(36%, 10rem); height: auto; overflow: visible; color: #eefbf6; opacity: .82; pointer-events: none; }
.auth-brand-pulse path { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.auth-form-panel { display: grid; min-width: 0; place-items: center; padding: clamp(2rem, 5vw, 4.5rem); background: linear-gradient(rgba(255, 255, 255, .96), rgba(255, 255, 255, .96)), repeating-linear-gradient(135deg, #edf1f3 0 1px, transparent 1px 14px); }
.auth-form-inner { width: min(100%, 25rem); }
.auth-form-heading { margin-bottom: 1.65rem; }
.auth-form-heading h2 { margin: .45rem 0 .55rem; font-size: clamp(2rem, 2.8vw, 2.65rem); line-height: 1.05; letter-spacing: -.035em; }
.auth-form-heading p { margin: 0; color: var(--muted); line-height: 1.45; }
.auth-form { gap: .95rem; }
.auth-form .field { gap: .42rem; }
.auth-form .field label { margin: 0; color: #3a4751; font-size: .82rem; letter-spacing: .01em; }
.auth-form input { min-height: 3.15rem; border-color: #aeb9c1; border-radius: .75rem; background: #f9fafb; padding: .72rem .8rem; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.auth-form input:hover { border-color: #8797a2; background: #fff; }
.auth-form input:focus { border-color: var(--accent); outline: 0; background: #fff; box-shadow: 0 0 0 4px rgba(40, 82, 71, .14); }
.password-field { position: relative; }
.password-field input { padding-right: 5.4rem; }
.password-toggle { position: absolute; top: 50%; right: .3rem; min-width: 4.7rem; min-height: var(--touch-target); transform: translateY(-50%); border: 0; border-radius: .55rem; color: var(--accent-dark); background: transparent; font: inherit; font-size: .76rem; font-weight: 850; cursor: pointer; }
.password-toggle:hover, .password-toggle:focus-visible { outline: 0; background: var(--accent-soft); }
.auth-submit { min-height: 3.15rem; margin-top: .35rem; border-radius: .75rem; box-shadow: 0 8px 18px rgba(22, 54, 46, .2); }
.auth-submit:focus-visible, .auth-install-button:focus-visible { outline: 3px solid rgba(40, 82, 71, .25); outline-offset: 2px; }
.auth-help { margin: 1.35rem 0 0; border-top: 1px solid var(--border); padding-top: 1rem; color: var(--muted); font-size: .78rem; line-height: 1.45; text-align: center; }
.auth-map-credit { display: block; margin-top: .4rem; color: #89949c; font-size: .58rem; line-height: 1.2; text-align: center; }
.auth-map-credit a { color: inherit; text-decoration: none; }
.auth-map-credit a:hover, .auth-map-credit a:focus-visible { text-decoration: underline; }
.auth-install-button { display: block; min-height: var(--touch-target); margin: .5rem auto 0; border: 0; color: var(--accent-dark); background: transparent; font: inherit; font-size: .78rem; font-weight: 850; text-decoration: underline; text-underline-offset: .18rem; cursor: pointer; }
.auth-install-button.is-installable { display: block; }
.auth-install-button[hidden] { display: none; }
.auth-install-help { margin: .25rem auto 0; color: var(--muted); font-size: .68rem; line-height: 1.3; text-align: center; }

@media (min-width: 761px) {
  .auth-brand-panel { padding-bottom: 0; }
  .auth-brand-copy { margin: 1.75rem 0 1.5rem; padding-bottom: 0; }
}

@media (max-width: 760px) {
  :root { --space-page-inline: .85rem; --space-card: .85rem; }
  .auth-shell { align-items: center; overflow: auto; padding: .7rem; }
  .auth-layout { width: min(100%, 32rem); min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; margin: auto; border-radius: 1.2rem; }
  .auth-brand-panel { min-height: clamp(16rem, calc(12rem + 9dvh), 18rem); padding: 1.15rem 1.25rem; }
  .auth-brand-lockup { gap: .65rem; }
  .auth-brand-lockup img { width: 2.45rem; height: 2.45rem; border-radius: .72rem; }
  .auth-product-name strong { font-size: 1.14rem; }
  .auth-product-name span { font-size: .69rem; }
  .auth-brand-copy { max-width: 19rem; margin: 1.1rem 0 0; padding-bottom: 0; }
  .auth-brand-copy .eyebrow { font-size: .7rem; }
  .auth-brand-copy h1 { max-width: 18rem; margin: .35rem 0 .4rem; font-size: 1.68rem; letter-spacing: -.035em; }
  .auth-brand-copy p { max-width: 18rem; font-size: .83rem; line-height: 1.4; }
  .auth-brand-visual, .auth-map-credit { display: none; }
  .auth-brand-pulse { top: 1.45rem; right: 1.25rem; bottom: auto; left: auto; width: min(36%, 8.5rem); }
  .auth-install-button { display: block; }
  .auth-form-panel { align-items: start; padding: 1.4rem 1.25rem 1.5rem; }
  .auth-form-inner { width: 100%; max-width: none; }
  .auth-form-heading { margin-bottom: 1.1rem; }
  .auth-form-heading h2 { margin: .3rem 0 .35rem; font-size: 1.72rem; }
  .auth-form-heading p { font-size: .86rem; }
  .auth-form { gap: .72rem; }
  .auth-help { margin-top: 1rem; padding-top: .8rem; }
}

@media (orientation: portrait) and (max-width: 760px) and (max-height: 760px) {
  .auth-shell { padding: .35rem; }
  .auth-layout { border-radius: 1rem; }
  .auth-brand-panel { min-height: clamp(12.25rem, calc(9.5rem + 9dvh), 14rem); padding: .75rem 1rem; }
  .auth-brand-lockup { gap: .5rem; }
  .auth-brand-lockup img { width: 2rem; height: 2rem; border-radius: .6rem; }
  .auth-product-name strong { font-size: .98rem; }
  .auth-product-name span { margin-top: .1rem; font-size: .59rem; }
  .auth-brand-copy { margin-top: .5rem; }
  .auth-brand-copy .eyebrow, .auth-form-heading .eyebrow { font-size: .62rem; }
  .auth-brand-copy h1 { margin: .22rem 0 .28rem; font-size: 1.38rem; line-height: .98; }
  .auth-brand-copy p { font-size: .73rem; line-height: 1.3; }
  .auth-brand-pulse { top: 1rem; right: 1rem; bottom: auto; left: auto; width: min(35%, 7rem); }
  .auth-form-panel { padding: .75rem 1rem .8rem; }
  .auth-form-heading { margin-bottom: .55rem; }
  .auth-form-heading h2 { margin: .18rem 0 .22rem; font-size: 1.42rem; }
  .auth-form-heading p { font-size: .75rem; line-height: 1.3; }
  .auth-form { gap: .4rem; }
  .auth-form .field { gap: .18rem; }
  .auth-form .field label { font-size: .72rem; }
  .auth-form input, .auth-submit { min-height: var(--touch-target); }
  .auth-submit { margin-top: .1rem; }
  .auth-help { margin-top: .5rem; padding-top: .45rem; font-size: .66rem; line-height: 1.3; }
  .auth-install-button { margin-top: .05rem; font-size: .68rem; }
}

@media (orientation: landscape) and (max-height: 540px) and (max-width: 960px) {
  body.auth-page { padding-bottom: 0; }
  .auth-shell { align-items: center; overflow: auto; padding: .45rem; }
  .auth-layout { width: min(100%, 55rem); min-height: calc(100dvh - .9rem); grid-template-columns: minmax(13rem, .8fr) minmax(21rem, 1.2fr); grid-template-rows: none; border-radius: 1rem; }
  .auth-brand-panel { min-height: 0; padding: .9rem 1.15rem; }
  .auth-brand-lockup img { width: 2.25rem; height: 2.25rem; }
  .auth-product-name strong { font-size: 1rem; }
  .auth-brand-copy { margin: auto 0; padding: .65rem 0 3.5rem; }
  .auth-brand-copy .eyebrow, .auth-form-heading .eyebrow { font-size: .62rem; }
  .auth-brand-copy h1 { margin: .28rem 0 .38rem; font-size: clamp(1.35rem, 3.2vw, 1.8rem); line-height: 1.02; }
  .auth-brand-copy p { font-size: .72rem; line-height: 1.32; }
  .auth-brand-visual, .auth-map-credit { display: none; }
  .auth-brand-pulse { top: auto; right: auto; bottom: .7rem; left: 1.15rem; width: min(46%, 9.5rem); }
  .auth-install-button { display: block; }
  .auth-form-panel { align-items: center; padding: .75rem 1.35rem; }
  .auth-form-inner { width: min(100%, 25rem); }
  .auth-form-heading { margin-bottom: .55rem; }
  .auth-form-heading h2 { margin: .18rem 0 .22rem; font-size: 1.45rem; }
  .auth-form-heading p { font-size: .75rem; }
  .auth-form { gap: .38rem; }
  .auth-form .field { gap: .18rem; }
  .auth-form .field label { font-size: .7rem; }
  .auth-form input, .auth-submit { min-height: var(--touch-target); }
  .auth-submit { margin-top: .1rem; }
  .auth-help { margin: .5rem 0 0; padding-top: .45rem; font-size: .66rem; line-height: 1.3; }
  .auth-install-button { margin-top: .05rem; font-size: .68rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
