:root {
  --ink: #141414;
  --paper: #faf7f0;
  --muted: #6b645c;
  --line: rgba(20, 20, 20, 0.14);
  --violet: #7c3aed;
  --green: #10b981;
  --amber: #d97706;
  --white: #fffdf8;
  --shadow: 0 20px 70px rgba(20, 20, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(20, 20, 20, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(20, 20, 20, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
}

.command-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(220px, 330px);
  gap: 18px;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 247, 240, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand strong {
  display: block;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 0.95;
}

.brand small {
  display: block;
  overflow: hidden;
  max-width: 360px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  background: var(--white);
}

.tab {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
}

.tab.is-active {
  background: var(--ink);
  color: var(--paper);
}

.search {
  display: grid;
  gap: 5px;
}

.search span,
.eyebrow,
.metric small,
dt,
.stream-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  padding: 0 12px;
  outline: 0;
}

.search input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16);
}

.workspace {
  width: min(1580px, 100%);
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.screen {
  display: none;
  animation: rise 240ms ease-out;
}

.screen.is-active {
  display: block;
}

.screen-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(34px, 6vw, 76px);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 17px;
  line-height: 1.18;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 1px;
  width: min(580px, 100%);
  border: 1px solid var(--line);
  background: var(--line);
}

.metric {
  min-height: 76px;
  padding: 12px;
  background: var(--white);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 28px;
  line-height: 1;
}

.board-shell {
  display: grid;
  grid-template-columns: minmax(260px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.beacon-map {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 48%, rgba(124, 58, 237, 0.18), transparent 28%),
    radial-gradient(circle at 72% 18%, rgba(16, 185, 129, 0.18), transparent 21%),
    var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
}

.beacon-map::before,
.beacon-map::after {
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(250, 247, 240, 0.18);
  transform: rotate(12deg);
  content: "";
}

.beacon-map::after {
  inset: 27%;
  border-color: rgba(16, 185, 129, 0.26);
  transform: rotate(-18deg);
}

.beacon-core {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 128px;
  height: 128px;
  place-items: center;
  transform: translate(-50%, -50%);
}

.beacon-core strong {
  position: relative;
  z-index: 2;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 42px;
}

.beacon-core small {
  position: relative;
  z-index: 2;
  margin-top: -46px;
  color: rgba(250, 247, 240, 0.7);
  font-size: 11px;
  text-transform: uppercase;
}

.pulse {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(250, 247, 240, 0.42);
  animation: pulse 3.8s ease-in-out infinite;
}

.pulse.two {
  animation-delay: 1.3s;
  border-color: rgba(16, 185, 129, 0.5);
}

.node {
  position: absolute;
  z-index: 3;
  width: 112px;
  min-height: 42px;
  border: 1px solid rgba(250, 247, 240, 0.32);
  background: rgba(250, 247, 240, 0.08);
  color: var(--paper);
  transition: transform 160ms ease, background 160ms ease;
}

.node:hover {
  background: rgba(16, 185, 129, 0.22);
  transform: translateY(-2px);
}

.node-a { left: 24px; top: 70px; }
.node-b { right: 24px; top: 118px; }
.node-c { left: 34px; bottom: 112px; }
.node-d { right: 30px; bottom: 58px; }

.kanban {
  min-width: 0;
  border-top: 3px solid var(--ink);
}

.kanban-toolbar,
.stream-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 56px;
}

.icon-button,
.primary,
.move,
.ghost {
  min-height: 38px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 0 14px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.primary {
  min-height: 48px;
  margin-top: 18px;
  background: var(--violet);
  border-color: var(--violet);
}

.move:hover,
.primary:hover,
.icon-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20, 20, 20, 0.18);
}

.ghost {
  cursor: default;
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
  min-width: 0;
}

.lane {
  min-width: 0;
  border-left: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.58);
}

.lane header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
}

.lane header span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 800;
}

