: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;
  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 { min-height: 100%; background: var(--background); }
body { min-height: 100vh; margin: 0; padding-bottom: 5.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: 4.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .96);
  padding: .65rem max(1rem, 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;
  border: 0;
  background: transparent;
  padding: .75rem;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.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: .45rem max(.5rem, env(safe-area-inset-right)) max(.45rem, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 18px rgba(0, 0, 0, .06);
}
.bottom-nav a {
  display: flex;
  min-width: 0;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  padding: .25rem;
  color: #48545e;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
}
.bottom-nav span { color: var(--accent); font-size: 1.4rem; line-height: 1; }

.page-shell { width: min(100%, 52rem); min-width: 0; margin: 0 auto; padding: 1.15rem 1rem 2rem; }

h1 { margin: .2rem 0 .7rem; font-size: clamp(1.65rem, 7vw, 2.35rem); line-height: 1.1; }
h2 { margin: .4rem 0 .65rem; font-size: 1.15rem; }
h3 { margin: .25rem 0 .4rem; font-size: 1rem; }
h1, h2, h3, .task-main, .page-heading { overflow-wrap: anywhere; }
p { line-height: 1.48; }
.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: 1rem;
  margin-bottom: 1.25rem;
}
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; }
.page-heading.compact { margin-bottom: 1.15rem; }
.page-heading h1 { margin-bottom: .45rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.workspace-section { margin-bottom: 1.25rem; }

.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: 7vh auto 0; padding: 1.5rem; }
.auth-card .muted { margin: .35rem 0 1.1rem; }
.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: 1rem;
  border: 1px solid #9ec0b2;
  border-radius: 1rem;
  background: linear-gradient(160deg, #fff, var(--accent-pale));
  padding: 1.2rem;
  box-shadow: 0 8px 28px rgba(22, 54, 46, .08);
}
.next-step-card h2 { margin-top: .75rem; font-size: 1.3rem; }
.next-step-card p { margin: .45rem 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.8rem;
  align-items: center;
  gap: .8rem;
  border-bottom: 1px solid var(--border);
  padding: .8rem 1rem;
  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.7rem; }
.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.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: .75rem;
  background: var(--accent);
  color: white;
  font-size: 1.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.5rem;
  height: 2.5rem;
  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: .85rem; padding: 1.2rem; 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: 1rem; border: 1px solid var(--border); border-radius: 1rem; background: white; padding: 1rem; }
.tools-panel > summary { cursor: pointer; font-weight: 850; }
.tools-panel[open] > summary { margin-bottom: .8rem; }
.field-help { margin: 0 0 .8rem; 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: 3rem;
  border: 1px solid #abb6bf;
  border-radius: .65rem;
  background: white;
  padding: .75rem;
  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: 3rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: .7rem;
  padding: .65rem 1rem;
  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: 2.55rem; 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: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: white;
  padding: 1rem;
}
.inventory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.inventory-card {
  display: flex;
  min-width: 0;
  min-height: 10rem;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: white;
  padding: 1rem;
  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: .9rem 0 .25rem; font-size: 1.05rem; }
