/*
 * OEE Live dashboard (/production/oee-live) — ported from the approved mockup
 * docs/SSTP-DOCS/20-MAN-HINH/2-PM/3-REPORT/sunjin-oee-live.html.
 *
 * Every class is prefixed `oee-` and every rule sits under `.oee-scope`, so nothing here reaches the rest of
 * the app. The tokens are the mockup's own; dark mode follows the app-bar toggle through the same marker
 * app.css uses for .qm-scope. Red keeps one meaning on this screen: trip.
 */
.oee-scope{
  --bg:#edf1f4; --surface:#ffffff; --surface-2:#f6f8fa; --line:#dde4ea; --line-2:#ebeff3;
  --ink:#0f1a24; --ink-2:#384654; --muted:#637180; --faint:#97a2ad;
  --accent:#0e9f8e; --accent-ink:#0a6e64; --accent-soft:#e0f2ef;
  --good:#0ca30c; --good-ink:#0a7a0a; --good-soft:#e6f4e6; --good-line:#bfe2bf;
  --warn:#f0a500; --warn-ink:#865700; --warn-soft:#fff5dc; --warn-line:#f0d185;
  --crit:#d03b3b; --crit-ink:#b02121; --crit-soft:#fdeceb; --crit-line:#f2b9b9;
  --idle:#a3adb8; --idle-soft:#eef1f4; --idle-seg:#d6dce3;
  --s1:#2a78d6; --s2:#eb6834; --band:#dcf0ec; --scrim:rgba(12,20,28,.45);
  --shadow:0 1px 2px rgba(15,26,36,.05);
  --sans:"Be Vietnam Pro","Segoe UI",system-ui,-apple-system,"Malgun Gothic","Apple SD Gothic Neo",sans-serif;
  --mono:"JetBrains Mono",ui-monospace,Consolas,monospace;
}
:root:has(.app-theme-marker[data-app-theme="dark"]) .oee-scope{
  --bg:#0c1217; --surface:#141c24; --surface-2:#19222c; --line:#27333f; --line-2:#1f2a35;
  --ink:#eef2f6; --ink-2:#c4cdd6; --muted:#94a2b0; --faint:#67737f;
  --accent:#22b5a3; --accent-ink:#62d4c6; --accent-soft:#12302d;
  --good-ink:#62dd78; --good-soft:#11291a; --good-line:#1e5a30;
  --warn:#fab219; --warn-ink:#f8c65a; --warn-soft:#2b2410; --warn-line:#6b5314;
  --crit:#e04b4b; --crit-ink:#f28a8a; --crit-soft:#341919; --crit-line:#6e2a2a;
  --idle:#6d7a87; --idle-soft:#212b35; --idle-seg:#2e3a46;
  --s1:#3987e5; --s2:#d95926; --band:#143330; --scrim:rgba(0,0,0,.6);
  --shadow:none;
}

.oee-scope{background:var(--bg);color:var(--ink);font-family:var(--sans);font-size:14px;line-height:1.45;-webkit-font-smoothing:antialiased;padding:16px;border-radius:10px;display:flex;flex-direction:column;gap:18px}

.oee-scope * {
box-sizing:border-box
}

.oee-scope button {
font:inherit;color:inherit;cursor:pointer
}

.oee-scope button:focus-visible,
.oee-scope a:focus-visible,
.oee-scope [tabindex]:focus-visible {
outline:2px solid var(--accent);outline-offset:2px
}

.oee-scope .oee-mono {
font-family:var(--mono);font-variant-numeric:tabular-nums
}

.oee-scope .oee-num {
font-variant-numeric:tabular-nums
}

.oee-scope .oee-eyebrow {
font-size:11px;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:600
}

.oee-scope .oee-live {
display:inline-flex;align-items:center;gap:6px;color:var(--good-ink);font-weight:600;white-space:nowrap
}

