:root {
  --bg: #06090c;
  --bg-soft: #0a0f14;
  --panel: #0d151d;
  --panel-2: #101a24;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9f2f6;
  --muted: #8ea3b0;
  --muted-2: #6b7f8c;
  --accent: #7cf7a0;
  --accent-2: #66e3d2;
  --accent-soft: rgba(124, 247, 160, 0.12);
  --warn: #f7c77c;
  --danger: #ff8585;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #11202a 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button,
select,
textarea,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
}

.hidden {
  display: none !important;
}

.svg-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Topbar */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 64px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(6, 9, 12, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: conic-gradient(from 140deg, var(--accent), var(--accent-2), #2b6c74, var(--accent));
  box-shadow: 0 0 22px rgba(124, 247, 160, 0.35);
  flex: 0 0 auto;
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.badge.ghost {
  color: var(--muted);
}

.badge.accent {
  color: #06120a;
  background: var(--accent);
  border-color: transparent;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
}

.btn:active {
  transform: translateY(1px);
}

.btn.ghost {
  background: transparent;
}

.btn.icon {
  width: 36px;
  padding: 0;
}

.btn.wide {
  width: 100%;
}

.btn.accent {
  background: var(--accent);
  border-color: transparent;
  color: #04140a;
  font-weight: 700;
}

.btn.danger {
  border-color: rgba(255, 133, 133, 0.4);
  color: var(--danger);
  background: transparent;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main {
  position: fixed;
  inset: 64px 0 0 0;
}

/* Voice stage */
.stage-voice {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto auto;
  place-items: center;
  padding: 24px 20px 28px;
  overflow: hidden;
}

.voice-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 380px at 50% 38%, rgba(124, 247, 160, 0.11), transparent 70%),
    radial-gradient(760px 520px at 50% 70%, rgba(102, 227, 210, 0.06), transparent 70%);
  pointer-events: none;
}

.orb-wrap {
  position: relative;
  width: min(58vh, 460px, 74vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 300ms ease;
}

#orb {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 20px 60px rgba(124, 247, 160, 0.12));
}

.orb-ring {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 1px solid rgba(124, 247, 160, 0.14);
  box-shadow: inset 0 0 80px rgba(124, 247, 160, 0.05);
  pointer-events: none;
}

body[data-voice-state="listening"] .orb-ring {
  animation: breathe 2.4s ease-in-out infinite;
}

body[data-voice-state="thinking"] .orb-ring {
  animation: spin 5s linear infinite;
  border-style: dashed;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.65; }
  50% { transform: scale(1.04); opacity: 1; }
}

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

.voice-status {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  letter-spacing: 0.01em;
  text-align: center;
  min-height: 20px;
  z-index: 1;
}

.transcript {
  width: min(680px, 92vw);
  min-height: 24px;
  margin: 12px 0 18px;
  text-align: center;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  z-index: 1;
}

.transcript .interim {
  color: var(--muted-2);
}

.transcript .command {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.transcript .reply {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.voice-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 1;
}

.mic {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 1px solid rgba(124, 247, 160, 0.35);
  background: radial-gradient(circle at 50% 30%, rgba(124, 247, 160, 0.28), rgba(6, 9, 12, 0.9) 68%);
  display: grid;
  place-items: center;
  color: var(--text);
  transition: transform 160ms ease, box-shadow 200ms ease, border-color 200ms ease;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

.mic:hover {
  transform: translateY(-1px) scale(1.02);
}

.mic[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 10px rgba(124, 247, 160, 0.06), 0 0 60px rgba(124, 247, 160, 0.24);
}

.mic svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mic-pulse {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(124, 247, 160, 0.4);
  opacity: 0;
}

.mic[aria-pressed="true"] .mic-pulse {
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.55); opacity: 0; }
}

.voice-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: min(900px, 94vw);
  margin-top: 26px;
  z-index: 1;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12.5px;
  transition: all 150ms ease;
}

.chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

body.canvas-open .orb-wrap {
  position: fixed;
  left: 28px;
  bottom: 96px;
  width: 132px;
  z-index: 46;
  opacity: 0.9;
  transform: none;
}

body.canvas-open .voice-status,
body.canvas-open .transcript,
body.canvas-open .quick-chips {
  opacity: 0.25;
  pointer-events: none;
}

body.canvas-open .voice-controls {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(6, 9, 12, 0.75);
  backdrop-filter: blur(14px);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

body.canvas-open .voice-controls .mic {
  width: 54px;
  height: 54px;
}

/* Text stage */
.stage-text {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr) 300px;
  height: 100%;
  background: var(--bg-soft);
}

.sidebar,
.activity {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: rgba(8, 12, 16, 0.6);
}

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

.sidebar-head,
.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.sidebar-head span {
  letter-spacing: 0.06em;
  text-transform: none;
  font-size: 10px;
}

.project-list,
.feature-list,
.events {
  margin: 0;
  padding: 0 10px;
  list-style: none;
  overflow: auto;
  scrollbar-width: thin;
}

.project-list li {
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 9px;
}

