:root {
  --bg: #f4efe6;
  --bg-strong: #eadfce;
  --panel: rgba(255, 252, 246, 0.86);
  --panel-strong: rgba(255, 252, 246, 0.96);
  --line: rgba(33, 28, 24, 0.08);
  --line-strong: rgba(33, 28, 24, 0.18);
  --text: #1f1a16;
  --muted: #665b53;
  --accent: #de6a4b;
  --accent-soft: rgba(222, 106, 75, 0.12);
  --accent-blue: #3d7ea6;
  --accent-blue-soft: rgba(61, 126, 166, 0.14);
  --accent-green: #4f8a58;
  --danger: #b64b3c;
  --shadow: 0 18px 48px rgba(63, 45, 28, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-ui: "Avenir Next", "Space Grotesk", "Noto Sans SC", "PingFang SC", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(222, 106, 75, 0.26), transparent 28%),
    radial-gradient(circle at top right, rgba(61, 126, 166, 0.2), transparent 24%),
    linear-gradient(180deg, #f7f2e9 0%, #efe7db 50%, #ebe1d3 100%);
  color: var(--text);
  font-family: var(--font-ui);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 22%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.018), rgba(0, 0, 0, 0.018));
  mix-blend-mode: multiply;
  pointer-events: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

#app {
  min-height: 100vh;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding:
    calc(env(safe-area-inset-top, 0px) + 18px)
    16px
    calc(env(safe-area-inset-bottom, 0px) + 18px);
}

.app-shell::after {
  content: "";
  position: fixed;
  right: -68px;
  bottom: 8%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 126, 166, 0.14), transparent 68%);
  pointer-events: none;
}

.auth-shell {
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(520px, 100%);
  display: grid;
  gap: 18px;
  padding: 26px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form .inline-actions {
  justify-content: flex-start;
}

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

.topbar__hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 16px;
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(255, 251, 245, 0.92), rgba(252, 245, 237, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.wordmark {
  display: grid;
  gap: 6px;
}

.wordmark__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.wordmark__dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb29f, var(--accent));
  box-shadow: 0 0 0 6px rgba(222, 106, 75, 0.08);
}

.wordmark__title {
  margin: 0;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.wordmark__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 54ch;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost-button,
.accent-button,
.pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.ghost-button {
  background: rgba(32, 27, 23, 0.06);
  color: var(--text);
}

.ghost-button:active,
.accent-button:active,
.pill-button:active {
  transform: translateY(1px) scale(0.99);
}

.accent-button {
  background: linear-gradient(135deg, #ee8a68, var(--accent));
  color: #fffaf5;
  box-shadow: 0 10px 24px rgba(222, 106, 75, 0.28);
}

.pill-button {
  background: rgba(61, 126, 166, 0.1);
  color: var(--accent-blue);
}

.status-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--muted);
  font-size: 13px;
}

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

.status-pill__signal {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-green);
  box-shadow: 0 0 0 5px rgba(79, 138, 88, 0.12);
}

.status-pill__signal.is-waiting {
  background: #cf9b3e;
  box-shadow: 0 0 0 5px rgba(207, 155, 62, 0.12);
}

.window-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 8px;
}

.window-chip {
  position: relative;
  min-width: 184px;
  max-width: 240px;
  padding: 14px 16px;
  border-radius: 24px;
  background: rgba(255, 252, 246, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.52);
  box-shadow: 0 12px 26px rgba(63, 45, 28, 0.08);
  text-align: left;
  overflow: hidden;
}

.window-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, var(--chip-color, rgba(222, 106, 75, 0.18)), transparent 42%);
  opacity: 0.72;
}

.window-chip > * {
  position: relative;
}

.window-chip.is-active {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(255, 248, 239, 0.95));
  border-color: rgba(222, 106, 75, 0.24);
  box-shadow: 0 18px 30px rgba(63, 45, 28, 0.14);
}

.window-chip__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.window-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-blue);
}

.window-chip__dot.is-running {
  background: var(--accent);
  animation: pulse 1.4s infinite;
}

