:root {
  --bg: #f4f7f3;
  --panel: #ffffff;
  --ink: #17201a;
  --muted: #657266;
  --line: #d9e2d8;
  --green: #247a4b;
  --green-strong: #145f37;
  --yellow: #b7791f;
  --red: #b42318;
  --blue: #2563a8;
  --soft-green: #e7f4ea;
  --soft-yellow: #fff4d8;
  --soft-red: #ffe6e2;
  --shadow: 0 16px 40px rgba(21, 46, 27, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  background: #102017;
  color: #eff7ef;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: #1d6b42;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #b8c9bb;
  font-size: 13px;
  margin-top: 2px;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-button {
  border: 0;
  background: transparent;
  color: #dfece1;
  text-align: left;
  padding: 12px 14px;
  border-radius: 6px;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.sidebar-footer label,
.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-footer label {
  color: #b8c9bb;
}

select,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
}

.main {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--green-strong);
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 6px;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
  margin-bottom: 6px;
}

.topbar-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.field {
  display: grid;
  gap: 6px;
  width: 210px;
}

.primary-button,
.secondary-button,
.icon-button {
  border-radius: 6px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  background: var(--green);
  color: white;
}

.secondary-button {
  background: #ffffff;
  color: var(--green-strong);
  border-color: var(--line);
}

.icon-button {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.icon-button.active {
  background: var(--soft-yellow);
  color: #7a4d0b;
  border-color: #ecc96a;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
}

.metric-card span,
.metric-card small {
  display: block;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 26px;
  line-height: 1.05;
}

.metric-card small {
  color: var(--muted);
}

.dashboard-layout,
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-header p,
.panel > p {
  color: var(--muted);
  margin-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--soft-green);
  color: var(--green-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.greenhouse-map {
  display: grid;
  grid-template-columns: 0.7fr 1fr 1.35fr 1fr;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.zone-column {
  position: relative;
  padding: 14px;
  display: grid;
  align-content: space-between;
  border-right: 1px solid var(--line);
  background: #f9fbf8;
}

.zone-column:last-child {
  border-right: 0;
}

.zone-column.core {
  background: #edf8ef;
}

.zone-label {
  display: grid;
  gap: 2px;
}

.zone-label strong {
  font-size: 14px;
}

.zone-label span {
  color: var(--muted);
  font-size: 12px;
}

.sensor-stack {
  display: grid;
  gap: 10px;
}

.sensor-dot {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 6px;
  padding: 10px;
  min-height: 72px;
}

.sensor-dot strong,
.sensor-dot span {
  display: block;
}

.sensor-dot strong {
  font-size: 13px;
}

.sensor-dot span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.sensor-dot.warn {
  border-color: #e9b949;
  background: #fff9e8;
}

.sensor-dot.risk {
  border-color: #f08a7a;
  background: #fff0ed;
}

.decision-box {
  padding: 16px;
  border-radius: 8px;
  background: #f6faf6;
  border: 1px solid var(--line);
  margin-bottom: 14px;
}

.decision-box strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.decision-box p {
  color: var(--muted);
  margin-bottom: 0;
}

.actuator-grid {
  display: grid;
  gap: 10px;
}

.actuator {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.actuator span {
  color: var(--muted);
  font-size: 13px;
}

.state {
  font-weight: 900;
  color: var(--green-strong);
}

.state.off {
  color: var(--muted);
}

.event-log {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.event-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdfb;
}

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

.event-item strong {
  display: block;
  margin-bottom: 3px;
}

.event-item p {
  color: var(--muted);
  margin-bottom: 0;
}

.compact {
  max-height: 360px;
}

.sensor-table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.zone-summary {
  display: grid;
  gap: 10px;
}

.zone-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.zone-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.zone-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.zone-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.scenario-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.timeline,
.people-list,
.bar-list,
.chat-box {
  display: grid;
  gap: 10px;
}

.timeline-item,
.person-card,
.chat-message {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fbfdfb;
}

.timeline-item strong,
.person-card strong {
  display: block;
}

.timeline-item span,
.person-card span,
.chat-message span {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.resource-meter {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 8px;
  background: #eef6ff;
  color: #143a68;
  margin: 14px 0;
}

.resource-meter strong {
  font-size: 30px;
}

.data-list {
  display: grid;
  gap: 10px;
}

.data-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.data-list dt {
  color: var(--muted);
}

.data-list dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.bar-item {
  display: grid;
  gap: 6px;
}

.bar-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.bar-track {
  height: 10px;
  background: #e7ece7;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--green);
}

.full {
  width: 100%;
  margin-top: 12px;
}

.chat-box {
  min-height: 300px;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf8;
}

.chat-message.system {
  background: var(--soft-green);
}

.chat-message.user {
  background: #ffffff;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

  .dashboard-layout,
  .split-layout,
  .status-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 18px;
  }

  .topbar,
  .panel-header,
  .data-list div {
    display: grid;
  }

  .topbar-actions,
  .field {
    width: 100%;
  }

  .dashboard-layout,
  .split-layout,
  .status-grid,
  .greenhouse-map,
  .nav-tabs {
    grid-template-columns: 1fr;
  }

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

  .chat-form {
    grid-template-columns: 1fr;
  }
}

/* Design refresh: operational control room */
:root {
  --bg: #eef2ef;
  --panel: #fbfcfb;
  --panel-strong: #ffffff;
  --ink: #142019;
  --muted: #607064;
  --line: #d6ded7;
  --green: #216e46;
  --green-strong: #124f32;
  --cyan: #1b7f89;
  --blue: #285f9f;
  --amber: #a86613;
  --red: #b53326;
  --soft-green: #e7f3ea;
  --soft-cyan: #e2f3f5;
  --soft-blue: #e8f0fb;
  --soft-yellow: #fff3d7;
  --soft-red: #ffe8e4;
  --shadow: 0 18px 50px rgba(16, 32, 23, 0.08);
}

body {
  background:
    linear-gradient(rgba(20, 32, 25, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 32, 25, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  background: #0d1712;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 18px 0 44px rgba(16, 32, 23, 0.16);
}

.brand {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.brand-mark {
  border-radius: 8px;
  background: #eaf6ee;
  color: #0d1712;
  border: 0;
  box-shadow: inset 0 -5px 0 rgba(33, 110, 70, 0.22);
}

.sidebar-panel {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-kicker,
.sidebar-panel span {
  color: #aebfb2;
  font-size: 12px;
}

.sidebar-panel strong {
  color: #ffffff;
  font-size: 15px;
}

.nav-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid transparent;
}

.nav-button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6d7d70;
  flex: 0 0 auto;
}

.nav-button.active {
  background: #eef7f0;
  color: #0d1712;
  border-color: rgba(255, 255, 255, 0.22);
}

.nav-button.active::before {
  background: var(--green);
}

.sidebar-footer {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.sidebar-footer select {
  background: #17241c;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
}

.main {
  padding: 30px clamp(22px, 3vw, 42px) 42px;
}

.topbar {
  align-items: center;
  gap: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 252, 251, 0.9);
  box-shadow: var(--shadow);
}

.title-block {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.eyebrow {
  color: var(--cyan);
  letter-spacing: 0;
}

h1 {
  font-size: clamp(25px, 3vw, 38px);
  letter-spacing: 0;
}

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

.system-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

#statusChip {
  color: var(--green-strong);
  background: var(--soft-green);
  border-color: #c8ddce;
}

.topbar-actions {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

select,
input {
  min-height: 42px;
  border-color: #cdd7cf;
  background: #fcfdfc;
  box-shadow: 0 1px 0 rgba(20, 32, 25, 0.03);
}

.primary-button,
.secondary-button,
.icon-button {
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(20, 32, 25, 0.12);
}

.primary-button {
  background: #123f2b;
  border-color: #123f2b;
}

.secondary-button {
  background: #ffffff;
  color: #163b2a;
}

.icon-button {
  min-width: 72px;
}

.status-grid {
  grid-template-columns: 1.15fr repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metric-card,
.panel {
  background: rgba(251, 252, 251, 0.94);
  border-color: #d2dbd4;
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--green);
}

.metric-card span {
  letter-spacing: 0;
}

.metric-card strong {
  font-size: clamp(24px, 2.4vw, 34px);
  letter-spacing: 0;
}

.status-card::before {
  background: var(--green);
}

.temp-card::before {
  background: var(--amber);
}

.water-card::before {
  background: var(--cyan);
}

.delta-card::before {
  background: var(--blue);
}

body[data-status="warn"] .status-card::before,
body[data-status="watch"] .status-card::before {
  background: var(--amber);
}

body[data-status="critical"] .status-card::before {
  background: var(--red);
}

.dashboard-layout {
  grid-template-columns: minmax(520px, 1.35fr) minmax(360px, 0.65fr);
}

.panel {
  border-radius: 8px;
}

.panel-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.pill {
  border: 1px solid #c8ddce;
}

.greenhouse-map {
  position: relative;
  min-height: 500px;
  border-color: #cfd9d1;
  background: #edf2ef;
}

.greenhouse-map::before,
.greenhouse-map::after {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  writing-mode: vertical-rl;
  text-transform: uppercase;
}

.greenhouse-map::before {
  content: "ACCESO";
  inset: 0 auto 0 0;
  background: rgba(27, 127, 137, 0.9);
}

.greenhouse-map::after {
  content: "SALIDA TERMICA";
  inset: 0 0 0 auto;
  background: rgba(168, 102, 19, 0.9);
}

.zone-column {
  padding: 18px 14px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.64)),
    repeating-linear-gradient(0deg, transparent 0, transparent 17px, rgba(20, 32, 25, 0.035) 18px);
}

.zone-column:first-child {
  padding-left: 42px;
}

.zone-column:last-child {
  padding-right: 42px;
}

.zone-column.core {
  background:
    linear-gradient(rgba(231, 243, 234, 0.82), rgba(231, 243, 234, 0.82)),
    repeating-linear-gradient(0deg, transparent 0, transparent 17px, rgba(20, 32, 25, 0.04) 18px);
}

.zone-label {
  padding: 12px;
  border: 1px solid rgba(20, 32, 25, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.zone-readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.zone-readout b {
  padding: 7px 8px;
  border-radius: 6px;
  background: #eef5f0;
  color: #183f2b;
  font-size: 12px;
}

.sensor-stack {
  gap: 8px;
}

.sensor-dot {
  border-color: rgba(20, 32, 25, 0.1);
  box-shadow: 0 8px 18px rgba(20, 32, 25, 0.06);
}

.sensor-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.sensor-topline em {
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  color: var(--green-strong);
  background: var(--soft-green);
  border-radius: 999px;
  padding: 3px 7px;
}

.sensor-dot.warn .sensor-topline em {
  color: #7a4d0b;
  background: var(--soft-yellow);
}

.sensor-dot.risk .sensor-topline em {
  color: #8f241a;
  background: var(--soft-red);
}

.decision-box {
  border-color: #c8ddce;
  background: linear-gradient(180deg, #f7fbf8, #eef7f1);
}

.decision-box strong {
  color: #123f2b;
}

.actuator {
  background: #ffffff;
  border-color: #d4ddd6;
}

.actuator:has(.state:not(.off)) {
  border-color: #b7d5bf;
  background: var(--soft-green);
}

.event-item {
  background: #ffffff;
}

table {
  min-width: 760px;
}

th {
  background: #f4f8f5;
}

tbody tr:hover {
  background: #f8fbf8;
}

.zone-card {
  background: #ffffff;
}

.resource-meter {
  background: var(--soft-blue);
}

.chat-box {
  background: #eef3f0;
}

@media (max-width: 1120px) {
  .sidebar {
    position: static;
    min-height: auto;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    border-left: 0;
    padding-left: 0;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 16px;
  }

  .topbar {
    padding: 14px;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .greenhouse-map::before,
  .greenhouse-map::after {
    display: none;
  }

  .zone-column:first-child,
  .zone-column:last-child {
    padding: 14px;
  }
}

/* Cinematic holographic command skin */
:root {
  --bg: #05090d;
  --panel: rgba(8, 18, 24, 0.78);
  --panel-strong: rgba(11, 27, 35, 0.92);
  --ink: #e8fbff;
  --muted: #86a3aa;
  --line: rgba(99, 226, 255, 0.22);
  --green: #47e686;
  --green-strong: #8dffb8;
  --cyan: #43dfff;
  --blue: #5f89ff;
  --amber: #ffb74a;
  --red: #ff5b4f;
  --violet: #b989ff;
  --soft-green: rgba(71, 230, 134, 0.13);
  --soft-cyan: rgba(67, 223, 255, 0.14);
  --soft-blue: rgba(95, 137, 255, 0.14);
  --soft-yellow: rgba(255, 183, 74, 0.15);
  --soft-red: rgba(255, 91, 79, 0.16);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

body {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 62% 8%, rgba(67, 223, 255, 0.16), transparent 32%),
    radial-gradient(circle at 88% 74%, rgba(255, 183, 74, 0.12), transparent 30%),
    linear-gradient(rgba(67, 223, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 223, 255, 0.055) 1px, transparent 1px),
    #05090d;
  background-size: auto, auto, 34px 34px, 34px 34px, auto;
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent, rgba(67, 223, 255, 0.05) 50%, transparent),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 5px);
  mix-blend-mode: screen;
  opacity: 0.46;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0 43%, rgba(67, 223, 255, 0.10) 48%, transparent 53% 100%);
  animation: hudSweep 9s linear infinite;
  z-index: 0;
}

@keyframes hudSweep {
  0% { transform: translateX(-80%); opacity: 0; }
  18% { opacity: 0.45; }
  48% { opacity: 0.16; }
  100% { transform: translateX(90%); opacity: 0; }
}

.app-shell,
.sidebar,
.main {
  position: relative;
  z-index: 1;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(8, 18, 24, 0.96), rgba(4, 9, 13, 0.98)),
    #071016;
  border-right: 1px solid rgba(67, 223, 255, 0.22);
  box-shadow: 22px 0 60px rgba(0, 0, 0, 0.48);
}

.brand {
  border-bottom-color: rgba(67, 223, 255, 0.20);
}

.brand-mark {
  background:
    linear-gradient(135deg, rgba(67, 223, 255, 0.22), rgba(255, 183, 74, 0.16)),
    rgba(5, 14, 19, 0.96);
  color: #dffbff;
  border: 1px solid rgba(67, 223, 255, 0.72);
  box-shadow: 0 0 26px rgba(67, 223, 255, 0.22), inset 0 0 18px rgba(67, 223, 255, 0.14);
}

.brand strong {
  color: #ffffff;
  text-shadow: 0 0 18px rgba(67, 223, 255, 0.44);
}

.brand span,
.sidebar-footer label,
.sidebar-kicker,
.sidebar-panel span {
  color: #8fb8c0;
}

.sidebar-panel {
  background: rgba(67, 223, 255, 0.06);
  border-color: rgba(67, 223, 255, 0.24);
  box-shadow: inset 0 0 28px rgba(67, 223, 255, 0.08);
}

.sidebar-panel strong {
  color: var(--amber);
}

.nav-button {
  color: #bce9ef;
  background: rgba(255, 255, 255, 0.018);
}

.nav-button::before {
  background: rgba(67, 223, 255, 0.34);
  box-shadow: 0 0 12px rgba(67, 223, 255, 0.42);
}

.nav-button:hover {
  background: rgba(67, 223, 255, 0.09);
  color: #ffffff;
}

.nav-button.active {
  background:
    linear-gradient(90deg, rgba(67, 223, 255, 0.24), rgba(255, 183, 74, 0.08)),
    rgba(6, 18, 23, 0.92);
  color: #ffffff;
  border-color: rgba(67, 223, 255, 0.34);
  box-shadow: inset 0 0 22px rgba(67, 223, 255, 0.12), 0 0 20px rgba(67, 223, 255, 0.10);
}

.nav-button.active::before {
  background: var(--amber);
  box-shadow: 0 0 16px rgba(255, 183, 74, 0.65);
}

.sidebar-footer {
  border-top-color: rgba(67, 223, 255, 0.18);
}

.sidebar-footer select,
select,
input {
  background: rgba(4, 11, 15, 0.72);
  color: var(--ink);
  border-color: rgba(67, 223, 255, 0.27);
  box-shadow: inset 0 0 20px rgba(67, 223, 255, 0.045);
}

option {
  color: #0b151a;
}

.topbar,
.metric-card,
.panel {
  position: relative;
  background:
    linear-gradient(135deg, rgba(67, 223, 255, 0.08), transparent 35%),
    rgba(6, 15, 20, 0.82);
  border: 1px solid rgba(67, 223, 255, 0.24);
  box-shadow: var(--shadow), inset 0 0 36px rgba(67, 223, 255, 0.045);
  backdrop-filter: blur(18px);
}

.topbar::before,
.panel::before,
.metric-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(67, 223, 255, 0.52), transparent 22% 78%, rgba(255, 183, 74, 0.42)) top / 100% 1px no-repeat,
    linear-gradient(90deg, rgba(67, 223, 255, 0.35), transparent) bottom / 100% 1px no-repeat;
}

.topbar {
  border-radius: 8px;
}

.topbar-actions {
  border-left-color: rgba(67, 223, 255, 0.20);
}

.eyebrow {
  color: var(--amber);
}

h1 {
  font-size: 34px;
  color: #ffffff;
  text-shadow: 0 0 24px rgba(67, 223, 255, 0.30);
}

h2 {
  color: #ffffff;
}

.panel-header p,
.panel > p,
.metric-card small,
.metric-card span,
.actuator span,
.sensor-dot span,
.event-item p,
.timeline-item span,
.person-card span,
.chat-message span,
.data-list dt {
  color: var(--muted);
}

.system-strip span,
.pill {
  background: rgba(67, 223, 255, 0.08);
  color: #dffbff;
  border-color: rgba(67, 223, 255, 0.27);
  box-shadow: inset 0 0 18px rgba(67, 223, 255, 0.07);
}

#statusChip {
  background: rgba(255, 183, 74, 0.12);
  color: var(--amber);
  border-color: rgba(255, 183, 74, 0.30);
}

.primary-button {
  background:
    linear-gradient(135deg, rgba(67, 223, 255, 0.36), rgba(67, 223, 255, 0.10)),
    #07131a;
  color: #ffffff;
  border-color: rgba(67, 223, 255, 0.48);
  box-shadow: 0 0 18px rgba(67, 223, 255, 0.18);
}

.secondary-button,
.icon-button {
  background: rgba(7, 19, 26, 0.72);
  color: #e8fbff;
  border-color: rgba(67, 223, 255, 0.28);
}

.icon-button.active {
  background: rgba(255, 183, 74, 0.16);
  color: var(--amber);
  border-color: rgba(255, 183, 74, 0.42);
}

.metric-card {
  min-height: 138px;
}

.metric-card::before {
  width: 3px;
  box-shadow: 0 0 18px currentColor;
}

.metric-card strong {
  font-size: 30px;
  color: #ffffff;
}

.status-card::before {
  background: var(--green);
}

.temp-card::before {
  background: var(--amber);
}

.water-card::before {
  background: var(--cyan);
}

.delta-card::before {
  background: var(--blue);
}

body[data-status="critical"] .status-card {
  border-color: rgba(255, 91, 79, 0.42);
}

.hud-ribbon {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.hud-ribbon span {
  min-height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(67, 223, 255, 0.22);
  background: rgba(67, 223, 255, 0.055);
  color: #a9eefa;
  font-size: 11px;
  font-weight: 900;
}

.greenhouse-map {
  min-height: 540px;
  background:
    radial-gradient(circle at center, rgba(67, 223, 255, 0.16), transparent 34%),
    linear-gradient(rgba(67, 223, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 223, 255, 0.055) 1px, transparent 1px),
    rgba(3, 10, 14, 0.70);
  background-size: auto, 22px 22px, 22px 22px, auto;
  border-color: rgba(67, 223, 255, 0.32);
  box-shadow: inset 0 0 60px rgba(67, 223, 255, 0.08);
}

.greenhouse-map::before {
  background: rgba(67, 223, 255, 0.70);
}

.greenhouse-map::after {
  background: rgba(255, 183, 74, 0.76);
}

.zone-column {
  background: rgba(6, 19, 24, 0.44);
  border-right-color: rgba(67, 223, 255, 0.20);
}

.zone-column.core {
  background:
    linear-gradient(rgba(71, 230, 134, 0.08), rgba(71, 230, 134, 0.035)),
    rgba(6, 19, 24, 0.55);
}

.zone-label {
  background: rgba(4, 12, 16, 0.76);
  border-color: rgba(67, 223, 255, 0.24);
  box-shadow: inset 0 0 24px rgba(67, 223, 255, 0.06);
}

.zone-label strong {
  color: #ffffff;
}

.zone-readout b {
  background: rgba(67, 223, 255, 0.10);
  color: #ddfbff;
  border: 1px solid rgba(67, 223, 255, 0.18);
}

.sensor-dot {
  background:
    linear-gradient(135deg, rgba(67, 223, 255, 0.10), transparent),
    rgba(5, 15, 20, 0.88);
  border-color: rgba(67, 223, 255, 0.22);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.24), inset 0 0 24px rgba(67, 223, 255, 0.04);
}

.sensor-dot strong {
  color: #ffffff;
}

.sensor-topline em {
  color: var(--green-strong);
  background: rgba(71, 230, 134, 0.13);
  border: 1px solid rgba(71, 230, 134, 0.20);
}

.sensor-dot.warn {
  background: rgba(46, 29, 7, 0.78);
  border-color: rgba(255, 183, 74, 0.34);
}

.sensor-dot.risk {
  background: rgba(43, 11, 10, 0.82);
  border-color: rgba(255, 91, 79, 0.42);
}

.sensor-dot.warn .sensor-topline em {
  color: var(--amber);
  background: rgba(255, 183, 74, 0.15);
}

.sensor-dot.risk .sensor-topline em {
  color: #ffaaa3;
  background: rgba(255, 91, 79, 0.18);
}

.decision-box {
  background:
    linear-gradient(135deg, rgba(255, 183, 74, 0.13), transparent 48%),
    rgba(5, 14, 18, 0.86);
  border-color: rgba(255, 183, 74, 0.28);
}

.decision-box strong {
  color: var(--amber);
}

.actuator,
.event-item,
.zone-card,
.timeline-item,
.person-card,
.chat-message {
  background: rgba(5, 14, 18, 0.82);
  border-color: rgba(67, 223, 255, 0.20);
}

.actuator:has(.state:not(.off)) {
  background: rgba(71, 230, 134, 0.11);
  border-color: rgba(71, 230, 134, 0.34);
}

.state {
  color: var(--green-strong);
  text-shadow: 0 0 14px rgba(71, 230, 134, 0.28);
}

.state.off {
  color: #79949a;
  text-shadow: none;
}

th {
  background: rgba(67, 223, 255, 0.08);
  color: #bceff8;
}

td {
  border-bottom-color: rgba(67, 223, 255, 0.13);
}

tbody tr:hover {
  background: rgba(67, 223, 255, 0.065);
}

.resource-meter {
  background:
    linear-gradient(135deg, rgba(95, 137, 255, 0.18), rgba(67, 223, 255, 0.08)),
    rgba(5, 14, 18, 0.84);
  color: #e8fbff;
  border: 1px solid rgba(95, 137, 255, 0.28);
}

.bar-track {
  background: rgba(255, 255, 255, 0.08);
}

.bar-fill {
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  box-shadow: 0 0 16px rgba(67, 223, 255, 0.28);
}

.data-list div {
  border-bottom-color: rgba(67, 223, 255, 0.14);
}

.chat-box {
  background: rgba(3, 10, 14, 0.62);
  border-color: rgba(67, 223, 255, 0.24);
}

.chat-message.system {
  background: rgba(67, 223, 255, 0.10);
}

.chat-message.user {
  background: rgba(255, 183, 74, 0.09);
}

@media (max-width: 1120px) {
  .sidebar {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: 28px;
  }

  .hud-ribbon {
    grid-template-columns: 1fr;
  }
}

/* Industrial avionics typography layer */
:root {
  --font-body: "Avenir Next", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Avenir Next Condensed", "DIN Condensed", "DIN Alternate", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-data: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
}

body {
  font-family: var(--font-body);
}

.brand strong,
h1,
h2,
.metric-card strong,
.nav-button,
.primary-button,
.secondary-button,
.icon-button,
.pill,
.system-strip span,
.hud-ribbon span,
.sidebar-panel strong,
.sensor-topline strong,
.zone-label strong,
.decision-box strong,
.actuator strong {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong {
  font-size: 18px;
  text-transform: uppercase;
}

.brand span,
.sidebar-panel span,
.sidebar-kicker,
.eyebrow,
.field span,
.metric-card span,
.metric-card small,
.panel-header p,
.sensor-dot span,
.zone-label span,
.actuator span,
.event-item p,
.timeline-item span,
.person-card span,
.chat-message span {
  font-family: var(--font-body);
}

h1 {
  font-size: 36px;
  line-height: 0.98;
  text-transform: uppercase;
}

h2 {
  font-size: 20px;
  line-height: 1;
  text-transform: uppercase;
}

.eyebrow,
.system-strip span,
.hud-ribbon span,
.metric-card span,
.sensor-topline em,
.pill,
.nav-button,
.primary-button,
.secondary-button,
.icon-button {
  text-transform: uppercase;
}

.metric-card strong,
.zone-readout b,
.sensor-dot span,
.state,
.resource-meter strong,
.bar-row span,
.data-list dd,
td,
th,
.event-item time {
  font-family: var(--font-data);
  letter-spacing: 0;
}

.metric-card strong {
  font-size: 32px;
  font-weight: 700;
}

.nav-button {
  font-size: 15px;
}

.primary-button,
.secondary-button,
.icon-button,
select,
input {
  font-weight: 700;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 17px;
}

.topbar {
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.metric-card,
.panel,
.sensor-dot,
.actuator,
.event-item,
.zone-card,
.timeline-item,
.person-card,
.chat-message {
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.primary-button,
.secondary-button,
.icon-button,
select,
input {
  border-radius: 2px;
}

.metric-card::before {
  width: 4px;
}

.sensor-topline em {
  border-radius: 2px;
}

.hud-ribbon span {
  font-size: 12px;
}

.decision-box {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

@media (max-width: 760px) {
  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 18px;
  }

  .metric-card strong {
    font-size: 28px;
  }
}

/* Arc-reactor command buttons */
:root {
  --btn-cyan: #44e5ff;
  --btn-cyan-soft: rgba(68, 229, 255, 0.18);
  --btn-amber: #ffb84d;
  --btn-amber-soft: rgba(255, 184, 77, 0.16);
  --btn-red: #ff5b4f;
}

.primary-button,
.secondary-button,
.icon-button,
.nav-button {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  border-radius: 0;
  letter-spacing: 0;
  text-shadow: 0 0 14px rgba(68, 229, 255, 0.26);
  transform: translateZ(0);
  user-select: none;
}

.primary-button,
.secondary-button,
.icon-button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(68, 229, 255, 0.38);
  background:
    linear-gradient(135deg, rgba(68, 229, 255, 0.22), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), transparent 52%),
    rgba(3, 13, 18, 0.86);
  color: #effdff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    inset 0 0 24px rgba(68, 229, 255, 0.07),
    0 0 0 1px rgba(68, 229, 255, 0.08),
    0 16px 30px rgba(0, 0, 0, 0.28);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.primary-button::before,
.secondary-button::before,
.icon-button::before,
.nav-button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 0 28%, rgba(255, 255, 255, 0.34) 45%, transparent 62% 100%);
  transform: translateX(-130%);
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.primary-button::after,
.secondary-button::after,
.icon-button::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--btn-cyan);
  box-shadow: 0 0 12px var(--btn-cyan), 0 0 24px rgba(68, 229, 255, 0.42);
  transform: translateY(-50%);
}

.primary-button {
  padding-right: 30px;
  border-color: rgba(68, 229, 255, 0.62);
  background:
    radial-gradient(circle at 18% 0, rgba(68, 229, 255, 0.34), transparent 42%),
    linear-gradient(135deg, rgba(68, 229, 255, 0.34), rgba(255, 184, 77, 0.12) 64%, rgba(68, 229, 255, 0.08)),
    rgba(2, 16, 22, 0.92);
  box-shadow:
    inset 0 0 30px rgba(68, 229, 255, 0.13),
    0 0 18px rgba(68, 229, 255, 0.18),
    0 18px 34px rgba(0, 0, 0, 0.30);
}

.secondary-button {
  padding-right: 30px;
  color: #c9f8ff;
}

.icon-button {
  min-width: 86px;
  padding-right: 28px;
}

.secondary-button::after {
  background: var(--btn-amber);
  box-shadow: 0 0 12px var(--btn-amber), 0 0 24px rgba(255, 184, 77, 0.38);
}

.icon-button.active {
  color: #ffe8b7;
  border-color: rgba(255, 184, 77, 0.58);
  background:
    radial-gradient(circle at 18% 0, rgba(255, 184, 77, 0.22), transparent 42%),
    linear-gradient(135deg, rgba(255, 184, 77, 0.22), rgba(255, 91, 79, 0.09)),
    rgba(18, 12, 3, 0.86);
  text-shadow: 0 0 14px rgba(255, 184, 77, 0.38);
}

.icon-button.active::after {
  background: var(--btn-red);
  box-shadow: 0 0 12px var(--btn-red), 0 0 26px rgba(255, 91, 79, 0.45);
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 0 32px rgba(68, 229, 255, 0.15),
    0 0 24px rgba(68, 229, 255, 0.22),
    0 22px 42px rgba(0, 0, 0, 0.34);
}

.primary-button:hover::before,
.secondary-button:hover::before,
.icon-button:hover::before,
.nav-button:hover::after,
.nav-button.active::after {
  transform: translateX(130%);
}

.primary-button:active,
.secondary-button:active,
.icon-button:active {
  transform: translateY(1px) scale(0.985);
  box-shadow:
    inset 0 0 36px rgba(68, 229, 255, 0.24),
    0 0 12px rgba(68, 229, 255, 0.20);
}

.scenario-actions .secondary-button {
  flex: 1 1 180px;
  min-width: 180px;
}

.chat-form .primary-button {
  min-width: 116px;
}

.nav-button {
  min-height: 46px;
  padding: 0 14px 0 16px;
  color: #b9eef7;
  background:
    linear-gradient(90deg, rgba(68, 229, 255, 0.07), transparent 72%),
    rgba(5, 15, 20, 0.50);
  border: 1px solid rgba(68, 229, 255, 0.12);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.nav-button::before {
  width: 7px;
  height: 20px;
  border-radius: 0;
  background: rgba(68, 229, 255, 0.30);
  box-shadow: 0 0 14px rgba(68, 229, 255, 0.34);
}

.nav-button:hover {
  background:
    linear-gradient(90deg, rgba(68, 229, 255, 0.18), rgba(255, 184, 77, 0.06)),
    rgba(5, 15, 20, 0.72);
  border-color: rgba(68, 229, 255, 0.30);
}

.nav-button.active {
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(68, 229, 255, 0.28), rgba(255, 184, 77, 0.16)),
    rgba(5, 15, 20, 0.94);
  border-color: rgba(255, 184, 77, 0.40);
  box-shadow:
    inset 0 0 28px rgba(68, 229, 255, 0.12),
    0 0 20px rgba(255, 184, 77, 0.08);
}

.nav-button.active::before {
  background: var(--btn-amber);
  box-shadow: 0 0 14px var(--btn-amber), 0 0 28px rgba(255, 184, 77, 0.34);
}

.sidebar-footer select,
.field select,
.chat-form input {
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  border-color: rgba(68, 229, 255, 0.28);
}

@media (max-width: 760px) {
  .scenario-actions .secondary-button,
  .chat-form .primary-button {
    width: 100%;
  }
}

/* Climate commerce selector */
.market-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 16px;
}

.market-hero h2 {
  font-size: 34px;
}

.market-hero p {
  max-width: 760px;
}

.market-status {
  display: grid;
  gap: 8px;
  min-width: 280px;
}

.market-status span {
  min-height: 34px;
  display: grid;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(68, 229, 255, 0.22);
  background: rgba(68, 229, 255, 0.07);
  color: #c9f8ff;
  font-family: var(--font-data);
  font-size: 12px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.market-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 16px;
  margin-bottom: 16px;
}

.secondary-market-layout {
  grid-template-columns: minmax(360px, 0.75fr) minmax(0, 1.25fr);
}

.climate-drive-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.climate-mode {
  position: relative;
  min-height: 158px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  text-align: left;
  color: #dffbff;
  border: 1px solid rgba(68, 229, 255, 0.22);
  background:
    radial-gradient(circle at 16% 0, rgba(68, 229, 255, 0.16), transparent 42%),
    rgba(4, 14, 18, 0.82);
  box-shadow: inset 0 0 24px rgba(68, 229, 255, 0.05);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  overflow: hidden;
}

.climate-mode::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 35%, rgba(255, 255, 255, 0.18), transparent 62%);
  transform: translateX(-130%);
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.climate-mode:hover::before,
.climate-mode.active::before {
  transform: translateX(130%);
}