.oee-scope .oee-pulse {
width:8px;height:8px;border-radius:50%;background:var(--good);box-shadow:0 0 0 0 rgba(12,163,12,.5);animation:oee-pulse 2s infinite
}

@keyframes oee-pulse{
70%{
box-shadow:0 0 0 7px rgba(12,163,12,0)
}

100%{
box-shadow:0 0 0 0 rgba(12,163,12,0)
}

}

.oee-scope .oee-card {
background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow)
}

.oee-scope .oee-card-h {
display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap
}

.oee-scope .oee-card-h h2 {
font-size:15px;margin:0;font-weight:700
}

.oee-scope .oee-sub {
font-size:12px;color:var(--muted)
}

.oee-scope .oee-legend {
display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--muted)
}

.oee-scope .oee-legend span {
display:inline-flex;align-items:center;gap:6px
}

.oee-scope .oee-sw {
width:12px;height:10px;border-radius:2px;display:inline-block
}

.oee-scope .oee-dot {
width:8px;height:8px;border-radius:50%;display:inline-block;flex-shrink:0
}

.oee-scope .oee-banner {
display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;background:var(--crit-soft);border:1px solid var(--crit-line);color:var(--crit-ink);border-radius:10px;padding:10px 16px;font-weight:600;animation:oee-flash 1.2s ease-in-out 2
}

@keyframes oee-flash{
50%{
background:var(--surface)
}

}

.oee-scope .oee-kpis {
display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px
}

.oee-scope .oee-kpi {
padding:14px 18px;display:flex;flex-direction:column;gap:4px
}

.oee-scope .oee-kpi .oee-big {
font-size:32px;font-weight:800;line-height:1.1;letter-spacing:-.02em;font-variant-numeric:tabular-nums
}

.oee-scope .oee-kpi .oee-big small {
font-size:16px;color:var(--muted);font-weight:600;letter-spacing:0
}

.oee-scope .oee-kpi.oee-attn {
background:var(--warn-soft);border-color:var(--warn-line)
}

.oee-scope .oee-kpi.oee-attn .oee-eyebrow {
color:var(--warn-ink)
}

.oee-scope .oee-kpi.oee-ok .oee-big {
color:var(--good-ink)
}

.oee-scope .oee-apq {
display:flex;gap:12px;font-size:12px;color:var(--muted)
}

.oee-scope .oee-apq b {
color:var(--ink)
}

.oee-scope .oee-pill {
display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:700;padding:3px 9px;border-radius:999px;letter-spacing:.03em;white-space:nowrap;font-variant-numeric:tabular-nums
}

.oee-scope .oee-pill.oee-s-run {
background:var(--good-soft);color:var(--good-ink)
}

.oee-scope .oee-pill.oee-s-idle {
background:var(--idle-soft);color:var(--muted)
}

.oee-scope .oee-pill.oee-s-stop {
background:var(--warn-soft);color:var(--warn-ink)
}

.oee-scope .oee-pill.oee-s-trip {
background:var(--crit);color:#fff
}

.oee-scope .oee-pill.oee-s-run::before {
content:"";width:7px;height:7px;border-radius:50%;background:var(--good);animation:oee-pulse 2s infinite
}

.oee-scope .oee-flow-scroll {
overflow-x:auto;padding-bottom:4px
}

.oee-scope .oee-flow {
display:grid;grid-template-columns:minmax(190px,1fr) 44px minmax(190px,1fr) 44px minmax(230px,1.2fr) 44px minmax(260px,1.4fr);align-items:center;min-width:1020px;height:284px
}

.oee-scope .oee-stack {
display:grid;grid-template-rows:repeat(3,88px);gap:10px
}

.oee-scope .oee-conn {
width:44px;height:284px;display:block
}

.oee-scope .oee-conn path {
stroke:var(--idle-seg);stroke-width:2;fill:none
}

.oee-scope .oee-conn.oee-on path.oee-f {
stroke:var(--accent);stroke-dasharray:6 6;animation:oee-dash 1s linear infinite
}

