/* Chapter-linked tools: compact, readable, and responsive. */
.chapter-tool-main { max-width: 1240px; padding-top: 22px; }
.chapter-back-link { display:inline-flex; align-items:center; gap:8px; color:#9fe7c4; font-size:14px; font-weight:700; text-decoration:none; margin-bottom:14px; }
.chapter-back-link:hover, .chapter-back-link:focus-visible { color:#fff; text-decoration:underline; }
.chapter-tool-hero { display:grid; grid-template-columns:minmax(0,1fr) minmax(250px,330px); gap:18px; align-items:end; margin-bottom:14px; }
.chapter-kicker { color:#ffb25f; font:700 11px/1.2 "DM Sans",sans-serif; letter-spacing:.14em; text-transform:uppercase; }
.chapter-tool-hero h1 { margin:6px 0 6px; font-size:clamp(25px,3.1vw,42px); line-height:1.08; color:#f5f8fa; }
.chapter-tool-hero p { max-width:760px; margin:0; color:#a9bac4; font-size:15px; line-height:1.55; }
.chapter-status { min-height:88px; display:grid; grid-template-columns:auto 1fr; column-gap:9px; align-content:center; padding:13px 15px; border:1px solid rgba(126,214,176,.26); border-radius:12px; background:rgba(8,28,24,.68); }
.chapter-status-dot { width:9px; height:9px; margin-top:4px; border-radius:50%; background:#7ed6b0; box-shadow:0 0 0 4px rgba(126,214,176,.12); }
.chapter-status strong { color:#eaf8f0; font-size:15px; }
.chapter-status small { grid-column:2; color:#9eafb8; font-size:12px; line-height:1.4; }
.chapter-status.is-error { border-color:rgba(255,121,121,.42); background:rgba(74,27,30,.42); }
.chapter-status.is-error .chapter-status-dot { background:#ff7979; box-shadow:0 0 0 4px rgba(255,121,121,.12); }
.chapter-retry { grid-column:2; justify-self:start; margin-top:8px; padding:5px 9px; border:1px solid rgba(255,178,95,.42); border-radius:7px; color:#ffcf94; background:transparent; font:700 12px "DM Sans",sans-serif; cursor:pointer; }
.chapter-retry:hover, .chapter-retry:focus-visible { color:#142019; background:#ffb25f; }
.chapter-control-panel, .chapter-chart-box, .chapter-read-card, .chapter-result-card, .chapter-bottom-guide { border:1px solid rgba(158,181,196,.17); border-radius:14px; background:linear-gradient(145deg,rgba(17,31,43,.96),rgba(9,21,30,.98)); box-shadow:0 12px 34px rgba(0,0,0,.12); }
.chapter-control-panel { padding:16px; margin-bottom:12px; }
.chapter-control-head, .chapter-result-head, .chapter-bottom-guide-head { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; margin-bottom:12px; }
.chapter-control-head h2, .chapter-result-head h2, .chapter-bottom-guide-head h2 { margin:4px 0 0; color:#f1f5f7; font-size:20px; line-height:1.2; }
.chapter-source-badge, .chapter-real-badge { display:inline-flex; align-items:center; min-height:26px; padding:4px 8px; border:1px solid rgba(255,178,95,.35); border-radius:7px; color:#ffcb8c; background:rgba(255,178,95,.07); font-size:11px; font-weight:700; text-align:right; }
.chapter-control-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.chapter-field { display:grid; gap:5px; min-width:0; }
.chapter-field span, .chapter-check span { color:#c5d2d9; font-size:13px; font-weight:700; }
.chapter-field input, .chapter-field select { width:100%; min-height:40px; padding:8px 10px; border:1px solid rgba(158,181,196,.26); border-radius:8px; color:#f8fbfc; background:#141e29; font:600 15px "DM Sans",sans-serif; box-sizing:border-box; }
.chapter-field input::placeholder { color:#718691; opacity:1; }
.chapter-field input:focus, .chapter-field select:focus { outline:2px solid rgba(126,214,176,.55); outline-offset:1px; border-color:#7ed6b0; }
.chapter-field option { color:#f8fbfc; background:#141e29; }
.chapter-check { display:flex; align-items:flex-start; gap:8px; min-height:38px; padding:9px 10px; border:1px solid rgba(158,181,196,.2); border-radius:8px; background:rgba(20,32,43,.74); cursor:pointer; }
.chapter-check input { flex:0 0 auto; width:17px; height:17px; accent-color:#ff9d52; }
.chapter-check span { font-size:13px; line-height:1.35; }
.chapter-run { display:inline-flex; align-items:center; gap:8px; min-height:40px; margin-top:12px; padding:8px 15px; border:1px solid #ffb25f; border-radius:8px; color:#162018; background:#ffb25f; font:800 14px "DM Sans",sans-serif; cursor:pointer; }
.chapter-run:hover, .chapter-run:focus-visible { color:#fff; background:#e87528; border-color:#e87528; outline:none; }
.chapter-input-note { margin:10px 0 0; color:#8298a8; font-size:12px; line-height:1.5; }
.chapter-hud { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.chapter-hud-item { min-width:0; padding:12px 13px; border:1px solid rgba(126,214,176,.22); border-radius:11px; background:rgba(8,29,25,.72); }
.chapter-hud-item span, .chapter-hud-item small { display:block; color:#8fa7ac; font-size:12px; }
.chapter-hud-item strong { display:block; margin:4px 0 2px; color:#f8fbfc; font:700 22px/1.1 "Space Grotesk",sans-serif; overflow-wrap:anywhere; }
.chapter-chart-layout { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(280px,.85fr); gap:12px; margin-bottom:12px; }
.chapter-chart-box { min-width:0; padding:14px; min-height:340px; }
.chapter-chart-title h2 { margin:4px 0 10px; color:#f1f5f7; font-size:18px; }
.chapter-chart-box canvas { display:block; width:100% !important; height:290px !important; }
.chapter-read-card { min-width:0; padding:16px; }
.chapter-read-card h2 { margin:5px 0 11px; color:#f1f5f7; font-size:20px; }
.chapter-read-card p { margin:0 0 11px; color:#b4c3ca; font-size:13px; line-height:1.62; }
.chapter-read-card h3 { margin:14px 0 4px; color:#ffbe7a; font-size:15px; }
.chapter-formula { padding:10px; border-left:3px solid #ffb25f; background:rgba(255,178,95,.06); }
.chapter-data-source { color:#91bfae !important; }
.chapter-guide-return, .chapter-tool-links a { display:inline-flex; align-items:center; gap:7px; color:#9fe7c4; font-size:13px; font-weight:700; text-decoration:none; }
.chapter-guide-return:hover, .chapter-guide-return:focus-visible, .chapter-tool-links a:hover, .chapter-tool-links a:focus-visible { color:#fff; text-decoration:underline; }
.chapter-result-card { padding:16px; margin-bottom:12px; }
.chapter-result { min-height:78px; }
.chapter-empty, .chapter-loading { margin:0; color:#9eb1bb; font-size:14px; }
.chapter-error { padding:13px; border:1px solid rgba(255,121,121,.35); border-radius:10px; background:rgba(88,28,34,.28); color:#ffd1d1; }
.chapter-error strong { display:block; margin-bottom:4px; color:#ffaaa7; }
.chapter-error p { margin:0; color:#d9bcbc; font-size:13px; line-height:1.5; }
.chapter-stat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
.chapter-stat { padding:10px; border:1px solid rgba(158,181,196,.16); border-radius:9px; background:rgba(7,18,27,.58); }
.chapter-stat span, .chapter-stat small { display:block; color:#90a4ad; font-size:12px; }
.chapter-stat strong { display:block; margin:3px 0; color:#f6f9fa; font-size:18px; overflow-wrap:anywhere; }
.chapter-result-copy { margin:10px 0 0; color:#a9bac4; font-size:13px; line-height:1.55; }
.chapter-bottom-guide { padding:16px; margin-bottom:12px; }
.chapter-method-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.chapter-method-grid > div { padding:12px; border:1px solid rgba(158,181,196,.16); border-radius:10px; background:rgba(8,20,29,.6); }
.chapter-method-grid h3 { margin:0 0 5px; color:#ffbe7a; font-size:15px; }
.chapter-method-grid p { margin:0; color:#b4c3ca; font-size:13px; line-height:1.55; }
.chapter-tool-links { display:flex; flex-wrap:wrap; gap:15px; padding:3px 0 14px; }
@media (max-width: 900px) { .chapter-tool-hero, .chapter-chart-layout { grid-template-columns:1fr; } .chapter-control-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width: 620px) { .chapter-tool-main { padding:14px 12px 0; } .chapter-tool-hero h1 { font-size:26px; } .chapter-tool-hero p { font-size:14px; } .chapter-control-panel, .chapter-chart-box, .chapter-read-card, .chapter-result-card, .chapter-bottom-guide { padding:12px; border-radius:11px; } .chapter-control-head, .chapter-result-head, .chapter-bottom-guide-head { display:block; } .chapter-source-badge, .chapter-real-badge { margin-top:9px; text-align:left; } .chapter-control-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } .chapter-field input, .chapter-field select { min-height:42px; font-size:15px; } .chapter-hud { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } .chapter-hud-item { padding:10px; } .chapter-hud-item strong { font-size:18px; } .chapter-chart-box { min-height:290px; } .chapter-chart-box canvas { height:240px !important; } .chapter-stat-grid, .chapter-method-grid { grid-template-columns:1fr; } .chapter-tool-links { gap:10px 15px; } }
@media (max-width: 390px) { .chapter-tool-main { padding-left:10px; padding-right:10px; } .chapter-control-grid { grid-template-columns:1fr; } .chapter-tool-hero h1 { font-size:24px; } .chapter-tool-hero p { font-size:13px; } }
