:root {
  --bg: #070b16;
  --charcoal: #0e1628;
  --graphite: #16213a;
  --panel: rgba(17, 26, 46, 0.92);
  --panel-strong: rgba(22, 33, 58, 0.96);
  --ink: #f2f6fc;
  --muted: #a9b7cc;
  --soft: rgba(148, 163, 184, 0.1);
  --line: rgba(148, 163, 184, 0.2);
  --brand: #4aa3ff;
  --brand-2: #1560bd;
  --silver: #d6d7d9;
  --green: #2fd07f;
  --amber: #f0aa3d;
  --red: #f35b5b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  max-width: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(120deg, rgba(74, 163, 255, 0.09), transparent 34%),
    linear-gradient(240deg, rgba(74, 163, 255, 0.08), transparent 38%),
    linear-gradient(rgba(148, 163, 184, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.032) 1px, transparent 1px),
    linear-gradient(180deg, #060a14, var(--charcoal) 52%, #060a14);
  background-size: auto, auto, 34px 34px, 34px 34px, auto;
  color: var(--ink);
  font-family: "Work Sans", Cabin, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.15;
}

h2 {
  font-size: clamp(26px, 5vw, 58px);
  line-height: 0.98;
}

h3 {
  font-size: 16px;
  line-height: 1.25;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(7, 11, 22, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand > div,
.intro-copy,
.surface {
  min-width: 0;
}

.brand img {
  width: clamp(118px, 16vw, 178px);
  height: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

/* En el celular los botones del encabezado pasan a su propia línea en vez de salirse por la derecha. */
@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand {
    min-width: 0;
    flex: 1 1 100%;
  }

  .brand h1 {
    overflow-wrap: anywhere;
  }

  .actions {
    flex: 1 1 100%;
    justify-content: flex-start;
  }
}

body[data-view="home"] .app-action,
body[data-view="app"] .view-home,
body[data-view="results"] .view-home {
  display: none;
}

body[data-view="home"] #saveSubmission,
body[data-view="home"] #printReport,
body[data-view="library"] #saveSubmission,
body[data-view="library"] #printReport,
body[data-view="instructions"] #saveSubmission,
body[data-view="instructions"] #printReport,
body:not([data-view="results"]) #emailReport {
  display: none;
}

/* «Ingresar» y «Cerrar sesión» se ven también en la portada, donde el resto de .app-action se oculta. */
body[data-view="home"] .app-action.auth-entry:not([hidden]) {
  display: inline-block;
}

body[data-view="home"] .view-app {
  display: none;
}

body[data-view="app"] .report-panel,
body[data-view="results"] .form-panel {
  display: none;
}

body[data-view="app"] #printReport {
  display: none;
}

.auth-actions {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.diagnostic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.auth-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(22, 33, 58, 0.98), rgba(14, 22, 40, 0.98));
  box-shadow: var(--shadow);
  color: var(--ink);
  padding: 22px;
}

.auth-dialog::backdrop {
  background: rgba(3, 6, 14, 0.72);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-dialog-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.auth-dialog-head h2 {
  font-size: 1.2rem;
  margin: 0;
}

.auth-close {
  font-size: 1.3rem;
  line-height: 1;
  min-height: 32px;
  padding: 0 10px;
}

.auth-intro {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.auth-message {
  color: var(--silver);
  font-size: 0.85rem;
  margin: 0;
  min-height: 1.2em;
}

.auth-message[data-tone="error"] {
  color: var(--red);
}

.auth-message[data-tone="ok"] {
  color: var(--green);
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.auth-link {
  background: none;
  border: 0;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
  min-height: 0;
  padding: 4px 0;
}

.auth-link:hover {
  background: none;
  text-decoration: underline;
}

.auth-status {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.75rem;
  max-width: 15rem;
}

.auth-benefit {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.7rem;
  max-width: 11rem;
  line-height: 1.2;
}

body[data-view="library"] .view-home,
body[data-view="library"] .view-app {
  display: none;
}

body[data-view="library"] #libraryView {
  display: block;
}

body[data-view="instructions"] .view-home,
body[data-view="instructions"] .view-app,
body[data-view="instructions"] #libraryView {
  display: none;
}

body[data-view="instructions"] #instructionsView {
  display: block;
}

