:root { color-scheme: dark; font-family: Inter, system-ui, sans-serif; background: #101318; color: #eef2f5; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #202936, #101318 55%); }
.app { width: min(960px, 100%); margin: 0 auto; padding: 24px 16px 48px; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.header-tools { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.guide-button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #4a596b; border-radius: 999px; background: #1b232d; padding: 8px 12px; }
.guide-button:hover { border-color: #f0b52d; }
.guide-icon { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid currentColor; border-radius: 50%; color: #f0b52d; font-family: Georgia, serif; font-weight: 700; }
h1, h2, p { margin-top: 0; }
h1 { letter-spacing: .18em; color: #f0b52d; }
.app-brand { margin: 0; padding: 0; border: 0; background: transparent; color: #f0b52d; font: inherit; font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 800; letter-spacing: .04em; text-align: left; }
.app-brand:hover, .app-brand:focus-visible { color: #f8d477; }
.app-version { align-self: center; color: #aeb9c5; font-size: .78rem; font-variant-numeric: tabular-nums; }
.session-user { max-width: 220px; overflow: hidden; color: #f0c96b; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
button { font: inherit; color: inherit; cursor: pointer; }
.primary, .secondary, .topic-action, .option { border: 1px solid #3a4655; border-radius: 12px; background: #1b232d; padding: 14px 16px; }
.primary { background: #d9961f; color: #15171a; border-color: #f5c85e; font-weight: 700; }
.secondary { background: transparent; }
.secondary:disabled, .topic-action:disabled { cursor: not-allowed; opacity: .48; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.question-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.question-tools button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 11px; border-color: var(--tool-color); color: #dce4eb; font-size: .82rem; }
.question-tool-icon { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid currentColor; border-radius: 50%; color: var(--tool-color); font-size: 1rem; font-weight: 800; line-height: 1; }
#save-question { --tool-color: #f0b52d; }
#doubt-question { --tool-color: #bc8cf2; }
.question-tools button:hover { border-color: var(--tool-color); background: color-mix(in srgb, var(--tool-color) 12%, transparent); }
.question-tools .is-selected { border-color: var(--tool-color); color: var(--tool-color); background: color-mix(in srgb, var(--tool-color) 16%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tool-color) 18%, transparent); }
.home-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0 12px; }
.home-menu-card { display: grid; grid-template-columns: 38px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 2px 11px; min-height: 78px; padding: 11px 13px; border: 1px solid #354354; border-radius: 12px; background: #18212a; text-align: left; }
.home-menu-card:hover { border-color: var(--menu-color, #f0b52d); background: #202b36; }
.home-menu-card.is-primary { border-color: #a97b29; }
.home-menu-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #657487; border-radius: 50%; color: #f0c96b; font-weight: 800; }
.home-menu-card { --menu-color: #f0b52d; border-top: 3px solid var(--menu-color); }
.home-menu-icon { border-color: var(--menu-color); color: var(--menu-color); background: color-mix(in srgb, var(--menu-color) 12%, transparent); }
.menu-guide { --menu-color: #56c2b7; }
.menu-story { --menu-color: #7c9cff; }
.menu-free { --menu-color: #f0b52d; }
.menu-exam { --menu-color: #f27777; }
.menu-review { --menu-color: #bc8cf2; }
.menu-practical { --menu-color: #ed8a4d; }
.menu-laws { --menu-color: #5db5ed; }
.menu-official { --menu-color: #77c98b; }
.home-menu-label { font-weight: 800; color: #eef2f5; }
.home-menu-card small { color: #aeb9c5; font-size: .76rem; line-height: 1.25; }
.home-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.home-controls .exam-choice { display: none; }
.home-control-actions { display: flex; align-items: center; gap: 8px; }
.compact-action { padding: 8px 11px; font-size: .82rem; }
.exam-choice { display: flex; align-items: center; gap: 8px; border: 1px solid #3a4655; border-radius: 12px; padding: 10px 12px; color: #f0b52d; }
.exam-choice select { font: inherit; color: #eef2f5; background: #1b232d; border: 1px solid #566476; border-radius: 7px; padding: 5px 8px; }
.exam-choice-panel { margin: 22px 0 18px; padding: 18px; border: 1px solid #374354; border-radius: 16px; background: #151d26; }
.exam-choice-panel h2 { margin: 6px 0; color: #f0c96b; }
.exam-choice-panel > p { color: #b9c4cf; }
.exam-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.exam-choice-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto auto; align-items: center; gap: 3px 11px; min-height: 118px; padding: 14px; border: 2px solid #354354; border-radius: 14px; background: #18212a; text-align: left; }
.exam-choice-card:hover { border-color: #f0b52d; background: #202b36; }
.exam-choice-card.is-selected { border-color: #f0b52d; background: #29251b; box-shadow: 0 0 0 2px rgb(240 181 45 / 15%); }
.exam-choice-icon { grid-row: 1 / span 3; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #f0b52d; border-radius: 50%; color: #f0b52d; font-size: 1.2rem; }
.exam-choice-card strong { color: #eef2f5; }
.exam-choice-card small { color: #aeb9c5; line-height: 1.35; }
.exam-choice-card b { color: #f0c96b; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.exam-start { margin-top: 4px; }
.home-notice { border-left: 3px solid #f0b52d; padding: 10px 14px; background: #202a35; }
.quiz-notice { border-left: 3px solid #f0b52d; padding: 10px 14px; background: #202a35; margin: 12px 0; }
.auth-card { width: min(520px, 100%); margin: 10vh auto 0; padding: clamp(22px, 5vw, 38px); border: 1px solid #374354; border-radius: 18px; background: #171d25; }
.auth-card h2 { margin: 8px 0 10px; color: #f0c96b; }
.auth-card p { color: #b9c4cf; line-height: 1.55; }
.auth-form { display: grid; gap: 10px; margin-top: 22px; }
.auth-form label { color: #d0d7df; font-size: .9rem; }
.auth-form input { width: 100%; border: 1px solid #4a596b; border-radius: 10px; background: #10161d; color: #eef2f5; padding: 13px 14px; font: inherit; }
.auth-form input:focus { outline: 2px solid #d9961f; outline-offset: 1px; }
.auth-message { min-height: 1.5em; margin: 14px 0 0; color: #f0c96b !important; }
.story { margin-top: 34px; }
.story-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.story-heading p { max-width: 680px; color: #b9c4cf; }
.story-heading > strong { flex: 0 0 auto; color: #f0c96b; font-size: .9rem; }
.unit-list { display: grid; gap: 12px; }
.story-unit { overflow: hidden; border: 1px solid #354354; border-radius: 16px; background: #151c24; }
.story-unit.is-active { border-color: #a97b29; box-shadow: 0 0 0 1px rgb(240 181 45 / 12%); }
.story-unit.is-completed { border-color: #32734a; }
.story-unit.is-locked { opacity: .72; }
.unit-toggle { width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 14px; border: 0; background: transparent; padding: 16px; text-align: left; }
.unit-toggle:hover { background: #1b242e; }
.unit-order { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #4a596b; border-radius: 50%; color: #f0c96b; font-weight: 800; }
.is-completed .unit-order { border-color: #49be76; color: #49be76; }
.unit-title { display: grid; gap: 4px; min-width: 0; }
.unit-title small, .story-topic small, .unit-final small, small { color: #aab5c3; font-size: .86rem; }
.unit-title strong { font-size: 1.08rem; }
.unit-title > span { color: #c4ccd5; font-size: .9rem; }
.unit-progress { color: #f0c96b; font-variant-numeric: tabular-nums; }
.unit-body { padding: 0 16px 16px 72px; }
.unit-reading { display: grid; gap: 10px; margin: 0 0 14px; padding: 13px; border: 1px solid #8b6828; border-radius: 11px; background: #252218; }
.unit-reading.is-complete { border-color: #32734a; background: #18251e; }
.unit-reading.is-reference { border-style: dashed; border-color: #4a596b; background: #18212a; }
.unit-reading > div:first-child { display: grid; gap: 3px; }
.unit-reading strong { color: #f0c96b; }
.unit-reading small { color: #c1cad3; }
.unit-law-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.unit-law-link { padding: 7px 9px; border: 1px solid #4a596b; border-radius: 7px; background: #1b232d; color: #d9e0e6; font-size: .78rem; line-height: 1.3; text-align: left; }
.unit-law-link:hover { border-color: #f0b52d; color: #fff; }
.story-topics { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.story-topic { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 13px; border: 1px solid #303d4c; border-radius: 12px; background: #18212a; }
.story-topic > div { display: grid; gap: 4px; }
.story-topic > div > span { color: #f0c96b; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.story-topic.is-complete { border-color: #2e6944; }
.story-topic.is-locked { background: #141a21; }
.editorial-alert { display: grid; gap: 4px; margin-top: 7px; padding: 10px; border-left: 3px solid #d9961f; border-radius: 6px; background: #29241b; color: #e6dcc4; font-size: .84rem; line-height: 1.45; }
.editorial-alert.is-critical { border-left-color: #ef6b73; background: #2c1d22; }
.editorial-alert strong { color: #f2d17d; }
.editorial-alert.is-critical strong { color: #ff9ca2; }
.topic-action { padding: 9px 12px; min-width: 84px; }
.unit-final { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; padding: 14px; border: 1px dashed #4c5b6c; border-radius: 12px; }
.unit-final > div { display: grid; gap: 4px; }
.quiz-card, .result-card { background: #171d25; border: 1px solid #374354; border-radius: 18px; padding: clamp(18px, 4vw, 34px); }
.quiz-meta { display: flex; justify-content: space-between; color: #f0b52d; font-size: .9rem; }
.options { display: grid; gap: 10px; margin: 24px 0; }
.option { text-align: left; }
.option:hover:not(:disabled) { border-color: #f0b52d; }
.option.correct { border-color: #49be76; background: #193526; }
.option.wrong { border-color: #d75d66; background: #3a2026; }
.feedback { border-left: 3px solid #f0b52d; padding: 10px 14px; background: #202a35; }
.question-origin { margin: 10px 0 14px; padding: 8px 10px; border: 1px solid #3d4b5a; border-radius: 8px; color: #f0c96b; font-size: .82rem; }
.question-context { margin: 10px 0 18px; padding: 14px 16px; border-left: 3px solid #55b7c9; border-radius: 10px; background: #132731; color: #d7e8ed; white-space: pre-line; font-size: .94rem; line-height: 1.5; }
.official-material { margin-top: 26px; padding: 14px 16px; border: 1px solid #334353; border-radius: 10px; background: #151d26; }
.official-material p { color: #b9c4cf; }
.official-material li { margin: 8px 0; }
.official-material a { color: #f0c96b; }
.practical-material { margin-top: 26px; padding: 14px 16px 18px; border: 1px solid #334353; border-radius: 10px; background: #151d26; }
.practical-material > p { color: #b9c4cf; }
.practical-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.practical-grid figure { margin: 0; overflow: hidden; border: 1px solid #303d4c; border-radius: 10px; background: #18212a; }
.practical-grid img { display: block; width: 100%; height: 220px; object-fit: contain; background: #101318; }
.practical-grid figure:nth-child(n+3) img { object-fit: cover; }
.practical-grid figcaption { padding: 9px 11px; color: #d0d7df; font-size: .84rem; }
.practical-note { margin: 14px 0 0; font-size: .84rem; }
.panel-back-row { display: flex; justify-content: flex-start; margin-bottom: 12px; }
.practical-menu, .practical-subcases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 24px; }
.practical-menu-card, .practical-subcase-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 3px 10px; min-height: 78px; padding: 12px; border: 1px solid #354354; border-top: 3px solid var(--practical-color); border-radius: 12px; background: #18212a; text-align: left; }
.practical-menu-card:hover, .practical-subcase-card:hover { border-color: var(--practical-color); background: #202b36; }
.practical-menu-icon, .practical-subcase-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--practical-color); border-radius: 50%; color: var(--practical-color); font-weight: 800; }
.practical-menu-card strong, .practical-subcase-card strong { color: #eef2f5; }
.practical-menu-card small, .practical-subcase-card small { color: #aeb9c5; font-size: .75rem; line-height: 1.3; }
.practical-menu-0 { --practical-color: #56c2b7; }
.practical-menu-1 { --practical-color: #7c9cff; }
.practical-menu-2 { --practical-color: #ed8a4d; }
.practical-subcase-card:nth-child(1) { --practical-color: #f0b52d; }
.practical-subcase-card:nth-child(2) { --practical-color: #bc8cf2; }
.practical-subcase-card:nth-child(3) { --practical-color: #77c98b; }
.practical-subtitle { margin: 22px 0 6px; color: #f0c96b; }
.guide-dialog { width: min(780px, calc(100% - 24px)); max-height: min(88vh, 900px); border: 1px solid #465568; border-radius: 18px; background: #151c24; color: #eef2f5; padding: 0; box-shadow: 0 24px 80px rgb(0 0 0 / 55%); }
.guide-dialog::backdrop { background: rgb(5 8 12 / 78%); backdrop-filter: blur(4px); }
.guide-dialog-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 22px 24px 18px; border-bottom: 1px solid #344252; background: #151c24; }
.guide-dialog-heading h2 { margin: 3px 0 5px; }
.guide-dialog-heading p { margin: 0; color: #b7c1cd; }
.guide-kicker { color: #f0b52d; font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.guide-close { flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid #465568; border-radius: 50%; background: #1d2630; font-size: 1.5rem; line-height: 1; }
.guide-content { padding: 22px 24px 30px; }
.guide-intro { padding: 14px 16px; border-left: 3px solid #f0b52d; background: #202a35; color: #d6dde5; }
.guide-section { padding: 18px 0; border-bottom: 1px solid #2d3947; }
.guide-section h3 { margin: 0 0 12px; color: #f0c96b; }
.guide-subsection { margin-top: 18px; padding: 15px 16px; border: 1px solid #303d4c; border-radius: 10px; background: #18212a; }
.guide-subsection h4 { margin: 0 0 9px; color: #eef2f5; }
.guide-subsection > :last-child { margin-bottom: 0; }
.guide-section p, .guide-section li { color: #d0d7df; line-height: 1.6; }
.guide-section li + li { margin-top: 7px; }
.guide-table-wrap { overflow-x: auto; border: 1px solid #354354; border-radius: 10px; }
.guide-table-wrap table { width: 100%; border-collapse: collapse; }
.guide-table-wrap th, .guide-table-wrap td { padding: 10px 12px; border-bottom: 1px solid #303d4c; text-align: left; }
.guide-table-wrap th:last-child, .guide-table-wrap td:last-child { width: 80px; text-align: right; font-variant-numeric: tabular-nums; }
.guide-table-wrap th { color: #f0c96b; background: #1c2530; }
.guide-legal-notice { margin-top: 10px; padding: 13px 14px; border-left: 3px solid #d9961f; border-radius: 7px; background: #29241b; }
.guide-legal-notice.is-critical { border-left-color: #ef6b73; background: #2c1d22; }
.guide-legal-notice p { margin: 6px 0 10px; }
.guide-sources { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.guide-sources a { color: #f0c96b; font-size: .82rem; }
.guide-reviewed { margin: 18px 0 0; color: #8f9baa; font-size: .8rem; text-align: right; }
.study-library { margin-top: 24px; padding: 20px; border: 1px solid #303d4c; border-radius: 12px; background: #151c24; }
.study-library > h2 { margin: 0 0 6px; color: #f0c96b; }
.study-library > p { margin-top: 0; color: #b8c3ce; }
.study-category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.study-category-card { display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 2px 10px; min-height: 76px; padding: 11px 13px; border: 1px solid #354354; border-radius: 11px; background: #1b2530; text-align: left; }
.study-category-card:hover { border-color: #f0b52d; background: #202b36; }
.study-category-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #657487; border-radius: 50%; color: #f0c96b; font-weight: 800; }
.study-category-card strong { font-size: .92rem; }
.study-category-card small { color: #aeb9c5; font-size: .75rem; line-height: 1.25; }
.study-empty { padding: 15px; border: 1px dashed #4a596b; border-radius: 10px; color: #b8c3ce; }
.study-doc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.study-doc-card { padding: 15px; border: 1px solid #354354; border-radius: 10px; background: #1b2530; }
.study-doc-card h3 { margin: 0 0 7px; color: #eef2f5; font-size: 1rem; }
.study-doc-card p { min-height: 42px; margin: 0 0 12px; color: #b8c3ce; font-size: .9rem; line-height: 1.45; }
.study-doc-open { width: 100%; }
.study-reader-page { padding: 20px 0 36px; }
.study-reader-toolbar, .study-reader-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.study-reader-nav { display: flex; gap: 8px; }
.study-reader-title { margin: 26px 0 20px; padding-bottom: 18px; border-bottom: 1px solid #344252; }
.study-reader-title h2 { margin: 5px 0; font-size: clamp(1.45rem, 3vw, 2.1rem); }
.study-reader-title p { margin: 0; color: #b7c1cd; }
.study-reader-layout { display: grid; grid-template-columns: minmax(180px, 245px) minmax(0, 1fr); gap: 24px; align-items: start; }
.study-toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding: 15px; border: 1px solid #303d4c; border-radius: 10px; background: #18212a; scrollbar-width: thin; }
.study-toc h3 { margin: 0 0 10px; color: #f0c96b; font-size: .95rem; }
.study-toc nav { display: grid; gap: 3px; padding-left: 6px; border-left: 1px solid #3c4b5d; }
.study-toc-link { display: block; padding: 5px 7px; border-radius: 5px; color: #c8d2dc; font-size: .84rem; line-height: 1.35; text-decoration: none; }
.study-toc-link:hover { background: #263442; color: #fff; }
.study-toc-link.is-active { background: #2b3b4d; color: #fff; box-shadow: inset 3px 0 0 #f0b52d; }
.study-toc-link.level-1 { padding-left: 7px; color: #f0c96b; font-weight: 800; }
.study-toc-link.level-2 { padding-left: 13px; }
.study-toc-link.level-3 { padding-left: 20px; color: #aeb9c5; font-size: .8rem; }
.study-toc-link.level-4 { padding-left: 27px; color: #94a4b5; font-size: .76rem; }
.study-page-content { min-width: 0; }
.study-page-content h1, .study-page-content h2, .study-page-content h3, .study-page-content h4 { scroll-margin-top: 18px; margin: 1.5em 0 .6em; color: #f0c96b; line-height: 1.25; }
.study-page-content h1 { margin-top: 0; font-size: 1.7rem; }
.study-page-content h2 { font-size: 1.4rem; }
.study-page-content h3 { font-size: 1.15rem; }
.study-page-content p, .study-page-content li { color: #d0d7df; line-height: 1.62; }
.study-page-content ul, .study-page-content ol { padding-left: 1.35rem; }
.study-page-content blockquote { margin: 1rem 0; padding: .8rem 1rem; border-left: 3px solid #d9961f; background: #202a35; color: #d0d7df; }
.study-page-content code { padding: .1em .3em; border-radius: 4px; background: #202a35; color: #f0c96b; }
.study-page-content a { color: #f0c96b; }
.study-table-wrap { overflow-x: auto; margin: 1rem 0 1.4rem; border: 1px solid #354354; border-radius: 10px; background: #18212a; }
.study-table-wrap table { width: 100%; min-width: 520px; border-collapse: collapse; }
.study-table-wrap th, .study-table-wrap td { padding: 9px 11px; border-bottom: 1px solid #303d4c; text-align: left; vertical-align: top; color: #d0d7df; line-height: 1.45; }
.study-table-wrap th { color: #f0c96b; background: #202a35; font-size: .84rem; }
.study-table-wrap tr:last-child td { border-bottom: 0; }
.study-reader-bottom { margin-top: 24px; padding-top: 18px; border-top: 1px solid #344252; }
.law-catalog-view, .law-reader-page { padding: 20px 0 36px; }
.law-catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.law-catalog-group { grid-column: 1 / -1; margin: 18px 0 0; padding: 8px 10px; border-left: 4px solid #f0c96b; color: #f0c96b; font-size: .92rem; letter-spacing: .01em; }
.law-catalog-group:first-child { margin-top: 0; }
.law-catalog-group.law-group-laboral { border-color: #8ad6a1; color: #8ad6a1; }
.law-catalog-group.law-group-inaem { border-color: #f2a7dc; color: #f2a7dc; }
.law-catalog-group.law-group-culture { border-color: #7fc6ef; color: #7fc6ef; }
.law-catalog-group.law-group-europe { border-color: #b9a7ff; color: #b9a7ff; }
.law-catalog-card.law-group-laboral .law-catalog-icon { color: #8ad6a1; border-color: #8ad6a1; }
.law-catalog-card.law-group-inaem .law-catalog-icon { color: #f2a7dc; border-color: #f2a7dc; }
.law-catalog-card.law-group-culture .law-catalog-icon { color: #7fc6ef; border-color: #7fc6ef; }
.law-catalog-card.law-group-europe .law-catalog-icon { color: #b9a7ff; border-color: #b9a7ff; }
.law-catalog-card { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 3px 10px; padding: 12px 13px; border: 1px solid #354354; border-radius: 11px; background: #18212a; text-align: left; }
.law-catalog-card:hover { border-color: #f0b52d; background: #202b36; }
.law-catalog-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #657487; border-radius: 50%; color: #f0c96b; font-size: 1.1rem; }
.law-catalog-card strong { color: #eef2f5; font-size: .88rem; line-height: 1.3; }
.law-catalog-card small { color: #aeb9c5; font-size: .72rem; line-height: 1.3; }
.law-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0 24px; padding: 13px 14px; border: 1px solid #354354; border-radius: 10px; background: #1a2530; }
.law-context strong { display: block; margin-bottom: 3px; color: #f0c96b; font-size: .78rem; }
.law-context p { margin: 0; color: #c5ced7; font-size: .82rem; line-height: 1.45; }
.law-context-compact { grid-column: 2; grid-template-columns: 1fr; gap: 6px; margin: 5px 0 0; padding: 8px 9px; border: 0; border-left: 2px solid var(--law-card-color, #5db5ed); border-radius: 0; background: transparent; }
.law-context-compact strong { font-size: .7rem; }
.law-context-compact .law-context-text { display: block; color: #aeb9c5; font-size: .72rem; line-height: 1.35; }
.law-page-content { min-width: 0; padding: 22px clamp(14px, 3vw, 32px); border: 1px solid #303d4c; border-radius: 14px; background: #151c24; }
.law-page-content main, .law-page-content body { max-width: none; margin: 0; }
.law-page-content header { display: block; margin: 0 0 26px; padding-bottom: 16px; border-bottom: 1px solid #344252; }
.law-page-content h1 { margin: 0 0 10px; color: #f0c96b; font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.25; letter-spacing: normal; }
.law-page-content h2, .law-page-content h3, .law-page-content h4 { scroll-margin-top: 18px; color: #f0c96b; line-height: 1.3; }
.law-page-content h2 { margin: 2rem 0 .7rem; font-size: 1.35rem; }
.law-page-content h3 { margin: 1.5rem 0 .55rem; font-size: 1.1rem; }
.law-page-content h4 { margin: 1.2rem 0 .45rem; font-size: 1rem; }
.law-page-content p { margin: .45rem 0; color: #d0d7df; line-height: 1.6; }
.law-page-content p.titulo, .law-page-content p.titulo_num { margin: 2.1rem 0 .45rem; padding-top: 12px; border-top: 1px solid #344252; color: #f0c96b; font-size: 1.35rem; font-weight: 850; line-height: 1.3; }
.law-page-content p.titulo_tit { margin: 0 0 1rem; color: #c5ced7; font-size: 1rem; font-weight: 700; }
.law-page-content p.capitulo_num { margin: 1.6rem 0 .25rem; color: #f0c96b; font-size: 1.1rem; font-weight: 800; }
.law-page-content p.capitulo_tit, .law-page-content p.seccion { margin: .2rem 0 .8rem; color: #d9b85e; font-size: .98rem; font-weight: 750; }
.law-page-content p.articulo { margin: 1.25rem 0 .35rem; padding: .45rem .65rem; border-left: 3px solid #5db5ed; border-radius: 0 6px 6px 0; background: rgb(93 181 237 / 8%); color: #eef2f5; font-weight: 800; }
.law-page-content p.subseccion { margin-top: 1rem; color: #f0c96b; font-weight: 700; }
.law-page-content p.parrafo { text-align: justify; }
.law-page-content a { color: #f0c96b; }
.law-page-content section { scroll-margin-top: 18px; }
.law-reader-dock { position: sticky; bottom: 10px; z-index: 4; display: flex; justify-content: flex-end; gap: 7px; margin: 10px 0 2px; pointer-events: none; }
.law-reader-dock button { pointer-events: auto; min-height: 32px; min-width: 36px; border: 1px solid #566476; border-radius: 8px; background: rgb(20 27 36 / 94%); color: #f0c96b; font-size: .84rem; font-weight: 800; padding: 6px 9px; box-shadow: 0 12px 28px rgb(0 0 0 / 28%); }
.law-reader-dock button:hover { border-color: #f0b52d; background: #202a35; }
.law-reader-dock span { align-self: center; max-width: 270px; overflow: hidden; color: #aeb9c5; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.law-reference-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: clamp(10px, 3vw, 28px); background: rgb(0 0 0 / 74%); }
.law-reference-sheet { width: min(940px, 100%); max-height: min(90vh, 900px); overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); border: 1px solid #566476; border-radius: 18px; background: #151c24; box-shadow: 0 18px 60px rgb(0 0 0 / 48%); }
.law-reference-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid #344252; }
.law-reference-head h2 { margin: 5px 0 3px; color: #eef2f5; font-size: clamp(1.05rem, 2.6vw, 1.45rem); line-height: 1.25; }
.law-reference-head p { margin: 0; color: #aeb9c5; font-size: .86rem; }
.law-reference-body { min-height: 0; overflow: auto; padding: 22px clamp(14px, 3vw, 32px) 34px; }
.law-reference-body header { display: block; margin: 0 0 26px; padding-bottom: 16px; border-bottom: 1px solid #344252; }
.law-reference-body h1 { margin: 0 0 10px; color: #f0c96b; font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.25; }
.law-reference-body h2, .law-reference-body h3, .law-reference-body h4 { scroll-margin-top: 18px; color: #f0c96b; line-height: 1.3; }
.law-reference-body h2 { margin: 2rem 0 .7rem; font-size: 1.35rem; }
.law-reference-body h3 { margin: 1.5rem 0 .55rem; font-size: 1.1rem; }
.law-reference-body h4 { margin: 1.2rem 0 .45rem; font-size: 1rem; }
.law-reference-body p { margin: .45rem 0; color: #d0d7df; line-height: 1.6; }
.law-reference-body p.titulo, .law-reference-body p.titulo_num { margin: 2.1rem 0 .45rem; padding-top: 12px; border-top: 1px solid #344252; color: #f0c96b; font-size: 1.35rem; font-weight: 850; line-height: 1.3; }
.law-reference-body p.titulo_tit { margin: 0 0 1rem; color: #c5ced7; font-size: 1rem; font-weight: 700; }
.law-reference-body p.capitulo_num { margin: 1.6rem 0 .25rem; color: #f0c96b; font-size: 1.1rem; font-weight: 800; }
.law-reference-body p.capitulo_tit, .law-reference-body p.seccion { margin: .2rem 0 .8rem; color: #d9b85e; font-size: .98rem; font-weight: 750; }
.law-reference-body p.articulo { margin: 1.25rem 0 .35rem; padding: .45rem .65rem; border-left: 3px solid #5db5ed; border-radius: 0 6px 6px 0; background: rgb(93 181 237 / 8%); color: #eef2f5; font-weight: 800; }
.law-reference-body p.subseccion { margin-top: 1rem; color: #f0c96b; font-weight: 700; }
.law-reference-body p.parrafo { text-align: justify; }
.law-reference-body a { color: #f0c96b; }
.law-reference-body section { scroll-margin-top: 18px; }
.law-reference-body .law-ref-highlight { outline: 2px solid #f0b52d; box-shadow: 0 0 0 5px rgb(240 181 45 / 18%); border-radius: 6px; }
body.law-reference-open { overflow: hidden; }
.feedback a[data-law-id] { color: #f0c96b; font-weight: 700; }
[hidden] { display: none !important; }
@media (max-width: 600px) {
  header { display: block; }
  .header-tools { justify-content: space-between; }
  .app { padding-top: 16px; }
  .story-heading { display: block; }
  .unit-toggle { grid-template-columns: 36px minmax(0, 1fr); padding: 13px; }
  .unit-order { width: 34px; height: 34px; }
  .unit-progress { grid-column: 2; }
  .unit-body { padding: 0 12px 12px; }
  .unit-law-links { grid-template-columns: 1fr; }
  .story-topic { grid-template-columns: 1fr; }
  .topic-action { width: 100%; }
  .unit-final { align-items: stretch; flex-direction: column; }
  .practical-grid { grid-template-columns: 1fr; }
  .practical-grid img { height: 190px; }
  .home-menu { gap: 8px; }
  .home-menu-card { min-height: 72px; padding: 9px 10px; }
  .home-menu-icon { width: 30px; height: 30px; }
  .home-menu-label { font-size: .9rem; }
  .home-menu-card small { font-size: .7rem; }
  .home-controls { align-items: stretch; flex-direction: column; }
  .home-controls .exam-choice { justify-content: space-between; }
  .home-control-actions { justify-content: space-between; }
  .practical-menu, .practical-subcases { grid-template-columns: 1fr; }
  .study-category-grid { grid-template-columns: 1fr; }
  .study-doc-list { grid-template-columns: 1fr; }
  .law-catalog-grid { grid-template-columns: 1fr; }
  .law-context { grid-template-columns: 1fr; }
  .law-context-compact { grid-column: 2; }
  .study-reader-toolbar, .study-reader-bottom { align-items: stretch; flex-direction: column; }
  .study-reader-nav { width: 100%; }
  .study-reader-nav button, .study-reader-bottom button { flex: 1; }
  .study-reader-layout { grid-template-columns: 1fr; }
  .study-toc { position: sticky; top: 8px; z-index: 5; max-height: 34vh; }
  .guide-dialog { width: 100%; max-width: none; max-height: 94vh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .guide-dialog-heading, .guide-content { padding-left: 17px; padding-right: 17px; }
  .law-reference-overlay { align-items: end; padding: 0; }
  .law-reference-sheet { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .law-reference-head { padding: 14px 16px; }
  .law-reference-body { padding: 18px 16px 28px; }
}
