@font-face { font-family: "VT323"; font-style: normal; font-weight: 400; font-display: swap; src: url(vt323.woff2) format("woff2"); }
html, body { margin: 0; }
/* Layout: a late-90s HMI workstation. Teal desktop, grey bevelled app window, black process mimic with
   red = open/running and green = closed/stopped (utility convention), alarm summary along the bottom. Single look by design. */
:root {
  --desk: #0a7273;
  --face: #c3c3c3;
  --face-lt: #dfdfdf;
  --hi: #ffffff;
  --lo: #828282;
  --dk: #050505;
  --ink: #050505;
  --title-a: #0a1f6e;
  --title-b: #2b78c2;
  --title-off: #8d8d8d;
  --hmi: #000000;
  --hmi-text: #d8d8d8;
  --hmi-pipe: #6e6e6e;
  --water: #1c49c9;
  --water-hi: #4a7bff;
  --run: #ff2b2b;
  --stop: #1fd61f;
  --trans: #ffe31a;
  --trip: #ff3df5;
  --val: #22f3f3;
  --field: #ffffff;
  --sel: #0a1f6e;
  --font-ui: Tahoma, Verdana, "DejaVu Sans", Geneva, sans-serif;
  --font-val: "VT323", "Lucida Console", "Courier New", monospace;
  color-scheme: light;
}
html, body { height: 100%; }
[hidden] { display: none !important; }
body {
  background: var(--desk); color: var(--ink);
  font-family: var(--font-ui); font-size: 13px; line-height: 1.3;
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--desk); }
button, input, select { font: inherit; color: inherit; }
.desk {
  min-height: 100%;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 16px;
}

