#login { max-width: 420px; margin: 12vh auto; }
#main { display: grid; grid-template-columns: minmax(0, 1fr) 430px; grid-template-rows: auto minmax(420px, 1fr) 220px; gap: 12px; padding: 12px; height: calc(100vh - 53px); }
.status { grid-column: 1 / -1; }
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); }
.tile { padding: 10px 14px; border-right: 1px solid var(--line); display: grid; gap: 2px; min-width: 0; }
.tile:last-child { border-right: 0; }
.tile span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tile b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile b.mono { font-size: 14px; }
.tile small { color: var(--dim); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ok-t { color: var(--ok); } .bad-t { color: var(--bad); } .warn-t { color: var(--warn); }
.mapbox { display: flex; flex-direction: column; min-height: 0; }
.cv { position: relative; flex: 1; min-height: 0; }
.cv canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.cv .empty { position: absolute; inset: 0; display: grid; place-items: center; }
.ctrl { grid-row: 2 / span 2; grid-column: 2; display: flex; flex-direction: column; gap: 12px; overflow: auto; min-height: 0; }
.logbox { display: flex; flex-direction: column; min-height: 0; }
#log { overflow: auto; flex: 1; font-family: var(--mono); font-size: 12px; padding: 6px 12px; }
#log div { padding: 2px 0; border-bottom: 1px solid #1c2126; }
#log time { color: var(--dim); margin-right: 8px; }
#log .warn { color: var(--warn); } #log .error { color: var(--bad); }
.pad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(3, 44px); gap: 6px; justify-content: center; }
.pad button { justify-content: center; font-size: 16px; user-select: none; touch-action: none; }
.pad button.on { background: var(--amber); color: var(--amber-ink); }
#stop { font-weight: 700; letter-spacing: .05em; }
.switchbig { display: flex; gap: 10px; align-items: center; font-weight: 600; cursor: pointer; }
.switchbig input { width: 18px; height: 18px; accent-color: var(--ok); }
#dests { font-size: 12.5px; }
#dests td, #dests th { padding: 5px 8px; }
#dests td.mono { font-size: 11.5px; }
#dests .row { gap: 4px; flex-wrap: nowrap; }
@media (max-width: 1100px) {
  #main { grid-template-columns: 1fr; grid-template-rows: auto 60vh auto 240px; height: auto; }
  .ctrl { grid-row: auto; grid-column: auto; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