.project-list li.active {
  background: rgba(124, 247, 160, 0.08);
  color: var(--text);
  border: 1px solid rgba(124, 247, 160, 0.16);
}

.project-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}

.project-list li small {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 10px;
}

.feature-list {
  counter-reset: feature;
  flex: 0 1 auto;
}

.feature-list li {
  counter-increment: feature;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  padding: 9px 8px;
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--muted);
  align-items: start;
}

.feature-list li::before {
  content: counter(feature);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
  padding-top: 2px;
}

.feature-list li strong {
  display: block;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
}

.feature-list li small {
  color: var(--muted-2);
  font-size: 10.5px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(900px 400px at 40% 0%, rgba(124, 247, 160, 0.03), transparent 70%),
    var(--bg-soft);
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}

.workspace-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.workspace-title strong {
  font-size: 14px;
  font-weight: 600;
}

.workspace-title small {
  color: var(--muted-2);
  font-size: 11.5px;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
}

.tab.active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

.pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  overflow: auto;
  padding: 24px clamp(18px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
}

.message {
  max-width: 720px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.6;
}

.message-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
}

.message.assistant .message-avatar {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(124, 247, 160, 0.2);
}

.message-body {
  min-width: 0;
}

.message-body p {
  margin: 0;
  white-space: pre-wrap;
}

.message-meta {
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 14px clamp(18px, 4vw, 48px) 20px;
  border-top: 1px solid var(--line);
  background: rgba(6, 9, 12, 0.45);
}

.composer textarea {
  flex: 1;
  resize: none;
  min-height: 42px;
  max-height: 160px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
  font-size: 13.5px;
  line-height: 1.4;
}

.composer textarea:focus {
  border-color: rgba(124, 247, 160, 0.4);
  box-shadow: 0 0 0 3px rgba(124, 247, 160, 0.07);
}

.activity .events {
  flex: 1;
  padding: 0 14px 14px;
}

.events li {
  position: relative;
  padding: 10px 0 10px 16px;
  border-left: 1px solid var(--line);
  margin-left: 4px;
}

.events li::before {
  content: "";
  position: absolute;
  left: -3.5px;
  top: 17px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
}

.events li.kind-deploy::before {
  background: var(--warn);
}

.events li.kind-pr::before,
.events li.kind-merge::before {
  background: var(--accent);
}

.events li strong {
  display: block;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.4;
}

.events li p {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.45;
}

.events time {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  color: var(--muted-2);
  font-family: var(--mono);
}

.empty-state {
  margin: auto;
  max-width: 520px;
  padding: 40px;
  text-align: center;
}

.empty-mark {
  width: 46px;
  height: 46px;
  margin: 0 auto 18px;
  border-radius: 14px;
  background: conic-gradient(from 160deg, var(--accent), var(--accent-2), transparent);
  opacity: 0.7;
}

.empty-state h2 {
  font-size: 17px;
  margin: 0 0 8px;
}

.empty-state p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.steps {
  text-align: left;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  margin: 18px 0 22px;
  padding-left: 20px;
}

iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

/* Canvas */
.scrim {
  position: fixed;
  inset: 64px 0 0 0;
  background: rgba(2, 4, 6, 0.45);
  backdrop-filter: blur(2px);
  z-index: 45;
}

