/* A calm, shared visual layer for the public experience. */
:root {
  --surface-soft: #f5f3f9;
  --setup-accent: #5546a3;
  --setup-line: #dcd8e9;
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
}
[data-theme="dark"] {
  --surface-soft: #1b2033;
  --setup-accent: #c3b7ff;
  --setup-line: #3c425b;
}
body { background: var(--bg-main); }
html:not([data-theme="dark"]) body { --bg-main: #f7f6f3; }
html[data-theme="dark"] body { --bg-main: #101321; }
.app-header { box-shadow: none; padding-block: 1rem; }
.app-header .btn-academic { box-shadow: none; background: transparent; }
.app-header .btn-academic-label { display: none; }
.app-header .btn-academic-title { font-size: .84rem; }
.container { max-width: 1180px; }
.card { border-radius: 24px; box-shadow: 0 8px 32px rgb(25 23 44 / 4%); }
.btn { transition: background .2s, box-shadow .2s, transform .2s; }
:is(button, a, input, select):focus-visible {
  outline: 3px solid var(--setup-accent);
  outline-offset: 4px;
}
#screenIntro [hidden] { display: none !important; }
#screenIntro > .card:first-child { padding: clamp(1.25rem, 4vw, 3.5rem); overflow: hidden; }
.intro-overview { padding: 0; }
.intro-overview-copy { max-width: 780px; text-align: left; margin: 0; }
.intro-overview-copy h2 { font-size: clamp(2.3rem, 4.8vw, 4.1rem); line-height: 1.08; letter-spacing: -.045em; }
.intro-overview-copy .landing-welcome-sub { font-size: 1.06rem; max-width: 680px; margin: 1.35rem 0 2rem; }
.section-kicker { color: var(--setup-accent); letter-spacing: .13em; font-size: .72rem; }
.landing-welcome-actions { gap: 1rem; }
.landing-action-card { text-align: left; border: 1px solid var(--setup-line); box-shadow: none; border-radius: 18px; background: var(--bg-glass-solid); }
.landing-action-card:first-child { background: var(--surface-soft); }
.landing-action-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgb(40 34 75 / 8%); }
.landing-card-icon-bg { border-radius: 12px; }
.intro-feature-grid { border-top: 1px solid var(--border); padding-top: 1.5rem; }
.intro-feature-card { padding: .5rem; background: transparent; border: 0; box-shadow: none; }
.intro-feature-card h3 { font-size: 1rem; }
.intro-feature-card p { font-size: .85rem; }
/* The landing cards and the setup footer are the only forward navigation. */
#screenIntro .carousel-controls { display: none; }
.carousel-track { transition: transform .38s var(--motion-ease), height .28s var(--motion-ease) !important; }
.carousel-slide { filter: none !important; transform: none !important; transition: opacity .28s ease !important; }
.onboarding-flow {
  --onboarding-max: 900px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  max-width: 900px;
  margin: auto;
  text-align: left;
  padding: 0;
}
.onboarding-flow > * { grid-column: 1 / -1; min-width: 0; }
.diagnostic-heading { margin: 0; text-align: left; }
.diagnostic-heading h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); line-height: 1.15; }
.setup-intro { color: var(--text-secondary); line-height: 1.65; max-width: 640px; margin: 0 0 .5rem; }
.onboarding-flow .setup-progress-panel { width: 100%; margin: .25rem 0 .8rem; padding: 1.25rem 1.4rem; background: var(--surface-soft); border: 1px solid var(--setup-line); border-radius: 16px; }
.setup-progress-copy { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.setup-progress-copy > span { color: var(--text-secondary); font-size: .8rem; line-height: 1.4; }
.setup-progress-copy > strong { font-size: .95rem; }
.onboarding-flow .setup-progress-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; padding: 0; margin: 0; }
.setup-step { display: flex; align-items: center; gap: .6rem; color: var(--text-secondary); font-size: .8rem; line-height: 1.3; }
.setup-step-number { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--setup-line); border-radius: 50%; font-variant-numeric: tabular-nums; }
.setup-step.active { color: var(--setup-accent); font-weight: 700; }
.setup-step.active .setup-step-number { color: white; background: #5546a3; border-color: #5546a3; }
.setup-step.complete .setup-step-number { background: var(--surface-soft); color: var(--setup-accent); }
#screenIntro .onboarding-flow .onboarding-step.active {
  width: 100%;
  min-height: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0;
  animation: setup-reveal .3s var(--motion-ease) both;
}
#screenIntro .onboarding-flow #profileSelectorPanel h3 { text-align: left; margin: 0 0 1.1rem; font-size: 1.15rem; }
.onboarding-flow .profile-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
#screenIntro .onboarding-flow .profile-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 0;
  min-height: 210px;
  width: 100%;
  border-radius: 16px;
  gap: .5rem;
  padding: 1.2rem !important;
  text-align: left;
  white-space: normal;
  font: inherit;
  background: var(--bg-glass-solid) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--setup-line) !important;
  box-shadow: none !important;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
