@font-face {
  font-family: "Manrope";
  src: url("assets/Manrope-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("assets/Manrope-Bold.ttf") format("truetype");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #222222;
  --ink-soft: #383a38;
  --ash: #6b706a;
  --paper: #f3f1ea;
  --surface: #ffffff;
  --surface-soft: #ebe9e2;
  --green: #1f3b35;
  --green-soft: #dce5e1;
  --copper: #b86f47;
  --blue: #075fe4;
  --red: #a9433b;
  --red-soft: #f2dedb;
  --amber: #9b681f;
  --amber-soft: #f2e7ce;
  --gray-soft: #e5e6e2;
  --line: rgba(34, 34, 34, 0.15);
  --line-strong: rgba(34, 34, 34, 0.32);
  --shadow: 0 18px 55px rgba(27, 34, 31, 0.09);
  --header-h: 70px;
  --bottom-nav-h: 72px;
  --action-h: 146px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body:has(.inspection-view) { padding-bottom: calc(var(--bottom-nav-h) + var(--action-h) + 28px); }
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button, [role="button"] { touch-action: manipulation; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 12px 16px;
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.prototype-notice {
  min-height: 29px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--green);
  color: white;
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.prototype-notice span { opacity: 0.68; }
.prototype-notice strong { font-size: inherit; }

.app-header {
  height: var(--header-h);
  position: sticky;
  z-index: 80;
  top: 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 241, 234, 0.95);
  backdrop-filter: blur(18px);
}
.brand-button {
  min-width: 0;
  height: 48px;
  padding: 0;
  display: grid;
  align-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.brand-button img { width: 148px; max-height: 38px; object-fit: contain; object-position: left center; }
.header-context {
  min-width: 0;
  margin-left: auto;
  display: grid;
  justify-items: end;
  line-height: 1.15;
}
.header-context span { font-size: 10px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.header-context b { margin-top: 3px; color: var(--copper); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; }
.page-history { display: flex; align-items: center; gap: 5px; }
.page-history button {
  min-width: 38px;
  height: 38px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.45);
  color: var(--ink);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}
.page-history button:disabled { opacity: .28; cursor: default; }
.page-history svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.page-history span { display: none; }
.icon-button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.icon-button svg { width: 22px; height: 22px; fill: currentColor; }
.scope-popover {
  width: min(330px, calc(100% - 32px));
  position: fixed;
  z-index: 200;
  top: 106px;
  right: 16px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.scope-popover strong { font-size: 14px; }
.scope-popover p { margin: 8px 0 14px; color: var(--ash); font-size: 12px; line-height: 1.45; }
.scope-popover button { min-height: 44px; padding: 10px 13px; border: 1px solid var(--line); background: transparent; cursor: pointer; }

main { min-height: calc(100dvh - var(--header-h) - 29px); }
.file-guard { width:min(620px, calc(100% - 32px)); margin:clamp(48px, 10vh, 110px) auto; padding:clamp(28px, 6vw, 58px); border:1px solid var(--line); background:var(--surface); box-shadow:var(--shadow); }
.file-guard h1 { max-width:520px; margin:12px 0 14px; font-size:clamp(30px, 7vw, 58px); line-height:.95; letter-spacing:-.05em; }
.file-guard p { max-width:520px; margin:0 0 24px; color:var(--ash); line-height:1.6; }
.file-guard .primary-button { display:inline-flex; text-decoration:none; }
.file-guard small { display:block; margin-top:18px; color:var(--ash); line-height:1.5; }
body[data-route="file-guard"] .mobile-nav { display:none; }
.page-shell { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 110px; }
.eyebrow { color: var(--ash); font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.eyebrow.light { color: rgba(255,255,255,.65); }
.page-title { margin: 9px 0 0; font-size: clamp(30px, 6vw, 64px); line-height: 0.98; letter-spacing: -0.045em; }
.page-lead { max-width: 640px; margin: 14px 0 0; color: var(--ash); font-size: 14px; line-height: 1.55; }
.section-heading { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.muted { color: var(--ash); }

.home-hero {
  position: relative;
  min-height: 280px;
  margin: 0 -16px;
  padding: 30px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: var(--ink);
  color: white;
}
.home-hero::after {
  width: 220px;
  height: 220px;
  position: absolute;
  right: -110px;
  bottom: -90px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 42px rgba(255,255,255,.025), 0 0 0 84px rgba(255,255,255,.018);
}
.home-hero h1 { max-width: 620px; margin: 12px 0 0; font-size: clamp(36px, 7vw, 74px); line-height: 0.98; letter-spacing: -0.05em; }
.home-hero p { max-width: 520px; margin: 22px 0 0; color: rgba(255,255,255,.7); font-size: 13px; line-height: 1.55; }
.hero-meta { position: relative; z-index: 2; margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-meta span { padding: 8px 10px; border: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.75); font-size: 10px; }

.project-panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.project-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.project-heading h2 { margin: 5px 0 0; font-size: 25px; line-height: 1.1; letter-spacing: -0.035em; }
.status-chip { min-height: 28px; padding: 6px 9px; display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.project-location { margin-top: 18px; padding-top: 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; border-top: 1px solid var(--line); }
.project-location small { display: block; color: var(--ash); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.project-location strong { display: block; margin-top: 4px; font-size: 13px; }
.progress-row { margin-top: 22px; }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; color: var(--ash); font-size: 11px; }
.progress-copy strong { color: var(--ink); }
.progress-track { height: 6px; margin-top: 9px; overflow: hidden; background: var(--surface-soft); }
.progress-track > span { height: 100%; display: block; background: var(--green); transition: width 260ms ease; }
.primary-button, .secondary-button, .ghost-button {
  min-height: 48px;
  padding: 13px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
  cursor: pointer;
}
.primary-button { background: var(--ink); color: white; }
.secondary-button { background: transparent; color: var(--ink); }
.ghost-button { border-color: var(--line); background: transparent; color: var(--ink); }
.primary-button svg, .secondary-button svg, .ghost-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.project-panel .primary-button { width: 100%; margin-top: 22px; }

.quick-stats { margin-top: 14px; display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.quick-stat { min-height: 104px; padding: 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.46); }
.quick-stat strong { display: block; font-size: 28px; letter-spacing: -0.04em; }
.quick-stat span { display: block; margin-top: 7px; color: var(--ash); font-size: 10px; line-height: 1.35; }
.local-note { margin-top: 14px; padding: 14px; display: flex; gap: 11px; align-items: flex-start; border-left: 3px solid var(--copper); background: rgba(184,111,71,.08); color: var(--ash); font-size: 11px; line-height: 1.5; }
.local-note svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: var(--copper); stroke-width: 1.8; }
.catalog-proof { margin-top: 14px; padding: 16px; display: grid; gap: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.5); }
.catalog-proof div { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.catalog-proof span { color: var(--ash); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.catalog-proof strong { color: var(--green); font-size: 20px; }
.catalog-proof p { margin: 0; color: var(--ash); font-size: 10px; line-height: 1.5; }
.catalog-proof code { color: var(--ink); font-family: inherit; font-weight: 800; }

.inspection-head { margin-bottom: 18px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; color: var(--ash); font-size: 10px; }
.breadcrumb span:not(:last-child)::after { margin-left: 6px; content: "/"; opacity: .45; }
.inspection-title-row { margin-top: 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.inspection-title-row h1 { margin: 0; font-size: 30px; line-height: 1.05; letter-spacing: -.04em; }
.counter-pill { min-width: 84px; min-height: 42px; padding: 7px 9px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--ink); color: white; }
.counter-pill small { font-size: 6px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; opacity: .68; }
.counter-pill b { font-size: 10px; }
.inspection-mode-panel { margin: 0 0 16px; padding: 14px; display: grid; gap: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.55); }
.inspection-mode-copy > span, .environment-access-title > span { color: var(--ash); font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.inspection-mode-copy > strong { display: block; margin-top: 4px; color: var(--green); font-size: 15px; }
.inspection-mode-copy > p, .inspection-mode-note { margin: 6px 0 0; color: var(--ash); font-size: 9px; line-height: 1.45; }
.inspection-mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.inspection-mode-switch button { min-height: 60px; padding: 10px; display: grid; gap: 3px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.inspection-mode-switch button[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: white; }
.inspection-mode-switch b { font-size: 10px; }
.inspection-mode-switch small { color: inherit; font-size: 7px; line-height: 1.35; opacity: .68; }
.inspection-mode-note { margin: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.environment-strip {
  margin: 0 -16px 16px;
  padding: 0 16px 7px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.environment-strip::-webkit-scrollbar { display: none; }
.environment-button {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 10px 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ash);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.environment-button > span { max-width: 190px; display: grid; gap: 2px; text-align: left; }
.environment-button small { color: inherit; font-size: 7px; letter-spacing: .08em; text-transform: uppercase; opacity: .65; }
.environment-button[aria-current="true"] { border-color: var(--green); background: var(--green); color: white; }
.environment-button.danger:not([aria-current="true"]) { border-color: rgba(169,67,59,.24); }
.environment-button.warning:not([aria-current="true"]) { border-color: rgba(158,105,38,.24); }
.catalog-toolbar { margin: -1px 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.catalog-toolbar > span { color: var(--ash); font-size: 9px; text-align: right; }
.catalog-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.catalog-index-button { min-height: 46px; padding: 8px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--green); background: transparent; color: var(--green); cursor: pointer; }
.catalog-index-button span { font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.catalog-index-button strong { padding-left: 9px; border-left: 1px solid rgba(31,59,53,.3); font-size: 10px; }
.rubric-config-button { min-height: 46px; padding: 8px 12px; display: grid; gap: 2px; border: 1px solid var(--copper); background: rgba(184,111,71,.07); color: var(--ink); text-align: left; cursor: pointer; }
.rubric-config-button span { color: var(--copper); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.rubric-config-button strong { max-width: 180px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.inspection-layout { display: grid; gap: 16px; }
.desktop-environments, .inspection-aside { display: none; }
.control-card { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.control-card-header { padding: 18px 18px 15px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.control-meta { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.control-code { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.category-tag { padding: 4px 7px; background: var(--surface-soft); color: var(--ash); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.priority-tag { min-height: 26px; max-width: 126px; padding: 5px 8px; display: inline-flex; align-items: center; border: 1px solid var(--line); color: var(--ash); font-size: 7px; font-weight: 800; line-height: 1.25; text-align: center; text-transform: uppercase; }
.priority-tag.critical { border-color: rgba(169,67,59,.35); background: var(--red-soft); color: var(--red); }
.control-card-body { padding: 19px 18px 22px; }
.control-card h2 { margin: 0; font-size: 25px; line-height: 1.12; letter-spacing: -.035em; }
.criterion { margin: 10px 0 0; color: var(--ash); font-size: 13px; line-height: 1.55; }
.source-trace { margin-top: 16px; padding: 13px; display: grid; gap: 10px; border-left: 3px solid var(--green); background: rgba(31,59,53,.06); }
.source-trace div { display: grid; gap: 3px; }
.source-trace span { color: var(--ash); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.source-trace strong { font-size: 10px; line-height: 1.4; }
.source-trace p { margin: 0; color: var(--ash); font-size: 9px; line-height: 1.45; }
.synthetic-blocker { margin-top: 13px; padding: 10px 11px; display: flex; align-items: center; gap: 8px; background: var(--red-soft); color: var(--red); font-size: 9px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.synthetic-blocker svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.field-label { margin: 22px 0 10px; display: block; color: var(--ash); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.status-button {
  min-height: 54px;
  padding: 9px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.status-button:last-child { grid-column: 1 / -1; }
.status-button::before { width: 9px; height: 9px; flex: 0 0 9px; border: 2px solid currentColor; border-radius: 50%; content: ""; opacity: .55; }
.status-button.selected::before { background: currentColor; box-shadow: inset 0 0 0 2px white; opacity: 1; }
.status-button[data-status="conforme"].selected { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.status-button[data-status="no_conforme"].selected { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.status-button[data-status="pendiente"].selected { border-color: var(--ink); background: var(--gray-soft); color: var(--ink); }
.observation-input {
  width: 100%;
  min-height: 94px;
  padding: 13px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}
.observation-input::placeholder { color: #989b96; }
.photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.file-label {
  min-height: 48px;
  padding: 11px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.file-label svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.file-label input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-grid { margin-top: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-thumb { aspect-ratio: 1; position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--surface-soft); }
.photo-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.photo-thumb button { width: 44px; height: 44px; position: absolute; top: 0; right: 0; display: grid; place-items: center; border: 0; background: rgba(34,34,34,.82); color: white; font-size: 19px; cursor: pointer; }
.empty-evidence { min-height: 78px; padding: 16px; display: grid; place-items: center; border: 1px dashed var(--line-strong); color: var(--ash); font-size: 10px; text-align: center; }
.storage-hint { margin: 9px 0 0; color: var(--ash); font-size: 9px; line-height: 1.45; }

.inspection-actions {
  min-height: var(--action-h);
  position: fixed;
  z-index: 70;
  right: 0;
  bottom: var(--bottom-nav-h);
  left: 0;
  padding: 10px max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: rgba(243,241,234,.97);
  backdrop-filter: blur(18px);
}
.inspection-actions button { min-height: 52px; padding: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 9px; font-weight: 800; text-transform: uppercase; cursor: pointer; }
.inspection-actions button.primary { border-color: var(--ink); background: var(--ink); color: white; }
.inspection-actions button:disabled { opacity: .32; cursor: default; }
.inspection-actions .finish-sheet-button { grid-column: 1 / -1; min-height: 44px; border-color: var(--line-strong); background: var(--surface-soft); }
.inspection-actions .finish-sheet-button.ready { border-color: var(--green); background: var(--green); color: white; box-shadow: 0 8px 24px rgba(31,59,53,.18); }
.inspection-actions .finish-sheet-button.finalized { border-color: var(--green); background: var(--green-soft); color: var(--green); opacity: 1; }
.finish-sheet-help { grid-column: 1 / -1; color: var(--ash); font-size: 8px; line-height: 1.35; text-align: center; }

.summary-banner { margin: 18px -16px 0; padding: 15px 20px; background: var(--red-soft); color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: .045em; text-align: center; text-transform: uppercase; }
.summary-grid { margin-top: 16px; display: grid; gap: 14px; }
.summary-main, .summary-panel { border: 1px solid var(--line); background: var(--surface); }
.summary-main { padding: 21px; }
.score-row { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; }
.score-ring {
  --value: 0deg;
  width: 120px;
  height: 120px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--value), var(--surface-soft) 0);
}
.score-ring::before { width: 92px; height: 92px; position: absolute; border-radius: 50%; background: var(--surface); content: ""; }
.score-value { position: relative; z-index: 1; display: grid; justify-items: center; }
.score-value strong { font-size: 29px; letter-spacing: -.05em; }
.score-value span { color: var(--ash); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.score-copy h2 { margin: 0; font-size: 21px; line-height: 1.1; }
.score-copy h2.danger { color: var(--red); }
.score-copy h2.success { color: var(--green); }
.score-copy h2.warning { color: var(--amber); }
.score-copy p { margin: 8px 0 0; color: var(--ash); font-size: 10px; line-height: 1.5; }
.summary-counts { margin-top: 20px; display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.summary-count { min-height: 82px; padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary-count strong { display: block; font-size: 23px; }
.summary-count span { color: var(--ash); font-size: 9px; }
.summary-panel { padding: 20px; }
.summary-panel h2 { margin: 0; font-size: 17px; }
.indicator-list { margin-top: 15px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.indicator { min-height: 60px; padding: 12px 0; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.indicator span { color: var(--ash); font-size: 10px; }
.indicator strong { max-width: 150px; font-size: 12px; text-align: right; }
.indicator strong.danger { color: var(--red); }
.limitations { margin: 14px 0 0; padding-left: 17px; color: var(--ash); font-size: 10px; line-height: 1.55; }
.limitations li + li { margin-top: 6px; }
.summary-panel .secondary-button { width: 100%; margin-top: 18px; opacity: .65; }

.mobile-nav {
  height: var(--bottom-nav-h);
  position: fixed;
  z-index: 90;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 6px max(10px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  border-top: 1px solid var(--line);
  background: rgba(243,241,234,.98);
  backdrop-filter: blur(18px);
}
.mobile-nav button { min-height: 56px; padding: 5px; display: grid; justify-items: center; align-content: center; gap: 3px; border: 0; background: transparent; color: var(--ash); font-size: 9px; font-weight: 700; cursor: pointer; }
.mobile-nav button.active { color: var(--green); }
.mobile-nav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.toast { min-width: 190px; max-width: calc(100% - 32px); position: fixed; z-index: 400; bottom: 160px; left: 50%; padding: 11px 15px; transform: translate(-50%, 16px); border: 1px solid rgba(255,255,255,.15); background: var(--ink); color: white; font-size: 10px; text-align: center; opacity: 0; pointer-events: none; transition: opacity 160ms ease, transform 160ms ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.catalog-dialog { width: min(760px, calc(100% - 24px)); height: min(800px, calc(100dvh - 24px)); padding: 0; border: 0; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.catalog-dialog::backdrop { background: rgba(20,22,21,.78); }
.catalog-dialog-head { position: sticky; z-index: 2; top: 0; padding: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(243,241,234,.98); }
.catalog-dialog-head h2 { margin: 4px 0 0; font-size: 23px; letter-spacing: -.035em; }
.catalog-dialog-head button { width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 22px; cursor: pointer; }
.catalog-dialog > p { margin: 15px 18px; color: var(--ash); font-size: 10px; line-height: 1.5; }
.rubric-assignment-legend { margin: 0 18px 12px; display: flex; flex-wrap: wrap; gap: 7px; }
.rubric-assignment-legend span { padding: 5px 8px; background: var(--surface-soft); color: var(--ash); font-size: 7px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.rubric-assignment-list { padding: 0 18px 96px; display: grid; gap: 8px; }
.rubric-assignment-row { min-height: 88px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); background: var(--surface); }
.rubric-assignment-row > div { min-width: 0; display: grid; gap: 4px; }
.rubric-assignment-row small { color: var(--ash); font-size: 7px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.rubric-assignment-row strong { font-size: 11px; line-height: 1.35; }
.assignment-origin { width: fit-content; padding: 4px 6px; background: var(--gray-soft); color: var(--ash); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.assignment-origin.source { background: var(--green-soft); color: var(--green); }
.assignment-origin.added { background: var(--amber-soft); color: var(--amber); }
.assignment-origin.removed { background: var(--red-soft); color: var(--red); }
.rubric-assignment-row [role="switch"] { width: 78px; min-height: 48px; flex: 0 0 78px; padding: 5px; display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--ash); cursor: pointer; }
.rubric-assignment-row [role="switch"] i { width: 18px; height: 18px; display: block; border: 2px solid currentColor; border-radius: 50%; }
.rubric-assignment-row [role="switch"] b { font-size: 7px; }
.rubric-assignment-row [role="switch"][aria-checked="true"] { border-color: var(--green); background: var(--green); color: white; }
.rubric-assignment-row [role="switch"][aria-checked="true"] i { background: white; box-shadow: inset 0 0 0 3px var(--green); }
.rubric-assignment-row [role="switch"]:disabled { opacity: .45; cursor: default; }
.rubric-dialog-foot { min-height: 76px; position: sticky; z-index: 3; bottom: 0; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); background: rgba(243,241,234,.98); }
.rubric-dialog-foot span { color: var(--ash); font-size: 8px; line-height: 1.4; }
.rubric-dialog-foot .primary-button { min-width: 110px; }
.catalog-search-label { margin: 0 18px 7px; display: block; color: var(--ash); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.catalog-search { width: calc(100% - 36px); min-height: 48px; margin: 0 18px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 0; background: white; color: var(--ink); font-size: 13px; }
.catalog-results-meta { margin: 12px 18px 8px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.catalog-index-list { padding: 0 18px 20px; display: grid; gap: 7px; }
.catalog-index-list button { min-height: 64px; padding: 11px 13px; display: grid; gap: 4px; border: 1px solid var(--line); background: white; color: var(--ink); text-align: left; cursor: pointer; }
.catalog-index-list button span { color: var(--green); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.catalog-index-list button strong { font-size: 11px; line-height: 1.35; }
.catalog-index-list button small { color: var(--ash); font-size: 8px; }
.catalog-empty { padding: 30px 12px; color: var(--ash); font-size: 11px; text-align: center; }

@media (min-width: 700px) {
  :root { --header-h: 78px; }
  body, body:has(.inspection-view) { padding-bottom: 0; }
  .prototype-notice { min-height: 31px; }
  .app-header { padding-right: 28px; padding-left: 28px; }
  .brand-button img { width: 182px; }
  .header-context { margin-left: 14px; margin-right: auto; justify-items: start; }
  .page-shell { width: min(1180px, calc(100% - 48px)); padding-top: 32px; padding-bottom: 62px; }
  .home-hero { min-height: 360px; margin: 0; padding: 38px; }
  .project-panel { margin-top: 20px; padding: 28px; }
  .home-content { display: grid; grid-template-columns: 1.3fr .7fr; gap: 20px; }
  .quick-stats { margin-top: 20px; }
  .quick-stat { min-height: 117px; }
  .environment-strip { margin-right: 0; margin-left: 0; padding-right: 0; padding-left: 0; }
  .status-grid { grid-template-columns: repeat(5, 1fr); }
  .status-button:last-child { grid-column: auto; }
  .control-card-header { padding: 22px 24px 18px; }
  .control-card-body { padding: 24px 24px 27px; }
  .photo-grid { grid-template-columns: repeat(5, 1fr); }
  .page-history span { display: inline; }
  .inspection-actions { width: min(650px, calc(100% - 48px)); min-height: 0; position: sticky; bottom: 0; margin: 16px auto 0; padding: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); }
  .mobile-nav { display: none; }
  .summary-banner { margin-right: 0; margin-left: 0; }
  .summary-counts { grid-template-columns: repeat(4, 1fr); }
  .toast { bottom: 32px; }
}

@media (min-width: 1020px) {
  .app-header { padding-right: max(32px, calc((100vw - 1240px) / 2)); padding-left: max(32px, calc((100vw - 1240px) / 2)); }
  .home-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; align-items: stretch; }
  .home-hero, .project-panel { margin-top: 0; }
  .quick-stats { grid-template-columns: repeat(4, 1fr); }
  .inspection-head { margin-bottom: 24px; }
  .inspection-mode-panel { padding: 16px 18px; grid-template-columns: minmax(220px, .8fr) minmax(420px, 1.2fr); align-items: center; }
  .inspection-mode-note { grid-column: 1 / -1; }
  .inspection-layout { grid-template-columns: 220px minmax(0, 1fr) 250px; gap: 20px; align-items: start; }
  .desktop-environments, .inspection-aside { display: block; position: sticky; top: 126px; }
  .desktop-environments { border-top: 1px solid var(--line); }
  .desktop-environments button { width: 100%; min-height: 52px; padding: 9px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ash); font-size: 9px; line-height: 1.25; text-align: left; cursor: pointer; }
  .desktop-environments button span { display: grid; gap: 2px; }
  .desktop-environments button small { font-size: 7px; letter-spacing: .06em; text-transform: uppercase; opacity: .65; }
  .desktop-environments button[aria-current="true"] { color: var(--green); font-weight: 800; }
  .desktop-environments b { min-width: 25px; height: 25px; display: grid; place-items: center; background: var(--surface-soft); font-size: 9px; }
  .inspection-aside { padding: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.55); }
  .inspection-aside h3 { margin: 0; font-size: 14px; }
  .aside-metric { margin-top: 18px; }
  .aside-metric strong { font-size: 24px; }
  .aside-metric span { display: block; color: var(--ash); font-size: 9px; }
  .aside-state { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
  .aside-state span { display: block; color: var(--ash); font-size: 9px; }
  .aside-state strong { display: block; margin-top: 5px; color: var(--green); font-size: 11px; }
  .control-card { min-height: 642px; }
  .inspection-actions { width: auto; margin-left: 240px; margin-right: 270px; }
  .summary-grid { grid-template-columns: 1.05fr .95fr; align-items: start; }
  .summary-main { padding: 28px; }
  .summary-panel { padding: 26px; }
}

@media (max-width: 389px) {
  .brand-button img { width: 132px; }
  .header-context span { display: none; }
  .page-shell { width: min(100% - 24px, 1240px); }
  .home-hero, .summary-banner { margin-right: -12px; margin-left: -12px; }
  .status-grid { grid-template-columns: 1fr; }
  .status-button:last-child { grid-column: auto; }
}

@media (max-width: 699px) {
  .header-context { display: none; }
  .brand-button { margin-right: auto; }
}

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

/* Prototype Lab v0.2 · flujo previo y ejecución por ambiente */
.scope-popover button + button { margin-top: 8px; }
body[data-route="login"] .app-header,
body[data-route="login"] .mobile-nav { display: none; }
body[data-route="login"] main { min-height: calc(100dvh - 29px); }
body[data-route="login"] { padding-bottom: 0; }
body[data-route="create"] .mobile-nav { display: none; }

.login-view {
  min-height: calc(100dvh - 29px);
  position: relative;
  padding: 92px 18px 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--paper);
}
.login-view::before {
  width: min(760px, 130vw);
  aspect-ratio: 1;
  position: absolute;
  right: -52%;
  bottom: -38%;
  border: 1px solid rgba(31,59,53,.18);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 70px rgba(31,59,53,.025), 0 0 0 140px rgba(31,59,53,.018);
}
.login-brand {
  position: absolute;
  z-index: 2;
  top: 28px;
  left: 22px;
  display: grid;
  gap: 8px;
}
.login-brand img { width: 172px; }
.login-brand span { color: var(--ash); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.login-card {
  width: min(470px, 100%);
  position: relative;
  z-index: 2;
  padding: 28px 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 10px 0 0; font-size: clamp(42px, 12vw, 68px); line-height: .94; letter-spacing: -.055em; }
.login-card > p { margin: 18px 0 0; color: var(--ash); font-size: 12px; line-height: 1.55; }
.login-card form { margin-top: 26px; display: grid; }
.login-card form label { margin: 14px 0 7px; color: var(--ash); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.login-card form input { min-height: 50px; padding: 12px 13px; border: 1px solid var(--line-strong); border-radius: 0; background: white; color: var(--ink); }
.login-card form .primary-button { width: 100%; margin-top: 20px; }
.simulation-note { margin-top: 18px; padding-top: 16px; display: flex; gap: 9px; align-items: center; border-top: 1px solid var(--line); color: var(--ash); font-size: 9px; }
.simulation-note svg { width: 16px; height: 16px; fill: none; stroke: var(--copper); stroke-width: 1.8; }

.page-heading-row { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.page-heading-row > .primary-button,
.page-heading-row > .secondary-button { width: 100%; }
.user-pill { max-width: 100%; padding: 9px 12px; overflow: hidden; border: 1px solid var(--line); color: var(--ash); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.module-grid { margin-top: 28px; display: grid; gap: 14px; }
.module-card { min-height: 300px; position: relative; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; border: 1px solid var(--line); text-align: left; }
button.module-card { cursor: pointer; }
.module-card.available { overflow: hidden; border-color: var(--green); background: var(--green); color: white; }
.module-card.available::after { width: 210px; height: 210px; position: absolute; right: -92px; bottom: -90px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; content: ""; box-shadow: 0 0 0 36px rgba(255,255,255,.025), 0 0 0 72px rgba(255,255,255,.018); }
.module-card.future { background: rgba(255,255,255,.45); color: var(--ash); }
.module-number { font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.module-card h2 { margin: 8px 0 0; font-size: 36px; line-height: .98; letter-spacing: -.045em; }
.module-card p { max-width: 330px; margin: 16px 0 0; color: inherit; font-size: 11px; line-height: 1.55; opacity: .7; }
.module-arrow { width: 48px; height: 48px; position: absolute; z-index: 2; right: 20px; bottom: 20px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); }
.module-arrow svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.filter-row { margin-top: 26px; display: flex; gap: 7px; overflow-x: auto; }
.filter-row button { min-height: 40px; padding: 9px 13px; flex: 0 0 auto; border: 1px solid var(--line); background: transparent; color: var(--ash); font-size: 9px; font-weight: 800; text-transform: uppercase; cursor: pointer; }
.filter-row button[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: white; }
.project-list { margin-top: 14px; display: grid; gap: 14px; }
.project-list-card { padding: 20px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 12px 32px rgba(27,34,31,.045); }
.project-card-top { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; color: var(--ash); font-size: 9px; }
.status-chip.warning { background: var(--amber-soft); color: var(--amber); }
.status-chip.success { background: var(--green-soft); color: var(--green); }
.status-chip.neutral { background: var(--gray-soft); color: var(--ash); }
.project-list-card h2 { margin: 6px 0 0; font-size: 24px; line-height: 1.08; letter-spacing: -.035em; }
.project-list-card > p { margin: 10px 0 0; color: var(--ash); font-size: 11px; line-height: 1.5; }
.project-list-card > .secondary-button { width: 100%; margin-top: 20px; }
.empty-list { padding: 42px 20px; border: 1px dashed var(--line-strong); color: var(--ash); font-size: 11px; text-align: center; }

.project-overview-head { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.project-overview-head h1 { margin: 8px 0 0; font-size: clamp(34px, 8vw, 62px); line-height: .98; letter-spacing: -.05em; }
.project-overview-head p { margin: 12px 0 0; color: var(--ash); font-size: 11px; }
.project-facts { margin-top: 24px; display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.project-facts > div { min-height: 88px; padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.48); }
.project-facts span { display: block; color: var(--ash); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.project-facts strong { display: block; margin-top: 7px; font-size: 12px; line-height: 1.3; }
.project-action-row { margin-top: 30px; display: grid; gap: 18px; }
.project-action-row h2 { margin: 6px 0 0; font-size: 24px; letter-spacing: -.035em; }
.project-action-row p { margin: 8px 0 0; color: var(--ash); font-size: 10px; }
.button-pair { display: grid; gap: 8px; }
.button-pair button { width: 100%; }
.workflow-choice-grid { margin-top: 18px; display: grid; gap: 10px; }
.workflow-choice-grid > button { min-height: 184px; padding: 18px; display: grid; align-content: start; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.workflow-choice-grid > button:hover { border-color: var(--green); }
.workflow-choice-grid > button > span { color: var(--green); font-size: 7px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.workflow-choice-grid > button > strong { margin-top: 8px; font-size: 23px; letter-spacing: -.035em; }
.workflow-choice-grid > button > p { margin: 0; color: var(--ash); font-size: 10px; line-height: 1.5; }
.workflow-choice-grid > button > b { margin-top: 13px; display: flex; align-items: center; justify-content: space-between; color: var(--green); font-size: 8px; letter-spacing: .055em; text-transform: uppercase; }
.workflow-choice-grid svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.environment-access-title { margin-top: 28px; }
.environment-access-title > strong { display: block; margin-top: 5px; font-size: 16px; }
.environment-access-title > p { margin: 6px 0 0; color: var(--ash); font-size: 9px; line-height: 1.45; }
.environment-card-grid { margin-top: 18px; display: grid; gap: 10px; }
.environment-card { min-height: 164px; padding: 17px; display: grid; grid-template-columns: 1fr auto; align-content: start; gap: 7px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.environment-card:hover { border-color: var(--green); }
.environment-index { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.environment-state { padding: 5px 7px; justify-self: end; background: var(--gray-soft); color: var(--ash); font-size: 7px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.environment-state.success { background: var(--green-soft); color: var(--green); }
.environment-state.warning { background: var(--amber-soft); color: var(--amber); }
.environment-state.danger { background: var(--red-soft); color: var(--red); }
.environment-card > strong { grid-column: 1 / -1; margin-top: 17px; font-size: 19px; letter-spacing: -.025em; }
.environment-card > small { grid-column: 1 / -1; color: var(--ash); font-size: 9px; }
.mini-progress { height: 5px; grid-column: 1 / -1; margin-top: 12px; overflow: hidden; background: var(--surface-soft); }
.mini-progress i { height: 100%; display: block; background: var(--green); }
.catalog-scope-panel { margin-top: 18px; padding: 18px; border-left: 3px solid var(--copper); background: rgba(184,111,71,.07); }
.catalog-scope-panel > div { padding: 8px 0; display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid rgba(184,111,71,.15); }
.catalog-scope-panel span { color: var(--ash); font-size: 9px; }
.catalog-scope-panel strong { font-size: 10px; text-align: right; }
.catalog-scope-panel p { margin: 13px 0 0; color: var(--ash); font-size: 9px; line-height: 1.5; }

.wizard-stepper { margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; }
.wizard-stepper li { min-width: 0; position: relative; display: grid; justify-items: center; gap: 6px; color: var(--ash); }
.wizard-stepper li::before { height: 1px; position: absolute; z-index: -1; top: 14px; right: 50%; left: -50%; background: var(--line); content: ""; }
.wizard-stepper li:first-child::before { display: none; }
.wizard-stepper li > span { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); font-size: 9px; font-weight: 800; }
.wizard-stepper li > b { max-width: 74px; overflow: hidden; font-size: 7px; letter-spacing: .03em; text-align: center; text-overflow: ellipsis; text-transform: uppercase; }
.wizard-stepper li.current, .wizard-stepper li.done { color: var(--green); }
.wizard-stepper li.current > span { background: var(--green); color: white; }
.wizard-stepper li.done > span { border-color: var(--green); }
.wizard-card { margin-top: 22px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.wizard-heading { padding: 20px; border-bottom: 1px solid var(--line); }
.wizard-heading > span { color: var(--green); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.wizard-heading h2 { margin: 7px 0 0; font-size: 22px; letter-spacing: -.03em; }
.wizard-form, .wizard-review { padding: 20px; }
.form-grid { display: grid; gap: 15px; }
.form-field { display: grid; gap: 7px; }
.form-field > span { color: var(--ash); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.form-field > small { color: var(--ash); font-size: 8px; line-height: 1.5; }
.form-field input, .form-field select { width: 100%; min-height: 49px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 0; background: white; color: var(--ink); }
.form-field input[readonly] { background: var(--paper); color: var(--ash); }
.wizard-actions { margin-top: 24px; display: grid; gap: 8px; }
.wizard-actions button { width: 100%; }
.wizard-intro { margin: 0 0 17px; color: var(--ash); font-size: 11px; line-height: 1.55; }
.environment-counter-grid { display: grid; gap: 8px; }
.environment-counter { min-height: 78px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); }
.environment-counter.locked { border-color: var(--mint); background: color-mix(in srgb, var(--mint) 10%, white); }
.environment-counter strong { display: block; font-size: 12px; }
.environment-counter span { display: block; margin-top: 4px; color: var(--ash); font-size: 7px; }
.counter-control { display: grid; grid-template-columns: 40px 48px 40px; }
.counter-control button, .counter-control input { height: 42px; padding: 0; border: 1px solid var(--line); background: white; color: var(--ink); text-align: center; }
.counter-control button { font-size: 18px; cursor: pointer; }
.counter-control input { border-right: 0; border-left: 0; font-size: 12px; font-weight: 800; }
.counter-control button:disabled { cursor: not-allowed; opacity: .35; }
.counter-control input[readonly] { background: var(--paper); color: var(--ink); }
.scope-warning { margin-top: 16px; padding: 14px; display: flex; gap: 10px; align-items: flex-start; background: var(--amber-soft); color: var(--amber); font-size: 9px; line-height: 1.5; }
.scope-warning svg { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.review-block { padding: 16px 0; border-bottom: 1px solid var(--line); }
.review-block > span { color: var(--ash); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.review-block > strong { display: block; margin-top: 6px; font-size: 17px; }
.review-block > p { margin: 7px 0 0; color: var(--ash); font-size: 10px; line-height: 1.55; }
.review-block.emphasis { margin: 10px 0 0; padding: 16px; border: 0; background: var(--green-soft); color: var(--green); }
.review-block.emphasis > span, .review-block.emphasis > p { color: inherit; opacity: .75; }

.inspection-title-row p { margin: 6px 0 0; color: var(--ash); font-size: 10px; }
.environment-button { min-width: 145px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.environment-button b { min-width: 30px; font-size: 8px; text-align: right; }
.status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.status-button:last-child { grid-column: auto; }
.status-button[data-status="no_conforme"].selected { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.status-button[data-status="pendiente"].selected { border-color: var(--ink); background: var(--gray-soft); color: var(--ink); }
.status-button[data-status="no_aplica"].selected { border-color: var(--ash); background: var(--surface-soft); color: var(--ash); }
.response-requirement { margin-top: 10px; padding: 11px; display: flex; gap: 9px; align-items: flex-start; background: var(--red-soft); color: var(--red); font-size: 9px; line-height: 1.45; }
.response-requirement.pending { background: var(--gray-soft); color: var(--ink); }
.response-requirement svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.read-only-banner { margin: -4px 0 18px; padding: 10px 12px; background: var(--green-soft); color: var(--green); font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.side-title { padding: 0 0 12px; color: var(--ash); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.desktop-environments button:disabled { opacity: .28; cursor: default; }

.matrix-legend { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.matrix-legend span { display: flex; align-items: center; gap: 6px; color: var(--ash); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.matrix-legend i { width: 10px; height: 10px; display: block; background: var(--gray-soft); }
.matrix-legend i.success { background: var(--green-soft); }
.matrix-legend i.warning { background: var(--amber-soft); }
.matrix-legend i.danger { background: var(--red-soft); }
.matrix-scroll { margin: 14px -16px 0; overflow: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.review-matrix { min-width: 1120px; border-collapse: collapse; }
.review-matrix th, .review-matrix td { min-width: 112px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.review-matrix thead th { height: 72px; position: sticky; z-index: 3; top: 0; background: var(--ink); color: white; font-size: 8px; line-height: 1.3; text-align: left; }
.review-matrix thead th:first-child { left: 0; z-index: 4; }
.review-matrix tbody th { min-width: 190px; position: sticky; z-index: 2; left: 0; background: var(--surface); font-size: 9px; line-height: 1.25; text-align: left; }
.review-matrix tbody th small { display: block; margin-bottom: 4px; color: var(--green); font-size: 7px; }
.matrix-cell { width: 100%; min-height: 54px; padding: 7px; display: grid; place-items: center; align-content: center; gap: 3px; border: 1px solid transparent; background: var(--gray-soft); color: var(--ash); cursor: pointer; }
.matrix-cell strong { font-size: 11px; }
.matrix-cell span { min-height: 10px; font-size: 7px; }
.matrix-cell.success { background: var(--green-soft); color: var(--green); }
.matrix-cell.warning { background: var(--amber-soft); color: var(--amber); }
.matrix-cell.danger { background: var(--red-soft); color: var(--red); }
.matrix-cell.progress { border-color: rgba(31,59,53,.22); background: white; color: var(--green); }
.matrix-empty { color: var(--ash); text-align: center; opacity: .35; }

.mobile-nav { grid-template-columns: repeat(4, 1fr); }

@media (min-width: 700px) {
  .login-view { padding: 110px 40px 70px; }
  .login-brand { top: 40px; left: 42px; }
  .login-brand img { width: 205px; }
  .login-card { padding: 38px; }
  .page-heading-row { flex-direction: row; justify-content: space-between; align-items: flex-end; }
  .page-heading-row > .primary-button, .page-heading-row > .secondary-button { width: auto; }
  .module-grid { grid-template-columns: 1.15fr .85fr; }
  .module-card { min-height: 390px; padding: 32px; }
  .module-card h2 { font-size: 48px; }
  .project-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-list-card { padding: 26px; }
  .project-overview-head { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .project-facts { grid-template-columns: repeat(4, 1fr); }
  .project-action-row { grid-template-columns: 1fr auto; align-items: end; }
  .button-pair { grid-template-columns: auto auto; }
  .workflow-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .environment-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wizard-card { max-width: 850px; margin-right: auto; margin-left: auto; }
  .wizard-stepper { max-width: 700px; margin-right: auto; margin-left: auto; }
  .wizard-heading, .wizard-form, .wizard-review { padding: 28px; }
  .form-grid.two-columns { grid-template-columns: repeat(2, 1fr); }
  .form-field.full { grid-column: 1 / -1; }
  .wizard-actions { grid-template-columns: auto auto; justify-content: end; }
  .wizard-actions button { width: auto; min-width: 150px; }
  .environment-counter-grid { grid-template-columns: repeat(2, 1fr); }
  .status-grid { grid-template-columns: repeat(4, 1fr); }
  .matrix-scroll { margin-right: 0; margin-left: 0; }
}

@media (min-width: 1020px) {
  .project-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .environment-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 430px) {
  .status-grid { grid-template-columns: 1fr; }
  .page-heading-row .page-title { font-size: 50px; }
  .project-facts { grid-template-columns: 1fr 1fr; }
  .environment-counter { align-items: flex-start; flex-direction: column; }
  .counter-control { width: 100%; grid-template-columns: 1fr 1.2fr 1fr; }
}

/* Prototype Lab v0.8 · alcance por ambiente e informe preliminar */
.summary-action-stack { margin-top: 18px; display: grid; gap: 8px; }
.summary-action-stack button { width: 100%; margin-top: 0 !important; }
.report-view { width: min(980px, calc(100% - 24px)); }
.report-actions { margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.report-actions button { width: 100%; }
.report-sheet { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.report-cover { min-height: 360px; padding: 28px 24px; display: flex; flex-direction: column; background: var(--green); color: white; }
.report-cover img { width: 188px; filter: brightness(0) invert(1); }
.report-cover > div { margin-top: 44px; display: grid; gap: 6px; }
.report-cover > div span { color: rgba(255,255,255,.7); font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.report-cover > div strong { color: #f0c5b3; font-size: 9px; letter-spacing: .06em; }
.report-cover h1 { margin: auto 0 0; font-size: clamp(42px, 9vw, 74px); line-height: .92; letter-spacing: -.055em; }
.report-cover > p { margin: 18px 0 0; color: rgba(255,255,255,.72); font-size: 11px; }
.report-section { padding: 24px; border-top: 1px solid var(--line); }
.report-section-title { display: flex; align-items: flex-start; gap: 13px; }
.report-section-title > span { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border: 1px solid var(--green); color: var(--green); font-size: 8px; font-weight: 800; }
.report-section-title small { color: var(--ash); font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.report-section-title h2 { margin: 3px 0 0; font-size: 22px; line-height: 1.05; letter-spacing: -.035em; }
.report-facts { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.report-facts div { min-height: 76px; padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.report-facts span, .report-result small, .report-environment-grid span { display: block; color: var(--ash); font-size: 7px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.report-facts strong { display: block; margin-top: 7px; font-size: 10px; line-height: 1.4; }
.report-result { margin-top: 20px; display: grid; gap: 18px; }
.report-result > div:first-child { min-height: 180px; padding: 20px; display: grid; align-content: center; background: var(--paper); }
.report-result > div:first-child > strong { margin: 8px 0; font-size: 58px; line-height: 1; letter-spacing: -.055em; }
.report-result > div:first-child > span { width: fit-content; padding: 5px 8px; background: var(--gray-soft); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.report-result > div:first-child > span.success { background: var(--green-soft); color: var(--green); }
.report-result > div:first-child > span.warning { background: var(--amber-soft); color: var(--amber); }
.report-indicators { border-top: 1px solid var(--line); }
.report-indicators p { margin: 0; padding: 10px 0; display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); font-size: 9px; }
.report-indicators p span { color: var(--ash); }
.report-indicators p strong { text-align: right; }
.report-warning { margin-top: 18px; padding: 13px; border-left: 3px solid var(--copper); background: rgba(184,111,71,.08); color: var(--ash); font-size: 9px; line-height: 1.5; }
.report-environment-grid { margin-top: 20px; display: grid; gap: 8px; }
.report-environment-grid div { min-height: 82px; padding: 12px; border: 1px solid var(--line); }
.report-environment-grid strong { display: block; margin-top: 7px; font-size: 17px; }
.report-environment-grid small { display: block; margin-top: 5px; color: var(--ash); font-size: 7px; line-height: 1.4; }
.report-intro { margin: 16px 0; color: var(--ash); font-size: 9px; line-height: 1.5; }
.report-entry { margin-top: 10px; padding: 16px; border: 1px solid var(--line); break-inside: avoid; }
.report-entry.no_conforme { border-left: 4px solid var(--red); }
.report-entry.pendiente { border-left: 4px solid var(--amber); }
.report-entry.no_aplica { border-left: 4px solid var(--ash); }
.report-entry header { display: flex; gap: 10px; align-items: flex-start; }
.report-entry header > span { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; background: var(--ink); color: white; font-size: 7px; font-weight: 800; }
.report-entry header div { display: grid; gap: 3px; }
.report-entry header small { color: var(--ash); font-size: 7px; text-transform: uppercase; }
.report-entry header strong { font-size: 9px; }
.report-entry h4 { margin: 14px 0 0; font-size: 13px; line-height: 1.4; }
.report-entry > p { margin: 9px 0 0; color: var(--ash); font-size: 10px; line-height: 1.55; }
.report-evidence-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.report-evidence-grid figure { margin: 0; }
.report-evidence-grid img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: var(--surface-soft); }
.report-evidence-grid figcaption { margin-top: 4px; color: var(--ash); font-size: 6px; }
.report-evidence-placeholder { aspect-ratio: 4 / 3; padding: 8px; display: grid; place-items: center; align-content: center; background: var(--gray-soft); color: var(--ash); text-align: center; }
.report-evidence-placeholder small { font-size: 6px; letter-spacing: .08em; }
.report-evidence-placeholder strong { margin-top: 5px; font-size: 8px; }
.report-evidence-missing, .report-empty { margin-top: 14px; padding: 18px; border: 1px dashed var(--line-strong); color: var(--ash); font-size: 9px; text-align: center; }
.report-scope-list { margin-top: 18px; display: grid; gap: 7px; }
.report-scope-list > div { padding: 12px; display: grid; gap: 4px; border: 1px solid var(--line); }
.report-scope-list span, .report-scope-list small { color: var(--ash); font-size: 7px; }
.report-scope-list strong { font-size: 10px; }
.report-scope-list b { width: fit-content; padding: 4px 6px; background: var(--gray-soft); font-size: 7px; text-transform: uppercase; }
.report-scope-list b.added { background: var(--amber-soft); color: var(--amber); }
.report-scope-list b.removed { background: var(--red-soft); color: var(--red); }
.report-audit-note { margin: 14px 0 0; color: var(--ash); font-size: 8px; line-height: 1.5; }
.report-footer { padding: 18px 24px; display: flex; flex-direction: column; gap: 5px; background: var(--ink); color: white; font-size: 7px; letter-spacing: .05em; text-transform: uppercase; }
.report-footer span { color: rgba(255,255,255,.58); }

@media (min-width: 700px) {
  .catalog-toolbar { align-items: flex-start; }
  .report-actions { flex-direction: row; justify-content: flex-end; }
  .report-actions button { width: auto; }
  .report-cover { min-height: 490px; padding: 42px; }
  .report-section { padding: 34px 42px; }
  .report-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .report-result { grid-template-columns: .78fr 1.22fr; }
  .report-environment-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-footer { padding: 20px 42px; flex-direction: row; justify-content: space-between; }
}

@media (max-width: 520px) {
  .catalog-toolbar { align-items: stretch; flex-direction: column; }
  .catalog-toolbar > span { text-align: left; }
  .catalog-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .catalog-index-button, .rubric-config-button { min-width: 0; }
  .catalog-index-button { justify-content: center; }
  .rubric-config-button strong { max-width: 120px; }
  .rubric-dialog-foot { align-items: stretch; flex-direction: column; }
  .rubric-dialog-foot .primary-button { width: 100%; }
  .report-facts { grid-template-columns: 1fr; }
  .report-evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  @page { size: A4; margin: 12mm; }
  .prototype-notice, .app-header, .mobile-nav, .report-actions, .toast, .scope-popover { display: none !important; }
  body { padding: 0 !important; background: white; color: #111; }
  main { min-height: 0; }
  .report-view { width: 100%; margin: 0; padding: 0; }
  .report-sheet { border: 0; box-shadow: none; }
  .report-cover { min-height: 245mm; break-after: page; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .report-section { padding: 8mm 5mm; }
  .report-break { break-before: page; }
  .report-entry, .report-environment-grid div, .report-facts div { break-inside: avoid; }
  .report-footer { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
