/* Field Line Mapper: the electrostatic survey desk. Board drawn by art.js (colors from the --flm-* properties below). */
html {
  --flm-wood1: #b8834d; --flm-wood2: #7d4e24; --flm-wood-line: #4f2e12;
  --flm-paper1: #fbfaf4; --flm-paper2: #ebe7d8; --flm-grid: #d6dde3; --flm-grid-m: #aebcc8; --flm-axis: #5b6f80;
  --flm-ink: #1c2733; --flm-text: #1c2733; --flm-model: #0b7a75; --flm-line: #e07b00; --flm-force: #8a2be2;
  --flm-pos: #d23a2c; --flm-pos2: #7d1a12; --flm-neg: #2f6fd0; --flm-neg2: #173f80; --flm-sphere-line: #1b1f24; --flm-brass-line: #6b4c12;
  --flm-tag: rgba(255,255,255,.93); --flm-tag-line: #6b7782; --flm-chip: rgba(255,255,255,.82);
  --flm-panel1: #f4f8f9; --flm-panel2: #e6eef1; --flm-accent: #245e76; --flm-card: #ffffff; --flm-ok: #13704a; --flm-bad: #b3261e;
}
html[data-theme="dark"] {
  --flm-wood1: #7a5330; --flm-wood2: #4f3218; --flm-wood-line: #b88a5c;
  --flm-paper1: #22303a; --flm-paper2: #19232b; --flm-grid: #2e3e4b; --flm-grid-m: #4b6171; --flm-axis: #9fb2c1;
  --flm-ink: #f1f5f8; --flm-text: #e8eef3; --flm-model: #4fd1c5; --flm-line: #ffb84d; --flm-force: #c792ff;
  --flm-pos: #ef5a4b; --flm-pos2: #9a2418; --flm-neg: #5b95ee; --flm-neg2: #234f9a; --flm-sphere-line: #0b0d0f; --flm-brass-line: #3b2a08;
  --flm-tag: rgba(20,28,36,.93); --flm-tag-line: #93a3b1; --flm-chip: rgba(20,28,36,.8);
  --flm-panel1: #1d2730; --flm-panel2: #172028; --flm-accent: #8cc8de; --flm-card: #1f2a33; --flm-ok: #4fd08c; --flm-bad: #ff8a80;
}

/* ── layout ── */
.core.flm { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 12px; padding: 10px;
  overflow: hidden; color: var(--flm-text); font-size: 16px; box-sizing: border-box; }
.flm *, .flm *::before, .flm *::after { box-sizing: border-box; }
.flm .core-bench, .flm .core-panel { min-width: 0; min-height: 0; overflow: auto; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(var(--flm-panel1), var(--flm-panel2)); border: 2px solid var(--flm-accent); box-shadow: 0 3px 8px rgba(0,0,0,.14); }
.flm .core-bench { display: flex; flex-direction: column; gap: 8px; }
.flm-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.flm .core-kicker { margin: 0; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: 16px; color: var(--flm-accent); }
.flm h2 { margin: 0; font-size: 22px; }
.flm h3 { margin: 0 0 6px; font-size: 18px; }
.flm .core-scene { flex: 0 0 auto; overflow: auto; border-radius: 16px; outline-offset: 3px; }
.flm .core-scene svg { display: block; width: 100%; min-width: 460px; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.flm .core-observation { margin: 0; min-height: 3em; line-height: 1.45; font-weight: 600; }
.flm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 16px; }
.flm-lg::before { content: ''; display: inline-block; width: 26px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 3px solid; }
.flm-lg-ink::before { border-color: var(--flm-ink); }
.flm-lg-model::before { border-top-style: dashed; border-color: var(--flm-model); }
.flm-lg-line::before { border-color: var(--flm-line); }