.instructions-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.instructions-panel {
  padding: clamp(24px, 5vw, 54px);
}

.instructions-lead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-top: 16px;
  max-width: 680px;
}

.instruction-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 28px 0;
}

.instruction-grid article {
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 6px;
  padding: 16px;
}

.instruction-grid span {
  color: var(--muted);
  line-height: 1.45;
}

.draft-notice {
  border-left: 3px solid var(--brand);
  color: var(--brand);
  margin: 16px 0;
  padding: 8px 12px;
}

.instructions-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 640px) {
  .instruction-grid {
    grid-template-columns: 1fr;
  }
}

.library-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.library-panel {
  padding: clamp(20px, 4vw, 42px);
}

.library-status {
  color: var(--muted);
  margin: 8px 0 22px;
}

.submission-list {
  display: grid;
  gap: 12px;
}

.submission-card {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 18px;
}

.submission-card h3,
.submission-card p {
  margin: 0;
}

.submission-card h3 {
  color: var(--ink);
  font-size: 1rem;
}

.submission-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 6px !important;
  font-size: 0.85rem;
}

.submission-summary {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 10px !important;
}

.admin-notice {
  background: rgba(74, 163, 255, 0.08);
  border: 1px solid rgba(74, 163, 255, 0.35);
  border-radius: 9px;
  margin-bottom: 18px;
  padding: 14px 16px;
}

.admin-notice strong,
.admin-notice p {
  display: block;
  margin: 4px 0 0;
}

.admin-notice p {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 700px) {
  .submission-card {
    grid-template-columns: 1fr;
  }
}

.app-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

body[data-view="app"] .shell,
body[data-view="results"] .shell {
  grid-template-columns: minmax(0, 860px);
  justify-content: center;
}

body[data-view="app"] .topbar {
  padding-top: 8px;
  padding-bottom: 8px;
}

body[data-view="app"] .brand {
  gap: 12px;
}

body[data-view="app"] .brand img {
  width: 104px;
  max-height: 54px;
  object-fit: contain;
}

body[data-view="app"] .brand h1 {
  font-size: 16px;
}

body[data-view="app"] .actions button {
  min-height: 34px;
  padding: 0 12px;
}

body[data-view="app"] .shell {
  padding-top: 16px;
  padding-bottom: 24px;
}

body[data-view="app"] .form-panel {
  padding: 14px 20px 16px;
}

body[data-view="app"] .form-panel .section-title {
  display: none;
}

body[data-view="app"] .wizard-status {
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  margin-bottom: 12px;
  padding: 0 0 12px;
}

body[data-view="app"] .wizard-status span {
  font-size: 11px;
}

body[data-view="app"] .wizard-status strong {
  font-size: 16px;
  line-height: 1.25;
}

body[data-view="app"] .wizard-track {
  height: 6px;
}

body[data-view="app"] .domain-heading {
  margin-bottom: 8px;
  font-size: 14px;
}

body[data-view="app"] .domain-heading span {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 11px;
}

body[data-view="app"] .question {
  gap: 9px;
  padding-top: 6px;
}

body[data-view="app"] .question-title {
  font-size: 16px;
  line-height: 1.3;
}

body[data-view="app"] .scale {
  gap: 6px;
  padding: 6px;
}

body[data-view="app"] .scale label,
body[data-view="app"] .scale span {
  min-height: 48px;
}

body[data-view="app"] .scale span {
  grid-template-columns: 28px 1fr;
  padding: 8px 10px;
}

body[data-view="app"] .scale b {
  width: 26px;
  height: 26px;
  font-size: 14px;
}