@keyframes oee-dash{
to{
stroke-dashoffset:-12
}

}

.oee-scope .oee-node {
text-align:left;border:1px solid var(--line);background:var(--surface-2);border-radius:10px;padding:10px 13px;display:flex;flex-direction:column;gap:3px;min-width:0;height:100%;transition:border-color .2s,background .2s
}

.oee-scope .oee-node:hover {
border-color:var(--faint)
}

.oee-scope .oee-node[data-state="run"] {
background:var(--good-soft);border-color:var(--good-line)
}

.oee-scope .oee-node[data-state="stop"] {
background:var(--warn-soft);border-color:var(--warn-line)
}

.oee-scope .oee-node[data-state="trip"] {
background:var(--crit-soft);border-color:var(--crit-line)
}

.oee-scope .oee-node-h {
display:flex;justify-content:space-between;align-items:center;gap:8px
}

.oee-scope .oee-node-t {
font-size:14px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}

.oee-scope .oee-node-s {
font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}

.oee-scope .oee-node.oee-tall {
height:150px
}

.oee-scope .oee-scales {
display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin:4px 0
}

.oee-scope .oee-scales span {
border:1px solid var(--line);border-radius:5px;text-align:center;font-size:11px;font-weight:600;padding:4px 0;background:var(--surface);transition:all .2s
}

.oee-scope .oee-scales span.oee-on {
background:var(--accent);border-color:var(--accent);color:#fff
}

.oee-scope .oee-prog {
height:6px;background:var(--line-2);border-radius:3px;overflow:hidden
}

.oee-scope .oee-prog i {
display:block;height:100%;background:var(--accent);border-radius:3px;transition:width .9s linear
}

.oee-scope .oee-pcards {
display:grid;grid-template-columns:repeat(auto-fit,minmax(330px,1fr));gap:14px
}

.oee-scope .oee-pcard {
padding:16px 18px;display:flex;flex-direction:column;gap:12px
}

.oee-scope .oee-pc-head {
display:flex;justify-content:space-between;align-items:flex-start;gap:10px
}

.oee-scope .oee-pc-head .oee-t {
font-size:18px;font-weight:800;letter-spacing:-.01em
}

.oee-scope .oee-note {
font-size:12px;color:var(--muted);background:var(--surface-2);border-radius:6px;padding:6px 10px
}

.oee-scope .oee-metrics {
display:flex;flex-direction:column;gap:11px;transition:opacity .4s
}

.oee-scope .oee-metrics.oee-dim {
opacity:.42
}

.oee-scope .oee-mrow {
display:grid;grid-template-columns:132px minmax(0,1fr) 100px;align-items:center;gap:12px
}

.oee-scope .oee-mrow .oee-l {
font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px
}

.oee-scope .oee-mrow .oee-v {
font-size:20px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.2
}

.oee-scope .oee-mrow .oee-v small {
font-size:12px;color:var(--muted);font-weight:500
}

.oee-scope .oee-mrow.oee-hot .oee-v {
color:var(--warn-ink)
}

.oee-scope .oee-chip-w {
font-size:10px;font-weight:700;background:var(--warn);color:#2a1d00;border-radius:4px;padding:1px 5px
}

.oee-scope .oee-rng {
position:relative;height:8px;background:var(--line-2);border-radius:4px
}

.oee-scope .oee-rng .oee-band {
position:absolute;top:0;height:8px;background:var(--band);border-radius:4px
}

.oee-scope .oee-rng .oee-mk {
position:absolute;top:-3px;width:3px;height:14px;border-radius:2px;background:var(--ink);transition:left .9s linear;margin-left:-1px
}

.oee-scope .oee-rng-l {
display:flex;justify-content:space-between;font-size:10px;color:var(--faint);margin-top:3px
}

.oee-scope .oee-spark {
width:100px;height:30px;display:block;overflow:visible
}

.oee-scope .oee-pc-foot {
display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--muted);border-top:1px solid var(--line-2);padding-top:10px
}

