:root {
  color-scheme: dark;
  --bg: #070908;
  --bg-2: #0b0e0c;
  --panel: #101412;
  --panel-2: #161b18;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f5f8f3;
  --muted: #a9b4ab;
  --soft: #dbe2da;
  --green: #ff9e64;
  --green-2: #f97316;
  --amber: #f3c15c;
  --blue: #8eb8ff;
  --red: #ff7c7c;
  --shadow: rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

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

p,
h1,
h2,
h3,
a,
button,
span,
strong,
label {
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.topbar {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(7, 9, 8, 0.76);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.brand,
.nav,
.top-actions,
.hero-actions,
.hero-metrics,
.footer,
.form-row,
.terminal-top,
.terminal-header,
.workspace-row,
.meter,
.table-row,
.app-header {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 900;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(249, 115, 22, 0.42);
  border-radius: 8px;
  background: rgba(249, 115, 22, 0.12);
  color: var(--green);
  font-size: 13px;
}

.nav {
  justify-content: center;
  gap: 26px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  min-width: 0;
  text-align: center;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
}

.top-actions {
  gap: 10px;
}

.ghost-button,
.solid-button,
.primary-cta,
.secondary-cta,
.form-submit,
.price-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 17px;
  color: var(--text);
  max-width: 100%;
  text-align: center;
  white-space: normal;
}

.ghost-button,
.secondary-cta {
  background: rgba(255, 255, 255, 0.06);
}

.solid-button,
.primary-cta,
.form-submit,
.price-card a {
  background: var(--green);
  color: #06100b;
  border-color: transparent;
  font-weight: 900;
}

.ghost-button:hover,
.secondary-cta:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.1);
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  align-items: center;
  padding: 104px clamp(20px, 5vw, 72px) 58px;
  overflow: hidden;
}

.hero-media,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.84;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(7, 9, 8, 0.99) 0%, rgba(7, 9, 8, 0.86) 31%, rgba(7, 9, 8, 0.25) 70%, rgba(7, 9, 8, 0.72) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(7, 9, 8, 0) 28%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(54px, 7vw, 118px);
  line-height: 0.92;
  overflow-wrap: anywhere;
}

.hero-copy {
  max-width: 620px;
  margin: 26px 0 0;
  color: var(--soft);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.45;
}

.hero-actions {
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.primary-cta,
.secondary-cta {
  min-height: 52px;
  padding-inline: 22px;
}

.hero-metrics {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-metrics span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  max-width: 100%;
  white-space: normal;
}

.hero-metrics strong {
  color: var(--amber);
}

.wide-section,
.feature-band,
.page-main {
  padding: 78px clamp(20px, 5vw, 72px);
}

.wide-section {
  background: var(--bg-2);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.section-head {
  max-width: 880px;
  margin-bottom: 34px;
}

.section-head h2,
.page-hero h1,
.auth-card h1,
.app-header h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.03;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.8fr);
  gap: clamp(22px, 4vw, 54px);
  align-items: stretch;
}

.terminal-preview,
.terminal-window,
.panel,
.feature,
.price-card,
.workflow-grid article,
.security-list article,
.system-map > div,
.auth-card,
.stat-grid article,
.runtime-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 60px var(--shadow);
  min-width: 0;
}

.terminal-top {
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.terminal-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
}

.terminal-top span:nth-child(2) {
  background: var(--amber);
}

.terminal-top span:nth-child(3) {
  background: var(--green);
}

.terminal-top strong {
  margin-left: 8px;
  min-width: 0;
}