body[data-view="app"] .scale small {
  font-size: 12px;
  line-height: 1.3;
}

body[data-view="app"] .wizard-nav {
  margin-top: 12px;
  padding-top: 12px;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(22, 33, 58, 0.72);
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.primary-action {
  border-color: rgba(74, 163, 255, 0.7);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.primary-action:hover {
  background: linear-gradient(135deg, #6bb5ff, #2a74d6);
  color: #fff;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 42px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  min-height: calc(100vh - 110px);
  padding: 54px 20px 56px;
}

/* En el celular la órbita va debajo del texto: con dos columnas la del texto quedaba en 0 px. */
@media (max-width: 760px) {
  .intro {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    min-height: 0;
    padding-top: 32px;
  }

  .maturity-orbit {
    min-height: 260px;
  }
}

.signal-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.signal-label::before {
  content: "";
  width: 32px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), transparent);
}

.intro-copy p {
  max-width: 760px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.intro-actions button {
  min-width: 168px;
}

.maturity-orbit {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  isolation: isolate;
}

.maturity-orbit::before,
.maturity-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 50%;
}

.maturity-orbit::before {
  width: 280px;
  height: 280px;
}

.maturity-orbit::after {
  width: 206px;
  height: 206px;
  border-color: rgba(74, 163, 255, 0.26);
}

.orbit-ring {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 156px;
  height: 156px;
  border: 2px solid transparent;
  border-radius: 50%;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    conic-gradient(from -38deg, var(--brand), var(--brand-2), rgba(148, 163, 184, 0.2), var(--brand)) border-box;
  text-align: center;
  box-shadow: 0 0 44px rgba(74, 163, 255, 0.18);
}

.orbit-ring span {
  font-size: 54px;
  font-weight: 900;
  line-height: 1;
}

.orbit-ring small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.orbit-meta {
  position: absolute;
  right: 0;
  bottom: 16px;
  z-index: 2;
  display: grid;
  gap: 8px;
}

.orbit-meta span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 26, 46, 0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.orbit-meta strong {
  color: var(--brand);
  font-size: 18px;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(390px, 0.72fr);
  gap: 22px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 20px 44px;
}

.surface {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22, 33, 58, 0.94), rgba(14, 22, 40, 0.92));
  box-shadow: var(--shadow);
}

.form-panel,
.report-panel {
  padding: 22px;
}

.form-panel {
  color: var(--ink);
}

.form-panel .section-title,
.form-panel .question-title,
.form-panel .wizard-status strong,
.form-panel .domain-heading {
  color: #eaf0fa;
}

.form-panel .eyebrow,
.form-panel .wizard-status span {
  color: #8cc4ff;
}

.form-panel .pill {
  border-color: rgba(18, 111, 116, 0.2);
  background: rgba(74, 163, 255, 0.1);
  color: #8cc4ff;
}

.report-panel {
  position: sticky;
  top: 86px;
  align-self: start;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  overflow-x: hidden;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(74, 163, 255, 0.28);
  border-radius: 999px;
  background: rgba(74, 163, 255, 0.12);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.pill.muted {
  border-color: var(--line);
  background: var(--soft);
  color: var(--muted);
}

.company-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 22px;
}