.climate-mode.active {
  border-color: rgba(255, 184, 77, 0.50);
  background:
    radial-gradient(circle at 20% 0, rgba(255, 184, 77, 0.22), transparent 42%),
    linear-gradient(135deg, rgba(68, 229, 255, 0.18), rgba(255, 184, 77, 0.09)),
    rgba(4, 14, 18, 0.92);
  box-shadow: inset 0 0 30px rgba(255, 184, 77, 0.08), 0 0 22px rgba(255, 184, 77, 0.12);
}

.climate-mode strong {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 20px;
  text-transform: uppercase;
}

.climate-mode span,
.climate-mode em,
.climate-mode small {
  color: var(--muted);
  font-style: normal;
}

.climate-mode em {
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 12px;
}

.mode-region {
  color: #8eeeff !important;
  font-family: var(--font-data);
  font-size: 11px;
}

.climate-detail-panel {
  min-height: 100%;
}

.climate-spec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.climate-spec-grid div {
  padding: 12px;
  border: 1px solid rgba(68, 229, 255, 0.20);
  background: rgba(68, 229, 255, 0.06);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.climate-spec-grid span,
.summary-line span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.climate-spec-grid strong,
.summary-line strong {
  display: block;
  margin-top: 5px;
  color: #ffffff;
  font-family: var(--font-data);
}

.compatible-foods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.compatible-foods span {
  padding: 8px 10px;
  border: 1px solid rgba(71, 230, 134, 0.24);
  background: rgba(71, 230, 134, 0.08);
  color: #c9ffd9;
  font-size: 12px;
  font-weight: 800;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.process-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.process-stack div {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(68, 229, 255, 0.18);
  background: rgba(255, 255, 255, 0.035);
}

.process-stack b {
  color: var(--amber);
  font-family: var(--font-data);
}

.process-stack span {
  color: #cbeaf0;
}

.stimulation-box {
  padding: 14px;
  border: 1px solid rgba(255, 184, 77, 0.28);
  background: rgba(255, 184, 77, 0.08);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.stimulation-box strong {
  color: var(--amber);
  text-transform: uppercase;
}

.stimulation-box p {
  margin: 6px 0 0;
  color: #f5dfb8;
}

.package-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.package-choice {
  min-height: 74px;
  color: #dffbff;
  border: 1px solid rgba(68, 229, 255, 0.28);
  background: rgba(4, 14, 18, 0.82);
  font-family: var(--font-display);
  font-size: 18px;
  text-transform: uppercase;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.package-choice.active {
  color: #ffffff;
  border-color: rgba(255, 184, 77, 0.50);
  background: linear-gradient(135deg, rgba(255, 184, 77, 0.22), rgba(68, 229, 255, 0.10)), rgba(4, 14, 18, 0.92);
  box-shadow: 0 0 22px rgba(255, 184, 77, 0.12);
}

.purchase-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.summary-line {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(68, 229, 255, 0.14);
}

.summary-price {
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 28px;
  font-weight: 900;
  text-align: right;
}

.purchased-climates {
  display: grid;
  gap: 10px;
}

.purchased-climate {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(68, 229, 255, 0.20);
  background: rgba(4, 14, 18, 0.78);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.purchased-climate strong {
  color: #ffffff;
  text-transform: uppercase;
}

.purchased-climate span {
  color: var(--muted);
}

.purchased-climate.empty {
  border-style: dashed;
}

@media (max-width: 1120px) {
  .market-hero,
  .market-layout,
  .secondary-market-layout {
    grid-template-columns: 1fr;
  }

  .market-hero {
    display: grid;
  }
}

@media (max-width: 760px) {
  .climate-drive-selector,
  .climate-spec-grid,
  .package-toggle {
    grid-template-columns: 1fr;
  }
}

/* Desktop cockpit layout: no page scroll, horizontal workspaces */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  min-height: 100%;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 16px 12px;
  gap: 14px;
}

.brand {
  min-height: 44px;
  padding-bottom: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
}

.brand strong {
  font-size: 15px;
}

.brand span {
  font-size: 11px;
}

.sidebar-panel {
  padding: 10px;
  gap: 4px;
}

.sidebar-panel strong {
  font-size: 13px;
}

.nav-tabs {
  gap: 6px;
}

.nav-button {
  min-height: 38px;
  padding: 0 10px 0 12px;
  font-size: 13px;
}

.nav-button::before {
  height: 16px;
}

.sidebar-footer {
  padding-top: 12px;
}

.sidebar-footer select {
  min-height: 38px;
}

.main {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
}

.topbar {
  min-height: 96px;
  margin: 0;
  padding: 14px;
}

.title-block {
  gap: 7px;
}

h1 {
  font-size: clamp(25px, 2.2vw, 32px);
}

h2 {
  font-size: 17px;
}

.eyebrow {
  margin-bottom: 0;
  font-size: 11px;
}

.system-strip {
  gap: 6px;
}

.system-strip span {
  min-height: 26px;
  padding: 0 8px;
  font-size: 10px;
}

.topbar-actions {
  gap: 8px;
}

.field {
  width: 190px;
}

.primary-button,
.secondary-button,
.icon-button {
  min-height: 38px;
  padding: 0 14px;
}

.view {
  min-height: 0;
}

.view.active {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.panel {
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.panel-header {
  margin-bottom: 10px;
  padding-bottom: 9px;
}

.panel-header p {
  font-size: 12px;
  line-height: 1.25;
}

.metric-card {
  min-height: 0;
  padding: 12px 14px;
}

.metric-card span {
  font-size: 10px;
}

.metric-card strong {
  margin: 5px 0;
  font-size: clamp(20px, 2vw, 26px);
}

.metric-card small {
  font-size: 11px;
}

#dashboard.view.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: 86px minmax(0, 1fr);
  gap: 12px;
}

#dashboard .status-grid {
  grid-column: 1 / -1;
  grid-row: 1;
  margin: 0;
  grid-template-columns: 1.15fr repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#dashboard .dashboard-layout {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 12px;
}

/* Geometry correction pass */
#dashboard.view.active {
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, 0.58fr) minmax(300px, 0.54fr);
  grid-template-rows: 86px minmax(0, 1fr);
}

#dashboard .dashboard-layout {
  display: contents;
}

#dashboard .map-panel {
  grid-column: 1;
  grid-row: 2;
}

