:root {
  --paper: #f6f8fb;
  --surface: #ffffff;
  --ink: #152033;
  --muted: #5c6a7e;
  --line: #d7e0ea;
  --accent: #0e7490;
  --accent-deep: #0b4f63;
  --warm: #c56b2d;
  --shadow: 0 16px 36px rgba(21, 32, 51, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a { color: var(--accent-deep); }
a:hover { color: var(--accent); }

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(14, 116, 144, 0.35);
  outline-offset: 4px;
}

.site-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #eef3f7;
  padding: 28px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.site-version {
  display: block;
  margin: 9px 0 0;
  color: var(--accent-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.site-version:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: block;
  border-radius: 11px;
  background: var(--surface);
  object-fit: contain;
  padding: 4px;
}

.sidebar-note {
  margin: 11px 0 30px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.nav-label,
.eyebrow {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.nav-label { margin: 0 0 9px; }

.nav-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-group {
  margin: 0;
}

.nav-group-details {
  border-radius: 9px;
}

.nav-group-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 9px;
  padding: 9px 10px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  font-size: 0.88rem;
}

.nav-group-details > summary::-webkit-details-marker { display: none; }

.nav-group-details > summary::after {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  content: "";
}

.nav-group-details[open] > summary::after {
  transform: rotate(225deg) translate(-1px, -2px);
}

.nav-group-details > summary:hover,
.nav-group-details > summary:focus-visible {
  background: var(--surface);
  color: var(--ink);
}

.nav-group-details > summary > .nav-state {
  margin-left: auto;
  padding-left: 12px;
  white-space: nowrap;
}

.nav-group-links {
  display: grid;
  gap: 2px;
  margin: 2px 0 5px 8px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.nav-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 9px;
  padding: 9px 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
}

.nav-group-links a {
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 0.82rem;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(21, 32, 51, 0.05);
}

.nav-list a[aria-current="page"] { font-weight: 700; }

.nav-state {
  color: var(--warm);
  font-size: 0.68rem;
}

.main {
  min-width: 0;
  padding: 28px clamp(24px, 5vw, 76px) 68px;
}

.topline,
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.topline { justify-content: space-between; margin-bottom: 48px; }
.breadcrumb { margin-bottom: 26px; }
.breadcrumb a { text-decoration: none; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-deep);
  font-size: 0.76rem;
  font-weight: 700;
}

.status::before {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.hero {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.85fr);
  gap: clamp(28px, 6vw, 88px);
  align-items: end;
  margin-bottom: 52px;
}

h1, h2, h3 { letter-spacing: -0.04em; line-height: 1.1; }
h1 { max-width: none; margin: 13px 0 20px; font-size: clamp(2.55rem, 5vw, 5.2rem); }
h2 { margin: 0 0 14px; font-size: clamp(1.55rem, 2.7vw, 2.35rem); }
h3 { margin: 0 0 8px; font-size: 1.1rem; }

.lede {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.7vw, 1.2rem);
}

.signal-line {
  position: relative;
  min-height: 176px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
}

.signal-line::before {
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px dashed #a9c6d1;
  content: "";
}

.signal-line svg { position: relative; width: 100%; height: 126px; }

.progress-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  margin-bottom: 42px;
}

.progress-band strong { font-size: 0.92rem; }
.progress-band span { color: var(--muted); font-size: 0.84rem; }

.content-wide { width: 100%; }

.route-guide {
  display: grid;
  grid-template-columns: minmax(220px, 0.62fr) minmax(0, 1.38fr);
  gap: clamp(26px, 5vw, 64px);
  align-items: start;
  margin-bottom: 54px;
}

.route-guide-heading h2 { margin-bottom: 12px; }
.route-guide-heading > p:last-child { max-width: none; margin: 0; color: var(--muted); }

.route-list { border-top: 1px solid var(--line); }

.route-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 19px 0;
}