.wizard-status {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 14px 0 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.wizard-status span {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.wizard-status strong {
  font-size: 20px;
}

.wizard-track {
  height: 8px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.wizard-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: grid;
}

.company-grid:not(.deferred-contact-step) > label:first-of-type {
  grid-column: 1 / -1;
}

.company-grid {
  align-items: start;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.wizard-nav button {
  min-width: 132px;
}

.deferred-contact-copy {
  display: grid;
  grid-column: 1 / -1;
  gap: 4px;
  padding-bottom: 4px;
}

.deferred-contact-copy strong {
  color: #eaf0fa;
  font-size: 16px;
}

.deferred-contact-copy span {
  color: #9fb0c8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

label {
  display: grid;
  gap: 7px;
  color: #b6c3d8;
  font-size: 12px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background-color: rgba(7, 11, 22, 0.55);
  color: #eaf0fa;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

input::placeholder {
  color: #7f8ea6;
  font-weight: 500;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23b6c3d8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

select:has(option[value=""]:checked) {
  color: #7f8ea6;
}

input:focus,
select:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(74, 163, 255, 0.14);
}

.domain-block {
  margin-top: 0;
  padding: 0;
  border-top: 0;
}

.domain-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.domain-heading::before {
  display: none;
}

.domain-heading span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(18, 111, 116, 0.22);
  border-radius: 50%;
  background: rgba(74, 163, 255, 0.12);
  color: #8cc4ff;
  font-size: 12px;
  font-weight: 900;
}

.question {
  display: grid;
  gap: 12px;
  padding: 16px 0 4px;
  border: 0;
  margin: 0;
}

.question:first-of-type {
  border-top: 0;
}

.question-title {
  padding: 0;
  color: #eaf0fa;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
}

.scale {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.scale label {
  position: relative;
  display: block;
  min-height: 58px;
  color: #eaf0fa;
}

.scale input {
  position: absolute;
  opacity: 0;
}

.scale span {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.scale b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: #c7d3e6;
  font-size: 16px;
}

.scale small {
  color: #d3deee;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.42;
}

.scale label:hover span {
  border-color: rgba(18, 111, 116, 0.34);
  background: rgba(74, 163, 255, 0.08);
}

.scale input:checked + span {
  border-color: #4aa3ff;
  background: rgba(74, 163, 255, 0.16);
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(74, 163, 255, 0.14);
}

.scale input:checked + span b {
  background: #4aa3ff;
  color: #ffffff;
}

.scale input:checked + span small {
  color: #ffffff;
}

.scale-help {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.empty {
  display: grid;
  gap: 8px;
  min-height: 220px;
  place-content: center;
  padding: 34px;
  border: 1px dashed rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(74, 163, 255, 0.08), transparent),
    rgba(255, 255, 255, 0.03);
  color: var(--muted);
  text-align: center;
}

.empty strong {
  color: var(--ink);
  font-size: 18px;
}

.empty.compact {
  min-height: 110px;
  padding: 18px;
}

.report {
  display: grid;
  gap: 22px;
}

.hidden,
.report.hidden {
  display: none;
}

.print-brand {
  display: none;
}

.score-hero {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(74, 163, 255, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(74, 163, 255, 0.14), rgba(21, 96, 189, 0.08)),
    rgba(255, 255, 255, 0.04);
}

.score-ring {
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #0b1224 58%, transparent 60%),
    conic-gradient(var(--brand) 0deg, rgba(148, 163, 184, 0.13) 0deg 360deg);
}

.score-ring span {
  font-size: 34px;
  font-weight: 900;
}

.score-copy p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-copy strong {
  display: block;
  margin: 6px 0 14px;
  font-size: 18px;
  line-height: 1.2;
}

.maturity-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.maturity-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 19.2%, rgba(0, 0, 0, 0.38) 19.2% 20%);
}

.maturity-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
}

/* Titulo de dominio: mismo tamano en resumen, grafico y prioridades */
.domain-title {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.domain-bars,
.priority-list {
  display: grid;
  gap: 14px;
}

.domain-bar-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.domain-bar-head .domain-title {
  flex: 1;
  min-width: 0;
}

.domain-level {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.domain-score {
  min-width: 34px;
  text-align: right;
  font-size: 18px;
}

.domain-bar-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.domain-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.domain-bar-target {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--brand-2);
}

.domain-footnote {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* Etiqueta de prioridad (Crítica, Alta, Media, Baja) en prioridades y resumen por dominio. */
.priority-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.priority-card .priority-tag {
  margin-bottom: 6px;
}

.priority-critica { color: #f35b5b; }
.priority-alta { color: #f08a3d; }
.priority-media { color: #f0aa3d; }
.priority-baja { color: #2fd07f; }

.highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.highlight-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--highlight-color, var(--brand));
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.04);
  min-width: 0;
}

.highlight-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.highlight-card strong {
  color: var(--ink);
  font-size: 21px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.highlight-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.domain-overview {
  display: grid;
  gap: 16px;
}

.domain-radar svg {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
}

.radar-ring {
  fill: none;
  stroke: rgba(148, 163, 184, 0.25);
  stroke-width: 1;
}

.radar-axis {
  stroke: rgba(148, 163, 184, 0.25);
  stroke-width: 1;
}

.radar-target {
  fill: none;
  stroke: var(--brand-2);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.radar-area {
  fill: rgba(74, 163, 255, 0.22);
  stroke: var(--brand);
  stroke-width: 2;
}

.radar-label {
  fill: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

@media (max-width: 480px) {
  .highlights {
    grid-template-columns: 1fr;
  }


  /* Nombre del dominio en su propia línea; nivel y prioridad debajo. */
  .domain-bar-head {
    flex-wrap: wrap;
    row-gap: 2px;
  }

  .domain-bar-head .domain-title {
    flex: 1 1 70%;
  }

  .domain-bar-head .domain-level {
    order: 3;
    flex-basis: 100%;
  }
}

.priority-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--priority-color, var(--amber));
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.04);
}

.priority-rank {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--priority-color, var(--amber));
  color: #121718;
  font-size: 14px;
  font-weight: 900;
}

.priority-actions {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.priority-actions li + li {
  margin-top: 4px;
}

.report h3 {
  margin-bottom: 8px;
}

.scale-intro {
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.level-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Cinco columnas no caben en el celular: la escala pasa a una lista (va después de la regla base). */
@media (max-width: 480px) {
  .level-scale {
    grid-template-columns: 1fr;
  }
}

.level-scale li {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.04);
  color: var(--muted);
}

.level-scale b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.16);
  color: var(--ink);
  font-size: 12px;
}

.level-scale strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.level-scale span {
  font-size: 11px;
  line-height: 1.35;
}

.level-scale li.current {
  border-color: var(--brand);
  background: rgba(74, 163, 255, 0.14);
  box-shadow: 0 0 0 2px rgba(74, 163, 255, 0.25);
}

.level-scale li.current b {
  background: var(--brand);
  color: #fff;
}

.next-steps {
  margin: 10px 0 14px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.disclaimer,
#executiveSummary {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.disclaimer {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

/* Portada: datos generales del diagnostico */
.report-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 18px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.report-meta dt {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-meta dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
}

/* Seccion final: proximos pasos, nota y contacto */
.final-contact {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 13px;
}

.contact-cta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.contact-email {
  margin: 8px 0 0;
  color: var(--muted);
}

.contact-email a {
  color: var(--brand);
  font-weight: 700;
}

.contact-button {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.contact-url {
  display: none;
}

.report-date {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

#reportTitle {
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.15;
}

@media print {
  @page {
    size: Letter;
    margin: 12mm;
  }

  /* Los textos del reporte usan estas variables: en papel van oscuros sobre blanco. */
  :root {
    --ink: #111;
    --muted: #4a4f50;
    --line: #d6d7d9;
    --soft: #f6f8f9;
  }

  body {
    background: #fff;
    color: #111;
  }

  /* La impresion parte en el logo: nada de botones, menus ni verificacion. */
  .topbar,
  .intro,
  .form-panel,
  .diagnostic-actions,
  .instructions-shell,
  .library-shell,
  .auth-dialog {
    display: none !important;
  }

  .shell {
    display: block;
    max-width: none;
    padding: 0;
  }

  .report-panel {
    position: static;
    max-height: none;
    overflow: visible;
    border: none;
    background: #fff;
    box-shadow: none;
    color: #111;
    padding: 0;
  }

  .print-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 2px solid #1560bd;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .print-brand img {
    width: 150px;
    height: auto;
  }

  .print-brand div {
    display: grid;
    gap: 2px;
    text-align: right;
  }

  .print-brand strong {
    font-size: 14px;
  }

  .report {
    gap: 10px;
  }

  .report h3 {
    margin-bottom: 6px;
    break-after: avoid;
    page-break-after: avoid;
  }

  .report-meta {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #f6f8f9;
    border-color: #d6d7d9;
  }

  .section-title {
    margin-bottom: 12px;
  }

  #reportTitle {
    font-size: 21px;
  }

  /* El nivel ya va en la tarjeta de puntaje: sin la pastilla el titulo cabe en una linea. */
  #globalLevel {
    display: none;
  }

  .score-hero {
    padding: 10px 14px;
    border-color: #d6d7d9;
    background: #f6f8f9;
  }

  .score-ring {
    width: 84px;
    height: 84px;
    color: #fff;
  }

  .score-hero {
    grid-template-columns: 96px 1fr;
  }

  .priority-card {
    padding: 7px 12px;
    background: #fff;
  }

  .scale-intro {
    margin: 8px 0 6px;
  }

  .level-scale li {
    padding: 6px 8px;
    background: #fff;
    border-color: #d6d7d9;
  }

  .level-scale li.current {
    background: #e8f2ff;
    border-color: #4aa3ff;
    box-shadow: none;
  }

  .level-scale span {
    font-size: 10px;
  }

  .level-scale li,
  .level-scale b {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .priority-actions {
    margin-top: 4px;
  }

  .priority-rank {
    color: #111;
  }

  .priority-actions,
  .next-steps,
  .disclaimer,
  #executiveSummary {
    font-size: 12px;
    line-height: 1.45;
  }

  .domain-bars,
  .priority-list {
    gap: 8px;
  }

  .domain-bar-head {
    margin-bottom: 4px;
  }

  .domain-bar-track,
  .domain-bar-track span,
  .domain-score,
  .priority-card,
  .priority-rank,
  .maturity-track,
  .maturity-track span,
  .score-ring {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .domain-bar-track {
    background: #e4e7e8;
  }

  .section-title .eyebrow {
    color: #1560bd;
  }

  .contact-email a {
    color: #1560bd;
  }

  .contact-button {
    border: 1px solid #1560bd;
    background: #fff;
    color: #1560bd;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .contact-url {
    display: inline-block;
    margin-left: 10px;
    color: #4a4f50;
    font-size: 12px;
  }

  .domain-overview {
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
  }

  .radar-label {
    fill: #111;
    font-size: 19px;
  }

  /* En papel el nombre del dominio va en una línea y el nivel con la prioridad debajo. */
  .domain-bar-head {
    flex-wrap: wrap;
    row-gap: 0;
  }

  .domain-bar-head .domain-title {
    flex: 1 1 70%;
    font-size: 13px;
  }

  .domain-bar-head .domain-level {
    order: 3;
    flex-basis: 100%;
    font-size: 10.5px;
  }

  .domain-bar-head .domain-score {
    font-size: 14px;
  }

  .domain-bars {
    gap: 6px;
  }

  .radar-ring,
  .radar-axis {
    stroke: #c9ced1;
  }

  .radar-area,
  .radar-dot,
  .priority-tag,
  .highlight-card {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .highlight-card {
    padding: 8px 12px;
    background: #fff;
  }

  .highlight-card strong {
    font-size: 16px;
  }

  .priority-critica { color: #c62828; }
  .priority-alta { color: #c2410c; }
  .priority-media { color: #a16207; }
  .priority-baja { color: #15803d; }

  /* Ni las tarjetas ni la seccion final se parten entre paginas. */
  .priority-card,
  .domain-bar,
  .domain-radar,
  .highlights,
  .final-section,
  .score-hero {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

.field-error {
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
}

input[aria-invalid="true"] {
  border-color: #c2410c;
}

option {
  background: #0e1628;
  color: #eaf0fa;
}