/* ── panel ── */
.flm .core-panel { display: flex; flex-direction: column; gap: 10px; }
.flm-card { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--flm-card); border: 1px solid var(--flm-tag-line); }
.flm-order ul { margin: 0; padding-left: 20px; line-height: 1.45; }
.flm-order li + li { margin-top: 3px; }
.flm-group { min-width: 0; }
.flm-group legend { padding: 0 6px; font-weight: 800; font-size: 17px; color: var(--flm-accent); }
.flm-note { margin: 0 0 8px; line-height: 1.4; font-size: 16px; opacity: .9; }
.flm .core-field { display: grid; gap: 4px; margin: 0 0 10px; font-weight: 600; }
.flm .core-field:last-child { margin-bottom: 0; }
.flm .core-field input, .flm .core-field select, .flm .flm-actions button { font: inherit; font-size: 16px; min-height: 44px; width: 100%; max-width: 100%;
  border-radius: 8px; border: 1px solid var(--flm-tag-line); padding: 8px 10px; background: var(--flm-panel1); color: inherit; }
.flm .core-field input:disabled, .flm .core-field select:disabled { opacity: .7; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(127,127,127,.12) 6px 12px), var(--flm-panel2); }
.flm-arrow-in { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: center; }
.flm-dial svg { display: block; width: 44px; height: 44px; }
.flm-dial-ring { fill: var(--flm-paper1); stroke: var(--flm-tag-line); stroke-width: 1.5; }
.flm-dial-tick { stroke: var(--flm-axis); stroke-width: 1.5; }
.flm-dial-hand { stroke: var(--flm-ink); stroke-width: 3; stroke-linecap: round; }
.flm-dial-pin { fill: var(--flm-ink); }
.flm-actions { display: grid; grid-template-columns: 1.5fr 1fr; gap: 8px; }
.flm .flm-actions button { font-weight: 800; cursor: pointer; }
.flm .core-run { background: var(--flm-accent); color: #fff; border-color: var(--flm-accent); }
html[data-theme="dark"] .flm .core-run { color: #0d1b22; }
.flm .flm-actions button:disabled { opacity: .55; cursor: default; }
html[data-theme="dark"] .flm .core-run:disabled { background: transparent; color: var(--flm-text); border-color: var(--flm-tag-line); }
.is-revealed .flm-dtag { display: none; }
.flm .core-status { margin: 0; line-height: 1.4; }
.flm .core-about summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.flm .core-about p { margin: 0; line-height: 1.45; }
.flm :focus-visible { outline: 3px solid #dd9823; outline-offset: 2px; }

/* ── board ── */
.flm svg .flm-t, .ps svg .flm-t { font: 700 24px system-ui, -apple-system, 'Segoe UI', sans-serif; fill: var(--flm-text); }
.flm svg .flm-t-s, .flm svg .flm-t-tag, .flm svg .flm-t-pin, .ps svg .flm-t-s, .ps svg .flm-t-tag { font-size: 22px; }
.flm svg .flm-t-mark { font-size: 24px; fill: #fff; }
.flm-grid { stroke: var(--flm-grid); stroke-width: 1; }
.flm-grid-m { stroke: var(--flm-grid-m); stroke-width: 1.4; }
.flm-axis { stroke: var(--flm-axis); stroke-width: 2; fill: none; }
.flm-tick { stroke: var(--flm-axis); stroke-width: 1.5; }
.flm-chip { fill: var(--flm-chip); stroke: var(--flm-tag-line); stroke-width: 1; }
.flm-scale { stroke: var(--flm-text); stroke-width: 3; fill: none; }
.flm-tag { fill: var(--flm-tag); stroke: var(--flm-tag-line); stroke-width: 1; }
.flm-halo { color: var(--flm-line); }
.flm-sphere.is-neg .flm-halo { color: var(--flm-neg); }
.flm-sphere.is-pos .flm-halo { color: var(--flm-pos); }
.flm-socket circle { fill: none; stroke: var(--flm-axis); stroke-width: 2.5; stroke-dasharray: 5 5; }
.flm-ink { stroke: var(--flm-ink); stroke-width: 4.5; stroke-linecap: round; fill: none; }
.flm-cross { stroke-width: 3; }
.flm-point { fill: var(--flm-ink); }
.flm-eq { fill: none; stroke: var(--flm-axis); stroke-width: 2.5; stroke-dasharray: 7 7; }
.flm-start { fill: var(--flm-paper1); stroke: var(--flm-axis); stroke-width: 3; }
.flm-handle { cursor: grab; outline: none; }
.flm-handle .flm-hit { fill: transparent; }
.flm-knob { fill: var(--flm-paper1); stroke: var(--flm-ink); stroke-width: 3; }
.flm-handle.is-empty .flm-knob { stroke-dasharray: 3 3; }
.flm-knob-l { stroke: var(--flm-ink); stroke-width: 1.5; stroke-dasharray: 3 3; opacity: .7; }
.is-locked .flm-knob-l { display: none; }
.flm-handle:focus-visible .flm-knob, .flm-handle:focus-visible rect.flm-hit { stroke: #dd9823; stroke-width: 4; }
.flm-handle:focus-visible rect.flm-hit { fill: rgba(221,152,35,.12); }
.is-locked .flm-handle { cursor: default; }
.is-locked .flm-knob { display: none; }
.flm-plate.is-ghost { opacity: .45; }
.flm-plate-h { cursor: ew-resize; }
.flm-gapdim { stroke: var(--flm-axis); stroke-width: 2; stroke-dasharray: 4 4; }
.flm-move { stroke: var(--flm-ink); stroke-width: 3; stroke-dasharray: 6 5; }
/* revealed model (practice, after Check) */
.flm-fl { fill: none; stroke: var(--flm-line); stroke-width: 2.2; opacity: .85; }
.flm-fl-head { stroke: var(--flm-line); stroke-width: 2.2; }
.flm-model { stroke: var(--flm-model); stroke-width: 4; stroke-dasharray: 9 6; stroke-linecap: round; }
.flm-model-pt { fill: none; stroke: var(--flm-model); stroke-width: 4; stroke-dasharray: 6 4; }
.flm-force { stroke: var(--flm-force); stroke-width: 5; stroke-linecap: round; }
.flm-mark circle { stroke: #fff; stroke-width: 2; }
.flm-mark.is-ok circle { fill: var(--flm-ok); }
.flm-mark.is-bad circle { fill: var(--flm-bad); }
.flm-start-lines .flm-fl { opacity: .7; }
.flm-test > circle:first-child { stroke: var(--flm-paper1); stroke-width: 4; paint-order: stroke; }
@media (prefers-reduced-motion: no-preference) {
  .flm-build.is-inked .flm-ink { stroke-dasharray: 120; animation: flm-ink-s .6s ease-out both; }
  .flm-reveal .flm-fl { stroke-dasharray: 900; animation: flm-ink 1.2s ease-out both; }
  .flm.is-cheer .flm-mark.is-ok { animation: flm-pop .45s ease-out both; transform-box: fill-box; transform-origin: center; }
}
@keyframes flm-ink { from { stroke-dashoffset: 900; } to { stroke-dashoffset: 0; } }
@keyframes flm-ink-s { from { stroke-dashoffset: 120; } to { stroke-dashoffset: 0; } }
@keyframes flm-pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* the shell's Start/Done/hint text at 16 px (shell request logged by Immune Defense, 2026-10-21) */
body[data-activity="field-line-mapper"] .ps-kicker, body[data-activity="field-line-mapper"] .ps-hint-note, body[data-activity="field-line-mapper"] .ps-badge { font-size: 16px; }

@media (max-width: 900px) {
  .core.flm { position: static; height: auto; grid-template-columns: 1fr; padding: 8px; overflow: visible; }
  .flm .core-bench, .flm .core-panel { overflow: visible; }
  .flm .core-scene { overflow-x: auto; }
  .flm .core-panel { padding-bottom: 30px; }
}
@media (prefers-reduced-motion: reduce) { .flm * { animation: none !important; transition: none !important; } }
