/* Offline showcase (ADR 0052): mobile first, map on top and the dashboard below; side by side
   from 900 px, like the 3D showcase. Colors from showcases.css, so light and dark follow. */
.offline {
  margin: 0;
  --ok: #00805a;
  --warn: #a35a00;
  --stop: #c4002b;
}

:root[data-scheme="dark"] .offline {
  --ok: #00d68f;
  --warn: #ffb04d;
  --stop: #ff6b86;
}

@media (prefers-color-scheme: dark) {
  :root[data-scheme-auto]:not([data-scheme="light"]) .offline {
    --ok: #00d68f;
    --warn: #ffb04d;
    --stop: #ff6b86;
  }
}

.layout {
  display: grid;
  grid-template-areas: "map" "controls";
}

.controls {
  grid-area: controls;
  padding: 12px 16px 24px;
}

.intro {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
}

.map-wrap {
  grid-area: map;
  position: relative;
  height: 60vh;
  min-height: 340px;
}

.map {
  position: absolute;
  inset: 0;
}

/* The big switch. */
.switch-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 18px 8px 10px;
  border: 2px solid var(--petrol-dark);
  border-radius: 32px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.switch:disabled {
  cursor: progress;
  opacity: 0.6;
}

.switch:focus-visible {
  outline: 3px solid var(--petrol-dark);
  outline-offset: 3px;
}

.switch-track {
  position: relative;
  width: 56px;
  height: 32px;
  border-radius: 16px;
  background: var(--line);
  transition: background 0.2s;
}

.switch-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(0 0 40 / 40%);
  transition: transform 0.2s;
}

.switch[aria-checked="true"] .switch-track {
  background: var(--petrol-dark);
}

.switch[aria-checked="true"] .switch-thumb {
  transform: translateX(24px);
}

@media (prefers-reduced-motion: reduce) {
  .switch-track,
  .switch-thumb {
    transition: none;
  }
}

.mode {
  margin: 0;
  font-weight: 600;
}

.mode[data-mode="offline"] {
  color: var(--petrol-dark);
}

.progress {
  width: 100%;
  height: 8px;
  margin: 12px 0 0;
  accent-color: var(--petrol-dark);
}

/* Numbers. */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin: 16px 0 0;
}

.kpis > div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sand);
}

.kpis .wide {
  grid-column: 1 / -1;
}

.kpis dt {
  color: var(--muted);
  font-size: 13px;
}

.kpis dd {
  margin: 2px 0 0;
  font-weight: 600;
}

.kpis .big {
  font-size: 30px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.counters #network {
  color: var(--petrol-dark);
}

[data-status="running"] {
  --c: var(--ok);
}

[data-status="attention"] {
  --c: var(--warn);
}

[data-status="stopped"] {
  --c: var(--stop);
}

.states .big {
  color: var(--c);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 28px 0 8px;
  font-size: 18px;
}

.tag {
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.assets {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.assets button {
  display: grid;
  grid-template-columns: 14px 1fr;
  grid-template-areas: "dot name" "dot meta";
  align-items: center;
  column-gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.assets button:hover,
.assets button[aria-pressed="true"] {
  border-color: var(--petrol-dark);
  background: var(--sand);
}

.assets button:focus-visible {
  outline: 2px solid var(--petrol-dark);
  outline-offset: 1px;
}

.assets .dot {
  grid-area: dot;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c);
}

.assets .name {
  grid-area: name;
  font-weight: 600;
}

.assets .meta {
  grid-area: meta;
  color: var(--muted);
  font-size: 13px;
}

.asset-pin {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 1px 4px rgb(0 0 40 / 50%);
  cursor: pointer;
}

.asset-pin:focus-visible {
  outline: 3px solid var(--petrol-dark);
  outline-offset: 2px;
}

.hint {
  margin: 8px 0;
  color: var(--muted);
  font-size: 14px;
}

.status {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

a.button[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.6;
}

.pitch {
  margin-top: 28px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.pitch h3 {
  margin: 16px 0 4px;
  font-size: 15px;
}

.pitch p,
.pitch ul,
.pitch ol {
  margin: 0 0 8px;
}

.pitch li {
  margin: 2px 0;
}

.source {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.source a {
  color: var(--petrol-dark);
}

@media (min-width: 900px) {
  .offline {
    height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .layout {
    flex: 1;
    min-height: 0;
    grid-template-columns: 400px 1fr;
    grid-template-areas: "controls map";
  }

  .controls {
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }

  .map-wrap {
    height: auto;
    min-height: 0;
  }
}