#dashboard .decision-panel {
  grid-column: 2;
  grid-row: 2;
}

#dashboard > .panel:not(.map-panel):not(.decision-panel) {
  grid-column: 3;
  grid-row: 2;
}

.greenhouse-map {
  grid-template-columns: 0.72fr 0.92fr 1.28fr 0.92fr;
}

.zone-column {
  align-content: start;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.sensor-stack {
  align-content: stretch;
  grid-auto-rows: minmax(46px, auto);
}

.zone-column.core .sensor-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.zone-column:not(.core) .sensor-stack {
  grid-template-columns: 1fr;
}

.sensor-dot {
  display: grid;
  align-content: start;
}

#market.view.active {
  grid-template-columns: minmax(430px, 0.95fr) minmax(430px, 0.95fr) minmax(330px, 0.62fr);
  grid-template-rows: 82px minmax(0, 1fr);
}

#market > .market-layout:first-of-type > .panel:first-child,
#market .climate-detail-panel,
#market > .secondary-market-layout {
  align-self: stretch;
}

.market-hero {
  align-items: center;
}

.market-hero h2 {
  font-size: 24px;
  margin-bottom: 4px;
}

.market-hero p {
  max-width: none;
  margin: 0;
}

.market-status {
  min-width: 470px;
}

#market > .market-layout:first-of-type > .panel:first-child {
  grid-column: 1;
  grid-row: 2;
}