pre {
  margin: 0;
  padding: 24px;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #d7ffe7;
  font: 15px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.copy-stack {
  display: grid;
  gap: 14px;
}

.copy-stack article,
.ledger-example {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.copy-stack h3,
.feature h3,
.panel h2,
.runtime-panel h2,
.price-card h2,
.security-list h2,
.workflow-grid h2 {
  margin: 0 0 10px;
}

.copy-stack p,
.feature p,
.panel p,
.price-card li,
.security-list p,
.workflow-grid p,
.system-map p,
.stat-grid p,
.workspace-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.feature-band {
  background: #090b0a;
}

.feature-grid,
.pricing-grid,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature,
.price-card,
.panel,
.stat-grid article,
.runtime-panel {
  padding: 24px;
}

.feature {
  display: block;
}

.icon,
.workflow-grid span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(243, 193, 92, 0.14);
  color: var(--amber);
  font-weight: 900;
  font-size: 13px;
}

.feature h3 {
  margin-top: 20px;
}

.footer {
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(20px, 5vw, 72px);
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.page-main {
  padding-top: 124px;
  min-height: 100vh;
}

.page-hero {
  max-width: 980px;
  margin-bottom: 38px;
}

.page-hero.compact p:last-child {
  max-width: 700px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
}

.workflow-grid,
.security-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.workflow-grid article,
.security-list article,
.system-map > div {
  padding: 24px;
}

.workflow-grid span {
  margin-bottom: 20px;
}

.system-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.pricing-grid {
  align-items: stretch;
}

.price-card {
  display: grid;
  gap: 16px;
}

.price-card.featured {
  border-color: rgba(249, 115, 22, 0.5);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.12), var(--panel));
}

.price-card p,
.price-card span {
  margin: 0;
  color: var(--muted);
}

.price-card h2 {
  font-size: clamp(34px, 4vw, 46px);
}

.price-card ul {
  display: grid;
  gap: 10px;
  padding-left: 18px;
}

.ledger-example {
  margin-top: 16px;
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.ledger-row.total {
  border-bottom: 0;
  color: var(--text);
}

.auth-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(7, 9, 8, 0.96), rgba(7, 9, 8, 0.72)),
    url("/assets/cloud-terminal-hero.png") center/cover fixed;
}

.auth-screen {
  display: grid;
  align-content: center;
  gap: 24px;
  min-height: 100vh;
  width: min(520px, calc(100% - 40px));
  margin: 0 auto;
}

.auth-card {
  padding: 28px;
}

.auth-form {
  display: grid;
  gap: 16px;
  padding-top: 22px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-size: 14px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

input:focus {
  border-color: rgba(249, 115, 22, 0.72);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.form-row {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-weight: 600;
  color: var(--muted);
}

.checkline input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  min-height: 17px;
  accent-color: var(--green);
}

.form-submit {
  width: 100%;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--green);
  font-size: 14px;
}

.form-status.is-error {
  color: var(--red);
}

.app-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg-2);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #080a09;
  min-width: 0;
}

.sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.sidebar nav a {
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--muted);
  min-width: 0;
  text-align: left;
}

.sidebar nav a.active,
.sidebar nav a:hover {
  background: rgba(249, 115, 22, 0.12);
  color: var(--text);
}