/* ---------- Win-9x-ish chrome ---------- */
.raised { background: var(--face); border: 2px solid; border-color: var(--hi) var(--dk) var(--dk) var(--hi); box-shadow: inset -1px -1px var(--lo), inset 1px 1px var(--face-lt); }
.sunken { border: 2px solid; border-color: var(--lo) var(--hi) var(--hi) var(--lo); box-shadow: inset 1px 1px var(--dk); }
.win { background: var(--face); padding: 3px; }
.title {
  display: flex; align-items: center; gap: 6px; padding: 2px 3px 2px 5px; min-height: 22px;
  background: linear-gradient(90deg, var(--title-a), var(--title-b)); color: var(--hi); font-weight: bold;
  user-select: none;
}
.title.off { background: linear-gradient(90deg, var(--title-off), #b5b5b5); color: var(--face-lt); }
.title .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title .ico { width: 16px; height: 16px; flex: none; }
.tb { width: 18px; height: 16px; padding: 0; font: bold 11px/1 var(--font-ui); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.btn { min-width: 76px; min-height: 24px; padding: 0 12px; cursor: pointer; color: var(--ink); }
.btn:active:not(:disabled), .tb:active { border-color: var(--dk) var(--hi) var(--hi) var(--dk); box-shadow: inset 1px 1px var(--lo); }
.btn:focus-visible, .tb:focus-visible, .menu > button:focus-visible { outline: 1px dotted var(--ink); outline-offset: -5px; }
.btn:disabled { color: var(--lo); text-shadow: 1px 1px var(--hi); cursor: default; }
.btn.on { border-color: var(--dk) var(--hi) var(--hi) var(--dk); box-shadow: inset 1px 1px var(--lo); background: var(--face-lt); }
/* etched frame: dark line + light line, drawn as a real border so the legend cuts through both */
fieldset { border: 2px groove var(--face-lt); margin: 0; padding: 10px 10px 10px; min-width: 0; }
legend { padding: 0 4px; margin-left: 4px; background: var(--face); }
.field { background: var(--field); padding: 2px 4px; min-height: 22px; border-radius: 0; outline: none; }
.field:focus { outline: 1px dotted var(--ink); outline-offset: -4px; }
.underline { text-decoration: underline; }

/* ---------- boot screens ---------- */
#remote { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at 50% 40%, #233a6b 0%, #0b1530 55%, #04070f 100%); color: #e8ecf5; }
.rf { width: min(520px, 100%); background: linear-gradient(180deg, #f2f2ee, #cfd2d8); color: #111; border: 1px solid #000; box-shadow: 0 0 0 1px #8a93a8 inset, 6px 6px 0 rgba(0,0,0,.4); }
.rf-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; background: linear-gradient(90deg, #1a2a55, #3d5c9a 70%, #8aa0c8); color: #fff; }
.rf-name { font: bold italic 28px/1 Georgia, "Times New Roman", serif; letter-spacing: -.01em; text-shadow: 1px 1px #000; }
.rf-name small { display: block; font: 11px/1.6 var(--font-ui); font-style: normal; letter-spacing: .14em; opacity: .9; }
.rf-body { padding: 14px 16px 12px; display: grid; gap: 10px; }
.rf-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-variant-numeric: tabular-nums; min-height: 8.6em; }
.rf-steps li::before { content: "› "; color: #3d5c9a; font-weight: bold; }
.rf-steps li.done::before { content: "✓ "; color: #087a08; }
.rf-bar { height: 14px; padding: 2px; display: flex; gap: 2px; background: #fff; overflow: hidden; }
.rf-bar i { width: 8px; flex: none; background: #3d5c9a; }
.rf-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
#post { position: fixed; inset: 0; background: #000; color: #bdbdbd; font: 18px/1.15 var(--font-val); padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left)); z-index: 30; white-space: pre-wrap; overflow: hidden; }
.center { min-height: calc(100vh - 32px); display: grid; place-items: center; }
#splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; cursor: progress; }
#splash .win { width: min(460px, 100%); }
.splash-art {
  height: 170px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #0b2a6b 0%, #1d5bb5 58%, #0e1f3d 58.5%, #0e1f3d 100%);
  color: var(--hi);
}
.splash-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.splash-art .brand { position: absolute; left: 18px; top: 14px; font: bold italic 30px/1 Georgia, "Times New Roman", serif; text-shadow: 2px 2px #000; }
.splash-art .brand small { display: block; font: 12px/1.6 var(--font-ui); font-style: normal; letter-spacing: .12em; }
.splash-body { padding: 10px 12px 12px; display: grid; gap: 8px; }
.progress { height: 18px; padding: 2px; background: var(--face); display: flex; gap: 2px; overflow: hidden; }
.progress i { width: 10px; flex: none; background: var(--sel); }
.fine { font-size: 11px; color: #3a3a3a; }

#cad .win, #logon .win, .dlg { width: min(420px, 100%); }
.dlg-body { padding: 14px 14px 12px; display: grid; gap: 12px; }
.dlg-row { display: flex; gap: 12px; align-items: flex-start; }
.dlg-row svg { flex: none; }
.form { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px 8px; align-items: center; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.keys { display: inline-flex; gap: 3px; }
.keys kbd { font: bold 11px var(--font-ui); padding: 1px 5px; }

/* ---------- app ---------- */
/* ---------- desktop shell ---------- */
#desktop {
  position: fixed; inset: 0; z-index: 20; background: var(--desk); display: flex; flex-direction: column;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.deskarea { position: relative; flex: 1; overflow: hidden; min-height: 0; }
.icons { position: absolute; top: 10px; left: 8px; display: grid; gap: 14px; width: 78px; z-index: 1; }
.icon { background: transparent; border: 0; color: var(--hi); display: grid; justify-items: center; gap: 4px; padding: 4px 2px; cursor: pointer; font-size: 12px; text-align: center; }
.icon span { padding: 0 2px; line-height: 1.25; word-break: break-all; }
.icon:focus-visible span, .icon.sel span { background: var(--sel); outline: 1px dotted var(--hi); }
.icon svg { width: 34px; height: 34px; }
.appwin { position: absolute; display: flex; flex-direction: column; min-width: 300px; min-height: 180px; resize: both; overflow: hidden; }
.appwin.max { inset: 0 !important; width: auto !important; height: auto !important; resize: none; }
.appwin .wbody { flex: 1; overflow: auto; min-height: 0; }
.appwin .title { cursor: default; touch-action: none; }
.taskbar { display: flex; align-items: center; gap: 4px; padding: 2px 3px; min-height: 32px; position: relative; z-index: 60; flex-wrap: nowrap; }
.taskbar .btn { min-width: 0; padding: 0 8px; display: inline-flex; align-items: center; gap: 6px; font-weight: bold; }
.tasks { display: flex; gap: 3px; flex: 1; min-width: 0; overflow: hidden; }
.tasks .btn { font-weight: normal; max-width: 180px; flex: 0 1 180px; min-width: 40px; justify-content: flex-start; }
.tasks .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray { padding: 1px 8px 1px 4px; white-space: nowrap; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
/* alarm server tray icon: the horn keeps sounding with HydroView closed, so it needs a visible owner */
.trayico { background: transparent; border: 0; padding: 0; width: 18px; height: 18px; display: grid; place-items: center; cursor: default; }
.trayico:focus-visible { outline: 1px dotted var(--ink); }
#trayMenu { position: absolute; right: 3px; bottom: 100%; z-index: 61; padding: 2px; min-width: 200px; display: grid; }
#trayMenu button { background: transparent; border: 0; text-align: left; padding: 5px 14px 5px 22px; cursor: pointer; color: var(--ink); white-space: nowrap; }
#trayMenu button:hover:not(:disabled), #trayMenu button:focus-visible { background: var(--sel); color: var(--hi); outline: 0; }
#trayMenu button:disabled { color: var(--lo); text-shadow: 1px 1px var(--hi); cursor: default; }
#startMenu { position: absolute; left: 3px; bottom: 100%; z-index: 61; list-style: none; margin: 0; padding: 2px; min-width: 220px; display: flex; }
#startMenu .band { width: 24px; background: linear-gradient(0deg, var(--title-a), var(--title-b)); color: var(--hi); writing-mode: vertical-rl; transform: rotate(180deg); font-weight: bold; padding: 6px 2px; letter-spacing: .1em; }
#startMenu ul { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; }
#startMenu li.end { margin-top: auto; }  /* Log Off sits at the bottom, next to the button */
#startMenu button { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: 0; padding: 6px 14px 6px 8px; cursor: pointer; text-align: left; color: var(--ink); }
#startMenu button:hover, #startMenu button:focus-visible { background: var(--sel); color: var(--hi); outline: 0; }
#startMenu hr { border: 0; border-top: 1px solid var(--lo); border-bottom: 1px solid var(--hi); margin: 3px 1px; }
.memo { width: 100%; height: 100%; box-sizing: border-box; resize: none; border: 0; padding: 8px; background: var(--field); font: 13px/1.4 "Lucida Console", "Courier New", monospace; color: var(--ink); white-space: pre-wrap; }

/* ---------- SiteGuard ---------- */
.sg { display: grid; gap: 6px; padding: 4px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sg .span { grid-column: 1 / -1; }
@media (max-width: 900px) { .sg { grid-template-columns: minmax(0, 1fr); } }
#sgMap { display: block; width: 100%; height: auto; background: #10140f; }
#sgMap text { font-family: var(--font-ui); font-size: 10px; fill: #cfd6cf; }
#sgMap .dev { cursor: pointer; }
#sgMap .dev:hover .hl, #sgMap .dev.sel .hl { stroke: #fff; stroke-dasharray: 3 2; }
.cams { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: #000; padding: 3px; }
.cam { position: relative; border: 2px solid #222; cursor: pointer; background: #000; }
.cam.sel { border-color: var(--trans); }
.cam canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; }
.ptz { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.ptz label { white-space: nowrap; }
.ptz select { flex: 1 1 auto; }
.ptz select { min-width: 0; width: 100%; }
.ptz .btn { min-width: 34px; padding: 0 8px; }
.gatectl { display: grid; gap: 8px; }
.gatectl .actions { justify-content: flex-start; }
tr.pick td { background: var(--sel); color: var(--hi); }
.sg .tablewrap { height: auto; max-height: 11em; }
/* spare window height goes to the security event log */
#w-guard .wbody { display: flex; flex-direction: column; }
#w-guard .sg { flex: 1 0 auto; grid-template-rows: auto auto 1fr; }
#w-guard .sg > fieldset.span { display: flex; flex-direction: column; }
#w-guard .sg > fieldset.span .tablewrap { flex: 1 0 6em; max-height: none; }
@media (max-width: 900px) { #w-guard .sg { grid-template-rows: repeat(4, auto) 1fr; } }
.sg tbody tr { cursor: pointer; }

.menubar { display: flex; flex-wrap: wrap; gap: 0; padding: 1px 2px; position: relative; }
.menu { position: relative; }
.menu > button { background: transparent; border: 0; padding: 3px 8px; cursor: pointer; color: var(--ink); }
.menu > button[aria-expanded="true"] { background: var(--sel); color: var(--hi); }
.menu ul { position: absolute; top: 100%; left: 0; z-index: 35; list-style: none; margin: 0; padding: 2px; min-width: 190px; }
.menu li button { display: flex; width: 100%; gap: 10px; background: transparent; border: 0; text-align: left; padding: 3px 18px 3px 22px; cursor: pointer; color: var(--ink); position: relative; white-space: nowrap; }
.menu li button:hover, .menu li button:focus-visible { background: var(--sel); color: var(--hi); outline: 0; }
.menu li button[aria-checked="true"]::before { content: "✓"; position: absolute; left: 7px; }
.menu li hr { border: 0; border-top: 1px solid var(--lo); border-bottom: 1px solid var(--hi); margin: 3px 1px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 4px 5px; border-top: 1px solid var(--lo); box-shadow: inset 0 1px var(--hi); }
.toolbar .sep { width: 2px; align-self: stretch; border-left: 1px solid var(--lo); border-right: 1px solid var(--hi); margin: 0 3px; }
.toolbar .btn { min-width: 0; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; }

.main { display: grid; gap: 6px; padding: 4px; grid-template-columns: minmax(0, 1fr) 290px; }
.left { display: grid; gap: 6px; min-width: 0; grid-template-rows: auto 1fr; }
.trendbox { display: flex; flex-direction: column; }
.side { display: grid; gap: 6px; align-content: start; min-width: 0; }
.bottom { padding: 0 4px 4px; }
/* any spare window height goes to the alarm list instead of empty grey */
#w-hydro .wbody { display: flex; flex-direction: column; }
#w-hydro .main { flex: none; }
#w-hydro .bottom { flex: 1 0 auto; display: flex; }
#w-hydro .bottom fieldset { flex: 1; display: flex; flex-direction: column; }
#w-hydro .bottom .tablewrap { flex: 1 0 7.4em; }
@media (max-width: 960px) { .main { grid-template-columns: minmax(0, 1fr); } .side { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }

.hmi { background: var(--hmi); }
.hmi-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 8px; color: var(--hmi-text); background: #1a1a1a; font-size: 12px; border-bottom: 1px solid #333; }
#mimic { display: block; width: 100%; height: auto; }
#mimic text { font-family: var(--font-ui); fill: var(--hmi-text); }
#mimic .v { font-family: var(--font-val); fill: var(--val); font-size: 19px; }
#mimic .lbl { font-size: 12px; font-weight: bold; }
#mimic .small { font-size: 10.5px; fill: #9a9a9a; }
#mimic .pipe { fill: none; stroke: var(--hmi-pipe); stroke-width: 6; }
#mimic .flow { fill: none; stroke: var(--water-hi); stroke-width: 2.5; stroke-dasharray: 6 10; }
#mimic .flowing { animation: flow .8s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -16; } }
#mimic .hot { cursor: pointer; }
#mimic .hot:hover .hl, #mimic .hot:focus-visible .hl { stroke: var(--hi); stroke-dasharray: 3 3; }
#mimic .hot:focus { outline: none; }
#mimic .box { fill: #000; stroke: #555; }
.flash { animation: flash 1s steps(1) infinite; }
@keyframes flash { 50% { opacity: .15 } }

.kv { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; font-variant-numeric: tabular-nums; }
.kv dt, .kv dd { min-height: 25px; display: flex; align-items: center; }
.kv dt { color: #2a2a2a; }
.kv dd { margin: 0; justify-content: flex-end; text-align: right; }
.readout { background: #000; color: var(--val); font: 19px/1 var(--font-val); padding: 2px 6px; min-width: 9ch; text-align: right; display: inline-block; }
.readout.warn { color: var(--trans); }
.readout.alarm { color: var(--run); }
.check { display: flex; align-items: center; gap: 6px; margin-top: 6px; cursor: pointer; }
.check input { width: 13px; height: 13px; margin: 0; accent-color: var(--sel); }

#trend { width: 100%; height: 160px; flex: 1 1 160px; min-height: 160px; display: block; background: #000; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; font-size: 12px; }
.legend i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 4px; }

.alarmbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.alarmbar .count { margin-right: auto; font-weight: bold; }
.tablewrap { background: var(--field); height: 7.4em; overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
td:last-child, th:last-child { text-align: left; }
th { position: sticky; top: 0; background: var(--face); text-align: left; font-weight: normal; padding: 1px 6px; border: 1px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); white-space: nowrap; }
td { padding: 1px 6px; white-space: nowrap; }
tr.act td { color: #c20000; }
tr.unack td { background: #c20000; color: #fff; }
tr.rtn td { color: #6a6a6a; }
.tabs { display: flex; padding-left: 4px; position: relative; z-index: 1; margin-bottom: -2px; flex-wrap: wrap; }
.tab { background: var(--face); color: var(--ink); border: 2px solid; border-color: var(--hi) var(--dk) var(--face) var(--hi); padding: 3px 12px; margin-top: 3px; cursor: pointer; }
.tab[aria-selected="true"] { margin-top: 0; padding-bottom: 6px; position: relative; z-index: 2; }
.tab:focus-visible { outline: 1px dotted var(--ink); outline-offset: -5px; }
.tabpanel { border: 2px solid; border-color: var(--hi) var(--dk) var(--dk) var(--hi); padding: 12px; display: grid; gap: 10px; }
.tabpanel select.field { padding: 0 2px; min-height: 20px; }
.cs-ok { color: #087a08; font-weight: bold; }
.cs-bad { color: #c20000; font-weight: bold; }
.cs-off { color: #6a6a6a; }
.cs-wait { color: #8a6d00; font-weight: bold; }
.status { display: flex; gap: 2px; padding: 2px; flex-wrap: wrap; }
.status span { padding: 1px 6px; white-space: nowrap; }
.status .grow { flex: 1; }

/* faceplate pop-up */
.face { position: fixed; z-index: 40; width: min(330px, calc(100vw - 32px)); left: 50%; top: 18%; transform: translateX(-50%); box-shadow: 4px 4px 0 rgba(0,0,0,.35); }
.face .title { cursor: move; touch-action: none; }
.face-body { padding: 10px; display: grid; gap: 10px; }
.face .kv dd .readout { min-width: 8ch; }
.slider { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.slider input { width: 100%; accent-color: var(--sel); }
.state { font-weight: bold; padding: 1px 6px; color: #000; display: inline-block; min-width: 8ch; text-align: center; }

@media (max-width: 640px) {
  .desk { padding-block: 8px; }
  .toolbar .lbl-long { display: none; }
  .status .opt { display: none; }
}
@media (prefers-reduced-motion: reduce) { .flash, #mimic .flowing { animation: none !important; } }
/* ---------- workstation apps ---------- */
.icons { bottom: 10px; width: auto; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 70px); grid-auto-columns: 78px; align-content: start; gap: 6px 4px; }
.pane { background: var(--field); overflow: auto; min-height: 0; }
.split { display: grid; gap: 4px; padding: 4px; min-height: 0; }
.mono { font: 12px/1.4 "Lucida Console", "Courier New", monospace; white-space: pre-wrap; }
tr.unread td { font-weight: bold; }
.rows tr { cursor: default; }
.lbl { align-self: center; }
.badge { display: inline-block; min-width: 6ch; padding: 0 5px; text-align: center; font-weight: bold; }
.st-ok { background: var(--stop); color: #000; }
.st-alert { background: var(--trans); color: #000; }
.st-action { background: var(--run); color: #fff; }
.st-stale { background: #9a9a9a; color: #000; }
/* mail */
#w-mail .wbody, #w-maint .wbody, #w-log .wbody, #w-hist .wbody, #w-dam .wbody { display: flex; flex-direction: column; }
.mail { flex: 1; grid-template-columns: 150px minmax(0, 1fr); grid-template-rows: minmax(9em, 1fr) minmax(9em, 1.2fr); }
.mail .folders { grid-row: 1 / span 2; padding: 4px 0; }
.mail .folders button { display: flex; width: 100%; gap: 6px; background: transparent; border: 0; padding: 3px 8px; text-align: left; cursor: pointer; color: var(--ink); }
.mail .folders button.on { background: var(--sel); color: var(--hi); }
.mail .head { padding: 6px 8px; border-bottom: 1px solid var(--lo); background: var(--face-lt); display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; font-size: 12px; }
.mail .msg { display: flex; flex-direction: column; }
.mail .msg .mono { padding: 8px; flex: 1; }
/* shift log */
.slog { flex: 1; display: flex; flex-direction: column; padding: 4px; gap: 4px; min-height: 0; }
.slog .pane { flex: 1; padding: 4px 6px; }
.slog .ent { display: grid; grid-template-columns: 9.5em 3.5em 3.5em minmax(0, 1fr); gap: 0 8px; padding: 3px 0; border-bottom: 1px dotted #b8b8b8; font: 12px/1.35 "Lucida Console", "Courier New", monospace; }
.slog .ent .c { color: #555; }
.slog .ent.mine { color: #0a1f6e; }
.slog form { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 6px; align-items: start; }
.slog textarea { height: 3.2em; resize: none; font: 12px "Lucida Console", "Courier New", monospace; }
@media (max-width: 760px) { .slog .ent { grid-template-columns: 1fr; } .slog form { grid-template-columns: 1fr 1fr; } .slog form textarea { grid-column: 1 / -1; } }
/* historian */
.hist { flex: 1; grid-template-columns: 190px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
.hist .tags { grid-row: 1 / span 2; padding: 2px 0; }
.hist .tags label { display: flex; gap: 6px; align-items: center; padding: 2px 6px; cursor: pointer; white-space: nowrap; }
.hist .tags label i { width: 10px; height: 10px; flex: none; border: 1px solid #000; }
.hist .plot { background: #000; position: relative; min-height: 200px; }
.hist .plot canvas, .dam .hplot canvas, .dam .seis canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hist .tablewrap { height: auto; max-height: 8em; }
/* dam safety */
.dam { flex: 1; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.dam .xsec { background: #000; position: relative; min-height: 240px; }
.dam .xsec svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dam .side { display: grid; grid-template-rows: auto minmax(110px, 1fr) 70px; gap: 4px; min-height: 0; }
.dam .hplot, .dam .seis { position: relative; background: #000; min-height: 0; }
.dam .span2 { grid-column: 1 / -1; display: flex; flex-direction: column; min-height: 0; }
.dam .span2 .tablewrap { flex: 1 0 7em; height: auto; }
.dam .side .kv dt, .dam .side .kv dd { min-height: 20px; }
/* maintenance */
.wo { flex: 1; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(8em, 1fr) minmax(10em, 1fr); }
.wo .tablewrap { height: auto; }
.wo .detail { padding: 8px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 18px; align-content: start; }
.wo .detail .kv dt, .wo .detail .kv dd { min-height: 19px; }
.wo .detail .notes { grid-column: 1 / -1; margin: 6px 0 0; padding: 6px; background: #f3f3ee; border: 1px solid #bbb; }
@media (max-width: 760px) { .dam { grid-template-rows: none; flex: none; } .dam .xsec { min-height: 0; aspect-ratio: 640 / 300; } .dam .side { grid-template-rows: auto 150px 70px; min-height: auto; } .dam .span2 { min-height: 16em; } .mail, .hist, .dam, .wo .detail { grid-template-columns: minmax(0, 1fr); } .mail .folders, .hist .tags { grid-row: auto; } .mail { grid-template-rows: auto minmax(9em, 1fr) minmax(9em, 1fr); } }
/* command prompt */
#w-term .wbody { background: #000; color: #c0c0c0; font: 14px/1.25 "Lucida Console", "Courier New", monospace; padding: 4px 6px; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
#w-term .cmd { display: flex; }
#w-term input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: inherit; font: inherit; padding: 0; caret-color: #c0c0c0; }
/* notepad */
#w-note .wbody { display: flex; flex-direction: column; }
#w-note textarea { flex: 1; width: 100%; box-sizing: border-box; resize: none; border: 0; padding: 4px 6px; font: 13px/1.35 "Lucida Console", "Courier New", monospace; background: var(--field); color: var(--ink); outline: 0; }
/* mines */
#w-mines { resize: none; min-width: 0; min-height: 0; }
.mines { padding: 6px; display: grid; gap: 6px; justify-content: center; }
.mines .bar { display: flex; justify-content: space-between; align-items: center; padding: 4px; }
.mines .lcd { background: #000; color: #ff1a1a; font: 26px/1 var(--font-val); padding: 0 4px; min-width: 3ch; text-align: right; letter-spacing: 1px; }
.mines .mnface { width: 28px; height: 28px; min-width: 0; padding: 0; font-size: 16px; line-height: 1; cursor: pointer; }
.mines .grid { display: grid; grid-template-columns: repeat(9, 22px); grid-auto-rows: 22px; border-width: 3px; }
.mines .grid button { width: 22px; height: 22px; padding: 0; min-width: 0; font: bold 13px/1 var(--font-ui); cursor: default; color: var(--ink); display: grid; place-items: center; }
.mines .grid button.open { border: 0; border-right: 1px solid var(--lo); border-bottom: 1px solid var(--lo); box-shadow: none; background: var(--face); }
.mines .grid button.boom { background: #ff1a1a; }
