:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #edf4f0;
  background: #07100e;
  color-scheme: dark;
  --line: #21332d;
  --muted: #7c9189;
  --green: #70f0a2;
  --cyan: #55d8ed;
  --blue: #6aa8ff;
  --amber: #f3c76a;
  --orange: #ed9760;
  --violet: #ad8cff;
  --red: #ff756f;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 58% -15%, #18392e 0, transparent 31%),
    linear-gradient(#07100e, #08110f 45%, #07100e);
  color: #edf4f0;
}
button,
a {
  font: inherit;
}
.topbar {
  height: 64px;
  padding: 0 max(20px, calc((100vw - 1480px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1b2b26;
  background: #07100ee8;
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #edf4f0;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
.brand i {
  font-style: normal;
  color: #5f746c;
  font-size: 9px;
  padding-left: 10px;
  border-left: 1px solid #2a3a35;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.connection {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #8fa098;
  font-size: 11px;
}
.connection i,
.mode i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px currentColor;
}
.connection.online i,
.mode.on i {
  background: var(--green);
}
.connection.error i,
.mode.blocked i {
  background: var(--red);
}
.top-link,
.top-button,
.map-actions button,
.job-filters button {
  border: 1px solid #2a3c36;
  background: #101a17;
  color: #cbd8d3;
  border-radius: 8px;
  padding: 7px 10px;
  text-decoration: none;
  cursor: pointer;
}
.top-link:hover,
.top-button:hover,
.map-actions button:hover,
.job-filters button:hover {
  border-color: #537267;
  color: #fff;
}
main {
  max-width: 1480px;
  margin: auto;
  padding: 46px 20px 80px;
}
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 26px;
}
.eyebrow {
  margin: 0 0 8px;
  color: #67d99b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 78px);
  line-height: 0.93;
  letter-spacing: -0.058em;
  margin: 0;
}
.hero h1 span {
  color: #769087;
}
.hero-copy {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.hero-status {
  text-align: right;
  min-width: 220px;
}
.mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #2c4039;
  background: #0c1915;
  border-radius: 99px;
  padding: 7px 10px;
  color: #9db0a8;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.hero-status > strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(45px, 6vw, 76px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.06em;
}
.hero-status > small {
  color: #63776f;
  font-size: 8px;
  letter-spacing: 0.16em;
}
.alert {
  border: 1px solid #66342f;
  background: #281814;
  color: #ff9c95;
  border-radius: 11px;
  padding: 12px 15px;
  margin-bottom: 12px;
  font-size: 12px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 36px;
}
.kpi {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #101b18, #0a1411);
  border-radius: 13px;
  padding: 16px 17px;
}
.kpi span {
  display: block;
  color: #71867e;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
}
.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.kpi small {
  display: block;
  margin-top: 3px;
  color: #63756f;
  font-size: 10px;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 0 0 12px;
}
.section-heading h2,
.surface-head h2,
.dialog-head h2 {
  margin: 0;
  font-size: 19px;
}
.section-heading > p {
  margin: 0;
  color: #6f827b;
  font-size: 11px;
}
.phase-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.phase-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  background: #0c1613;
  border-radius: 12px;
  padding: 13px;
  text-align: left;
  color: #e8f1ed;
  cursor: pointer;
  overflow: hidden;
}
.phase-card:before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--phase);
}
.phase-card:hover,
.phase-card.selected {
  border-color: color-mix(in srgb, var(--phase) 55%, #2a3c36);
  background: #111d19;
}
.phase-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #7d9189;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.phase-number i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--phase);
}
.phase-card h3 {
  font-size: 12px;
  margin: 13px 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phase-count {
  font-size: 19px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.phase-count small {
  font-size: 10px;
  color: #6e817a;
}
.phase-meta {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin-top: 7px;
  color: #71837d;
  font-size: 8px;
}
.phase-track {
  height: 3px;
  background: #20302b;
  border-radius: 9px;
  margin-top: 10px;
  overflow: hidden;
}
.phase-track i {
  display: block;
  height: 100%;
  background: var(--phase);
}
.phase-time {
  margin-top: 9px;
  color: #91a39c;
  font-size: 9px;
}
.visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(390px, 0.85fr);
  gap: 12px;
  margin-bottom: 12px;
}
.surface {
  border: 1px solid var(--line);
  background: linear-gradient(155deg, #0d1714, #0a1311);
  border-radius: 15px;
  overflow: hidden;
}
.surface-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid #1c2c27;
}
.surface-head .eyebrow {
  margin-bottom: 5px;
}
.head-stat {
  color: #8ea199;
  font-size: 10px;
}
.map-actions {
  display: flex;
  gap: 5px;
}
.map-actions button {
  padding: 6px 8px;
  font-size: 10px;
}
.map-wrap {
  height: 620px;
  position: relative;
  background: radial-gradient(circle at 45% 45%, #12231e, #08100e 70%);
  cursor: grab;
  overflow: hidden;
}
.map-wrap.dragging {
  cursor: grabbing;
}
.map-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.map-tooltip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  padding: 8px 10px;
  border: 1px solid #385148;
  border-radius: 8px;
  background: #07110fe8;
  box-shadow: 0 10px 30px #0007;
  font-size: 10px;
  line-height: 1.45;
}
.map-tooltip b {
  display: block;
}
.map-tooltip span {
  display: block;
  margin-top: 3px;
  color: #b9d5cb;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.map-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 9px;
  border: 1px solid #273a33;
  border-radius: 8px;
  background: #07110fd9;
}
.map-legend span {
  color: #81958d;
  font-size: 8px;
}
.map-legend span:before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  margin-right: 5px;
  background: var(--c);
}
.map-legend .terrain {
  --c: var(--orange);
}
.map-legend .available {
  --c: #9bc8b6;
}
.map-legend .invalidated {
  --c: #b89358;
}
.map-legend .plan {
  --c: var(--blue);
}
.map-legend .compose {
  --c: var(--violet);
}
.map-legend .materialize {
  --c: var(--cyan);
}
.map-legend .public {
  --c: var(--green);
}
.map-legend .failed {
  --c: var(--red);
}
.map-legend .coast-water:before,
.map-legend .coast-partial:before,
.map-legend .coast-verifying:before {
  box-sizing: border-box;
  border-radius: 1px;
  background: transparent;
  border-top: 3px solid var(--coast);
  border-right: 3px solid var(--coast);
}
.map-legend .coast-water {
  --coast: #55c9ef;
}
.map-legend .coast-partial {
  --coast: #35d6c3;
}
.map-legend .coast-partial:before {
  border-right-color: #f3c76a;
}
.map-legend .coast-verifying {
  --coast: #f3c76a;
}
.map-legend .coast-verifying:before {
  border-top-style: dashed;
  border-right-style: dashed;
}
.map-detail {
  min-height: 57px;
  padding: 13px 18px;
  border-top: 1px solid #1c2c27;
  color: #83978f;
  font-size: 10px;
}
.map-cell-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.map-cell-title b {
  color: #edf4f0;
  font:
    12px ui-monospace,
    monospace;
}
.coast-line,
.coast-status {
  color: #bdebf5 !important;
}
.coast-line.partial,
.coast-status.partial {
  color: #9ee8d9 !important;
}
.coast-line.verifying,
.coast-status.verifying {
  color: #f3d99e !important;
}
.coast-line.blocked,
.coast-status.blocked {
  color: #ffaaa5 !important;
}
.coast-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 9px;
}
.coast-status i {
  width: 8px;
  height: 8px;
  box-sizing: border-box;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
}
.coast-status.verifying i {
  border-top-style: dashed;
  border-right-style: dashed;
}
.cell-pipeline {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.cell-pipeline span {
  flex: 1;
  height: 4px;
  border-radius: 5px;
  background: #26342f;
}
.cell-pipeline span.complete {
  background: var(--c);
}
.cell-pipeline span.active {
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
}
.network-stage {
  height: 500px;
  padding: 4px 8px;
  background: radial-gradient(circle at 50% 43%, #142720, #091210 62%);
}
#network {
  display: block;
  width: 100%;
  height: 100%;
}
.net-link {
  stroke: #315047;
  stroke-width: 1.4;
  stroke-dasharray: 5 7;
  animation: flow 1.4s linear infinite;
}
.net-link.idle {
  stroke: #263a34;
  animation: none;
}
.net-node circle {
  fill: #0c1714;
  stroke: var(--node);
  stroke-width: 2;
}
.net-node.active circle {
  filter: drop-shadow(
    0 0 10px color-mix(in srgb, var(--node) 55%, transparent)
  );
}
.net-node text {
  fill: #eef4f1;
  text-anchor: middle;
  font-size: 10px;
  font-weight: 700;
}
.net-node .net-sub {
  fill: #789087;
  font-size: 7px;
  font-weight: 500;
}
.net-center circle {
  fill: #14251f;
  stroke: #64dda0;
  stroke-width: 2;
}
.net-center text {
  fill: #eaf5f0;
  text-anchor: middle;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.net-progress {
  fill: none;
  stroke: var(--node);
  stroke-width: 4;
  stroke-linecap: round;
}
.worker-list {
  border-top: 1px solid #1c2c27;
  padding: 5px 16px 13px;
}
.worker-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #192823;
}
.worker-row:last-child {
  border: 0;
}
.worker-row > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--worker);
  box-shadow: 0 0 9px var(--worker);
}
.worker-row b,
.worker-row small {
  display: block;
}
.worker-row b {
  font-size: 10px;
}
.worker-row small {
  margin-top: 3px;
  color: #6c8179;
  font-size: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.worker-stats {
  text-align: right;
  color: #91a49c;
  font-size: 8px;
}
.jobs-surface {
  margin-top: 12px;
}
.jobs-head {
  align-items: end;
}
.job-filters {
  display: flex;
  gap: 4px;
}
.job-filters button {
  font-size: 9px;
  padding: 6px 8px;
}
.job-filters button.active {
  border-color: #5d7e72;
  background: #1a2b25;
  color: #fff;
}
.job-list {
  padding: 0 18px 12px;
}
.job-row {
  display: grid;
  grid-template-columns: 120px minmax(190px, 1.5fr) minmax(
      150px,
      1fr
    ) 100px 74px;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #192823;
  font-size: 10px;
}
.job-row:last-child {
  border: 0;
}
.job-phase {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.job-phase i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--phase);
}
.job-id {
  min-width: 0;
}
.job-id b,
.job-id small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-id b {
  font:
    10px ui-monospace,
    monospace;
  color: #dce8e3;
}
.job-id small {
  margin-top: 4px;
  color: #687b74;
}
.job-stage {
  color: #879b93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-worker {
  color: #9bb0a7;
}
.status-pill {
  justify-self: end;
  border-radius: 99px;
  padding: 4px 7px;
  background: #202e29;
  color: #91a39c;
  font-size: 8px;
  font-weight: 800;
}
.status-pill.running,
.status-pill.leased,
.status-pill.uploading {
  background: #163743;
  color: #76dff1;
}
.status-pill.complete {
  background: #173a29;
  color: #7beaa2;
}
.status-pill.failed {
  background: #472421;
  color: #ff928c;
}
.empty {
  padding: 30px;
  text-align: center;
  color: #6d8179;
  font-size: 11px;
}
dialog {
  width: min(680px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid #30443d;
  border-radius: 15px;
  background: #0c1714;
  color: #edf4f0;
  box-shadow: 0 28px 80px #000b;
}
dialog::backdrop {
  background: #020806b8;
  backdrop-filter: blur(5px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 19px;
  border-bottom: 1px solid #21322c;
}
.dialog-head button {
  border: 0;
  background: transparent;
  color: #8da199;
  font-size: 24px;
  cursor: pointer;
}
.admin-content {
  padding: 18px;
}
.admin-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px;
  border: 1px solid #283b34;
  border-radius: 10px;
}
.admin-mode b,
.admin-mode small {
  display: block;
}
.admin-mode small {
  color: #768a82;
  margin-top: 4px;
}
.admin-mode button,
.retry-button {
  border: 1px solid #365046;
  background: #14251f;
  color: #d9e7e1;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.admin-failures {
  margin-top: 14px;
}
.admin-failure {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #1d2d27;
  font-size: 9px;
}
.admin-failure code {
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-login {
  display: grid;
  gap: 10px;
}
.admin-login input {
  width: 100%;
  border: 1px solid #30453d;
  background: #08110f;
  color: #fff;
  border-radius: 8px;
  padding: 10px;
}
.admin-login button {
  border: 1px solid #49695d;
  background: #173126;
  color: #dcf4e9;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
}
@keyframes flow {
  to {
    stroke-dashoffset: -24;
  }
}
@media (max-width: 1100px) {
  .phase-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .visual-grid {
    grid-template-columns: 1fr;
  }
  .network-stage {
    height: 460px;
  }
  .map-wrap {
    height: 560px;
  }
}
@media (max-width: 720px) {
  main {
    padding: 30px 12px 60px;
  }
  .topbar {
    padding: 0 12px;
  }
  .brand i,
  .connection {
    display: none;
  }
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .hero-status {
    text-align: left;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
  }
  .phase-grid {
    grid-template-columns: 1fr 1fr;
  }
  .section-heading > p {
    display: none;
  }
  .surface-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .map-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .map-wrap {
    height: 500px;
  }
  .job-row {
    grid-template-columns: 92px minmax(0, 1fr) 70px;
  }
  .job-stage,
  .job-worker {
    display: none;
  }
  .jobs-head {
    align-items: flex-start;
  }
  .job-filters {
    flex-wrap: wrap;
  }
  .network-stage {
    height: 420px;
  }
}
@media (max-width: 420px) {
  .kpis {
    grid-template-columns: 1fr;
  }
  .phase-grid {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 42px;
  }
  .map-wrap {
    height: 440px;
  }
}
.net-machine {
  font-size: 10px !important;
  font-weight: 800 !important;
}
.net-slot-label {
  fill: #a9bbb4 !important;
  font-size: 6.5px !important;
  font-weight: 650 !important;
  text-anchor: start !important;
}
.net-slot-track {
  stroke: #263b34;
  stroke-width: 3;
  stroke-linecap: round;
}
.net-slot-progress {
  stroke-width: 3;
  stroke-linecap: round;
}
.net-capacity {
  fill: #61766e !important;
  font-size: 6px !important;
  letter-spacing: 0.1em;
}
.completion-confetti {
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
  pointer-events: none;
}
.completion-confetti i {
  position: absolute;
  top: -18px;
  left: var(--x);
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: completion-confetti-fall var(--fall) cubic-bezier(.18,.72,.25,1) var(--delay) forwards;
}
@keyframes completion-confetti-fall {
  8% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift),105vh,0) rotate(var(--spin)); }
}
@media (prefers-reduced-motion: reduce) {
  .completion-confetti { display: none; }
}
.worker-machine {
  padding: 11px 0;
  border-left: 3px solid var(--machine);
  padding-left: 10px;
  border-bottom: 1px solid #192823;
}
.worker-machine:last-child {
  border-bottom: 0;
}
.worker-machine-head b,
.worker-machine-head small {
  display: block;
}
.worker-machine-head b {
  font-size: 10px;
}
.worker-machine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rename-worker {
  border: 1px solid #385047;
  border-radius: 7px;
  background: #101c18;
  color: #b6c8c0;
  padding: 5px 8px;
  font-size: 10px;
  cursor: pointer;
}
.worker-machine-head small {
  margin-top: 3px;
  color: #6c8179;
  font-size: 8px;
}
.worker-slots {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}
.worker-slot {
  display: grid;
  grid-template-columns: 44px 70px minmax(50px, 1fr) 34px;
  gap: 7px;
  align-items: center;
  color: #8fa29a;
  font-size: 7px;
}
.worker-slot b {
  color: #c9d7d1;
  font-size: 7px;
}
.worker-slot span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.worker-slot > i {
  height: 3px;
  border-radius: 4px;
  background: #24352f;
  overflow: hidden;
}
.worker-slot > i em {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--slot);
  box-shadow: 0 0 8px var(--slot);
}
.worker-slot strong {
  text-align: right;
  color: #b7c7c1;
  font-size: 7px;
  font-variant-numeric: tabular-nums;
}

/* Produktionsvyn ska kunna läsas på avstånd utan att informationsdensiteten försvinner. */
.eyebrow,
.kpi span,
.phase-number,
.phase-meta,
.status-pill {
  font-size: 11px;
}
.hero-copy,
.section-heading > p,
.head-stat,
.map-actions button,
.map-detail,
.job-row {
  font-size: 13px;
}
.phase-card h3 {
  font-size: 14px;
}
.phase-count {
  font-size: 23px;
}
.phase-time,
.map-legend span,
.worker-machine-head small,
.worker-stats {
  font-size: 11px;
}
.worker-machine-head b {
  font-size: 14px;
}
.worker-slot,
.worker-slot b,
.worker-slot strong {
  font-size: 10px;
}
.worker-slot {
  grid-template-columns: 56px 82px minmax(55px, 1fr) 40px;
}
.net-machine {
  font-size: 11px !important;
}
.net-slot-label {
  font-size: 7.5px !important;
}
