/* Guide layout; shared chapter styles provide the reading components. */
.study-guide-main { --subject-color: var(--accent); }
.guide-hero, .guide-layout { max-width: 1100px; margin-inline: auto; }
.guide-hero { margin-bottom: 28px; }
.guide-back { display: inline-block; margin-bottom: 20px; color: var(--muted); font-size: 14px; text-decoration: none; }
.guide-back:hover { color: var(--text); }
.guide-hero h1 { margin: 0 0 12px; font-size: 28px; line-height: 1.28; font-weight: 700; }
.guide-hero > p { color: var(--text2); font-size: 16px; line-height: 1.75; }
.study-guide-main [hidden] { display: none !important; }
.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 42px; align-items: start; }
.guide-chapter { grid-column: 1; grid-row: 1; min-width: 0; font-size: 16px; line-height: 1.75; }
.study-guide-main .guide-chapter :is(p, li, figcaption, small, table, label, input, select) { font-size: 16px; line-height: 1.75; }
.guide-chapter p { margin-bottom: 14px; }
.guide-section { --section-color: var(--mat); scroll-margin-top: calc(var(--topbar-height) + 24px); }
.guide-section:nth-child(2) { --section-color: var(--geo); }
.guide-section:nth-child(3) { --section-color: var(--kem); }
.guide-section:nth-child(4) { --section-color: var(--psi); }
.guide-section:nth-child(5) { --section-color: var(--ang); }
.guide-section:nth-child(6) { --section-color: var(--ele); }
.guide-section:nth-child(7) { --section-color: var(--zgo); }
.guide-chapter .guide-section + .guide-section { margin-top: 38px; }
.guide-chapter .guide-section > h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding-top: 24px; border-top: 1px solid var(--border2); font-size: 24px; }
.guide-chapter .guide-section:first-child > h2 { padding-top: 0; border-top: 0; }
.guide-heading-icon { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; color: var(--section-color); background: color-mix(in srgb, var(--section-color) 10%, var(--surface)); border: 1px solid var(--border2); border-radius: 4px; }
.guide-heading-icon svg { width: 21px; height: 21px; }
.guide-chapter h3 { margin: 24px 0 12px; padding: 0; border: 0; font-size: 18px; }
.guide-chapter :is(.study-process, .study-cards, .guide-note-photo) h3 { margin: 0 0 10px; padding: 0; border: 0; font-size: 18px; }
.guide-chapter .study-process { border: 0; padding: 0; }
.guide-chapter .study-process ol { padding: 0; }
.guide-chapter .study-process li { margin: 0 0 12px; padding: 18px 18px 18px 62px; border: 1px solid var(--border2); border-radius: 4px; background: var(--surface); }
.guide-chapter .study-process li + li { margin-top: 0; }
.guide-chapter .study-process li:last-child { padding-bottom: 18px; border-color: var(--border2); }
.guide-chapter .study-step-number { left: 16px; top: 18px; border-radius: 4px; color: var(--section-color); background: color-mix(in srgb, var(--section-color) 10%, var(--surface2)); }
.guide-chapter .guide-subject-tip { margin: 16px 0 0; padding: 14px; border: 1px solid var(--border2); border-radius: 4px; background: var(--surface2); }
.guide-chapter :is(.study-callout, .study-cards article, .study-recall, .guide-planner, .guide-week, .guide-five-minutes) { border: 1px solid var(--border2); border-radius: 4px; background: var(--surface); }
.guide-chapter .study-table { overflow-x: auto; }
.guide-chapter .study-table :is(th, td) { vertical-align: top; }
.guide-notes-grid { display: grid; grid-template-columns: 1fr; gap: 32px; margin: 24px 0; }
.guide-chapter .guide-note-photo { display: grid; grid-template-columns: minmax(0, 1fr) 210px; align-items: center; gap: 26px; margin: 0; border: 0; padding: 0; background: transparent; }
.guide-note-photo > a { grid-column: 2; grid-row: 1; width: 210px; justify-self: center; }
.guide-chapter .guide-note-photo img { max-height: none; width: 100%; height: auto; border-radius: 4px; }
.guide-chapter .guide-note-photo figcaption { grid-column: 1; grid-row: 1; margin: 0; color: var(--text2); }
.guide-chapter .guide-illustration { display: block; padding: 0; border: 0; background: transparent; border-radius: 4px; }
.guide-illustration > a { display: block; }
.guide-chapter .guide-illustration img { width: 100%; height: auto; max-height: none; border-radius: 4px; }
.guide-chapter .guide-illustration figcaption { margin-top: 14px; color: var(--text2); }
.guide-chapter .study-image-open { cursor: zoom-in; }
.guide-chapter .guide-methods > section { margin-top: 26px; padding: 20px 0 0; border-top: 1px solid var(--border2); }
.guide-chapter .guide-methods > section:first-child { padding-top: 0; border-top: 0; }
.guide-chapter .guide-methods h3 { margin-top: 0; padding: 0; border: 0; }
.guide-method-number, .guide-five-number { display: none; }
.guide-chapter .guide-example { margin: 14px 0 0; padding: 14px; border: 1px solid var(--border2); border-radius: 4px; background: var(--surface); }
.guide-planner, .guide-week, .guide-five-minutes { padding: 20px; margin: 22px 0; }
.guide-planner-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.guide-planner-fields > div { display: grid; gap: 6px; min-width: 0; }
.guide-planner-fields :is(input, select) { width: 100%; min-width: 0; min-height: 40px; padding: 7px 10px; border: 1px solid var(--border2); border-radius: 4px; background: var(--surface2); color: var(--text); font-family: inherit; }
.guide-chapter .guide-planner-result { margin-top: 18px; color: var(--text); }
.guide-chapter .guide-calendar-steps li + li { margin-top: 12px; }
.guide-week ol { list-style: none; padding: 0; }
.guide-week li { display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: 2px 12px; padding: 12px 0; border-top: 1px solid var(--border2); }
.guide-week li > span { grid-row: 1 / 3; color: var(--muted); }
.guide-week small { color: var(--text2); }
.guide-chapter .guide-five-minutes h3 { margin-top: 0; }
.guide-motivation { display: flex; gap: 14px; align-items: center; margin-top: 32px; padding: 20px 0; border-top: 1px solid var(--border2); color: var(--text2); }
.guide-motivation-mark { color: var(--accent); font-size: 25px; }
.guide-chapter .guide-motivation p { margin-bottom: 4px; }
.guide-motivation strong { font-weight: 500; }
/* A light navigation rail, with clear row states and a quiet section index. */
.guide-toc { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--topbar-height) + 26px); max-height: calc(100vh - var(--topbar-height) - 52px); overflow-y: auto; padding: 4px; }
.guide-toc-title { margin: 0 10px 12px; color: var(--text); font-size: 14px; font-weight: 650; }
.guide-toc nav { display: grid; gap: 3px; counter-reset: guide-section; }
.guide-toc nav a { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: baseline; gap: 9px; padding: 9px 10px; border-radius: 4px; color: var(--text2); font-size: 14px; line-height: 1.5; text-decoration: none; }
.guide-toc nav a::before { counter-increment: guide-section; content: counter(guide-section, decimal-leading-zero); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.guide-toc nav a:hover { color: var(--text); background: var(--surface); }
.guide-toc nav a[aria-current="location"] { color: var(--text); background: var(--surface2); }
.guide-toc nav a[aria-current="location"]::before { color: var(--accent); }
.guide-calendar-link { display: block; margin: 16px 10px 0; padding-top: 16px; border-top: 1px solid var(--border2); color: var(--muted); font-size: 14px; line-height: 1.6; text-decoration: none; }
.guide-calendar-link:hover { color: var(--text); }
.study-guide-main :is(a, input, select):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 1100px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .guide-toc { grid-column: 1; grid-row: 1; position: static; max-height: none; margin-bottom: 28px; padding-bottom: 18px; border-bottom: 1px solid var(--border2); }
  .guide-toc nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-chapter { grid-row: 2; }
}
@media (max-width: 640px) {
  .guide-hero h1 { font-size: 26px; }
  .guide-planner-fields { grid-template-columns: 1fr; }
  .guide-planner, .guide-week, .guide-five-minutes { padding: 16px; }
  .guide-week li { grid-template-columns: 100px minmax(0, 1fr); }
  .guide-chapter .study-process li { padding: 16px 14px 16px 52px; }
  .guide-chapter .study-step-number { left: 10px; top: 17px; width: 27px; height: 27px; }
  .guide-chapter .guide-section > h2 { font-size: 22px; }
  .guide-chapter .guide-note-photo { grid-template-columns: minmax(0, 1fr) 140px; gap: 16px; }
  .guide-note-photo > a { width: 140px; }
}
@media (max-width: 420px) {
  .guide-chapter .guide-note-photo { grid-template-columns: 1fr; }
  .guide-note-photo > a { grid-column: 1; grid-row: 2; width: min(240px, 100%); }
  .guide-chapter .guide-note-photo figcaption { grid-column: 1; grid-row: 1; }
}
@media print {
  .guide-layout { display: block; }
  .guide-toc, .guide-back, .guide-planner { display: none; }
}