#market .climate-detail-panel {
  grid-column: 2;
  grid-row: 2;
}

#market > .secondary-market-layout {
  grid-column: 3;
  grid-row: 2;
  grid-template-rows: 0.52fr 0.48fr;
}

.climate-drive-selector {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  height: calc(100% - 58px);
}

.climate-mode {
  min-height: 0;
  display: grid;
  grid-template-rows: 54px auto auto auto auto;
}

.climate-mode-image {
  height: 50px;
  margin: 0;
}

.climate-mode strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.climate-detail-panel {
  display: grid;
  grid-template-rows: auto 178px auto auto minmax(0, auto) auto;
  align-content: start;
}

.climate-detail-image {
  height: 170px;
}

.process-stack {
  grid-template-columns: 1fr 1fr;
}

.process-stack div {
  min-height: 42px;
}

.stimulation-box {
  margin-top: 2px;
}

.package-toggle {
  grid-template-columns: 1fr 1fr;
}

.purchased-climates {
  overflow: hidden;
}

@media (max-height: 760px) {
  #dashboard.view.active {
    grid-template-rows: 76px minmax(0, 1fr);
  }

  #market.view.active {
    grid-template-rows: 72px minmax(0, 1fr);
  }

  .climate-mode {
    grid-template-rows: 42px auto auto auto auto;
  }

  .climate-mode-image {
    height: 40px;
  }

  .climate-detail-panel {
    grid-template-rows: auto 112px auto auto minmax(0, auto) auto;
  }

  .climate-detail-image {
    height: 108px;
  }

  .process-stack {
    gap: 5px;
  }
}

#dashboard > .panel {
  grid-column: 2;
  grid-row: 2;
}

.hud-ribbon {
  gap: 6px;
  margin-bottom: 8px;
}

.hud-ribbon span {
  min-height: 24px;
  font-size: 10px;
}

.greenhouse-map {
  height: calc(100% - 78px);
  min-height: 0;
}

.zone-column {
  padding: 12px 9px;
}

.zone-column:first-child {
  padding-left: 34px;
}

.zone-column:last-child {
  padding-right: 34px;
}

.zone-label {
  padding: 8px;
}

.zone-label strong {
  font-size: 12px;
}

.zone-label span {
  font-size: 10px;
}

.zone-readout {
  gap: 4px;
  margin-top: 7px;
}

.zone-readout b {
  padding: 5px 6px;
  font-size: 10px;
}

.sensor-stack {
  gap: 6px;
}

.sensor-dot {
  min-height: 0;
  padding: 7px;
}

.sensor-topline strong {
  font-size: 11px;
}

.sensor-topline em {
  font-size: 9px;
  padding: 2px 5px;
}

.sensor-dot span {
  font-size: 10px;
  margin-top: 3px;
}

.decision-box {
  padding: 12px;
  margin-bottom: 10px;
}

.decision-box strong {
  font-size: 16px;
}

.decision-box p {
  font-size: 12px;
  line-height: 1.32;
}

.actuator-grid {
  gap: 7px;
}

.actuator {
  padding: 9px;
}

.actuator strong {
  font-size: 13px;
}

.actuator span,
.state {
  font-size: 11px;
}

.event-log,
.compact,
.chat-box {
  max-height: none;
  overflow: hidden;
}

.event-log {
  height: calc(100% - 58px);
  gap: 7px;
}

.event-item {
  grid-template-columns: 56px 1fr;
  gap: 8px;
  padding: 8px;
}

.event-item time,
.event-item p {
  font-size: 10px;
}

.event-item strong {
  font-size: 12px;
}

#climate.view.active,
#resources.view.active,
#security.view.active,
#voice.view.active {
  display: grid;
}

#climate .split-layout,
#resources .split-layout,
#security .split-layout,
#voice .split-layout {
  height: 100%;
  min-height: 0;
  margin: 0;
  gap: 12px;
}

#climate .split-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.55fr);
}

.sensor-table-wrap {
  height: calc(100% - 64px);
  overflow: hidden;
}

table {
  min-width: 0;
  font-size: 11px;
}

th,
td {
  padding: 8px 7px;
}

.zone-summary {
  gap: 8px;
}

.zone-card {
  padding: 9px;
}

.zone-metrics {
  gap: 6px;
}

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

#market.view.active {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(360px, 0.84fr) 360px;
  grid-template-rows: 88px minmax(0, 1fr);
  gap: 12px;
}

.market-hero {
  grid-column: 1 / -1;
  min-height: 0;
  margin: 0;
  padding: 12px;
}

.market-hero h2 {
  font-size: 25px;
}

.market-hero p {
  font-size: 12px;
  line-height: 1.3;
}

.market-status {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 520px;
}

.market-status span {
  min-height: 28px;
  font-size: 10px;
}

#market > .market-layout:first-of-type {
  display: contents;
}

#market > .market-layout:first-of-type > .panel:first-child {
  grid-column: 1;
  grid-row: 2;
}

#market .climate-detail-panel {
  grid-column: 2;
  grid-row: 2;
}

#market > .secondary-market-layout {
  grid-column: 3;
  grid-row: 2;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 0.58fr) minmax(0, 0.42fr);
  gap: 12px;
  min-height: 0;
  margin: 0;
}

.climate-drive-selector {
  height: calc(100% - 62px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.climate-mode {
  min-height: 0;
  padding: 9px;
  gap: 3px;
}

.climate-mode strong {
  font-size: 15px;
}

.climate-mode span,
.climate-mode em,
.climate-mode small {
  font-size: 10px;
  line-height: 1.18;
}

.climate-spec-grid {
  gap: 7px;
  margin-bottom: 10px;
}

.climate-spec-grid div {
  padding: 9px;
}

.compatible-foods {
  gap: 6px;
  margin-bottom: 10px;
}

.compatible-foods span {
  padding: 6px 8px;
  font-size: 10px;
}

.process-stack {
  gap: 6px;
  margin-bottom: 10px;
}

.process-stack div {
  grid-template-columns: 30px 1fr;
  padding: 8px;
}

.process-stack span,
.stimulation-box p {
  font-size: 11px;
  line-height: 1.25;
}

.stimulation-box {
  padding: 10px;
}

.package-toggle {
  gap: 8px;
  margin-bottom: 10px;
}

.package-choice {
  min-height: 50px;
  font-size: 15px;
}

.purchase-summary {
  gap: 6px;
  margin-bottom: 10px;
}

.summary-line {
  padding: 6px 0;
}

.summary-line span,
.summary-line strong {
  font-size: 10px;
}

.summary-price {
  font-size: 21px;
}

.purchased-climates {
  height: calc(100% - 62px);
  overflow: hidden;
  gap: 8px;
}

.purchased-climate {
  padding: 9px;
}

.purchased-climate strong,
.purchased-climate span {
  font-size: 11px;
  line-height: 1.25;
}

#production.view.active,
#carbon.view.active {
  display: grid;
  grid-template-rows: 86px minmax(0, 1fr);
  gap: 12px;
}

#production .status-grid,
#carbon .status-grid {
  margin: 0;
}

#production > .panel,
#carbon > .panel {
  min-height: 0;
}

.timeline {
  height: calc(100% - 62px);
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.timeline-item {
  align-content: start;
  padding: 10px;
}

.timeline-item strong,
.timeline-item span {
  font-size: 11px;
  line-height: 1.25;
}

.bar-list {
  height: calc(100% - 34px);
  align-content: start;
  gap: 12px;
}

.resource-meter {
  margin: 10px 0;
  padding: 12px;
}

.resource-meter strong {
  font-size: 24px;
}

.data-list {
  gap: 8px;
}

.data-list div {
  padding-bottom: 8px;
}

#security .people-list,
#security .event-log,
#voice .chat-box {
  height: calc(100% - 62px);
}

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

.person-card,
.chat-message {
  padding: 10px;
}

.chat-form {
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 1180px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell,
  .main,
  .sidebar {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .view.active {
    height: auto;
    overflow: visible;
  }
}

/* Visible climate imagery */
.climate-mode-image,
.climate-detail-image {
  display: block;
  width: 100%;
  object-fit: cover;
  border: 1px solid rgba(68, 229, 255, 0.24);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 24px rgba(68, 229, 255, 0.08), 0 10px 20px rgba(0, 0, 0, 0.22);
}

.climate-mode-image {
  height: 46px;
  margin: -2px 0 4px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.climate-detail-image {
  height: 132px;
  margin: 0 0 12px;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}

.climate-mode.active .climate-mode-image {
  border-color: rgba(255, 184, 77, 0.42);
  box-shadow: 0 0 20px rgba(255, 184, 77, 0.16);
}

@media (max-height: 760px) {
  .climate-mode-image {
    height: 38px;
  }

  .climate-detail-image {
    height: 104px;
  }
}

/* Final geometry lock */
#dashboard.view.active {
  display: grid !important;
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, 0.58fr) minmax(300px, 0.54fr) !important;
  grid-template-rows: 86px minmax(0, 1fr) !important;
  gap: 12px !important;
  height: 100% !important;
  overflow: hidden !important;
}

#dashboard .status-grid {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
}

#dashboard .dashboard-layout {
  display: contents !important;
}

#dashboard .map-panel {
  grid-column: 1 !important;
  grid-row: 2 !important;
}

#dashboard .decision-panel {
  grid-column: 2 !important;
  grid-row: 2 !important;
}

#dashboard > .panel:not(.map-panel):not(.decision-panel) {
  grid-column: 3 !important;
  grid-row: 2 !important;
}

.greenhouse-map {
  height: calc(100% - 76px) !important;
  min-height: 0 !important;
}

.zone-column {
  align-content: start !important;
  align-items: stretch !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  gap: 10px !important;
}

.sensor-stack {
  align-content: start !important;
  align-self: start !important;
}

.zone-column.core .sensor-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.zone-column:not(.core) .sensor-stack {
  grid-template-columns: 1fr !important;
}

#market.view.active {
  display: grid !important;
  grid-template-columns: minmax(430px, 1fr) minmax(430px, 1fr) minmax(330px, 0.72fr) !important;
  grid-template-rows: 82px minmax(0, 1fr) !important;
  gap: 12px !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

#market > .market-hero {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  margin: 0 !important;
  min-height: 0 !important;
}

#market > .market-layout:first-of-type {
  grid-column: 1 / 3 !important;
  grid-row: 2 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 12px !important;
  min-height: 0 !important;
  height: 100% !important;
  margin: 0 !important;
}

#market > .market-layout:first-of-type > .panel:first-child,
#market .climate-detail-panel {
  grid-column: auto !important;
  grid-row: auto !important;
  align-self: stretch !important;
  min-height: 0 !important;
  height: 100% !important;
}

#market > .secondary-market-layout {
  grid-column: 3 !important;
  grid-row: 2 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: minmax(0, 0.52fr) minmax(0, 0.48fr) !important;
  gap: 12px !important;
  min-height: 0 !important;
  height: 100% !important;
  margin: 0 !important;
}

#market > .secondary-market-layout > .panel {
  min-height: 0 !important;
  height: 100% !important;
}

.climate-drive-selector {
  height: calc(100% - 58px) !important;
  min-height: 0 !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.climate-mode {
  min-height: 0 !important;
  grid-template-rows: 50px auto auto auto auto !important;
}

.climate-mode-image {
  height: 48px !important;
  margin: 0 !important;
}

.climate-detail-panel {
  display: grid !important;
  grid-template-rows: auto 158px auto auto minmax(0, auto) auto !important;
  align-content: start !important;
}

.climate-detail-image {
  height: 150px !important;
}

.process-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

@media (max-height: 760px) {
  #dashboard.view.active {
    grid-template-rows: 76px minmax(0, 1fr) !important;
  }

  #market.view.active {
    grid-template-rows: 72px minmax(0, 1fr) !important;
  }

  .climate-mode {
    grid-template-rows: 38px auto auto auto auto !important;
  }

  .climate-mode-image {
    height: 36px !important;
  }

  .climate-detail-panel {
    grid-template-rows: auto 108px auto auto minmax(0, auto) auto !important;
  }

  .climate-detail-image {
    height: 102px !important;
  }
}