.oee-scope .oee-pc-foot b {
color:var(--ink);font-variant-numeric:tabular-nums
}

.oee-scope .oee-avail {
display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted)
}

.oee-scope .oee-bar {
flex:1;height:8px;background:var(--line-2);border-radius:4px;overflow:hidden
}

.oee-scope .oee-bar i {
display:block;height:100%;background:var(--accent);border-radius:4px;transition:width .6s
}

.oee-scope .oee-link {
border:0;background:none;padding:0;color:var(--accent-ink);font-weight:600;font-size:12.5px
}

.oee-scope .oee-link:hover {
text-decoration:underline
}

.oee-scope .oee-tl {
display:flex;flex-direction:column;gap:7px
}

.oee-scope .oee-tl-row {
display:grid;grid-template-columns:96px minmax(0,1fr) 64px;align-items:center;gap:12px
}

.oee-scope .oee-tl-row .oee-n {
font-size:12px;font-weight:600;color:var(--ink-2);border:0;background:none;padding:0;text-align:left
}

.oee-scope .oee-track {
position:relative;height:20px;background:var(--surface-2);border-radius:3px;overflow:hidden
}

.oee-scope .oee-track i {
position:absolute;top:0;height:20px
}

.oee-scope .oee-k-run {
background:var(--good)
}

.oee-scope .oee-k-idle {
background:var(--idle-seg)
}

.oee-scope .oee-k-stop {
background:var(--crit)
}

.oee-scope .oee-k-trip {
background:var(--crit)
}

.oee-scope .oee-axis {
position:relative;height:14px;font-size:10px;color:var(--faint)
}

.oee-scope .oee-axis span {
position:absolute;transform:translateX(-50%);white-space:nowrap
}

.oee-scope .oee-two {
display:grid;grid-template-columns:repeat(auto-fit,minmax(360px,1fr));gap:14px
}

.oee-scope .oee-ev {
display:grid;grid-template-columns:62px 10px 88px minmax(0,1fr);gap:10px;align-items:center;padding:7px 0;border-bottom:1px solid var(--line-2);font-size:13px
}

.oee-scope .oee-ev:last-child {
border-bottom:0
}

.oee-scope .oee-ev.oee-new {
animation:oee-evin 1.6s ease-out
}

@keyframes oee-evin{
from{
background:var(--accent-soft)
}

to{
background:transparent
}

}

.oee-scope .oee-ev b {
font-weight:600
}

.oee-scope .oee-par {
display:grid;grid-template-columns:150px minmax(0,1fr) 52px;gap:12px;align-items:center;padding:4px 0;font-size:13px
}

.oee-scope .oee-par .oee-b {
height:14px;background:var(--surface-2);border-radius:0 4px 4px 0
}

.oee-scope .oee-par .oee-b i {
display:block;height:100%;background:var(--s1);border-radius:0 4px 4px 0;transition:width .6s
}

.oee-scope .oee-par .oee-b i.oee-un {
background:var(--idle)
}

.oee-scope .oee-pend {
display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;border-radius:8px;padding:9px 13px;font-size:13px;background:var(--warn-soft);border:1px solid var(--warn-line)
}

.oee-scope .oee-pend.oee-trip {
background:var(--crit-soft);border-color:var(--crit-line)
}

@media (max-width:640px){
.oee-scope .oee-top-in {
padding:10px 16px
}

.oee-scope .oee-wrap {
padding:16px 16px 90px
}

.oee-scope .oee-mrow {
grid-template-columns:112px minmax(0,1fr) 72px;gap:8px
}

.oee-scope .oee-spark {
width:72px
}

.oee-scope .oee-tl-row {
grid-template-columns:70px minmax(0,1fr) 52px;gap:8px
}

.oee-scope .oee-par {
grid-template-columns:110px minmax(0,1fr) 44px
}

.oee-scope .oee-ev {
grid-template-columns:44px 10px 74px minmax(0,1fr);gap:7px;font-size:12px
}

.oee-scope .oee-tv {
padding-left:16px;padding-right:16px
}

.oee-scope .oee-reasons {
grid-template-columns:1fr
}

}

