/* Etapa 2: entrada y navegación. El editor mantiene sus estilos originales. */
body[data-shell-view="welcome"] #flowProgress,
body[data-shell-view="welcome"] .workspace,
body[data-shell-view="home"] #flowProgress,
body[data-shell-view="home"] .workspace { display: none !important; }
body[data-shell-view="tool"] #flowProgress,
body[data-shell-view="tool"] .workspace { display: none !important; }
body[data-shell-view="simulator"] .shell-page { display: none !important; }
body[data-shell-view="welcome"] .topbar-actions { display: none !important; }
body[data-shell-view="welcome"] #shellMenu,
body[data-shell-view="home"] #shellCloseButton { display: none !important; }
body:not([data-shell-view="welcome"]) .topbar { position: sticky; top: 0; z-index: 25; }
.topbar-inner { position: relative; }
.topbar-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.topbar-actions #projectsButton,
.topbar-actions #accountButton,
.topbar-actions button[hidden] { display: none !important; }
body[data-shell-view="home"] .topbar-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shell-page { width: min(1060px, calc(100% - 32px)); margin: 24px auto 40px; padding: clamp(20px, 4vw, 42px); border: 1px solid #ded2c6; border-radius: 20px; background: #faf7f2; }
.shell-page[hidden] { display: none !important; }
.shell-welcome { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(220px, .75fr); align-items: center; gap: 32px; }
.shell-eyebrow { color: #9b633e; font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.shell-page h1 { margin: 8px 0 10px; color: #3c2415; font-family: Georgia, serif; font-size: clamp(30px, 4vw, 45px); line-height: 1.08; }
.shell-page p { line-height: 1.5; }
.shell-feature-list, .shell-tools { display: grid; gap: 10px; margin: 24px 0; }
.shell-tool-card { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 16px; border: 1px solid #dccbbc; border-radius: 12px; background: linear-gradient(90deg, var(--tool-accent), #fffdfa 78%); color: #3c2415; text-align: left; box-shadow: 0 2px 5px #3c24150d; }
.shell-feature-list .shell-tool-card { width: 100%; font: inherit; cursor: pointer; }
.account-message[data-kind="info"] { padding: 12px; border: 2px solid #2d7757; border-radius: 10px; background: #e8f5ec; color: #18543c; font-weight: 700; }
.shell-tool-card[data-tool="simulator"] { --tool-accent: #dcebea; --tool-stroke: #245f61; }
.shell-tool-card[data-tool="guide"] { --tool-accent: #f3e6d4; --tool-stroke: #79512d; }
.shell-tool-card[data-tool="calculator"] { --tool-accent: #e2ebdd; --tool-stroke: #3f6745; }
.shell-tool-card[data-tool="projects"] { --tool-accent: #f2ded3; --tool-stroke: #8b513b; }
.shell-tool-card strong, .shell-tool-card .shell-tool-copy, .shell-tool-card .shell-tool-copy span, .shell-feature-list .shell-tool-card > div > span { display: block; }
.shell-tool-card .shell-tool-copy, .shell-feature-list .shell-tool-card > div { min-width: 0; }
.shell-tool-card .shell-tool-copy span, .shell-feature-list .shell-tool-card > div > span { margin-top: 4px; color: #5d5751; font-size: 13px; line-height: 1.4; }
.shell-tool-icon { flex: 0 0 72px; display: block !important; width: 72px; height: 72px; margin: 0 !important; border-radius: 18px; overflow: hidden; }
.shell-tool-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shell-hero-image { display: block; width: 100%; max-height: 440px; object-fit: contain; border-radius: 16px; background: #eee9e2; }
.shell-entry-actions { display: grid; gap: 10px; }
.shell-entry-actions button { min-height: 44px; }
#welcomeReset { justify-self: start; border: 0; background: transparent; color: #603913; text-decoration: underline; box-shadow: none; cursor: pointer; }
.shell-home { min-height: min(590px, 70vh); }
.shell-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shell-tools button { min-height: 105px; cursor: pointer; }
.shell-tools button:hover:not(:disabled), .shell-tools button:focus-visible { border-color: var(--tool-stroke); background: #fffdfa; box-shadow: 0 4px 12px #3c24151c; }
.shell-tools button:focus-visible { outline: 3px solid var(--tool-stroke); outline-offset: 2px; }
.shell-tools button:active { transform: translateY(1px); background: var(--tool-accent); }
.shell-tools button:disabled { opacity: .7; cursor: default; box-shadow: none; }
.shell-home-note { padding: 14px; border-radius: 10px; background: #e3f0e8; color: #245b45; }
.shell-menu { position: absolute; z-index: 30; right: 0; top: calc(100% + 4px); display: grid; width: min(280px, calc(100vw - 32px)); padding: 8px; border: 1px solid #d8c5b4; border-radius: 12px; background: #fffdf9; box-shadow: 0 12px 30px #2d1a1433; }
.shell-menu[hidden] { display: none !important; }
.shell-menu button { min-height: 44px; padding: 9px 12px; border: 0; background: transparent; color: #3c2415; text-align: left; box-shadow: none; cursor: pointer; }
.shell-menu button:hover { background: #f1e8de; }
#shellBackButton, #shellMenuButton, #shellCloseButton { min-height: 44px; }
.fixture-banner { padding: 7px 12px; background: #6d4429; color: white; font-size: 12px; text-align: center; }
.fixture-banner button { padding: 3px 7px; border: 1px solid #fff8; background: transparent; color: white; box-shadow: none; cursor: pointer; font-size: 12px; }
.fixture-only { margin-top: 8px; }
.shell-leave-content { padding: 20px; }
.shell-leave-content h2 { margin: 0 0 8px; }
.shell-leave-content p { margin: 0 0 16px; }
.shell-leave-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shell-leave-actions button:last-child { grid-column: 1 / -1; }
.stage3-guide, .stage3-calculator { min-height: 55vh; }
.stage3-filter, .stage3-calculator form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 560px; }
.stage3-calculator form > * { min-width: 0; }
.stage3-filter[hidden], .guide-grid[hidden] { display: none; }
.stage3-filter select, .stage3-calculator select, .stage3-calculator input[type="text"] { display: block; box-sizing: border-box; width: 100%; min-height: 46px; margin-top: 7px; padding: 9px; border: 1px solid #cdb9a7; border-radius: 9px; background: #fff; color: #3c2415; font: inherit; }
.stage3-calculator label { font-weight: 600; }
.stage3-merma { min-width: 0; margin: 0; padding: 0; border: 0; }
.stage3-merma legend { margin-bottom: 9px; padding: 0; font-weight: 600; }
.stage3-merma-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.merma-choice { position: relative; display: block; min-width: 0; cursor: pointer; }
.merma-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.merma-choice span { display: grid; place-items: center; min-height: 48px; border: 2px solid currentColor; border-radius: 9px; background: #fff; font-size: 18px; font-weight: 700; }
.merma-choice[data-choice="yes"] span { color: #146149; }
.merma-choice[data-choice="no"] span { color: #a61d24; }
.merma-choice[data-choice="yes"] input:checked + span { background: #146149; color: #fff; }
.merma-choice[data-choice="no"] input:checked + span { background: #a61d24; color: #fff; }
.merma-choice input:focus-visible + span { outline: 3px solid #245f61; outline-offset: 3px; }
#calcResult { display: block; padding: 14px 16px; border-radius: 10px; font-size: 22px; font-weight: 700; }
#calcResult[hidden] { display: none; }
#calcResult[data-status="success"] { background: #dcefe5; color: #14583e; }
#calcResult[data-status="error"] { background: #fde8e8; color: #a61d24; font-size: 16px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 20px 0; }
.guide-card { display: grid; align-content: start; gap: 7px; min-width: 0; padding: 10px; border: 1px solid #dccbbc; border-radius: 12px; background: #fff; color: #3c2415; text-align: left; cursor: pointer; }
.guide-card img { width: 100%; height: 110px; object-fit: contain; }
.guide-card strong { line-height: 1.3; }
.guide-card span { font-size: 14px; }
.guide-detail { max-width: 700px; }
.guide-detail img { display: block; width: min(100%, 500px); height: auto; max-height: 330px; object-fit: contain; margin: 16px 0; background: #fff; }
.guide-printed { font-size: 24px; font-weight: 700; }
.scene-library { margin-top: 18px; }
.scene-subtitle { margin: 4px 0 0; color: #5d5751; }
.scene-filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.scene-filter-row button { min-height: 42px; padding: 6px 13px; border: 1px solid #bba18b; border-radius: 9px; background: #fff; color: #3c2415; cursor: pointer; }
.scene-filter-row button[aria-pressed="true"] { background: #3c2415; color: #fff; }
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 10px; }
.scene-card { display: grid; grid-template-rows: 122px auto; align-content: start; gap: 6px; min-width: 0; padding: 8px; border: 1px solid #d5c8b8; border-radius: 12px; background: #fff; color: #3c2415; text-align: center; cursor: pointer; }
.scene-card img { display: block; width: 100%; height: 122px; object-fit: contain; background: #ece8e2; }
.scene-card strong { font-size: 14px; }
.scene-card:disabled { opacity: .6; cursor: progress; }
.scene-card[hidden] { display: none; }
@media (max-width: 650px) {
  .shell-page { width: calc(100% - 20px); margin: 14px auto 100px; padding: 18px; }
  .shell-welcome { display: block; }
  .shell-hero-image { display: none; }
  .shell-tools { grid-template-columns: 1fr; }
  .shell-page h1 { font-size: clamp(27px, 9vw, 36px); }
  body:not([data-shell-view="welcome"]) .topbar-actions { gap: 4px; }
  body:not([data-shell-view="welcome"]) .topbar-actions button { min-width: 0; min-height: 44px; padding: 4px 1px; font-size: 14px; line-height: 1.1; }
  body:not([data-shell-view="welcome"]) .topbar-actions button span { font-size: 10px; white-space: normal; }
  .shell-menu { right: 0; }
  .shell-leave-actions { grid-template-columns: 1fr; }
  .shell-leave-actions button:last-child { grid-column: auto; }
}
@media (max-width: 350px) { .shell-page { padding: 14px; } }
@media (max-width: 350px) { .shell-tool-card { gap: 10px; padding: 12px; } .shell-tool-icon { flex-basis: 64px; width: 64px; height: 64px; } }