.sidebar-account {
  display: grid;
  gap: 8px;
  margin-top: 34px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-account span,
.sidebar-account strong {
  overflow-wrap: anywhere;
}

.sidebar-account span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.sidebar-account strong {
  color: var(--soft);
  font-size: 13px;
}

.sidebar-account button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.app-main,
.terminal-main {
  padding: 34px;
  min-width: 0;
}

.app-header {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 24px;
}

.stat-grid article span,
.meter span,
.table-row span {
  color: var(--muted);
}

.stat-grid article strong {
  display: block;
  margin: 12px 0 8px;
  font-size: clamp(28px, 4vw, 36px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 16px;
}

.table-row,
.meter {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.workspace-row {
  gap: 14px;
  padding-top: 10px;
}

.workspace-row a {
  margin-left: auto;
  color: var(--green);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(249, 115, 22, 0.12);
}

.terminal-main {
  display: grid;
  grid-template-rows: auto 1fr;
}

.terminal-header {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.terminal-header div {
  display: grid;
  gap: 4px;
}

.terminal-header span {
  color: var(--muted);
}

.terminal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 310px);
  gap: 16px;
}

.terminal-window.large {
  min-height: 620px;
}

.live-terminal {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  outline: none;
}

.live-terminal:focus {
  border-color: rgba(249, 115, 22, 0.7);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12), 0 24px 60px var(--shadow);
}

.terminal-output {
  min-height: 0;
  max-height: 560px;
  overflow: auto;
  background: #080b09;
}

.terminal-input-hint {
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
}

.terminal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.runtime-panel {
  align-self: start;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .nav {
    display: none;
  }

  .split-layout,
  .system-map,
  .dashboard-grid,
  .terminal-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .pricing-grid,
  .workflow-grid,
  .security-list,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .app-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .sidebar nav a {
    text-align: center;
  }

  .sidebar-account {
    margin-top: 18px;
  }
}

@media (max-width: 620px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
    min-height: 66px;
    gap: 12px;
  }

  .top-actions {
    justify-content: stretch;
    width: 100%;
  }

  .top-actions a {
    flex: 1 1 0;
  }

  .brand span:last-child {
    display: none;
  }

  .top-actions {
    gap: 8px;
  }

  .ghost-button,
  .solid-button {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 14px;
  }

  h1 {
    font-size: clamp(42px, 14vw, 62px);
    line-height: 0.98;
  }

  .section-head h2,
  .page-hero h1,
  .auth-card h1,
  .app-header h1 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .hero {
    min-height: 86vh;
    padding-top: 92px;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(7, 9, 8, 0.99), rgba(7, 9, 8, 0.76)),
      linear-gradient(0deg, var(--bg) 0%, rgba(7, 9, 8, 0) 36%);
  }

  .primary-cta,
  .secondary-cta {
    width: 100%;
  }

  .hero-metrics span {
    width: 100%;
  }

  .wide-section,
  .feature-band,
  .page-main,
  .app-main,
  .terminal-main {
    padding: 54px 18px;
  }

  .page-main {
    padding-top: 96px;
  }

  .auth-screen {
    width: min(100% - 28px, 520px);
  }

  .auth-card,
  .feature,
  .price-card,
  .panel,
  .stat-grid article,
  .runtime-panel,
  .workflow-grid article,
  .security-list article,
  .system-map > div {
    padding: 20px;
  }

  pre {
    padding: 18px;
    font-size: 13px;
  }

  .sidebar nav {
    grid-template-columns: 1fr 1fr;
  }

  .terminal-window.large {
    min-height: 460px;
  }

  .footer,
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* xterm.js live terminal mount */
.terminal-mount {
  min-height: 0;
  height: 100%;
  padding: 8px 10px 4px;
  background: #0b0f14;
  overflow: hidden;
}
.terminal-mount .xterm,
.terminal-mount .xterm .xterm-viewport,
.terminal-mount .xterm .xterm-screen {
  height: 100% !important;
}
.terminal-mount .xterm .xterm-viewport {
  overflow-y: auto;
}

/* ===== Bash27 chat interface ===== */
.chat-main {
  height: 100vh;
  box-sizing: border-box;
  padding: 24px 34px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  min-width: 0;
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.chat-header strong {
  font-size: 18px;
}
.chat-header span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.chat-log {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.chat-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}
.chat-row-user {
  align-self: flex-end;
  align-items: flex-end;
}
.chat-row-bot {
  align-self: flex-start;
  align-items: flex-start;
}
.chat-who {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green);
  margin: 0 0 4px 6px;
}
.chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  max-width: 100%;
}
.chat-row-user .chat-bubble {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.20), rgba(249, 115, 22, 0.10));
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-bottom-right-radius: 4px;
  color: var(--text);
}
.chat-row-bot .chat-bubble {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  color: var(--soft);
}
.chat-bubble.is-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  background: #0b0f0d;
  overflow-x: auto;
}
.chat-bubble.is-error {
  border-color: rgba(255, 120, 120, 0.5);
  color: #ffb4b4;
}
.chat-bubble.is-muted {
  color: var(--muted);
  font-style: italic;
  background: transparent;
  border-style: dashed;
}
.chat-bubble.is-pending {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.chat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: chatPulse 1.1s infinite ease-in-out;
}
.chat-dot:nth-child(2) { animation-delay: 0.18s; }
.chat-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes chatPulse {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}
.chat-composer {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.chat-composer textarea {
  flex: 1;
  resize: none;
  max-height: 160px;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
}
.chat-composer textarea:focus {
  outline: none;
  border-color: rgba(249, 115, 22, 0.6);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}
.chat-composer .solid-button {
  min-height: 46px;
}
.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 980px) {
  .chat-main {
    padding: 18px;
  }
  .chat-row {
    max-width: 92%;
  }
}