.window-chip__title {
  display: block;
  margin-top: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.window-chip__footer {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.window-chip__queue {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(32, 27, 23, 0.06);
  font-size: 11px;
}

.window-rail__add {
  min-width: 62px;
  border-radius: 24px;
  background: rgba(32, 27, 23, 0.08);
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.workspace {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.panel {
  border-radius: var(--radius-xl);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.window-stage {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: min(74vh, 860px);
}

.window-stage__header {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.window-stage__title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.window-stage__title h2 {
  margin: 0;
  font-size: clamp(24px, 5vw, 30px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.window-stage__title p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.window-stage__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-grid {
  display: grid;
  gap: 8px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(32, 27, 23, 0.04);
}

.meta-row span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.meta-row strong {
  font-weight: 600;
  font-size: 13px;
  max-width: 62%;
  text-align: right;
  word-break: break-word;
}

.timeline {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  overflow-y: auto;
}

.message {
  display: flex;
  gap: 10px;
  animation: fade-up 0.26s ease;
}

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

.message--system {
  justify-content: center;
}

.message__bubble {
  max-width: min(88%, 540px);
  padding: 14px 16px;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(46, 34, 24, 0.06);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.message--assistant .message__bubble {
  background: rgba(255, 252, 246, 0.92);
  border-top-left-radius: 10px;
}

.message--user .message__bubble {
  color: #fffaf5;
  background: linear-gradient(135deg, #3d7ea6, #245675);
  border-top-right-radius: 10px;
}

.message--status .message__bubble {
  background: rgba(32, 27, 23, 0.06);
  color: var(--muted);
  font-size: 13px;
}

.message--system .message__bubble {
  max-width: min(96%, 560px);
  background: rgba(182, 75, 60, 0.08);
  color: #7f352a;
  text-align: center;
}

.message__bubble[data-state="streaming"] {
  position: relative;
  overflow: hidden;
}

.message__bubble[data-state="streaming"]::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  animation: shimmer 1.8s infinite;
}

.message__meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.composer {
  padding: 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 251, 246, 0.86);
  backdrop-filter: blur(16px);
}

.composer__shell {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 24px;
  background: var(--panel-strong);
  border: 1px solid rgba(32, 27, 23, 0.08);
}

.composer textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 15px;
  line-height: 1.6;
}

.composer__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

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

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

.mic-button {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: rgba(32, 27, 23, 0.08);
  color: var(--text);
  font-size: 18px;
}

.mic-button.is-active {
  background: linear-gradient(135deg, #ec8b68, #c84d34);
  color: #fffaf5;
  animation: pulse 1.2s infinite;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 56vh;
  padding: 28px;
}

.empty-state__card {
  max-width: 420px;
  padding: 26px;
  border-radius: 30px;
  text-align: center;
  background: rgba(255, 252, 246, 0.88);
  box-shadow: var(--shadow);
}

.empty-state__card h2 {
  margin: 0 0 10px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.empty-state__card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.notice {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  z-index: 60;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(33, 28, 24, 0.88);
  color: #fffaf5;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.26);
  animation: fade-up 0.24s ease;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
  visibility: hidden;
  pointer-events: none;
}

.sheet.is-open {
  visibility: visible;
  pointer-events: auto;
}

.sheet__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(20, 16, 12, 0.34);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.sheet.is-open .sheet__scrim {
  pointer-events: auto;
  opacity: 1;
}

.sheet__panel {
  position: relative;
  pointer-events: none;
  margin-top: 18vh;
  padding:
    16px
    16px
    calc(env(safe-area-inset-bottom, 0px) + 20px);
  border-top-left-radius: 32px;
  border-top-right-radius: 32px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.97), rgba(252, 246, 238, 0.97));
  box-shadow: 0 -18px 44px rgba(42, 30, 20, 0.18);
  transform: translateY(100%);
  transition: transform 0.28s ease;
}

.sheet.is-open .sheet__panel {
  pointer-events: auto;
  transform: translateY(0);
}

.sheet__grabber {
  width: 56px;
  height: 6px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(32, 27, 23, 0.12);
}

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

.sheet__header h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.sheet__header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sheet__content {
  display: grid;
  gap: 18px;
  max-height: min(72vh, 760px);
  overflow-y: auto;
}

.card-grid {
  display: grid;
  gap: 12px;
}

.project-card,
.session-card {
  display: grid;
  gap: 8px;
  padding: 15px 16px;
  border-radius: 20px;
  background: rgba(32, 27, 23, 0.05);
}

.project-card strong,
.session-card strong {
  font-size: 15px;
}

.project-card span,
.session-card span,
.project-card code,
.session-card code {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  word-break: break-all;
}

.project-card__actions,
.session-card__actions,
.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.path-form {
  display: grid;
  gap: 10px;
  padding: 15px 16px;
  border-radius: 22px;
  background: rgba(32, 27, 23, 0.05);
}

.input-shell {
  display: grid;
  gap: 8px;
}

.input-shell label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.input-shell input {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(32, 27, 23, 0.08);
  background: rgba(255, 255, 255, 0.76);
  outline: none;
}

.microcopy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.help-block {
  margin: 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.mono {
  font-family: var(--font-mono);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(222, 106, 75, 0.26);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 0 10px rgba(222, 106, 75, 0);
  }
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 880px) {
  .app-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
  }

  .workspace {
    grid-template-columns: 320px minmax(0, 1fr);
    align-items: start;
  }

  .workspace__rail {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + 18px);
  }

  .window-stage {
    min-height: 78vh;
  }

  .sheet {
    align-items: center;
    justify-items: center;
  }

  .sheet__panel {
    width: min(760px, calc(100vw - 40px));
    margin-top: 0;
    border-radius: 32px;
    transform: translateY(40px) scale(0.98);
  }

  .sheet.is-open .sheet__panel {
    transform: translateY(0) scale(1);
  }
}

:root {
  --bg: #eef3f8;
  --bg-strong: #dde7f1;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(19, 32, 51, 0.08);
  --line-strong: rgba(19, 32, 51, 0.16);
  --text: #132033;
  --muted: #5d6b7c;
  --accent: #1f6feb;
  --accent-soft: rgba(31, 111, 235, 0.1);
  --accent-blue: #205ea6;
  --accent-blue-soft: rgba(32, 94, 166, 0.12);
  --accent-green: #1b8f63;
  --danger: #b64b3c;
  --shadow: 0 18px 48px rgba(20, 32, 52, 0.1);
}

html,
body {
  background:
    radial-gradient(circle at top left, rgba(31, 111, 235, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(27, 143, 99, 0.1), transparent 24%),
    linear-gradient(180deg, #f4f7fb 0%, #edf2f7 48%, #e7edf4 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 24px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 28px;
  pointer-events: none;
}

.console-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  gap: 14px;
  padding:
    calc(env(safe-area-inset-top, 0px) + 14px)
    14px
    calc(env(safe-area-inset-bottom, 0px) + 14px);
}

.console-shell::after {
  content: "";
  position: fixed;
  right: -56px;
  bottom: 8%;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 111, 235, 0.14), transparent 68%);
  pointer-events: none;
}

.console-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.console-header {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
}

.console-header__title,
.sidebar__brand,
.inspector-panel,
.inspector-panel__group {
  display: grid;
  gap: 8px;
}

.console-header__eyebrow,
.sidebar__eyebrow,
.inspector-panel__eyebrow {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.console-header__title h2,
.sidebar__brand h1,
.inspector-panel h3 {
  margin: 0;
  letter-spacing: -0.04em;
}

.console-header__title h2 {
  font-size: clamp(24px, 3vw, 30px);
}

.console-header__title p,
.sidebar__brand p,
.inspector-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.console-sidebar {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
}

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

.sidebar__section {
  display: grid;
  gap: 10px;
}

.sidebar__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.sidebar__window-list {
  display: grid;
  gap: 8px;
}

.sidebar__empty,
.sidebar__metric,
.inspector-panel__tips {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(19, 32, 51, 0.04);
  color: var(--muted);
  line-height: 1.5;
}

.sidebar__metric span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.sidebar__metric strong {
  font-size: 14px;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
}

.window-chip {
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.9);
  box-shadow: 0 10px 26px rgba(20, 32, 52, 0.06);
}

.window-chip.is-active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(244, 249, 255, 0.98));
  border-color: rgba(31, 111, 235, 0.22);
  box-shadow: 0 18px 30px rgba(20, 32, 52, 0.12);
}

.window-stage {
  min-height: min(82vh, 980px);
  min-width: 0;
  grid-template-rows: 1fr auto;
}

.console-body {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.inspector-panel {
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.inspector-panel__actions {
  display: grid;
  gap: 8px;
}

.meta-row,
.project-card,
.session-card,
.path-form {
  background: rgba(19, 32, 51, 0.04);
}

.timeline {
  padding: 16px 18px 20px;
  min-width: 0;
}

.message__bubble {
  max-width: min(92%, 920px);
  padding: 16px 18px;
  border-radius: 20px;
}

.message--assistant .message__bubble {
  background: rgba(247, 250, 255, 0.96);
  border: 1px solid rgba(19, 32, 51, 0.05);
}

.message--user .message__bubble {
  background: linear-gradient(135deg, #1f6feb, #205ea6);
}

.message--status .message__bubble {
  background: rgba(19, 32, 51, 0.06);
}

.composer {
  padding: 14px 16px 16px;
  background: rgba(248, 251, 255, 0.92);
}

.composer__shell {
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  border-color: rgba(19, 32, 51, 0.08);
}

.composer textarea {
  min-height: 148px;
  font-size: 16px;
  line-height: 1.65;
}

.mic-button {
  background: rgba(19, 32, 51, 0.08);
}

.accent-button {
  background: linear-gradient(135deg, #3c84ff, #1f6feb);
  box-shadow: 0 10px 24px rgba(31, 111, 235, 0.24);
}

.ghost-button {
  background: rgba(19, 32, 51, 0.06);
}

.empty-state.panel {
  background: rgba(255, 255, 255, 0.86);
}

@media (min-width: 880px) {
  .console-shell {
    max-width: 1560px;
    margin: 0 auto;
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (min-width: 1080px) {
  .console-shell {
    grid-template-columns: 236px minmax(0, 1fr);
    align-items: start;
  }

  .console-sidebar {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + 14px);
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 28px);
    overflow: auto;
  }

  .console-body {
    grid-template-columns: minmax(0, 1fr) 236px;
    align-items: stretch;
  }

  .window-stage {
    min-height: calc(100vh - 148px);
  }

  .inspector-panel {
    max-height: calc(100vh - 148px);
    overflow: auto;
  }
}

.console-shell > * {
  position: relative;
  z-index: 1;
}

.console-header__row,
.sidebar__topline,
.window-stage__badge-row,
.console-header__actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.console-header__actions {
  align-items: center;
}

.ghost-icon-button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(19, 32, 51, 0.06);
  color: var(--text);
  font-size: 14px;
}

.sidebar__topline {
  align-items: flex-start;
}

.sidebar__filters,
.rename-form,
.window-stage__summary {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(19, 32, 51, 0.04);
}

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

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

.input-shell--compact label {
  font-size: 11px;
  letter-spacing: 0.14em;
}

.input-shell input,
.input-shell select {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(19, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  outline: none;
}

.input-shell select {
  appearance: none;
}

.window-chip::before {
  pointer-events: none;
}

.window-chip__preview {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.window-stage {
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.window-stage__summary {
  margin: 14px 14px 0;
}

.window-stage__summary-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.52);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.timeline {
  min-height: 0;
}

.composer {
  padding-top: 12px;
}

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

.inspector-panel__actions .ghost-button {
  width: 100%;
}

.console-sidebar.is-collapsed {
  gap: 12px;
}

.console-sidebar.is-collapsed .sidebar__brand h1,
.console-sidebar.is-collapsed .sidebar__brand p,
.console-sidebar.is-collapsed .sidebar__section--summary {
  display: none;
}

.console-sidebar.is-collapsed .sidebar__actions {
  display: grid;
}

.console-sidebar.is-collapsed .sidebar__window-list {
  gap: 8px;
}

.console-sidebar.is-collapsed .window-chip {
  padding: 10px;
}

.console-sidebar.is-collapsed .window-chip__preview,
.console-sidebar.is-collapsed .window-chip__footer,
.console-sidebar.is-collapsed .window-chip__queue {
  display: none;
}

.console-sidebar.is-collapsed .window-chip__title {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.console-sidebar.is-collapsed .window-chip__meta {
  gap: 6px;
}

.console-sidebar.is-collapsed .window-chip__meta span:last-child,
.console-sidebar.is-collapsed .sidebar__section-head span {
  display: none;
}

@media (max-width: 879px) {
  body::after {
    inset: 10px;
    border-radius: 22px;
  }

  .console-shell {
    gap: 12px;
  }

  .console-sidebar,
  .console-header,
  .window-stage,
  .inspector-panel {
    border-radius: 24px;
  }

  .console-header__actions,
  .sidebar__actions,
  .inspector-panel__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .console-header__actions {
    width: 100%;
  }

  .console-header__actions .ghost-button,
  .console-header__actions .accent-button,
  .sidebar__actions .ghost-button,
  .sidebar__actions .accent-button,
  .sidebar__actions .pill-button,
  .inspector-panel__actions .ghost-button {
    width: 100%;
  }

  .sidebar__filter-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 1080px) {
  .console-shell {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .console-sidebar.is-collapsed {
    width: 96px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .console-sidebar.is-collapsed + .console-main {
    min-width: 0;
  }

  .console-body {
    grid-template-columns: minmax(0, 1fr) 236px;
  }
}

.console-shell--backend {
  width: 100%;
  max-width: none !important;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 0;
  padding: 0 !important;
  background:
    radial-gradient(circle at top right, rgba(31, 111, 235, 0.08), transparent 24%),
    linear-gradient(180deg, #f4f7fb 0%, #edf2f7 52%, #e8edf3 100%);
}

.console-sidebar--admin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 16px;
  padding: 18px 14px;
  border-radius: 0;
  border: 0;
  border-right: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: none;
  background:
    linear-gradient(180deg, rgba(12, 20, 36, 0.98), rgba(15, 23, 42, 0.98)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02));
  color: #e5ecf6;
}

.sidebar-admin__brand,
.sidebar-admin__section,
.sidebar-admin__footer {
  display: grid;
  gap: 10px;
}

.sidebar-admin__eyebrow,
.section-header__eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sidebar-admin__eyebrow {
  color: rgba(148, 163, 184, 0.82);
}

.sidebar-admin__brand h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.05em;
  color: #f8fbff;
}

.sidebar-admin__brand p {
  margin: 0;
  color: rgba(203, 213, 225, 0.78);
  font-size: 13px;
  line-height: 1.6;
}

.sidebar-admin__create {
  width: 100%;
  min-height: 44px;
}

.sidebar-menu {
  display: grid;
  gap: 8px;
}

.sidebar-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.08);
  color: rgba(226, 232, 240, 0.86);
}

.sidebar-menu__item strong {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 700;
}

.sidebar-menu__item.is-active {
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.2), rgba(59, 130, 246, 0.14));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.24);
}

.sidebar-admin__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: rgba(203, 213, 225, 0.74);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-admin__windows {
  display: grid;
  gap: 8px;
  align-content: start;
}

.sidebar-window {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.06);
  color: #dbe7f5;
  text-align: left;
}

.sidebar-window.is-active {
  background: rgba(31, 111, 235, 0.18);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.24);
}

.sidebar-window__dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.6);
}