.inventory-card p { margin: 0 0 .75rem; color: var(--muted); font-size: .86rem; }
.inventory-summary { display: flex; gap: 1rem; margin-top: auto; border-top: 1px solid var(--border); padding-top: .75rem; color: var(--muted); font-size: .8rem; }
.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: .7rem; margin-bottom: 1.25rem; }
.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: 2.55rem; 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: 2.55rem; 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: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: white;
  padding: 1rem;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { background: #f0f3f4; padding: .75rem .8rem; color: #53606a; font-size: .72rem; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
td { border-top: 1px solid var(--border); padding: .85rem .8rem; 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: .28rem .58rem; font-size: .75rem; 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; }
.table-empty { padding: 2rem 1rem; color: var(--muted); text-align: center; }
.table-note { color: var(--muted); font-size: .8rem; }

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

.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: .85rem; }
.profile-card { display: flex; min-width: 0; flex-direction: column; border: 1px solid var(--border); border-radius: 1rem; background: white; padding: 1rem; box-shadow: 0 5px 20px rgba(31, 41, 51, .05); }
.profile-card.system { border-top: 4px solid var(--accent); }
.profile-card h2 { margin-top: 1rem; font-size: 1.2rem; }
.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: 1rem; margin-bottom: .8rem; padding: 1rem; }
.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: 1rem; padding: .9rem 1rem; cursor: pointer; font-weight: 850; }
.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: 2rem; min-height: 2rem; 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: 2.4rem; 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-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); }
.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: .3rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .85rem 1rem; }
.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: 2.55rem; padding: .45rem .6rem; }
.cancellation-panel { margin-top: 1.4rem; }
.inspection-row .status { flex: 0 0 auto; }
.inspection-overview { margin-bottom: 1rem; }
.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-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: .8rem 1rem;
}
.capture-progress > div:last-child { border-right: 0; }
.capture-progress small { color: var(--muted); font-size: .72rem; }
.capture-progress strong { font-size: 1.25rem; }
.capture-feedback { margin-bottom: .8rem; }
.capture-form { display: grid; gap: .8rem; }
.pass-context-card { display: grid; grid-template-columns: .8fr 1.2fr; gap: .8rem; padding: 1rem; }
.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-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; cursor: pointer; font-weight: 850; }
.capture-group > summary small { color: var(--muted); font-size: .75rem; }
.capture-group[open] > summary { border-bottom: 1px solid var(--border); background: #f8faf9; }
.capture-group-body { display: grid; gap: .8rem; padding: .8rem; }
.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; }
.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 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; }
.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-explanation { display: flex; min-width: 0; flex-direction: column; gap: .3rem; margin-top: .65rem; color: var(--muted); font-size: .72rem; }
.response-explanation textarea { min-height: 4rem; padding: .55rem; font-size: .82rem; }
.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: 2.65rem; 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: auto; flex: 0 0 auto; 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; }
.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-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: auto; padding: .2rem; color: var(--danger); font-size: .7rem; }
.capture-save-actions { position: sticky; right: auto; bottom: 4.6rem; left: auto; margin: .2rem -1rem 0; }
.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: min(100%, 22rem); border: 1px solid var(--border); border-radius: .7rem; padding: .65rem .8rem; }
.decline-offer-panel summary { cursor: pointer; color: var(--danger); font-size: .82rem; font-weight: 800; }
.decline-offer-panel[open] summary { margin-bottom: .6rem; }
.decline-offer-panel .button { margin-top: .6rem; }

.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: 2.45rem; padding: .45rem .7rem; font-size: .76rem; }
.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) {
  body { padding-bottom: calc(5.75rem + env(safe-area-inset-bottom)); }
  .app-header { gap: .5rem; padding-right: max(.75rem, env(safe-area-inset-right)); padding-left: max(.75rem, env(safe-area-inset-left)); }
  .brand { gap: .5rem; font-size: 1rem; }
  .brand img { width: 34px; height: 34px; }
  .link-button { padding: .65rem .5rem; }
  .page-shell { padding: .9rem .75rem 1.75rem; }
  .hero { gap: 1rem; margin-bottom: 1rem; }
  .hero .button { flex: 0 0 auto; }
  .page-heading { flex-direction: column; gap: .75rem; margin-bottom: 1rem; }
  .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: 1rem; }
  .tools-panel { padding: .9rem; }
  .task-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .35rem .7rem; min-height: 4.6rem; padding: .75rem .85rem; }
  .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: 1rem; }
  .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; }
  .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 > 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-asset-heading .button { width: 100%; }
  .signature-actions { flex-direction: column-reverse; }
  .signature-actions .button { width: 100%; }
  .proposal-actions, .proposal-actions form, .proposal-actions .button, .decline-offer-panel { width: 100%; }
  .pagination { flex-wrap: wrap; }
  .capture-save-actions { bottom: calc(4.6rem + env(safe-area-inset-bottom)); margin-right: -.75rem; margin-left: -.75rem; }
}

@media (max-width: 420px) {
  .order-summary, .inspection-overview { 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; }
  .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; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