/* Dashboard dead-space removal */
#dashboard.view.active {
  grid-template-rows: 78px minmax(0, 1fr) 148px !important;
}

#dashboard .status-grid {
  gap: 10px !important;
}

#dashboard .map-panel,
#dashboard .decision-panel,
#dashboard > .panel:not(.map-panel):not(.decision-panel) {
  min-height: 0 !important;
  height: 100% !important;
}

#dashboard .map-panel {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
}

.greenhouse-map {
  height: auto !important;
}

.zone-column {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

.sensor-stack {
  height: 100% !important;
  grid-auto-rows: minmax(52px, auto) !important;
  align-content: start !important;
}

.zone-column.core .sensor-stack {
  grid-auto-rows: minmax(60px, auto) !important;
}

.decision-panel {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, auto) auto !important;
}

.decision-microgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.decision-microgrid div,
.memory-footer span,
.telemetry-card {
  border: 1px solid rgba(68, 229, 255, 0.18);
  background: rgba(68, 229, 255, 0.055);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.decision-microgrid div {
  min-height: 58px;
  padding: 9px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.decision-microgrid span,
.telemetry-card span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.decision-microgrid strong,
.telemetry-card strong {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 15px;
  text-transform: uppercase;
}

.event-log {
  height: calc(100% - 96px) !important;
}

.memory-footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 9px;
}

.memory-footer span {
  min-height: 28px;
  display: grid;
  align-items: center;
  padding: 0 9px;
  color: #c9f8ff;
  font-family: var(--font-data);
  font-size: 10px;
}

.dashboard-telemetry {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
}

.telemetry-card {
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 7px;
  box-shadow: inset 0 0 24px rgba(68, 229, 255, 0.045);
}

.telemetry-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

@media (max-height: 760px) {
  #dashboard.view.active {
    grid-template-rows: 70px minmax(0, 1fr) 112px !important;
  }

  .dashboard-telemetry {
    gap: 8px;
  }

  .telemetry-card {
    padding: 9px;
    gap: 4px;
  }

  .telemetry-card p {
    font-size: 10px;
  }
}

/* Minimal generous climate marketplace */
#market.view.active {
  grid-template-columns: minmax(360px, 0.72fr) minmax(520px, 1.28fr) minmax(340px, 0.72fr) !important;
  grid-template-rows: 74px minmax(0, 1fr) !important;
}

.market-hero {
  padding: 10px 14px !important;
}

.market-hero h2 {
  font-size: 22px !important;
  margin: 0 0 2px !important;
}

.market-hero p {
  max-width: 760px !important;
}

.market-status {
  min-width: 440px !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

#market > .market-layout:first-of-type {
  display: contents !important;
}

#market > .market-layout:first-of-type > .panel:first-child {
  grid-column: 1 !important;
  grid-row: 2 !important;
  height: 100% !important;
  min-height: 0 !important;
}

#market .climate-detail-panel {
  grid-column: 2 !important;
  grid-row: 2 !important;
  height: 100% !important;
  min-height: 0 !important;
}

#market > .secondary-market-layout {
  grid-column: 3 !important;
  grid-row: 2 !important;
  grid-template-rows: minmax(0, 0.48fr) minmax(0, 0.52fr) !important;
  height: 100% !important;
  min-height: 0 !important;
}

#market .panel-header {
  margin-bottom: 8px !important;
}

#market .panel-header p {
  max-width: 92%;
}

.climate-drive-selector {
  height: calc(100% - 56px) !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

.climate-mode {
  grid-template-rows: 58px auto auto auto !important;
  padding: 10px !important;
  gap: 5px !important;
}

.climate-mode-image {
  height: 56px !important;
}

.climate-mode strong {
  font-size: 15px !important;
}

.climate-mode small {
  display: none !important;
}

.climate-detail-panel {
  display: grid !important;
  grid-template-rows: auto 230px auto auto auto minmax(0, 1fr) !important;
  align-content: stretch !important;
}

.climate-detail-panel .panel-header h2 {
  font-size: 22px !important;
}

.climate-detail-image {
  height: 220px !important;
  margin-bottom: 12px !important;
}

.climate-spec-grid {
  margin-bottom: 12px !important;
}

.climate-spec-grid div {
  padding: 11px !important;
}

.climate-spec-grid strong {
  font-size: 14px !important;
}

.compatible-foods {
  margin-bottom: 12px !important;
}

.compatible-foods span {
  padding: 7px 10px !important;
  font-size: 11px !important;
}

.process-stack {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-bottom: 12px !important;
}

.process-stack div {
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-content: start !important;
  min-height: 74px !important;
  gap: 6px !important;
  padding: 10px !important;
}

.process-stack b {
  font-size: 16px !important;
}

.stimulation-box {
  align-self: end !important;
}

.package-toggle {
  margin-bottom: 12px !important;
}

.package-choice {
  min-height: 54px !important;
}

.purchase-summary {
  gap: 8px !important;
}

.summary-price {
  font-size: 24px !important;
}

.purchased-climates {
  height: calc(100% - 56px) !important;
}

@media (max-height: 760px) {
  #market.view.active {
    grid-template-rows: 64px minmax(0, 1fr) !important;
  }

  .climate-drive-selector {
    gap: 7px !important;
  }

  .climate-mode {
    grid-template-rows: 42px auto auto auto !important;
    padding: 8px !important;
  }

  .climate-mode-image {
    height: 40px !important;
  }

  .climate-detail-panel {
    grid-template-rows: auto 136px auto auto auto minmax(0, 1fr) !important;
  }

  .climate-detail-image {
    height: 130px !important;
  }

  .process-stack div {
    min-height: 48px !important;
    padding: 7px !important;
  }
}

/* Final generous minimalist geometry */
#market.view.active {
  grid-template-columns: minmax(340px, 0.82fr) minmax(520px, 1.2fr) minmax(320px, 0.72fr) !important;
  grid-template-rows: 68px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: stretch !important;
}

#market > .market-hero {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(410px, 0.54fr) !important;
  gap: 16px !important;
  align-items: center !important;
}

#market > .market-layout:first-of-type,
#market > .secondary-market-layout {
  min-width: 0 !important;
}

#market > .market-layout:first-of-type {
  display: contents !important;
}

#market .panel {
  padding: 12px !important;
}

#market .panel-header {
  min-height: 46px !important;
  margin-bottom: 8px !important;
}

#market .panel-header h2 {
  line-height: 1 !important;
}

#market .panel-header p {
  max-width: 62ch !important;
  line-height: 1.32 !important;
}

#market .climate-drive-selector {
  height: calc(100% - 54px) !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
  gap: 9px !important;
}

#market .climate-mode {
  grid-template-rows: clamp(42px, 8vh, 66px) auto auto auto !important;
  gap: 5px !important;
  padding: 9px !important;
  align-content: stretch !important;
}

#market .climate-mode-image {
  width: 100% !important;
  height: clamp(40px, 7vh, 62px) !important;
  object-fit: cover !important;
}

#market .climate-mode strong {
  font-size: 14px !important;
  line-height: 1.05 !important;
}

#market .climate-mode span,
#market .climate-mode em {
  line-height: 1.22 !important;
}

#market .climate-detail-panel {
  grid-template-rows: auto clamp(160px, 25vh, 230px) auto auto auto minmax(86px, 1fr) !important;
  align-content: stretch !important;
}

#market .climate-detail-image {
  height: 100% !important;
  min-height: 0 !important;
  margin-bottom: 12px !important;
}

#market .climate-spec-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

#market .compatible-foods {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
}

#market .process-stack {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

#market .process-stack div {
  min-height: 64px !important;
  padding: 9px !important;
}

#market .stimulation-box {
  align-self: stretch !important;
  display: grid !important;
  align-content: center !important;
  margin-top: 0 !important;
}

#market > .secondary-market-layout {
  display: grid !important;
  grid-template-rows: minmax(0, 0.46fr) minmax(0, 0.54fr) !important;
  gap: 12px !important;
}

#market > .secondary-market-layout > .panel {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
}

#market > .secondary-market-layout > .panel:last-child {
  grid-template-rows: auto minmax(0, 1fr) !important;
}

#market .purchase-summary {
  align-content: start !important;
}

#market .purchased-climates {
  height: auto !important;
  min-height: 0 !important;
}

@media (max-height: 760px) {
  #market.view.active {
    grid-template-rows: 60px minmax(0, 1fr) !important;
  }

  #market .market-hero h2 {
    font-size: 19px !important;
  }

  #market .panel {
    padding: 10px !important;
  }

  #market .panel-header {
    min-height: 40px !important;
    margin-bottom: 6px !important;
  }

  #market .climate-drive-selector {
    height: calc(100% - 46px) !important;
    gap: 7px !important;
  }

  #market .climate-mode {
    padding: 7px !important;
    gap: 4px !important;
  }

  #market .climate-mode strong {
    font-size: 12px !important;
  }

  #market .climate-detail-panel {
    grid-template-rows: auto clamp(108px, 19vh, 136px) auto auto auto minmax(58px, 1fr) !important;
  }

  #market .process-stack div {
    min-height: 44px !important;
  }
}

/* Climate selector product UX */
#market.view.active {
  grid-template-columns: minmax(300px, 0.76fr) minmax(480px, 1.16fr) minmax(285px, 0.72fr) !important;
  grid-template-rows: 66px minmax(0, 1fr) !important;
  gap: 12px !important;
  overflow: hidden !important;
}

#market > .market-hero {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  min-height: 0 !important;
  padding: 10px 14px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.44fr) !important;
  align-items: center !important;
  gap: 14px !important;
}

#market > .climate-catalog-panel {
  grid-column: 1 !important;
  grid-row: 2 !important;
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
}

#market > .climate-detail-panel {
  grid-column: 2 !important;
  grid-row: 2 !important;
  min-height: 0 !important;
  height: 100% !important;
}

#market > .market-side {
  grid-column: 3 !important;
  grid-row: 2 !important;
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: minmax(0, 0.53fr) minmax(0, 0.47fr) !important;
  gap: 12px !important;
}

#market > .market-side > .panel {
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
}

#market > .market-side > .panel:first-child {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto !important;
}

#market > .market-side > .panel:last-child {
  grid-template-rows: auto minmax(0, 1fr) !important;
}

#market .market-hero h2 {
  font-size: 22px !important;
  margin: 0 !important;
}

#market .market-hero p {
  max-width: 850px !important;
  line-height: 1.25 !important;
}

#market .market-status {
  min-width: 0 !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

#market .market-status span {
  min-height: 30px !important;
  padding: 0 10px !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
}

#market .climate-drive-selector {
  height: auto !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: repeat(8, minmax(0, 1fr)) !important;
  gap: 8px !important;
  overflow: hidden !important;
}

#market .climate-mode {
  min-height: 0 !important;
  height: 100% !important;
  padding: 8px !important;
  display: grid !important;
  grid-template-columns: 74px minmax(0, 1fr) minmax(54px, auto) !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  gap: 6px 10px !important;
  align-items: stretch !important;
  align-content: stretch !important;
}

#market .climate-mode-image {
  grid-column: 1 !important;
  grid-row: 1 / 3 !important;
  width: 74px !important;
  height: 100% !important;
  min-height: 50px !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: cover !important;
}

#market .climate-mode-copy {
  grid-column: 2 !important;
  grid-row: 1 / 3 !important;
  min-width: 0 !important;
  display: grid !important;
  align-content: center !important;
  gap: 2px !important;
}

#market .climate-mode strong {
  max-width: 100% !important;
  font-size: 15px !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#market .climate-mode small,
#market .mode-terrain {
  display: block !important;
  max-width: 100% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#market .mode-region {
  font-size: 10px !important;
}

#market .trial-badge {
  grid-column: 3 !important;
  grid-row: 1 !important;
  align-self: start !important;
  justify-self: end !important;
  padding: 5px 7px !important;
  border: 1px solid rgba(255, 184, 77, 0.42) !important;
  background: rgba(255, 184, 77, 0.13) !important;
  color: var(--amber) !important;
  font-family: var(--font-data) !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px) !important;
}

#market .climate-mode em {
  grid-column: 3 !important;
  grid-row: 2 !important;
  align-self: end !important;
  justify-self: end !important;
  max-width: 72px !important;
  font-size: 10px !important;
  line-height: 1.18 !important;
  text-align: right !important;
}

#market .climate-detail-panel {
  display: grid !important;
  grid-template-rows: auto minmax(165px, 0.82fr) auto auto auto auto minmax(70px, 0.55fr) !important;
  align-content: stretch !important;
  padding: 12px !important;
}

#market .climate-detail-image {
  width: 100% !important;
  height: 100% !important;
  min-height: 150px !important;
  margin: 0 0 10px !important;
  object-fit: cover !important;
}

.climate-observer-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.climate-observer-strip div {
  min-height: 48px;
  padding: 8px 9px;
  border: 1px solid rgba(68, 229, 255, 0.18);
  background: rgba(68, 229, 255, 0.06);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.climate-observer-strip span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.climate-observer-strip strong {
  display: block;
  margin-top: 4px;
  color: #ffffff;
  font-family: var(--font-data);
  font-size: 12px;
}

#market .climate-spec-grid {
  margin-bottom: 10px !important;
}

#market .compatible-foods {
  margin-bottom: 10px !important;
}

