
  /* ===== v84 design system — dark drilling-console theme (ISA-101 inspired: quiet surfaces, colour = meaning) ===== */
  :root { --bg:#070b10; --bg2:#0a1017; --pan:#0f1720; --pan2:#16212d; --pan3:#1c2937; --line:#1d2a38; --line2:#2b3c4f; --fg:#e8eef5; --mut:#8b9cb1; --dim:#5f7086;
    --amb:#f5a524; --amb2:#ffcf7a; --teal:#2dd4bf; --grn:#34d17a; --red:#ff5a5f; --blu:#4c8dff; --vio:#a78bfa; --tile:#0b131c;
    --r:16px; --r2:12px; --sh:0 1px 0 #ffffff0a inset, 0 12px 32px -12px #000c; --mono:"JetBrains Mono","SFMono-Regular",ui-monospace,Menlo,Consolas,monospace; }
  * { box-sizing:border-box; }
  html,body { margin:0; background:var(--bg); color:var(--fg); font:15px/1.45 "IBM Plex Sans Arabic","Inter","Segoe UI",system-ui,"Noto Sans Arabic",Tahoma,sans-serif; }
  body { background:radial-gradient(1200px 600px at 85% -10%, #10233a 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #0e1d2c 0%, transparent 55%), var(--bg); background-attachment:fixed; }
  button, select, input { font:inherit; color:var(--fg); }
  .sr { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  .ic { display:inline-flex; width:18px; height:18px; flex:none; } .ic svg { width:100%; height:100%; display:block; }
  /* buttons */
  .b, select { background:var(--pan2); border:1px solid var(--line2); border-radius:var(--r2); padding:0 14px; min-height:44px; font-weight:700; font-size:14px; cursor:pointer; transition:background .18s, border-color .18s, transform .08s, box-shadow .18s, opacity .18s; display:inline-flex; align-items:center; justify-content:center; gap:7px; }
  select { appearance:none; -webkit-appearance:none; padding:0 12px; }
  .b:hover:not(:disabled) { background:var(--pan3); border-color:#3d5470; } .b:active:not(:disabled) { transform:translateY(1px); }
  .b:disabled { opacity:.35; cursor:not-allowed; }
  .b:focus-visible, select:focus-visible, input:focus-visible, .tab:focus-visible { outline:2px solid var(--amb); outline-offset:2px; }
  .b.pri { background:linear-gradient(180deg,#ffb83d,#f09a12); color:#1a1205; border-color:#ffb83d; box-shadow:0 6px 18px -6px #f5a52480; }
  .b.pri:hover:not(:disabled) { background:linear-gradient(180deg,#ffc45a,#f5a524); border-color:#ffc45a; }
  .b.red { border-color:#7a2a2e; } .b.on { background:#0f2f22; border-color:var(--grn); color:#cffbe2; }
  .b.done { background:#0d2a1e; border-color:#1f6b45; color:#bff3d6; } .b.done::before { content:"✓"; font-weight:900; color:var(--grn); }
  .b.next:not(:disabled) { border-color:var(--amb); color:#fff; background:linear-gradient(180deg,#2a2210,#1c1709); box-shadow:0 0 0 3px #f5a52433, 0 0 22px -4px #f5a524aa; animation:nextp 1.8s ease-in-out infinite; position:relative; }
  .b.pri.next:not(:disabled) { background:linear-gradient(180deg,#ffb83d,#f09a12); color:#1a1205; }
  .b.next:not(:disabled)::after { content:attr(data-next); position:absolute; top:-9px; inset-inline-end:8px; background:var(--amb); color:#1a1205; font-size:10px; font-weight:900; letter-spacing:.06em; padding:1px 7px; border-radius:999px; line-height:16px; }
  @keyframes nextp { 0%,100% { box-shadow:0 0 0 3px #f5a52433, 0 0 18px -6px #f5a524aa; } 50% { box-shadow:0 0 0 5px #f5a52422, 0 0 26px -2px #f5a524cc; } }
  /* header */
  header.app-h { position:relative; z-index:20; padding:max(10px,env(safe-area-inset-top)) 16px 10px; display:flex; gap:14px; align-items:center; border-bottom:1px solid var(--line); background:linear-gradient(180deg,#0c141dcc,#0a1017e6); backdrop-filter:blur(10px); }
  .brand { display:flex; align-items:center; gap:10px; min-width:0; } .brand-t { min-width:0; }
  header h1 { margin:0; font-size:17px; font-weight:800; letter-spacing:.01em; white-space:nowrap; } header small { color:var(--mut); font-weight:600; font-size:11.5px; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  header .logo { width:36px; height:36px; border-radius:50%; flex:none; box-shadow:0 0 0 1px #f2b63244, 0 4px 14px -4px #f2b63266; }
  .sp { margin-inline-start:auto; display:flex; gap:8px; align-items:center; }
  .hb { min-height:40px; padding:0 12px; font-size:13px; border-radius:11px; background:#121c27; }
  .hb.icon { width:40px; padding:0; }
  .qa-btn { border-color:#6b4d12; background:linear-gradient(180deg,#22190a,#171107); color:var(--amb2); }
  .ops-btn { border-color:#2a4a6e; background:linear-gradient(180deg,#0f1d2e,#0c1622); color:#bcd6ff; }
  .speed { display:inline-flex; align-items:center; gap:4px; background:#121c27; border:1px solid var(--line2); border-radius:11px; padding:0 4px 0 10px; height:40px; color:var(--mut); }
  .speed select { border:0; background:transparent; min-height:36px; padding:0 6px; font:700 13px var(--mono); color:var(--fg); direction:ltr; }
  .modeb { display:inline-flex; align-items:center; gap:6px; background:#0f2f22; border:1px solid #1f6b45; color:#cffbe2; border-radius:999px; padding:4px 12px; font-weight:800; font-size:12.5px; white-space:nowrap; }
  .modeb::before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; box-shadow:0 0 8px currentColor; }
  .modeb.demo { background:#0e1e3d; border-color:#2a4f99; color:#bcd3ff; } .modeb.pro { background:#2a1e07; border-color:#7a5512; color:#ffdc96; }
  /* procedure stepper */
  .stepper { display:none; max-width:1600px; margin:0 auto; padding:10px 16px 0; }
  body.lvrun .stepper { display:block; }
  .st-row { display:flex; align-items:center; gap:0; }
  .st { flex:1 1 0; min-width:0; display:flex; align-items:center; gap:8px; position:relative; color:var(--dim); font-size:12.5px; font-weight:700; }
  .st:not(:last-child)::after { content:""; flex:1 1 auto; height:2px; margin:0 8px; background:var(--line2); border-radius:2px; min-width:8px; }
  .st.done:not(:last-child)::after { background:linear-gradient(90deg,var(--grn),#1f6b45); }
  .st i { flex:none; width:26px; height:26px; border-radius:50%; display:grid; place-items:center; font:800 12px var(--mono); font-style:normal; background:var(--pan2); border:1.5px solid var(--line2); color:var(--mut); transition:all .25s; }
  .st span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .st.done { color:#9fe3bd; } .st.done i { background:#0f2f22; border-color:var(--grn); color:var(--grn); }
  .st.cur { color:#fff; } .st.cur i { background:var(--amb); border-color:var(--amb); color:#1a1205; box-shadow:0 0 0 4px #f5a52430, 0 0 16px #f5a52488; }
  .st-prog { display:none; margin-top:9px; align-items:center; gap:10px; font:700 11.5px var(--mono); color:var(--mut); direction:ltr; }
  .st-prog.on { display:flex; } .st-prog { padding-bottom:10px; }
  .st-bar { position:relative; flex:1; height:8px; background:var(--pan2); border:1px solid var(--line2); border-radius:999px; overflow:visible; }
  .st-bar > b { position:absolute; inset-block:0; left:0; border-radius:999px; background:linear-gradient(90deg,#c97a00,var(--amb)); transition:width .4s; }
  .st-bar > u { position:absolute; top:-4px; bottom:-4px; width:2px; background:var(--teal); text-decoration:none; }
  .st-bar > u::after { content:attr(data-l); position:absolute; top:13px; transform:translateX(-50%); font-size:9.5px; color:var(--teal); white-space:nowrap; }
  .st-prog em { font-style:normal; color:var(--fg); white-space:nowrap; }
  /* KPI tiles */
  .kpis { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; padding:12px 16px 0; max-width:1600px; margin:0 auto; }
  .kpi { position:relative; background:linear-gradient(180deg,#111b26,#0c141d); border:1px solid var(--line); border-radius:14px; padding:9px 12px 8px; min-width:0; overflow:hidden; box-shadow:var(--sh); }
  .kpi::before { content:""; position:absolute; inset-inline-start:0; top:10px; bottom:10px; width:3px; border-radius:3px; background:var(--kc,var(--dim)); }
  .kpi small { display:block; color:var(--mut); font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .kpi b { display:block; font:700 25px/1.15 var(--mono); color:#f4f7fb; direction:ltr; text-align:start; unicode-bidi:plaintext; letter-spacing:-.02em; }
  .kpi i { font-style:normal; font-size:11px; color:var(--dim); font-weight:600; }
  [dir=rtl] .kpi b { text-align:right; }
  #k-spp { --kc:var(--amb); } #k-sidpp { --kc:#ffcf7a; } #k-sicp { --kc:var(--teal); } #k-bhp { --kc:var(--blu); } #k-pit { --kc:var(--vio); } #k-stk { --kc:#9aa9bb; }
  .kpi.warn { border-color:#7a2a2e; background:linear-gradient(180deg,#2a1013,#160a0c); } .kpi.warn b { color:#ff8b8e; } .kpi.warn::before { background:var(--red); box-shadow:0 0 10px var(--red); }
  /* alarm chips — overlay on the well view, only active ones */
  .chips { position:absolute; z-index:3; bottom:10px; left:10px; right:40%; display:flex; flex-direction:column; align-items:flex-start; gap:5px; pointer-events:none; direction:ltr; }
  .chip { display:none; align-items:center; gap:6px; border:1px solid #7a2a2e; border-radius:999px; padding:3px 10px; font-size:11.5px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; color:#ffe1e2; background:#3a1215e6; box-shadow:0 4px 14px -4px #000; backdrop-filter:blur(4px); }
  .chip::before { content:"⚠"; } .chip.on { display:inline-flex; animation:blink 1.2s ease-in-out infinite; } .chip.on.warn { border-color:#8a6212; background:#3a2a08e6; color:#ffe7b3; }
  @keyframes blink { 50% { opacity:.6; } }
  /* main grid */
  main { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(330px,1fr) minmax(250px,.72fr); grid-template-areas:"view ctrl side"; gap:14px; padding:14px 16px; max-width:1600px; margin:0 auto; align-items:start; }
  .c3 > #evalcard { order:-2; } body:not([data-circ]) .c3 > .ctrlcard { order:-1; }
  main > .viewcard { grid-area:view; } main > .c3 { grid-area:ctrl; } main > .c2 { grid-area:side; }
  .card { background:linear-gradient(180deg,#101a24,#0c141c); border:1px solid var(--line); border-radius:var(--r); padding:12px; box-shadow:var(--sh); min-width:0; }
  .col { display:flex; flex-direction:column; gap:14px; min-width:0; }
  h2 { margin:0 0 10px; font-size:11.5px; letter-spacing:.12em; text-transform:uppercase; color:var(--mut); font-weight:800; display:flex; align-items:center; gap:8px; }
  h2::before { content:""; width:6px; height:6px; border-radius:2px; background:var(--amb); }
  /* segmented tabs */
  .tabs { display:flex; gap:4px; margin-bottom:10px; padding:4px; background:#0a1118; border:1px solid var(--line); border-radius:13px; }
  .tab { flex:1; min-height:38px; border-radius:10px; border:0; background:transparent; color:var(--mut); font-weight:700; font-size:13.5px; cursor:pointer; padding:0 8px; transition:background .2s,color .2s; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .tab:hover { color:var(--fg); background:#ffffff08; }
  .tab[aria-selected=true] { background:linear-gradient(180deg,#24364a,#1a2938); color:#fff; box-shadow:0 1px 0 #ffffff14 inset, 0 2px 8px -2px #000; }
  .pane[hidden] { display:none; }
  #viewbox { position:relative; border-radius:12px; overflow:hidden; background:#0a131c; border:1px solid var(--line); }
  #viewbox svg { display:block; width:100%; height:auto; max-height:var(--vavail, calc(100vh - 330px)); min-height:300px; margin:0 auto; }
  #viewbox .pane { animation:fade .25s ease; } @keyframes fade { from { opacity:.3; } to { opacity:1; } }
  /* gauges column */
  #gauges { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .gauge { background:var(--tile); border:1px solid var(--line); border-radius:12px; padding:6px 6px 8px; } .gauge:first-child { grid-column:1 / -1; }
  .gcap { display:flex; justify-content:space-between; gap:4px; padding:0 4px; font-size:11.5px; line-height:1.25; color:#c9d5e3; } .gcap span { color:var(--dim); flex:none; font-family:var(--mono); }
  .ro { display:grid; grid-template-columns:repeat(auto-fill,minmax(104px,1fr)); gap:6px; margin-top:10px; } .ro div { background:var(--tile); border:1px solid var(--line); border-radius:10px; padding:6px 10px; min-width:0; }
  .ro small { display:block; color:var(--dim); font-size:10.5px; letter-spacing:.06em; text-transform:uppercase; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } .ro b { font:700 14.5px var(--mono); direction:ltr; unicode-bidi:plaintext; color:#e6edf5; }
  .sec { margin:0 0 12px; } .sec h2, .sec h3 { margin:0 0 8px; font-size:11.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--amb); font-weight:800; }
  .btnrow { display:flex; flex-wrap:wrap; gap:8px; } .btnrow .b { flex:1 1 140px; }
  .proc { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } .proc .b { min-height:46px; font-size:13.5px; line-height:1.2; padding:4px 10px; } .proc .b:last-child { grid-column:1 / -1; }
  #btn-kill { min-height:52px; font-size:15.5px; }
  .choke { display:flex; flex-wrap:wrap; gap:6px; align-items:center; } .choke .b { flex:1 1 60px; padding:0 8px; } #chokehint { font-weight:800; color:var(--amb); flex:1 1 100%; direction:ltr; min-height:1.4em; }
  .drl-g { display:flex; flex-direction:column; gap:8px; } .drl-row { display:flex; gap:8px; align-items:stretch; } .drl-t { flex:1 1 auto; display:flex; align-items:center; justify-content:center; gap:6px; }
  .drl-t i { font-style:normal; display:inline-flex; } .drl-t i svg { width:16px; height:16px; } .drl-t.on { border-color:#2fbf71; color:#7ee2a8; background:#123323; }
  .drl-adj { display:flex; align-items:center; gap:4px; flex:0 0 auto; direction:ltr; } .drl-adj .b { min-width:38px; padding:4px 0; font-size:18px; font-weight:800; }
  .drl-v { min-width:62px; display:flex; flex-direction:column; align-items:center; line-height:1.05; } .drl-v b { font-size:16px; } .drl-v small { font-size:9.5px; color:var(--dim); letter-spacing:.02em; }
  .tabs .tab.hint { animation:tabhint 1.2s ease-in-out 4; box-shadow:inset 0 0 0 2px var(--amb); } @keyframes tabhint { 50% { box-shadow:inset 0 0 0 2px var(--amb), 0 0 12px #f5a52488; } }
  .flowmsg { margin:8px 0 0; font-weight:700; font-size:13.5px; } .flowmsg:empty { display:none; } .flowmsg.yes { color:#ff8b8e; } .flowmsg.no { color:var(--mut); }
  .ks { display:grid; gap:8px; margin-bottom:6px; } .ks label { display:flex; justify-content:space-between; align-items:center; gap:10px; font-weight:700; font-size:13.5px; } .ks i { color:var(--mut); font-style:normal; font-weight:600; font-size:12px; }
  .ks input { width:120px; min-height:42px; background:#0a1118; border:1px solid var(--line2); border-radius:10px; padding:0 10px; text-align:end; direction:ltr; font:700 15px var(--mono); transition:border-color .2s, box-shadow .2s; } .ks input:focus { border-color:var(--amb); box-shadow:0 0 0 3px #f5a52426; outline:0; } .ks input:disabled { opacity:.85; border-color:var(--grn); color:#bff3d6; }
  .leg { display:flex; gap:14px; font-size:12px; font-weight:700; margin-top:2px; } .lp { color:var(--amb); } .la { color:var(--teal); }
  .alarm-list { list-style:none; margin:0; padding:0; display:grid; gap:6px; } .alarm { display:flex; gap:10px; padding:7px 10px; border-radius:10px; background:var(--tile); border:1px solid var(--line); border-inline-start:3px solid var(--dim); font-size:13px; font-weight:600; animation:fade .3s ease; }
  .alarm time { font:700 11.5px var(--mono); color:var(--dim); flex:none; direction:ltr; } .alarm.bad { border-inline-start-color:var(--red); background:#1a0c0e; } .alarm.warn { border-inline-start-color:var(--amb); } .alarm.ok { border-inline-start-color:var(--grn); } .alarm.info { border-inline-start-color:var(--blu); } .alarm.none { color:var(--dim); }
  .note { color:var(--mut); font-size:12px; margin:10px 0 0; }
  .det-list { display:grid; gap:10px; } .det-card { background:#f1f4f7; color:#14202b; border-radius:14px; padding:10px 12px; } .det-card h3 { margin:0 0 6px; font-size:15px; } .det-card p { margin:6px 0 0; font-size:13px; line-height:1.45; } .det-card b { color:#7a4b00; }
  .det-svg { display:block; width:100%; height:200px; border-radius:8px; background:#e9eef2; }
  .demo .hide-demo { display:none; }
  /* guidance strip (bottom) */
  .lv-bar { position:fixed; left:max(12px,env(safe-area-inset-left)); right:max(12px,env(safe-area-inset-right)); bottom:max(26px,calc(env(safe-area-inset-bottom) + 22px)); z-index:8100; background:linear-gradient(180deg,#131f2ce8,#0d1620f2); backdrop-filter:blur(12px); border:1px solid var(--line2); border-radius:18px; padding:10px 12px 10px 14px; display:flex; flex-wrap:nowrap; gap:12px; align-items:center; box-shadow:0 18px 40px -12px #000, 0 0 0 1px #ffffff06 inset; max-width:980px; margin:0 auto; overflow:hidden; animation:rise .3s ease; }
  @keyframes rise { from { transform:translateY(12px); opacity:0; } to { transform:none; opacity:1; } }
  .lv-bar::before { content:""; position:absolute; inset-block:0; inset-inline-start:0; width:4px; background:var(--grn); }
  .lv-bar.demo::before { background:var(--blu); } .lv-bar.pro::before { background:var(--amb); }
  .lv-bar[hidden] { display:none; }
  .lv-tag { flex:none; align-self:center; background:#0f2f22; color:#bff3d6; border:1px solid #1f6b45; border-radius:999px; padding:3px 10px; font-weight:800; font-size:12px; } .lv-bar.demo .lv-tag { background:#0e1e3d; color:#bcd3ff; border-color:#2a4f99; } .lv-bar.pro .lv-tag { background:#2a1e07; color:#ffdc96; border-color:#7a5512; }
  .lv-t { flex:1 1 auto; min-width:0; } .lv-n { font:700 11px var(--mono); color:var(--mut); letter-spacing:.06em; text-transform:uppercase; }
  .lv-a { font-size:16px; font-weight:700; line-height:1.35; color:#f4f7fb; } .lv-why { font-size:13px; color:#a9bbd0; margin-top:3px; }
  .lv-g { margin-top:6px; background:#2a0f12; border:1px solid #a33a40; border-radius:10px; padding:6px 9px; font-size:13.5px; font-weight:700; color:#ffd0d4; } .lv-g[hidden] { display:none; }
  .lv-go { flex:none; min-height:46px; min-width:96px; border:0; border-radius:12px; background:linear-gradient(180deg,#3be38a,#22b866); color:#06150d; font:inherit; font-size:14.5px; font-weight:800; cursor:pointer; padding:0 14px; box-shadow:0 6px 16px -6px #34d17a99; }
  .lv-x { flex:none; width:40px; height:40px; border-radius:12px; border:1px solid var(--line2); background:#ffffff06; color:#dbe6f2; font-size:15px; cursor:pointer; display:grid; place-items:center; }
  .lv-x:hover { background:#ffffff10; }
  .lv-grade { display:flex; align-items:baseline; gap:4px; margin-bottom:6px; } .lv-grade b { font:800 48px/1 var(--mono); color:var(--amb); } .lv-grade span { font-weight:800; color:var(--mut); }
  #evalcard { border-color:#6b4d12; background:linear-gradient(180deg,#1b160c,#0f0d08); }
  #evalcard table { width:100%; border-collapse:collapse; font-size:13.5px; margin-bottom:10px; } #evalcard th { text-align:start; font-weight:600; padding:5px 0; border-bottom:1px solid #ffffff0d; } #evalcard td { text-align:end; font-weight:800; color:var(--amb); direction:ltr; border-bottom:1px solid #ffffff0d; }
  .ks label[hidden] { display:none; }
  .devnote { color:var(--amb2); font-weight:700; }
  .fault { background:linear-gradient(180deg,#2a1708,#1a0f06); border:1px solid var(--amb); border-radius:14px; padding:10px; } .fault h2, .fault h3 { color:var(--amb2); } .fault .btnrow .b { flex:1 1 46%; font-size:13px; }
  .lv-bar.min { padding:6px 10px 6px 14px; } .lv-bar.min .lv-why, .lv-bar.min .lv-n, .lv-bar.min .lv-tag { display:none; } .lv-bar.min .lv-a { font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } .lv-bar.min .lv-t { order:0; flex:1 1 0; }
  .lv-bar.min .lv-go { min-height:36px; } .lv-bar.min .lv-x { width:36px; height:36px; }
  @media (max-width:1240px) { main { grid-template-columns:minmax(0,1.15fr) minmax(320px,1fr); grid-template-areas:"view ctrl" "side side"; } main > .c2 { display:grid; grid-template-columns:2fr 1fr; align-items:start; } .kpi b { font-size:21px; } .st span { font-size:11.5px; } }
  @media (max-width:860px) and (min-width:601px) { main { grid-template-columns:minmax(0,1fr); grid-template-areas:"view" "ctrl" "side"; } main > .c2 { grid-template-columns:1fr; } .kpis { grid-template-columns:repeat(3,minmax(0,1fr)); } #viewbox svg { max-height:none; } .st span { display:none; } .st.cur span { display:inline; } }
  svg text { direction:ltr; unicode-bidi:embed; }
  .sec.choke[hidden] { display:none; }
  /* catalog equipment panels (unchanged art) */
  #pane-close { background:#efe9dc; }
  .eq-wrap { display:grid; gap:10px; padding:8px; background:#efe9dc; }
  .eq-state { display:flex; justify-content:space-between; flex-wrap:wrap; gap:6px; color:#14202b; font-weight:800; font-size:13px; padding:2px 4px; } .eq-state span { color:#5b4a2a; }
  .eq-panel { margin:0; background:#f7f3ea; border:1.5px solid #cfc4ad; border-radius:12px; padding:6px; box-shadow:inset 0 1px 0 #fff; }
  .eq-panel figcaption { font:900 11px system-ui,sans-serif; letter-spacing:.12em; color:#5b4a2a; padding:2px 4px 4px; direction:ltr; text-align:left; }
  #viewbox .eq-svg { display:block; width:100%; height:auto; max-height:none; min-height:0; }
  #viewbox #pane-bh .bh-svg { max-height:calc(var(--vavail, calc(100vh - 330px)) - 64px); min-height:300px; }
  .eq-part { transition:filter .3s; } .eq-focus { animation:eqpulse 1.4s ease-in-out infinite; }
  @keyframes eqpulse { 0%,100% { filter:drop-shadow(0 0 0 rgba(245,165,36,0)); } 50% { filter:drop-shadow(0 0 7px #f5a524) drop-shadow(0 0 2px #f5a524); } }
  .det-card { background:#f7f3ea; border:1.5px solid #cfc4ad; } .det-svg { height:auto; max-height:320px; background:#efe9dc; } .det-svg.tall { max-height:520px; }
  #viewbox .det-svg { max-height:300px; min-height:0; } #viewbox .det-svg.tall { max-height:560px; }
  #pane-det, #pane-close { max-height:var(--vavail, calc(100vh - 330px)); overflow:auto; } #pane-det { padding:8px; }
  .det-card.eq-focus-card { outline:3px solid var(--amb); outline-offset:2px; }
  /* choke console */
  .conscard { padding:10px; }
  .cons { background:transparent; border:0; border-radius:14px; padding:0; transition:box-shadow .3s; }
  .cons-h { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:8px; } .cons-h b { font-size:11.5px; letter-spacing:.12em; text-transform:uppercase; color:var(--mut); display:flex; align-items:center; gap:8px; }
  .cons-h b::before { content:""; width:8px; height:8px; border-radius:50%; background:var(--dim); }
  .cons[data-dev=g] .cons-h b::before { background:var(--grn); box-shadow:0 0 8px var(--grn); } .cons[data-dev=a] .cons-h b::before { background:var(--amb); box-shadow:0 0 8px var(--amb); } .cons[data-dev=r] .cons-h b::before { background:var(--red); box-shadow:0 0 8px var(--red); }
  .cons-mode { min-height:34px; font-size:12px; padding:0 10px; border-radius:999px; }
  .cons-g { display:grid; grid-template-columns:1.2fr 1fr; grid-template-areas:"dp knob" "side side"; gap:10px; align-items:center; }
  .cons-dp { grid-area:dp; } .cons-knob { grid-area:knob; } .cons-side { grid-area:side; }
  .cons-dp svg, .cons-knob svg, #cons-cp svg { display:block; width:100%; height:auto; }
  #cons-knob { touch-action:none; cursor:grab; border-radius:50%; } #cons-knob:focus-visible { outline:2px solid var(--amb); }
  .cons.off #cons-knob { cursor:default; opacity:.6; }
  .cons-kb { display:grid; grid-template-columns:repeat(4,1fr); gap:5px; margin-top:6px; direction:ltr; } .cons-kb .b { min-height:38px; padding:0; font:700 13.5px var(--mono); border-radius:10px; }
  .cons-side { display:grid; grid-template-columns:110px 1fr; gap:10px; align-items:stretch; text-align:center; }
  #cons-cp { background:var(--tile); border:1px solid var(--line); border-radius:12px; padding:4px; }
  .cons-pump { background:var(--tile); border:1px solid var(--line); border-radius:12px; padding:8px; display:flex; flex-direction:column; gap:6px; justify-content:center; } .cons-pump small { color:var(--dim); font-size:10.5px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
  .cons-pump .b { min-height:42px; font-size:13.5px; padding:0 6px; } .cons-spm { display:flex; align-items:center; gap:6px; direction:ltr; } .cons-spm .b { flex:1; min-height:38px; padding:0; font-size:18px; } .cons-spm b { flex:1.3; font:700 24px var(--mono); color:#f4f7fb; }
  .cons-i { margin-top:10px; min-height:2.6em; background:var(--tile); border:1px solid var(--line); border-radius:12px; padding:8px 12px; font-weight:700; font-size:14px; line-height:1.35; border-inline-start:4px solid var(--dim); }
  .cons.hint[data-dev=g] .cons-i { border-inline-start-color:var(--grn); } .cons.hint[data-dev=a] .cons-i, .cons.hint[data-dev=r] .cons-i { border-inline-start-color:var(--amb); color:#ffe2a0; }
  /* IWCF Q&A + Ops overlays */
  body.qa-on { overflow:hidden; }
  .qa { position:fixed; inset:0; z-index:9000; background:radial-gradient(900px 500px at 80% -10%, #12263d 0%, transparent 60%), #070b10; overflow:auto; padding:max(14px,env(safe-area-inset-top)) 14px 40px; animation:fade .2s ease; } .qa[hidden] { display:none; }
  .qa-in { max-width:820px; margin:0 auto; }
  .qa-h { position:sticky; top:-14px; z-index:2; display:flex; justify-content:space-between; align-items:center; gap:10px; margin:0 -14px 10px; padding:10px 14px; background:#070b10e6; backdrop-filter:blur(8px); border-bottom:1px solid var(--line); } .qa-h b { font-size:17px; font-weight:800; } .qa-h .b { min-height:38px; font-size:12.5px; flex:none; border-radius:999px; }
  .qa-intro { color:var(--mut); font-size:13.5px; line-height:1.55; }
  .qa-lv { display:grid; grid-template-columns:1fr 1fr; gap:12px; } @media (max-width:600px) { .qa-lv { grid-template-columns:1fr; } }
  .qa-card { position:relative; text-align:start; background:linear-gradient(180deg,#112018,#0c1510); border:1px solid #1f6b45; border-radius:18px; padding:16px; cursor:pointer; display:flex; flex-direction:column; gap:8px; transition:transform .15s, box-shadow .2s; box-shadow:var(--sh); } .qa-card:hover { transform:translateY(-2px); box-shadow:0 16px 30px -12px #000; }
  .qa-card { overflow:hidden; } .qa-card::after { content:"IWCF"; position:absolute; top:14px; inset-inline-end:14px; font:800 10.5px var(--mono); letter-spacing:.16em; color:#ffffff55; border:1px solid #ffffff26; border-radius:6px; padding:2px 7px; }
  .qa-card.l4 { border-color:#7a5512; background:linear-gradient(180deg,#201809,#141007); }
  .qa-card b { font-size:21px; font-weight:800; } .qa-card span { color:var(--mut); font-size:13.5px; } .qa-card i { font-style:normal; font-weight:800; color:var(--amb); }
  .qa-meta { display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap; font-size:12px; font-weight:700; color:var(--mut); } .qa-tag { color:var(--amb2); }
  .qa-bar { height:6px; background:var(--pan2); border-radius:999px; margin:8px 0 14px; overflow:hidden; } .qa-bar i { display:block; height:100%; background:linear-gradient(90deg,#c97a00,var(--amb)); border-radius:999px; transition:width .3s; }
  .qa-q { font-size:17px; font-weight:700; line-height:1.55; margin:0 0 14px; background:var(--pan); border:1px solid var(--line); border-radius:14px; padding:14px; }
  .qa-opts { display:grid; gap:8px; } .qa-o { display:flex; gap:12px; align-items:center; text-align:start; background:var(--pan); border:1px solid var(--line2); border-radius:13px; padding:10px 12px; cursor:pointer; font-size:15px; font-weight:600; min-height:52px; transition:border-color .15s, background .15s; } .qa-o:hover:not(:disabled) { border-color:#3d5470; background:var(--pan2); }
  .qa-o b { flex:none; width:28px; height:28px; border-radius:9px; background:var(--pan3); display:grid; place-items:center; font-size:13px; } .qa-o.ok { border-color:var(--grn); background:#0d2a1e; } .qa-o.bad { border-color:var(--red); background:#2a0f12; } .qa-o:disabled { cursor:default; }
  .qa-num { display:flex; flex-wrap:wrap; gap:10px; align-items:center; background:var(--pan); border:1px solid var(--line); border-radius:14px; padding:12px; } .qa-num input { width:160px; min-height:48px; background:#0a1118; border:1px solid var(--line2); border-radius:11px; padding:0 12px; font:700 17px var(--mono); margin-inline-start:6px; direction:ltr; } .qa-num .b { min-height:48px; }
  .qa-fb { margin-top:12px; border-radius:13px; padding:11px 13px; background:var(--pan); border:1px solid var(--line); border-inline-start:4px solid var(--dim); font-size:14.5px; line-height:1.55; } .qa-fb.ok { border-inline-start-color:var(--grn); } .qa-fb.bad { border-inline-start-color:var(--red); } .qa-fb p { margin:6px 0 0; } .qa-fb small { color:var(--mut); }
  .qa-nav { display:flex; gap:8px; margin-top:14px; } .qa-nav .b { flex:1; min-height:50px; }
  .qa-res { text-align:center; background:linear-gradient(180deg,#112018,#0c1510); border:1px solid var(--grn); border-radius:20px; padding:22px; } .qa-res.bad { border-color:var(--red); background:linear-gradient(180deg,#2a0f12,#160a0c); } .qa-res b { display:block; font:800 60px var(--mono); color:var(--amb); } .qa-res small { color:var(--mut); font-weight:700; } .qa-res p { font-weight:800; font-size:16px; }
  #ops .ops-tabs { display:grid !important; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:6px; padding:4px; background:#0a1118; border:1px solid var(--line); border-radius:14px; }
  #ops .ops-tabs .b { min-height:42px; font-size:12.5px; background:transparent; border-color:transparent; color:var(--mut); line-height:1.2; padding:4px 8px; }
  #ops .ops-tabs .b[aria-pressed=true] { background:linear-gradient(180deg,#ffb83d,#f09a12); color:#1a1205; border-color:#ffb83d; }
  #ops .ops-g { background:var(--pan); border:1px solid var(--line); border-radius:14px; padding:12px; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)) !important; }
  #ops .ops-g input { background:#0a1118 !important; border:1px solid var(--line2) !important; font-family:var(--mono) !important; }
  #ops .ops-l { background:var(--pan) !important; border:1px solid var(--line); } #ops .ops-l.bad { background:#2a0f12 !important; border-color:#7a2a2e; } #ops .ops-l b { font-family:var(--mono); }
  #ops .ops-t { background:var(--pan); border:1px solid var(--line); border-radius:14px; padding:4px 8px; } #ops .ops-t td { font-family:var(--mono); }
  @media (prefers-reduced-motion:reduce) { * { animation:none !important; transition:none !important; } }
  /* ===== phone: no page scroll; tabs Well / Controls / Gauges / Q&A + pinned choke strip ===== */
  #mtabs, #mstrip { display:none; }
  #viewbox svg.zoomed { cursor:grab; }
  @media (min-width:601px) { .zhint { display:none; } }
  @media (max-width:600px) {
    html, body { height:100%; overflow:hidden; }
    body { display:flex; flex-direction:column; height:100dvh; background-attachment:scroll; }
    header.app-h, .kpis, #mtabs, .stepper { flex:0 0 auto; }
    header.app-h { padding:max(6px,env(safe-area-inset-top)) 8px 6px; gap:6px; }
    header small#t-sub { display:none; } header .logo { width:28px; height:28px; }
    .brand { flex:1 1 auto; overflow:hidden; gap:7px; } header h1 { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:14.5px; }
    .modeb { display:none !important; }
    .sp { gap:5px; } .hb { min-height:36px; height:36px; padding:0 9px; font-size:12px; border-radius:10px; } .hb.icon { width:36px; }
    .hb .tx { display:none; } .hb.qa-btn, .hb.ops-btn { width:auto; padding:0 8px; }
    .speed { height:36px; padding:0 2px 0 6px; border-radius:10px; } .speed .ic { width:15px; height:15px; } .speed select { font-size:12px; padding:0 2px; min-height:32px; }
    .stepper { padding:6px 8px 0; }
    .st { gap:0; } .st span { display:none; } .st i { width:20px; height:20px; font-size:10px; border-width:1px; } .st:not(:last-child)::after { margin:0 3px; min-width:4px; }
    .st.cur { flex:0 0 auto; } .st.cur span { display:inline; font-size:11.5px; margin-inline-start:5px; max-width:110px; }
    .st-prog { margin-top:4px; font-size:10px; gap:6px; } .st-bar { height:6px; } .st-bar > u::after { display:none; }
    .kpis { grid-template-columns:repeat(6,minmax(0,1fr)); gap:4px; padding:6px 8px 0; } .kpi { padding:4px 3px 4px 6px; border-radius:9px; box-shadow:none; } .kpi::before { top:6px; bottom:6px; width:2px; }
    [dir] .kpi b { font-size:13.5px; letter-spacing:-.03em; text-align:center; } .kpi small { font-size:9.5px; letter-spacing:0; text-align:center; } .kpi i { display:none; }
    #mtabs { display:flex; gap:3px; margin:6px 8px 0; padding:3px; background:#0a1118; border:1px solid var(--line); border-radius:12px; }
    #mtabs button { flex:1; min-height:32px; border-radius:9px; border:0; background:transparent; color:var(--mut); font-weight:700; font-size:12.5px; padding:0 4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    #mtabs button[aria-selected=true] { background:linear-gradient(180deg,#24364a,#1a2938); color:#fff; box-shadow:0 1px 0 #ffffff14 inset; }
    #mtabs button[data-t=qa] { color:var(--amb2); }
    main#wrap { flex:1 1 auto; min-height:0; overflow:hidden; display:flex !important; flex-direction:column; padding:6px 8px calc(var(--lvh,0px) + 4px) !important; gap:6px; }
    main#wrap > * { min-height:0; }
    .card { padding:6px; border-radius:14px; } .tabs { margin-bottom:6px; padding:3px; } .tabs .tab { min-height:32px; font-size:11.5px; padding:0 2px; }
    body[data-mt=well] main > .col, body[data-mt=well] .conscard { display:none !important; }
    body[data-mt=well] main > .viewcard { flex:1 1 auto; display:flex; flex-direction:column; overflow:hidden; }
    body[data-mt=well] #viewbox { flex:1 1 auto; min-height:0; }
    body[data-mt=well] #viewbox .pane:not([hidden]) { height:100%; overflow:auto; }
    body[data-mt=well] #pane-site svg { height:100%; max-height:none; min-height:0; width:100%; }
    body[data-mt=well] #mstrip:not([hidden]) { display:flex; }
    body[data-mt=ctrl] main > .viewcard, body[data-mt=ctrl] main > .col:not(.c3) { display:none !important; }
    body[data-mt=ctrl] main > .c3 { flex:0 0 auto; gap:8px; }
    body[data-mt=ctrl] main#wrap, body[data-mt=gauges] main#wrap { overflow-y:auto; }
    body[data-mt=gauges] main > .viewcard, body[data-mt=gauges] main > .c3 { display:none !important; }
    main > .c2 { display:flex !important; flex-direction:column; }
    body[data-mt=gauges] main > .c2 { gap:8px; }
    body:not([data-circ])[data-mt=ctrl] .conscard { display:none !important; }
    #mstrip { gap:6px; align-items:stretch; padding:6px 0 0; font-size:12.5px; font-weight:700; }
    #mstrip .b { min-height:44px; min-width:46px; font-size:22px; padding:0; border-radius:12px; background:var(--pan3); }
    .ms-mid { display:flex; flex-direction:column; align-items:center; justify-content:center; min-width:58px; padding-inline:6px; line-height:1.05; } #ms-ch { font:700 16px var(--mono); direction:ltr; } .ms-mid small { font-size:10px; color:var(--dim); letter-spacing:.1em; }
    #ms-dp { flex:1; display:flex; flex-direction:column; justify-content:center; text-align:center; direction:ltr; border-radius:12px; padding:3px 4px; background:var(--tile); border:1px solid var(--line2); line-height:1.2; font:700 12.5px var(--mono); }
    #ms-dp.g { border-color:var(--grn); box-shadow:inset 0 0 12px #34d17a22; } #ms-dp.a { border-color:var(--amb); box-shadow:inset 0 0 12px #f5a52422; } #ms-dp.r { border-color:var(--red); box-shadow:inset 0 0 12px #ff5a5f33; }
    #ms-spm { direction:ltr; min-width:50px; display:flex; align-items:center; justify-content:center; text-align:center; color:#9fd0ff; font:700 12px var(--mono); background:var(--tile); border:1px solid var(--line); border-radius:12px; }
    body[data-mt=well] #pane-bh .bh-wrap { height:100%; box-sizing:border-box; display:flex; flex-direction:column; gap:4px; padding:4px; }
    body[data-mt=well] #pane-bh .eq-state { flex:0 0 auto; font-size:11.5px; padding:0 2px; }
    body[data-mt=well] #pane-bh .eq-panel { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; padding:3px; }
    body[data-mt=well] #pane-bh .eq-panel figcaption { flex:0 0 auto; font-size:9.5px; padding:0 2px 2px; }
    body[data-mt=well] #pane-bh .bh-svg { flex:1 1 auto; min-height:0; width:100%; height:100%; max-height:none; }
    body[data-mt=well] #viewbox .eq-svg:not(.bh-svg) { max-height:calc(var(--vbh, 60vh) - 46px); width:100%; }
    #pane-det { max-height:none; padding:4px; } #pane-close { max-height:none; }
    .zhint { position:absolute; inset-inline-end:6px; bottom:6px; z-index:2; background:#0b1622cc; color:#cfe3f5; font:700 10.5px system-ui,sans-serif; padding:3px 7px; border-radius:8px; pointer-events:none; }
    .chips { bottom:8px; left:6px; right:35%; } .chip { font-size:10px; padding:2px 8px; }
    .lv-bar { left:8px; right:8px; bottom:max(24px,calc(env(safe-area-inset-bottom) + 20px)); padding:7px 8px 7px 12px; gap:6px 8px; border-radius:14px; flex-wrap:wrap; }
    .lv-a { font-size:13.5px; line-height:1.32; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; } .lv-why { display:none; }
    .lv-n { display:none; } .lv-tag { font-size:11px; padding:2px 8px; }
    .lv-go { flex:0 0 auto; min-height:36px; min-width:0; font-size:13px; padding:0 12px; border-radius:10px; margin-inline-start:auto; } .lv-x { width:36px; height:36px; border-radius:10px; }
    .lv-t { flex:1 1 100%; order:5; } .lv-g { font-size:12.5px; }
    .lv-bar.min { flex-wrap:nowrap; } .lv-bar.min .lv-go { margin-inline-start:0; }
    .proc .b { min-height:44px; font-size:13px; }
    .cons-g { grid-template-columns:1.1fr 1fr; gap:6px; } .cons-side { grid-template-columns:92px 1fr; gap:6px; } .cons-i { font-size:13px; margin-top:6px; padding:6px 10px; }
    .qa-btn, .ops-btn { max-width:none; }
    #gauges { grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; } .gauge:first-child { grid-column:auto; } .gcap { font-size:10px; flex-direction:column; align-items:center; text-align:center; }
    .ro { grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; } .ro div { padding:4px 7px; } .ro b { font-size:12.5px; }
    .qa { padding:max(10px,env(safe-area-inset-top)) 10px 40px; } .qa-h { margin:0 -10px 10px; padding:8px 10px; top:-10px; } .qa-h b { font-size:15px; }
  }
  /* v87: phone side control rail (no scrolling to reach controls) */
  .vrow { display:contents; } #mrail { display:none; }
  @media (min-width:601px) { #btn-reset.hb.icon { width:auto; padding:0 10px; } }
  .eq-sw { display:flex; gap:3px; padding:2px; background:#ddd3bf; border-radius:9px; direction:ltr; justify-self:start; }
  .eq-sw button { border:0; background:transparent; font:900 11px system-ui,sans-serif; letter-spacing:.08em; color:#5b4a2a; padding:5px 12px; border-radius:7px; cursor:pointer; min-height:28px; }
  .eq-sw button.on { background:#14202b; color:#f4c430; }
  .eq-wrap[data-sel] .eq-panel { display:none; }
  #pane-close .eq-wrap { grid-template-columns:minmax(0,1fr) auto; align-items:center; } #pane-close .eq-wrap > .eq-panel { grid-column:1 / -1; }
  #viewbox:has(#pane-close:not([hidden])) .chips { left:50%; right:auto; bottom:44px; transform:translateX(-50%); align-items:center; }
  .eq-wrap[data-sel=bop] #eqp-bop, .eq-wrap[data-sel=choke] #eqp-choke, .eq-wrap[data-sel=acc] #eqp-acc { display:block; }
  @media (max-width:600px) {
    body[data-mt=well] .vrow { display:flex; flex:1 1 auto; min-height:0; gap:6px; direction:ltr; }
    body[data-mt=well] .vrow > #viewbox { flex:1 1 auto; min-width:0; }
    body[data-mt=well] #mrail { display:flex; flex-direction:column; flex:0 0 70px; width:70px; gap:5px; min-height:0; overflow:hidden; }
    html[dir=rtl] body[data-mt=well] #mrail { direction:rtl; }
    #mrail .mr-chips:empty { display:none; }
    #mrail .chips { position:static; display:flex; flex-direction:column; align-items:stretch; gap:3px; }
    #mrail .chip { font-size:9.5px; padding:2px 4px; border-radius:7px; letter-spacing:0; justify-content:center; text-align:center; line-height:1.1; white-space:normal; gap:2px; }
    .mr-acts { display:flex; flex-direction:column; gap:4px; min-height:0; flex:0 1 auto; }
    .mr-acts .b { min-height:40px; padding:3px 3px; font-size:10.5px; line-height:1.12; border-radius:10px; white-space:normal; display:flex; align-items:center; justify-content:center; text-align:center; flex-direction:column; gap:1px; }
    .mr-acts .b i { font-style:normal; font-size:14px; line-height:1; display:block; height:16px; } .mr-acts .b i svg { display:block; width:16px; height:16px; }
    .mr-acts { overflow:hidden; } .mr-go { flex:0 0 auto; } #mr-go[hidden] { display:none !important; }
    #mrail.fit1 .mr-acts .b { min-height:34px; } #mrail.fit1 .mr-acts .b.done i { display:none; }
    #mrail.fit2 .mr-acts .b { min-height:30px; font-size:9.5px; } #mrail.fit2 .mr-acts .b i { display:none; } #mrail.fit2 #mstrip .b { min-height:40px; } #mrail.fit2 .mr-go { min-height:40px; font-size:10.5px; }
    #mrail.fit3 .mr-acts .b.done { min-height:20px; } #mrail.fit3 .mr-acts .b.done { flex-direction:row; padding:1px 3px; } #mrail.fit3 .mr-acts .b.done span { line-height:1.6; font-size:8.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; } #mrail.fit3 .mr-acts .b.done::after { display:none; } #mrail.fit3 .mr-acts { gap:3px; }
    #mrail.fit4 .mr-chips .chip { font-size:9px; padding:1px 3px; } #mrail.fit4 .mr-acts .b:not(.done):not(.next) { min-height:26px; }
    #mrail.fit5 .mr-acts .b i { display:block; } #mrail.fit5 .mr-acts .b:not(.next) span { display:none; } #mrail.fit5 .mr-acts .b { min-height:24px; } #mrail.fit5 .mr-acts .b.done::after { display:none; }
    #mrail.fit6 .mr-acts .b:disabled:not(.done):not(.next) { display:none; } #mrail.fit6 .mr-chips .chip { font-size:9px; }
    .mr-acts .b.done { opacity:.55; } .mr-acts .b.done::after { content:'✓'; font-size:10px; color:var(--grn); }
    .mr-acts .b.next { outline:2px solid var(--amb); box-shadow:0 0 12px #f5a52466; }
    .mr-acts .b:disabled { opacity:.35; }
    body[data-circ] .mr-acts .b:not(.mr-keep), body[data-circ] .mr-acts .b.mr-keep:disabled { display:none; }
    #mrail #ms-p { order:-1; }
    #mrail #mstrip { flex-direction:column; gap:5px; padding:0; }
    #mrail #mstrip .b { min-height:48px; min-width:0; width:100%; font-size:24px; }
    #mrail .ms-mid { min-width:0; padding:4px 0; background:var(--tile); border:1px solid var(--line2); border-radius:12px; } #mrail #ms-ch { font-size:14px; }
    #mrail #ms-dp { flex:0 0 auto; font-size:10.5px; padding:4px 2px; line-height:1.25; }
    #mrail #ms-dp small { display:block; font-size:10px; color:var(--dim); } #mrail #ms-dp i { display:block; font-style:normal; font-weight:800; }
    #mrail #ms-spm { min-width:0; padding:6px 2px; font-size:11px; }
    #mrail .mr-drl { display:flex; flex-direction:column; gap:6px; flex:0 0 auto; } #mrail .mr-drl[hidden] { display:none; } #mrail .mr-acts[hidden] { display:none; }
    #mrail .drl-row { flex-direction:column; gap:3px; }
    #mrail .drl-t { min-height:42px; padding:3px; font-size:10.5px; line-height:1.12; border-radius:10px; flex-direction:column; gap:1px; white-space:normal; text-align:center; }
    #mrail .drl-t i svg { width:15px; height:15px; } #mrail .drl-t.next { outline:2px solid var(--amb); box-shadow:0 0 12px #f5a52466; }
    #mrail .drl-adj { gap:2px; } #mrail .drl-adj .b { flex:0 0 21px; min-width:0; min-height:30px; padding:0; font-size:16px; border-radius:8px; }
    #mrail .drl-v { flex:1 1 auto; min-width:0; } #mrail .drl-v b { font-size:12px; } #mrail .drl-v small { font-size:7px; white-space:nowrap; }
    #mrail.fit1 .mr-drl { gap:4px; } #mrail.fit2 .drl-t { min-height:34px; } #mrail.fit3 .drl-t i { display:none; } #mrail.fit3 .drl-row { gap:2px; } #mrail.fit4 .drl-adj .b { min-height:25px; } #mrail.fit4 .drl-v small { display:none; } #mrail.fit5 .drl-t { min-height:28px; font-size:9.5px; } #mrail.fit6 .drl-t { min-height:24px; font-size:9px; } #mrail.fit6 .drl-adj .b { min-height:22px; }
    .mr-go { margin-top:auto; min-height:46px; padding:3px; font-size:11.5px; font-weight:800; line-height:1.15; border-radius:12px; background:linear-gradient(180deg,#2fbf71,#1f9a58); color:#04170c; border:0; white-space:normal; }
    body[data-mt=well] .lv-bar .lv-go { display:none; }
    body[data-mt=well] #pane-close .eq-wrap { padding:4px; gap:4px; } body[data-mt=well] #pane-close .eq-state { font-size:10.5px; padding:0 2px; }
    body[data-mt=well] #pane-close .eq-panel { padding:3px; } body[data-mt=well] #pane-close .eq-panel.is-3d figcaption { display:none; }
    .eq-sw button { padding:4px 9px; min-height:26px; font-size:10.5px; }
    body[data-mt=well] #pane-close .eq-wrap { grid-template-columns:minmax(0,1fr) auto; align-items:center; } body[data-mt=well] #pane-close .eq-wrap > .eq-panel { grid-column:1 / -1; }
  }
/* bop3d.css — v86 3D BOP view */
.b3-host { position:relative; width:100%; overflow:hidden; border-radius:10px; background:radial-gradient(120% 90% at 50% 38%, #2b3743 0%, #17202a 55%, #0d141b 100%); touch-action:none; user-select:none; -webkit-user-select:none; }
.b3-cv { position:absolute; inset:0; display:block; }
.b3-ov { position:absolute; inset:0; pointer-events:none; }
.b3-lines { position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.b3-lines path { fill:none; stroke:rgba(226,234,240,.78); stroke-width:1; }
.b3-lines circle { fill:#f4c430; stroke:#10161c; stroke-width:.8; }
.b3-l { position:absolute; left:0; top:0; max-width:var(--b3col,110px); padding:2px 5px 2px; border-radius:5px; background:rgba(12,18,24,.78); border:1px solid rgba(160,178,192,.35);
  font:800 9.5px/1.15 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; letter-spacing:.03em; color:#eef3f6; direction:ltr; text-align:left; box-sizing:border-box; will-change:transform; }
.b3-R { text-align:right; }
.b3-t { display:block; }
.b3-s { display:block; font-style:normal; font-weight:900; font-size:8.5px; letter-spacing:.06em; margin-top:1px; }
.b3-s:empty { display:none; }
.b3-s.off { color:#7fe3a0; } .b3-s.on { color:#ff8a7a; }
.b3-l:has(.b3-s.on) { border-color:rgba(255,110,90,.75); }
.b3-s.flow { color:#f4c430; }
.b3-l.b3-f { border-color:#f4c430; box-shadow:0 0 0 2px rgba(244,196,48,.35); animation:b3p 1.4s ease-in-out infinite; }
@keyframes b3p { 50% { box-shadow:0 0 0 4px rgba(244,196,48,.12); } }
.b3-reset { position:absolute; right:6px; bottom:6px; width:30px; height:30px; border-radius:8px; border:1px solid rgba(200,210,220,.35); background:rgba(12,18,24,.7); color:#e8eef3; font:700 16px system-ui; cursor:pointer; }
.b3-hint { position:absolute; left:50%; bottom:6px; transform:translateX(-50%); font:700 9.5px system-ui,sans-serif; color:rgba(220,228,236,.7); background:rgba(12,18,24,.55); padding:2px 8px; border-radius:20px; pointer-events:none; white-space:nowrap; }
@media (min-width:700px) { .b3-l { font-size:11px; padding:3px 7px; } .b3-s { font-size:9.5px; } }
/* v87: compact phone labels (short names, tighter chips) so the model can be ~2x larger */
.b3-compact .b3-l { font-size:8.5px; padding:1px 4px; border-radius:4px; background:rgba(12,18,24,.6); letter-spacing:.02em; }
.b3-compact .b3-s { font-size:7.5px; margin-top:0; }
.b3-compact .b3-hint { font-size:8.5px; }
.b3-hint { transition:opacity .8s; }
  .eq-panel.is-3d > svg.eq-svg, #viewbox .eq-panel.is-3d > svg.eq-svg { display:none !important; }
  .eq-panel.is-3d { background:#121a22; border-color:#2a3846; } .eq-panel.is-3d figcaption { color:#cfd8e0; }
  #pane-close .b3-host { height:min(calc(var(--vavail, calc(100vh - 330px)) - 94px), 680px); min-height:300px; }
  #pane-site.is-3d > svg { display:none !important; }
  #pane-site .b3-host { height:min(var(--vavail, calc(100vh - 330px)), 780px); min-height:320px; }
  #pane-bh .b3-host { height:min(calc(var(--vavail, calc(100vh - 330px)) - 64px), 760px); min-height:320px; }
  @media (max-width:600px) {   /* v92: phone only (body[data-mt] is also set on desktop) */
  body[data-mt=well] #pane-site.is-3d .b3-host { height:100%; min-height:0; }
  body[data-mt=well] .vrow > #viewbox:has(#pane-site.is-3d:not([hidden])) { flex:1 1 0%; width:100%; } body[data-mt=well] #pane-site.is-3d .b3-host { min-width:min(250px, 62vw); }
  body[data-mt=well] #pane-bh .eq-panel.is-3d .b3-host { flex:1 1 auto; height:auto; min-height:0; } }
  .bh-msg { position:absolute; left:50%; bottom:4px; transform:translateX(-50%); max-width:calc(100% - 2 * var(--b3col, 90px) - 12px); z-index:2; pointer-events:none; text-align:center; direction:ltr;
    font:800 9.5px/1.2 system-ui,sans-serif; color:#ffd9a8; background:rgba(12,18,24,.72); border:1px solid rgba(255,170,90,.45); border-radius:6px; padding:2px 6px; }
  .bh-msg:empty { display:none; }
  @media (max-width:600px) { body[data-mt=well] #pane-close .b3-host { height:calc(var(--vbh, 60vh) - 74px); min-height:220px; } }
  /* v95: phone — the kill graph replaces the dials on request (toggle in the gauges card), so the Gauges tab never grows */
  .tr-tg { display:none; }
  @media (max-width:600px) {
    .gcard { position:relative; }
    .tr-tg:not([hidden]) { display:inline-flex; align-items:center; gap:4px; position:absolute; top:4px; inset-inline-end:6px; min-height:28px; padding:0 10px; border-radius:9px; border:1px solid var(--amb); background:#2a1c08; color:var(--amb2); font:700 11.5px system-ui, sans-serif; cursor:pointer; }
    body:not(.trend-on) #trendcard { display:none !important; }
    body.trend-on .gcard:has(#trendcard:not([hidden])) #gauges { display:none; }
    body.trend-on #trendcard h2#t-trend { display:none; }
    .gcard #trendcard { border:0; padding:0; margin:12px 0 0; box-shadow:none; background:none; border-radius:0; }
  }
  /* v94 live kill graph (trend.js) */
  .trendcard h2#t-trend { margin:0 0 4px; } .trendcard[hidden] { display:none !important; }
  .tr-h { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:4px 10px; margin-bottom:4px; }
  .tr-sub { font-size:11.5px; color:var(--mut); font-weight:700; }
  .tr-leg { display:flex; gap:10px; flex-wrap:wrap; font-size:11.5px; color:var(--fg); font-weight:600; }
  .tr-leg span, .tr-tip span { display:inline-flex; align-items:center; gap:5px; }
  .tr-leg .sw, .tr-tip .sw { display:inline-block; width:14px; height:0; border-top:2px solid var(--amb); }
  .tr-leg .sw.pl, .tr-tip .sw.pl { border-top:2px dashed #f5a52499; } .tr-leg .sw.cs, .tr-tip .sw.cs { border-top-color:var(--teal); }
  .tr-w { position:relative; direction:ltr; }
  .tr-svg { display:block; width:100%; height:auto; touch-action:pan-y; }
  .tr-gl { stroke:#1d2a38; stroke-width:1; } .tr-ax { fill:var(--mut); font:600 9.5px var(--mono, ui-monospace, monospace); } .tr-ax.bt { fill:var(--teal); }
  .tr-bit { stroke:#2dd4bf66; stroke-width:1; }
  .tr-band { fill:#f5a52414; stroke:none; }
  .tr-plan { fill:none; stroke:#f5a52499; stroke-width:2; stroke-dasharray:5 4; stroke-linecap:round; }
  .tr-dp, .tr-cas { fill:none; stroke-width:2; stroke-linejoin:round; stroke-linecap:round; } .tr-dp { stroke:var(--amb); } .tr-cas { stroke:var(--teal); }
  .tr-dot { stroke:var(--pan); stroke-width:2; } .tr-dot.dp { fill:var(--amb); } .tr-dot.cs { fill:var(--teal); }
  .tr-end { fill:var(--fg); font:700 10px var(--mono, ui-monospace, monospace); }
  .tr-x { stroke:#8b9cb180; stroke-width:1; }
  .tr-tip { position:absolute; top:4px; display:flex; flex-direction:column; gap:2px; padding:6px 8px; background:#0a1118f2; border:1px solid var(--line2); border-radius:9px; font-size:11.5px; color:var(--fg); pointer-events:none; white-space:nowrap; z-index:2; }
  .tr-tip b { font:700 11.5px var(--mono, ui-monospace, monospace); }
  .tr-empty { position:absolute; inset:0; margin:0; display:flex; align-items:center; justify-content:center; text-align:center; padding:0 18px; color:var(--mut); font-size:12.5px; line-height:1.45; direction:inherit; }
  [dir=rtl] .tr-empty { direction:rtl; }
  .tr-empty[hidden], .tr-tip[hidden] { display:none; }
  .tr-tab { margin-top:4px; font-size:12px; } .tr-tab summary { cursor:pointer; color:var(--mut); font-weight:700; padding:3px 0; }
  .tr-tab summary:focus-visible { outline:2px solid var(--amb); outline-offset:2px; border-radius:4px; }
  .tr-tab table { width:100%; border-collapse:collapse; direction:ltr; font:12px var(--mono, ui-monospace, monospace); }
  .tr-tab th { color:var(--mut); font:700 11px system-ui, sans-serif; text-align:end; padding:2px 6px; } .tr-tab td { text-align:end; padding:2px 6px; border-top:1px solid var(--line); }
  .tr-tab tr.warn td:last-child { color:var(--amb2); } .tr-tab tr.bad td:last-child { color:var(--red); }

/* ===== v97: guided layer — tab glow · stage popups · depth badge ===== */
.tabs .tab.tglow, #mtabs button.tglow { color:#fff; background:linear-gradient(180deg,#3a2c0c,#2a2108); box-shadow:inset 0 0 0 2px var(--amb), 0 0 14px #f5a524aa; animation:tglow 1.3s ease-in-out infinite; position:relative; }
.tabs .tab.tglow::after, #mtabs button.tglow::after { content:""; position:absolute; top:3px; inset-inline-end:3px; width:7px; height:7px; border-radius:50%; background:var(--amb); box-shadow:0 0 8px var(--amb); }
@keyframes tglow { 50% { box-shadow:inset 0 0 0 2px var(--amb), 0 0 22px #f5a524; } }
#btn-kick { background:linear-gradient(180deg,#5a1414,#3a0c0c); border-color:#ff5a5a; color:#fff; font-weight:800; }
#btn-kick:disabled { opacity:.45; background:var(--tile); border-color:var(--line2); }
.mr-acts #mr-btn-kick i { color:#ff7b7b; }
.dpb { position:absolute; inset-inline-start:8px; bottom:8px; z-index:5; display:flex; flex-wrap:wrap; gap:4px 8px; align-items:center; max-width:calc(100% - 16px); direction:ltr; padding:5px 9px; border-radius:10px; background:#0b1118d9; border:1px solid var(--line2); color:#dfeaf5; font-size:11.5px; font-variant-numeric:tabular-nums; pointer-events:none; backdrop-filter:blur(4px); }
.dpb[hidden] { display:none; } .dpb b { color:#fff; font-size:13px; } .dpb .w { color:var(--amb2); } .dpb .l { color:#0b1118; background:var(--amb); border-radius:6px; padding:1px 6px; font-weight:800; animation:nextp 1.8s ease-in-out infinite; }
.wcpop { position:fixed; inset:0; z-index:9500; display:flex; align-items:center; justify-content:center; padding:max(12px,env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom)); }
.wcpop[hidden] { display:none; }
.wcpop-bd { position:absolute; inset:0; background:radial-gradient(ellipse at 50% 30%,#0b1a2acc,#02060bf0); }
.wcpop-card { position:relative; width:min(520px,100%); max-height:calc(100dvh - 24px); overflow:auto; background:linear-gradient(180deg,#14222f,#0d1721); border:1px solid #2c4258; border-radius:18px; padding:20px 20px 16px; box-shadow:0 24px 70px #000b, 0 0 0 1px #ffffff0d inset; color:#e6eef6; }
.wcpop-card::before { content:""; position:absolute; inset-inline:0; top:0; height:4px; border-radius:18px 18px 0 0; background:linear-gradient(90deg,var(--grn),var(--amb)); }
.wcpop[data-k=kick] .wcpop-card::before { background:linear-gradient(90deg,#ff5a5a,var(--amb)); }
.wcpop h2 { margin:2px 36px 10px 0; font-size:19px; line-height:1.25; color:#fff; } html[dir=rtl] .wcpop h2 { margin:2px 0 10px 36px; }
.wcpop-b p { margin:0 0 9px; font-size:14.5px; line-height:1.55; color:#cfdbe7; } .wcpop-b b { color:#fff; } .wcpop-b small { color:var(--dim); }
.wcpop-f { display:flex; justify-content:flex-end; margin-top:14px; } .wcpop-ok { min-height:44px; padding:0 20px; font-size:15px; }
.wcpop-x { position:absolute; top:10px; inset-inline-end:10px; width:38px; height:38px; border-radius:50%; border:1px solid var(--line2); background:#0a1118; color:#c5d3e0; font-size:16px; cursor:pointer; }
.wcpop-x:hover, .wcpop-x:focus-visible { background:#1a2938; color:#fff; outline:2px solid var(--amb); }
@media (max-width:600px) { .wcpop-card { padding:16px 14px 12px; border-radius:16px; } .wcpop h2 { font-size:17px; } .wcpop-b p { font-size:13.5px; line-height:1.5; margin-bottom:7px; } .wcpop-ok { width:100%; } .dpb { font-size:10px; padding:3px 6px; } .dpb b { font-size:11px; } }
/* coach bar: tap the text to read it all (phone) */
.lv-bar .lv-t { cursor:pointer; } .lv-bar.open .lv-a, .lv-bar.open .lv-why { white-space:normal !important; overflow:visible !important; -webkit-line-clamp:unset !important; display:block !important; max-height:none !important; }

/* ===== v97: desktop console — fixed 100dvh grid, coach bar in flow, columns scroll internally ===== */
@media (min-width:1101px) and (min-height:620px) {
  html, body { height:100dvh; overflow:hidden; }
  body { display:flex; flex-direction:column; padding-bottom:0 !important; }
  body > header.app-h, body > .kpis, body > .stepper { flex:0 0 auto; }
  main#wrap { flex:1 1 auto; min-height:0; align-items:stretch; grid-template-rows:minmax(0,1fr); width:100%; box-sizing:border-box; padding:10px 16px; }
  main#wrap > .viewcard, main#wrap > .col { min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#2a3b4d transparent; }
  .lv-bar { position:relative; left:auto; right:auto; bottom:auto; flex:0 0 auto; width:calc(100% - 32px); max-width:1568px; margin:0 auto 34px; box-sizing:border-box; padding:8px 12px 8px 16px; }
  .lv-a { font-size:15px; } .lv-bar:not(.open) .lv-a { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
}
@media (min-width:1101px) and (min-height:620px) { body > .kpis, body > .stepper { width:100%; box-sizing:border-box; } }

/* v97 GSAP motion layer (glow intensity is driven by --gp / --kf / --bp tweened from sim.js; html.gs only when GSAP runs and motion is allowed) */
html.gs .b.next:not(:disabled) { animation:none; box-shadow:0 0 0 calc(3px + 2px*var(--gp,0)) #f5a52433, 0 0 calc(18px + 8px*var(--gp,0)) -4px #f5a524cc; }
html.gs .tabs .tab.tglow, html.gs #mtabs button.tglow { animation:none; box-shadow:inset 0 0 0 2px var(--amb), 0 0 calc(10px + 12px*var(--gp,0)) #f5a524; }
html.gs #viewbox .pane { animation:none; }
.kpi { outline:2px solid rgba(245,165,36,calc(var(--kf,0)*.75)); outline-offset:-2px; }
.lv-bar { box-shadow:0 18px 40px -12px #000, 0 0 0 1px #ffffff06 inset, 0 0 calc(var(--bp,0)*26px) rgba(245,165,36,calc(var(--bp,0)*.45)); }
.wcpop.out { pointer-events:none; }
@media (prefers-reduced-motion:reduce) { .b.next, .tglow, #viewbox .pane { animation:none !important; } }
/* ===== v98 rig3d + hoist console ===== */
.r3-host { background:radial-gradient(120% 90% at 50% 30%, #1d2c3b 0%, #0f1822 60%, #070c12 100%); }
.r3-cv { position:absolute; inset:0; width:100%; height:100%; display:block; touch-action:none; cursor:grab; }
.r3-ov { position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.r3-l { position:absolute; left:0; top:0; padding:2px 6px; border-radius:5px; background:rgba(8,14,20,.72); border:1px solid rgba(150,175,195,.4); color:#eaf2f7; direction:ltr; white-space:nowrap;
  font:800 10px/1.2 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; letter-spacing:.05em; will-change:transform; }
.r3-l b, .r3-l em { font-style:normal; color:#ffd24a; margin-inline-start:5px; }
.r3-hot { border-color:#ff7a5a; color:#ffb4a2; } .r3-zone { border-color:#ffb02e; color:#ffd88a; } .r3-brk { border-style:dashed; color:#9fd2ff; }
.r3-tick { background:none; border:0; padding:0; font-size:9px; color:rgba(190,210,225,.75); } .r3-dn { opacity:.95; }
.r3-compact .r3-l { font-size:8.5px; padding:1px 4px; }
/* console */
#viewbox { position:relative; }
.wcc { position:absolute; inset:0; pointer-events:none; z-index:6; direction:ltr; font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; color:#eaf2f7; }
.wcc button { font:inherit; color:inherit; -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
.wcc > * { pointer-events:auto; }
.wcc-hud { position:absolute; top:6px; left:6px; display:grid; grid-template-columns:repeat(4,auto); gap:4px; pointer-events:none; }
.wcc-t { min-width:62px; padding:3px 7px 3px; border-radius:7px; background:rgba(8,14,20,.74); border:1px solid rgba(140,165,185,.3); line-height:1.1; }
.wcc-t small { display:block; font:800 8.5px/1 system-ui; letter-spacing:.08em; text-transform:uppercase; color:#8fa7b8; }
.wcc-t b { font:900 15px/1.15 ui-monospace,Menlo,Consolas,monospace; font-variant-numeric:tabular-nums; }
.wcc-t u { text-decoration:none; font:700 8px/1 system-ui; color:#7d93a3; }
.wcc-t.hot b { color:#6ee7a0; } .wcc-t.bad b { color:#ff7a66; } .wcc-t.warn b { color:#ffb02e; }
.wcc-wi { position:absolute; top:6px; right:6px; width:min(210px,34%); height:26px; border-radius:7px; background:rgba(8,14,20,.74); border:1px solid rgba(140,165,185,.3); overflow:hidden; pointer-events:none; }
.wcc-wi::before { content:""; position:absolute; inset:0 0 11px; background:linear-gradient(90deg,#2d7fd6,#2dd68a 55%,#f4c430 80%,#ff5a4a); opacity:.55; }
.wcc-wi-n { position:absolute; left:0; top:0; width:100%; height:15px; } .wcc-wi-n::after { content:""; position:absolute; right:0; top:0; bottom:0; width:3px; background:#fff; box-shadow:0 0 6px #fff; }
.wcc-wi-l { position:absolute; left:5px; right:5px; bottom:1px; font:800 8.5px/11px system-ui; color:#cfe0ea; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wcc-pre { position:absolute; right:6px; top:38px; display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.wcc-chip { min-height:32px; padding:4px 11px; border-radius:16px; border:1px solid rgba(150,175,195,.45); background:rgba(8,14,20,.78); font:800 11px/1 system-ui; letter-spacing:.03em; cursor:pointer; }
.wcc-chip.on { background:#f4c430; color:#16202a; border-color:#f4c430; } .wcc-chip[aria-pressed=true] { background:#2a8fd6; border-color:#2a8fd6; }
.wcc-ic { width:36px; padding:0; font-size:18px; } .wcc-sp { height:4px; }
.wcc-ill { position:absolute; left:6px; bottom:calc(100% - 100% + 6px); display:none; }
.wcc-ctl { position:absolute; left:6px; bottom:6px; display:flex; gap:8px; padding:8px; border-radius:14px; background:rgba(8,14,22,.84); border:1px solid rgba(150,175,195,.35); backdrop-filter:blur(6px); max-width:calc(100% - 12px); }
.wcc-ctl[hidden] { display:none; }
.wcc-fold { display:none; }
.wcc-h { font:900 9px/1 system-ui; letter-spacing:.12em; text-transform:uppercase; color:#8fa7b8; margin-bottom:4px; }
.wcc-lv { width:84px; display:flex; flex-direction:column; align-items:center; border-radius:10px; padding:2px; }
.wcc-trk { position:relative; width:64px; height:176px; border-radius:32px; background:linear-gradient(#1b4a2a 0 38%, #232e38 38% 62%, #4a2a1b 62%); border:2px solid #4b6070; outline:0; touch-action:none; cursor:grab; }
.wcc-trk.drag { cursor:grabbing; } .wcc-trk:focus-visible { border-color:#f4c430; }
.wcc-a { position:absolute; left:0; right:0; font:900 10px/1 system-ui; text-align:center; letter-spacing:.1em; opacity:.8; } .wcc-aout { top:9px; color:#7fe3a0; } .wcc-ain { bottom:9px; color:#ffb48a; }
.wcc-cn { position:absolute; left:8px; right:8px; top:50%; height:2px; background:#8fa7b8; }
.wcc-th { position:absolute; left:50%; top:50%; width:52px; height:34px; border-radius:12px; background:linear-gradient(#f6f9fb,#b8c6d0); box-shadow:0 3px 8px #000a; transform:translate(-50%,-50%); }
.wcc-th em { position:absolute; left:10px; right:10px; top:50%; height:3px; margin-top:-1px; background:#37474f; border-radius:2px; }
.wcc-trk.in .wcc-th { background:linear-gradient(#ffd3b5,#ff9f6b); } .wcc-trk.out .wcc-th { background:linear-gradient(#c6f5d6,#6fe0a0); }
.wcc-col { display:flex; flex-direction:column; gap:6px; min-width:0; }
.wcc-g { display:flex; gap:6px; }
.wcc-b { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; min-width:64px; min-height:50px; padding:4px 6px; border-radius:11px; border:1px solid #4b6070; background:linear-gradient(#27333e,#1a232c); cursor:pointer; font-weight:800; }
.wcc-b i { display:block; width:20px; height:20px; } .wcc-b svg { width:100%; height:100%; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.wcc-b .l { font-size:10px; letter-spacing:.04em; } .wcc-b .s { font-size:9.5px; color:#9fb3c2; font-weight:900; }
.wcc-b.on { background:linear-gradient(#ffcf5a,#e09a14); color:#1a1405; border-color:#ffe08a; } .wcc-b.on .s { color:#3a2a00; }
.wcc-b.busy { background:linear-gradient(#58b6ff,#2a7fd6); color:#04101c; animation:wccBusy 1s linear infinite; }
@keyframes wccBusy { 50% { filter:brightness(1.3); } }
.wcc-brake.on { background:linear-gradient(#ff8070,#d6402e); border-color:#ffb0a2; color:#fff; } .wcc-brake.on .s { color:#ffe0da; }
.wcc-rot { display:flex; gap:6px; align-items:stretch; }
.wcc-adj { display:flex; align-items:center; gap:3px; }
.wcc-adj button { width:34px; min-height:42px; border-radius:9px; border:1px solid #4b6070; background:#1d2832; font:900 18px/1 system-ui; cursor:pointer; }
.wcc-v { min-width:44px; text-align:center; } .wcc-v b { display:block; font:900 16px/1.1 ui-monospace,Menlo,monospace; } .wcc-v small { font:800 8.5px/1 system-ui; color:#8fa7b8; } .wcc-v.dim b { color:#6d7f8c; }
.wcc-tq { min-width:54px; text-align:center; align-self:center; } .wcc-tq b { display:block; font:900 14px ui-monospace,monospace; } .wcc-tq small { display:block; font:800 8px/1.1 system-ui; color:#8fa7b8; }
.wcc-pp { display:flex; flex-direction:column; gap:4px; padding:5px; border-radius:11px; border:1px solid #33434f; } .wcc-pp.on { border-color:#4cd0ff; box-shadow:0 0 10px #4cd0ff55 inset; }
.wcc-pp .wcc-b { flex-direction:row; gap:5px; min-height:40px; } .wcc-pp .wcc-b i { width:16px; height:16px; }
.wcc-pcol { min-width:122px; }
.wcc.idle .wcc-ctl { opacity:.5; filter:saturate(.4); }
.wcc-next { position:relative; animation:wccGlow 1.1s ease-in-out infinite; z-index:1; }
@keyframes wccGlow { 0%,100% { box-shadow:0 0 0 2px #ffd24a, 0 0 8px 2px #ffd24a66; } 50% { box-shadow:0 0 0 3px #ffd24a, 0 0 22px 6px #ffd24aaa; } }
@media (prefers-reduced-motion:reduce) { .wcc-next, .wcc-b.busy { animation:none; } .wcc-next { box-shadow:0 0 0 3px #ffd24a; } }
/* desktop: scene is the majority of the width */
@media (min-width:901px) {
  main#wrap { grid-template-columns:minmax(0,2.5fr) minmax(220px,.62fr) minmax(200px,.5fr); }
  body.wcc-on #pane-site .b3-host { height:min(calc(100vh - 150px),800px); }
  .wcc-ctl { gap:12px; padding:10px; } .wcc-trk { height:200px; }
}
/* phone: compact dock, scene stays large */
@media (max-width:600px) {
  .wcc-hud { grid-template-columns:repeat(4,auto); gap:3px; } .wcc-t { min-width:0; padding:2px 5px; } .wcc-t b { font-size:12px; } .wcc-t small { font-size:7px; }
  .wcc-wi { display:none; }
  .wcc-pre { flex-direction:row; flex-wrap:wrap; justify-content:flex-start; left:6px; right:6px; top:auto; bottom:calc(var(--dock,206px) + 12px); }
  .wcc-chip { min-height:30px; padding:4px 9px; font-size:10px; }
  .wcc-ctl { left:0; right:0; bottom:0; max-width:none; border-radius:14px 14px 0 0; gap:5px; padding:6px; overflow:hidden; }
  .wcc-lv { width:60px; } .wcc-trk { width:52px; height:132px; } .wcc-th { width:44px; height:28px; }
  .wcc-b { min-width:48px; min-height:42px; padding:3px 3px; } .wcc-b .l { font-size:8.5px; } .wcc-b i { width:16px; height:16px; }
  .wcc-adj button { width:28px; min-height:36px; } .wcc-pcol { min-width:96px; } .wcc-v { min-width:32px; } .wcc-v b { font-size:13px; }
  .wcc-tq { display:none; }
}

/* v98 layout: the 3D rig fills the view card (tablet + desktop); phone keeps its flex column */
@media (min-width:601px) {
  main#wrap > .viewcard:has(.r3-host) { display:flex; flex-direction:column; overflow:hidden; }
  main#wrap > .viewcard:has(.r3-host) .vrow { display:flex; flex:1 1 auto; min-height:0; }
  main#wrap > .viewcard:has(.r3-host) #viewbox { flex:1 1 auto; min-height:0; width:100%; }
  #viewbox #pane-site.is-3d:not([hidden]) { height:100%; }
  #viewbox #pane-site.is-3d .b3-host, #viewbox #pane-site .r3-host { height:100%; min-height:0; max-height:none; }
}
@media (min-width:901px) { body.wcc-on #kpis { display:none; } .wcc-trk { height:150px; } .wcc-ctl { padding:8px; } }
/* v98 compact desktop console: pumps in single rows, presets in a right column */
.wcc svg { min-height:0 !important; max-height:none !important; width:100%; height:100%; margin:0; display:block; }
.wcc-pp { flex-direction:row; align-items:center; gap:5px; padding:4px; } .wcc-pp .wcc-b { min-width:92px; min-height:38px; } .wcc-pcol { min-width:0; }
.wcc-pre { top:42px; right:6px; }
@media (min-width:601px) { .wcc-hud { max-width:calc(50% - 20px); } }
@media (max-width:600px) { .wcc-pre { top:auto; left:6px; right:6px; flex-direction:row; flex-wrap:wrap; justify-content:flex-start; bottom:calc(var(--dock,200px) + 8px); } .wcc-pp .wcc-b { min-width:60px; } }

.r3-inset{position:absolute;z-index:4;border:2px solid rgba(255,196,60,.85);border-radius:10px;pointer-events:none;box-shadow:0 4px 18px rgba(0,0,0,.5)}
.r3-inset span{position:absolute;left:6px;top:4px;font:700 10px/1 system-ui,sans-serif;letter-spacing:.12em;color:#ffc43c;text-shadow:0 1px 2px #000}

/* v98 desktop: console is a left rail, the 3D scene gets the rest of the card (never covered) */
@media (min-width:901px) {
  body.wcc-on .r3-host { margin-left:246px; width:calc(100% - 246px); }
  body.wcc-on .wcc-hud { left:254px; }
  .wcc-ctl { top:6px; bottom:6px; left:6px; width:236px; max-width:236px; display:grid; grid-template-columns:auto 1fr; grid-template-rows:auto 1fr; gap:8px; overflow:auto; align-content:start; }
  .wcc-ctl .wcc-fold { display:none; }
  .wcc-lv { grid-column:1; } .wcc-col:not(.wcc-pcol) { grid-column:2; min-width:0; display:flex; flex-direction:column; gap:6px; }
  .wcc-pcol { grid-column:1 / -1; display:flex; flex-direction:column; gap:6px; }
  .wcc-pp { display:grid; grid-template-columns:1fr; gap:4px; }
  .wcc-rot { display:flex; flex-wrap:wrap; gap:4px; }
  .wcc-trk { height:170px; }
}

/* v98 phone: compact HUD, single-row presets, slim dock so the scene stays large */
@media (max-width:600px) {
  .wcc-hud { top:36px; left:4px; grid-template-columns:repeat(4,auto); }
  .wcc-hud .wcc-t[data-wk=hole], .wcc-hud .wcc-t[data-wk=rop], .wcc-hud .wcc-t[data-wk=spp], .wcc-hud .wcc-t[data-wk=pit] { display:none; }
  .wcc-pre { top:4px; right:4px; left:4px; flex-direction:row; flex-wrap:nowrap; overflow-x:auto; gap:4px; }
  .wcc-pre .wcc-chip { flex:0 0 auto; min-height:28px; padding:2px 9px; font-size:11px; }
  .wcc-pre .wcc-ic, .wcc-pre .wcc-orb, .wcc-pre .wcc-sp { display:none; }
  .wcc-trk { height:104px !important; width:46px !important; } .wcc-lv { width:50px !important; }
  .wcc-b { min-height:40px; }
}
@media (max-width:600px) {
  .wcc-pre { top:4px !important; bottom:auto !important; }
  .wcc-ctl { display:grid !important; grid-template-columns:54px 1fr 1fr; align-items:start; gap:6px; padding:6px; }
  .wcc-ctl .wcc-fold { display:none; }
  .wcc-col, .wcc-pcol { min-width:0 !important; display:flex; flex-direction:column; gap:4px; }
  .wcc-g { display:grid; grid-template-columns:1fr 1fr; gap:4px; }
  .wcc-rot { display:flex; flex-wrap:wrap; gap:4px; }
  .wcc-pp { display:flex; flex-direction:column; gap:3px; }
  .wcc-pp .wcc-b { min-width:0 !important; width:100%; }
  .wcc-pp .wcc-adj, .wcc-rot .wcc-adj { display:flex; justify-content:space-between; align-items:center; }
}

/* v98 phone R3b: scene full-width; legacy action rail becomes a slim strip under the scene while the drill console is on */
@media (max-width:600px) {
  body[data-mt=well].wcc-on .vrow { flex-direction:column; gap:4px; }
  body[data-mt=well].wcc-on #mrail { flex:0 0 auto; width:100%; flex-direction:row; align-items:stretch; gap:4px; overflow-x:auto; overflow-y:hidden; }
  body[data-mt=well].wcc-on #mrail .mr-acts { flex-direction:row; flex:1 1 auto; gap:4px; overflow-x:auto; }
  body[data-mt=well].wcc-on #mrail .mr-acts .b { min-height:34px; min-width:84px; flex:0 0 auto; flex-direction:row; font-size:10.5px; }
  body[data-mt=well].wcc-on #mrail .mr-acts .b i { display:none; }
  body[data-mt=well].wcc-on #mrail .mr-acts .b.done { display:none; }
  body[data-mt=well].wcc-on #mrail .mr-chips, body[data-mt=well].wcc-on #mrail .chips { display:none; }
  .wcc-trk { height:84px !important; } .wcc-b { min-height:34px; }
}
@media (max-width:600px) {
  body[data-mt=well].wcc-on main#wrap, body[data-mt=well].wcc-on .viewcard, body[data-mt=well].wcc-on .vrow { min-width:0; max-width:100%; width:100%; }
  body[data-mt=well].wcc-on #viewbox { width:100%; max-width:100%; min-width:0; }
  body[data-mt=well].wcc-on #mrail { min-width:0; max-width:100%; contain:inline-size; }
}
/* v98 phone R3c: slim ~142px dock below a dedicated scene area (dock never covers the rig/hole) */
@media (max-width:600px) {
  body[data-mt=well].wcc-on #kpis { display:none; }
  body[data-mt=well].wcc-on .r3-host { height:calc(100% - 148px) !important; }
  .wcc-ctl { padding:5px !important; gap:5px !important; grid-template-columns:50px 1fr 1fr !important; }
  .wcc-h { display:none !important; }
  .wcc-trk { height:92px !important; }
  .wcc-b { min-height:32px !important; }
  .wcc-pp { gap:2px !important; } .wcc-pp .wcc-adj button { min-height:26px !important; height:26px; width:30px; }
  .wcc-adj .wcc-v b { font-size:12px; } .wcc-adj .wcc-v small { font-size:7px; }
  .wcc-rot .wcc-adj button { min-height:28px !important; height:28px; }
  .wcc-ctl .wcc-b i { width:14px !important; height:14px !important; }
}
@media (max-width:600px) {
  .wcc-pp, .wcc-rot { display:flex !important; flex-direction:row !important; flex-wrap:nowrap !important; align-items:stretch; gap:3px !important; }
  .wcc-pp .wcc-b, .wcc-rot .wcc-b { flex:1 1 0; min-width:0 !important; width:auto !important; padding:2px 2px; }
  .wcc-pp .wcc-b .l, .wcc-rot .wcc-b .l { font-size:8px; line-height:1.05; }
  .wcc-pp .wcc-adj, .wcc-rot .wcc-adj { flex:0 0 auto; display:flex; align-items:center; gap:1px; }
  .wcc-pp .wcc-adj button, .wcc-rot .wcc-adj button { width:23px !important; min-height:34px !important; height:34px; padding:0; }
  .wcc-adj .wcc-v { min-width:22px !important; } .wcc-adj .wcc-v small { display:none; } .wcc-adj .wcc-v b { font-size:11px; }
  .wcc-ctl { grid-template-columns:46px 1fr 1fr !important; }
  .wcc-lv { width:46px !important; } .wcc-trk { width:42px !important; }
}
.wcc-ctl[hidden], .wcc[hidden], .wcc-hud[hidden] { display:none !important; }



/* ===== v99 phone: scene unobstructed (≥50% viewport), dock in flow below, fold toggle ===== */
@media (max-width:600px) {
  /* Always a bottom action strip on the Well tab, so Side-rail never covers BOP / Equipment / Bottom hole */
  body[data-mt=well] .vrow { flex-direction:column !important; gap:4px; }
  body[data-mt=well] #viewbox { width:100%; max-width:100%; min-width:0; flex:1 1 auto; }
  body[data-mt=well] #mrail {
    display:flex;
    flex:0 0 auto !important;
    width:100% !important;
    max-width:100%;
    min-height:34px;
    max-height:40px;
    overflow-x:auto;
    overflow-y:hidden;
    flex-direction:row !important;
    align-items:stretch;
    gap:4px;
    padding:0 4px;
    box-sizing:border-box;
  }
  body[data-mt=well] #mrail .mr-acts {
    flex-direction:row !important;
    flex:1 1 auto;
    gap:4px;
    overflow-x:auto;
    overflow-y:hidden;
  }
  body[data-mt=well] #mrail .mr-acts .b {
    min-height:32px !important;
    min-width:max-content !important;
    width:auto !important;
    flex:0 0 auto !important;
    flex-direction:row;
    font-size:10.5px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    padding:2px 8px !important;
  }
  body[data-mt=well] #mrail .mr-acts .b i { display:none; }
  body[data-mt=well] #mrail .mr-chips, body[data-mt=well] #mrail .chips { display:none !important; }

  body[data-mt=well].wcc-on #viewbox {
    display:flex;
    flex-direction:column;
    min-height:50dvh;
    position:relative;
  }
  body[data-mt=well].wcc-on #viewbox .pane:not([hidden]) {
    flex:1 1 auto;
    min-height:0;
    height:auto !important;
    overflow:hidden;
  }
  body[data-mt=well].wcc-on #pane-site.is-3d .b3-host,
  body[data-mt=well].wcc-on .r3-host,
  body[data-mt=well].wcc-on #pane-site.is-3d:not([hidden]) {
    height:100% !important;
    min-height:0 !important;
    max-height:none;
  }
  /* compact chrome so the scene can reach ~50% of the viewport */
  body[data-mt=well].wcc-on header.app-h { padding-top:max(4px,env(safe-area-inset-top)); padding-bottom:4px; }
  body[data-mt=well].wcc-on .stepper { padding-top:2px; }
  body[data-mt=well].wcc-on #mtabs { margin-top:4px; }
  body[data-mt=well].wcc-on .viewcard .tabs { margin-bottom:4px; }
  body[data-mt=well].wcc-on #kpis { display:none !important; }

  /* HUD / presets stay over the scene (positioned against #viewbox). Dock sits in flow under it. */
  body[data-mt=well].wcc-on .wcc {
    position:static;
    inset:auto;
    flex:0 0 auto;
    height:auto;
    pointer-events:none;
    z-index:6;
  }
  body[data-mt=well].wcc-on .wcc-hud,
  body[data-mt=well].wcc-on .wcc-pre,
  body[data-mt=well].wcc-on .wcc-wi,
  body[data-mt=well].wcc-on .wcc-ill { pointer-events:auto; }
  body[data-mt=well].wcc-on .wcc-ctl {
    position:relative !important;
    left:auto !important;
    right:auto !important;
    top:auto !important;
    bottom:auto !important;
    width:100%;
    max-width:none !important;
    max-height:120px;
    overflow:hidden;
    margin:0;
    border-radius:12px;
    display:grid !important;
    grid-template-columns:28px 44px 1fr 1fr !important;
    align-items:stretch;
    gap:4px !important;
    padding:4px 6px 4px 2px !important;
    pointer-events:auto;
  }
  body[data-mt=well].wcc-on .wcc-fold {
    display:flex !important;
    align-items:center;
    justify-content:center;
    width:26px;
    min-height:28px;
    padding:0;
    border:0;
    border-radius:8px;
    background:rgba(255,255,255,.06);
    cursor:pointer;
    grid-column:1;
    grid-row:1 / -1;
    pointer-events:auto;
  }
  body[data-mt=well].wcc-on .wcc-fold i {
    display:block;
    width:8px;
    height:8px;
    border:solid #d5e4ee;
    border-width:0 2px 2px 0;
    transform:rotate(45deg);
    margin-top:-4px;
  }
  body.wcc-folded[data-mt=well] .wcc-fold i {
    transform:rotate(-135deg);
    margin-top:4px;
  }
  body.wcc-folded[data-mt=well] .wcc-ctl {
    max-height:36px !important;
    height:36px;
    padding:0 8px 0 2px !important;
    grid-template-columns:36px 1fr !important;
    align-items:center;
  }
  body.wcc-folded[data-mt=well] .wcc-ctl > :not(.wcc-fold) { display:none !important; }
  body.wcc-folded[data-mt=well] .wcc-fold::after {
    content:"CONSOLE";
    font:800 10px/1 system-ui,sans-serif;
    letter-spacing:.08em;
    color:#cfe0ea;
    margin-inline-start:8px;
  }
  body.wcc-folded[data-mt=well] .wcc-fold {
    width:auto;
    flex-direction:row;
    justify-content:flex-start;
    padding:0 10px;
    grid-column:1 / -1;
  }
  /* Hide hoist HUD / dock on every tab except Wellsite, and whenever the drill console is off */
  body[data-mt=well] #viewbox:has(#pane-site[hidden]) .wcc,
  body:not(.wcc-on) .wcc-hud,
  body:not(.wcc-on) .wcc-pre,
  body:not(.wcc-on) .wcc-wi,
  body:not(.wcc-on) .wcc-ctl { display:none !important; }
  body[data-mt=well].wcc-on #viewbox > .chips,
  body[data-mt=well].wcc-on .zhint { display:none !important; }
  /* Pump label / status no longer overlap the button */
  body[data-mt=well].wcc-on .wcc-pp .wcc-b {
    flex-direction:column !important;
    gap:0 !important;
    min-width:0 !important;
    width:auto !important;
    overflow:hidden;
    padding:2px 3px !important;
  }
  body[data-mt=well].wcc-on .wcc-pp .wcc-b .l,
  body[data-mt=well].wcc-on .wcc-pp .wcc-b .s {
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    line-height:1.1;
  }
  body[data-mt=well].wcc-on .wcc-pp .wcc-b .l { font-size:8px; }
  body[data-mt=well].wcc-on .wcc-pp .wcc-b .s { font-size:7.5px; }
  body[data-mt=well].wcc-on .wcc-hud {
    top:34px;
    left:4px;
    right:auto;
    max-width:calc(100% - 128px);
  }
  body[data-mt=well].wcc-on .wcc-pre { top:4px !important; bottom:auto !important; left:4px; right:4px; }
  body[data-mt=well].wcc-on .r3-inset { z-index:3; }
  body[data-mt=well].wcc-on .wcc-trk { height:76px !important; }
}

/* Desktop: scene stays unobstructed (existing left-rail layout). */
@media (min-width:901px) {
  body.wcc-on .r3-host { margin-left:246px; width:calc(100% - 246px); }
}
