@import url("chapter1.css?v=20260821-math-typography3");

.function-map{max-width:680px;margin:22px auto;padding:20px;border:1px solid var(--line);border-radius:14px;background:#fbfcfe}
.function-map>div:not(.map-arrow){display:grid;grid-template-columns:minmax(100px,1.35fr) repeat(4,minmax(48px,.7fr));gap:8px;align-items:center;text-align:center}
.function-map strong{display:flex;align-items:center;justify-content:center;min-height:44px;border:1px solid #cbd7e6;border-radius:9px;background:#fff;font-variant-numeric:tabular-nums}
.function-map .map-label{text-align:left;color:var(--muted);font-size:.9rem;font-weight:750}
.function-map .map-arrow{text-align:center;color:var(--blue);font-size:1.25rem;line-height:1.2;margin:4px 0}

.table-scroll{overflow-x:auto;margin:20px 0}
.value-table{width:100%;min-width:600px;border-collapse:collapse;border:1px solid var(--line);background:#fff;text-align:center;font-variant-numeric:tabular-nums}
.value-table th,.value-table td{padding:12px 14px;border:1px solid var(--line)}
.value-table th{background:#f5f8fd;color:#52627a;font-weight:800}
.value-table tbody th{white-space:nowrap}

.quadratic-figure{margin:24px auto 28px;max-width:820px;border:1px solid var(--line);border-radius:14px;background:#fbfcfe;padding:16px 18px 12px}
.quadratic-figure svg{display:block;width:100%;height:auto}
.quadratic-figure figcaption{margin-top:10px;color:var(--muted);font-size:.92rem;text-align:center}
.quadratic-figure marker path{fill:#52627a}
.graph-grid line{stroke:#e7ecf2;stroke-width:1}
.graph-axis{stroke:#52627a;stroke-width:2;fill:none}
.graph-ticks line{stroke:#7a879a;stroke-width:1.4}
.graph-labels text,.graph-note,.graph-legend text{fill:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic","YuGothic","Noto Sans CJK JP",Meiryo,sans-serif;font-size:14px}
.graph-labels text{text-anchor:middle}
.graph-note{font-size:13px;font-weight:700}
.parabola-main,.parabola-wide,.parabola-narrow,.parabola-muted{fill:none;stroke-width:3.2;stroke-linecap:round}
.parabola-main{stroke:var(--blue)}
.parabola-wide{stroke:var(--green)}
.parabola-narrow{stroke:var(--accent)}
.parabola-muted{stroke:#9aa8bb;stroke-dasharray:8 7}
.graph-point{fill:var(--blue)}
.graph-point-accent{fill:var(--accent)}
.graph-legend line{stroke-width:3.2}

.vertex-strip,.decision-flow,.case-strip,.sign-chart{display:grid;gap:12px;margin:20px 0}
.vertex-strip{grid-template-columns:repeat(3,minmax(0,1fr))}
.vertex-strip>div,.decision-flow>div,.case-strip>div,.sign-chart>div{border:1px solid var(--line);border-radius:12px;background:#fff;padding:16px}
.vertex-strip strong,.decision-flow strong,.case-strip strong,.sign-chart strong{display:block;margin-bottom:7px;color:var(--ink)}
.decision-flow{grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch}
.decision-flow .arrow-card{display:flex;align-items:center;justify-content:center;border-style:dashed;color:var(--blue);font-weight:800}
.case-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
.sign-chart{grid-template-columns:repeat(3,minmax(0,1fr));text-align:center}
.sign-positive{border-top:4px solid var(--green)!important}
.sign-zero{border-top:4px solid var(--blue)!important}
.sign-negative{border-top:4px solid var(--accent)!important}

.interval-line{position:relative;height:54px;margin:22px 16px 10px;border-top:2px solid #708096}
.interval-line .interval-range{position:absolute;top:-4px;height:6px;border-radius:999px;background:var(--blue)}
.interval-line .mark{position:absolute;top:-9px;width:16px;height:16px;margin-left:-8px;border-radius:50%;background:#fff;border:3px solid var(--blue)}
.interval-line .mark.filled{background:var(--blue)}
.interval-line .label{position:absolute;top:14px;transform:translateX(-50%);font-size:.88rem;color:var(--muted)}

.formula-choice{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:20px 0}
.formula-choice>div{border:1px solid var(--line);border-radius:12px;padding:16px;background:#fbfcfe}
.formula-choice .when{font-size:.84rem;color:var(--muted);font-weight:750;margin-bottom:8px}
.formula-choice math{font-size:1.08em}
.example-head .badge{white-space:nowrap;flex:0 0 auto}

/* Chapter 3 redesign polish: isolate the new number-line primitive from the
   older site-wide .numberline component, and make the root-position lesson
   literally narrow from 3 candidates to 2 to 1. */
.redesign-visual .numberline{
  position:relative!important;
  display:block!important;
  width:auto!important;
  height:42px!important;
  min-height:0!important;
  margin:12px 12px 0!important;
  padding:0!important;
  border:0!important;
  border-top:2px solid #78889b!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:visible!important;
}
.redesign-visual[data-qa-benchmark-visual="s43-root-position"] .candidate-grid.stage-2{grid-template-columns:repeat(2,minmax(0,1fr));max-width:720px;margin-inline:auto}
.redesign-visual[data-qa-benchmark-visual="s43-root-position"] .candidate-grid.stage-3{grid-template-columns:minmax(0,1fr);max-width:360px;margin-inline:auto}
.redesign-visual[data-qa-benchmark-visual="s38-parameter-discriminant"] .redesign-grid>.redesign-card:nth-child(3)>strong{font-size:0}
.redesign-visual[data-qa-benchmark-visual="s38-parameter-discriminant"] .redesign-grid>.redesign-card:nth-child(3)>strong::after{content:"代表 a=−1：D=0（a=2でも重解）";font-size:1rem}
.redesign-visual[data-qa-benchmark-visual="s42-standard-inequalities"] .interval-stack>.interval-row:nth-child(2)>span:first-child{font-size:0}
.redesign-visual[data-qa-benchmark-visual="s42-standard-inequalities"] .interval-stack>.interval-row:nth-child(2)>span:first-child::after{content:"x≤1 または x≥2";font-size:.9rem}
.redesign-visual[data-qa-benchmark-visual="s37-discriminant-formula"] .disc-formula{font-size:0}
.redesign-visual[data-qa-benchmark-visual="s37-discriminant-formula"] .disc-formula::after{content:"x = (−b ± √D) / (2a)　　D = b² − 4ac";font-size:1.1rem}
.redesign-visual{scroll-margin-top:72px}

@media(max-width:720px){
  .function-map{padding:16px 12px}
  .function-map>div:not(.map-arrow){grid-template-columns:minmax(76px,1.1fr) repeat(4,minmax(40px,.7fr));gap:5px}
  .function-map strong{min-height:40px;font-size:.94rem}
  .function-map .map-label{font-size:.82rem}
  .table-scroll::before{content:"横にスクロールできます";display:block;margin:0 0 7px;color:var(--muted);font-size:.82rem;font-weight:650}
  .quadratic-figure{padding:10px 6px 8px;border-radius:11px}
  .graph-labels text{font-size:20px}
  .graph-note{font-size:22px}
  .graph-legend text{font-size:18px}
  .vertex-strip,.decision-flow,.case-strip,.sign-chart,.formula-choice{grid-template-columns:1fr}
  .decision-flow .arrow-card{min-height:44px}
  .redesign-visual[data-qa-benchmark-visual="s43-root-position"] .candidate-grid.stage-2{grid-template-columns:1fr}
}


/* Textbook-style quadratic diagrams: standard coordinate geometry and direct labels. */
.textbook-graph{max-width:680px;border:0;background:#fff;padding:6px 0 0}
.textbook-graph>svg{max-width:620px;margin-inline:auto;border:1px solid #aeb7c3;background:#fff}
.textbook-graph .textbook-axis{stroke:#252b33;stroke-width:1.45;fill:none}
.textbook-graph marker path{fill:#252b33}
.textbook-graph .textbook-grid line{stroke:#e2e5e9;stroke-width:1}
.textbook-graph .textbook-curve{fill:none;stroke:#20252b;stroke-width:2.2;stroke-linecap:round}
.textbook-graph .textbook-curve.is-primary{stroke:var(--blue);stroke-width:3}
.textbook-graph .textbook-curve.is-light{stroke:#68717d;stroke-width:1.8}
.textbook-graph .textbook-curve.is-dashed{stroke:#929aa5;stroke-width:1.7;stroke-dasharray:6 5}
.textbook-graph .textbook-line{stroke:#20252b;stroke-width:2;fill:none}
.textbook-graph .textbook-line.is-accent{stroke:#d97706;stroke-width:2.4}
.textbook-graph .textbook-guide{stroke:#7f8791;stroke-width:1.15;stroke-dasharray:5 4}
.textbook-graph .textbook-move-arrow,.textbook-graph .textbook-callout{stroke:#414852;stroke-width:1.5;fill:none}
.textbook-graph .textbook-points circle{fill:#20252b}
.textbook-graph .textbook-points .vertex,.textbook-graph .textbook-vertex{fill:var(--blue)}
.textbook-graph .textbook-point.is-muted{fill:#747d88}
.textbook-graph .textbook-endpoint{fill:var(--blue);stroke:#fff;stroke-width:1.5}
.textbook-graph .textbook-open-point{fill:#fff;stroke:var(--blue);stroke-width:2.2}
.textbook-graph .textbook-domain{fill:none;stroke:var(--blue);stroke-width:5;stroke-linecap:round}
.textbook-graph .textbook-domain-arrow{fill:var(--blue)}
.textbook-graph .textbook-domain-band{fill:#eaf3ff}
.textbook-graph .textbook-boundary{stroke:var(--blue);stroke-width:1.25;opacity:.62}
.textbook-graph .textbook-extremum{fill:#d97706;stroke:#fff;stroke-width:1.8}
.textbook-graph .textbook-root{fill:#d97706;stroke:#fff;stroke-width:1.8}
.textbook-graph .textbook-target-line{stroke:#d97706;stroke-width:1.15;stroke-dasharray:4 4;fill:none;opacity:.8}
.textbook-graph .textbook-direct-label{fill:#20252b;font-size:13px;font-weight:750;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic","YuGothic",sans-serif;paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round}
.textbook-graph .textbook-label-box{fill:#fff;stroke:#4b535d;stroke-width:1}
.textbook-graph .textbook-result-box{fill:#f5f8fd;stroke:#9ab2d3;stroke-width:1}
.textbook-graph .textbook-ticks line{stroke:#252b33;stroke-width:1.2}
.textbook-graph .graph-equation{fill:#20252b;font-family:"Latin Modern Math","STIX Two Math","Cambria Math",serif;font-size:16px;font-weight:650}
.textbook-graph .graph-note{fill:#20252b;font-size:14px;font-weight:650;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic","YuGothic",sans-serif}
.textbook-graph .graph-note.is-point-label{font-size:12px;font-weight:600}
.textbook-case-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:stretch}
.textbook-case-grid.is-two{grid-template-columns:repeat(2,minmax(0,1fr));max-width:620px;margin-inline:auto}
.textbook-case{display:flex;flex-direction:column;align-items:center;border:1px solid #c5cbd3;background:#fff;padding:12px 8px 8px;text-align:center}
.textbook-case>strong{display:block;min-height:1.6em;color:#20252b;font-size:.95rem}
.textbook-case svg{display:block;width:100%;max-width:280px;height:auto;margin-top:4px}
.textbook-case .graph-note{font-size:13px}
.textbook-graph[data-qa-figure="s28-extrema-intro"]{max-width:820px}
.textbook-graph[data-qa-figure="s28-extrema-intro"] .textbook-case-grid.is-two{max-width:780px}
.textbook-graph[data-qa-figure="s28-extrema-intro"] .textbook-case{padding:14px 10px 10px;border-color:#b9c3cf}
.textbook-graph[data-qa-figure="s28-extrema-intro"] .textbook-case>strong{font-size:1rem}
.textbook-graph[data-qa-figure="s28-extrema-intro"] .textbook-case svg{max-width:340px}
.textbook-graph[data-qa-figure="s29-three-intervals"]{max-width:960px}
.textbook-graph[data-qa-figure="s29-three-intervals"] .textbook-case{padding:14px 10px 10px;border-color:#b9c3cf}
.textbook-graph[data-qa-figure="s29-three-intervals"] .textbook-case>strong{font-size:1rem}
.textbook-graph[data-qa-figure="s29-three-intervals"] .textbook-case svg{max-width:300px}
.textbook-graph[data-qa-figure="s33-moving-axis-cases"],.textbook-graph[data-qa-figure="s34-moving-domain-cases"],.textbook-graph[data-qa-figure="s35-extrema-inverse"]{max-width:960px}
.textbook-graph[data-qa-figure="s33-moving-axis-cases"] .textbook-case,.textbook-graph[data-qa-figure="s34-moving-domain-cases"] .textbook-case,.textbook-graph[data-qa-figure="s35-extrema-inverse"] .textbook-case{padding:14px 10px 10px;border-color:#b9c3cf}
.textbook-graph[data-qa-figure="s33-moving-axis-cases"] .textbook-case>strong,.textbook-graph[data-qa-figure="s34-moving-domain-cases"] .textbook-case>strong,.textbook-graph[data-qa-figure="s35-extrema-inverse"] .textbook-case>strong{font-size:1rem}
.textbook-graph[data-qa-figure="s33-moving-axis-cases"] .textbook-case svg,.textbook-graph[data-qa-figure="s34-moving-domain-cases"] .textbook-case svg,.textbook-graph[data-qa-figure="s35-extrema-inverse"] .textbook-case svg{max-width:300px}
.textbook-graph[data-qa-figure="s36-determining-forms"],.textbook-graph[data-qa-figure="s37-discriminant-cases"]{max-width:960px}
.textbook-graph[data-qa-figure="s36-determining-forms"] .textbook-case,.textbook-graph[data-qa-figure="s37-discriminant-cases"] .textbook-case{padding:14px 10px 10px;border-color:#b9c3cf}
.textbook-graph[data-qa-figure="s36-determining-forms"] .textbook-case>strong,.textbook-graph[data-qa-figure="s37-discriminant-cases"] .textbook-case>strong{font-size:1rem}
.textbook-graph[data-qa-figure="s36-determining-forms"] .textbook-case svg,.textbook-graph[data-qa-figure="s37-discriminant-cases"] .textbook-case svg{max-width:300px}
.textbook-graph[data-qa-figure="s36-determining-forms"] .case-method,.textbook-graph[data-qa-figure="s37-discriminant-cases"] .case-method{display:block;min-height:2.8em;margin-top:6px;color:#4b5563;font-size:.78rem;line-height:1.45}
.textbook-graph[data-qa-figure="s38-discriminant-parameters"]{max-width:680px}
.textbook-graph[data-qa-figure="s38-discriminant-parameters"]>svg{max-width:660px}
.textbook-graph[data-qa-figure="s39-root-to-coordinate"],.textbook-graph[data-qa-figure="s33-sign-intervals"]{max-width:700px}
.textbook-graph[data-qa-figure="s39-root-to-coordinate"]>svg,.textbook-graph[data-qa-figure="s33-sign-intervals"]>svg{max-width:660px}
.textbook-graph[data-qa-figure="s40-parabola-line-cases"]{max-width:960px}
.textbook-graph[data-qa-figure="s40-parabola-line-cases"] .textbook-case{padding:14px 10px 10px;border-color:#b9c3cf}
.textbook-graph[data-qa-figure="s40-parabola-line-cases"] .textbook-case>strong{font-size:1rem}
.textbook-graph[data-qa-figure="s40-parabola-line-cases"] .textbook-case svg{max-width:300px}
@media(max-width:720px){
  .textbook-graph{padding:4px 0 0}
  .textbook-graph>svg{border-left:0;border-right:0}
  .textbook-graph .graph-note{font-size:20px}
  .textbook-case-grid,.textbook-case-grid.is-two{grid-template-columns:1fr}
  .textbook-case{padding:12px 10px 8px}
  .textbook-case>strong{font-size:1rem}
  .textbook-case svg{max-width:320px}
  .textbook-case .graph-note{font-size:14px}
  .textbook-graph[data-qa-figure="s28-extrema-intro"] .graph-labels text,.textbook-graph[data-qa-figure="s29-three-intervals"] .graph-labels text{font-size:15px}
  .textbook-graph .graph-equation{font-size:16px}
  .textbook-graph .graph-note.is-point-label{font-size:12px}
  .textbook-graph .textbook-direct-label{font-size:13px}
  .textbook-graph[data-qa-figure="s36-determining-forms"] .textbook-case svg,.textbook-graph[data-qa-figure="s37-discriminant-cases"] .textbook-case svg{max-width:320px}
  .textbook-graph[data-qa-figure="s36-determining-forms"] .case-method,.textbook-graph[data-qa-figure="s37-discriminant-cases"] .case-method{font-size:.82rem}
  .textbook-graph[data-qa-figure="s38-discriminant-parameters"]>svg{max-width:360px}
  .textbook-graph[data-qa-figure="s38-discriminant-parameters"] .graph-equation{font-size:19px}
  .textbook-graph[data-qa-figure="s39-root-to-coordinate"]>svg,.textbook-graph[data-qa-figure="s33-sign-intervals"]>svg{max-width:360px}
  .textbook-graph[data-qa-figure="s39-root-to-coordinate"] .graph-equation,.textbook-graph[data-qa-figure="s33-sign-intervals"] .graph-equation{font-size:19px}
  .textbook-graph[data-qa-figure="s40-parabola-line-cases"] .textbook-case svg{max-width:320px}
}


/* Runtime-free textbook figures: clip plotted curves to the SVG viewport and keep long piecewise results inside narrow screens. */
.textbook-graph[data-qa-figure^="s42-"]{max-width:620px}
.textbook-graph[data-qa-figure^="s42-"]>svg{max-width:600px}
.textbook-graph[data-qa-figure^="s42-"] .graph-note,.textbook-graph[data-qa-figure^="s42-"] .graph-equation{font-size:18px}
.textbook-graph[data-qa-figure="s43-root-position"]{max-width:1000px}
.textbook-graph[data-qa-figure="s43-root-position"] .textbook-case svg{max-width:320px}
.textbook-graph[data-qa-figure="s43-root-position"] .graph-note{font-size:15px}
.textbook-graph[data-qa-figure^="s44-"]{max-width:480px}
.textbook-graph[data-qa-figure^="s44-"]>svg{max-width:440px}
.textbook-graph[data-qa-figure^="s44-"] .graph-note{font-size:16px}
.textbook-graph[data-qa-figure^="s44-"] .graph-equation{font-size:18px}
.textbook-case svg,.textbook-graph>svg{overflow:hidden}
@media(max-width:720px){.result-piecewise math{font-size:.94em}}

/* Standard coordinate figures for absolute-value and substitution applications. */
.textbook-graph[data-qa-figure^="s45-"]{max-width:480px}
.textbook-graph[data-qa-figure^="s45-"]>svg{max-width:440px}
.textbook-graph[data-qa-figure^="s45-"] .graph-note{font-size:16px}
.textbook-graph[data-qa-figure^="s45-"] .graph-equation{font-size:18px}
.textbook-graph[data-qa-figure^="s46-"]{max-width:440px}
.textbook-graph[data-qa-figure^="s46-"]>svg{max-width:400px}
.textbook-graph[data-qa-figure^="s46-"] .graph-note,.textbook-graph[data-qa-figure^="s46-"] .graph-equation{font-size:18px}
.s46-title-term{white-space:nowrap}
.s45-phrase,.s46-phrase{white-space:nowrap}
.model-table.s45-case-table,.model-table.s45-case-table th{font-size:1rem}
.model-table.s45-case-table math{font-size:1em}
.s45-example+.s45-example{margin-top:22px}