.canvas {
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  width: min(620px, 94vw);
  background: linear-gradient(180deg, #0c141b 0%, #080d12 100%);
  border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  z-index: 50;
  display: flex;
  flex-direction: column;
  animation: slide-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slide-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.canvas-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.canvas-kicker {
  display: block;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}

.canvas-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.canvas-body {
  flex: 1;
  overflow: auto;
  padding: 20px 22px 28px;
  scrollbar-width: thin;
}

/* Diff */
.repo-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.repo-tab {
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.repo-tab.active {
  color: var(--text);
  border-color: rgba(124, 247, 160, 0.3);
  background: var(--accent-soft);
}

.repo-summary {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 14px;
}

.diff-file {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.diff-file-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
}

.diff-stat {
  display: flex;
  gap: 8px;
  font-size: 11px;
}

.add { color: var(--accent); }
.del { color: var(--danger); }

.diff-lines {
  margin: 0;
  padding: 8px 0;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
  overflow-x: auto;
}

.diff-line {
  display: flex;
  white-space: pre;
}

.diff-line .ln {
  width: 22px;
  flex: 0 0 auto;
  text-align: center;
  color: var(--muted-2);
  user-select: none;
}

.diff-line.add {
  background: rgba(124, 247, 160, 0.07);
  color: #b6f7c8;
}

.diff-line.del {
  background: rgba(255, 133, 133, 0.07);
  color: #ffc0c0;
}

.diff-line.hunk {
  color: #7cc8f7;
  background: rgba(124, 200, 247, 0.05);
}

.diff-line.ctx {
  color: var(--muted);
}

.source-tag {
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Chart */
.metric-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.chart-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 16px 10px;
  background: rgba(255, 255, 255, 0.02);
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.chart-head strong {
  font-size: 14px;
}

.chart-head span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}

.chart-note {
  color: var(--muted-2);
  font-size: 11.5px;
  margin: 10px 0 0;
  line-height: 1.5;
}

.chart svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Kanban */
.queue {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.queue li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
}

.queue .pos {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  text-align: center;
}

.queue .q-title {
  min-width: 0;
}

.queue .q-title strong {
  display: block;
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.35;
}

.queue .q-title small {
  color: var(--muted-2);
  font-size: 10.5px;
}

.queue .btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.stage-pill {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 240px;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.column {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  min-height: 180px;
}

.column h3 {
  margin: 2px 2px 10px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}

.card {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  margin-bottom: 7px;
  background: rgba(255, 255, 255, 0.03);
}

.card strong {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}

.card small {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 10px;
}

.card a {
  font-size: 10px;
}

/* Prototype */
.proto-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.proto-frame {
  width: 100%;
  height: 480px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #000;
}

.proto-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin: 10px 0 0;
}

/* Settings */
.settings-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

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

.settings-section h3 {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.settings-section p {
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.5;
  margin: 0 0 12px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-size: 12px;
  color: var(--text);
}

.field .hint {
  font-size: 10.5px;
  color: var(--muted-2);
  line-height: 1.45;
}

.field .hint.warn {
  color: var(--warn);
}

.field .hint.ok {
  color: var(--accent);
}

select {
  width: 100%;
  min-height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #0b131a;
  padding: 0 10px;
  font-size: 12.5px;
}

.field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.field-row .btn {
  min-height: 36px;
  white-space: nowrap;
}

.test-result {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 6px;
}

.test-result.ok {
  color: var(--accent);
}

.test-result.fail {
  color: var(--danger);
}

.session-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

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

.kv span:last-child {
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
}

/* Install */
.install-card {
  border: 1px solid rgba(124, 247, 160, 0.2);
  background: linear-gradient(160deg, rgba(124, 247, 160, 0.08), rgba(255, 255, 255, 0.02));
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
}

.install-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.install-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin: 0 0 14px;
}

.install-steps {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.install-steps strong {
  color: var(--text);
  font-weight: 550;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(12, 20, 27, 0.96);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  max-width: min(560px, 92vw);
  animation: toast-in 220ms ease;
}

.toast button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
}

@keyframes toast-in {
  from { transform: translate(-50%, 8px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Login page */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: radial-gradient(900px 500px at 50% 0%, #122029, var(--bg) 65%);
}

.login-card {
  width: min(420px, 92vw);
  padding: 34px 30px 28px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 16, 22, 0.9);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 21px;
  letter-spacing: -0.01em;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.login-card input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
  letter-spacing: 0.08em;
}

.login-card input:focus {
  border-color: rgba(124, 247, 160, 0.45);
  box-shadow: 0 0 0 3px rgba(124, 247, 160, 0.08);
}

.login-card .btn {
  width: 100%;
  margin-top: 12px;
  min-height: 44px;
}

.login-error {
  min-height: 18px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 12px;
}

.login-foot {
  margin-top: 20px;
  font-size: 10.5px;
  color: var(--muted-2);
  line-height: 1.5;
}

/* Offline */
.offline-card {
  margin: 0 auto;
  max-width: 460px;
  text-align: center;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* Responsive */
@media (max-width: 1080px) {
  .stage-text {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .activity {
    display: none;
  }
}

@media (max-width: 780px) {
  .topbar {
    padding: 0 10px;
    gap: 6px;
    height: 58px;
  }
  .brand-sub,
  #provider-badge,
  #mode-badge {
    display: none;
  }
  .brand-name {
    font-size: 13px;
  }
  .brand-mark {
    width: 24px;
    height: 24px;
  }
  .topbar-actions {
    gap: 6px;
  }
  .topbar-actions .btn {
    padding: 0 9px;
    font-size: 11.5px;
    min-height: 34px;
  }
  #mode-button {
    min-width: 0;
  }
  #install-button {
    font-size: 11px;
  }
  .orb-wrap {
    width: min(62vh, 300px, 68vw);
  }
  .stage-voice {
    padding: 16px 14px calc(20px + env(safe-area-inset-bottom));
  }
  .voice-status {
    font-size: 12.5px;
  }
  .transcript {
    font-size: 13.5px;
    margin: 10px 0 14px;
  }
  body.canvas-open .orb-wrap {
    display: none;
  }
  body.canvas-open .voice-controls {
    display: none;
  }
  .stage-text {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .canvas {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 84vh;
    border-left: 0;
    border-top: 1px solid var(--line-strong);
    border-radius: 20px 20px 0 0;
    animation: sheet-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  @keyframes sheet-in {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  body.canvas-open .orb-wrap {
    transform: scale(0.28) translate(-90%, -40%);
  }
  .voice-controls {
    gap: 12px;
  }
  .quick-chips {
    margin-top: 18px;
  }
  .workspace-head {
    padding: 10px 14px;
  }
  .messages {
    padding: 16px;
  }
  .composer {
    padding: 10px 14px 16px;
  }
  .diff-lines {
    font-size: 10.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.chip.active {
  color: var(--text);
  border-color: rgba(124, 247, 160, 0.3);
  background: var(--accent-soft);
}
