/* Electric trainers article: static figures and the "one lesson" widget.
 * Shares tokens with home.css / article.css. */
:root { --ev-green: #1f7a4d; --ev-amber: #c98a12; --ev-amber-text: #8a5a00; }
@media (prefers-color-scheme: dark) { :root { --ev-green: #5fc493; --ev-amber: #e0a63a; --ev-amber-text: #f0c060; } }

/* Static figures */
.ev-box { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; }
.ev-box.e { stroke: var(--ev-green); }
.ev-box.p { stroke: var(--magenta); }
.ev-flow { stroke: var(--ink-soft); stroke-width: 2; fill: none; }
.ev-flow.e { stroke: var(--ev-green); stroke-width: 2.6; }
.ev-ah { fill: var(--ink-soft); }
.ev-ah.e { fill: var(--ev-green); }
.ev-t { font: 600 12px var(--mono); fill: var(--ink); }
.ev-ts { font: 500 11px var(--mono); fill: var(--ink-soft); }
.ev-tg { font: 600 13px var(--mono); fill: var(--ev-green); }
.ev-tm { font: 600 13px var(--mono); fill: var(--magenta); }
.ev-fuel { fill: color-mix(in srgb, var(--magenta) 55%, var(--card)); }
.ev-batt { fill: color-mix(in srgb, var(--ev-green) 60%, var(--card)); }
.ev-batt.lo { fill: color-mix(in srgb, var(--ev-green) 22%, var(--card)); }
.ev-empty { fill: var(--paper-2); stroke: var(--ink-soft); stroke-width: 1.4; }
.ev-axis { stroke: var(--ink); stroke-width: 1.4; }
.prose .fig.ev-fig svg { max-width: 560px; margin: 0 auto; }

/* Widget */
.widget.ev { grid-template-columns: 1fr; }
.ev-ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.ev-range { display: grid; gap: 6px; font-size: 15px; color: var(--ink-soft); }
.ev-range b { font-family: var(--mono); color: var(--ink); }
.ev-range input { width: 100%; accent-color: var(--magenta); }
.ev-group { display: grid; gap: 6px; }
.ev-lbl { font-size: 15px; color: var(--ink-soft); }
.ev-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-seg button { font: 600 14px var(--body); padding: 7px 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; text-align: left; }
.ev-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ev-seg button:focus-visible, .ev-range input:focus-visible, .ev-prices summary:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.ev-prices { grid-column: 1 / -1; border-top: 1px dashed var(--rule); padding-top: 10px; }
.ev-prices summary { cursor: pointer; font-size: 15px; color: var(--ink-soft); font-weight: 600; }
.ev-prices[open] { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.ev-prices[open] summary { grid-column: 1 / -1; }
.ev-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ev-card { background: var(--paper); border: 1px solid var(--rule); border-top: 4px solid var(--magenta); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.ev-card.e { border-top-color: var(--ev-green); }
.ev-card h4 { margin: 0 0 8px; font: 700 16px var(--display); }
.ev-card dl { margin: 0; display: grid; gap: 6px; }
.ev-card dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--rule); padding-bottom: 5px; }
.ev-card dt { font-size: 14px; color: var(--ink-soft); }
.ev-card dd { margin: 0; font: 600 15px var(--mono); text-align: right; white-space: nowrap; }
.ev-bar { display: block; width: 100%; height: auto; margin-top: 10px; }
.ev-shell { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.ev-used { fill: var(--paper-2); }
.ev-free { fill: color-mix(in srgb, var(--ev-green) 55%, var(--card)); }
.ev-res { fill: color-mix(in srgb, var(--blue) 45%, var(--card)); }
.ev-res.hit { fill: var(--magenta); }
.ev-margin { fill: color-mix(in srgb, var(--ev-amber) 35%, var(--card)); }
.ev-margin.hit { fill: var(--ev-amber); }
.ev-card dl div[hidden] { display: none; }
.w-note.ev-verdict { font-weight: 600; padding: 10px 12px; border-radius: 10px; border-left: 4px solid; }
.w-note.ev-verdict.green { color: var(--ev-green); border-color: var(--ev-green); background: color-mix(in srgb, var(--ev-green) 10%, transparent); }
.w-note.ev-verdict.amber { color: var(--ev-amber-text); border-color: var(--ev-amber); background: color-mix(in srgb, var(--ev-amber) 14%, transparent); }
.w-note.ev-verdict.red { color: var(--magenta); border-color: var(--magenta); background: color-mix(in srgb, var(--magenta) 10%, transparent); }
.ev-card.e.amber { border-color: var(--ev-amber); }
.ev-card.e.red { border-color: var(--magenta); }
.ev-mark { stroke: var(--ink); stroke-width: 2; }
.prose .ev-key { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.prose .ev-key li { font: 500 12px var(--mono); color: var(--ink-soft); margin: 0; }
.ev-key li::before { content: ""; display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.ev-key .u::before { background: var(--paper-2); border: 1px solid var(--rule); }
.ev-key .f::before { background: color-mix(in srgb, var(--ev-green) 55%, var(--card)); }
.ev-key .r::before { background: color-mix(in srgb, var(--blue) 45%, var(--card)); }
.ev-key .m::before { background: color-mix(in srgb, var(--ev-amber) 35%, var(--card)); }
.w-note.ev-assume { font-size: 13px; }

@media (max-width: 720px) {
  .ev-ctl, .ev-cols, .ev-prices[open] { grid-template-columns: 1fr; }
}
