:root {
  --bg: #071117;
  --panel: rgba(11, 24, 31, 0.78);
  --panel-strong: rgba(10, 22, 29, 0.96);
  --line: rgba(186, 215, 222, 0.12);
  --line-strong: rgba(186, 215, 222, 0.2);
  --text: #ebf4f1;
  --muted: #92a8af;
  --accent: #8bffd7;
  --accent-2: #77b8ff;
  --accent-3: #ffd18a;
  --danger: #ff9f8c;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 18% 18%, rgba(119, 184, 255, 0.16), transparent 24%),
    radial-gradient(circle at 80% 10%, rgba(139, 255, 215, 0.12), transparent 18%),
    #071117;
  color: var(--text);
  font-family: "Sora", sans-serif;
}

body {
  overflow-x: hidden;
}

h1,
h2 {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  letter-spacing: -0.02em;
}

button,
select,
input {
  font: inherit;
}

.ambient,
.grid-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient-a {
  background:
    radial-gradient(circle at 24% 28%, rgba(119, 184, 255, 0.1), transparent 22%),
    radial-gradient(circle at 74% 18%, rgba(139, 255, 215, 0.08), transparent 16%);
  filter: blur(32px);
}

.ambient-b {
  background: radial-gradient(circle at 78% 74%, rgba(255, 209, 138, 0.06), transparent 22%);
  filter: blur(48px);
}

.grid-glow {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 82%);
  opacity: 0.35;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar,
.toolbar,
.workspace,
.error-banner {
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
}

.title-cluster h1 {
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  line-height: 1;
  margin-top: 6px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.68rem;
}

.top-summary {
  margin: 10px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.headline-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  gap: 16px;
}

.headline-metric {
  min-width: 88px;
}

.headline-metric span,
.tool span,
.inline-stat span,
.rail-copy,
.section-note,
.property-type,
.property-rate-label {
  color: var(--muted);
}

.headline-metric span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.headline-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.6rem;
  font-weight: 600;
}

.toolbar,
.workspace {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 18%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.toolbar {
  display: grid;
  grid-template-columns: 150px 150px 260px minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 12px;
  padding: 16px 18px;
  border-radius: 24px;
  margin-bottom: 16px;
}

.tool {
  display: grid;
  gap: 8px;
}

.tool-properties select {
  min-height: 88px;
}

select,
input,
button {
  border-radius: 14px;
  border: 1px solid var(--line-strong);
}

select,
input {
  background: rgba(5, 13, 18, 0.7);
  color: var(--text);
  padding: 10px 12px;
}

button {
  background: linear-gradient(135deg, var(--accent), #cffff1);
  color: #051016;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

.chip-fieldset {
  margin: 0;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
  background: rgba(4, 12, 17, 0.44);
}

.chip-fieldset legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 340px;
  gap: 0;
  border-radius: 28px;
  overflow: hidden;
}

.canvas,
.utility-rail,
.inventory {
  padding: 22px;
}

.canvas {
  border-right: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin-top: 4px;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
}

.section-note {
  margin: 0;
  font-size: 0.88rem;
}

.section-head.secondary {
  margin-top: 10px;
}

.inline-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.inline-stat {
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
}

.inline-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.55rem;
  font-weight: 600;
}

.inline-stat small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.section-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.utility-rail {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  background: rgba(7, 18, 24, 0.54);
}

.rail-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.rail-section:last-child {
  border-bottom: 0;
}

.gauge-section {
  padding-top: 4px;
}

.gauge-wrap {
  position: relative;
  display: grid;
  place-items: center;
  margin-top: 8px;
}

.gauge-wrap svg {
  width: min(100%, 220px);
  height: auto;
}

.gauge-copy {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 6px;
}

.gauge-copy span {
  color: var(--muted);
  font-size: 0.84rem;
}

.gauge-copy strong {
  font-size: 2.3rem;
  font-weight: 600;
}

.rail-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.sync-status {
  margin: 0;
  font-weight: 600;
}

.rail-copy {
  margin: 8px 0 0;
  font-size: 0.88rem;
  line-height: 1.65;
}

.rail-copy.muted {
  opacity: 0.9;
}

.sync-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.tool.compact {
  flex: 1 1 auto;
}

.tool.compact select {
  width: 100%;
}

.inventory {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
}

.property-list {
  display: grid;
  margin-top: 10px;
}

.property-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 120px 140px;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.property-row:last-child {
  border-bottom: 0;
}

.property-meta {
  display: grid;
  gap: 8px;
}

.property-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.property-name {
  font-size: 0.98rem;
  font-weight: 600;
}

.property-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.property-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.property-pressure,
.property-next {
  text-align: right;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-occupied {
  background: rgba(255, 184, 110, 0.12);
  color: #ffd6a3;
}

.status-available {
  background: rgba(139, 255, 215, 0.1);
  color: #abffe4;
}

.status-blocked {
  background: rgba(255, 159, 140, 0.12);
  color: #ffc3b8;
}

.error-banner {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 159, 140, 0.24);
  background: rgba(58, 21, 18, 0.45);
  color: #ffd8d1;
}

.hidden {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1220px) {
  .topbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .headline-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .tool-properties,
  .chip-fieldset {
    grid-column: 1 / -1;
  }

  .canvas {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1420px);
    padding-top: 16px;
  }

  .toolbar,
  .canvas,
  .utility-rail,
  .inventory {
    padding: 16px;
  }

  .headline-metrics,
  .inline-stats,
  .toolbar {
    grid-template-columns: 1fr;
  }

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

  .property-pressure,
  .property-next {
    text-align: left;
  }

  .section-head,
  .sync-actions,
  .rail-row {
    align-items: start;
    flex-direction: column;
  }
}
