:root {
  --bg: #eef4f1;
  --panel: rgba(255, 255, 255, 0.84);
  --ink: #173127;
  --muted: #5f7469;
  --line: rgba(23, 49, 39, 0.12);
  --accent: #1a7f5a;
  --idle: #3e7ea0;
  --busy: #d0891f;
  --offline: #8b5b63;
  --maintenance: #546e8a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(26, 127, 90, 0.18), transparent 30%),
    linear-gradient(160deg, #f5fbf8 0%, var(--bg) 60%, #dde9e3 100%);
  min-height: 100vh;
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.hero {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(23, 49, 39, 0.08);
}

.hero-nav {
  display: flex;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 0.95;
}

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

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.summary-card,
.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px rgba(23, 49, 39, 0.06);
}

.summary-card {
  padding: 18px;
}

.summary-card strong {
  display: block;
  font-size: 30px;
}

.summary-card span {
  color: var(--muted);
}

.fleet-section {
  margin-top: 22px;
}

.fleet-section-council .fleet-head,
.fleet-section-worker .fleet-head {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(23, 49, 39, 0.05);
}

.fleet-section-council .fleet-head {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(232, 243, 237, 0.95)),
    var(--panel);
}

.fleet-section-worker .fleet-head {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(237, 241, 245, 0.98)),
    var(--panel);
}

.fleet-head {
  display: flex;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
}

.fleet-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
}

.fleet-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.fleet-kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--accent);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

.fleet-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(23, 49, 39, 0.06);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fleet-tag-type {
  background: rgba(26, 127, 90, 0.12);
  color: var(--accent);
}

.fleet-tag-profile {
  background: rgba(84, 110, 138, 0.12);
  color: #355368;
}

.card-worker {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(242, 246, 249, 0.9)),
    var(--panel);
}

.card-council {
  background: var(--panel);
}

.tw-group-title {
  margin: 26px 0 12px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tw-group-toggle {
  width: 100%;
  margin: 26px 0 12px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.tw-group-toggle-icon {
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
}

.tw-group-council {
  background: rgba(26, 127, 90, 0.12);
  color: var(--accent);
}

.tw-group-worker {
  background: rgba(84, 110, 138, 0.12);
  color: #355368;
}

.tw-machine-cap-kind {
  background: rgba(26, 127, 90, 0.18);
  color: var(--accent);
  font-weight: 800;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.council-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.card {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.hero-council {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(234, 244, 238, 0.92)),
    radial-gradient(circle at top right, rgba(26, 127, 90, 0.12), transparent 28%);
}

.council-card {
  min-height: 100%;
}

.council-card-lead,
.council-card-wide {
  grid-column: span 2;
}

.pixel-board {
  position: relative;
  margin-top: 18px;
  min-height: 1120px;
  border-radius: 28px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(250, 253, 251, 0.96), rgba(228, 237, 232, 0.92)),
    repeating-linear-gradient(
      0deg,
      rgba(23, 49, 39, 0.04) 0,
      rgba(23, 49, 39, 0.04) 1px,
      transparent 1px,
      transparent 16px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(23, 49, 39, 0.04) 0,
      rgba(23, 49, 39, 0.04) 1px,
      transparent 1px,
      transparent 16px
    );
  overflow: hidden;
}

.pixel-seat,
.pixel-table {
  position: absolute;
}

.pixel-seat {
  width: 220px;
  padding: 14px;
  border: 4px solid #173127;
  border-radius: 0;
  background: #ffffff;
  box-shadow: 8px 8px 0 rgba(23, 49, 39, 0.18);
  z-index: 2;
}

.pixel-seat::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(23, 49, 39, 0.12);
  pointer-events: none;
}

.pixel-seat .seat-photo {
  margin-bottom: 10px;
  border-radius: 0;
  border: 4px solid #173127;
  image-rendering: pixelated;
  filter: saturate(0.92) contrast(1.04);
  object-position: center 20%;
}

.pixel-seat strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.seat-current {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.pixel-seat-1 { top: 24px; left: 50%; transform: translateX(-50%); }
.pixel-seat-2 { top: 160px; left: 40px; }
.pixel-seat-3 { top: 440px; left: 20px; }
.pixel-seat-4 { bottom: 120px; left: 80px; }
.pixel-seat-5 { top: 160px; right: 40px; }
.pixel-seat-6 { top: 440px; right: 20px; }
.pixel-seat-7 { bottom: 120px; right: 80px; }
.pixel-seat-8 { bottom: 24px; left: 50%; transform: translateX(-50%); }

.pixel-table {
  top: 250px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 320px));
  height: 560px;
  border: 8px solid #173127;
  border-radius: 42px;
  background:
    repeating-linear-gradient(
      45deg,
      #ba8a5f 0,
      #ba8a5f 12px,
      #a8774f 12px,
      #a8774f 24px
    );
  box-shadow:
    inset 0 0 0 8px #e6c8a5,
    12px 12px 0 rgba(23, 49, 39, 0.18);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  z-index: 3;
}

.pixel-table::before,
.pixel-table::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  background: #6f4d33;
  border: 6px solid #173127;
}

