:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #030712;
  --rail: #070d19;
  --panel: rgba(10, 17, 31, 0.94);
  --panel2: rgba(13, 24, 42, 0.92);
  --line: rgba(129, 160, 203, 0.18);
  --line2: rgba(43, 126, 255, 0.34);
  --text: #f2f7ff;
  --muted: #95a6bd;
  --soft: #63748c;
  --cyan: #2f8cff;
  --green: #22c55e;
  --blue: #3182f6;
  --purple: #7c5cff;
  --yellow: #f5c542;
  --danger: #ff6b6b;
  --footer-height: 64px;
  --page-gap: 27px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: var(--footer-height);
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 18%, rgba(49, 130, 246, 0.18), transparent 26%),
    radial-gradient(circle at 58% 100%, rgba(26, 80, 180, 0.18), transparent 34%),
    linear-gradient(135deg, #02040b 0%, #07111f 48%, #030712 100%);
}

@media (display-mode: standalone) {
  body {
    min-height: 100dvh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }
}
button, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; }

.control-shell {
  width: min(1840px, calc(100vw - 48px));
  min-height: calc(100dvh - var(--footer-height) - (var(--page-gap) * 2));
  margin: var(--page-gap) auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: visible;
  border: 1px solid rgba(129, 160, 203, 0.12);
  border-radius: 8px;
  background: rgba(4, 8, 18, 0.86);
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.48);
}

.left-rail {
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 15, 29, 0.98), rgba(4, 8, 18, 0.96));
}
.brand { display: flex; align-items: center; gap: 12px; height: 56px; }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  color: #f7fbff; background: linear-gradient(135deg, #4da3ff, #0057ff);
  font-size: 26px; font-weight: 950; border-radius: 4px;
}
.brand strong, .brand span { display: block; }
.brand strong { font-size: 15px; letter-spacing: 0.04em; }
.brand span { color: var(--muted); font-size: 11px; font-weight: 700; }
.axis-nav { display: grid; gap: 10px; margin-top: 28px; }
.axis-button {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px;
  padding: 10px 12px; border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--muted); text-align: left;
}
.axis-button .nav-icon {
  width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto;
  color: currentColor; border: 1px solid currentColor; border-radius: 999px; opacity: .78;
}
.axis-button strong, .axis-button small { display: block; }
.axis-button strong { color: var(--text); font-size: 14px; }
.axis-button small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.axis-button.active {
  border-color: rgba(49, 130, 246, 0.52);
  color: var(--cyan);
  background: linear-gradient(90deg, rgba(49, 130, 246, 0.18), rgba(49, 130, 246, 0.04));
}
.system-settings {
  margin-top: auto; height: 42px; display: flex; align-items: center; gap: 10px;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 7px;
  color: var(--muted); background: rgba(255,255,255,.025); text-align: left;
}
.system-settings small { margin-left: auto; }

.command-center { min-width: 0; min-height: 0; display: grid; grid-template-rows: 64px auto; }
.command-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; border-bottom: 1px solid var(--line);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-left strong { font-size: 15px; }
.topbar-left span { color: var(--muted); font-size: 12px; }
.live-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--green); box-shadow: 0 0 14px var(--green); }
.topbar-right button {
  height: 36px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 6px; color: #d8e9ff; background: rgba(19, 33, 57, 0.9);
}
.icon-button { width: 36px; padding: 0 !important; }
.operator { position: relative; display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 8px; cursor: pointer; }
.operator:hover { background: rgba(49,130,246,.1); }
.operator > span {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 999px; background: #13213a; color: #eaf2ff; font-weight: 900;
}
.operator strong, .operator small { display: block; }
.operator strong { font-size: 12px; }
.operator small { color: var(--muted); font-size: 11px; }
.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 80;
  min-width: 142px;
  display: none;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 15, 29, .98);
  box-shadow: 0 20px 54px rgba(0,0,0,.42);
}
.operator.open .profile-dropdown { display: block; }
.profile-dropdown button {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 7px;
  color: #ffb4b4;
  background: rgba(255,107,107,.1);
  text-align: center;
  font-weight: 800;
}
.profile-dropdown button:hover { background: rgba(255,107,107,.18); }

