:root {
  color-scheme: dark;
  --bg: #07090e;
  --bg-raised: #0b0e15;
  --panel: #0e121a;
  --panel-strong: #111722;
  --panel-hover: #151c28;
  --line: #202938;
  --line-soft: #171e2a;
  --text: #f2f6fb;
  --text-soft: #a8b2c2;
  --muted: #6f7b8d;
  --cyan: #57e6d4;
  --cyan-bright: #91fff1;
  --cyan-dim: rgba(87, 230, 212, 0.12);
  --violet: #9f8cff;
  --violet-dim: rgba(159, 140, 255, 0.12);
  --amber: #ffcb6b;
  --danger: #ff758a;
  --success: #6ce6a8;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.34);
  --sidebar-width: 272px;
  --inspector-width: 352px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(80, 196, 207, 0.09), transparent 34rem),
    var(--bg);
  font-size: 1rem;
  line-height: 1.5;
}

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

button,
select {
  cursor: pointer;
}

button {
  border: 0;
}

button:disabled {
  cursor: not-allowed;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

::selection {
  color: #06110f;
  background: var(--cyan);
}

:focus-visible {
  outline: 2px solid var(--cyan-bright);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  color: #06110f;
  background: var(--cyan-bright);
  border-radius: var(--radius-sm);
  font-weight: 700;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--inspector-width);
  height: 100dvh;
  min-height: 34rem;
}

.sidebar,
.inspector {
  position: relative;
  z-index: 10;
  min-width: 0;
  background: rgba(10, 13, 20, 0.94);
  backdrop-filter: blur(20px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-soft);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  padding: 0 1rem 0 1.15rem;
}

.brand {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--cyan-bright);
  background: linear-gradient(145deg, rgba(87, 230, 212, 0.14), rgba(159, 140, 255, 0.08));
  border: 1px solid rgba(87, 230, 212, 0.28);
  border-radius: 9px;
  box-shadow: inset 0 0 20px rgba(87, 230, 212, 0.05), 0 0 22px rgba(87, 230, 212, 0.06);
}

.brand-mark svg {
  width: 1.3rem;
}

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

