/* Circuit Explorer — shared by circuits.html (index) and circuit.html (player).
   Colors follow the owner's Colpitts reference page. */
:root {
  color-scheme: dark;
  --ce-bg: #0b1020;
  --ce-panel: #131b2e;
  --ce-line: #2a3850;
  --ce-text: #edf3ff;
  --ce-muted: #9cacbf;
  --ce-cyan: #52d7e8;
  --ce-amber: #ffbd59;
  --ce-green: #6fe0a2;
  --ce-red: #ff7a83;
  --ce-purple: #c2a4ff;
  --ce-wire: #75849b;
  --ce-sym: #a8b7ca;
  --ce-radius: 18px;
}
* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body.ce-page {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 15% 5%, #1c2b44 0, var(--ce-bg) 45%);
  background-color: var(--ce-bg);
  font: 16px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ce-text);
}
a { color: var(--ce-cyan); }
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--ce-cyan); outline-offset: 2px; }

/* ---------- top bar ---------- */
.ce-top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 12px 28px;
}
.ce-logo img { height: 34px; display: block; }
.ce-crumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--ce-muted); font-size: 14px; min-width: 0; }
.ce-crumbs a { color: #c6d4e8; text-decoration: none; }
.ce-crumbs a:hover { text-decoration: underline; }
.ce-crumbs #crumb-title { color: var(--ce-text); }
.ce-topnav { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.ce-arrow, .ce-all {
  border: 1px solid #34445e; border-radius: 9px; padding: 6px 11px; color: #c6d4e8;
  text-decoration: none; font-size: 14px; background: #10192a;
}
.ce-arrow[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.ce-arrow:hover, .ce-all:hover { background: #1d2a41; }

/* ---------- page ---------- */
.ce-main { max-width: 1180px; margin: 0 auto; padding: 8px 28px 28px; }
.ce-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 0 0 18px; }
.ce-eyebrow { color: var(--ce-cyan); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.ce-head h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.12; margin: 6px 0 4px; }
.ce-sub { margin: 0; color: var(--ce-muted); max-width: 690px; }
.ce-badge { border: 1px solid #34445e; border-radius: 999px; padding: 8px 13px; color: #c6d4e8; white-space: nowrap; font-size: 13px; background: #10192a; }
.ce-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 16px; }
.ce-card { background: linear-gradient(145deg, #151f33, #101827); border: 1px solid var(--ce-line); border-radius: var(--ce-radius); box-shadow: 0 16px 50px #0004; overflow: hidden; }
.ce-schem { padding: 14px; position: relative; }
.ce-schem-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 4px 8px; }
.ce-schem h2 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: #c5d4e8; margin: 0; }
.ce-toggles { display: flex; gap: 12px; font-size: 13px; color: var(--ce-muted); }
.ce-toggles label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.ce-svg-host { position: relative; }
.ce-foot { color: #8091a8; font-size: 12px; margin: 12px 4px 0; }
.ce-keys { color: #6f819b; font-size: 12px; margin: 14px 4px 0; }

/* ---------- schematic ---------- */
.ce-svg { display: block; width: 100%; height: auto; }
.ce-svg text { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
.ce-svg .wire { fill: none; stroke: var(--ce-wire); stroke-width: 4; stroke-linecap: round; transition: stroke .2s; }
.ce-svg .sym { fill: none; stroke: var(--ce-sym); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ce-svg .sym-thin { fill: none; stroke: var(--ce-sym); stroke-width: 2; stroke-linecap: round; }
.ce-svg .sym-fill { fill: var(--ce-sym); stroke: none; }
.ce-svg .sym-ring { fill: #15243a; stroke: #c6d2e2; stroke-width: 3; }
.ce-svg .sym-pin { fill: var(--ce-bg); stroke: var(--ce-sym); stroke-width: 2; }
.ce-svg .node { fill: #d9e3f1; }
.ce-svg .ce-part .sym-ring { fill-opacity: .9; }
.ce-svg .ce-parts > g > .sym-ring:first-child { }
.ce-svg .ce-label { fill: #dce7f6; font-size: 14px; }
.ce-svg .ce-rail { font-weight: 650; }
.ce-svg .ce-tiny { fill: #9cacbf; font-size: 11px; }
.ce-svg .sym-text { fill: var(--ce-sym); font-size: 20px; font-weight: 700; }
.ce-svg .sym-small { font-size: 12px; font-weight: 600; }
.ce-svg .sym-num { font-size: 10px; font-weight: 500; fill: #8fa0b6; }
.ce-svg .ce-led-light { opacity: 0; filter: blur(7px); pointer-events: none; }
.ce-svg .ce-logic-hi { fill: var(--ce-green); }
.ce-svg .ce-logic-lo { fill: var(--ce-muted, #8ea0b8); }
.ce-svg .ce-logic-z { fill: var(--ce-amber); }
.ce-svg .ce-logic-x { fill: var(--ce-red); }
/* digital engine: wires by logic level */
.ce-svg .wire.ce-l1 { stroke: var(--ce-green); }
.ce-svg .wire.ce-l0 { stroke: #4a5870; }
.ce-svg .wire.ce-lz { stroke: var(--ce-amber); stroke-dasharray: 8 8; }
.ce-svg .wire.ce-lx { stroke: var(--ce-red); }
.ce-svg .ce-reading { fill: var(--ce-amber); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ce-explore-on .ce-svg .ce-part[data-type="switch"], .ce-explore-on .ce-svg .ce-part[data-type="spdt"], .ce-explore-on .ce-svg .ce-part[data-type="pushbutton"] { cursor: pointer; }
.ce-svg .ce-glow { fill: none; stroke: var(--glow); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; opacity: 0; filter: url(#ce-glow-f); transition: opacity .3s; }
.ce-svg .ce-glow path { fill: none; stroke: var(--glow); stroke-width: 10; }
.ce-svg .ce-glow.on { opacity: 1; }
.ce-svg .ce-dot { fill: #ffe7a3; filter: drop-shadow(0 0 3px #ffbd5999); pointer-events: none; }
.ce-svg .ce-tag rect { fill: #19283d; stroke: #30425e; stroke-width: 1; }
.ce-svg .ce-tag text { fill: #bdcde3; font-size: 11px; font-weight: 650; }
.ce-svg.ce-volts .wire { stroke-width: 5; }
.ce-tip { position: absolute; pointer-events: none; background: #0d1422; border: 1px solid #2b3850; border-radius: 8px; padding: 4px 8px; font-size: 12px; color: var(--ce-text); white-space: nowrap; }

/* ---------- scope ---------- */
.ce-scope { margin: 10px 4px 0; border: 1px solid #2b3850; border-radius: 12px; background: #0d1422; }
.ce-scope summary { cursor: pointer; padding: 8px 12px; font-size: 13px; color: #c5d4e8; }
.ce-scope canvas { display: block; width: 100%; height: 150px; }

/* ---------- explanation ---------- */
.ce-explain { padding: 24px 25px; display: flex; flex-direction: column; min-height: 560px; }
.ce-stepno { color: var(--ce-cyan); font-weight: 750; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.ce-explain h2 { font-size: 25px; margin: 10px 0 8px; }
.ce-body { font-size: 17px; color: #d2deef; max-width: 460px; min-height: 5.8em; }
.ce-num { color: var(--ce-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ce-meters { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 14px; }
.ce-meter { flex: 1 1 180px; background: #0d1422; border: 1px solid #2b3850; padding: 11px 12px; border-radius: 12px; }
.ce-meter.wide { flex-basis: 100%; }
.ce-meter label { display: flex; justify-content: space-between; gap: 8px; color: var(--ce-muted); font-size: 12px; margin-bottom: 8px; }
.ce-meter .v { color: var(--ce-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ce-meter .track { height: 7px; background: #263148; border-radius: 99px; overflow: hidden; }
.ce-meter .fill { height: 100%; width: 0; border-radius: 99px; transition: width .08s linear; }
.ce-meter .fill.amber { background: var(--ce-amber); }
.ce-meter .fill.cyan { background: var(--ce-cyan); }
.ce-meter .fill.green { background: var(--ce-green); }
.ce-meter .fill.red { background: var(--ce-red); }
.ce-meter .fill.purple { background: var(--ce-purple); }
.ce-meter small { display: block; margin-top: 8px; color: #8698b2; font-size: 11px; }
.ce-hint { margin-top: auto; padding: 14px 15px; border-left: 3px solid var(--ce-amber); background: #20283a; color: #cbd6e7; border-radius: 0 10px 10px 0; font-size: 14px; }
.ce-controls { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.ce-controls button, .ce-controls2 button, .ce-explore button {
  border: 1px solid #394c69; background: #1d2a41; color: var(--ce-text); padding: 9px 13px; border-radius: 9px; cursor: pointer;
}
.ce-controls button:hover, .ce-controls2 button:hover, .ce-explore button:hover { background: #293a57; }
.ce-dots { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.ce-dot { width: 14px; height: 14px; padding: 0; border-radius: 100%; background: #3a4860; border: 3px solid transparent; background-clip: content-box; cursor: pointer; }
.ce-dot.on { background-color: var(--ce-cyan); box-shadow: 0 0 10px #52d7e888; }
.ce-dot-explore { width: auto; height: auto; border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--ce-muted); background: #1d2a41; border: 1px solid #394c69; }
.ce-dot-explore.on { color: #0b1020; background: var(--ce-cyan); }
.ce-controls2 { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.ce-speed { display: flex; border: 1px solid #394c69; border-radius: 9px; overflow: hidden; }
.ce-speed button { border: 0; border-radius: 0; background: #131d2f; color: var(--ce-muted); padding: 7px 10px; cursor: pointer; }
.ce-speed button[aria-pressed="true"] { background: #2b3f5f; color: var(--ce-text); }
.ce-controls2 > button { padding: 7px 11px; font-size: 14px; }
.ce-scrub { width: 100%; margin: 12px 0 2px; accent-color: var(--ce-cyan); }
.ce-time { color: #8091a8; font-size: 12px; font-variant-numeric: tabular-nums; }
.ce-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- explore ---------- */
.ce-explore { margin: 4px 0 14px; padding: 12px; border: 1px solid #2b3850; border-radius: 12px; background: #0d1422; }
.ce-ctl { margin: 4px 0 10px; }
.ce-ctl label { display: flex; justify-content: space-between; font-size: 13px; color: var(--ce-muted); }
.ce-ctl output { color: var(--ce-text); font-variant-numeric: tabular-nums; }
.ce-ctl input[type="range"] { width: 100%; accent-color: var(--ce-cyan); }
.ce-readouts { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.ce-readout { flex: 1 1 120px; background: #131d2f; border-radius: 10px; padding: 8px 10px; font-size: 12px; color: var(--ce-muted); }
.ce-readout strong { display: block; color: var(--ce-text); font-size: 18px; font-variant-numeric: tabular-nums; }
.ce-toggle { border: 1px solid #3a4b67; background: #1d2a41; color: var(--ce-text); border-radius: 9px; padding: 7px 12px; cursor: pointer; }
.ce-toggle[aria-pressed="true"] { background: #1d4a3a; border-color: #2f6e50; }
.ce-momentary { touch-action: none; user-select: none; -webkit-user-select: none; }
.ce-explore-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ce-explore-actions button { padding: 7px 11px; font-size: 14px; }

/* ---------- related / footer / loading ---------- */
.ce-related { margin-top: 18px; padding: 16px 20px; border: 1px solid var(--ce-line); border-radius: var(--ce-radius); background: #10182a; }
.ce-related h2 { font-size: 15px; margin: 0 0 8px; color: #c5d4e8; }
.ce-related ul { margin: 0; padding-left: 18px; columns: 2; }
.ce-related li { margin: 4px 0; }
.ce-related .soon { color: var(--ce-muted); }
.ce-related em { font-size: 12px; color: #6f819b; }
.ce-footer { text-align: center; color: #8091a8; font-size: 13px; padding: 24px 16px 32px; }
.ce-footer a { color: #c6d4e8; }
.ce-loading { position: fixed; inset: auto 16px 16px auto; background: #131d2f; border: 1px solid #394c69; padding: 8px 12px; border-radius: 9px; font-size: 13px; color: var(--ce-muted); }
.ce-message .ce-layout, .ce-message .ce-keys, .ce-message .ce-related, .ce-message .ce-feedback { display: none; }

@media (max-width: 850px) {
  .ce-top, .ce-main { padding-left: 16px; padding-right: 16px; }
  .ce-head { align-items: start; flex-direction: column; }
  .ce-layout { grid-template-columns: 1fr; }
  .ce-explain { min-height: 0; }
  .ce-badge { white-space: normal; }
  .ce-scope canvas { height: 120px; }
  .ce-related ul { columns: 1; }
  .ce-topnav { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ================= index page (circuits.html) ================= */
.ci-hero { max-width: 760px; margin: 18px 0 22px; }
.ci-hero h1 { font-size: clamp(28px, 4.4vw, 42px); line-height: 1.1; margin: 8px 0 8px; }
.ci-search { position: relative; margin-top: 18px; }
.ci-search input {
  width: 100%; padding: 14px 52px 14px 44px; border-radius: 14px; border: 1px solid #394c69;
  background: #0d1422; color: var(--ce-text); font-size: 17px;
}
.ci-search input::placeholder { color: #6f819b; }
.ci-search input:focus { outline: none; border-color: var(--ce-cyan); box-shadow: 0 0 0 3px #52d7e833; }
.ci-search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-52%); color: var(--ce-muted); font-size: 20px; pointer-events: none; }
.ci-search kbd { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); border: 1px solid #394c69; border-radius: 6px; padding: 1px 7px; font-size: 12px; color: var(--ce-muted); font-family: inherit; }
.ci-under { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; min-height: 30px; }
.ci-continue { border: 1px solid #2f6670; background: #11303a; color: #bff3f9; border-radius: 999px; padding: 5px 12px; font-size: 14px; text-decoration: none; }
.ci-continue:hover { background: #164150; }
.ci-progress { color: #8091a8; font-size: 13px; }

.ci-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-bottom: 1px solid var(--ce-line); margin-bottom: 18px; }
.ci-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.ci-tab { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--ce-muted); padding: 10px 14px; cursor: pointer; white-space: nowrap; font-weight: 600; }
.ci-tab span { font-size: 12px; color: #6f819b; font-weight: 400; margin-left: 2px; }
.ci-tab[aria-selected="true"] { color: var(--ce-text); border-bottom-color: var(--ce-cyan); }
.ci-tab:hover { color: var(--ce-text); }
.ci-filters { position: relative; font-size: 14px; }
.ci-filters summary { cursor: pointer; list-style: none; border: 1px solid #394c69; border-radius: 9px; padding: 6px 12px; color: var(--ce-muted); margin-bottom: 6px; }
.ci-filters summary::-webkit-details-marker { display: none; }
.ci-filters[open] summary { color: var(--ce-text); }
.ci-filter-body { position: absolute; right: 0; z-index: 5; display: grid; gap: 10px; min-width: 230px; padding: 12px; background: #131d2f; border: 1px solid #394c69; border-radius: 12px; box-shadow: 0 12px 30px #0007; color: #c6d4e8; }
.ci-filter-body label { display: flex; gap: 8px; align-items: center; }
.ci-filter-body select { flex: 1; background: #0d1422; color: var(--ce-text); border: 1px solid #394c69; border-radius: 8px; padding: 5px 8px; }

.ci-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 22px; align-items: start; }
.ci-sections { position: sticky; top: 12px; display: grid; gap: 4px; max-height: calc(100vh - 24px); overflow-y: auto; }
.ci-sec { display: flex; gap: 10px; padding: 9px 10px; border-radius: 12px; text-decoration: none; color: #c6d4e8; border: 1px solid transparent; }
.ci-sec:hover { background: #131d2f; }
.ci-sec.on { background: #16233a; border-color: #2f4566; color: var(--ce-text); }
.ci-sec-n { flex: none; width: 26px; height: 26px; border-radius: 8px; background: #1d2a41; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ce-cyan); }
.ci-sec-body strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.ci-sec-body small { display: block; color: #7f90a8; font-size: 12px; margin-top: 2px; }

.ci-view-head h2 { font-size: 26px; margin: 4px 0 2px; }
.ci-group { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #9fb1c8; margin: 24px 0 10px; }
.ci-view-head + .ci-grid { margin-top: 16px; }
.ci-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ci-card { display: flex; flex-direction: column; border: 1px solid var(--ce-line); border-radius: 14px; overflow: hidden; background: linear-gradient(145deg, #151f33, #101827); color: var(--ce-text); text-decoration: none; transition: border-color .15s, transform .15s; }
a.ci-card:hover, .ci-card.active { border-color: var(--ce-cyan); transform: translateY(-2px); }
.ci-card.active { box-shadow: 0 0 0 2px #52d7e855; }
.ci-card.is-planned { opacity: .62; }
.ci-thumb { aspect-ratio: 2 / 1; background: #0d1422 repeating-linear-gradient(0deg, transparent 0 19px, #ffffff06 19px 20px), repeating-linear-gradient(90deg, transparent 0 19px, #ffffff06 19px 20px); display: grid; place-items: center; border-bottom: 1px solid #222e44; }
.ci-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ci-thumb-planned { width: 34%; fill: none; stroke: #3e4f6a; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ci-thumb-planned circle { fill: #3e4f6a; stroke: none; }
.ci-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.ci-n { color: var(--ce-cyan); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ci-card h3 { font-size: 15px; line-height: 1.3; margin: 0; font-weight: 600; }
.ci-card p { margin: 0; font-size: 13px; color: var(--ce-muted); }
.ci-card mark { background: #ffbd5940; color: inherit; border-radius: 3px; padding: 0 1px; }
.ci-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.ci-badges > span { font-size: 11px; border-radius: 999px; padding: 2px 8px; border: 1px solid #394c69; color: #b6c4d8; }
.ci-level.ci-beginner { border-color: #2f6e50; color: #9be9be; }
.ci-level.ci-intermediate { border-color: #7a6233; color: #ffd28c; }
.ci-level.ci-advanced { border-color: #6b4f86; color: #d8c4ff; }
.ci-badges .ci-badge { border-color: #2f6670; color: #a6edf5; }
.ci-badges .ci-seen { border-color: #2f6e50; color: var(--ce-green); }
.ci-badges .ci-soon { border-style: dashed; color: #8091a8; }
.ci-next { display: inline-block; margin-top: 26px; padding: 10px 16px; border-radius: 12px; border: 1px solid #394c69; background: #1d2a41; color: var(--ce-text); text-decoration: none; }
.ci-next:hover { background: #293a57; }
.ci-empty, .ci-count { color: #c6d4e8; }
.ci-count { font-size: 15px; margin: 0 0 4px; }
.ci-link { background: none; border: 0; padding: 0; color: var(--ce-cyan); cursor: pointer; text-decoration: underline; }
.ci-results { margin-top: 4px; color: #c6d4e8; }
.ci-searching .ci-layout { display: none; }

@media (max-width: 850px) {
  .ci-layout { grid-template-columns: 1fr; gap: 14px; }
  .ci-sections { position: static; display: flex; overflow-x: auto; max-height: none; gap: 6px; padding-bottom: 6px; scrollbar-width: thin; }
  .ci-sec { flex: none; max-width: 230px; border-color: #2a3850; padding: 7px 10px; }
  .ci-sec-body small { display: none; }
  .ci-bar { position: sticky; top: 0; z-index: 4; background: var(--ce-bg); }
  .ci-search input { font-size: 16px; }
  .ci-search kbd { display: none; }
}

/* ================= rating, feedback, notices ================= */
.ce-feedback { margin-top: 18px; padding: 18px 20px; border: 1px solid var(--ce-line); border-radius: var(--ce-radius); background: #10182a; }
.ce-rate { border: 0; margin: 0; padding: 0; }
.ce-rate legend { font-size: 16px; font-weight: 600; padding: 0; margin-bottom: 6px; }
.ce-stars { display: inline-flex; gap: 2px; }
.ce-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ce-stars label { font-size: 32px; line-height: 1; color: #3a4860; cursor: pointer; padding: 4px; transition: color .1s, transform .1s; }
.ce-stars label.on { color: var(--ce-amber); }
.ce-stars label:hover { transform: scale(1.12); }
.ce-stars input:focus-visible + label { outline: 2px solid var(--ce-cyan); outline-offset: 2px; border-radius: 6px; }
.ce-rated { margin: 4px 0 0; min-height: 1.4em; color: var(--ce-muted); font-size: 14px; }
.ce-fb { margin-top: 10px; }
.ce-fb summary { cursor: pointer; color: var(--ce-cyan); font-size: 15px; }
.ce-fb form { display: grid; gap: 8px; margin-top: 12px; max-width: 680px; }
.ce-fb form p { margin: 0; color: #c6d4e8; }
.ce-fb label { font-size: 13px; color: var(--ce-muted); }
.ce-fb label small { font-size: 12px; color: #6f819b; }
.ce-fb textarea, .ce-fb input[type="text"], .ce-fb input[type="email"] {
  width: 100%; background: #0d1422; color: var(--ce-text); border: 1px solid #394c69; border-radius: 10px; padding: 9px 11px; font-size: 16px; margin-top: 4px;
}
.ce-fb textarea:focus, .ce-fb input:focus { outline: none; border-color: var(--ce-cyan); }
.ce-fb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ce-fb-turnstile { min-height: 65px; }
.ce-fb button { justify-self: start; border: 1px solid #3a4b67; background: #2b3f5f; color: var(--ce-text); border-radius: 10px; padding: 9px 16px; cursor: pointer; }
.ce-fb button:hover { background: #35507a; }
.ce-fb button:disabled { opacity: .6; cursor: wait; }
.ce-fb-status { min-height: 1.4em; font-size: 14px; }
.ce-fb-status.ok { color: var(--ce-green); }
.ce-fb-status.err { color: var(--ce-red); }
.ce-notice { margin-top: 18px; padding: 14px 18px; border-left: 3px solid var(--ce-red); background: #1a1f2e; border-radius: 0 12px 12px 0; font-size: 13px; color: #b8c5d8; }
.ce-notice p { margin: 0 0 8px; }
.ce-notice p:last-child { margin: 0; }
.ce-notice strong { color: var(--ce-text); }
.ce-notice-short { max-width: 760px; margin: 0 auto 12px; font-size: 12px; color: #7f90a8; }

/* ================= screen sizes ================= */
@media (max-width: 600px) {
  .ci-grid { grid-template-columns: 1fr; }
  .ci-card { flex-direction: row; }
  .ci-thumb { width: 116px; flex: none; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid #222e44; }
  .ci-card p { display: none; }
  .ce-fb-row { grid-template-columns: 1fr; }
  .ce-explain { padding: 18px 16px; }
  .ce-explain h2 { font-size: 22px; }
  .ce-body { font-size: 16px; min-height: 0; }
  .ce-schem { padding: 10px 8px; }
  .ce-top { flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; padding-bottom: 6px; }
  .ce-crumbs { order: 3; width: 100%; font-size: 13px; gap: 5px; }
  .ce-topnav { margin-left: auto; }
  .ce-arrow, .ce-all { padding: 5px 10px; font-size: 14px; }
  /* schematic text stays readable when the drawing shrinks to phone width */
  .ce-svg .ce-label { font-size: 17px; }
  .ce-svg .ce-tiny { display: none; }
  .ce-svg .ce-reading { font-size: 19px; } /* small annotations collide at phone size; the step text covers them */
  /* step controls stay reachable while reading a long step on a phone */
  .ce-controls { position: sticky; bottom: 0; z-index: 3; background: #111a2b; margin: 12px -16px 0; padding: 10px 16px; border-top: 1px solid var(--ce-line); }
}
@media (pointer: coarse) {
  .ce-controls button, .ce-controls2 button, .ce-explore button, .ce-speed button, .ce-arrow, .ce-all, .ci-tab, .ci-filters summary, .ce-fb button { min-height: 44px; }
  .ce-dot { width: 28px; height: 28px; border-width: 8px; }
  .ce-stars label { font-size: 38px; padding: 6px; }
  .ce-toggles label { min-height: 44px; }
}
/* Large screens and TVs: scale everything up instead of leaving a narrow strip. */
@media (min-width: 1700px) { body.ce-page { zoom: 1.2; } }
@media (min-width: 2300px) { body.ce-page { zoom: 1.5; } }
@media (min-width: 3200px) { body.ce-page { zoom: 2; } }