.center-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 14px;
  padding: 14px;
}
.restricted-workspace .topbar-left span:not(#clockLine),
.restricted-workspace #adminButton,
.restricted-workspace #refreshButton,
.restricted-workspace .integration-grid,
.restricted-workspace .right-stack {
  display: none;
}
.restricted-workspace:not(.workspace-open) .forge-workspace {
  display: none;
}
.restricted-workspace .center-layout {
  grid-template-columns: minmax(0, 1fr);
}
.restricted-workspace .main-stack {
  grid-template-rows: auto auto;
}
.main-stack { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto auto auto; gap: 14px; }
h2, h3 { margin: 0; }
.axis-status h2 { margin-bottom: 12px; font-size: 14px; }
.axis-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.axis-card, .integration-card, .forge-workspace, .right-panel, .voice-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(13, 24, 42, 0.96), rgba(7, 13, 27, 0.96));
  box-shadow: 0 14px 34px rgba(0,0,0,.22);
}
.axis-card { min-height: 170px; padding: 14px; display: grid; gap: 10px; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.axis-card:hover, .axis-card.selected {
  border-color: rgba(49,130,246,.62);
  background: linear-gradient(180deg, rgba(18, 36, 66, 0.98), rgba(8, 17, 35, 0.98));
}
.axis-card:hover { transform: translateY(-1px); }
.axis-card-head { display: flex; align-items: center; gap: 10px; }
.agent-letter {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 5px;
  color: #eaffff; font-weight: 950; font-size: 22px;
}
.axis-card h3 { font-size: 15px; }
.axis-card p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.metric-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.metric-row strong { color: var(--text); }
.sparkline { width: 100%; height: 34px; }
.detail-link {
  justify-self: start;
  padding: 0;
  color: #b9d9ff;
  font-size: 12px;
  text-decoration: none;
  background: transparent;
}
.detail-link:hover { color: var(--cyan); }
.integration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.integration-card { min-height: 136px; padding: 14px; }
.card-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head small { color: var(--muted); font-weight: 500; }
.ok { color: var(--green); font-size: 12px; font-weight: 900; }
dl { margin: 0; display: grid; gap: 7px; }
dl div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
dd { margin: 0; color: var(--text); }
.progress { height: 5px; margin-top: 10px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, #3182f6, #63a4ff); }

.forge-workspace { min-height: 0; overflow: visible; display: grid; grid-template-rows: 56px auto minmax(0, 1fr); }
.workspace-head {
  display: flex; align-items: center; gap: 18px; padding: 0 14px; border-bottom: 1px solid var(--line);
}
.workspace-head > div { display: flex; align-items: center; gap: 10px; }
.workspace-head span strong,
.workspace-head span small { display: block; }
.workspace-head span small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.forge-badge { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 4px; background: #3182f6; font-weight: 900; }
.workspace-head label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.agent-select, .generation-panel select, .generation-panel textarea {
  border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: rgba(255,255,255,.04);
}
.agent-select { height: 32px; padding: 0 10px; }
.workspace-head nav { margin-left: auto; display: flex; height: 100%; }
.tab { min-width: 78px; color: var(--muted); background: transparent; border-left: 1px solid transparent; border-right: 1px solid transparent; }
.tab.active { color: var(--text); border-bottom: 2px solid var(--blue); }
.axis-detail-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(4, minmax(90px, .7fr)) auto;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(49,130,246,.055);
}
.axis-detail-panel > div,
.axis-detail-panel article {
  min-height: 52px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 6px;
  background: rgba(255,255,255,.025);
}
.axis-detail-panel strong { font-size: 13px; }
.axis-detail-panel span,
.axis-detail-panel small { color: var(--muted); font-size: 11px; }
.axis-detail-panel article strong { color: var(--text); }
.axis-detail-panel button {
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  color: var(--cyan);
  background: rgba(49,130,246,.1);
  font-weight: 800;
}
.workspace-body { min-height: 620px; overflow: visible; display: grid; grid-template-columns: 240px minmax(0, 1fr) 300px; }
.chat-room-list {
  --room-row: 58px;
  min-height: 0;
  max-height: calc((var(--room-row) * 10) + 64px);
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-auto-rows: minmax(54px, auto);
  align-content: start;
  gap: 8px;
  padding: 14px;
  border-right: 1px solid var(--line);
}
.room-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.room-list-head strong { font-size: 13px; }
.room-list-head button, .new-room {
  border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: rgba(255,255,255,.04);
}
.room-list-head button { height: 28px; padding: 0 10px; font-size: 12px; }
.room-item {
  display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; align-items: center;
  padding: 8px; border-radius: 6px; color: var(--muted); background: rgba(255,255,255,.025); text-align: left;
}
.room-item span { grid-row: 1 / span 2; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; }
.room-item strong { color: var(--text); font-size: 12px; }
.room-item small { font-size: 11px; color: var(--muted); }
.room-item.active strong { color: var(--cyan); }
.new-room { min-height: 38px; }
.chat-console { min-width: 0; min-height: 0; overflow: hidden; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; border-right: 1px solid var(--line); }
.chat-stream { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-console[data-view="code"] .chat-stream,
.chat-console[data-view="runs"] .chat-stream,
.chat-console[data-view="artifacts"] .chat-stream { display: none; }
.chat-console[data-view="chat"] .workspace-panel { display: none; }
.workspace-panel {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}
.workspace-item,
.workspace-empty {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 7px;
  background: rgba(0,0,0,.22);
}
.workspace-item > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.workspace-item strong,
.workspace-empty strong { color: var(--cyan); font-size: 12px; text-transform: uppercase; }
.workspace-item time,
.workspace-item span,
.workspace-empty span { color: var(--muted); font-size: 12px; }
.workspace-item span,
.workspace-empty span { display: block; line-height: 1.5; }
.workspace-item pre {
  max-height: 320px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0,0,0,.34);
  color: #9ecbff;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.workspace-item img,
.workspace-item video {
  display: block;
  width: min(520px, 100%);
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #000;
}
.message { max-width: min(760px, 86%); padding: 9px 12px; border-radius: 8px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.06); color: #d6e2f0; font-size: 16px; line-height: 1.48; white-space: pre-wrap; }
.message.user { justify-self: end; background: rgba(49,130,246,.14); border-color: rgba(49,130,246,.24); }
.message small { display: block; margin-bottom: 5px; color: var(--cyan); font-size: 11px; font-weight: 900; }
.message img, .message video { display: block; width: min(360px, 100%); margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; background: #000; }
.composer { display: grid; grid-template-columns: 1fr 42px; gap: 10px; padding: 14px; }
.composer textarea { resize: none; border: 1px solid var(--line); border-radius: 7px; padding: 11px; color: var(--text); background: rgba(0,0,0,.22); outline: none; }
.composer button { border: 1px solid var(--line2); border-radius: 7px; color: #d8e9ff; background: linear-gradient(180deg, rgba(49,130,246,.22), rgba(49,130,246,.1)); font-size: 20px; }
.quick-actions { min-height: 48px; display: flex; flex-wrap: nowrap; gap: 10px; overflow-x: auto; padding: 0 14px 14px; }
.chip { flex: 0 0 auto; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: rgba(255,255,255,.035); font-size: 12px; white-space: nowrap; }
.chip.success { color: var(--green); border-color: rgba(34,197,94,.32); }
.chip.blue { color: #7db1ff; border-color: rgba(78,149,255,.3); }
.generation-panel { min-height: 0; overflow: auto; display: grid; align-content: start; gap: 14px; padding: 14px; }
.generation-panel h3 { font-size: 14px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.segmented button { height: 38px; color: var(--muted); background: rgba(255,255,255,.025); }
.segmented button.active { color: var(--text); background: rgba(49,130,246,.14); }
.generation-panel label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.generation-panel textarea { resize: vertical; min-height: 108px; max-height: 260px; padding: 10px; line-height: 1.5; }
.generation-panel select, .generation-panel input { height: 36px; padding: 0 10px; }
.generation-panel input { border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: rgba(255,255,255,.04); }
.custom-app-form { display: grid; gap: 12px; }
.app-summary {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(49,130,246,.22);
  border-radius: 7px;
  background: rgba(49,130,246,.08);
}
.app-summary strong { color: var(--cyan); font-size: 13px; }
.app-summary span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.generate-button { height: 46px; border-radius: 7px; color: var(--text); background: linear-gradient(180deg, #2563eb, #1743a6); border: 1px solid rgba(99,164,255,.28); font-weight: 800; }
.generate-button.secondary { background: rgba(49,130,246,.12); }

.right-stack {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(4, auto);
  align-content: start;
  gap: 10px;
}
.right-panel { min-height: 0; overflow: hidden; padding: 14px; }
.right-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.right-title h2 { font-size: 14px; }
.right-title button, .right-title span { color: var(--muted); background: transparent; font-size: 12px; }
.log-stream { display: grid; gap: 10px; max-height: 238px; overflow: auto; }
.log-line { display: grid; grid-template-columns: 76px 82px 1fr; gap: 8px; color: var(--muted); font-size: 12px; }
.log-line strong { color: var(--cyan); font-size: 11px; }
.log-line time { color: var(--muted); }
.log-line span { color: #d4e1f0; }
.health-list { display: grid; gap: 10px; }
.health-list div { display: grid; grid-template-columns: 1fr 54px 54px; gap: 8px; color: var(--muted); font-size: 12px; }
.health-list strong { color: var(--green); }
.health-list small { text-align: right; color: #b2c2c8; }
.wave { --voice-level: 8%; height: 54px; border-radius: 6px; background:
  linear-gradient(180deg, transparent calc(50% - var(--voice-level) / 2), rgba(49,130,246,.86) calc(50% - var(--voice-level) / 2) calc(50% + var(--voice-level) / 2), transparent calc(50% + var(--voice-level) / 2)),
  repeating-linear-gradient(90deg, transparent 0 8px, rgba(49,130,246,.44) 8px 11px, transparent 11px 18px);
  mask-image: linear-gradient(180deg, transparent 0 18%, #000 18% 82%, transparent 82%);
  transition: background .12s ease, filter .12s ease;
}
.voice-activity.active .wave { filter: drop-shadow(0 0 12px rgba(49,130,246,.28)); animation: voice-wave 1.1s linear infinite; }
.voice-activity.speaking .wave { filter: drop-shadow(0 0 18px rgba(34,197,94,.28)); }
.voice-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.voice-stats small { color: var(--muted); }
.voice-stats strong { display: block; margin-top: 6px; }
.level-bars { --voice-level: 0%; position: relative; height: 24px; margin-top: 14px; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,.055); }
.level-bars::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--voice-level); background: repeating-linear-gradient(90deg, var(--green) 0 7px, transparent 7px 13px); opacity: .9; transition: width .1s ease; }
@keyframes voice-wave {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 0, 18px 0; }
}
.voice-avatar { display: grid; justify-items: center; align-content: center; gap: 12px; }
.voice-orb {
  position: relative;
  width: clamp(92px, 8vw, 142px); height: clamp(92px, 8vw, 142px); border-radius: 999px; color: var(--cyan);
  border: 1px solid rgba(49,130,246,.82);
  background:
    radial-gradient(circle at 50% 45%, rgba(49,130,246,.36), transparent 28%),
    radial-gradient(circle, rgba(49,130,246,.18), rgba(5,12,25,.72) 70%);
  box-shadow: 0 0 42px rgba(49,130,246,.3), inset 0 0 28px rgba(49,130,246,.22);
  font-size: 52px; font-weight: 950;
}
.voice-orb::before {
  content: "";
  position: absolute;
  inset: 28px 38px 36px;
  border: 2px solid rgba(99,164,255,.72);
  border-radius: 48% 48% 44% 44%;
  box-shadow:
    inset 0 -22px 24px rgba(49,130,246,.12),
    0 0 20px rgba(49,130,246,.2);
}
.voice-orb::after {
  content: "";
  position: absolute;
  left: 47px;
  top: 62px;
  width: 48px;
  height: 28px;
  background:
    radial-gradient(circle at 12px 8px, rgba(99,164,255,.95) 0 2px, transparent 3px),
    radial-gradient(circle at 36px 8px, rgba(99,164,255,.95) 0 2px, transparent 3px),
    linear-gradient(rgba(99,164,255,.65), rgba(99,164,255,.65)) 16px 23px / 16px 1px no-repeat;
  opacity: .9;
}
.voice-orb span {
  position: relative;
  z-index: 1;
  align-self: end;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: .12em;
}
.voice-avatar strong { color: var(--cyan); }
.zetvis-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  min-height: var(--footer-height);
  padding: 10px 18px;
  border-top: 1px solid rgba(49,130,246,.22);
  background: rgba(4, 8, 18, .96);
  backdrop-filter: blur(16px);
  box-shadow: 0 -16px 50px rgba(0,0,0,.38);
}
.zetvis-footer strong {
  color: var(--text);
  font-size: 13px;
  letter-spacing: .04em;
}
.zetvis-footer a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(49,130,246,.36);
  border-radius: 7px;
  color: var(--cyan);
  background: rgba(49,130,246,.1);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}
.zetvis-footer a:hover { background: rgba(49,130,246,.18); }
.footer-install {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(49,130,246,.42);
  border-radius: 7px;
  color: #dcecff;
  background: rgba(49,130,246,.14);
  font-size: 12px;
  font-weight: 900;
}
.footer-install:hover { background: rgba(49,130,246,.22); }
.footer-install[hidden] { display: none; }
.footer-permission {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(49,130,246,.32);
  border-radius: 7px;
  color: #dcecff;
  background: rgba(255,255,255,.055);
  font-size: 12px;
  font-weight: 900;
}
.footer-permission:hover { background: rgba(49,130,246,.16); }
.footer-permission:disabled { opacity: .72; cursor: wait; }
.voice-panel { position: fixed; right: 28px; bottom: 82px; z-index: 50; width: 390px; display: none; overflow: hidden; box-shadow: 0 24px 90px rgba(0,0,0,.5); }
.voice-panel.open { display: block; }
.voice-head { display: flex; justify-content: space-between; padding: 14px; border-bottom: 1px solid var(--line); }
.voice-head span { display: block; margin-top: 4px; color: var(--cyan); font-size: 12px; }
.voice-head button, .voice-controls button { border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: rgba(255,255,255,.04); }
#message { margin: 0; min-height: 112px; max-height: 230px; padding: 14px; overflow: auto; color: #d7e7ec; }
.voice-line { display: grid; gap: 6px; margin-bottom: 12px; }
.voice-line b { color: var(--cyan); font-size: 11px; letter-spacing: .02em; }
.voice-line span { display: block; line-height: 1.55; white-space: pre-wrap; }
.voice-line.user { padding: 10px; border: 1px solid rgba(49,130,246,.2); border-radius: 8px; background: rgba(49,130,246,.1); }
.voice-line.assistant { padding: 10px; border: 1px solid rgba(255,255,255,.09); border-radius: 8px; background: rgba(255,255,255,.035); }
.meter { height: 7px; margin: 0 14px 14px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.08); }
.meter span { display: block; width: 0%; height: 100%; background: linear-gradient(90deg, #3182f6, #63a4ff); }
.voice-controls { display: flex; gap: 10px; padding: 0 14px 14px; }
.voice-controls button { height: 36px; padding: 0 14px; }
button:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 1280px) {
  body { overflow: auto; }
  .control-shell { width: 100%; min-height: calc(100dvh - var(--footer-height)); margin: 0 0 var(--footer-height); border-radius: 0; grid-template-columns: 190px 1fr; }
  .center-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .right-stack { grid-template-columns: 1fr; grid-template-rows: repeat(4, auto); }
  .axis-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .axis-status h2 { margin-bottom: 8px; }
  .axis-card { min-height: 88px; padding: 10px; gap: 5px; }
  .axis-card p,
  .axis-card .metric-row:nth-of-type(n+3),
  .axis-card .sparkline { display: none; }
  .integration-card { min-height: 82px; padding: 10px; }
  .integration-card dl { grid-template-columns: 1fr 1fr; gap: 5px 12px; }
  .integration-card dl div:nth-child(n+3),
  .integration-card .progress { display: none; }
  .integration-grid { display: none; }
  .main-stack { grid-template-rows: auto auto auto; }
  .axis-detail-panel { grid-template-columns: 1fr 1fr; }
  .forge-workspace { grid-template-rows: 52px auto minmax(260px, 1fr); }
  .workspace-body { grid-template-columns: 180px minmax(0, 1fr) 260px; }
  .generation-panel { grid-column: auto; }
}

@media (max-width: 1024px) {
  body { padding-bottom: 88px; }
  .control-shell { grid-template-columns: 1fr; width: 100%; height: auto; min-height: 100dvh; overflow: visible; }
  .left-rail { position: static; padding: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { height: auto; }
  .axis-nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(132px, 1fr);
    grid-template-columns: none;
    gap: 8px;
    margin-top: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .axis-button { min-height: 54px; padding: 8px 10px; gap: 10px; }
  .axis-button .nav-icon { width: 26px; height: 26px; }
  .axis-button strong { font-size: 12px; }
  .axis-button small { font-size: 10px; }
  .system-settings { display: none; }
  .command-center { grid-template-rows: auto minmax(0, 1fr); }
  .center-layout { padding: 10px; gap: 10px; }
  .main-stack { gap: 10px; }
  .axis-cards, .integration-grid, .right-stack, .workspace-body { grid-template-columns: 1fr; }
  .axis-cards { gap: 8px; }
  .axis-card { min-height: 148px; }
  .right-stack { display: grid; grid-template-rows: auto; }
  .axis-detail-panel { grid-template-columns: 1fr; }
  .command-topbar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    gap: 12px;
    padding: 14px;
  }
  .topbar-left, .topbar-right { width: 100%; flex-wrap: wrap; }
  .topbar-right { justify-content: space-between; }
  .operator { margin-left: auto; }
  .workspace-head {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    gap: 12px;
    padding: 14px;
  }
  .workspace-head nav {
    width: 100%;
    height: 42px;
    margin-left: 0;
    overflow-x: auto;
  }
  .tab { min-width: 92px; }
  .forge-workspace { grid-template-rows: auto auto minmax(0, 1fr); }
  .workspace-body { min-height: auto; }
  .chat-room-list {
    grid-template-rows: auto;
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 1fr);
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .room-list-head, .new-room { min-width: 150px; }
  .chat-console { min-height: 520px; border-right: 0; border-bottom: 1px solid var(--line); }
  .generation-panel { min-height: auto; }
  .message { max-width: 100%; font-size: 13px; }
  .log-line { grid-template-columns: 66px 74px 1fr; }
  .voice-avatar { padding: 18px 0 10px; }
  .voice-orb { width: 116px; height: 116px; }
  .zetvis-footer { justify-content: space-between; gap: 10px; min-height: 64px; }
  .zetvis-footer strong { font-size: 12px; }
  .zetvis-footer a { max-width: 54vw; justify-content: center; text-align: center; }
  .voice-panel { left: 12px; right: 12px; bottom: 76px; width: auto; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .left-rail { padding: 16px 14px; }
  .brand-mark { width: 42px; height: 42px; font-size: 28px; }
  .brand strong { font-size: 15px; }
  .brand span { font-size: 11px; }
  .axis-nav {
    grid-auto-columns: 172px;
    gap: 10px;
    margin-top: 18px;
  }
  .axis-button {
    min-height: 68px;
    padding: 12px;
    border-radius: 10px;
  }
  .axis-button .nav-icon { width: 34px; height: 34px; }
  .axis-button strong { font-size: 14px; }
  .axis-button small { font-size: 12px; }
  .command-topbar { padding: 16px 14px; }
  .topbar-left { gap: 8px; }
  .topbar-left strong { font-size: 16px; }
  .topbar-left span { font-size: 12px; }
  .topbar-right button { height: 40px; padding: 0 13px; font-size: 13px; }
  .operator > span { width: 38px; height: 38px; }
  .operator strong { font-size: 13px; }
  .operator small { font-size: 11px; }
  .center-layout { padding: 12px; gap: 14px; }
  .main-stack { gap: 14px; }
  .axis-status h2 { font-size: 16px; margin-bottom: 14px; }
  .axis-cards { gap: 12px; }
  .axis-card {
    min-height: 188px;
    padding: 18px;
    border-radius: 12px;
  }
  .agent-letter { width: 44px; height: 44px; border-radius: 9px; font-size: 24px; }
  .axis-card h3 { font-size: 18px; }
  .axis-card p { font-size: 13px; }
  .metric-row { font-size: 14px; }
  .sparkline { height: 54px; }
  .detail-link { font-size: 14px; }
  .integration-grid { gap: 12px; }
  .integration-card, .right-panel {
    min-height: auto;
    padding: 18px;
    border-radius: 12px;
  }
  .card-head strong, .right-title h2 { font-size: 16px; }
  dl div, .health-list div, .log-line { font-size: 13px; }
  .forge-workspace { border-radius: 12px; }
  .workspace-head { padding: 16px; }
  .workspace-head span small, .workspace-head label { font-size: 12px; }
  .agent-select { height: 38px; font-size: 14px; }
  .tab { min-width: 104px; font-size: 14px; }
  .axis-detail-panel { padding: 14px; gap: 12px; }
  .axis-detail-panel > div,
  .axis-detail-panel article,
  .axis-detail-panel button { min-height: 64px; border-radius: 10px; }
  .axis-detail-panel strong { font-size: 15px; }
  .axis-detail-panel span,
  .axis-detail-panel small { font-size: 12px; }
  .chat-room-list {
    grid-auto-columns: minmax(178px, 76vw);
    padding: 16px;
    gap: 10px;
  }
  .room-item { min-height: 64px; border-radius: 10px; }
  .room-item strong { font-size: 13px; }
  .room-item small { font-size: 12px; }
  .chat-console { min-height: 560px; }
  .chat-stream { padding: 16px; gap: 12px; }
  .message { padding: 13px 14px; border-radius: 12px; font-size: 14px; line-height: 1.55; }
  .message small { font-size: 12px; }
  .composer { grid-template-columns: 1fr 48px; padding: 14px; }
  .composer textarea { min-height: 52px; font-size: 14px; }
  .composer button { min-height: 48px; }
  .quick-actions { padding: 0 14px 14px; }
  .chip { min-height: 40px; font-size: 13px; }
  .generation-panel { padding: 16px; gap: 16px; }
  .generation-panel h3 { font-size: 16px; }
  .generation-panel textarea { min-height: 92px; font-size: 14px; }
  .generate-button { height: 52px; font-size: 15px; }
  .voice-orb { width: 128px; height: 128px; }
  .zetvis-footer strong,
  .zetvis-footer a,
  .footer-permission,
  .footer-install { font-size: 12px; }
}

@media (max-width: 560px) {
  .center-layout { padding: 8px; }
  .topbar-right button { height: 34px; padding: 0 10px; font-size: 12px; }
  .operator { width: 100%; justify-content: flex-start; margin-left: 0; }
  .profile-dropdown { left: 0; right: auto; }
  .axis-cards { grid-template-columns: 1fr; }
  .integration-card, .right-panel, .generation-panel, .chat-stream, .workspace-panel { padding: 12px; }
  .workspace-body { grid-template-columns: minmax(0, 1fr); }
  .chat-room-list { grid-auto-columns: minmax(136px, 74vw); }
  .chat-console { min-height: 480px; }
  .composer { grid-template-columns: 1fr 40px; padding: 12px; }
  .quick-actions { overflow-x: auto; padding: 0 12px 12px; }
  .chip { min-width: max-content; }
  .voice-panel { bottom: 84px; }
  #message { max-height: 190px; }
  .zetvis-footer { flex-direction: column; align-items: stretch; padding: 8px 12px; }
  .zetvis-footer strong { text-align: center; }
  .zetvis-footer a { width: 100%; max-width: none; min-height: 34px; }
  .footer-install { width: 100%; min-height: 34px; }
  .footer-permission { width: 100%; min-height: 34px; }
}

@media (display-mode: standalone) and (max-width: 1024px) {
  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }
  .control-shell {
    min-height: calc(100dvh - env(safe-area-inset-top));
  }
  .left-rail {
    padding-top: calc(12px + env(safe-area-inset-top));
  }
  .center-layout {
    padding-bottom: 12px;
  }
  .chat-console {
    min-height: min(520px, calc(100dvh - 230px));
  }
  .voice-panel {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
  .zetvis-footer {
    min-height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

@media (display-mode: standalone) and (max-width: 560px) {
  body {
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }
  .chat-console {
    min-height: min(460px, calc(100dvh - 245px));
  }
  .voice-panel {
    bottom: calc(118px + env(safe-area-inset-bottom));
  }
  .zetvis-footer {
    min-height: calc(96px + env(safe-area-inset-bottom));
  }
}