#market .process-stack {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  margin-bottom: 10px !important;
}

#market .process-stack div {
  min-height: 58px !important;
  padding: 8px !important;
}

#market .primary-button,
#market .secondary-button {
  min-height: 38px !important;
  padding: 0 10px !important;
  font-size: 13px !important;
  white-space: normal !important;
  line-height: 1.08 !important;
}

#market .stimulation-box {
  min-height: 0 !important;
  padding: 12px !important;
}

#market .package-toggle {
  margin-bottom: 10px !important;
}

#market .package-choice {
  min-height: 48px !important;
  font-size: 14px !important;
}

#market .purchase-summary {
  overflow: hidden !important;
  align-content: start !important;
  gap: 6px !important;
  margin-bottom: 8px !important;
}

#market .summary-line {
  padding: 7px 0 !important;
}

#market .summary-price {
  font-size: 22px !important;
}

#trialClimateButton {
  margin-top: 0 !important;
}

#purchaseClimateButton {
  margin-top: 8px !important;
}

#market .purchased-climates {
  min-height: 0 !important;
  height: auto !important;
  overflow: hidden !important;
  align-content: start !important;
}

#market .purchased-climate {
  padding: 10px !important;
}

@media (max-height: 760px) {
  #market.view.active {
    grid-template-rows: 56px minmax(0, 1fr) !important;
  }

  #market .market-hero {
    padding: 8px 12px !important;
  }

  #market .market-hero h2 {
    font-size: 18px !important;
  }

  #market .climate-mode {
    grid-template-columns: 64px minmax(0, 1fr) 54px !important;
    padding: 6px !important;
  }

  #market .climate-mode-image {
    width: 64px !important;
    min-height: 42px !important;
  }

  #market .climate-mode strong {
    font-size: 12px !important;
  }

  #market .climate-mode small {
    display: none !important;
  }

  #market .climate-detail-panel {
    grid-template-rows: auto minmax(100px, 0.68fr) auto auto auto auto minmax(52px, 0.45fr) !important;
  }

  .climate-observer-strip div {
    min-height: 38px;
  }

  #market .process-stack div {
    min-height: 42px !important;
    padding: 6px !important;
  }
}

/* Eyes On Industries extensions: sonic, genetics, comparison and ledger */
.nav-tabs {
  min-height: 0;
  overflow: hidden;
}

#sonic.view.active,
#genetics.view.active,
#compare.view.active,
#ledger.view.active {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

#sonic.view.active {
  grid-template-rows: 82px minmax(0, 1fr);
}

#sonic .market-hero {
  margin: 0;
}

#sonic .sonic-layout {
  min-height: 0;
  margin: 0;
  grid-template-columns: minmax(520px, 0.88fr) minmax(520px, 1.12fr);
}

.sonic-program-list,
.genetic-pack-grid,
.comparison-table {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

.sonic-program-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}

.sonic-program,
.genetic-pack,
.comparison-row {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  text-align: left;
  color: #dffbff;
  border: 1px solid rgba(68, 229, 255, 0.22);
  background:
    radial-gradient(circle at 16% 0, rgba(68, 229, 255, 0.14), transparent 42%),
    rgba(4, 14, 18, 0.82);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  overflow: hidden;
}

.sonic-program.active,
.genetic-pack.active {
  border-color: rgba(255, 184, 77, 0.50);
  background:
    radial-gradient(circle at 20% 0, rgba(255, 184, 77, 0.20), transparent 42%),
    linear-gradient(135deg, rgba(68, 229, 255, 0.16), rgba(255, 184, 77, 0.09)),
    rgba(4, 14, 18, 0.92);
  box-shadow: inset 0 0 30px rgba(255, 184, 77, 0.08), 0 0 22px rgba(255, 184, 77, 0.10);
}

.sonic-program strong,
.genetic-pack strong,
.comparison-row strong {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  text-transform: uppercase;
}

.sonic-program span,
.genetic-pack span,
.comparison-row p {
  color: var(--muted);
  margin: 0;
}

.sonic-program em,
.genetic-pack em {
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 12px;
  font-style: normal;
}

.sonic-bars {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  height: 38px;
  align-items: end;
}

.sonic-bars i {
  display: block;
  min-height: 5px;
  background: linear-gradient(180deg, var(--violet), var(--cyan));
  box-shadow: 0 0 14px rgba(67, 223, 255, 0.18);
}

.sonic-bars.large {
  height: 98px;
  gap: 8px;
}

.sonic-hero-meter {
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(68, 229, 255, 0.22);
  background:
    linear-gradient(rgba(67, 223, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 223, 255, 0.055) 1px, transparent 1px),
    rgba(3, 10, 14, 0.70);
  background-size: 22px 22px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

#genetics.view.active {
  grid-template-columns: minmax(0, 1fr);
}

#genetics .genetics-layout,
#ledger .ledger-layout {
  min-height: 0;
  margin: 0;
  grid-template-columns: minmax(620px, 1.15fr) minmax(420px, 0.85fr);
}

.genetic-pack-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}

.genetic-pack {
  min-height: 190px;
  align-content: space-between;
}

#compare.view.active {
  grid-template-rows: 86px minmax(0, 1fr);
}

#compare .status-grid {
  margin: 0;
  gap: 10px;
}

#compare > .panel {
  min-height: 0;
}

.comparison-table {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
}

.comparison-row {
  min-height: 150px;
  align-content: start;
}

.comparison-row span {
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 12px;
  text-transform: uppercase;
}

#ledger .ledger-log,
#ledger .purchased-climates {
  min-height: 0;
  max-height: none;
  overflow: auto;
}

#ledger .event-item {
  grid-template-columns: 76px 1fr;
}

@media (max-height: 760px) {
  #sonic.view.active {
    grid-template-rows: 68px minmax(0, 1fr);
  }

  .sonic-program,
  .genetic-pack,
  .comparison-row {
    padding: 9px;
  }

  .sonic-program strong,
  .genetic-pack strong,
  .comparison-row strong {
    font-size: 16px;
  }

  .sonic-bars.large {
    height: 70px;
  }
}

/* Generous cockpit pass: keep the desktop aura without crowding content */
.nav-tabs {
  overflow: auto;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(68, 229, 255, 0.38) transparent;
}

.view.active {
  min-height: 0;
}

#market.view.active {
  grid-template-columns: minmax(380px, 0.86fr) minmax(560px, 1.18fr) minmax(360px, 0.76fr) !important;
  grid-template-rows: 82px minmax(0, 1fr) !important;
  gap: 16px !important;
}

#market > .market-hero {
  min-height: 82px !important;
  padding: 14px 18px !important;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.36fr) !important;
}

#market .market-hero h2 {
  font-size: 26px !important;
  line-height: 0.95 !important;
}

#market .market-hero p {
  font-size: 13px !important;
  line-height: 1.35 !important;
}

#market .climate-drive-selector {
  grid-template-rows: none !important;
  grid-auto-rows: minmax(108px, auto) !important;
  gap: 12px !important;
  overflow: auto !important;
  padding: 2px 6px 2px 0 !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(68, 229, 255, 0.42) rgba(2, 10, 13, 0.4);
}

#market .climate-mode {
  height: auto !important;
  min-height: 108px !important;
  grid-template-columns: 92px minmax(0, 1fr) 72px !important;
  gap: 8px 12px !important;
  padding: 10px !important;
}

#market .climate-mode-image {
  width: 92px !important;
  min-height: 84px !important;
}

#market .climate-mode-copy {
  gap: 4px !important;
}

#market .climate-mode strong {
  font-size: 17px !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

#market .climate-mode small,
#market .mode-terrain {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

#market .climate-mode em {
  max-width: 84px !important;
}

#market .climate-detail-panel {
  grid-template-rows: auto minmax(230px, 0.82fr) auto auto auto auto minmax(86px, 0.45fr) !important;
  padding: 16px !important;
}

#market .climate-detail-image {
  min-height: 220px !important;
  margin-bottom: 12px !important;
}

#market .process-stack div {
  min-height: 66px !important;
}

#market .purchased-climates,
#market .purchase-summary {
  overflow: auto !important;
}

#sonic.view.active {
  grid-template-rows: 90px minmax(0, 1fr);
  gap: 16px;
}

#sonic .market-hero {
  min-height: 90px;
  padding: 14px 18px;
}

#sonic .sonic-layout {
  grid-template-columns: minmax(390px, 0.72fr) minmax(640px, 1.28fr);
  gap: 16px;
}

#sonic .sonic-layout > .panel {
  min-height: 0;
  display: grid;
}

#sonic .sonic-layout > .panel:first-child {
  grid-template-rows: auto minmax(0, 1fr);
}

#sonic .sonic-layout > .panel:last-child {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.sonic-program-list {
  grid-template-columns: 1fr;
  gap: 12px;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(68, 229, 255, 0.42) transparent;
}

.sonic-program {
  min-height: 118px;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.sonic-program em {
  grid-column: 1 / -1;
}

.sonic-detail {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto auto auto;
  gap: 12px;
  overflow: auto;
  padding-right: 4px;
}

.sonic-visual-frame {
  position: relative;
  min-height: 300px;
  border: 1px solid rgba(68, 229, 255, 0.28);
  background:
    radial-gradient(circle at 50% 45%, rgba(68, 229, 255, 0.16), transparent 42%),
    linear-gradient(rgba(67, 223, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 223, 255, 0.055) 1px, transparent 1px),
    rgba(3, 10, 14, 0.72);
  background-size: auto, 28px 28px, 28px 28px, auto;
  box-shadow: inset 0 0 48px rgba(67, 223, 255, 0.08), 0 0 28px rgba(67, 223, 255, 0.08);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  overflow: hidden;
}

.sonic-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 300px;
}

.sonic-equation {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(68, 229, 255, 0.20);
  background: rgba(2, 10, 13, 0.78);
  color: #dffbff;
  font-family: var(--font-data);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.sonic-equation span,
.sonic-equation em {
  color: var(--amber);
  font-style: normal;
  text-transform: uppercase;
}

.sonic-equation strong {
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#sonic .climate-spec-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#sonic .process-stack {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#genetics .genetics-layout,
#ledger .ledger-layout {
  gap: 16px;
}

.genetic-pack-grid,
.comparison-table {
  gap: 14px;
}

@media (max-width: 1500px) {
  #market.view.active {
    grid-template-columns: minmax(330px, 0.88fr) minmax(500px, 1.12fr) minmax(320px, 0.78fr) !important;
  }

  #sonic .sonic-layout {
    grid-template-columns: minmax(340px, 0.76fr) minmax(520px, 1.24fr);
  }

  #market .climate-mode {
    grid-template-columns: 78px minmax(0, 1fr) 68px !important;
  }

  #market .climate-mode-image {
    width: 78px !important;
  }
}

@media (max-height: 820px) {
  #market.view.active {
    grid-template-rows: 72px minmax(0, 1fr) !important;
  }

  #market > .market-hero,
  #sonic .market-hero {
    min-height: 72px !important;
    padding: 10px 14px !important;
  }

  #market .climate-drive-selector {
    grid-auto-rows: minmax(92px, auto) !important;
  }

  #market .climate-mode {
    min-height: 92px !important;
  }

  #market .climate-detail-panel {
    grid-template-rows: auto minmax(160px, 0.75fr) auto auto auto auto minmax(62px, 0.42fr) !important;
  }

  #sonic.view.active {
    grid-template-rows: 72px minmax(0, 1fr);
  }

  .sonic-detail,
  .sonic-visual-frame,
  .sonic-canvas {
    min-height: 240px;
  }
}

/* Readability and voice-forward cockpit */
#dashboard.view.active {
  grid-template-columns: minmax(0, 1fr) minmax(370px, 0.34fr) !important;
  grid-template-rows: 82px minmax(0, 1fr) 150px !important;
  gap: 16px !important;
}

#dashboard .map-panel {
  grid-column: 1 !important;
  grid-row: 2 !important;
  padding: 16px !important;
}

#dashboard .decision-panel {
  grid-column: 2 !important;
  grid-row: 2 !important;
  padding: 16px !important;
}

#dashboard > .panel:not(.map-panel):not(.decision-panel) {
  grid-column: 1 / -1 !important;
  grid-row: 3 !important;
  padding: 14px 16px !important;
}

.greenhouse-map {
  grid-template-columns: minmax(170px, 0.9fr) minmax(230px, 1.1fr) minmax(360px, 1.75fr) minmax(230px, 1.1fr) !important;
  gap: 0 !important;
  min-height: 520px !important;
  height: 100% !important;
}

.zone-column {
  padding: 16px 14px !important;
  gap: 14px !important;
}

.zone-column:first-child {
  padding-left: 46px !important;
}

.zone-column:last-child {
  padding-right: 46px !important;
}

.zone-label {
  padding: 12px !important;
  gap: 5px !important;
}

.zone-label strong {
  font-size: 15px !important;
}

.zone-label span {
  font-size: 12px !important;
  line-height: 1.25 !important;
}

.zone-readout {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-top: 9px !important;
}

.zone-readout b {
  min-height: 34px !important;
  padding: 7px 8px !important;
  font-size: 12px !important;
}

.sensor-stack {
  gap: 10px !important;
  grid-auto-rows: minmax(76px, auto) !important;
}

