:root {
  color-scheme: light;
  --ink: #10282a;
  --muted: #637371;
  --teal: #126d67;
  --teal-dark: #0a4f4c;
  --teal-pale: #dfeee9;
  --cream: #f4f1e8;
  --paper: #fffef9;
  --line: #d9dfd9;
  --orange: #da6b39;
  --red: #a83f3f;
  --shadow: 0 16px 45px rgba(16, 40, 42, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-header {
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: white;
  background: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 42px; height: 42px; object-fit: contain; border-radius: 50%; }
.brand span { display: grid; line-height: 1.15; }
.brand strong { font-size: 1.08rem; letter-spacing: 0.02em; }
.brand small { margin-top: 4px; color: #b8d1cc; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.header-actions a { color: #d5e2df; text-decoration: none; font-size: 0.9rem; }
.header-actions a:hover { color: white; }
.language-switch { display: inline-grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid #547371; border-radius: 999px; }
.language-switch button { min-width: 34px; min-height: 27px; padding: 0 7px; color: #bdd3ce; background: transparent; border: 0; font-size: .62rem; font-weight: 850; cursor: pointer; }
.language-switch button + button { border-left: 1px solid #547371; }
.language-switch button.active { color: var(--ink); background: #dce9e6; }
.local-badge {
  padding: 7px 10px;
  color: #d9f2eb;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid rgba(163, 222, 207, 0.36);
  border-radius: 999px;
}

.app-shell { max-width: 1680px; margin: 0 auto; padding: clamp(28px, 5vw, 66px) clamp(16px, 4vw, 64px) 64px; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 360px); gap: 48px; align-items: end; }
.eyebrow { margin: 0 0 10px; color: var(--teal); font-size: 0.73rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.intro h1 { max-width: 760px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.3rem, 5vw, 4.7rem); font-weight: 500; line-height: 0.98; letter-spacing: -0.04em; }
.intro > div > p:last-child { max-width: 760px; margin: 22px 0 0; color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.intro aside { padding: 20px 22px; background: var(--teal-pale); border-left: 3px solid var(--teal); }
.intro aside strong { font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; }
.intro aside p { margin: 8px 0 0; color: #395b57; line-height: 1.5; }

.module-tabs { margin: 42px 0 18px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: rgba(255,255,255,.45); }
.module-tabs button { min-height: 68px; padding: 12px 16px; display: grid; align-content: center; gap: 4px; color: #72807e; background: transparent; border: 0; border-right: 1px solid var(--line); text-align: left; }
.module-tabs button:last-child { border-right: 0; }
.module-tabs button span { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.module-tabs button b { font-weight: inherit; }
.module-tabs button.active { color: white; background: var(--teal); }
.module-tabs button.active span { color: #bfe1d9; }

.workspace { display: grid; grid-template-columns: minmax(310px, 420px) minmax(0, 1fr); align-items: start; background: var(--paper); box-shadow: var(--shadow); border: 1px solid var(--line); }
.control-panel { border-right: 1px solid var(--line); }
.panel-section { padding: 28px 26px; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; border-bottom: 1px solid var(--line); }
.panel-section:last-child { border-bottom: 0; }
.section-number { padding-top: 3px; color: var(--orange); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.08em; }
.section-body h2, .results-panel h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 500; }
.section-help { margin: 7px 0 16px; color: var(--muted); font-size: 0.82rem; line-height: 1.45; }

.drop-zone { min-height: 160px; padding: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; border: 1.5px dashed #9eb3ae; background: #f6f8f3; cursor: pointer; transition: .2s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--teal); background: var(--teal-pale); transform: translateY(-1px); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-mark { width: 38px; height: 38px; margin-bottom: 10px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 50%; font-size: 1.4rem; }
.drop-zone strong { font-size: .9rem; }
.drop-zone small { margin-top: 5px; color: var(--muted); font-size: .72rem; }
.text-button { width: 100%; margin-top: 9px; padding: 10px; color: var(--teal); background: transparent; border: 0; cursor: pointer; font-size: .82rem; font-weight: 750; }
.text-button:hover { text-decoration: underline; }
.file-status { margin: 6px 0 0; padding: 9px 10px; color: var(--muted); background: #f3f4ef; font-size: .74rem; line-height: 1.4; overflow-wrap: anywhere; }
.file-status.success { color: var(--teal-dark); background: var(--teal-pale); }
.file-status.error { color: var(--red); background: #f7e8e4; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-grid > label:first-child { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: #41504f; font-size: .75rem; font-weight: 700; }
select, input[type="text"], input[type="number"] { width: 100%; min-height: 39px; padding: 8px 9px; color: var(--ink); background: white; border: 1px solid #cbd4cf; border-radius: 0; }
select:focus, input:focus { outline: 2px solid rgba(18,109,103,.22); outline-offset: 1px; border-color: var(--teal); }
select:disabled { color: #909b98; background: #f0f1ed; }
.sweep-selector { min-height: 39px; display: grid; grid-template-columns: 39px minmax(0, 1fr) 39px; border: 1px solid #cbd4cf; background: white; }
.sweep-selector button {
  min-width: 39px;
  color: var(--teal);
  background: #f4f7f3;
  border: 0;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 800;
}
.sweep-selector button:first-child { border-right: 1px solid #d7dfda; }
.sweep-selector button:last-child { border-left: 1px solid #d7dfda; }
.sweep-selector button:hover:not(:disabled) { color: white; background: var(--teal); }
.sweep-selector button:disabled { color: #aeb8b5; cursor: not-allowed; }
.sweep-selector output { min-width: 0; padding: 9px 10px; overflow: hidden; color: var(--ink); text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.range-field { margin-bottom: 17px; }
.range-field span { display: flex; justify-content: space-between; gap: 12px; }
.range-field output { color: var(--teal); }
input[type="range"] { width: 100%; accent-color: var(--teal); }
details { margin-top: 16px; }
summary { color: var(--teal); font-size: .78rem; font-weight: 750; cursor: pointer; }
.field-grid.compact { margin-top: 12px; }
.field-grid .export-scope { grid-column: 1 / -1; }
.field-hint { margin: 12px 0 0; padding: 9px 10px; color: #395b57; background: var(--teal-pale); font-size: .72rem; line-height: 1.45; border-left: 2px solid var(--teal); }
.method-note { margin: 16px 0 0; padding: 12px; color: #7a543c; background: #f7ece3; font-size: .74rem; line-height: 1.45; border-left: 2px solid var(--orange); }
.mode-select { margin: 12px 0 16px; }
.parameter-block { padding-top: 15px; border-top: 1px solid var(--line); }
.pops-profile { margin-bottom: 14px; }
.toggle-row { margin-bottom: 14px; display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 9px; }
.toggle-row input { width: 17px; height: 17px; margin: 0; accent-color: var(--teal); }
.window-grid { margin-top: 12px; display: grid; grid-template-columns: minmax(105px, 1fr) 74px 74px; gap: 7px; align-items: center; }
.window-grid::before { content: "Ventana"; }
.window-grid::after { content: "Inicio    Fin"; grid-column: 2 / 4; white-space: pre; }
.window-grid::before, .window-grid::after { color: var(--muted); font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.window-grid span { color: #41504f; font-size: .7rem; font-weight: 700; }
.window-grid input { min-width: 0; min-height: 35px; }
.window-help { margin-top: 8px; display: block; color: var(--muted); font-size: .68rem; line-height: 1.4; }
.fixed-scope { min-height: 72px; padding: 8px 10px; display: grid; gap: 3px; align-content: center; border: 1px solid #cbd4cf; background: #f4f6f2; }
.fixed-scope span { color: var(--muted); font-size: .65rem; font-weight: 750; }
.fixed-scope strong { color: var(--ink); font-size: .74rem; }
.fixed-scope small, .saturation-help { color: var(--muted); font-size: .66rem; line-height: 1.45; }
.saturation-details { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.saturation-details h3 { margin: 0; color: var(--teal); font-size: .78rem; }
.saturation-help { margin: 9px 0 12px; padding: 10px 12px; background: #eef4f0; border-left: 3px solid var(--teal); }
.saturation-fields { margin-top: 10px; }

.results-panel { min-width: 0; padding: 30px; }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.trace-heading { min-width: 0; }
.trace-heading h2 { overflow-wrap: anywhere; }
.toolbar-actions { display: flex; gap: 8px; }
.toolbar-actions button { min-height: 39px; padding: 8px 13px; color: var(--teal); background: white; border: 1px solid #b9c9c4; cursor: pointer; font-size: .78rem; font-weight: 750; }
.toolbar-actions button.primary { color: white; background: var(--teal); border-color: var(--teal); }
.toolbar-actions button:disabled { color: #9aa3a1; background: #eceeea; border-color: #dde1dc; cursor: not-allowed; }

.review-workflow { margin-top: 18px; padding: 16px 18px; display: grid; grid-template-columns: minmax(210px, .8fr) minmax(260px, 1.2fr); gap: 10px 20px; border: 1px solid #cbd4cf; border-left: 4px solid #9aa5a2; background: #f6f7f3; }
.review-workflow[data-status="accepted"] { border-left-color: var(--teal); background: #f0f7f3; }
.review-workflow[data-status="rejected"] { border-left-color: var(--red); background: #fbf1ef; }
.review-workflow[data-status="stale"] { border-left-color: var(--orange); background: #fff7ef; }
.review-summary { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.review-summary > p { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.review-note { grid-column: 2; grid-row: 1; }
.review-note textarea { width: 100%; min-height: 72px; padding: 9px 10px; resize: vertical; color: var(--ink); background: white; border: 1px solid #cbd4cf; font: inherit; font-weight: 400; line-height: 1.45; }
.review-note textarea:focus { outline: 2px solid rgba(18,109,103,.22); outline-offset: 1px; border-color: var(--teal); }
.review-storage-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .66rem; line-height: 1.4; }

.point-editor { margin-top: 18px; padding: 18px; border: 1px solid #cbd4cf; background: #f7f8f4; }
.point-editor[data-armed="true"] { border-color: var(--orange); box-shadow: inset 4px 0 0 var(--orange); background: #fff8f0; }
.point-editor-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.point-editor-heading label { width: min(190px, 42%); }
.point-editor-controls { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 8px; }
.point-editor-controls button, .point-choice button {
  min-height: 38px;
  padding: 8px 12px;
  color: #41504f;
  background: white;
  border: 1px solid #b9c9c4;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 800;
}
.point-choice { display: inline-flex; }
.point-choice button + button { border-left: 0; }
.point-choice button.selected { color: white; background: var(--ink); border-color: var(--ink); }
.point-choice button.corrected::after { content: "†"; margin-left: 2px; color: #f4c692; }
.point-editor-controls button.primary { color: white; background: var(--teal); border-color: var(--teal); }
.point-editor[data-armed="true"] #arm-correction { background: var(--orange); border-color: var(--orange); }
.point-editor-controls button:disabled { color: #a2aaa8; background: #eceeea; border-color: #d9dfda; cursor: not-allowed; }
.point-editor-status { margin: 13px 0 0; color: var(--teal-dark); font-size: .75rem; font-weight: 700; line-height: 1.45; }
.point-editor-status.error { color: var(--red); }
.point-editor-note { margin: 7px 0 0; color: var(--muted); font-size: .67rem; line-height: 1.45; }

.plot-card { margin-top: 24px; border: 1px solid var(--line); background: #fbfaf5; }
.quick-review-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 52px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 254, 249, .97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 5px 14px rgba(16, 40, 42, .05);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.quick-review-bar[data-status="accepted"] { box-shadow: inset 4px 0 0 var(--teal), 0 5px 14px rgba(16, 40, 42, .05); }
.quick-review-bar[data-status="rejected"] { box-shadow: inset 4px 0 0 var(--red), 0 5px 14px rgba(16, 40, 42, .05); }
.quick-review-bar[data-status="stale"] { box-shadow: inset 4px 0 0 var(--orange), 0 5px 14px rgba(16, 40, 42, .05); }
.quick-trace-navigator { min-width: min(340px, 48%); display: grid; grid-template-columns: 38px minmax(150px, 1fr) 38px; border: 1px solid #cbd4cf; background: white; }
.quick-trace-navigator > button { min-width: 38px; color: var(--teal); background: #f4f7f3; border: 0; cursor: pointer; font-size: 1.05rem; font-weight: 800; }
.quick-trace-navigator > button:first-child { border-right: 1px solid #d7dfda; }
.quick-trace-navigator > button:last-child { border-left: 1px solid #d7dfda; }
.quick-trace-navigator > button:hover:not(:disabled) { color: white; background: var(--teal); }
.quick-trace-navigator > button:disabled { color: #aeb8b5; cursor: not-allowed; }
.quick-review-state { min-width: 0; padding: 4px 10px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1px 8px; }
.quick-review-state span { color: var(--ink); font-size: .68rem; font-weight: 800; }
.quick-review-state small { overflow: hidden; color: var(--muted); font-size: .65rem; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.quick-review-state strong { grid-column: 1 / -1; color: var(--ink); font-size: .72rem; }
.quick-review-actions { display: flex; gap: 6px; }
.quick-review-actions button {
  min-height: 35px;
  padding: 7px 10px;
  color: #41504f;
  background: white;
  border: 1px solid #b9c9c4;
  cursor: pointer;
  font-size: .7rem;
  font-weight: 800;
}
.quick-review-actions button.reject { color: #8a3535; border-color: #d8abab; }
.quick-review-actions button.accept { color: white; background: var(--teal); border-color: var(--teal); }
.quick-review-actions button:disabled { color: #a2aaa8; background: #eceeea; border-color: #d9dfda; cursor: not-allowed; }
.quick-review-actions kbd { margin-left: 4px; padding: 1px 4px; color: inherit; background: rgba(16, 40, 42, .08); border-radius: 2px; font: 700 .58rem/1.2 ui-monospace, monospace; }
.quick-review-actions .accept kbd { background: rgba(255, 255, 255, .2); }
.plot-legend { min-height: 42px; padding: 10px 16px; display: flex; justify-content: flex-end; gap: 22px; align-items: center; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .72rem; }
.plot-legend span::before { content: ""; width: 18px; height: 2px; margin-right: 7px; display: inline-block; vertical-align: middle; background: var(--teal); }
.plot-legend .event-key::before { background: var(--orange); }
.plot-legend .raw-key::before { background: #9aa5a2; }
.plot-legend .points-key::before { height: 7px; background: linear-gradient(90deg, #d99a32 0 33%, #2b8a64 33% 66%, #b64b4b 66%); }
.plot-view-control { margin-right: auto; display: flex; align-items: center; gap: 7px; color: #41504f; font-weight: 750; }
.plot-view-control select { width: auto; min-height: 30px; padding: 4px 28px 4px 8px; font-size: .7rem; }
#signal-canvas { width: 100%; height: clamp(300px, 38vw, 530px); display: block; }
#signal-canvas.editing-points { cursor: crosshair; }

.metric-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); }
.metric-grid article { min-width: 0; padding: 15px 13px; border-right: 1px solid var(--line); }
.metric-grid article:last-child { border-right: 0; }
.metric-grid span { display: block; color: var(--muted); font-size: .68rem; line-height: 1.3; }
.metric-grid strong { margin-top: 6px; display: block; overflow: hidden; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; font-weight: 500; text-overflow: ellipsis; }

.quality-card, .scope-card { margin-top: 18px; padding: 22px; display: grid; grid-template-columns: minmax(170px, .45fr) 1fr; gap: 30px; border: 1px solid var(--line); }
.quality-card ul { margin: 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.quality-card li { padding: 10px 12px; color: #41504f; background: #f2f4ef; font-size: .79rem; line-height: 1.4; border-left: 3px solid #9aa5a2; }
.quality-card li.pass { color: #285d52; background: #e7f1ec; border-color: var(--teal); }
.quality-card li.review { color: #74503b; background: #f7ece3; border-color: var(--orange); }
.quality-card li.exclude { color: #7d3636; background: #f7e5e3; border-color: var(--red); }
.quality-card li.info { border-color: #527d8a; }
.event-table-card { margin-top: 18px; padding: 22px; border: 1px solid var(--line); background: white; }
.table-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.method-badge { padding: 6px 9px; color: var(--teal-dark); background: var(--teal-pale); font-size: .65rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.table-scroll { margin-top: 17px; overflow-x: auto; border: 1px solid var(--line); }
.event-table-card table { width: 100%; min-width: 1040px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.event-table-card th { padding: 10px 9px; color: #dcebe7; background: var(--ink); font-size: .65rem; letter-spacing: .035em; text-align: right; white-space: nowrap; }
.event-table-card th:first-child, .event-table-card td:first-child { text-align: center; }
.event-table-card td { padding: 9px; color: #334846; border-bottom: 1px solid #e3e7e2; font-size: .72rem; text-align: right; white-space: nowrap; }
.event-table-card tbody tr:last-child td { border-bottom: 0; }
.event-table-card tbody tr.review { background: #fff8f0; }
.review-pill { padding: 3px 6px; display: inline-block; color: #7a543c; background: #f6e5d7; font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.review-pill.accept { color: #285d52; background: #e3f0ea; }
.table-note { margin: 11px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.45; }
.scope-card { grid-template-columns: minmax(170px, .45fr) 1fr; background: var(--ink); color: white; border-color: var(--ink); }
.scope-card p { margin: 0 0 10px; color: #c9d8d5; font-size: .82rem; line-height: 1.55; }
.scope-card p:last-child { margin-bottom: 0; }
.scope-card strong { color: white; }

footer { padding: 24px clamp(18px,4vw,64px); display: flex; justify-content: space-between; gap: 30px; color: #a9bfbb; background: var(--ink); font-size: .76rem; }

@media (max-width: 1100px) {
  .intro { grid-template-columns: 1fr; gap: 24px; }
  .intro aside { max-width: 600px; }
  .workspace { grid-template-columns: 340px minmax(0, 1fr); }
  .results-panel { padding: 22px; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .metric-grid article:nth-child(3) { border-right: 0; }
  .metric-grid article:nth-child(n+4) { border-top: 1px solid var(--line); }
}

@media (max-width: 820px) {
  .header-actions .local-badge { display: none; }
  .module-tabs { grid-template-columns: 1fr 1fr; }
  .module-tabs button:nth-child(2) { border-right: 0; }
  .module-tabs button:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .workspace { grid-template-columns: 1fr; }
  .control-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .results-toolbar { align-items: flex-start; flex-direction: column; }
  .review-workflow { grid-template-columns: 1fr; }
  .review-note { grid-column: 1; grid-row: auto; }
  .point-editor-heading { align-items: stretch; flex-direction: column; }
  .point-editor-heading label { width: 100%; }
}

@media (max-width: 560px) {
  .app-header { min-height: 64px; }
  .brand img { width: 34px; height: 34px; }
  .brand small { font-size: .68rem; }
  .header-actions a { display: none; }
  .app-shell { padding-top: 34px; }
  .intro h1 { font-size: 2.45rem; }
  .intro > div > p:last-child { font-size: .94rem; }
  .module-tabs button { min-height: 62px; padding: 10px; font-size: .78rem; }
  .panel-section { padding: 22px 16px; grid-template-columns: 25px minmax(0,1fr); gap: 8px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid > label:first-child { grid-column: auto; }
  .results-panel { padding: 18px 12px; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions button { flex: 1; }
  .point-editor-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .point-choice { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); }
  .quick-review-bar { align-items: stretch; flex-direction: column; gap: 7px; }
  .quick-trace-navigator { width: 100%; min-width: 0; }
  .quick-review-actions { display: grid; grid-template-columns: repeat(3, 1fr); }
  .quick-review-actions button { padding-inline: 6px; }
  #signal-canvas { height: 310px; }
  .plot-legend { justify-content: flex-start; flex-wrap: wrap; gap: 8px 16px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid article, .metric-grid article:nth-child(3) { border-right: 1px solid var(--line); border-top: 1px solid var(--line); }
  .metric-grid article:nth-child(-n+2) { border-top: 0; }
  .metric-grid article:nth-child(even) { border-right: 0; }
  .quality-card, .scope-card { padding: 18px; grid-template-columns: 1fr; gap: 16px; }
  .table-heading { flex-direction: column; }
  footer { flex-direction: column; }
}

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