/* CCR Academy - ISA-101 inspired high-performance HMI styling.
   Gray process graphics, color reserved for abnormal states and alarms. */
:root {
  --bg: #15181b; --bg2: #1b1f23; --panel: #20252a; --panel2: #262c32; --line: #333b43; --line2: #414a53;
  --text: #dde3e8; --muted: #8d979f; --dim: #69737b; --equip: #59636c; --equip-fill: #2a3137; --pipe: #4a545d;
  --sp: #8cc4ec; --accent: #f28c28; --accent2: #ffb35c; --ok: #7fcf9a; --good: #57b87a;
  --p1: #ff3b30; --p2: #ff9500; --p3: #ffd60a; --p4: #5ac8fa;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --r: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 13px; }
body { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line2); border-radius: 4px; padding: 6px 8px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--sp); outline-offset: 1px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
a { color: var(--sp); }

/* ---------- App shell ---------- */
#app { display: flex; flex-direction: column; height: 100vh; }
.topnav { display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 16px; background: #0f1113; border-bottom: 1px solid var(--line); flex: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; }
.brand small { font-weight: 500; color: var(--muted); }
.navlinks { display: flex; gap: 2px; margin-left: 8px; }
.navlinks button { background: none; border: 0; padding: 8px 12px; border-radius: 4px; color: var(--muted); font-weight: 500; }
.navlinks button:hover { color: var(--text); background: var(--panel); }
.navlinks button.on { color: var(--text); background: var(--panel2); box-shadow: inset 0 -2px 0 var(--accent); }
.navspacer { flex: 1; }
.whoami { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.whoami:hover { background: var(--panel); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line2); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.whoami .rk { font-size: 11px; color: var(--accent2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel); font-size: 11px; color: var(--muted); white-space: nowrap; }
.chip.warn { color: var(--p2); border-color: #6b4a1e; }
.chip.bad { color: #fff; background: var(--p1); border-color: var(--p1); }
.chip.good { color: var(--ok); border-color: #2f5d40; }
.view { flex: 1; overflow: auto; }
.page { max-width: 1280px; margin: 0 auto; padding: 24px 20px 60px; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 17px; } h3 { font-size: 14px; }
.sub { color: var(--muted); margin-top: 4px; }
.row { display: flex; gap: 16px; }
.grid { display: grid; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.card h3 { margin-bottom: 10px; }
.btn { background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; padding: 8px 14px; font-weight: 600; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1006; }
.btn.primary:hover { background: var(--accent2); }
.btn.danger { background: #3a1614; border-color: #7a2a24; color: #ffb4ad; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.ghost { background: none; }
.btn:disabled { opacity: .45; cursor: default; }
.kbd { font-family: var(--mono); font-size: 10px; border: 1px solid var(--line2); border-radius: 3px; padding: 0 4px; color: var(--muted); }
.empty { color: var(--muted); padding: 24px; text-align: center; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px; border-bottom: 1px solid #262c31; }
.tbl tr.click:hover td { background: var(--panel2); cursor: pointer; }
.grade { display: inline-grid; place-items: center; width: 26px; height: 22px; border-radius: 4px; font-weight: 800; font-size: 12px; font-family: var(--mono); }
.g-A { background: #1f4a31; color: #9ff0bd; } .g-B { background: #274259; color: #a8d6ff; } .g-C { background: #4a4420; color: #f7e38a; }
.g-D { background: #4c3218; color: #ffc27a; } .g-F { background: #4d1c19; color: #ffaaa3; } .g-none { background: #262c31; color: var(--dim); }
.pips { display: inline-flex; gap: 2px; } .pips i { width: 6px; height: 10px; border-radius: 1px; background: var(--line2); } .pips i.on { background: var(--accent); }
.tag { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; padding: 2px 6px; border-radius: 3px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.tag.safety { color: #ffb4ad; border-color: #5c2622; background: #2a1514; }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 16px; }
.hero-main { position: relative; overflow: hidden; background: radial-gradient(1200px 300px at 90% -10%, rgba(242,140,40,.22), transparent 60%), linear-gradient(180deg, #22272c, #1c2025); border: 1px solid var(--line); border-radius: 12px; padding: 28px; min-height: 230px; }
.hero-main h1 { font-size: 30px; line-height: 1.15; max-width: 560px; }
.hero-main p { color: #b9c2c9; max-width: 540px; line-height: 1.55; font-size: 14px; }
.hero-kiln { position: absolute; right: -30px; bottom: -10px; width: 380px; opacity: .55; pointer-events: none; }
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.stat b { display: block; font-family: var(--mono); font-size: 20px; }
.stat span { color: var(--muted); font-size: 11px; }
.xpbar { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; transition: width .8s ease; }
.rec { display: flex; gap: 14px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.rec .code { font-family: var(--mono); font-weight: 700; color: var(--accent2); font-size: 16px; min-width: 48px; }

/* ---------- Library ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; align-items: center; }
.fchip { background: var(--panel); border: 1px solid var(--line2); border-radius: 999px; padding: 5px 12px; color: var(--muted); font-size: 12px; }
.fchip.on { color: var(--text); border-color: var(--accent); background: #2b2217; }
.drills { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.drill { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, transform .15s; }
.drill:hover { border-color: var(--line2); transform: translateY(-1px); }
.drill .top { display: flex; align-items: center; gap: 8px; }
.drill .code { font-family: var(--mono); font-weight: 700; color: var(--accent2); }
.drill .ttl { font-weight: 600; font-size: 14px; }
.drill p { margin: 0; color: var(--muted); line-height: 1.45; font-size: 12px; flex: 1; }
.drill .meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.area-ico { width: 22px; height: 22px; color: var(--muted); }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5,7,9,.72); display: grid; place-items: center; z-index: 50; backdrop-filter: blur(2px); }
.modal { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.modal h2 { margin-bottom: 6px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.brief { background: var(--bg2); border-left: 3px solid var(--accent); padding: 12px 14px; border-radius: 4px; line-height: 1.55; margin: 12px 0; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Control room ---------- */
.cr { display: grid; grid-template-rows: auto auto auto 1fr; height: 100%; }
.crbar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--bg2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.crbar .scn { font-weight: 700; }
.crbar .scn .code { font-family: var(--mono); color: var(--accent2); margin-right: 6px; }
.clock { font-family: var(--mono); font-size: 18px; font-weight: 600; letter-spacing: .5px; }
.clock small { color: var(--muted); font-size: 12px; }
.tbar { height: 4px; width: 140px; background: var(--line); border-radius: 2px; overflow: hidden; }
.tbar i { display: block; height: 100%; background: var(--sp); }
.speed { display: inline-flex; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; }
.speed button { background: var(--panel); border: 0; padding: 5px 9px; font-family: var(--mono); font-size: 12px; color: var(--muted); border-right: 1px solid var(--line2); }
.speed button:last-child { border-right: 0; }
.speed button.on { background: var(--panel2); color: var(--text); box-shadow: inset 0 -2px 0 var(--sp); }
.alarmbar { display: flex; align-items: stretch; gap: 8px; padding: 6px 14px; background: #121416; border-bottom: 1px solid var(--line); min-height: 40px; }
.alarmlist { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow: hidden; max-height: 84px; overflow-y: auto; }
.alm { display: grid; grid-template-columns: 58px 24px 1fr auto auto; gap: 8px; align-items: center; padding: 2px 6px; border-radius: 3px; font-size: 12px; cursor: pointer; }
.alm .pri { font-family: var(--mono); font-weight: 700; font-size: 10px; text-align: center; border-radius: 2px; color: #111; }
.alm .t { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.alm .v { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.alm.cleared .txt { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.2); }
.alm .shelve { background: none; border: 1px solid var(--line2); border-radius: 3px; padding: 0 5px; font-size: 10px; color: var(--muted); }
.pri1 { background: var(--p1); } .pri2 { background: var(--p2); } .pri3 { background: var(--p3); } .pri4 { background: var(--p4); }
.alm.unack.p1 { animation: flashR 1s steps(1) infinite; } .alm.unack.p2 { animation: flashO 1s steps(1) infinite; }
.alm.unack.p3 { animation: flashY 1s steps(1) infinite; } .alm.unack.p4 { animation: flashC 1s steps(1) infinite; }
@keyframes flashR { 50% { background: rgba(255,59,48,.28); } } @keyframes flashO { 50% { background: rgba(255,149,0,.24); } }
@keyframes flashY { 50% { background: rgba(255,214,10,.18); } } @keyframes flashC { 50% { background: rgba(90,200,250,.18); } }
.alarmctl { display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.flood { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.flood.on { color: var(--p2); font-weight: 700; }
.noalarm { color: var(--dim); font-size: 12px; display: flex; align-items: center; }

.kpis { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.kpi { background: var(--bg2); padding: 6px 10px; min-width: 0; }
.kpi .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-family: var(--mono); font-size: 16px; font-weight: 600; white-space: nowrap; }
.kpi .v small { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.kpi .d { font-size: 10px; font-family: var(--mono); color: var(--dim); }
.kpi.alarm .v { color: var(--p2); } .kpi.crit .v { color: var(--p1); }
.kpi.person .v { font-family: var(--sans); font-size: 12px; font-weight: 600; }
.kpi.person.hazard { background: #3a1614; } .kpi.person.hazard .v { color: #ffb4ad; }

.crmain { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: 0; }
.crleft { display: grid; grid-template-rows: minmax(260px, 1.25fr) minmax(200px, 1fr); min-height: 0; border-right: 1px solid var(--line); }
.mimicwrap { position: relative; min-height: 0; background: #1a1d20; border-bottom: 1px solid var(--line); }
.mimicwrap svg { width: 100%; height: 100%; display: block; }
.trendwrap { display: grid; grid-template-rows: auto 1fr; min-height: 0; background: var(--bg2); }
.trendtabs { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.trendtabs button { background: none; border: 1px solid transparent; border-radius: 4px; padding: 3px 9px; color: var(--muted); font-size: 12px; }
.trendtabs button.on { border-color: var(--line2); color: var(--text); background: var(--panel); }
.trendtabs .sp { flex: 1; }
.trendbody { display: grid; grid-template-columns: 1fr 170px; min-height: 0; }
.trendcv { position: relative; min-height: 0; min-width: 0; }
.trendcv canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.legend { border-left: 1px solid var(--line); padding: 6px 8px; overflow: auto; font-size: 11px; }
.legend .li { display: grid; grid-template-columns: 10px 1fr auto; gap: 6px; align-items: center; padding: 3px 0; cursor: pointer; }
.legend .li.off { opacity: .35; }
.legend .sw { width: 10px; height: 3px; border-radius: 2px; }
.legend .val { font-family: var(--mono); color: var(--text); }
.legend .rng { grid-column: 2 / 4; color: var(--dim); font-family: var(--mono); font-size: 10px; margin-top: -2px; }

.crright { display: grid; grid-template-rows: auto auto 1fr minmax(150px, 34%); min-height: 0; background: var(--panel); }
.rtabs { display: flex; border-bottom: 1px solid var(--line); }
.rtabs button { flex: 1; background: none; border: 0; padding: 10px 4px; color: var(--muted); font-weight: 600; font-size: 12px; border-bottom: 2px solid transparent; position: relative; }
.rtabs button.on { color: var(--text); border-bottom-color: var(--sp); }
.rtabs .badge { position: absolute; top: 5px; right: 8px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: #111; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
.rbody { overflow: auto; padding: 10px 12px; min-height: 0; }
.grp { margin-bottom: 12px; }
.grp h4 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.grp.flash h4 { color: var(--sp); }
.fp { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 5px; background: var(--bg2); }
.fp.moved { border-color: #3d5a73; }
.fp .nm { font-weight: 600; font-size: 12px; }
.fp .pv { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.fp .pv b { color: var(--text); font-weight: 600; }
.fp .ctl { grid-column: 1 / 3; display: grid; grid-template-columns: 28px 28px 1fr 28px 28px 74px; gap: 4px; align-items: center; margin-top: 4px; }
.fp .ctl button { background: var(--panel2); border: 1px solid var(--line2); border-radius: 4px; height: 24px; font-family: var(--mono); font-size: 11px; padding: 0; }
.fp .ctl button:hover { border-color: var(--sp); color: var(--sp); }
.fp input[type=range] { width: 100%; accent-color: var(--sp); height: 4px; }
.fp input.spin { width: 74px; padding: 3px 5px; font-family: var(--mono); font-size: 12px; text-align: right; color: var(--sp); }
.fp .bar { grid-column: 1 / 3; height: 3px; background: var(--line); border-radius: 2px; position: relative; margin-top: 2px; }
.fp .bar i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--equip); border-radius: 2px; }
.fp .bar u { position: absolute; top: -2px; width: 2px; height: 7px; background: var(--sp); }
.eqrow { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 5px; background: var(--bg2); }
.eqrow .led { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--equip); }
.eqrow .led.run { background: var(--text); border-color: var(--text); }
.eqrow .led.trip { background: var(--p1); border-color: var(--p1); animation: flashR 1s steps(1) infinite; }
.eqrow .st { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.modesel { display: flex; gap: 4px; margin-top: 4px; }
.modesel button { flex: 1; background: var(--panel2); border: 1px solid var(--line2); border-radius: 4px; padding: 5px; font-size: 11px; color: var(--muted); }
.modesel button.on { color: var(--sp); border-color: var(--sp); }
.act { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-bottom: 5px; font-size: 12px; }
.act:hover { border-color: var(--line2); }
.act.done { border-color: #2f4a5c; }
.act .ico { width: 16px; height: 16px; flex: none; color: var(--muted); }
.act.priority { border-color: #6b3a1c; background: #2a1c12; }
.act .cd { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--dim); }
.person-loc { font-size: 12px; padding: 8px 10px; border-radius: 6px; background: var(--bg2); border: 1px solid var(--line); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.person-loc.hazard { border-color: var(--p1); background: #2a1514; color: #ffb4ad; }
.diaglist { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.diaglist button { background: var(--bg2); border: 1px solid var(--line); border-radius: 5px; padding: 7px 8px; text-align: left; font-size: 11.5px; line-height: 1.25; }
.diaglist button:hover { border-color: var(--sp); }
.diaglist button.sel { border-color: var(--sp); color: var(--sp); background: #1c2a36; }
.hintbox { background: #1c2a36; border: 1px solid #2d4a60; border-radius: 6px; padding: 10px; line-height: 1.45; margin: 8px 0; font-size: 12px; }
.coachans { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 10px; line-height: 1.5; white-space: pre-wrap; font-size: 12px; margin-top: 8px; }

.log { border-top: 1px solid var(--line); overflow: auto; padding: 6px 10px; font-size: 12px; background: #1a1e22; min-height: 0; }
.log .ln { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 3px 0; border-bottom: 1px dashed #262c31; line-height: 1.4; }
.log .ln .t { font-family: var(--mono); color: var(--dim); font-size: 11px; }
.log .ln.radio .x { color: var(--sp); } .log .ln.field .x, .log .ln.reply .x { color: #cfe6f7; }
.log .ln.lab .x { color: #b9f0c8; } .log .ln.trip .x, .log .ln.alarm .x { color: var(--p2); }
.log .ln.gate .x { color: #fff; background: var(--p1); padding: 2px 6px; border-radius: 3px; font-weight: 700; }
.log .ln.fail .x { color: var(--p1); font-weight: 700; } .log .ln.success .x { color: var(--ok); font-weight: 600; }
.log .ln.deny .x, .log .ln.warn .x { color: var(--p3); } .log .ln.hint .x { color: var(--accent2); }
.log .ln.brief .x { color: var(--text); font-weight: 500; } .log .ln.lever .x, .log .ln.equip .x, .log .ln.mode .x { color: var(--muted); }
.log .ln.coach { display: none; } .log .ln.ack { display: none; }

/* mimic svg */
.m-eq { fill: var(--equip-fill); stroke: var(--equip); stroke-width: 1.5; }
.m-eq.run { fill: #39424a; }
.m-eq.off { fill: none; stroke-dasharray: 4 3; }
.m-eq.trip { stroke: var(--p1); animation: strokeflash 1s steps(1) infinite; }
@keyframes strokeflash { 50% { stroke: #5a1a16; } }
.m-pipe { fill: none; stroke: var(--pipe); stroke-width: 3; stroke-linejoin: round; }
.m-pipe.gas { stroke: #3f4a54; stroke-width: 6; }
.m-pipe.meal { stroke: #5d5648; stroke-width: 2.5; }
.m-flow { fill: none; stroke: #7d8891; stroke-width: 1.5; stroke-dasharray: 3 9; animation: flow 1.2s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -12; } }
.m-lbl { fill: var(--muted); font-size: 10px; font-family: var(--sans); text-transform: uppercase; letter-spacing: .06em; }
.m-lbl.big { font-size: 11px; font-weight: 600; fill: #9aa4ac; }
.m-tag rect { fill: #121416; stroke: #2b3238; rx: 2; }
.m-tag text.v { fill: #e8edf1; font-family: var(--mono); font-size: 11px; font-weight: 600; }
.m-tag text.u { fill: var(--dim); font-family: var(--mono); font-size: 9px; }
.m-tag text.n { fill: var(--dim); font-family: var(--sans); font-size: 8.5px; text-transform: uppercase; letter-spacing: .04em; }
.m-tag.a1 rect { stroke: var(--p1); fill: #3a1311; } .m-tag.a2 rect { stroke: var(--p2); fill: #33210c; } .m-tag.a3 rect { stroke: var(--p3); fill: #2d2a0e; } .m-tag.a4 rect { stroke: var(--p4); }
.m-tag.a1.un rect { animation: tagflashR 1s steps(1) infinite; } .m-tag.a2.un rect { animation: tagflashO 1s steps(1) infinite; }
@keyframes tagflashR { 50% { fill: #121416; } } @keyframes tagflashO { 50% { fill: #121416; } }
.m-hot { transition: opacity .5s; }
.m-click { cursor: pointer; }
.m-click:hover .m-eq { stroke: var(--sp); }
.m-person { transition: transform .8s ease; }

/* ---------- Debrief ---------- */
.deb-head { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.bigrade { width: 110px; height: 110px; border-radius: 16px; display: grid; place-items: center; font-size: 64px; font-weight: 800; font-family: var(--mono); }
.axes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.axis { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.axis .top { display: flex; justify-content: space-between; align-items: baseline; }
.axis b { font-family: var(--mono); font-size: 22px; }
.axis .meter { height: 6px; border-radius: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.axis .meter i { display: block; height: 100%; border-radius: 3px; transition: width 1s ease; }
.gatebox { background: #2a1514; border: 1px solid #7a2a24; color: #ffc8c2; border-radius: 8px; padding: 12px 14px; margin-top: 14px; line-height: 1.5; }
.gatebox b { color: #fff; }
.find { display: grid; grid-template-columns: 48px 22px 1fr auto; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px solid #262c31; }
.find .t { font-family: var(--mono); color: var(--dim); font-size: 11px; padding-top: 2px; }
.find .k { width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.find .k.ideal { background: #1f4a31; color: #9ff0bd; } .find .k.decoy { background: #4c3218; color: #ffc27a; } .find .k.gate { background: var(--p1); color: #fff; }
.find .k.missing { background: #4d1c19; color: #ffaaa3; } .find .k.info { background: var(--panel2); color: var(--muted); }
.find .pts { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.coachcard { background: linear-gradient(180deg, #1f2a33, #1d2328); border: 1px solid #2d4a60; }
.coachcard .body { line-height: 1.6; white-space: pre-wrap; font-size: 13.5px; }
.typing { display: inline-flex; gap: 3px; } .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--sp); animation: dot 1s infinite; } .typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { opacity: .2; } }
.xpgain { font-family: var(--mono); font-size: 28px; font-weight: 800; color: var(--accent2); }
.rankup { animation: pop .8s ease; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); } }
.replay { height: 240px; }
.idealbox ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.6; color: #c9d1d7; }

/* ---------- Career / instructor ---------- */
.ladder { display: flex; gap: 4px; margin-top: 10px; }
.ladder div { flex: 1; text-align: center; font-size: 10px; color: var(--dim); padding: 8px 2px; border-radius: 4px; background: var(--bg2); border: 1px solid var(--line); line-height: 1.25; }
.ladder div.done { color: var(--muted); border-color: #4a3a26; }
.ladder div.cur { color: #1a1006; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.heat td.cell { text-align: center; padding: 4px; }
.heat .grade { width: 30px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid #262c31; }
.checklist .ck { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line2); display: grid; place-items: center; font-size: 11px; }
.checklist .ck.on { background: var(--good); border-color: var(--good); color: #0b1a10; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line2); padding: 10px 16px; border-radius: 8px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: 90vw; }
.toast.bad { border-color: var(--p1); }
.overlay-msg { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10,12,14,.72); z-index: 5; }
.overlay-msg .box { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 22px 26px; text-align: center; max-width: 440px; }

/* certificate (print) */
.cert { display: none; }
@media print {
  body * { visibility: hidden; }
  .cert, .cert * { visibility: visible; }
  .cert { display: block; position: fixed; inset: 0; background: #fff; color: #111; padding: 60px; font-family: Georgia, serif; }
}

@media (max-width: 1180px) {
  .crmain { grid-template-columns: minmax(0, 1fr) 330px; }
  .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  .grid { grid-template-columns: 1fr !important; }
  .navlinks { overflow-x: auto; margin-left: 0; }
  #dbchip, .hero-kiln { display: none; }
  .topnav { gap: 8px; padding: 0 10px; }
  .brand span { display: none; }
  .page { padding: 16px 14px 60px; }
  .hero-main h1 { font-size: 24px; }
  #app { height: auto; min-height: 100vh; }
  .navlinks button { padding: 8px 8px; }
  .brand small { display: none; }
  .cr { height: auto; }
  .crmain { grid-template-columns: 1fr; }
  .crleft { grid-template-rows: auto 280px; border-right: 0; }
  .mimicwrap { overflow-x: auto; }
  .mimicwrap svg { width: 900px; height: 396px; }
  .crright { grid-template-rows: auto auto 480px 260px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .statgrid { grid-template-columns: repeat(2, 1fr); }
  .axes { grid-template-columns: 1fr; }
  .deb-head { grid-template-columns: 1fr; }
  .trendbody { grid-template-columns: 1fr; } .legend { display: none; }
  .trendcv { min-height: 200px; }
  .whoami .nm { display: none; }
}

/* ---------- Top-bar sound + full screen ---------- */
.navbtn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid transparent; border-radius: 4px; padding: 6px 9px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.navbtn:hover { color: var(--text); border-color: var(--line2); }
.navbtn.off { color: var(--dim); }
.navbtn .ico, .ico { width: 15px; height: 15px; flex: none; }
body.focusmode .topnav { display: none; }
body.focusmode #app { height: 100vh; }
body.focusmode::after { content: 'Focus mode · F to exit'; position: fixed; right: 10px; bottom: 8px; font-size: 11px; color: var(--dim); pointer-events: none; z-index: 5; }
@media (max-width: 900px) { .navbtn span { display: none; } }

/* ---------- Help ---------- */
.helpbtn { position: relative; border-color: rgba(140,196,236,.45) !important; }
.helpbtn b { margin-left: 6px; padding: 1px 6px; border-radius: 9px; background: rgba(255,149,0,.18); color: var(--p2); font-family: var(--mono); font-size: 11px; }
.helpgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.helpcard { border: 1px solid var(--line2); border-radius: 8px; padding: 12px; background: var(--bg2); display: flex; flex-direction: column; gap: 8px; }
.helpcard p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; flex: 1; }
.helpcard textarea { width: 100%; font-size: 12px; }
.hc-top { display: flex; justify-content: space-between; align-items: center; }
.hc-top h3 { margin: 0; font-size: 14px; }
.cost { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--p2); background: rgba(255,149,0,.12); border-radius: 10px; padding: 2px 8px; }
.helpans { margin-top: 12px; padding: 12px 14px; border-left: 3px solid var(--sp); background: rgba(140,196,236,.07); border-radius: 0 6px 6px 0; line-height: 1.5; font-size: 13px; }
.helpans.rec { border-left-color: var(--accent); background: rgba(242,140,40,.08); }
.helpans .why { color: var(--muted); font-size: 12px; margin-top: 4px; }
.helphist { max-height: 170px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.helpitem { display: grid; grid-template-columns: 44px 110px 1fr auto; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 12px; align-items: start; }
.helpitem:last-child { border-bottom: 0; }
.helpitem .t { font-family: var(--mono); color: var(--dim); }
.helpitem .k { color: var(--sp); font-weight: 600; }
.helpitem i { color: var(--muted); font-style: normal; }
.helpitem b { font-family: var(--mono); color: var(--p2); }
.recbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: rgba(242,140,40,.1); border-bottom: 1px solid rgba(242,140,40,.35); font-size: 12px; }
.recbar .lbl { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); flex: none; }
.recbar .txt { flex: 1; line-height: 1.35; }
.recbar .x { background: none; border: 0; color: var(--muted); font-size: 16px; padding: 0 4px; }
.coach-target { outline: 2px solid var(--accent) !important; outline-offset: 2px; animation: coachpulse 1s ease-in-out infinite; border-radius: 4px; }
@keyframes coachpulse { 50% { outline-color: rgba(242,140,40,.25); box-shadow: 0 0 0 6px rgba(242,140,40,.12); } }
.find .k.help { background: rgba(255,149,0,.15); color: var(--p2); }
@media (max-width: 700px) { .helpgrid { grid-template-columns: 1fr; } .helpitem { grid-template-columns: 40px 1fr auto; } .helpitem .k { display: none; } }
.crright > .rtabs { grid-row: 1; } .crright > .recbar { grid-row: 2; } .crright > .rbody { grid-row: 3; } .crright > .log { grid-row: 4; }

.unitchip { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line2); color: var(--text); }

/* Voice coach */
.voicebtn { display: inline-flex; align-items: center; gap: 6px; }
.voicebtn .vdot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.voicebtn .vdot.read { background: var(--sp); }
.voicebtn .vdot.coach { background: var(--good); box-shadow: 0 0 0 3px rgba(87, 184, 122, .18); }
.voicebtn.on { border-color: var(--sp); color: var(--text); }
.talkbtn.on { border-color: var(--good); color: var(--text); background: rgba(87, 184, 122, .12); }
.voicebar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--panel2); font-size: 13px; min-height: 30px; }
.voicebar .vwho { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent2); flex: 0 0 auto; }
.voicebar .vtxt { flex: 1 1 auto; color: var(--text); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.voicebar .vstat { flex: 0 0 auto; color: var(--muted); font-size: 11.5px; }
.voicebar .vask { flex: 1 1 240px; }
.voicebar .vask input { width: 100%; }
.cr.hasvoice { grid-template-rows: auto auto auto auto 1fr; }

/* Alarm response guide */
.recbar.guide { background: rgba(255,59,48,.12); border-bottom-color: rgba(255,59,48,.45); flex-wrap: wrap; }
.recbar.guide.p2 { background: rgba(255,149,0,.12); border-bottom-color: rgba(255,149,0,.45); }
.recbar.guide .lbl { color: var(--p1); } .recbar.guide.p2 .lbl { color: var(--p2); }
.recbar.guide .where { display: block; margin-top: 3px; color: var(--text); }
.guide-target { outline: 2px solid var(--p1) !important; outline-offset: 2px; border-radius: 4px; animation: guidepulse 1s ease-in-out infinite; }
@keyframes guidepulse { 50% { outline-color: rgba(255,59,48,.25); box-shadow: 0 0 0 6px rgba(255,59,48,.14); } }
.rtabs button.tab-pulse { color: var(--text); box-shadow: inset 0 -3px 0 var(--p1); animation: tabpulse 1s ease-in-out infinite; }
@keyframes tabpulse { 50% { background: rgba(255,59,48,.18); } }
.kpi[data-focus] { box-shadow: inset 0 0 0 2px var(--p1); animation: tabpulse 1s ease-in-out infinite; }
.m-tag.m-focus rect { stroke: #ffffff; stroke-width: 2; animation: mfocus 1s ease-in-out infinite; }
@keyframes mfocus { 50% { stroke-opacity: .25; } }
.arptoggle { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* ---------- Modes: test, shift ---------- */
.modechip.test { color: #fff; background: #7a2a24; border-color: #a33a31; font-weight: 700; letter-spacing: .06em; }
.modechip.shift { color: #0f1113; background: var(--sp); border-color: var(--sp); font-weight: 700; }
.tag.modetag.test { color: #ffc8c2; border-color: #7a2a24; background: #2a1514; }
.tag.modetag.shift { color: #cfe6f7; border-color: #2d4a60; background: #1c2a36; }
.testnote { background: #2a1514; border: 1px solid #7a2a24; color: #ffc8c2; border-radius: 6px; padding: 9px 12px; margin: 10px 0; font-size: 12.5px; line-height: 1.45; }
.shiftgoals { display: grid; gap: 6px; }
.shiftgoals div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; font-size: 12px; line-height: 1.4; }
.shiftgoals span { color: var(--muted); }
.drill .meta .btn + .btn { margin-left: 6px; }

/* ---------- Two-person drill ---------- */
.fieldlink { border: 1px dashed var(--line2); border-radius: 8px; padding: 10px; }
.fieldlink.on { border: 1px solid #2d6a47; background: #14231b; }
.flcode { font-family: var(--mono); font-size: 34px; font-weight: 800; letter-spacing: .25em; color: var(--accent2); margin: 6px 0; }
.fltask { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
body.fieldmode .topnav .navlinks, body.fieldmode #unitBtn, body.fieldmode #sndBtn, body.fieldmode #fsBtn, body.fieldmode #dbchip, body.fieldmode .whoami { display: none; }
body.fieldmode .view { overflow: auto; }
.phone { max-width: 480px; margin: 0 auto; padding: 18px 16px 40px; font-size: 15px; }
.phone h1 { font-size: 24px; margin: 0 0 4px; }
.phone .field input { font-size: 20px; padding: 10px; width: 100%; }
.btn.big { width: 100%; padding: 14px; font-size: 17px; margin-top: 10px; }
.phhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.phjob { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.phjob h2 { font-size: 20px; margin: 4px 0 8px; }
.phjob textarea { width: 100%; margin-top: 10px; font-size: 15px; }
.phfind { background: #1c2a36; border: 1px solid #2d4a60; border-radius: 8px; padding: 10px; margin-top: 10px; line-height: 1.45; }
.phidle { color: var(--muted); text-align: center; padding: 26px 10px; border: 1px dashed var(--line2); border-radius: 12px; margin-bottom: 12px; }
.phurgent { background: var(--p1); color: #fff; font-weight: 700; border-radius: 10px; padding: 14px; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; animation: strokeflash 1s steps(1) infinite; }
.phradio { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.phfeed { margin-top: 12px; font-size: 13.5px; line-height: 1.5; }
.phfeed .me { color: var(--sp); }

/* ---------- Screen styles (plant profile) ---------- */
.cr.hmi-dark-blue { --bg: #0f1a26; --bg2: #12202e; --panel: #152536; --panel2: #1b2e42; --line: #284059; --line2: #34506d; --equip: #5f7489; --equip-fill: #1e3043; --pipe: #48617a; background: var(--bg); }
.cr.hmi-dark-blue .alarmbar { background: #0b1520; }
.cr.hmi-dark-blue .mimicwrap { background: #102030; }
.cr.hmi-dark-blue .log { background: #102030; }
.cr.hmi-dark-blue .m-eq.run { fill: #2c4358; }
.cr.hmi-dark-blue .m-tag rect { fill: #0b1622; stroke: #2a3f55; }
.cr.hmi-light { --bg: #bfc3c7; --bg2: #c9cdd1; --panel: #d3d6d9; --panel2: #c3c7cb; --line: #9ea4aa; --line2: #8b9298; --text: #15191c; --muted: #454c52; --dim: #5b6268; --equip: #5d646a; --equip-fill: #b3b8bd; --pipe: #7d848a; --sp: #1f5f95; background: var(--bg); color: var(--text); }
.cr.hmi-light .alarmbar { background: #b3b7bb; }
.cr.hmi-light .mimicwrap { background: #c6cacd; }
.cr.hmi-light .log { background: #cdd0d3; }
.cr.hmi-light .m-eq.run { fill: #9aa1a7; }
.cr.hmi-light .m-lbl.big { fill: #30363b; }
.cr.hmi-light .m-pipe.gas { stroke: #8f969c; }
.cr.hmi-light .m-flow { stroke: #4d5358; }
.cr.hmi-light .m-tag rect { fill: #eceeef; stroke: #8b9298; }
.cr.hmi-light .m-tag text.v { fill: #111; }
.cr.hmi-light .m-tag.a1 rect { fill: #f6c9c5; } .cr.hmi-light .m-tag.a2 rect { fill: #f8dcb8; } .cr.hmi-light .m-tag.a3 rect { fill: #f3eab0; }
.cr.hmi-light .kpi .v, .cr.hmi-light .fp .nm, .cr.hmi-light .clock { color: var(--text); }
.cr.hmi-light .act.priority { background: #e7cdb8; border-color: #b0773f; }
.cr.hmi-light .person-loc.hazard, .cr.hmi-light .kpi.person.hazard { background: #f1c4bf; color: #6d1510; }
.cr.hmi-light .diaglist button.sel, .cr.hmi-light .hintbox { background: #cfe0ee; }
.navlinks button { white-space: nowrap; }
@media (max-width: 1750px) { html[lang=es] .navbtn span { display: none; } }
#dbExp { white-space: nowrap; flex: none; }
.meetbtn.on { background: #1d5a3a; border-color: #2d8a57; color: #e3fbe9; }
.lenrow { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; flex-wrap: wrap; }
.lenrow .modesel { margin-top: 0; flex: 1; min-width: 260px; }
.lenrow .modesel button { font-size: 12px; padding: 6px 8px; }
.lenrow .modesel small { opacity: .7; font-size: 10px; }
.ratiofp .pv { color: var(--muted); }
.calcfp .calcsp { grid-column: 1/3; display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.calcfp .calcsp.dim { opacity: .55; }
.calcfp .calcsp .spin { width: 70px; }
.calcfp .calcsp { display: flex !important; grid-template-columns: none !important; }
.calcfp .calcsp button { flex: none; width: 28px; height: 26px; padding: 0; }
.calcfp .calcsp .spin { flex: 1; width: auto; min-width: 60px; }
.calcfp .calcsp .muted { margin-right: 4px; }
.ramptop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.ramptop div { display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.ramptop b { font-family: var(--mono); font-size: 15px; }
.rampbar { height: 8px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 4px; overflow: hidden; flex: 1; }
.rampbar i { display: block; height: 100%; width: 0; background: var(--sp); transition: width .4s; }
.rampbar.big { height: 12px; } .rampbar.big i { background: var(--ok); }
.ramplist { display: flex; flex-direction: column; gap: 6px; }
.ramprow { display: grid; grid-template-columns: 104px 1fr 42px; align-items: center; gap: 8px; font-size: 11.5px; }
.ramprow b { font-family: var(--mono); text-align: right; }

/* ---------- How to score higher (debrief) ---------- */
.card.improve { margin-top: 16px; }
.improve .imp-sub { font-size: 12px; margin: -2px 0 10px; }
.improve .imp-axis { padding: 10px 0; border-top: 1px solid var(--line); }
.improve .imp-axis:first-of-type { border-top: 0; }
.improve .imp-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; font-size: 14px; }
.improve .imp-head .mono { font-weight: 700; }
.improve .imp-tip, .improve .imp-help { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 8px 10px; margin-bottom: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; }
.improve .imp-pts { font-family: var(--mono); font-weight: 800; font-size: 14px; color: var(--p2); text-align: right; padding-top: 1px; }
.improve .imp-tip.bonus .imp-pts { color: var(--ok); }
.improve .imp-tip.gate { border-color: var(--p1); background: rgba(255, 59, 48, .08); }
.improve .imp-tip.gate .imp-pts { color: var(--p1); }
.improve .imp-help .imp-pts { color: var(--muted); }
.improve .imp-title { font-weight: 600; line-height: 1.4; }
.improve .imp-fact { font-size: 12px; color: var(--muted); margin-top: 2px; }
.improve .imp-fact b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.improve .imp-how { font-size: 12.5px; line-height: 1.5; margin-top: 4px; }
.improve .imp-note { font-size: 11.5px; color: var(--muted); margin: -2px 0 6px; }
.improve .imp-none, .improve .imp-perfect { font-size: 12.5px; color: var(--muted); padding: 4px 0; }
.improve .imp-perfect b { color: var(--ok); }
@media (max-width: 600px) { .improve .imp-tip, .improve .imp-help { grid-template-columns: 40px 1fr; padding: 8px; } }

/* ---------- Hide-controls layout (P) ---------- */
.crleft { position: relative; }
.crmain { position: relative; }
.cr.panel-off .crmain { grid-template-columns: minmax(0, 1fr); }
.cr.panel-off .crleft { border-right: 0; }
@media (min-width: 861px) { .cr.panel-off .crleft { grid-template-rows: minmax(300px, 1.5fr) minmax(200px, 1fr); } }
/* The panel is gone, but the alarm guide / next-move bar still shows, floating over the top right of the graphic. */
.cr.panel-off .crright { position: absolute; top: 8px; right: 8px; width: min(380px, calc(100% - 16px)); display: block; background: none; z-index: 25; pointer-events: none; min-height: 0; }
.cr.panel-off .crright > :not(.recbar) { display: none; }
.cr.panel-off .crright > .recbar { pointer-events: auto; border: 1px solid var(--line2); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.cr.panel-off .crright > .recbar.hidden { display: none; }
#crPanel.on { border-color: var(--sp); color: var(--sp); }
.btn.btn-pulse { box-shadow: inset 0 -3px 0 var(--p1); animation: tabpulse 1s ease-in-out infinite; }

/* ---------- Click zones on the graphic ---------- */
.m-fphot { fill: transparent; stroke: transparent; stroke-width: 1.5; stroke-dasharray: 4 3; cursor: pointer; pointer-events: all; }
.m-fphot:hover { stroke: var(--sp); fill: rgba(140, 196, 236, .07); }
.m-fphot.on { stroke: var(--sp); stroke-dasharray: none; fill: rgba(140, 196, 236, .10); }
.m-fphot.guide { stroke: var(--p1); stroke-width: 2.5; stroke-dasharray: none; fill: rgba(255, 59, 48, .08); animation: mfocus 1s ease-in-out infinite; }

/* ---------- Pop-up faceplate ---------- */
.facepl { position: absolute; z-index: 30; width: 320px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.5); overflow: hidden; }
.facepl .fphead { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; background: var(--panel2); border-bottom: 1px solid var(--line); cursor: move; user-select: none; touch-action: none; }
.facepl .fpt { flex: 1; font-weight: 700; font-size: 12.5px; }
.facepl .fphead button { background: none; border: 1px solid var(--line2); border-radius: 4px; color: var(--muted); font-size: 11px; padding: 2px 8px; cursor: pointer; }
.facepl .fphead button.x { border: 0; font-size: 17px; line-height: 1; padding: 0 5px; }
.facepl .fphead button:hover { color: var(--text); border-color: var(--sp); }
.facepl .fpscroll { overflow: auto; min-height: 0; padding-bottom: 4px; }
.facepl .fppv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 7px 8px 0; }
.facepl .fppv div { background: var(--bg2); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; min-width: 0; }
.facepl .fppv span { display: block; font-size: 9px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facepl .fppv b { font-family: var(--mono); font-size: 12px; font-weight: 600; white-space: nowrap; }
.facepl .fppv div.off { border-color: var(--p2); }
.facepl .fppv div.off b { color: var(--p2); }
.facepl .fpbody, .facepl .fpeq { padding: 7px 8px 0; }
.facepl .fpbody .fp:last-child, .facepl .fpeq .eqrow:last-child { margin-bottom: 0; }
.facepl .hidden { display: none; }
.facepl .fp .ctl { grid-template-columns: 26px 26px minmax(40px, 1fr) 26px 26px 66px; }
.facepl .fp input.spin { width: 66px; }
.fp.fp-pick { border-color: var(--sp); box-shadow: 0 0 0 1px var(--sp); }
.cr.hmi-light .facepl { box-shadow: 0 10px 28px rgba(0,0,0,.25); }