.sidebar-window__dot.is-running {
  background: #fb7185;
  box-shadow: 0 0 0 6px rgba(251, 113, 133, 0.12);
}

.sidebar-window__body {
  display: grid;
  gap: 4px;
}

.sidebar-window__body strong {
  font-size: 13px;
  font-weight: 700;
  color: #f8fbff;
}

.sidebar-window__body span {
  color: rgba(191, 219, 254, 0.76);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}

.sidebar-admin__empty {
  padding: 12px;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.06);
  color: rgba(203, 213, 225, 0.72);
  font-size: 12px;
  line-height: 1.6;
}

.sidebar-admin__footer {
  align-content: end;
}

.sidebar-admin__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  color: rgba(226, 232, 240, 0.82);
  font-size: 12px;
}

.sidebar-admin__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
}

.sidebar-admin__status-dot.is-waiting {
  background: #f59e0b;
}

.sidebar-admin__logout {
  width: 100%;
  min-height: 40px;
  color: #e5ecf6;
  background: rgba(148, 163, 184, 0.08);
}

.console-main--backend {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 14px 16px;
}

.console-header--admin,
.section-header,
.admin-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.console-header--admin {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.console-header__compact,
.console-header__meta-row {
  display: grid;
  gap: 10px;
}

.console-header__meta-row {
  grid-template-columns: repeat(auto-fit, minmax(160px, max-content));
}

.console-header__actions--compact {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(19, 32, 51, 0.05);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.rename-form--inline {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.rename-form--inline .input-shell {
  min-width: min(420px, 100%);
  flex: 1 1 320px;
}

.command-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: calc(100vh - 96px);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.22);
  background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.16);
}

