:root {
  color-scheme: dark;
  --bg: #090d10;
  --panel: rgba(18, 24, 28, 0.78);
  --panel-strong: rgba(22, 31, 35, 0.92);
  --line: rgba(180, 205, 202, 0.18);
  --line-strong: rgba(190, 220, 210, 0.32);
  --text: #edf3ef;
  --muted: #9daaa5;
  --soft: #c9d4ce;
  --green: #34d399;
  --cyan: #22d3ee;
  --amber: #f6b23c;
  --red: #f87171;
  --violet: #a78bfa;
  --steel: #7dd3fc;
  --radius: 8px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(7, 12, 14, 0.96), rgba(16, 19, 16, 0.92)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 68px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 68px),
    radial-gradient(circle at 22% 18%, rgba(45, 212, 191, 0.18), transparent 30%),
    radial-gradient(circle at 78% 24%, rgba(246, 178, 60, 0.13), transparent 28%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
  animation: industrialGridDrift 32s linear infinite;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(100deg, transparent 0 18%, rgba(255, 255, 255, 0.06) 19%, transparent 20% 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 20%, rgba(0, 0, 0, 0.28) 100%);
  mix-blend-mode: screen;
  opacity: 0.55;
  animation: scanSweep 9s linear infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 4px;
  opacity: 0.12;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: rgba(8, 12, 14, 0.72);
  backdrop-filter: blur(22px);
}

.brand {
  display: grid;
  gap: 4px;
  padding: 0 8px 20px;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0;
}

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

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

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--soft);
  transition: 0.18s ease;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line-strong);
  color: var(--text);
}

.nav i {
  width: 18px;
  height: 18px;
  color: var(--cyan);
}

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

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

.title-block {
  display: grid;
  gap: 7px;
}

.eyebrow {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.16;
  letter-spacing: 0;
}

.subtitle {
  margin: 0;
  max-width: 820px;
  color: var(--muted);
  line-height: 1.6;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--soft);
  font-size: 13px;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px currentColor;
}

.dot.warn {
  background: var(--amber);
}

.dot.danger {
  background: var(--red);
}

.grid {
  display: grid;
  gap: 16px;
}

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

.grid.two {
  grid-template-columns: 1.35fr 1fr;
}

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

.panel,
.metric,
.table-panel,
.flow-node,
.chat-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.panel:hover,
.metric:hover,
.flow-node:hover,
.chat-panel:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.028)),
    var(--panel);
}

.panel {
  padding: 18px;
}

.metric {
  min-height: 118px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
  position: relative;
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto 14px 0 14px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.72), transparent);
  transform: translateX(-110%);
  animation: dataSweep 4.8s ease-in-out infinite;
}

.metric .label,
.section-label {
  color: var(--muted);
  font-size: 13px;
}

.metric .value {
  margin-top: 12px;
  font-size: 30px;
  font-weight: 760;
}

.metric .trend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--soft);
  font-size: 12px;
}

.accent-green {
  color: var(--green);
}

.accent-cyan {
  color: var(--cyan);
}

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

.accent-red {
  color: var(--red);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

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

.bars {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 178px;
  padding-top: 10px;
  border-bottom: 1px solid var(--line);
}

.bar {
  flex: 1;
  min-width: 8px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--cyan), rgba(52, 211, 153, 0.52));
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.18);
  transform-origin: bottom;
  animation: barRise 0.9s ease both, barPulse 3.6s ease-in-out infinite;
}

.bar.amber {
  background: linear-gradient(180deg, var(--amber), rgba(246, 178, 60, 0.32));
}

.bar.red {
  background: linear-gradient(180deg, var(--red), rgba(248, 113, 113, 0.25));
}

.spark {
  width: 100%;
  height: 50px;
  border-radius: 6px;
  background:
    linear-gradient(140deg, transparent 0 13%, rgba(34, 211, 238, 0.55) 13.5% 14.5%, transparent 15% 29%, rgba(52, 211, 153, 0.65) 30% 31%, transparent 32% 48%, rgba(246, 178, 60, 0.7) 49% 50%, transparent 51% 68%, rgba(34, 211, 238, 0.5) 69% 70%, transparent 71%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent);
  background-size: 160% 100%, 100% 100%;
  animation: traceMove 5.2s linear infinite;
}

.viz-canvas {
  display: block;
  width: 100%;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(0, 0, 0, 0.12)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0, rgba(255, 255, 255, 0.028) 1px, transparent 1px, transparent 42px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0, rgba(255, 255, 255, 0.022) 1px, transparent 1px, transparent 38px);
}