/* ===== Bash27 workspace console ===== */
.sidebar { overflow-y: auto; }
.ws-menu { margin-top: 20px; display: grid; gap: 2px; }
.ws-group {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 12px 6px 4px;
}
.ws-item {
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
}
.ws-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.ws-item.active { background: rgba(249, 115, 22, 0.14); color: var(--text); }

.ws-main {
  height: 100vh;
  box-sizing: border-box;
  padding: 20px 28px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}
.ws-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.ws-header strong { font-size: 18px; }
.ws-header span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }

.ws-panel { min-height: 0; }
.ws-panel[hidden] { display: none; }
.ws-pad { overflow-y: auto; padding-right: 4px; }

.chat-panel { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 14px; min-height: 0; }
.chat-log { min-height: 0; }

/* Files */
.files-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
}
.file-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.file-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.file-item:hover { background: rgba(255, 255, 255, 0.05); }
.file-item.active { background: rgba(249, 115, 22, 0.14); }
.file-path { overflow-wrap: anywhere; }
.file-size { color: var(--muted); font-size: 11px; white-space: nowrap; }
.file-loading { color: var(--muted); padding: 8px; }
.file-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}
.file-view-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--soft);
}
.file-view-body {
  margin: 0;
  padding: 14px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
  min-height: 0;
}