#screenIntro .profile-choice-header { display: flex; justify-content: space-between; align-items: center; width: 100%; margin: 0 0 .5rem; }
#screenIntro .profile-choice-title { display: block; max-width: 100%; line-height: 1.35; overflow-wrap: anywhere; font-weight: 800; margin-bottom: .2rem; }
#screenIntro .profile-choice-desc { display: block; max-width: 100%; }
#screenIntro .onboarding-flow .profile-choice:hover { transform: translateY(-2px) !important; border-color: var(--setup-accent) !important; }
#screenIntro .onboarding-flow .profile-choice.active { background: var(--surface-soft) !important; border-color: var(--setup-accent) !important; box-shadow: inset 0 0 0 1px var(--setup-accent) !important; }
#screenIntro .profile-choice .profile-choice-title { color: var(--text-primary); font-size: 1.05rem; }
#screenIntro .profile-choice .profile-choice-desc { color: var(--text-secondary) !important; font-size: .84rem !important; line-height: 1.5 !important; }
#screenIntro .profile-choice .profile-choice-icon-bg { width: 38px; height: 38px; display: grid; place-items: center; background: var(--surface-soft); color: var(--setup-accent); border-radius: 10px; }
#screenIntro .profile-choice-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--setup-line); display: grid; place-items: center; }
#screenIntro .profile-choice.active .profile-choice-check::after { content: '✓'; color: white; font-size: .72rem; font-weight: 800; }
#screenIntro .profile-choice.active .profile-choice-check { background: #5546a3; border-color: #5546a3; box-shadow: none; }
.profile-preview { min-height: 3em; margin-top: 1rem; padding: .85rem 1rem; border-left: 3px solid var(--setup-line); color: var(--text-secondary); font-size: .87rem; line-height: 1.55; }
#countryWrapper, #nivelEducativoWrapper { grid-column: auto; }
#screenIntro .onboarding-flow .onboarding-step label { text-align: left !important; font-size: .9rem; }
#screenIntro .onboarding-flow .input { width: 100%; min-height: 50px; border: 1px solid var(--setup-line); border-radius: 10px; background: var(--bg-glass-solid); box-shadow: none; color: var(--text-primary); font-size: 1rem; }
#screenIntro .onboarding-flow select[data-native-select] { display: block !important; padding: .75rem; }
#screenIntro .onboarding-flow :is(#nivelEducativoChips, #familiaridadChips) { display: none !important; }
#screenIntro #recursosSimilaresWrapper > div { display: flex !important; flex-wrap: wrap; gap: .65rem !important; }
#screenIntro #recursosSimilaresWrapper label { min-height: 44px; min-width: 0; width: auto; flex: 1 1 auto; padding: .65rem .85rem; border-radius: 10px; background: var(--bg-glass-solid); box-shadow: none; transform: none; justify-content: flex-start; }
#screenIntro #recursosSimilaresWrapper label:has(input:checked) { background: var(--surface-soft); border-color: var(--setup-accent); color: var(--text-primary); }
#screenIntro .onboarding-flow .consent-box.active { display: block !important; border-top: 1px solid var(--border) !important; padding-top: 1rem !important; }
#screenIntro .setup-consent { display: flex; align-items: flex-start; gap: .7rem; cursor: pointer; }
#screenIntro .setup-consent input {
  appearance: auto !important;
  position: static !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  width: 20px !important;
  height: 20px !important;
  flex: 0 0 20px;
  margin-top: .2rem;
  box-shadow: none !important;
  accent-color: #5546a3;
}
#screenIntro .consent-help { padding: .4rem 0 0 1.95rem; font-size: .8rem !important; }
#screenIntro .onboarding-controls { display: flex; flex-direction: row; justify-content: space-between; align-items: center; width: 100%; max-width: none; padding-top: 1.25rem; margin-top: .5rem; border-top: 1px solid var(--setup-line); gap: 1rem; }
#screenIntro .onboarding-controls .btn { min-height: 48px; min-width: 0; width: auto; border-radius: 10px; font-size: .9rem; }
#screenIntro #onboardingBackBtn { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-secondary); padding-inline: .25rem; }
#screenIntro #onboardingNextBtn { background: #5546a3; color: #fff; box-shadow: none; padding-inline: 1.7rem; }
#screenIntro .start-guidance { margin: 0; padding: .85rem 1rem; background: var(--surface-soft); border: 1px solid var(--setup-line); border-radius: 10px; box-shadow: none; }
#screenIntro .start-guidance:not([hidden]) { display: block; }
#screenIntro .start-guidance-list { display: block; font-size: .85rem; margin-top: .35rem; }
#screenIntro .framework-card { box-shadow: none; }
@keyframes setup-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* SVG components have their own names and solid paints; no legacy graph filters. */
#principleGraph, #principleResultGraph {
  width: min(100%, 760px) !important;
  min-height: 0 !important;
  height: auto;
  margin: 0 auto;
  padding: 0;
  border-radius: 16px;
  background: transparent;
}
.ethics-network {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: 'Plus Jakarta Sans', sans-serif;
  --en-edge: #b8b1d3;
  --en-disc: #ffffff;
  --en-label: #28223f;
  --en-muted: #655e79;
  --en-core: #f0ecfc;
  --en-priority: #6849b2;
  --en-progress: #316eac;
  --en-done: #287967;
}
[data-theme="dark"] .ethics-network {
  --en-edge: #666080;
  --en-disc: #202639;
  --en-label: #f2efff;
  --en-muted: #b9b1cd;
  --en-core: #302a49;
  --en-priority: #c3a5ff;
  --en-progress: #8cbffa;
  --en-done: #86d6be;
}
.ethics-network .en-link { fill: none; stroke: var(--en-edge); stroke-width: 2; stroke-linecap: round; opacity: .75; transition: stroke .3s, opacity .3s; }
.ethics-network .en-link.priority { stroke: var(--en-priority); }
.ethics-network .en-link.progress { stroke: var(--en-progress); }
.ethics-network .en-link.done { stroke: var(--en-done); }
.ethics-network .en-link.is-current { stroke-width: 3; opacity: 1; stroke-dasharray: 5 8; animation: en-signal 2s linear infinite; }
.ethics-network .en-core-disc { fill: var(--en-core); stroke: var(--en-edge); stroke-width: 1.5; }
.ethics-network .en-core-halo { fill: none; stroke: var(--en-edge); stroke-width: 1; opacity: .3; }
.ethics-network .en-core-title { font-size: 19px; font-weight: 800; fill: var(--en-label); }
.ethics-network .en-core-caption { font-size: 10px; fill: var(--en-muted); font-weight: 600; }
.ethics-network .en-node { cursor: pointer; outline: none; --en-node-color: var(--en-edge); }
.ethics-network .en-node.priority { --en-node-color: var(--en-priority); }
.ethics-network .en-node.progress { --en-node-color: var(--en-progress); }
.ethics-network .en-node.done { --en-node-color: var(--en-done); }
.ethics-network .en-disc { fill: var(--en-disc); stroke: var(--en-node-color); stroke-width: 1.8; transition: stroke-width .2s, fill .2s; }
.ethics-network .en-halo { fill: none; stroke: var(--en-node-color); stroke-width: 1.5; opacity: 0; transition: opacity .2s; }
.ethics-network .en-state-dot { fill: var(--en-node-color); }
.ethics-network .en-node text { pointer-events: none; stroke: none; }
.ethics-network .en-label { font-size: 13px; font-weight: 800; fill: var(--en-label); }
.ethics-network .en-status { font-size: 12px; font-weight: 650; fill: var(--en-node-color); }
.ethics-network .en-node.pending .en-status { fill: var(--en-muted); }
.ethics-network .en-count { font-size: 10px; fill: var(--en-muted); }
.ethics-network .en-node.is-current .en-halo { opacity: .55; animation: en-breathe 2.6s ease-in-out infinite; }
.ethics-network .en-node:is(.is-selected, :hover, :focus-visible) .en-disc { stroke-width: 3; }
.ethics-network .en-node:is(.is-selected, :focus-visible) .en-halo { opacity: 1; animation: none; stroke-width: 2; }
.en-hint { text-align: center; font-size: .8rem; color: var(--text-secondary); margin: .25rem 0 .9rem; }
.en-detail { min-height: 88px; padding: 1rem 1.2rem; border: 1px solid var(--setup-line); border-radius: 12px; background: var(--bg-glass-solid); text-align: left; }
.en-detail strong { display: block; font-size: .9rem; color: var(--text-primary); margin-bottom: .35rem; }
.en-detail p { margin: 0; font-size: .84rem; line-height: 1.6; color: var(--text-secondary); }
.ethics-network .en-node.is-preview .en-disc { stroke-width: 3; fill: var(--en-core); }
.ethics-network .en-link.is-preview { stroke-width: 3.5; opacity: 1; }
.ethics-network .en-node.en-updated .en-halo { animation: en-answer-pulse 1.1s ease-out; }
.ethics-network .en-link.en-updated { animation: en-answer-signal 1.1s ease-out; stroke-dasharray: 5 7; }
.en-detail .en-section-label { display: block; margin: .9rem 0 .45rem; color: var(--text-primary); font-size: .75rem; font-weight: 750; }
.en-response-list { list-style: none; margin: 0; padding: 0; }
.en-response-list li { display: grid; grid-template-columns: auto 1fr; gap: .45rem .7rem; margin: .5rem 0; font-size: .84rem; line-height: 1.5; }
.en-response-list small { grid-column: 2; color: var(--text-secondary); font-size: .78rem; }
.en-answer { align-self: start; border-radius: 6px; padding: .15rem .45rem; font-size: .73rem; font-weight: 750; background: var(--surface-soft); color: var(--setup-accent); white-space: nowrap; }
.en-answer.context { color: var(--text-secondary); border: 1px dashed var(--setup-line); }
.en-response-history { margin-top: .7rem; border-top: 1px solid var(--border); padding-top: .65rem; }
.en-response-history summary { cursor: pointer; font-size: .78rem; color: var(--setup-accent); padding: .3rem 0; }
.en-framework { border-top: 1px solid var(--border); margin-top: .9rem; }
.en-source-links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .6rem; }
.en-source-links a { color: var(--setup-accent); font-size: .76rem; text-decoration: underline; text-underline-offset: 3px; }
.en-action { margin-top: .9rem; padding: .75rem 1rem; background: var(--surface-soft); border-radius: 10px; }
.en-action .en-section-label { margin-top: 0; }
.en-detail .en-interpretation { margin-top: .8rem; font-size: .72rem; color: var(--text-secondary); }
@keyframes en-answer-pulse { 0% { opacity: 1; stroke-width: 5; } 100% { opacity: .3; stroke-width: 1.5; } }
@keyframes en-answer-signal { 0% { stroke-dashoffset: 36; stroke-width: 5; opacity: 1; } 100% { stroke-dashoffset: 0; stroke-width: 2; opacity: .8; } }
@keyframes en-signal { to { stroke-dashoffset: -26; } }
@keyframes en-breathe { 0%, 100% { opacity: .25; } 50% { opacity: .65; } }
@media (max-width: 680px) {
  .app-header { padding: .75rem 1rem; }
  .app-header h1 { font-size: .95rem; }
  .header-actions { gap: .35rem; }
  .app-header .btn-academic { padding: .45rem; }
  .app-header .btn-academic-icon { display: none; }
  .container { padding: 1rem; }
  #screenIntro > .card:first-child { padding: 1.15rem; border-radius: 18px; }
  .landing-welcome-actions, .onboarding-flow .profile-choice-grid { grid-template-columns: 1fr; }
  #screenIntro .onboarding-flow .profile-choice { min-height: 0; padding: 1rem !important; }
  .profile-choice-header { margin-bottom: .5rem; }
  .onboarding-flow .setup-progress-panel { padding: 1rem; }
  .setup-step { flex-direction: column; align-items: flex-start; font-size: .72rem; gap: .4rem; }
  .onboarding-flow { grid-template-columns: 1fr; }
  #countryWrapper, #nivelEducativoWrapper { grid-column: 1 / -1; }
  .intro-feature-grid { grid-template-columns: 1fr; gap: .75rem; }
  #screenIntro #onboardingNextBtn { padding-inline: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.recommended-case[hidden], .recommended-case [hidden] { display: none !important; }
.recommended-case { border: 1px solid var(--setup-line); text-align: left; }
.recommended-case h3, .recommended-case h4 { margin-bottom: .8rem; }
.recommended-case p { line-height: 1.65; }
.recommended-case blockquote { margin: 1rem 0 1.5rem; padding: 1rem 1.2rem; background: var(--surface-soft); border-left: 3px solid var(--setup-accent); border-radius: 0 12px 12px 0; }
.recommended-case blockquote p { margin: 0 0 .5rem; }
.recommended-case-context { color: var(--text-secondary); font-size: .85rem; margin: 1rem 0; }
.recommended-case [data-recommended-player]:not(:empty) { margin-top: 1.5rem; border-top: 1px solid var(--setup-line); padding-top: 1.5rem; }