.viz-canvas.compact {
  height: 150px;
}

.visual-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.ring {
  --value: 74%;
  width: 144px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at center, rgba(13, 20, 22, 0.98) 0 55%, transparent 56%),
    conic-gradient(var(--cyan) var(--value), rgba(255, 255, 255, 0.08) 0);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.45), 0 0 30px rgba(34, 211, 238, 0.12);
}

.ring::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ring strong {
  font-size: 24px;
}

.ring span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.ring.amber {
  background:
    radial-gradient(circle at center, rgba(13, 20, 22, 0.98) 0 55%, transparent 56%),
    conic-gradient(var(--amber) var(--value), rgba(255, 255, 255, 0.08) 0);
}

.ring.green {
  background:
    radial-gradient(circle at center, rgba(13, 20, 22, 0.98) 0 55%, transparent 56%),
    conic-gradient(var(--green) var(--value), rgba(255, 255, 255, 0.08) 0);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
}

.data-table td {
  color: var(--soft);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}

.tag.ok {
  color: var(--green);
}

.tag.warn {
  color: var(--amber);
}

.tag.danger {
  color: var(--red);
}

.flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
}

.flow-node {
  position: relative;
  min-height: 146px;
  padding: 15px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
}

.flow-node::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -14px;
  width: 14px;
  height: 2px;
  background: linear-gradient(90deg, var(--line-strong), var(--cyan));
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.42);
  animation: flowLink 1.9s linear infinite;
}

.flow-node::before {
  content: "";
  position: absolute;
  left: -45%;
  top: 0;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.11), transparent);
  transform: skewX(-14deg);
  animation: nodeSweep 5.5s ease-in-out infinite;
}

.flow-node:nth-child(5)::after,
.flow-node:last-child::after {
  display: none;
}

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

.node-name {
  font-weight: 700;
}

.node-data {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.gauge {
  --pct: 72%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.gauge span {
  display: block;
  width: var(--pct);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  animation: gaugeFill 1.1s ease both;
}

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

.row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--soft);
}

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

.device-hero {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
}

.machine-visual {
  min-height: 270px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(255, 255, 255, 0.07) 8% 8.4%, transparent 9% 100%),
    linear-gradient(180deg, rgba(52, 211, 153, 0.08), rgba(246, 178, 60, 0.08)),
    rgba(0, 0, 0, 0.22);
  position: relative;
  overflow: hidden;
}

.machine-visual .rotor {
  position: absolute;
  width: 88px;
  height: 88px;
  left: calc(50% - 44px);
  top: calc(48% - 44px);
  border: 1px solid rgba(220, 235, 229, 0.26);
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, transparent 0 22%, rgba(34, 211, 238, 0.62) 23% 27%, transparent 28% 48%, rgba(246, 178, 60, 0.6) 49% 53%, transparent 54% 100%),
    rgba(0, 0, 0, 0.18);
  animation: rotorSpin 4.8s linear infinite;
}

.machine-visual .belt {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 12%;
  height: 12px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, rgba(237, 243, 239, 0.5) 0 8px, transparent 8px 18px),
    rgba(255, 255, 255, 0.08);
  background-position: 0 0;
  animation: conveyorMove 1.3s linear infinite;
}

.machine-visual::before {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 28%;
  height: 38%;
  border: 1px solid rgba(220, 235, 229, 0.24);
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  transform: skewX(-8deg);
}

.machine-visual::after {
  content: "";
  position: absolute;
  left: 24%;
  right: 24%;
  bottom: 16%;
  height: 8%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--cyan), var(--green));
  opacity: 0.7;
  filter: blur(0.2px);
}

.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.control {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  color: var(--soft);
  font-size: 13px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 94px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.16);
  position: relative;
  overflow: hidden;
}

.timeline-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--green));
}

.chat-panel {
  min-height: 530px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
}

.message-list {
  display: grid;
  align-content: start;
  gap: 12px;
}

.message {
  max-width: 86%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  color: var(--soft);
  line-height: 1.55;
  animation: messageIn 0.45s ease both;
}

.message.user {
  justify-self: end;
  border-color: rgba(34, 211, 238, 0.42);
  background: rgba(34, 211, 238, 0.08);
}

.inputbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.inputbar input {
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
}

.icon-button,
.primary-button {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(52, 211, 153, 0.14));
  color: var(--text);
  cursor: pointer;
}

.data-ribbon {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.ribbon-cell {
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 4px;
}

.ribbon-cell span {
  color: var(--muted);
  font-size: 11px;
}

.ribbon-cell strong {
  font-size: 15px;
}

@keyframes industrialGridDrift {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 0 0, 136px 0, 0 136px, 0 0, 0 0, 0 0; }
}