@media (prefers-reduced-motion:reduce){
.oee-scope *,
.oee-scope *::before {
animation:none!important;transition:none!important
}

}

/* ---- additions that are not in the mockup ---------------------------------------------------------- */

/* Unknown: the tag could not be read. Never drawn as idle or stopped (RFC-0005 §4) — hatched and dotted so it
   is distinguishable without colour, like trip below. */
.oee-scope .oee-k-unknown {
  background: repeating-linear-gradient(45deg, var(--idle-seg) 0 3px, transparent 3px 6px);
  box-shadow: inset 0 0 0 1px var(--faint);
}

/* Trip is hatched as well as red: the timeline must read in greyscale and to colour-blind viewers. */
.oee-scope .oee-k-trip {
  background: repeating-linear-gradient(135deg, var(--crit) 0 4px, color-mix(in srgb, var(--crit) 55%, #fff) 4px 8px);
}

.oee-scope .oee-pill.oee-s-unknown {
  background: var(--idle-soft);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--faint);
}

.oee-scope .oee-node[data-state="unknown"] {
  background: var(--surface-2);
  border-style: dashed;
}

.oee-scope .oee-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
}

.oee-scope .oee-toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.oee-scope .oee-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.oee-scope .oee-chip.oee-chip-warn {
  background: var(--warn-soft);
  border-color: var(--warn-line);
  color: var(--warn-ink);
}

.oee-scope .oee-stale {
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  color: var(--warn-ink);
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 600;
}

.oee-scope .oee-refresh {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 7px;
  padding: 6px 11px;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-2);
  min-height: 32px;
}

.oee-scope .oee-refresh:hover:not(:disabled) {
  border-color: var(--faint);
}

.oee-scope .oee-refresh:disabled {
  opacity: 0.5;
  cursor: default;
}

/* A slot the mockup fills but this build has no data for — says so instead of showing an invented number. */
.oee-scope .oee-nosource {
  font-size: 11.5px;
  color: var(--faint);
  font-style: italic;
}

.oee-scope .oee-spark-empty {
  display: block;
  width: 100px;
  height: 30px;
  border-bottom: 1px dashed var(--line);
}

@media (max-width: 640px) {
  .oee-scope {
    padding: 10px;
    border-radius: 0;
  }
}

/* Pellet card rows without the mockup's range gauge (there are no per-product limits to draw): value and
   sparkline only, the sparkline taking the width the gauge used. */
.oee-scope .oee-mrow.oee-mrow-2 {
  grid-template-columns: 150px minmax(0, 1fr);
}

.oee-scope .oee-mrow-2 .oee-spark {
  width: 100%;
  height: 34px;
}

.oee-scope .oee-live-off {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--warn-ink);
  font-weight: 600;
}

.oee-scope .oee-live-off .oee-pulse {
  background: var(--warn);
  animation: none;
  box-shadow: none;
}

/* ---- sub-navigation, tables, TV wall (Plan B3) ------------------------------------------------------- */

.oee-scope .oee-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.oee-scope .oee-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.oee-scope .oee-nav a:hover {
  color: var(--ink);
}

.oee-scope .oee-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.oee-scope .oee-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.oee-scope .oee-table-wrap {
  overflow-x: auto;
}

.oee-scope .oee-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
}

.oee-scope .oee-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.oee-scope .oee-table td {
  font-size: 13px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-2);
  font-variant-numeric: tabular-nums;
}

