/* dash.css — the laboratory display: a control room that shows consequences, not causes. */
.dash {
  --g: var(--green);
  position: relative; min-height: 100vh; padding: 14px 20px 16px; display: flex; flex-direction: column; gap: 12px;
  font-family: var(--crt); color: #cfe9d8;
  background:
    radial-gradient(ellipse at 30% 0%, #10261a55, transparent 60%),
    repeating-linear-gradient(0deg, #ffffff05 0 1px, transparent 1px 3px),
    var(--bg);
  overflow: hidden;
}
.dash[data-level=low] { background-color: #140c0b; }
.dash[data-level=crit] { background-color: #1c0808; animation: critBg 1.2s infinite; }
@keyframes critBg { 50% { background-color: #2a0a0a; } }
.d-top { display: flex; align-items: center; gap: 18px; border-bottom: 2px solid #1f3b2b; padding-bottom: 8px; padding-right: 56px; }
.d-title { flex: 1; font-family: var(--display); letter-spacing: 0.12em; font-size: 1.35rem; color: var(--text); }
.d-code { color: var(--amber); font-family: var(--crt); font-size: 1.1rem; }
.d-phase { font-family: var(--display); letter-spacing: 0.14em; color: var(--muted); font-size: 1.05rem; }
.d-timer-box { text-align: right; }
.d-timer-label { font-size: 0.7rem; letter-spacing: 0.2em; color: var(--muted); }
.d-timer { font-size: 2.8rem; line-height: 1; color: var(--g); text-shadow: 0 0 12px #3ddc8466; }
.d-timer.ending { color: var(--red); animation: pulse 0.8s infinite; text-shadow: 0 0 16px #ff4d4d88; }
.d-main { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; flex: 1; min-height: 0; }
.d-left { display: flex; flex-direction: column; gap: 14px; }
.dash:not(.compact) .d-systems { flex: 1; align-content: space-evenly; }
.dash:not(.compact) .d-bar { height: 42px; }
.d-stab { background: #0c1510; border: 1px solid #1f3b2b; border-radius: 10px; padding: 12px 16px; }
.d-stab-label { letter-spacing: 0.25em; font-size: 0.9rem; color: var(--muted); }
.d-stab-row { display: flex; align-items: baseline; gap: 16px; }
.d-stab-num { font-size: 5rem; line-height: 1; color: var(--g); text-shadow: 0 0 18px #3ddc8466; }
.d-stab-bar { height: 16px; background: #06100a; border: 1px solid #1f3b2b; margin-top: 6px; }
.d-stab-fill { height: 100%; background: var(--green); transition: width 0.5s, background 0.5s; box-shadow: 0 0 12px currentColor; }
.d-stab-fill.mid { background: var(--yellow); }
.d-stab-fill.low { background: var(--amber); }
.d-stab-fill.crit { background: var(--red); }
.dash[data-level=mid] .d-stab-num { color: var(--yellow); }
.dash[data-level=low] .d-stab-num { color: var(--amber); }
.dash[data-level=crit] .d-stab-num { color: var(--red); animation: pulse 0.6s infinite; }
.d-systems { display: grid; gap: 10px; }
.d-sys { display: grid; grid-template-columns: 9.5em 1fr 4em 8.5em; align-items: center; gap: 12px; font-size: 1.35rem; }
.d-sys-name { letter-spacing: 0.08em; color: #b7d8c3; }
.d-bar { position: relative; height: 30px; background: #06100a; border: 1px solid #1f3b2b; overflow: hidden; }
.d-bar-fill { height: 100%; background: linear-gradient(90deg, #1d8a50, var(--green)); transition: width 0.45s ease-out; }
.d-bar-ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), #0b0f13aa calc(10% - 1px) 10%); }
.d-sys.mid .d-bar-fill { background: linear-gradient(90deg, #8a7a10, var(--yellow)); }
.d-sys.low .d-bar-fill { background: linear-gradient(90deg, #8a4b10, var(--amber)); }
.d-sys.crit .d-bar-fill { background: linear-gradient(90deg, #7a1515, var(--red)); animation: pulse 0.9s infinite; }
.d-bar-val { text-align: right; font-size: 1.5rem; }
.d-bar-delta { font-size: 1.1rem; white-space: nowrap; }
.d-bar-delta.up { color: var(--green); }
.d-bar-delta.down { color: var(--red); }
.d-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.d-h { letter-spacing: 0.22em; font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.d-em { display: grid; gap: 8px; }
.em-none { border: 1px dashed #1f3b2b; border-radius: 10px; padding: 12px; text-align: center; color: #5d8a6e; letter-spacing: 0.15em; }
.em-card { display: flex; gap: 12px; align-items: center; background: #2a0d0d; border: 2px solid var(--red); border-radius: 10px; padding: 10px 12px; color: #ffd9d9; animation: emIn 0.4s ease-out, emGlow 1.4s infinite; }
@keyframes emIn { from { transform: scale(1.2); opacity: 0; } }
@keyframes emGlow { 50% { box-shadow: 0 0 22px #ff4d4d66; } }
.em-card.urgent { animation: emGlow 0.5s infinite; background: #3a0c0c; }
.em-card.ok { background: #0c2a18; border-color: var(--green); color: #d0ffe2; animation: none; }
.em-card.fail { background: #1a1a1a; border-color: #555; color: #999; animation: none; }
.em-card.insp { background: #2a220c; border-color: var(--amber); color: #ffeac2; animation: emGlow 2s infinite; }
.em-code { font-family: var(--display); font-size: 1.8rem; font-weight: 700; background: #0006; border-radius: 6px; padding: 2px 8px; }
.em-body { flex: 1; min-width: 0; }
.em-title { font-family: var(--display); letter-spacing: 0.06em; font-size: 1.15rem; line-height: 1.15; }
.em-blurb { font-size: 0.9rem; opacity: 0.85; }
.em-left { font-size: 2rem; }
.d-spec-wrap { background: #0c1510; border: 1px solid #1f3b2b; border-radius: 10px; padding: 10px; }
.d-spec { display: grid; grid-template-columns: 110px 1fr; grid-template-rows: auto auto; gap: 2px 14px; align-items: center; }
.spec-name { grid-column: 2; font-family: var(--display); letter-spacing: 0.14em; font-size: 1.3rem; color: var(--text); align-self: end; }
.spec-art { grid-row: 1 / 3; grid-column: 1; width: 110px; height: 110px; }
.spec-status { grid-column: 2; font-size: 1.1rem; align-self: start; }
.spec-status b { color: var(--g); }
.spec-status.st-1 b { color: var(--yellow); } .spec-status.st-2 b { color: var(--amber); } .spec-status.st-3 b, .spec-status.st-4 b { color: var(--red); } .spec-status.st-5 b { color: var(--red); animation: pulse 0.5s infinite; }
.spec-none { text-align: center; color: #5d8a6e; letter-spacing: 0.12em; grid-column: 1 / 3; padding: 16px; }
.d-cond { background: #0c1510; border: 1px solid #1f3b2b; border-radius: 10px; padding: 8px 12px; }
.warn-line { color: var(--amber); font-size: 1.05rem; }
.warn-line.ok { color: var(--green); }
.d-amb { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: 0.95rem; }
.amb { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted #1f3b2b; }
.amb-name { color: var(--muted); }
.amb-val { color: var(--cyan); }
.amb-val.zero { color: var(--red); animation: pulse 1s infinite; }
.d-bottom { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; }
.d-board { display: flex; flex-wrap: wrap; gap: 6px; }
.d-board-count { color: var(--g); }
.chip { display: flex; gap: 6px; align-items: baseline; padding: 4px 8px; border-radius: 6px; border: 1px solid #2a3a30; background: #0d1410; font-size: 0.95rem; color: #9fb8a8; }
.chip b { color: var(--text); }
.chip span { font-size: 0.72rem; opacity: 0.8; }
.chip i { font-style: normal; color: var(--g); }
.chip.cert { border-color: var(--green); background: #0f2a1b; color: #c9f5da; }
.chip.fault { border-color: var(--amber); }
.chip.open { border-style: dashed; border-color: var(--yellow); }
.chip.open b::after { content: ' 🔧'; }
.chip.off { opacity: 0.55; }
.chip.off b::after { content: ' ⏻'; color: var(--red); }
.chip.pop { animation: pop 0.8s cubic-bezier(.3,1.8,.4,1); }
@keyframes pop { 0% { transform: scale(1.8); background: var(--green); } }
.d-log { display: grid; gap: 2px; font-size: 0.92rem; max-height: 10.5em; overflow: hidden; }
.log-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: logIn 0.4s ease-out; }
@keyframes logIn { from { transform: translateX(-20px); opacity: 0; } }
.log-t { color: var(--faint); }
.log-line.lvl1 { color: var(--green); } .log-line.lvl2 { color: var(--amber); } .log-line.lvl3 { color: var(--red); }

/* Banners and overlays. */
.d-banner { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) scale(0.6); opacity: 0; pointer-events: none; font-family: var(--display); font-size: clamp(2rem, 5vw, 4.4rem); letter-spacing: 0.08em; padding: 14px 34px; border-radius: 14px; background: #000d; border: 4px solid var(--text); color: var(--text); text-align: center; transition: all 0.3s cubic-bezier(.3,1.6,.5,1); z-index: 5; max-width: 90%; }
.d-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.d-banner.bad { border-color: var(--red); color: #ffd0d0; background: #3a0808ee; }
.d-banner.good { border-color: var(--green); color: #d6ffe6; background: #06301aee; }
.d-banner.warn { border-color: var(--amber); color: #ffe8c0; background: #33230aee; }
.d-banner.phase { border-color: var(--cyan); color: #d0f2ff; background: #062a3aee; }
.d-overlay { position: absolute; inset: 0; display: none; place-items: center; background: #000a; z-index: 6; }
.d-overlay.show { display: grid; }
.insp-report { background: var(--paper); color: var(--ink); padding: 24px 32px; border-radius: 8px; min-width: min(560px, 90%); font-family: var(--mono); transform: rotate(-1deg); animation: reportIn 0.5s; }
.ir-h { font-family: var(--display); font-size: 2.2rem; letter-spacing: 0.1em; border-bottom: 3px solid var(--ink); margin-bottom: 10px; }
.ir-row { display: flex; justify-content: space-between; font-size: 1.4rem; padding: 2px 0; border-bottom: 1px dotted #b3a88f; }
.ir-row b { font-family: var(--display); letter-spacing: 0.06em; }
.g-excellent, .g-sublime, .g-adorable { color: #15803d; } .g-acceptable, .g-tolerable { color: #0369a1; } .g-questionable { color: #a16207; } .g-concerning { color: #c2410c; } .g-pleaseexplain, .g-undrinkable, .g-whereisit { color: #b91c1c; }
.ir-bonus { font-family: var(--display); font-size: 1.6rem; margin-top: 10px; text-align: right; }
.exp-box { text-align: center; font-family: var(--display); color: var(--text); }
.exp-h { font-size: 2rem; letter-spacing: 0.3em; color: var(--muted); }
.exp-t { font-size: clamp(2rem, 8vw, 7rem); color: var(--amber); }
.d-overlay.out .exp-t { color: var(--green); }
.out-n { font-family: var(--crt); font-size: clamp(1rem, 3vw, 2rem); color: var(--muted); }
.dash.alarm::after { content: ''; position: absolute; inset: 0; background: #ff000040; animation: alarmFlash 0.4s 4; pointer-events: none; z-index: 4; }
@keyframes alarmFlash { 50% { background: transparent; } }
.dash.shake { animation: shake 0.5s; }
@keyframes shake { 20% { transform: translate(-10px, 4px); } 40% { transform: translate(8px, -6px); } 60% { transform: translate(-6px, 6px); } 80% { transform: translate(4px, -2px); } }
.dash.twitch { animation: shake 0.3s; }
.dash.glitch { animation: glitch 0.25s steps(2) 8; }
@keyframes glitch { 0% { filter: hue-rotate(90deg) contrast(2); transform: translate(6px, 0) skewX(4deg); } 50% { filter: invert(1); transform: translate(-8px, 2px); } 100% { filter: none; transform: none; } }
.dash.over { filter: grayscale(0.6) brightness(0.7); }

/* Specimen art. */
.specimen { overflow: visible; }
.sp-glass { fill: #9fe9ff14; stroke: #7fd8ff66; stroke-width: 2; }
.sp-base { fill: #2a3540; }
.sp-body { transform-origin: 60px 100px; animation: breathe 3.5s ease-in-out infinite; }
.specimen.st-1 .sp-body { animation-duration: 2.2s; }
.specimen.st-2 .sp-body { animation: wobble 1.2s ease-in-out infinite; }
.specimen.st-3 .sp-body { animation: wobble 0.6s ease-in-out infinite; }
.specimen.st-4 .sp-body { animation: wobble 0.25s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scaleY(1.04); } }
@keyframes wobble { 25% { transform: rotate(-4deg) translateX(-2px); } 75% { transform: rotate(4deg) translateX(2px); } }
.sp-eye { fill: #fff; } .sp-pupil { fill: #111; }
.sp-eyelid { fill: none; stroke: #222; stroke-width: 2; stroke-linecap: round; }
.sp-fill-duck { fill: #ffd84a; stroke: #6b5200; stroke-width: 2; }
.sp-beak { fill: #ff8a1f; stroke: #6b3000; stroke-width: 1.5; }
.sp-excl { fill: var(--red); font-family: var(--display); font-size: 20px; font-weight: 700; }
.sp-fill-egg { fill: #f7f1e1; stroke: #9a8f75; stroke-width: 2; }
.sp-crack { fill: none; stroke: #3a2f20; stroke-width: 2.4; stroke-linejoin: round; }
.sp-fill-slime { fill: #7cf06e; stroke: #2a7a22; stroke-width: 2; opacity: 0.92; }
.sp-fill-orb { fill: #d9c8ff; stroke: #6b4fc2; stroke-width: 2; }
.sp-glow { fill: #b69cff44; animation: pulse 2s infinite; }
.sp-ring { fill: none; stroke: #b69cff; stroke-width: 2; stroke-dasharray: 6 5; }
.sp-pot { fill: #b8612e; stroke: #5a2c10; stroke-width: 2; }
.sp-stem { fill: none; stroke: #2f9e44; stroke-width: 5; stroke-linecap: round; }
.sp-leaf { fill: #4bc45e; stroke: #1c6b2a; stroke-width: 1.5; }
.sp-fill-s42 { fill: #232830; stroke: #0a0c10; stroke-width: 2; }
.sp-s42 .sp-eye { fill: #ffec5c; }
.sp-gone { font-size: 34px; }

/* Compact dashboard (phones without a laboratory display). */
.dash.compact { min-height: auto; padding: 10px; gap: 10px; }
.dash.compact .d-top { flex-wrap: wrap; gap: 6px; }
.dash.compact .d-title { font-size: 0.95rem; flex-basis: 100%; }
.dash.compact .d-timer { font-size: 1.8rem; }
.dash.compact .d-main, .dash.compact .d-bottom { grid-template-columns: 1fr; gap: 10px; }
.dash.compact .d-stab-num { font-size: 3rem; }
.dash.compact .d-sys { grid-template-columns: 6.2em 1fr 2.8em; font-size: 0.95rem; gap: 6px; }
.dash.compact .d-bar { height: 18px; }
.dash.compact .d-bar-val { font-size: 1rem; }
.dash.compact .d-bar-delta { grid-column: 2 / 4; font-size: 0.8rem; text-align: right; margin-top: -4px; }
.dash.compact .d-bar-delta:empty { display: none; }
.dash.compact .em-code { font-size: 1.2rem; }
.dash.compact .em-left { font-size: 1.3rem; }
.dash.compact .d-spec { grid-template-columns: 70px 1fr; }
.dash.compact .spec-art { width: 70px; height: 70px; }
.dash.compact .d-banner { font-size: 1.4rem; top: 30%; }
.dash.compact .d-amb { grid-template-columns: 1fr; }
@media (max-width: 1100px) { .d-sys { grid-template-columns: 8em 1fr 3.4em 7em; font-size: 1.1rem; } }
@media (max-width: 800px) {
  .dash:not(.compact) .d-main, .dash:not(.compact) .d-bottom { grid-template-columns: 1fr; }
  .dash:not(.compact) .d-sys { grid-template-columns: 7em 1fr 3em; }
  .dash:not(.compact) .d-bar-delta { grid-column: 2 / 4; text-align: right; font-size: 0.85rem; }
  .dash:not(.compact) .d-top { flex-wrap: wrap; }
}
.dash.anomaly-lights .d-main, .dash.anomaly-lights .d-bottom { animation: lightsOut 9s steps(1); }
.dash.anomaly-gravity .d-main { animation: gravity 9s ease-in-out; }
.em-who { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 0.85rem; margin-top: 3px; color: #ffe9e9; }
.em-who b { color: #fff; }