.zone-column.core .sensor-stack {
  grid-template-columns: repeat(2, minmax(150px, 1fr)) !important;
  grid-auto-rows: minmax(82px, auto) !important;
}

.sensor-dot {
  min-height: 76px !important;
  padding: 11px !important;
}

.sensor-topline strong {
  font-size: 14px !important;
}

.sensor-topline em {
  padding: 3px 7px !important;
  font-size: 10px !important;
}

.sensor-dot span {
  margin-top: 5px !important;
  color: #a8c5cb !important;
  font-size: 12px !important;
  line-height: 1.28 !important;
}

#dashboard .event-log {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  height: auto !important;
  overflow: auto !important;
}

#dashboard .event-item {
  grid-template-columns: 54px 1fr !important;
  min-height: 74px !important;
}

#market .climate-drive-selector {
  grid-auto-rows: minmax(128px, auto) !important;
}

#market .climate-mode {
  min-height: 128px !important;
  grid-template-columns: 108px minmax(0, 1fr) 76px !important;
  padding: 12px !important;
}

#market .climate-mode-image {
  width: 108px !important;
  min-height: 104px !important;
  border-color: rgba(223, 251, 255, 0.32) !important;
}

#market .climate-mode strong {
  font-size: 18px !important;
  line-height: 1.12 !important;
}

#market .climate-mode small,
#market .climate-mode span,
#market .climate-mode em {
  font-size: 12px !important;
  line-height: 1.28 !important;
}

#market .trial-badge {
  font-size: 11px !important;
}

#market .climate-detail-panel {
  grid-template-rows: auto minmax(270px, 0.9fr) auto auto auto auto minmax(90px, 0.45fr) !important;
}

#market .climate-detail-image {
  min-height: 250px !important;
}

#sonic .climate-spec-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.frequency-cloud {
  display: grid;
  grid-template-columns: repeat(32, minmax(0, 1fr));
  gap: 2px;
  min-height: 76px;
  padding: 10px;
  align-items: end;
  border: 1px solid rgba(68, 229, 255, 0.20);
  background: rgba(68, 229, 255, 0.045);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.frequency-cloud i {
  display: block;
  height: var(--h);
  min-height: 7px;
  background: linear-gradient(180deg, rgba(255, 184, 77, 0.95), rgba(68, 229, 255, 0.78));
  box-shadow: 0 0 10px rgba(68, 229, 255, 0.22);
  animation: frequencyPulse 1800ms ease-in-out infinite;
  animation-delay: calc(var(--d) * -70ms);
}

.wildlife-soundscape {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wildlife-soundscape span {
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(77, 255, 168, 0.24);
  background: rgba(77, 255, 168, 0.08);
  color: #dffbff;
  font-family: var(--font-data);
  font-size: 12px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.sonic-preview-button {
  min-height: 40px;
}

@keyframes frequencyPulse {
  0%, 100% {
    opacity: 0.42;
    transform: scaleY(0.72);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

#voice.view.active {
  display: grid !important;
  min-height: 0 !important;
}

.voice-console {
  display: grid;
  grid-template-columns: minmax(540px, 0.96fr) minmax(560px, 1.04fr);
  gap: 16px;
  min-height: 0;
  height: 100%;
}

.voice-brain-panel,
.voice-chat-panel {
  display: grid;
  min-height: 0;
  height: 100%;
}

.voice-brain-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.voice-chat-panel {
  grid-template-rows: auto minmax(180px, 0.34fr) minmax(0, 1fr) auto;
}

.voice-brain-stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(68, 229, 255, 0.30);
  background:
    radial-gradient(circle at 50% 50%, rgba(68, 229, 255, 0.22), transparent 34%),
    linear-gradient(rgba(67, 223, 255, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 223, 255, 0.065) 1px, transparent 1px),
    rgba(3, 15, 22, 0.92);
  background-size: auto, 30px 30px, 30px 30px, auto;
  box-shadow: inset 0 0 70px rgba(68, 229, 255, 0.10), 0 0 28px rgba(68, 229, 255, 0.10);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}

.brain-field {
  position: absolute;
  inset: 9%;
}

.brain-field span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #44e5ff;
  box-shadow: 0 0 22px rgba(68, 229, 255, 0.9);
  animation: brainNode 3200ms ease-in-out infinite;
}

.brain-field span:nth-child(1) { left: 18%; top: 26%; animation-delay: -100ms; }
.brain-field span:nth-child(2) { left: 32%; top: 18%; animation-delay: -420ms; }
.brain-field span:nth-child(3) { left: 58%; top: 20%; animation-delay: -800ms; }
.brain-field span:nth-child(4) { left: 74%; top: 36%; animation-delay: -1180ms; }
.brain-field span:nth-child(5) { left: 68%; top: 66%; animation-delay: -1560ms; }
.brain-field span:nth-child(6) { left: 45%; top: 76%; animation-delay: -1960ms; }
.brain-field span:nth-child(7) { left: 22%; top: 64%; animation-delay: -2320ms; }
.brain-field span:nth-child(8) { left: 50%; top: 48%; animation-delay: -2660ms; }

.brain-field::before,
.brain-field::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(68, 229, 255, 0.22);
  border-radius: 48% 52% 44% 56%;
  animation: brainOrbit 7600ms linear infinite;
}

.brain-field::after {
  inset: 22%;
  border-color: rgba(255, 184, 77, 0.18);
  animation-direction: reverse;
}

.brain-core {
  position: relative;
  width: min(58vh, 440px);
  aspect-ratio: 1.24;
  border: 1px solid rgba(68, 229, 255, 0.28);
  border-radius: 48% 52% 46% 54% / 52% 46% 54% 48%;
  background:
    radial-gradient(circle at 34% 42%, rgba(223, 251, 255, 0.22), transparent 15%),
    radial-gradient(circle at 62% 46%, rgba(68, 229, 255, 0.24), transparent 19%),
    radial-gradient(circle at 48% 64%, rgba(255, 184, 77, 0.12), transparent 18%),
    rgba(7, 41, 53, 0.56);
  box-shadow: inset 0 0 60px rgba(68, 229, 255, 0.16), 0 0 42px rgba(68, 229, 255, 0.16);
  animation: brainBreath 3600ms ease-in-out infinite;
}

.brain-core i,
.brain-core b {
  position: absolute;
  inset: 15%;
  border: 1px solid rgba(223, 251, 255, 0.20);
  border-radius: 50%;
}

.brain-core i:nth-child(1) {
  transform: rotate(22deg) scaleX(0.74);
}

.brain-core i:nth-child(2) {
  transform: rotate(-18deg) scaleX(0.9);
}

.brain-core i:nth-child(3) {
  inset: 28% 19%;
  transform: rotate(90deg);
}

.brain-core b {
  inset: 42% 16%;
  border-color: rgba(255, 184, 77, 0.24);
}

.voice-rings {
  position: absolute;
  inset: 18%;
  pointer-events: none;
}

.voice-rings i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(68, 229, 255, 0.18);
  border-radius: 50%;
  animation: voiceRing 2800ms ease-out infinite;
}

.voice-rings i:nth-child(2) {
  animation-delay: -900ms;
}

.voice-rings i:nth-child(3) {
  animation-delay: -1800ms;
}

.voice-brain-stage.listening .brain-core,
.voice-brain-stage.speaking .brain-core {
  animation-duration: 2200ms;
}

.voice-brain-stage.muted {
  filter: saturate(0.48);
}

.voice-brain-stage.muted .brain-field span,
.voice-brain-stage.muted .voice-rings i {
  animation-play-state: paused;
  opacity: 0.34;
}

.voice-mode-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.voice-mode-strip span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(68, 229, 255, 0.20);
  background: rgba(68, 229, 255, 0.06);
  color: #c9f8ff;
  font-family: var(--font-data);
  font-size: 12px;
  text-transform: uppercase;
}

.voice-display {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(68, 229, 255, 0.26);
  background:
    linear-gradient(rgba(67, 223, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 223, 255, 0.055) 1px, transparent 1px),
    rgba(3, 15, 22, 0.82);
  background-size: 24px 24px;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  overflow: auto;
}

.voice-display strong {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  text-transform: uppercase;
}

.voice-display span {
  color: #a8c5cb;
  font-size: 15px;
  line-height: 1.45;
}

#voice .chat-box {
  max-height: none !important;
  min-height: 0;
  height: auto;
  overflow: auto !important;
  padding: 14px;
  border: 1px solid rgba(68, 229, 255, 0.20);
  background: rgba(2, 10, 13, 0.50);
}

#voice .chat-message {
  padding: 12px !important;
}

#voice .chat-message strong {
  font-size: 13px;
}

#voice .chat-message span {
  font-size: 14px;
  line-height: 1.42;
}

#voice .chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
  margin-top: 12px;
}

#voice .chat-form input {
  min-height: 48px;
  font-size: 15px;
}

@keyframes brainNode {
  0%, 100% {
    transform: scale(0.72);
    opacity: 0.42;
  }
  50% {
    transform: scale(1.22);
    opacity: 1;
  }
}

@keyframes brainOrbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes brainBreath {
  0%, 100% {
    transform: scale(0.985);
  }
  50% {
    transform: scale(1.018);
  }
}

@keyframes voiceRing {
  0% {
    transform: scale(0.72);
    opacity: 0.38;
  }
  100% {
    transform: scale(1.28);
    opacity: 0;
  }
}

@media (max-width: 1500px), (max-height: 840px) {
  #dashboard.view.active {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.34fr) !important;
    grid-template-rows: 74px minmax(0, 1fr) 126px !important;
  }

  .greenhouse-map {
    min-height: 420px !important;
    grid-template-columns: minmax(140px, 0.85fr) minmax(190px, 1.05fr) minmax(300px, 1.65fr) minmax(190px, 1.05fr) !important;
  }

  .sensor-stack {
    grid-auto-rows: minmax(66px, auto) !important;
  }

  .zone-column.core .sensor-stack {
    grid-template-columns: repeat(2, minmax(128px, 1fr)) !important;
  }

  .voice-console {
    grid-template-columns: minmax(440px, 0.9fr) minmax(500px, 1.1fr);
  }

  .brain-core {
    width: min(50vh, 360px);
  }
}

/* Dashboard cleanup: one clear lane per block */
#dashboard.view.active {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.36fr) !important;
  grid-template-rows: 98px minmax(0, 1fr) 158px !important;
  gap: 16px !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

#dashboard .status-grid {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
  min-height: 0 !important;
  margin: 0 !important;
}

#dashboard .metric-card {
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  align-content: center !important;
  padding: 14px 16px !important;
  overflow: hidden !important;
}

#dashboard .metric-card span {
  font-size: 11px !important;
  line-height: 1.1 !important;
}

#dashboard .metric-card strong {
  margin: 6px 0 !important;
  font-size: clamp(24px, 2.2vw, 32px) !important;
  line-height: 1 !important;
}

#dashboard .metric-card small {
  font-size: 12px !important;
  line-height: 1.22 !important;
}

#dashboard .dashboard-layout {
  display: contents !important;
}

#dashboard .map-panel {
  grid-column: 1 !important;
  grid-row: 2 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: auto 26px minmax(0, 1fr) !important;
  gap: 10px !important;
  padding: 16px !important;
  overflow: hidden !important;
}

#dashboard .map-panel .panel-header {
  margin: 0 !important;
  padding-bottom: 10px !important;
}

#dashboard .hud-ribbon {
  min-height: 26px !important;
  margin: 0 !important;
}

#dashboard .decision-panel {
  grid-column: 2 !important;
  grid-row: 2 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
  gap: 10px !important;
  padding: 16px !important;
  overflow: hidden !important;
}

#dashboard .decision-panel .panel-header {
  margin: 0 !important;
  padding-bottom: 10px !important;
}

#dashboard .decision-box {
  margin: 0 !important;
}

#dashboard .actuator-grid {
  min-height: 0 !important;
  overflow: auto !important;
  align-content: start !important;
  gap: 8px !important;
  padding-right: 4px !important;
}

#dashboard .actuator {
  min-height: 54px !important;
}

#dashboard .decision-microgrid {
  margin-top: 0 !important;
}

#dashboard .event-panel {
  grid-column: 1 !important;
  grid-row: 3 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(210px, 0.28fr) minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  gap: 10px 14px !important;
  padding: 14px 16px !important;
  overflow: hidden !important;
}

#dashboard .event-panel .panel-header {
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: grid !important;
  align-content: start !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-bottom: 0 !important;
}

#dashboard .event-panel .panel-header h2 {
  font-size: 18px !important;
  line-height: 1 !important;
}

#dashboard .event-panel .panel-header p {
  font-size: 12px !important;
  line-height: 1.25 !important;
}

#dashboard .event-panel .panel-header .secondary-button {
  width: 100% !important;
  min-height: 34px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
}

#dashboard .event-panel .event-log {
  grid-column: 2 !important;
  grid-row: 1 / 3 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: auto !important;
  align-content: start !important;
  padding-right: 4px !important;
}

#dashboard .event-panel .event-item {
  min-height: 62px !important;
  grid-template-columns: 52px 1fr !important;
  gap: 8px !important;
  padding: 8px !important;
}

#dashboard .event-panel .event-item strong {
  font-size: 12px !important;
}

#dashboard .event-panel .event-item p,
#dashboard .event-panel .event-item time {
  font-size: 10px !important;
  line-height: 1.22 !important;
}