/* Data tables */
.data-table-wrap { margin-bottom: 22px; }
.data-table-name { font-size: 14px; margin: 0 0 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th,
.data-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.data-table th {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.data-empty { color: var(--muted); font-style: italic; }

/* Endpoints */
.endpoint-row {
  display: grid;
  grid-template-columns: 56px minmax(170px, 320px) 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--panel);
}
.endpoint-method {
  font-weight: 800;
  font-size: 11px;
  text-align: center;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
}
.method-get { color: #7fd3a0; }
.method-post { color: #7db8ff; }
.method-ws { color: #d8a0ff; }
.method-delete { color: #ff9b9b; }
.endpoint-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.endpoint-desc { color: var(--muted); font-size: 13px; }
.endpoint-auth { font-size: 11px; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.auth-yes { background: rgba(249, 115, 22, 0.16); color: var(--green); }
.auth-no { background: rgba(255, 255, 255, 0.07); color: var(--muted); }

/* Account + connect cards */
.account-card,
.connect-card {
  max-width: 560px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 22px;
}
.account-card h2,
.connect-card h2 { margin: 0 0 14px; font-size: 18px; }
.account-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 16px;
  margin-bottom: 18px;
}
.account-key { color: var(--muted); font-size: 13px; }
.account-val { overflow-wrap: anywhere; font-size: 13px; }
.field-label { display: block; color: var(--muted); font-size: 12px; margin: 12px 0 4px; }
.field-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.field-input:focus { outline: none; border-color: rgba(249, 115, 22, 0.6); }
.connect-status { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.connect-status.is-on { color: var(--green); }
.connect-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.connect-msg { color: var(--muted); font-size: 12px; }
.connect-hint { color: var(--muted); font-size: 12px; margin-top: 14px; line-height: 1.5; }
.panel-loading { color: var(--muted); }
.panel-error { color: #ffb4b4; }

/* ===== Workspace: light + compact theme (scoped to /chat/ only) ===== */
body[data-workspace] {
  --bg: #ffffff;
  --bg-2: #f4f6f7;
  --panel: #ffffff;
  --panel-2: #f1f4f3;
  --line: rgba(15, 30, 25, 0.12);
  --line-strong: rgba(15, 30, 25, 0.22);
  --text: #10201a;
  --muted: #5d6f66;
  --soft: #1f2d27;
  --green: #ea580c;
  --green-2: #c2410c;
  --shadow: rgba(15, 40, 30, 0.08);
  color-scheme: light;
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
}
body[data-workspace].app-body { grid-template-columns: 200px minmax(0, 1fr); }
body[data-workspace] .sidebar { background: #f7f9f8; padding: 16px; }
body[data-workspace] .brand { font-size: 14px; }
body[data-workspace] .sidebar-account { margin-top: 18px; padding: 10px; background: rgba(15, 40, 30, 0.04); }
body[data-workspace] .sidebar-account button { background: rgba(15, 40, 30, 0.05); color: var(--text); }
body[data-workspace] .ws-menu { margin-top: 14px; }
body[data-workspace] .ws-group { font-size: 10px; margin: 9px 6px 3px; }
body[data-workspace] .ws-item { padding: 6px 10px; font-size: 12px; }
body[data-workspace] .ws-item:hover { background: rgba(15, 40, 30, 0.06); color: var(--text); }
body[data-workspace] .ws-item.active { background: rgba(234, 88, 12, 0.14); color: var(--green-2); }
body[data-workspace] .ws-main { padding: 14px 18px; gap: 10px; }
body[data-workspace] .ws-header strong { font-size: 15px; }
body[data-workspace] .ws-header span { font-size: 11px; }
body[data-workspace] .ghost-button { background: rgba(15, 40, 30, 0.05); color: var(--text); min-height: 34px; padding: 0 12px; font-size: 12px; }
body[data-workspace] .solid-button { color: #ffffff; min-height: 34px; padding: 0 14px; font-size: 12px; }
body[data-workspace] .chat-log { padding: 12px; gap: 10px; border-color: var(--line); background: var(--panel); }
body[data-workspace] .chat-bubble { font-size: 13px; padding: 8px 11px; }
body[data-workspace] .chat-row { max-width: 86%; }
body[data-workspace] .chat-row-user .chat-bubble { background: #fff0e6; border-color: rgba(234, 88, 12, 0.35); color: #7c2d12; }
body[data-workspace] .chat-row-bot .chat-bubble { background: #f1f4f3; border-color: var(--line); color: var(--soft); }
body[data-workspace] .chat-bubble.is-mono { background: #f4f6f5; font-size: 12px; }
body[data-workspace] .chat-bubble.is-error { color: #b42318; border-color: rgba(180, 35, 24, 0.4); }
body[data-workspace] .chat-who { color: var(--green-2); font-size: 10px; }
body[data-workspace] .chat-composer textarea { background: #ffffff; color: var(--text); font-size: 13px; min-height: 40px; }
body[data-workspace] .file-list,
body[data-workspace] .file-view { background: var(--panel); border-color: var(--line); }
body[data-workspace] .file-item { font-size: 12px; }
body[data-workspace] .file-item:hover { background: rgba(15, 40, 30, 0.05); }
body[data-workspace] .file-item.active { background: rgba(234, 88, 12, 0.14); }
body[data-workspace] .file-view-body { background: #f7f9f8; font-size: 12px; }
body[data-workspace] .data-table { font-size: 12px; }
body[data-workspace] .endpoint-row { padding: 7px 10px; background: var(--panel); }
body[data-workspace] .endpoint-desc { font-size: 12px; }
body[data-workspace] .endpoint-method { background: rgba(15, 40, 30, 0.07); }
body[data-workspace] .method-get { color: #ea580c; }
body[data-workspace] .method-post { color: #2563eb; }
body[data-workspace] .method-ws { color: #7c3aed; }
body[data-workspace] .auth-no { background: rgba(15, 40, 30, 0.06); }
body[data-workspace] .account-card,
body[data-workspace] .connect-card { padding: 16px; }
body[data-workspace] .account-card h2,
body[data-workspace] .connect-card h2 { font-size: 15px; }
body[data-workspace] .field-input { background: #ffffff; }

/* sidebar-account pinned to bottom (workspace) */
body[data-workspace] .sidebar { display: flex; flex-direction: column; }
body[data-workspace] .sidebar-account { margin-top: auto; }

/* HTTP method colors stay semantic (not brand accent) */
.method-get { color: #7fd3a0; }
body[data-workspace] .method-get { color: #15803d; }

/* ===== Bash27 logo ===== */
.brand-mark {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: url("/assets/logo.svg?v=hex2") center / contain no-repeat;
  filter: drop-shadow(0 4px 9px rgba(234, 88, 12, 0.38));
  color: transparent;
  font-size: 0;
}
.brand > span:last-child {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.2px;
}
body[data-workspace] .brand-mark { filter: drop-shadow(0 3px 8px rgba(234, 88, 12, 0.3)); }