.lane header strong {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  background: var(--green);
  color: var(--ink);
}

.lane-items {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.order-card {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 12px;
  transition: transform 160ms ease, border-color 160ms ease;
}

.order-card:hover {
  border-color: rgba(124, 58, 237, 0.45);
  transform: translateY(-2px);
}

.card-top,
.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.card-top strong {
  font-size: 12px;
}

.card-top span {
  color: var(--violet);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
}

dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
}

dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.inspection {
  margin: 12px 0 0;
  border-left: 3px solid var(--amber);
  color: #4b3720;
  padding-left: 9px;
  font-size: 13px;
  line-height: 1.35;
}

.evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.evidence span {
  border: 1px solid var(--line);
  padding: 4px 7px;
  font-size: 11px;
  text-transform: uppercase;
}

.evidence .ok {
  background: rgba(16, 185, 129, 0.18);
}

.evidence .wait {
  background: rgba(217, 119, 6, 0.16);
}

.status {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.event-stream {
  margin-top: 22px;
  border-top: 3px solid var(--ink);
}

.events {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.event {
  min-height: 120px;
  background: var(--white);
  padding: 12px;
}

.event time,
.event strong,
.event span {
  display: block;
}

.event time {
  color: var(--muted);
  font-size: 12px;
}

.event strong {
  margin: 10px 0 6px;
  font-size: 13px;
}

.event span {
  font-size: 13px;
  line-height: 1.38;
}

.analytics-layout,
.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 18px;
}

.wide-panel {
  min-height: 420px;
  border-top: 3px solid var(--ink);
  background: rgba(255, 253, 248, 0.72);
  padding: 18px 0 0;
}

.bars {
  display: grid;
  gap: 14px;
  padding-top: 18px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 190px) minmax(120px, 1fr) 62px;
  gap: 14px;
  align-items: center;
}

.bar-row span,
.bar-row strong {
  overflow-wrap: anywhere;
}

.bar-track {
  height: 28px;
  background: rgba(20, 20, 20, 0.08);
}

.bar-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--green));
}

.stage-chart {
  display: flex;
  align-items: end;
  gap: 22px;
  min-height: 230px;
  padding-top: 32px;
}

.stage-bar {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 74px;
}

.stage-bar i {
  display: block;
  width: 48px;
  background: var(--ink);
}

.stage-bar strong {
  color: var(--violet);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 28px;
}

.stage-bar span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.copy {
  max-width: 520px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.terminal {
  min-height: 260px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--green);
  padding: 18px;
  white-space: pre-wrap;
}

.public-status {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.public-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 130px 110px;
  gap: 14px;
  align-items: center;
  min-height: 64px;
  background: var(--white);
  padding: 12px 16px;
}

.public-item span,
.public-item mark {
  overflow-wrap: anywhere;
}

.public-item mark {
  background: rgba(16, 185, 129, 0.18);
  color: var(--ink);
  padding: 6px 8px;
}

.empty,
.error,
.skeleton {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.error {
  color: #b91c1c;
  padding: 16px;
  background: #fee2e2;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.35;
    transform: scale(0.85) rotate(0deg);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.08) rotate(45deg);
  }
}

@media (max-width: 1120px) {
  .command-bar,
  .board-shell,
  .analytics-layout,
  .import-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
  }

  .tab {
    flex: 1 0 auto;
  }

  .beacon-map {
    min-height: 340px;
  }

  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .events {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .command-bar {
    padding: 12px;
  }

  .workspace {
    padding: 20px 12px 32px;
  }

  .brand small {
    white-space: normal;
  }

  .screen-head {
    display: grid;
    align-items: start;
  }

  .metric-strip,
  .board,
  .events,
  .public-item {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: auto;
  }

  .beacon-map {
    min-height: 300px;
  }

  .node {
    width: 96px;
    font-size: 12px;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .stage-chart {
    overflow-x: auto;
  }
}