#dashboard .event-panel .memory-footer {
  grid-column: 1 !important;
  grid-row: 2 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin: 0 !important;
}

#dashboard .event-panel .memory-footer span {
  min-height: 22px !important;
  padding: 0 7px !important;
  font-size: 10px !important;
}

#dashboard .dashboard-telemetry {
  grid-column: 2 !important;
  grid-row: 3 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  overflow: hidden !important;
  margin: 0 !important;
}

#dashboard .telemetry-card {
  min-height: 0 !important;
  padding: 12px !important;
  overflow: hidden !important;
}

#dashboard .telemetry-card span {
  font-size: 10px !important;
  line-height: 1.1 !important;
}

#dashboard .telemetry-card strong {
  margin-top: 6px !important;
  font-size: 13px !important;
  line-height: 1.15 !important;
}

#dashboard .telemetry-card p {
  display: none !important;
}

#dashboard .greenhouse-map {
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr) minmax(0, 1.45fr) minmax(0, 1fr) !important;
  overflow: hidden !important;
}

#dashboard .zone-column {
  min-width: 0 !important;
  padding: 14px 10px !important;
  gap: 10px !important;
}

#dashboard .zone-column:first-child {
  padding-left: 42px !important;
}

#dashboard .zone-column:last-child {
  padding-right: 42px !important;
}

#dashboard .zone-label {
  padding: 10px !important;
  gap: 4px !important;
}

#dashboard .zone-label strong {
  font-size: 14px !important;
  line-height: 1.05 !important;
}

#dashboard .zone-label span {
  font-size: 11px !important;
  line-height: 1.22 !important;
}

#dashboard .zone-readout {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
  margin-top: 8px !important;
}

#dashboard .zone-readout b {
  min-width: 0 !important;
  min-height: 32px !important;
  padding: 7px !important;
  font-size: 11px !important;
  line-height: 1.05 !important;
}

#dashboard .sensor-stack {
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  gap: 8px !important;
  grid-auto-rows: minmax(62px, auto) !important;
  overflow: auto !important;
  padding-right: 2px !important;
}

#dashboard .zone-column.core .sensor-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: minmax(66px, auto) !important;
}

#dashboard .zone-column:not(.core) .sensor-stack {
  grid-template-columns: 1fr !important;
}

#dashboard .sensor-dot {
  min-width: 0 !important;
  min-height: 62px !important;
  padding: 9px !important;
}

#dashboard .sensor-topline strong {
  font-size: 13px !important;
}

#dashboard .sensor-topline em {
  padding: 2px 6px !important;
  font-size: 9px !important;
}

#dashboard .sensor-dot span {
  margin-top: 4px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
}

@media (max-width: 1500px), (max-height: 850px) {
  #dashboard.view.active {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.38fr) !important;
    grid-template-rows: 86px minmax(0, 1fr) 138px !important;
    gap: 12px !important;
  }

  #dashboard .metric-card {
    padding: 10px 12px !important;
  }

  #dashboard .metric-card strong {
    font-size: clamp(21px, 2vw, 27px) !important;
  }

  #dashboard .map-panel,
  #dashboard .decision-panel {
    padding: 12px !important;
  }

  #dashboard .event-panel {
    grid-template-columns: 190px minmax(0, 1fr) !important;
    padding: 12px !important;
  }

  #dashboard .event-panel .event-log {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #dashboard .telemetry-card {
    padding: 10px !important;
  }

  #dashboard .greenhouse-map {
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr) minmax(0, 1.36fr) minmax(0, 1fr) !important;
  }

  #dashboard .zone-column {
    padding: 10px 8px !important;
  }

  #dashboard .zone-column:first-child {
    padding-left: 36px !important;
  }

  #dashboard .zone-column:last-child {
    padding-right: 36px !important;
  }

  #dashboard .sensor-stack {
    grid-auto-rows: minmax(56px, auto) !important;
  }

  #dashboard .zone-column.core .sensor-stack {
    grid-auto-rows: minmax(60px, auto) !important;
  }

  #dashboard .sensor-dot {
    min-height: 56px !important;
    padding: 7px !important;
  }

  #dashboard .sensor-dot span {
    font-size: 10px !important;
  }
}

/* Final product layout pass: readable panels, top-view map, DNA Sonic and voice command */
#market.view.active {
  grid-template-columns: minmax(360px, 0.78fr) minmax(560px, 1.18fr) minmax(340px, 0.72fr) !important;
  grid-template-rows: 86px minmax(0, 1fr) !important;
  gap: 16px !important;
}

#market > .market-hero {
  min-height: 86px !important;
  overflow: hidden !important;
}

#market .climate-drive-selector {
  grid-auto-rows: minmax(116px, auto) !important;
  overflow: auto !important;
  padding-right: 8px !important;
}

#market .climate-mode {
  min-height: 116px !important;
  grid-template-columns: 104px minmax(0, 1fr) 76px !important;
  padding: 12px !important;
  overflow: hidden !important;
}

#market .climate-mode-image {
  width: 104px !important;
  min-height: 92px !important;
  height: 92px !important;
}

#market .climate-mode strong {
  font-size: 17px !important;
  line-height: 1.08 !important;
  white-space: normal !important;
}

#market .climate-mode span,
#market .climate-mode small,
#market .climate-mode em {
  font-size: 11px !important;
  line-height: 1.22 !important;
  white-space: normal !important;
}

#market > .climate-detail-panel {
  display: grid !important;
  grid-template-rows: auto minmax(220px, 0.7fr) auto auto auto auto !important;
  gap: 10px !important;
  overflow: auto !important;
  padding: 16px !important;
}

#market .climate-detail-image {
  min-height: 210px !important;
  max-height: 300px !important;
}

#market .climate-spec-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

#market .process-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

#market .process-stack div {
  min-height: 54px !important;
  padding: 9px !important;
}

#market > .market-side {
  overflow: auto !important;
  grid-template-rows: auto auto !important;
  align-content: start !important;
}

#market > .market-side > .panel {
  min-height: auto !important;
  height: auto !important;
}

#market .purchase-summary,
#market .purchased-climates {
  overflow: visible !important;
}

#market .primary-button,
#market .secondary-button {
  white-space: normal !important;
  min-height: 46px !important;
}

#dashboard .greenhouse-map {
  position: relative !important;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1fr) !important;
  gap: 10px !important;
  padding: 16px 44px !important;
  border-radius: 0 !important;
  background:
    linear-gradient(rgba(67, 223, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 223, 255, 0.045) 1px, transparent 1px),
    rgba(2, 10, 13, 0.72) !important;
  background-size: 26px 26px !important;
}

#dashboard .greenhouse-map::before,
#dashboard .greenhouse-map::after {
  width: 32px !important;
  z-index: 4 !important;
}

#dashboard .zone-column {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  min-width: 0 !important;
  padding: 12px !important;
  border: 1px solid rgba(68, 229, 255, 0.24) !important;
  background:
    radial-gradient(circle at 50% 45%, rgba(68, 229, 255, 0.07), transparent 46%),
    rgba(2, 10, 13, 0.70) !important;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

#dashboard .zone-column:first-child,
#dashboard .zone-column:last-child {
  padding-left: 12px !important;
  padding-right: 12px !important;
}

#dashboard .zone-column.core {
  border-color: rgba(77, 255, 168, 0.36) !important;
  background:
    radial-gradient(circle at 50% 50%, rgba(77, 255, 168, 0.09), transparent 50%),
    rgba(2, 16, 13, 0.74) !important;
}

#dashboard .zone-label {
  background: rgba(2, 10, 13, 0.76) !important;
  border-color: rgba(68, 229, 255, 0.20) !important;
}

#dashboard .zone-label strong {
  font-size: 15px !important;
}

#dashboard .zone-label span {
  font-size: 12px !important;
}

#dashboard .sensor-stack {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-content: center !important;
  gap: 8px !important;
  overflow: auto !important;
}

#dashboard .zone-column:first-child .sensor-stack {
  grid-template-columns: 1fr !important;
}

#dashboard .zone-column.core .sensor-stack {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

#dashboard .sensor-dot {
  display: grid !important;
  min-height: 70px !important;
  padding: 8px !important;
  border-color: rgba(68, 229, 255, 0.26) !important;
  background: rgba(6, 31, 38, 0.82) !important;
}

#dashboard .sensor-dot small {
  display: block;
  color: #89aeb6;
  font-family: var(--font-data);
  font-size: 10px;
  line-height: 1.15;
}

#dashboard .zone-artifacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(68, 229, 255, 0.14);
}

#dashboard .zone-artifacts span {
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  border: 1px solid rgba(255, 184, 77, 0.24);
  background: rgba(255, 184, 77, 0.08);
  color: #ffd493;
  font-family: var(--font-data);
  font-size: 10px;
}

.frequency-cloud {
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  gap: 6px !important;
  max-height: 230px;
  overflow: auto;
  align-items: stretch !important;
}

.frequency-cloud span {
  min-height: 34px;
  display: grid;
  place-items: center;
  gap: 0;
  border: 1px solid rgba(68, 229, 255, 0.20);
  background: rgba(68, 229, 255, 0.055);
  color: #ffffff;
  font-family: var(--font-data);
  animation: frequencyPulse 1800ms ease-in-out infinite;
  animation-delay: calc(var(--d) * -70ms);
}

.frequency-cloud span b {
  font-size: 12px;
  line-height: 1;
}

.frequency-cloud span small {
  color: var(--amber);
  font-size: 9px;
  line-height: 1;
}

.sonic-program-list {
  grid-template-columns: 1fr !important;
}

.sonic-program {
  min-height: 104px !important;
  grid-template-columns: minmax(0, 1fr) 84px !important;
}

.sonic-program small {
  display: block;
  margin-top: 5px;
  color: #ffd493;
  font-family: var(--font-data);
  font-size: 10px;
  line-height: 1.24;
}

#voice.view.active {
  overflow: hidden !important;
}

.voice-console {
  grid-template-columns: minmax(0, 4fr) minmax(0, 1fr) !important;
  gap: 16px !important;
}

.voice-brain-panel {
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  padding: 16px !important;
}

.voice-chat-panel {
  grid-template-rows: auto minmax(190px, 0.42fr) minmax(0, 1fr) auto !important;
  padding: 16px !important;
}

.voice-brain-stage {
  min-height: 0 !important;
  background:
    radial-gradient(circle at 50% 50%, rgba(85, 247, 255, 0.12), transparent 38%),
    rgba(1, 6, 12, 0.96) !important;
}

.voice-brain-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

#voice .voice-brain-panel { padding: 0 !important; border: 0; background: transparent; clip-path: none; }
#voice .voice-brain-panel > .panel-header { padding: 12px 16px; margin: 0; }
#voice .voice-brain-stage { border: 0; clip-path: none; }
#voice .voice-chat-panel { min-width: 0; overflow: auto; padding: 12px !important; }
#voice .voice-chat-panel .panel-header p { display: none; }
#voice .voice-chat-panel h2 { font-size: 18px; }
#voice .voice-display, #voice .chat-message { overflow-wrap: anywhere; padding: 12px; }
#voice .voice-display strong { font-size: 18px; }
#voice .voice-display span, #voice .chat-message { font-size: 13px; line-height: 1.5; }
#voice .chat-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
#voice .chat-form input { min-width: 0; width: 100%; font-size: 13px; }
@media (max-width: 760px) {
  body:has(#voice.active) { min-width: 0 !important; height: auto !important; overflow: auto !important; }
  body:has(#voice.active) .app-shell { display: block !important; min-width: 0 !important; height: auto !important; }
  body:has(#voice.active) .sidebar { position: relative !important; width: 100% !important; height: auto !important; min-height: 0 !important; padding: 12px; }
  body:has(#voice.active) .sidebar-panel, body:has(#voice.active) .sidebar-footer { display: none; }
  body:has(#voice.active) .nav-tabs { display: flex; overflow: auto; }
  body:has(#voice.active) .nav-button { flex: 0 0 auto; }
  body:has(#voice.active) .main { display: block !important; min-width: 0 !important; width: 100% !important; height: auto !important; padding: 10px !important; overflow: visible !important; }
  body:has(#voice.active) .topbar { display: none !important; }
  #voice.view.active { overflow: auto !important; }
  #voice .voice-console { display: grid; grid-template-columns: minmax(0, 1fr) !important; height: auto !important; overflow: visible; }
  #voice .voice-brain-panel { min-height: 65vh; }
  #voice .voice-chat-panel { min-height: 460px; }
}

.brain-field,
.brain-core,
.voice-rings {
  z-index: 2;
  display: none;
}

.voice-display {
  min-height: 0 !important;
}

#voice .chat-box {
  min-height: 0 !important;
}

@media (max-width: 1500px), (max-height: 850px) {
  #market.view.active {
    grid-template-columns: minmax(330px, 0.78fr) minmax(500px, 1.16fr) minmax(310px, 0.72fr) !important;
  }

  #market > .climate-detail-panel {
    grid-template-rows: auto minmax(170px, 0.58fr) auto auto auto auto !important;
  }

  #market .climate-detail-image {
    min-height: 160px !important;
  }

  .voice-console {
    grid-template-columns: minmax(0, 4fr) minmax(0, 1fr) !important;
  }

  .frequency-cloud {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}