.route-row-primary { border-top: 2px solid var(--accent); }
.route-number { color: var(--accent-deep); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; font-weight: 800; }
.route-kicker { margin: 0 0 3px; color: var(--warm); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.route-row h3 { margin: 0; font-size: 1.06rem; }
.route-row p:not(.route-kicker) { margin: 4px 0 0; color: var(--muted); font-size: 0.84rem; }
.route-action { display: grid; justify-items: end; gap: 7px; white-space: nowrap; }
.route-action > span { color: var(--muted); font-size: 0.74rem; }
.route-action > a:not(.button) { color: var(--accent-deep); font-size: 0.82rem; font-weight: 750; text-decoration: none; }
.route-action > a:not(.button):hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.benefits {
  display: grid;
  grid-template-columns: minmax(220px, 0.62fr) minmax(0, 1.38fr);
  gap: clamp(26px, 5vw, 64px);
  align-items: start;
  margin-bottom: 54px;
  border-top: 1px solid var(--line);
  padding-top: 34px;
}

.benefits-heading h2 { margin-bottom: 12px; }
.benefits-heading > p:last-child { max-width: none; margin: 0; color: var(--muted); }

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.benefit-card {
  min-height: 170px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px;
}

.benefit-number {
  display: block;
  margin-bottom: 22px;
  color: var(--accent-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 800;
}

.benefit-card h3 { margin-bottom: 7px; font-size: 1rem; }
.benefit-card p { margin: 0; color: var(--muted); font-size: 0.84rem; }

.study-start {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 30px;
  align-items: start;
  border-top: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 40px);
}

.study-start > div > p:not(.module-kicker) { max-width: none; color: var(--muted); }

.study-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.module-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 30px;
  align-items: start;
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
}

.module-kicker {
  margin: 0 0 11px;
  color: var(--warm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.module-feature p { color: var(--muted); }

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 22px 0 28px;
}

.topic-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 0.76rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--accent-deep);
  border-radius: 8px;
  padding: 9px 14px;
  background: var(--accent-deep);
  color: white;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 750;
}