.command-shell__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.92);
  color: rgba(191, 219, 254, 0.9);
  font-size: 12px;
}

.command-shell__path,
.command-shell__session {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-terminal {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 20%),
    linear-gradient(180deg, #09101d 0%, #0b1220 100%);
}

.terminal-entry {
  display: grid;
  gap: 6px;
}

.terminal-entry__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(148, 163, 184, 0.88);
  font-size: 12px;
}

.terminal-entry__prompt {
  letter-spacing: 0.02em;
}

.terminal-entry--user .terminal-entry__prompt {
  color: #f59e0b;
}

.terminal-entry--assistant .terminal-entry__prompt {
  color: #60a5fa;
}

.terminal-entry--status .terminal-entry__prompt {
  color: #2dd4bf;
}

.terminal-entry--system .terminal-entry__prompt {
  color: #fb7185;
}

.terminal-entry__body {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(148, 163, 184, 0.08);
  color: #e6eefb;
}

.terminal-entry--assistant .terminal-entry__body {
  background: rgba(59, 130, 246, 0.08);
}

.terminal-entry--user .terminal-entry__body {
  background: rgba(245, 158, 11, 0.12);
}

.terminal-entry--status .terminal-entry__body {
  background: rgba(45, 212, 191, 0.1);
}

.terminal-entry--system .terminal-entry__body {
  background: rgba(251, 113, 133, 0.12);
}