/* TV wall: always dark, whatever the app theme, and sized to be read from across the floor. */
.oee-scope.oee-tv {
  --bg: #0c1217; --surface: #151e27; --surface-2: #19222c; --line: #243140; --line-2: #1f2a35;
  --ink: #f1f4f7; --ink-2: #c4cdd6; --muted: #8f9dab; --faint: #5f6c78;
  --good-ink: #62dd78; --good-soft: #12301b; --warn-ink: #f8c65a; --warn-soft: #2b2410;
  --crit-ink: #ffb3b3; --idle-soft: #243140; --accent: #22b5a3; --accent-ink: #62d4c6; --accent-soft: #12302d;
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: auto;
  border-radius: 0;
  padding: 28px 36px;
  gap: 22px;
}

.oee-scope .oee-tv-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.oee-scope .oee-tv-brand {
  font-size: clamp(24px, 2.6vw, 40px);
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.oee-scope .oee-tv-brand i {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 3px;
  display: inline-block;
}

.oee-scope .oee-tv-brand span {
  font-size: 0.55em;
  color: var(--muted);
  font-weight: 600;
}

.oee-scope .oee-tv-r {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.oee-scope .oee-tv-clock {
  font-size: clamp(32px, 3.4vw, 56px);
  font-weight: 600;
  color: #cfd8e1;
}

.oee-scope .oee-tv-exit {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.oee-scope .oee-tv-exit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.oee-scope .oee-tv-stale {
  background: #5a1616;
  color: #ffd6d6;
  border: 1px solid #b83a3a;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: clamp(16px, 1.4vw, 22px);
  text-align: center;
}

.oee-scope .oee-tv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  flex: 1;
}

.oee-scope .oee-tvt {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.oee-scope .oee-tvt[data-state="run"] { border-color: #1f6b3a; }
.oee-scope .oee-tvt[data-state="stop"] { border-color: #8a6412; background: #211c0f; }
.oee-scope .oee-tvt[data-state="unknown"] { border-style: dashed; border-color: var(--faint); }
.oee-scope .oee-tvt[data-state="trip"] { border-color: #b83a3a; background: #2a1414; animation: oee-tvflash 1.4s infinite; }

@keyframes oee-tvflash {
  50% { border-color: #ff6b6b; }
}

.oee-scope .oee-tvt .oee-n {
  font-size: clamp(22px, 2vw, 32px);
  font-weight: 800;
}

.oee-scope .oee-tvt .oee-pill {
  font-size: clamp(13px, 1.1vw, 18px);
  padding: 6px 14px;
}

.oee-scope .oee-tvt .oee-p {
  font-size: clamp(18px, 1.6vw, 26px);
  font-weight: 700;
}

.oee-scope .oee-tv-vals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  transition: opacity 0.4s;
}

.oee-scope .oee-tv-vals > div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.oee-scope .oee-tv-vals .oee-eyebrow {
  font-size: clamp(11px, 0.9vw, 14px);
}

.oee-scope .oee-tv-vals b {
  display: block;
  font-size: clamp(30px, 3vw, 48px);
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.oee-scope .oee-tv-vals b small {
  font-size: 0.45em;
  color: var(--muted);
  font-weight: 600;
}

.oee-scope .oee-tv-bot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.oee-scope .oee-tv-bot .oee-tvt {
  padding: 16px 22px;
  gap: 4px;
}

.oee-scope .oee-tv-bot .oee-big {
  font-size: clamp(30px, 2.8vw, 44px);
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.oee-scope .oee-tv-bot .oee-big small {
  font-size: 0.45em;
  color: var(--muted);
}

/* ---- machine detail ---------------------------------------------------------------------------------- */

.oee-scope .oee-nodelink {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
}

.oee-scope .oee-nodelink:hover .oee-node {
  border-color: var(--faint);
}

.oee-scope .oee-nodelink:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.oee-scope .oee-mtabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.oee-scope .oee-mtabs a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 12.5px;
  text-decoration: none;
}

.oee-scope .oee-mtabs a[aria-current="page"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.oee-scope .oee-mtabs a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.oee-scope .oee-dhead h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.oee-scope .oee-dgrid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 940px) {
  .oee-scope .oee-dgrid {
    grid-template-columns: 1fr;
  }
}

.oee-scope .oee-avail-big {
  font-size: 50px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.oee-scope .oee-avail-big small {
  font-size: 20px;
  color: var(--muted);
}

.oee-scope .oee-stat3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.oee-scope .oee-stat3 > div {
  display: flex;
  flex-direction: column;
}

.oee-scope .oee-stat3 b {
  color: var(--ink);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.oee-scope .oee-trend svg {
  display: block;
  width: 100%;
  height: auto;
}

.oee-scope .oee-trend-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.oee-scope .oee-trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.oee-scope .oee-stop-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-2);
}

.oee-scope .oee-stop-row:last-child {
  border-bottom: 0;
}

.oee-scope .oee-table th.oee-r,
.oee-scope .oee-table td.oee-r {
  text-align: right;
}

.oee-scope .oee-table tr.oee-cur td {
  background: var(--accent-soft);
}

.oee-scope a.oee-n,
.oee-scope a.oee-link {
  text-decoration: none;
}

.oee-scope a.oee-n:hover,
.oee-scope a.oee-link:hover {
  text-decoration: underline;
}

/* ---- digital-signal strip and the dosing board ---------------------------------------------------------- */

.oee-scope .oee-drow {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.oee-scope .oee-dl {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-2);
}

.oee-scope .oee-da {
  color: var(--faint);
  font-size: 11px;
  min-width: 44px;
}

.oee-scope .oee-dtrack {
  position: relative;
  height: 14px;
  border-bottom: 1px solid var(--line);
}

.oee-scope .oee-dtrack i {
  position: absolute;
  bottom: 0;
  height: 12px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.oee-scope .oee-dtrack.oee-na {
  border: 1px dashed var(--line);
  border-radius: 3px;
  font-size: 10.5px;
  color: var(--faint);
  display: flex;
  align-items: center;
  padding-left: 8px;
  height: 16px;
  background: repeating-linear-gradient(135deg, transparent 0 6px, var(--line-2) 6px 7px);
}

.oee-scope .oee-dv {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  text-align: right;
}

.oee-scope .oee-dv.oee-on {
  color: var(--accent-ink);
  font-weight: 600;
}

.oee-scope .oee-dgap {
  height: 6px;
}

.oee-scope .oee-stiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.oee-scope .oee-stile {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--surface-2);
  transition: all 0.2s;
}

.oee-scope .oee-stile.oee-on {
  background: var(--good-soft);
  border-color: var(--good-line);
}

.oee-scope .oee-stile.oee-na {
  background: transparent;
  border-style: dashed;
}

.oee-scope .oee-stile .oee-top2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.oee-scope .oee-lamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.oee-scope .oee-lamp::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--idle-seg);
}

.oee-scope .oee-lamp.oee-on {
  color: var(--accent-ink);
  font-weight: 600;
}

.oee-scope .oee-lamp.oee-on::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

@media (max-width: 640px) {
  .oee-scope .oee-drow {
    grid-template-columns: 140px minmax(0, 1fr) 34px;
    gap: 6px;
  }

  .oee-scope .oee-da {
    display: none;
  }
}

.oee-scope .oee-dtrack i {
  min-width: 2px;
}

.oee-scope .oee-daxis {
  position: relative;
  height: 14px;
  font-size: 10px;
  color: var(--faint);
}

.oee-scope .oee-daxis span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

.oee-scope .oee-stile .oee-top2 b {
  font-size: 13px;
}

/* ---- trend chart hover: crosshair, dots and tooltip shown per strip, no JavaScript ----------------------- */

.oee-scope .oee-hit rect {
  cursor: crosshair;
  pointer-events: all;
}

.oee-scope .oee-hv {
  visibility: hidden;
  pointer-events: none;
}

.oee-scope .oee-hit:hover .oee-hv,
.oee-scope .oee-hit.oee-sync .oee-hv {
  visibility: visible;
}