.button:hover { background: var(--accent); color: white; }
.button.secondary { border-color: var(--line); background: transparent; color: var(--ink); }
.button.secondary:hover { border-color: var(--accent); background: #eef8fa; color: var(--accent-deep); }

.module-aside {
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.module-aside dt { color: var(--muted); font-size: 0.73rem; }
.module-aside dd { margin: 2px 0 17px; font-size: 0.9rem; font-weight: 700; }

.roadmap { margin-top: 54px; }
.roadmap-intro { max-width: none; margin: 0 0 22px; color: var(--muted); }

.roadmap-list { border-top: 1px solid var(--line); }

.roadmap-row {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.roadmap-number { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; }
.roadmap-row h3 { margin: 0; font-size: 1rem; letter-spacing: -0.02em; }
.roadmap-row p { margin: 3px 0 0; color: var(--muted); font-size: 0.84rem; }
.roadmap-row .status { white-space: nowrap; }
.roadmap-row.is-locked { opacity: 0.62; }
.roadmap-row.is-locked .status::before { background: var(--warm); }

.notice {
  margin-top: 46px;
  border: 1px solid #ead9ca;
  border-radius: 9px;
  background: #fffaf6;
  padding: 12px 15px;
  color: var(--muted);
  font-size: 0.86rem;
}

.article-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: clamp(32px, 4vw, 78px);
  align-items: start;
}

.article { min-width: 0; }
.article h1 { max-width: none; font-size: clamp(2.25rem, 4.7vw, 4.3rem); }
.article h2 { margin-top: 44px; }
.article h3 { margin-top: 28px; }
.article p, .article li { color: #334158; overflow-wrap: anywhere; }
.article p { max-width: none; }
.article li { margin: 6px 0; }

.changelog-content { width: 100%; }
.changelog-content h2 { margin: 48px 0 14px; font-size: clamp(1.65rem, 3vw, 2.5rem); letter-spacing: -.03em; }
.changelog-content h2:first-child { margin-top: 0; }
.changelog-content h3 { margin: 34px 0 10px; color: var(--accent-deep); font-size: clamp(1.15rem, 2vw, 1.5rem); }
.changelog-content p, .changelog-content li { max-width: none; color: #334158; overflow-wrap: anywhere; }
.changelog-content ul { margin: 12px 0 26px; padding-left: 1.3rem; }
.changelog-content li { margin: 7px 0; }
.changelog-content code { border-radius: 4px; background: #edf1f5; padding: 2px 5px; color: var(--accent-deep); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
.beginner-guide {
  margin: 30px 0 42px;
  border: 1px solid #cfe1e6;
  border-radius: 12px;
  background: #f9fcfd;
  padding: 22px clamp(18px, 4vw, 28px) 20px;
}
.beginner-guide h2 { margin: 0 0 15px; font-size: clamp(1.45rem, 2.6vw, 2rem); }
.beginner-guide h3 { margin: 25px 0 8px; color: var(--accent-deep); font-size: 1.03rem; }
.beginner-guide p { margin: 0 0 13px; }
.beginner-guide p:last-child { margin-bottom: 0; }
.beginner-guide ul { margin: 0 0 14px; padding-left: 22px; }
.beginner-guide-note { border-top: 1px solid #cfe1e6; padding-top: 12px; color: var(--muted) !important; font-size: 0.9rem; }
.article table { width: 100%; border-collapse: collapse; margin: 18px 0 26px; font-size: 0.9rem; }
.article th, .article td { border-bottom: 1px solid var(--line); padding: 10px 9px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.article th { background: #edf5f7; color: var(--ink); }
.article .table-scroll { width: 100%; margin: 18px 0 26px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.article .table-scroll table { min-width: 930px; margin: 0; }
.article .table-scroll .component-overview-table { min-width: 1160px; table-layout: fixed; }
.article .table-scroll .component-overview-table th,
.article .table-scroll .component-overview-table td { overflow-wrap: normal; word-break: normal; }
.article .table-scroll .component-overview-table th:nth-child(1),
.article .table-scroll .component-overview-table td:nth-child(1) { width: 120px; }
.article .table-scroll .component-overview-table th:nth-child(2),
.article .table-scroll .component-overview-table td:nth-child(2) { width: 78px; }
.article .table-scroll .component-overview-table th:nth-child(3),
.article .table-scroll .component-overview-table td:nth-child(3) { width: 205px; }
.article .table-scroll .component-overview-table th:nth-child(4),
.article .table-scroll .component-overview-table td:nth-child(4) { width: 190px; }
.article .table-scroll .component-overview-table th:nth-child(5),
.article .table-scroll .component-overview-table td:nth-child(5) { width: 275px; }
.article .table-scroll .component-overview-table th:nth-child(6),
.article .table-scroll .component-overview-table td:nth-child(6) { width: 260px; }
.resistor-code-table { table-layout: fixed; font-size: 0.84rem; }
.resistor-code-table th, .resistor-code-table td { overflow-wrap: anywhere; }
.resistor-code-table td:first-child::before {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-right: 0.45em;
  border: 1px solid rgba(21, 32, 51, 0.28);
  border-radius: 3px;
  vertical-align: -0.12em;
  content: "";
}
.resistor-code-table tbody tr:nth-child(1) td:first-child::before { background: #111827; border-color: #111827; }
.resistor-code-table tbody tr:nth-child(2) td:first-child::before { background: #8a4b2f; border-color: #713c27; }
.resistor-code-table tbody tr:nth-child(3) td:first-child::before { background: #d74848; border-color: #b83b3b; }
.resistor-code-table tbody tr:nth-child(4) td:first-child::before { background: #ef8b2e; border-color: #cc6e1b; }
.resistor-code-table tbody tr:nth-child(5) td:first-child::before { background: #e4c354; border-color: #b99b31; }
.resistor-code-table tbody tr:nth-child(6) td:first-child::before { background: #4e9f61; border-color: #367948; }
.resistor-code-table tbody tr:nth-child(7) td:first-child::before { background: #468fd6; border-color: #2f6eac; }
.resistor-code-table tbody tr:nth-child(8) td:first-child::before { background: #8a64c9; border-color: #6842a7; }
.resistor-code-table tbody tr:nth-child(9) td:first-child::before { background: #a2a8b3; border-color: #7d8490; }
.resistor-code-table tbody tr:nth-child(10) td:first-child::before { background: #ffffff; }
.resistor-code-table tbody tr:nth-child(11) td:first-child::before { background: #d9a441; border-color: #af7b22; }
.resistor-code-table tbody tr:nth-child(12) td:first-child::before { background: #c3ccd3; border-color: #8997a3; }
.resistor-code-table tbody tr:nth-child(13) td:first-child::before { background: transparent; border: 1px dashed #8997a3; }
.article h2, .article h3 { scroll-margin-top: 32px; }
.article code { border-radius: 4px; background: #edf1f5; padding: 2px 5px; color: var(--accent-deep); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; overflow-wrap: anywhere; }
.article pre { overflow-x: auto; border-radius: 10px; padding: 16px 18px; background: #172536; color: #e6f3f5; }
.article pre code { background: transparent; color: inherit; padding: 0; overflow-wrap: normal; }
.formula-block {
  margin: 22px 0 26px;
  border: 1px solid #cfe1e6;
  border-radius: 12px;
  background: #f9fcfd;
  padding: 18px clamp(18px, 4vw, 28px) 16px;
}
.formula-block-compact { max-width: 560px; }
.formula-block-label { margin: 0 0 7px; color: var(--accent-deep) !important; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.formula-display { min-height: 2.7rem; overflow-x: auto; color: var(--ink); font-size: clamp(1.08rem, 2.4vw, 1.5rem); }
.formula-display mjx-container[display="true"] { margin: 0.2em 0 !important; }
.formula-block-note { margin: 8px 0 0 !important; color: var(--muted) !important; font-size: 0.8rem; }

.exercise-intro { margin: -3px 0 17px; color: var(--muted); font-size: 0.9rem; }

.exercise-list {
  display: grid;
  gap: 10px;
  margin: 0 0 32px;
}

.exercise-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.exercise-item[open] {
  border-color: #a9c6d1;
  box-shadow: 0 8px 20px rgba(21, 32, 51, 0.06);
}

.exercise-item summary {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px 48px 16px 18px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.exercise-item summary::-webkit-details-marker { display: none; }

.exercise-item summary::after {
  position: absolute;
  top: 22px;
  right: 19px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: var(--accent-deep);
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.exercise-item[open] summary::after { transform: rotate(225deg) translate(-1px, -2px); }
.exercise-item summary:focus-visible { border-radius: 11px; outline: 3px solid rgba(14, 116, 144, 0.35); outline-offset: -3px; }

.exercise-index {
  color: var(--accent-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  line-height: 1.55;
}

.exercise-prompt { min-width: 0; }
.exercise-context-image {
  display: block;
  width: min(100%, 680px);
  height: auto;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.exercise-answer {
  border-top: 1px solid var(--line);
  padding: 14px 18px 17px 62px;
  background: #fbfcfe;
}

.exercise-answer-label {
  display: block;
  margin-bottom: 3px;
  color: var(--warm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.exercise-answer p { margin: 0; color: #334158; font-weight: 650; }

.article-figure { width: 100%; margin: 26px 0 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px; }
.article-figure img { display: block; width: 100%; height: auto; }
.article-figure.wide-diagram { overflow-x: auto; }
.article-figure.wide-diagram img { min-width: 720px; }
.article-figure figcaption { margin-top: 10px; color: var(--muted); font-size: 0.76rem; }

.article-aside { position: sticky; top: 24px; border-top: 2px solid var(--accent); padding-top: 15px; }
.article-aside p { margin: 0 0 10px; color: var(--muted); font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.article-aside ul { margin: 0; padding: 0; list-style: none; }
.article-aside li { margin: 8px 0; }
.article-aside a { display: block; border-radius: 8px; padding: 5px 8px; color: var(--muted); font-size: 0.8rem; text-decoration: none; }
.article-aside a.is-active { background: #eef8fa; color: var(--accent-deep); font-weight: 750; }
.article-aside a.is-active::before { display: inline-block; width: 6px; height: 6px; margin: 0 7px 1px 0; border-radius: 50%; background: var(--accent); content: ""; }
.article-aside a:hover { color: var(--accent-deep); }

.footer { width: 100%; margin-top: 70px; border-top: 1px solid var(--line); padding-top: 17px; color: var(--muted); font-size: 0.78rem; }

.page-header { width: 100%; margin-bottom: 36px; }
.page-header h1 { font-size: clamp(2.35rem, 4.5vw, 4.8rem); }
.study-index { width: 100%; }
.study-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 28px 0 42px; }
.home-study-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.study-card, .source-card, .question-record, .study-explainer { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.study-card { padding: 26px; }
.study-card p:not(.eyebrow), .source-card p, .question-subtopic, .question-note { color: var(--muted); }
.summary-strip { display: flex; flex-wrap: wrap; gap: 1px; overflow: hidden; margin: 0 0 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.summary-strip span { flex: 1 1 170px; padding: 18px 20px; background: var(--surface); color: var(--muted); }
.summary-strip strong { display: block; color: var(--ink); font-size: 1.55rem; }
.study-explainer { width: 100%; margin: 34px 0; padding: 28px; }
.study-explainer dl { display: grid; grid-template-columns: minmax(150px, .35fr) 1fr; gap: 12px 24px; margin: 0; }
.study-explainer dt { font-weight: 800; }
.study-explainer dd { margin: 0; color: var(--muted); }
.source-list, .question-results { display: grid; gap: 38px; }
.question-results { grid-template-columns: minmax(0, 1fr); }
.source-group h2 { margin: 0 0 14px; color: var(--accent-deep); font-size: clamp(1.35rem, 2.5vw, 2rem); }
.source-group-list { display: grid; gap: 16px; }
.source-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 26px; }
.source-card h3, .question-record h2 { margin: 14px 0 5px; font-size: 1.2rem; }
.source-card p { margin: 0; }
.source-card .source-role { margin-bottom: 9px; color: #334158; }
.notice-warm { border-left-color: var(--warm); }
.question-filters { position: sticky; z-index: 2; top: 0; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(150px, .35fr) auto; gap: 12px; align-items: end; margin: 0 0 22px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(246, 248, 251, .96); backdrop-filter: blur(10px); }
.question-filters.has-module-filter { grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, .35fr)) auto; }
.question-filters label { display: grid; gap: 5px; color: var(--muted); font-size: .75rem; font-weight: 700; }
.question-filters input, .question-filters select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); padding: 8px 10px; font: inherit; }
.question-filters output { padding: 9px 4px; color: var(--muted); white-space: nowrap; }
.question-record { width: 100%; min-width: 0; padding: clamp(22px, 3vw, 34px); box-shadow: none; content-visibility: auto; contain-intrinsic-block-size: auto 640px; }
.question-record[hidden] { display: none; }
.question-record:target { border-color: var(--accent); box-shadow: 0 8px 24px rgba(14, 116, 144, .12); }
.question-record-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.question-id { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; }
.question-context { margin: 18px 0 8px; color: var(--muted); font-size: .82rem; }
.question-record h2 { max-width: none; margin: 0 0 22px; font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.35; letter-spacing: -.02em; }
.question-visual { width: 100%; margin: 22px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.question-visual img { display: block; width: 100%; max-height: 440px; object-fit: contain; }
.question-visual figcaption { margin-top: 9px; color: var(--muted); font-size: .75rem; }
.question-options { display: grid; gap: 8px; width: 100%; margin: 0 0 14px; padding: 0; list-style: none; }
.question-options li { display: block; padding: 0; }
.question-option { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; color: var(--ink); font: inherit; line-height: 1.45; text-align: start; cursor: pointer; transition: border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease; }
.question-option:hover:not(:disabled) { border-color: var(--accent); background: #f2fafb; }
.question-option:disabled { cursor: default; }
.question-option.is-selected { box-shadow: 0 0 0 2px rgba(14, 116, 144, .12); }
.question-option.is-correct { border-color: #2d8a61; background: #e8f5ed; color: #1f5d42; }
.question-option.is-incorrect { border-color: #c74b4b; background: #fdecec; color: #7b2d2d; }
.question-option.is-correct .option-label { background: #2d8a61; color: #fff; }
.question-option.is-incorrect .option-label { background: #c74b4b; color: #fff; }
.option-text { min-width: 0; overflow-wrap: anywhere; }
.option-state { color: currentColor; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.question-feedback { margin: 0 0 18px; padding: 11px 14px; border: 1px solid var(--accent); border-radius: 10px; background: #eef8fa; color: var(--accent-deep); font-size: .9rem; font-weight: 700; line-height: 1.5; }
.question-feedback.is-incorrect { border-color: #d67575; background: #fff1f1; color: #7b2d2d; }
.question-feedback[hidden] { display: none; }
.option-label { display: inline-grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: #e3eef2; color: var(--accent-deep); font-size: .75rem; font-weight: 850; }
.question-answer { width: 100%; margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.question-answer > summary { position: relative; padding: 16px 42px 16px 0; color: var(--accent-deep); cursor: pointer; font-weight: 800; list-style: none; }
.question-answer > summary::-webkit-details-marker { display: none; }
.question-answer > summary::after { position: absolute; top: 20px; right: 8px; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); content: ""; }
.question-answer[open] > summary::after { top: 24px; transform: rotate(225deg); }
.question-answer-body { padding: 2px 0 20px; }
.answer-grid { display: grid; gap: 0; margin: 0; }
.answer-row { display: grid; grid-template-columns: minmax(185px, .42fr) minmax(0, 1fr); gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.answer-row dt { color: var(--muted); font-size: .78rem; font-weight: 800; }
.answer-row dd { margin: 0; }
.answer-explanation dd { line-height: 1.65; }
.answer-steps { width: 100%; margin: 14px 0 0; padding: 14px 16px; border-left: 1px solid var(--accent); border-radius: 0 10px 10px 0; background: #f2f7f8; }
.answer-steps ol { margin: 8px 0 0; padding-left: 22px; }
.answer-steps li + li { margin-top: 6px; }
.answer-mistake { width: 100%; margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: #fff7e9; color: #674d17; font-size: .9rem; line-height: 1.55; }
.answer-correction dd { color: #8d2f2f; font-weight: 800; }
.answer-notes { padding: 14px 16px; border-radius: 10px; background: #f8f3e8; color: #5f4b1b; }
.answer-notes ul { margin: 7px 0 0; padding-left: 20px; }
.answer-sources { margin: 14px 0 0; font-size: .82rem; }
.question-attribution { width: 100%; margin: -12px 0 28px; color: var(--muted); font-size: .82rem; }
.question-links { margin-bottom: 0; font-size: .88rem; }
.study-badge { display: inline-flex; border-radius: 999px; padding: 5px 9px; background: #e3eef2; color: var(--accent-deep); font-size: .7rem; font-weight: 800; }
.study-badge.aguarda_regulamentacao { background: #f6eadf; color: #8a481c; }
.study-badge.incorrecta_na_origem, .study-badge.ambigua { background: #f5dddd; color: #8d2f2f; }
.study-badge.validada_com_ressalva { background: #f3edcf; color: #675a15; }
.study-badge.validada_por_fonte_oficial { background: #dcefe6; color: #245e48; }
.test-config, .test-question { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.test-config { margin-bottom: 16px; padding: clamp(20px, 3vw, 30px); }
.test-config fieldset, .test-question fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.test-config legend { margin-bottom: 18px; font-size: 1.35rem; font-weight: 850; }
.test-config-grid { display: grid; grid-template-columns: minmax(180px, .6fr) minmax(280px, 1.4fr); gap: 22px; align-items: end; margin-bottom: 18px; }
.test-config label { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.test-config select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); padding: 8px 10px; font: inherit; }
.test-config select:focus-visible { outline: 3px solid rgba(14, 116, 144, .25); outline-offset: 2px; }
.test-rule-summary { display: grid; gap: 3px; min-width: 0; padding: 2px 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.test-rule-summary strong { color: var(--ink); font-size: 1rem; }
.test-live { min-height: 1.5em; color: var(--muted); }
.test-live.is-error { color: #8d2f2f; font-weight: 800; }
.test-session { display: grid; gap: 24px; margin-top: 30px; scroll-margin-top: 18px; }
.test-question { padding: clamp(22px, 3vw, 34px); }
.test-question-title { width: 100%; margin: 14px 0 20px; color: var(--ink); font-size: clamp(1.2rem, 2vw, 1.55rem); font-weight: 800; line-height: 1.4; }
.test-options { display: grid; gap: 9px; }
.test-option { display: grid; grid-template-columns: 22px 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-width: 0; min-height: 50px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; cursor: pointer; }
.test-option:hover { border-color: var(--accent); background: #f2fafb; }
.test-option:focus-within { outline: 3px solid rgba(14, 116, 144, .22); outline-offset: 2px; }
.test-option.is-correct { border-color: #2d8a61; background: #e8f5ed; color: #1f5d42; }
.test-option.is-incorrect { border-color: #c74b4b; background: #fdecec; color: #7b2d2d; }
.test-option-state { font-size: .72rem; font-weight: 850; }
.test-explanation { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #f2f7f8; }
.test-explanation[hidden], .test-session[hidden], .test-result[hidden], .test-timer[hidden] { display: none; }
.test-explanation h3 { margin-top: 0; }
.test-correct-answer { color: #1f5d42; font-weight: 850; }
.test-reservation { margin-top: 16px; padding: 14px 16px; border: 1px solid #d8ca78; border-radius: 10px; background: #fff9df; color: #5f5215; }
.test-reservation ul, .test-reservation p { margin-bottom: 0; }
.test-timer { position: fixed; z-index: 20; inset-block-start: 18px; inset-inline-end: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; align-items: center; width: min(300px, calc(100vw - 36px)); padding: 14px 16px; border: 1px solid var(--accent); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 30px rgba(21, 32, 51, .18); }
.test-timer > span { color: var(--muted); font-size: .72rem; font-weight: 800; }
.test-timer > strong { color: var(--accent-deep); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.35rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1.2; }
.test-finish { grid-column: 2; grid-row: 1 / 3; min-height: 42px; padding: 9px 14px; }
.test-timer.is-urgent { border-color: #b34242; }
.test-timer.is-urgent > strong { color: #8d2f2f; }
.test-result { margin-top: 28px; scroll-margin-top: 24px; }
.test-result-header { padding: clamp(22px, 3vw, 34px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.test-result-header h2 { margin: 4px 0 8px; color: var(--ink); }
.test-result-header p { margin-bottom: 0; }
.test-result-status { margin: 0; color: var(--accent-deep); font-size: .82rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.test-result.is-reproved .test-result-status { color: #8d2f2f; }
.test-result-time { color: var(--muted); font-size: .88rem; }
.test-result-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 14px 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.test-result-stats > div { display: grid; gap: 2px; padding: 18px 20px; }
.test-result-stats > div + div { border-inline-start: 1px solid var(--line); }
.test-result-stats dt { color: var(--muted); font-size: .78rem; font-weight: 800; }
.test-result-stats dd { margin: 0; color: var(--ink); font-size: 1.7rem; font-weight: 900; line-height: 1.2; }
.test-result-stats span { color: var(--muted); font-size: .72rem; }
.test-review { margin-top: 44px; }
.test-review > h2 { margin-bottom: 8px; }
.test-review > p { color: var(--muted); }
.test-question-review { margin-top: 22px; }
.test-review-outcome { margin-inline-start: auto; border-radius: 999px; padding: 5px 9px; font-size: .7rem; font-weight: 850; }
.test-review-outcome.is-incorrect { background: #f5dddd; color: #8d2f2f; }
.test-review-outcome.is-unanswered { background: #e8edf3; color: #46566d; }
.test-question-review.is-unanswered { border-color: #aeb9c7; }
.test-review-options { margin: 0; padding: 0; list-style: none; }
.test-review-options .test-option { grid-template-columns: 30px minmax(0, 1fr) auto; }
.test-review-options .test-option { cursor: default; }
.test-review-empty { padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }

@media (max-width: 900px) {
  .site-shell { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px 20px; }
  .sidebar-note { display: none; }
  .sidebar nav { margin-top: 14px; }
  .nav-list { display: grid; }
  .nav-list a { white-space: normal; }
  .nav-group-links { margin-right: 0; }
  .main { padding: 24px clamp(18px, 4vw, 40px) 54px; }
  .topline { margin-bottom: 38px; }
  .hero, .article-layout, .route-guide, .benefits { grid-template-columns: 1fr; }
  .study-grid { grid-template-columns: 1fr; }
  .test-config-grid { grid-template-columns: 1fr; }
  .test-result-stats { grid-template-columns: 1fr; }
  .test-result-stats > div + div { border-block-start: 1px solid var(--line); border-inline-start: 0; }
  .question-filters,
  .question-filters.has-module-filter { position: static; grid-template-columns: 1fr 1fr; }
  .question-filters label:first-child { grid-column: 1 / -1; }
  .source-card { align-items: flex-start; flex-direction: column; }
  .route-guide-heading > p:last-child { max-width: 620px; }
  .benefits-heading > p:last-child { max-width: 620px; }
  .route-row {
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    padding: 22px 0;
  }
  .route-action {
    grid-column: 2;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-items: initial;
    gap: 10px 14px;
    margin-top: 11px;
    white-space: normal;
  }
  .route-action > span { flex: 0 0 auto; }
  .article-aside { position: static; order: -1; }
  .article-aside ul { display: flex; flex-wrap: wrap; gap: 8px 16px; }
  .article-aside li { margin: 0; }
}

@media (max-width: 620px) {
  .question-directory-item > a { grid-template-columns: 2.7rem minmax(0, 1fr); }
  .question-directory-item .study-badge { grid-column: 2; justify-self: start; }
  .test-option { grid-template-columns: 20px 28px minmax(0, 1fr); }
  .test-option-state { grid-column: 3; }
  h1 { font-size: clamp(2.3rem, 13vw, 3.7rem); }
  .topline { align-items: flex-start; }
  .progress-band { align-items: flex-start; flex-direction: column; gap: 4px; }
  .module-feature, .study-start { grid-template-columns: 1fr; }
  .module-aside { border-top: 1px solid var(--line); border-left: 0; padding: 19px 0 0; }
  .roadmap-row { grid-template-columns: 34px minmax(0, 1fr); }
  .roadmap-row .status { grid-column: 2; justify-self: start; }
  .benefit-grid { grid-template-columns: 1fr; }
  .study-explainer dl,
  .question-filters,
  .question-filters.has-module-filter { grid-template-columns: 1fr; }
  .answer-row { grid-template-columns: 1fr; gap: 4px; }
  .question-filters label:first-child { grid-column: auto; }
  .exercise-item summary { grid-template-columns: 28px minmax(0, 1fr); gap: 9px; padding: 14px 40px 14px 14px; }
  .exercise-item summary::after { top: 20px; right: 15px; }
  .exercise-answer { padding: 13px 14px 16px 51px; }
  .article pre { overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
  .article table { table-layout: fixed; }
  .article-figure.wide-diagram img { width: 720px; max-width: none; }
  .resistor-code-table { font-size: 0.74rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .exercise-item summary::after { transition: none; }
}