.brand strong {
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: -0.1rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.icon-button,
.small-icon-button {
  display: grid;
  place-items: center;
  color: var(--text-soft);
  background: transparent;
  border-radius: var(--radius-sm);
  transition: color 140ms ease, background 140ms ease;
}

.icon-button {
  width: 2.35rem;
  height: 2.35rem;
}

.small-icon-button {
  width: 1.8rem;
  height: 1.8rem;
}

.icon-button:hover,
.small-icon-button:hover {
  color: var(--text);
  background: var(--panel-hover);
}

.icon-button svg {
  width: 1.15rem;
  height: 1.15rem;
}

.small-icon-button svg {
  width: 0.95rem;
  height: 0.95rem;
}

.sidebar-close {
  display: none;
}

.new-chat-button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.35rem 0.8rem 0.75rem;
  padding: 0.72rem 0.75rem;
  color: #e9fffc;
  background: linear-gradient(135deg, rgba(87, 230, 212, 0.16), rgba(87, 230, 212, 0.07));
  border: 1px solid rgba(87, 230, 212, 0.24);
  border-radius: 10px;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.new-chat-button:hover {
  background: linear-gradient(135deg, rgba(87, 230, 212, 0.21), rgba(87, 230, 212, 0.1));
  border-color: rgba(87, 230, 212, 0.42);
  transform: translateY(-1px);
}

.new-chat-button svg {
  width: 1rem;
}

.new-chat-button span {
  flex: 1;
  font-size: 0.86rem;
  font-weight: 650;
}

kbd {
  padding: 0.08rem 0.32rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
}

.search-field,
.memory-search {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field {
  margin: 0 0.8rem 0.6rem;
}

.search-field svg,
.memory-search svg {
  position: absolute;
  left: 0.7rem;
  width: 0.95rem;
  color: var(--muted);
  pointer-events: none;
}

.search-field input,
.memory-search input {
  width: 100%;
  border: 1px solid transparent;
  outline: none;
}

.search-field input {
  height: 2.2rem;
  padding: 0 0.75rem 0 2.1rem;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 8px;
  font-size: 0.875rem;
}

.search-field input:focus,
.memory-search input:focus {
  border-color: rgba(87, 230, 212, 0.35);
  box-shadow: 0 0 0 3px rgba(87, 230, 212, 0.07);
}

.search-field input::placeholder,
.memory-search input::placeholder,
.composer textarea::placeholder {
  color: #647084;
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  padding: 0 0.55rem;
  overflow: auto;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

.nav-section + .nav-section {
  margin-top: 1.25rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 1.85rem;
  padding: 0 0.55rem;
}

.section-heading h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-heading > span {
  color: #596476;
  font-size: 0.75rem;
}

.nav-list {
  display: grid;
  gap: 0.15rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  width: 100%;
  min-height: 2.55rem;
  padding: 0.45rem 0.55rem;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.nav-item[aria-current="page"] {
  color: #e9fffc;
  background: var(--cyan-dim);
  border-color: rgba(87, 230, 212, 0.1);
}

.nav-item > svg {
  width: 1rem;
  flex: 0 0 auto;
  color: var(--muted);
}

.nav-item[aria-current="page"] > svg {
  color: var(--cyan);
}

.nav-item-copy {
  min-width: 0;
  flex: 1;
}

.nav-item-copy strong,
.nav-item-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item-copy strong {
  font-size: 0.875rem;
  font-weight: 520;
}

.nav-item-copy small {
  margin-top: 0.05rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.project-glyph {
  width: 0.5rem;
  height: 0.5rem;
  flex: 0 0 auto;
  background: var(--project-color, var(--violet));
  border-radius: 2px;
  box-shadow: 0 0 8px color-mix(in srgb, var(--project-color, var(--violet)) 40%, transparent);
}

.demo-tag,
.source-tag {
  padding: 0.12rem 0.35rem;
  color: var(--amber);
  background: rgba(255, 203, 107, 0.08);
  border: 1px solid rgba(255, 203, 107, 0.16);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.source-tag--real {
  color: var(--cyan);
  background: var(--cyan-dim);
  border-color: rgba(87, 230, 212, 0.18);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.4rem;
  padding: 0.7rem 0.75rem 0.7rem 1rem;
  border-top: 1px solid var(--line-soft);
}

.runtime-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.65rem;
}

.runtime-identity strong,
.runtime-identity small {
  display: block;
}

.runtime-identity strong {
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 600;
}

.runtime-identity small {
  color: var(--muted);
  font-size: 0.75rem;
}

.pulse-dot {
  width: 0.5rem;
  height: 0.5rem;
  flex: 0 0 auto;
  background: var(--muted);
  border-radius: 50%;
}

.pulse-dot--online {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(108, 230, 168, 0.08), 0 0 12px rgba(108, 230, 168, 0.3);
}

.pulse-dot--demo {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 203, 107, 0.08);
}

.workspace {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
  background-size: 32px 32px;
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  padding: 0 1.15rem 0 1.4rem;
  background: rgba(7, 9, 14, 0.76);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
}

.topbar-context,
.topbar-controls,
.service-pills {
  display: flex;
  align-items: center;
}

.topbar-context {
  min-width: 0;
  gap: 0.35rem;
}

.context-copy {
  min-width: 0;
}

.context-eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.context-copy h1 {
  max-width: 25rem;
  margin: 0.1rem 0 0;
  overflow: hidden;
  font-size: 0.93rem;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-controls {
  gap: 0.65rem;
}

.menu-button,
.inspector-button {
  display: none;
}

.mode-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 11rem;
}

.mode-select-wrap select {
  width: 100%;
  height: 2.35rem;
  padding: 0 2rem 0 1.95rem;
  appearance: none;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  font-size: 0.875rem;
  font-weight: 620;
}

.mode-select-wrap select:focus-visible {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

.mode-orbit {
  position: absolute;
  z-index: 1;
  left: 0.75rem;
  width: 0.55rem;
  height: 0.55rem;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  pointer-events: none;
}

.mode-orbit::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.19rem;
  height: 0.19rem;
  background: var(--cyan-bright);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.select-chevron {
  position: absolute;
  right: 0.65rem;
  width: 0.85rem;
  color: var(--muted);
  pointer-events: none;
}

.service-pills {
  gap: 0.35rem;
}

.service-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.1rem;
  padding: 0.35rem 0.55rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  font-size: 0.75rem;
}

.service-pill > span {
  width: 0.4rem;
  height: 0.4rem;
  background: var(--muted);
  border-radius: 50%;
}

.service-pill strong {
  color: var(--text-soft);
  font-weight: 600;
}

.service-pill[data-status="online"] > span {
  background: var(--success);
  box-shadow: 0 0 7px rgba(108, 230, 168, 0.4);
}

.service-pill[data-status="online"] strong {
  color: var(--success);
}

.service-pill[data-status="starting"] > span {
  background: var(--amber);
}

.service-pill[data-status="offline"] > span {
  background: var(--danger);
}

.chat-surface {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.environment-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: min(46rem, calc(100% - 2rem));
  margin: 0.75rem auto 0;
  padding: 0.55rem 0.7rem;
  color: var(--text-soft);
  background: rgba(255, 203, 107, 0.07);
  border: 1px solid rgba(255, 203, 107, 0.16);
  border-radius: 9px;
  font-size: 0.8rem;
}

.environment-banner[data-environment="real"] {
  background: rgba(87, 230, 212, 0.06);
  border-color: rgba(87, 230, 212, 0.14);
}

.environment-banner > svg {
  width: 1rem;
  flex: 0 0 auto;
  color: var(--amber);
}

.environment-banner[data-environment="real"] > svg {
  color: var(--cyan);
}

.environment-banner p {
  display: flex;
  min-width: 0;
  flex: 1;
  gap: 0.35rem;
  margin: 0;
}

.environment-banner strong {
  color: var(--text);
}

.environment-banner button {
  padding: 0.25rem 0.45rem;
  color: var(--amber);
  background: transparent;
  border: 1px solid rgba(255, 203, 107, 0.2);
  border-radius: 6px;
  font-size: 0.75rem;
}

.message-stream {
  min-height: 0;
  flex: 1;
  overflow: auto;
  scroll-behavior: smooth;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

.welcome-panel {
  display: grid;
  align-content: center;
  width: min(46rem, calc(100% - 2rem));
  min-height: 100%;
  margin: 0 auto;
  padding: 2.2rem 0 1.5rem;
}

.welcome-symbol {
  display: grid;
  width: 3.1rem;
  height: 3.1rem;
  margin-bottom: 1.2rem;
  place-items: center;
  color: var(--cyan-bright);
  background: radial-gradient(circle at 30% 20%, rgba(87, 230, 212, 0.18), rgba(159, 140, 255, 0.06));
  border: 1px solid rgba(87, 230, 212, 0.22);
  border-radius: 14px;
  box-shadow: 0 0 50px rgba(87, 230, 212, 0.08);
}

.welcome-symbol svg {
  width: 2rem;
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.11em;
}

.welcome-panel h2 {
  margin: 0.35rem 0 0.45rem;
  font-size: clamp(1.75rem, 4vw, 2.55rem);
  font-weight: 520;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.welcome-copy {
  max-width: 35rem;
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 2rem;
}

.prompt-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.8rem;
  color: var(--text-soft);
  background: rgba(13, 17, 25, 0.75);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  text-align: left;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.prompt-card:hover {
  color: var(--text);
  background: var(--panel-strong);
  border-color: #2a3648;
  transform: translateY(-1px);
}

.prompt-card > svg:first-child {
  width: 1.15rem;
  flex: 0 0 auto;
  color: var(--cyan);
}

.prompt-card span {
  min-width: 0;
  flex: 1;
}

.prompt-card strong,
.prompt-card small {
  display: block;
}

.prompt-card strong {
  font-size: 0.875rem;
  font-weight: 620;
}

.prompt-card small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.prompt-arrow {
  width: 0.8rem;
  flex: 0 0 auto;
  color: #4d596a;
}

.messages-inner {
  width: min(46rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 1rem;
}

.message {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.message--user {
  grid-template-columns: minmax(0, 1fr) 2rem;
}

.message-avatar {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--cyan-bright);
  background: var(--cyan-dim);
  border: 1px solid rgba(87, 230, 212, 0.2);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
}

.message--user .message-avatar {
  grid-column: 2;
  color: var(--text-soft);
  background: var(--panel-hover);
  border-color: var(--line);
}

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

.message--user .message-body {
  grid-row: 1;
  grid-column: 1;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.35rem;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.message--user .message-meta {
  justify-content: flex-end;
}

.message-meta strong {
  color: var(--text-soft);
  font-weight: 650;
}

.message-content {
  color: #dce3ed;
  font-size: 1rem;
  line-height: 1.68;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message--user .message-content {
  width: fit-content;
  max-width: 90%;
  margin-left: auto;
  padding: 0.65rem 0.85rem;
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 12px 4px 12px 12px;
}

.typing-cursor::after {
  display: inline-block;
  width: 0.48rem;
  height: 1em;
  margin-left: 0.2rem;
  vertical-align: -0.12em;
  background: var(--cyan);
  border-radius: 1px;
  content: "";
  animation: blink 900ms step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.composer-zone {
  padding: 0.35rem 1rem 0.8rem;
  background: linear-gradient(to top, var(--bg) 55%, transparent);
}

.composer {
  width: min(46rem, 100%);
  margin: 0 auto;
  padding: 0.72rem;
  background: rgba(15, 20, 29, 0.96);
  border: 1px solid #2a3546;
  border-radius: 15px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.012) inset;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.composer:focus-within {
  border-color: rgba(87, 230, 212, 0.38);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28), 0 0 0 3px rgba(87, 230, 212, 0.05);
}

.composer textarea {
  display: block;
  width: 100%;
  max-height: 12rem;
  padding: 0.15rem 0.2rem 0.45rem;
  resize: none;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.composer-footer,
.composer-tools {
  display: flex;
  align-items: center;
}

.composer-footer {
  justify-content: space-between;
}

.composer-tools {
  gap: 0.6rem;
}

.composer-tool {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.9rem;
  padding: 0.25rem 0.45rem;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
  font-size: 0.75rem;
}

.composer-tool:hover {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.035);
}

.composer-tool svg {
  width: 0.9rem;
}

.mode-caption {
  color: #5f6b7d;
  font-size: 0.75rem;
}

.send-button {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: #07110f;
  background: var(--cyan-bright);
  border-radius: 8px;
  box-shadow: 0 0 16px rgba(87, 230, 212, 0.14);
  transition: background 120ms ease, transform 120ms ease, opacity 120ms ease;
}

.send-button:hover:not(:disabled) {
  background: #c0fff7;
  transform: translateY(-1px);
}

.send-button:disabled {
  opacity: 0.28;
}

.send-button svg {
  width: 1rem;
  stroke-width: 2;
}

.composer-disclaimer {
  margin: 0.45rem auto 0;
  color: #586476;
  font-size: 0.75rem;
  text-align: center;
}

.inspector {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line-soft);
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  padding: 0 0.85rem 0 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.inspector-header h2 {
  margin: 0.05rem 0 0;
  font-size: 0.92rem;
  font-weight: 620;
}

.inspector-close {
  display: none;
}

.tabs {
  display: flex;
  min-height: 3rem;
  padding: 0 0.65rem;
  border-bottom: 1px solid var(--line-soft);
}

.tabs button {
  position: relative;
  min-width: 0;
  flex: 1;
  padding: 0.15rem 0.15rem 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 620;
}

.tabs button[aria-selected="true"] {
  color: var(--text);
}

.tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 0.2rem;
  bottom: -1px;
  left: 0.2rem;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px 2px 0 0;
  content: "";
  box-shadow: 0 0 10px rgba(87, 230, 212, 0.35);
}

.tabs button svg {
  width: 0.85rem;
  margin: auto;
}

.inspector-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

.tab-panel {
  padding: 1rem;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.6rem;
  margin-bottom: 0.9rem;
}

.panel-heading h3 {
  margin: 0.08rem 0 0;
  font-size: 0.93rem;
  font-weight: 620;
}

.count-badge,
.live-label {
  display: inline-flex;
  align-items: center;
  min-height: 1.4rem;
  padding: 0.15rem 0.45rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 0.75rem;
}

.task-list,
.memory-list {
  display: grid;
  gap: 0.55rem;
}

.task-card,
.memory-card {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.task-top,
.memory-top {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.task-status-icon {
  display: grid;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  margin-top: 0.08rem;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.task-status-icon svg {
  width: 0.7rem;
}

.task-card[data-status="running"] .task-status-icon {
  color: var(--cyan);
  background: var(--cyan-dim);
  border-color: rgba(87, 230, 212, 0.3);
}

.task-card[data-status="done"] .task-status-icon {
  color: var(--success);
  border-color: rgba(108, 230, 168, 0.3);
}

.task-copy,
.memory-copy {
  min-width: 0;
  flex: 1;
}

.task-copy strong,
.memory-copy strong {
  display: block;
  color: #dce3ed;
  font-size: 0.77rem;
  font-weight: 620;
}

.task-copy p,
.memory-copy p {
  display: -webkit-box;
  margin: 0.2rem 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-meta,
.memory-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
  color: #586476;
  font-size: 0.75rem;
}

.task-progress {
  height: 2px;
  margin-top: 0.6rem;
  overflow: hidden;
  background: var(--line-soft);
  border-radius: 2px;
}

.task-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
}

.memory-search {
  margin-bottom: 0.75rem;
}

.memory-search input {
  height: 2.25rem;
  padding: 0 0.75rem 0 2.15rem;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.022);
  border-color: var(--line-soft);
  border-radius: 8px;
  font-size: 0.875rem;
}

.memory-type {
  padding: 0.12rem 0.32rem;
  color: var(--violet);
  background: var(--violet-dim);
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.empty-state {
  display: grid;
  justify-items: center;
  padding: 3rem 1.2rem;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 1.7rem;
  margin-bottom: 0.7rem;
  color: #445064;
}

.empty-state strong {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.empty-state p {
  margin: 0.3rem 0 0;
  font-size: 0.75rem;
}

.system-card {
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
}

.system-card + .system-card {
  margin-top: 0.65rem;
}

.system-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.system-icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--cyan);
  background: var(--cyan-dim);
  border-radius: 8px;
}

.system-icon--violet {
  color: var(--violet);
  background: var(--violet-dim);
}

.system-icon svg {
  width: 1.1rem;
}

.system-title > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.system-title strong,
.system-title small {
  display: block;
}

.system-title strong {
  color: #dfe6ef;
  font-size: 0.78rem;
}

.system-title small {
  margin-top: 0.03rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-word {
  color: var(--muted);
  font-size: 0.75rem;
}

.status-word[data-status="online"] {
  color: var(--success);
}

.status-word[data-status="offline"] {
  color: var(--danger);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin: 0.9rem 0 0;
}

.metric-grid div {
  min-width: 0;
  padding: 0.45rem;
  background: rgba(0, 0, 0, 0.13);
  border-radius: 7px;
}

.metric-grid dt {
  color: #5e6a7c;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.metric-grid dd {
  margin: 0.12rem 0 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-note,
.field-help {
  margin: 0.75rem 0 0;
  color: #5e6a7c;
  font-size: 0.75rem;
}

.budget-hero {
  padding: 1rem;
  background: linear-gradient(145deg, rgba(87, 230, 212, 0.07), rgba(159, 140, 255, 0.035));
  border: 1px solid rgba(87, 230, 212, 0.12);
  border-radius: 12px;
}

.budget-hero > span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.budget-hero > strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.6rem;
  font-weight: 540;
  letter-spacing: -0.04em;
}

.progress-track {
  height: 5px;
  margin-top: 0.9rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  border-radius: inherit;
  transition: width 300ms ease;
}

.budget-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  color: #5e6a7c;
  font-size: 0.75rem;
}

.cost-list {
  margin: 0.8rem 0 0;
}

.cost-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.35rem;
  border-bottom: 1px solid var(--line-soft);
}

.cost-list dt,
.cost-list dd {
  margin: 0;
  font-size: 0.75rem;
}

.cost-list dt {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-soft);
}

.cost-list dd {
  color: var(--muted);
}

.cost-dot {
  width: 0.45rem;
  height: 0.45rem;
  background: var(--muted);
  border-radius: 2px;
}

.cost-dot--cyan { background: var(--cyan); }
.cost-dot--violet { background: var(--violet); }
.cost-dot--muted { background: #5e6a7c; }

.settings-group {
  padding: 0.75rem 0;
  border-top: 1px solid var(--line-soft);
}

.settings-group h4 {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  min-height: 3.5rem;
  cursor: pointer;
}

.setting-row > span:first-child {
  min-width: 0;
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row strong {
  color: var(--text-soft);
  font-size: 0.875rem;
  font-weight: 620;
}

.setting-row small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch {
  position: relative;
  width: 2rem;
  height: 1.12rem;
  background: #252e3d;
  border: 1px solid #344052;
  border-radius: 999px;
  transition: background 140ms ease, border-color 140ms ease;
}

.switch::after {
  position: absolute;
  top: 0.16rem;
  left: 0.17rem;
  width: 0.68rem;
  height: 0.68rem;
  background: #8490a0;
  border-radius: 50%;
  content: "";
  transition: left 140ms ease, background 140ms ease;
}

.switch-input:checked + .switch {
  background: rgba(87, 230, 212, 0.2);
  border-color: rgba(87, 230, 212, 0.35);
}

.switch-input:checked + .switch::after {
  left: 1.03rem;
  background: var(--cyan-bright);
}

.switch-input:focus-visible + .switch {
  outline: 2px solid var(--cyan-bright);
  outline-offset: 2px;
}

.setting-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.8rem;
  color: var(--text-soft);
  font-size: 0.875rem;
}

.setting-field > div {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted);
}

.setting-field input {
  width: 6rem;
  height: 2rem;
  padding: 0 0.5rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  font-size: 0.875rem;
  text-align: right;
}

.setting-field input:focus {
  border-color: var(--cyan);
}

.inspector-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3rem;
  padding: 0 1rem;
  color: #596577;
  border-top: 1px solid var(--line-soft);
  font-size: 0.75rem;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sync-status svg {
  width: 0.75rem;
}

.toast-region {
  position: fixed;
  z-index: 90;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  width: min(22rem, calc(100% - 2rem));
  gap: 0.45rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 0.85rem;
  color: var(--text-soft);
  background: rgba(18, 24, 34, 0.97);
  border: 1px solid #2a3546;
  border-radius: 9px;
  box-shadow: var(--shadow);
  font-size: 0.75rem;
  animation: toast-in 180ms ease-out;
}

.toast strong {
  color: var(--text);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(0.5rem); }
}

.scrim {
  position: fixed;
  z-index: 20;
  inset: 0;
  background: rgba(1, 3, 7, 0.68);
  backdrop-filter: blur(3px);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .inspector {
    position: fixed;
    z-index: 30;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(var(--inspector-width), calc(100% - 2rem));
    box-shadow: var(--shadow);
    transform: translateX(105%);
    transition: transform 180ms ease;
  }

  .app-shell[data-inspector-open="true"] .inspector {
    transform: translateX(0);
  }

  .inspector-button,
  .inspector-close {
    display: grid;
  }
}

@media (max-width: 800px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 30;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(var(--sidebar-width), calc(100% - 2rem));
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .app-shell[data-sidebar-open="true"] .sidebar {
    transform: translateX(0);
  }

  .workspace {
    height: 100dvh;
  }

  .menu-button,
  .sidebar-close {
    display: grid;
  }

  .topbar {
    padding: 0 0.6rem;
  }

  .context-eyebrow {
    display: none;
  }

  .context-copy h1 {
    max-width: 11rem;
    font-size: 0.82rem;
  }

  .service-pills {
    display: none;
  }

  .mode-select-wrap {
    min-width: 9.5rem;
  }

  .mode-select-wrap select {
    font-size: 0.8rem;
  }

  .environment-banner p {
    display: block;
  }

  .environment-banner p span {
    display: block;
  }

  .welcome-panel {
    align-content: start;
    padding-top: 3rem;
  }
}

@media (max-width: 560px) {
  .topbar {
    min-height: 4rem;
  }

  .context-copy h1 {
    max-width: 7.5rem;
  }

  .topbar-controls {
    gap: 0.25rem;
  }

  .mode-select-wrap {
    min-width: 8.6rem;
  }

  .mode-select-wrap select {
    height: 2.15rem;
    padding-right: 1.65rem;
    padding-left: 1.7rem;
    font-size: 0.75rem;
  }

  .mode-orbit {
    left: 0.6rem;
  }

  .environment-banner {
    width: calc(100% - 1rem);
    margin-top: 0.45rem;
  }

  .welcome-panel,
  .messages-inner {
    width: calc(100% - 1.25rem);
  }

  .welcome-panel h2 {
    font-size: 1.75rem;
  }

  .prompt-grid {
    grid-template-columns: 1fr;
    margin-top: 1.25rem;
  }

  .prompt-card {
    min-height: 3.6rem;
  }

  .composer-zone {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
  }

  .mode-caption {
    display: none;
  }

  .composer-disclaimer {
    font-size: 0.75rem;
  }
}

@media (max-height: 700px) and (min-width: 561px) {
  .welcome-panel {
    align-content: start;
    padding-top: 1.5rem;
  }

  .welcome-symbol {
    width: 2.6rem;
    height: 2.6rem;
    margin-bottom: 0.7rem;
  }

  .prompt-grid {
    margin-top: 1rem;
  }
}

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