.pixel-table::before {
  height: 90px;
  bottom: -84px;
}

.pixel-table::after {
  width: 180px;
  height: 26px;
  bottom: -110px;
}

.pixel-table-inner {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 80px);
  padding: 22px;
  border: 4px solid #173127;
  background: rgba(255, 248, 236, 0.9);
  text-align: center;
  z-index: 1;
}

.pixel-table:hover {
  transform: translateX(-50%) translateY(-4px);
  box-shadow:
    inset 0 0 0 8px #e6c8a5,
    16px 16px 0 rgba(23, 49, 39, 0.18);
}

.pixel-table-title,
.pixel-table-subtitle {
  display: block;
}

.pixel-table-title {
  font-size: 28px;
  font-weight: 800;
}

.pixel-table-subtitle {
  margin-top: 8px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.pixel-table-cta {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 12px;
  border: 3px solid #173127;
  background: #1a7f5a;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legend-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 22, 17, 0.72);
  backdrop-filter: blur(8px);
  z-index: 40;
}

.legend-overlay.is-open {
  display: flex;
}

.legend-panel {
  width: min(1080px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border: 4px solid #173127;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(241, 246, 243, 0.98));
  box-shadow: 16px 16px 0 rgba(23, 49, 39, 0.22);
}

.pixel-board-legend {
  min-height: 1120px;
  margin-top: 18px;
}

.legend-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.legend-close {
  width: auto;
  padding: 12px 16px;
  border: 3px solid #173127;
  border-radius: 0;
  background: #173127;
  color: #fff;
  font-weight: 800;
}

.seat-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 14px;
  display: block;
  margin-bottom: 14px;
  background: rgba(23, 49, 39, 0.08);
}

.seat-legend {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.seat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}

.council-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.5;
}

.council-list li + li {
  margin-top: 10px;
}

.seat-credits a {
  color: var(--accent);
}

.timeline-lite {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.timeline-lite div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(26, 127, 90, 0.08);
}

.timeline-lite span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.timeline-lite p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.member {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.name {
  margin: 6px 0 0;
  font-size: 26px;
}

.role {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.status-badge {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: white;
}

.status-online { background: var(--accent); }
.status-idle { background: var(--idle); }
.status-busy { background: var(--busy); }
.status-offline { background: var(--offline); }
.status-maintenance { background: var(--maintenance); }

.meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
}

.meta div {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

dd {
  margin: 6px 0 0;
  font-size: 15px;
}

.note {
  min-height: 32px;
  color: var(--muted);
  margin: 0;
}

.focus-box {
  padding: 14px;
  border-radius: 16px;
  background: rgba(26, 127, 90, 0.08);
}

.focus-label {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.current-focus {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

.signal-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.signal-pill,
.checklist-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.signal-pill {
  border: 1px solid transparent;
}

.signal-danger {
  background: rgba(139, 91, 99, 0.12);
  border-color: rgba(139, 91, 99, 0.18);
  color: var(--offline);
}

.signal-warm {
  background: rgba(208, 137, 31, 0.12);
  border-color: rgba(208, 137, 31, 0.18);
  color: #a66e13;
}

.signal-ok {
  background: rgba(26, 127, 90, 0.12);
  border-color: rgba(26, 127, 90, 0.18);
  color: var(--accent);
}

.signal-muted,
.signal-neutral {
  background: rgba(23, 49, 39, 0.06);
  border-color: rgba(23, 49, 39, 0.1);
  color: var(--muted);
}

.remote-box,
.checklist-box,
.help-box {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
}

.checklist-box.is-complete {
  background: rgba(26, 127, 90, 0.08);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-label {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

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

.remote-copy,
.help-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.remote-copy {
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  word-break: break-all;
  color: var(--ink);
}

.checklist-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checklist-pill {
  background: rgba(23, 49, 39, 0.05);
  color: var(--muted);
}

.checklist-pill.is-ready {
  background: rgba(26, 127, 90, 0.14);
  color: var(--accent);
}

.checklist-pill.is-pending {
  background: rgba(208, 137, 31, 0.12);
  color: #a66e13;
}

.checklist-pill.is-muted {
  background: rgba(23, 49, 39, 0.06);
  color: var(--muted);
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

select,
input,
button {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  font: inherit;
}

button {
  background: var(--ink);
  color: white;
  border: none;
  cursor: pointer;
}

button:hover {
  opacity: 0.92;
}

@media (max-width: 760px) {
  .hero-nav {
    justify-content: flex-start;
  }

  .fleet-head {
    align-items: start;
  }

  .council-card-lead,
  .council-card-wide {
    grid-column: span 1;
  }

  .pixel-board {
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .pixel-seat,
  .pixel-table {
    position: static;
    width: 100%;
    transform: none;
  }

  .pixel-table {
    order: -1;
    height: 240px;
    margin-bottom: 8px;
  }

  .pixel-table::before {
    height: 50px;
    bottom: -48px;
  }

  .pixel-table::after {
    width: 120px;
    bottom: -72px;
  }

  .legend-panel {
    padding: 18px;
  }

  .legend-panel-head {
    flex-direction: column;
  }

  .pixel-board-legend {
    min-height: auto;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}