@keyframes scanSweep {
  from { transform: translateX(-12%); }
  to { transform: translateX(12%); }
}

@keyframes dataSweep {
  0%, 40% { transform: translateX(-110%); opacity: 0; }
  52% { opacity: 1; }
  100% { transform: translateX(110%); opacity: 0; }
}

@keyframes barRise {
  from { transform: scaleY(0.08); opacity: 0.35; }
  to { transform: scaleY(1); opacity: 1; }
}

@keyframes barPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

@keyframes traceMove {
  from { background-position: 0 0, 0 0; }
  to { background-position: 160% 0, 0 0; }
}

@keyframes gaugeFill {
  from { width: 0; }
}

@keyframes flowLink {
  0%, 100% { opacity: 0.38; }
  50% { opacity: 1; }
}

@keyframes nodeSweep {
  0%, 55% { left: -48%; opacity: 0; }
  70% { opacity: 1; }
  100% { left: 110%; opacity: 0; }
}

@keyframes rotorSpin {
  to { transform: rotate(360deg); }
}

@keyframes conveyorMove {
  to { background-position: 36px 0; }
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(8px); }
}

@keyframes agentIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

.primary-button {
  padding: 0 16px;
  font-weight: 700;
}

.icon-button {
  width: 44px;
  display: grid;
  place-items: center;
}

.mobile-top {
  display: none;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 14, 0.82);
  backdrop-filter: blur(18px);
}

.mobile-nav {
  display: none;
}

.agent-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
}

.agent-fab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(34, 211, 238, 0.44);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.28), rgba(52, 211, 153, 0.18)),
    rgba(8, 12, 14, 0.86);
  color: var(--text);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.4), 0 0 28px rgba(34, 211, 238, 0.16);
  cursor: pointer;
  backdrop-filter: blur(18px);
}

.agent-fab svg {
  width: 19px;
  height: 19px;
}

.agent-panel {
  position: absolute;
  right: 0;
  bottom: 62px;
  width: min(420px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 110px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(12, 17, 19, 0.94);
  box-shadow: 0 28px 92px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(24px);
  overflow: hidden;
  animation: agentIn 0.22s ease both;
}

.agent-panel[hidden] {
  display: none;
}

.agent-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.agent-header div {
  display: grid;
  gap: 3px;
}

.agent-header strong {
  font-size: 15px;
}

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

.agent-close,
.agent-input button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  color: var(--soft);
  cursor: pointer;
}

.agent-body {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.agent-message {
  margin-bottom: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--soft);
  line-height: 1.55;
  font-size: 13px;
  animation: messageIn 0.28s ease both;
}

.agent-bot {
  background: rgba(255, 255, 255, 0.05);
}

.agent-user {
  margin-left: 36px;
  border-color: rgba(34, 211, 238, 0.42);
  background: rgba(34, 211, 238, 0.09);
  color: var(--text);
}

.agent-list {
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.agent-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.agent-chip {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--soft);
  cursor: pointer;
  font-size: 12px;
}

.agent-chip:hover {
  border-color: rgba(34, 211, 238, 0.42);
  color: var(--text);
}

.agent-log {
  max-height: 260px;
  overflow: auto;
}

.agent-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.agent-input input {
  min-width: 0;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
}

.page-section {
  margin-top: 16px;
}

.loading {
  color: var(--muted);
  padding: 18px;
}

.empty {
  color: var(--muted);
  padding: 14px 0;
}

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

  .sidebar {
    display: none;
  }

  .mobile-top {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 12, 14, 0.68);
  }

  .mobile-nav a {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--soft);
    font-size: 13px;
  }

  .mobile-nav a.active {
    color: var(--text);
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.07);
  }

  .main {
    padding: 18px 16px 86px;
  }

  .topbar,
  .device-hero {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .grid.metrics,
  .grid.two,
  .grid.three,
  .flow {
    grid-template-columns: 1fr;
  }

  .flow-node::after {
    top: auto;
    right: 50%;
    bottom: -14px;
    width: 2px;
    height: 14px;
  }

  .flow-node:nth-child(5)::after {
    display: block;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .visual-row,
  .data-ribbon {
    grid-template-columns: 1fr;
  }

  .agent-widget {
    right: 14px;
    bottom: 14px;
  }

  .agent-fab {
    width: auto;
    min-width: 92px;
    justify-content: center;
    padding: 0 15px;
  }

  .agent-panel {
    right: -2px;
    bottom: 60px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 130px);
  }

  h1 {
    font-size: 24px;
  }
}