.terminal-placeholder {
  display: grid;
  gap: 10px;
  align-content: center;
  min-height: 260px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.05);
  color: rgba(226, 232, 240, 0.82);
  line-height: 1.7;
}

.terminal-placeholder p {
  margin: 0;
}

.command-composer {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.96);
}

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

.command-composer__prompt {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  font-size: 13px;
}

.command-composer textarea {
  width: 100%;
  min-height: 132px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: #09111f;
  color: #eff6ff;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}

.command-composer__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.command-composer__hint {
  color: rgba(191, 219, 254, 0.78);
  font-size: 12px;
}

.command-composer__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
}

.section-header__eyebrow {
  color: var(--muted);
}

.section-header h2,
.admin-card h3 {
  margin: 0;
  letter-spacing: -0.04em;
}

.section-header h2 {
  font-size: 28px;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.admin-card {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.admin-card--wide {
  grid-column: 1 / -1;
}

.admin-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.path-form--admin {
  padding: 0;
  background: transparent;
}

.admin-list {
  display: grid;
  gap: 8px;
}

.admin-list__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(19, 32, 51, 0.04);
  text-align: left;
}

.admin-list__row.is-active {
  background: rgba(31, 111, 235, 0.08);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 235, 0.16);
}

.admin-list__primary,
.admin-list__meta {
  display: grid;
  gap: 4px;
}

.admin-list__primary strong {
  color: var(--text);
  font-size: 14px;
}

.admin-list__primary span,
.admin-list__meta span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}

.admin-list__meta {
  justify-items: end;
}

.admin-list__empty {
  padding: 14px;
  border-radius: 14px;
  background: rgba(19, 32, 51, 0.04);
  color: var(--muted);
  line-height: 1.6;
}

.empty-state--admin {
  min-height: calc(100vh - 32px);
}

@media (max-width: 960px) {
  .console-shell--backend {
    grid-template-columns: minmax(0, 1fr);
  }

  .console-sidebar--admin {
    position: static;
    height: auto;
    grid-template-rows: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  }

  .console-main--backend {
    min-height: auto;
  }

  .command-shell {
    min-height: 72vh;
  }

  .admin-grid,
  .command-composer__input {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-card--wide {
    grid-column: auto;
  }

  .admin-list__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-list__meta {
    justify-items: start;
  }
}
