:root {
  --bg-top: #edf3f2;
  --bg-bottom: #dfe7e3;
  --surface: rgba(255, 252, 247, 0.82);
  --surface-strong: rgba(255, 252, 247, 0.94);
  --surface-alt: rgba(239, 244, 239, 0.86);
  --ink: #10211c;
  --muted: #5e6f69;
  --line: rgba(38, 67, 57, 0.12);
  --line-strong: rgba(11, 93, 69, 0.22);
  --brand: #0b5d45;
  --brand-strong: #063f30;
  --brand-soft: rgba(11, 93, 69, 0.12);
  --accent: #cf6b35;
  --accent-soft: rgba(207, 107, 53, 0.14);
  --success: #157e52;
  --success-soft: rgba(21, 126, 82, 0.14);
  --danger: #b6434d;
  --danger-soft: rgba(182, 67, 77, 0.14);
  --terminal: #0b1714;
  --terminal-line: rgba(255, 255, 255, 0.06);
  --shadow: 0 28px 72px rgba(45, 63, 57, 0.16);
  --shadow-soft: 0 16px 36px rgba(45, 63, 57, 0.11);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --workspace-offset: 150px;
  --sans: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --display: "Sora", "Noto Sans SC", "PingFang SC", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 10%, rgba(11, 93, 69, 0.13), transparent 0 22%),
    radial-gradient(circle at 92% 14%, rgba(207, 107, 53, 0.11), transparent 0 20%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  color: var(--ink);
  font-family: var(--sans);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(16, 33, 28, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 33, 28, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 58%, transparent 100%);
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p,
pre {
  margin: 0;
}

code,
pre {
  font-family: var(--mono);
}

.app-shell {
  width: min(1600px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 26px;
}

.workspace-shell {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.workspace-shell[hidden],
.login-shell[hidden] {
  display: none;
}

.login-shell {
  min-height: calc(100vh - 26px);
  display: grid;
  place-items: center;
}

.login-card,
.topbar,
.panel,
.message-card,
.node-card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.login-card::after,
.topbar::after,
.panel::after,
.message-card::after,
.node-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), transparent 28%, transparent 72%, rgba(11, 93, 69, 0.12));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.login-card {
  width: min(100%, 620px);
  padding: 42px;
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.97), rgba(241, 246, 241, 0.9));
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.brand-logo {
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(11, 93, 69, 0.16);
}

.brand-lockup-topbar {
  flex: 1;
  min-width: 0;
}

.brand-logo-topbar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  box-shadow: 0 14px 28px rgba(11, 93, 69, 0.14);
}

.login-form,
.node-config-form,
.create-node-form,
.quota-body {
  display: grid;
  gap: 16px;
}

.login-form {
  margin-top: 28px;
}

.auth-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.switch-chip {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.switch-chip.is-active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: #f7fbf8;
  box-shadow: 0 10px 24px rgba(11, 93, 69, 0.18);
}

.login-field {
  display: grid;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.login-field input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.login-field input {
  min-height: 52px;
  padding: 0 16px;
}

.login-field input:focus,
textarea:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(11, 93, 69, 0.12);
}

.login-actions {
  display: grid;
  gap: 10px;
}

.login-error {
  color: var(--danger);
  font-size: 14px;
  line-height: 1.7;
}

.eyebrow,
.panel-kicker,
.hint,
.node-mode,
.bundle-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
h3,
.metric-chip strong,
.bundle-block strong {
  font-family: var(--display);
  letter-spacing: -0.04em;
}

h1 {
  margin-top: 4px;
  font-size: clamp(34px, 3vw, 48px);
  line-height: 1.12;
  padding-bottom: 0.08em;
  background: linear-gradient(135deg, #081813 0%, var(--brand) 54%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar-copy {
  max-width: 62ch;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.75;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.95), rgba(239, 244, 239, 0.82));
}

.topbar-copy-block {
  flex: 1;
  min-width: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.pill-badge,
.status-badge,
.node-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
}

.pill-badge {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(11, 93, 69, 0.12);
  color: var(--brand-strong);
}

.layout {
  display: grid;
  gap: 18px;
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: visible;
  align-items: start;
}

.dashboard-layout {
  grid-template-columns: minmax(290px, 340px) minmax(0, 1fr);
}

.left-rail {
  min-height: 0;
}

.workspace-main {
  display: grid;
  grid-template-rows: auto auto;
  gap: 18px;
  min-height: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(239, 244, 239, 0.82));
}

.panel-header,
.chat-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel-header {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
}

.compact-header {
  padding-top: 16px;
  padding-bottom: 14px;
}

.section-title {
  display: grid;
  gap: 4px;
}

.server-panel,
.command-panel,
.detail-dock {
  min-height: 0;
}

.command-panel {
  min-height: 760px;
}

.node-list {
  flex: 1;
  min-height: 220px;
  max-height: min(62vh, 760px);
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  overscroll-behavior: contain;
}

.user-summary-card {
  display: grid;
  gap: 10px;
  margin: 18px 20px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 244, 239, 0.88));
}

.user-summary-meta {
  color: var(--muted);
  line-height: 1.7;
}

.node-card {
  width: 100%;
  text-align: left;
  border-radius: 20px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(235, 243, 238, 0.9));
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.node-card:hover {
  transform: translateY(-1px);
}

.node-card.is-selected {
  border-color: rgba(11, 93, 69, 0.24);
  box-shadow: 0 20px 44px rgba(11, 93, 69, 0.14);
}

.node-card-head,
.node-card-meta,
.message-meta,
.quota-card-head,
.detail-header-actions,
.file-upload-bar,
.file-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.node-card-head {
  align-items: start;
}

.node-card h3 {
  margin-top: 8px;
  font-size: 22px;
}

.node-description {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.65;
}

.node-card-meta {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.node-status.online,
.status-badge.done {
  background: var(--success-soft);
  border-color: rgba(21, 126, 82, 0.18);
  color: var(--success);
}

.node-status.busy,
.status-badge.busy {
  background: var(--accent-soft);
  border-color: rgba(207, 107, 53, 0.2);
  color: var(--accent);
}

.node-status.offline,
.status-badge.idle {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(11, 93, 69, 0.12);
  color: var(--brand-strong);
}

.node-status.disabled,
.status-badge.error {
  background: var(--danger-soft);
  border-color: rgba(182, 67, 77, 0.18);
  color: var(--danger);
}

.create-node-form,
.node-config-form {
  display: grid;
  gap: 16px;
}

.admin-only-block[hidden],
.node-config-form[hidden],
.read-only-card[hidden],
.bundle-card[hidden] {
  display: none;
}

.create-node-box,
.config-box {
  padding: 18px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.78), rgba(236, 244, 238, 0.92));
}

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

.hero-panel {
  display: grid;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(248, 252, 250, 0.88), rgba(236, 244, 239, 0.82));
}

.hero-summary,
.hero-meta,
.message-node,
.empty-chat,
.empty-state,
.empty-state-block p,
.form-state,
.quota-state,
.redeem-state,
.bundle-block span,
.metric-chip p,
.metric-chip span {
  color: var(--muted);
}

.hero-summary,
.quota-state,
.redeem-state,
.form-state {
  line-height: 1.7;
}

.hero-meta {
  margin-top: 8px;
  font-size: 13px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.hero-card,
.metric-chip,
.quota-card,
.bundle-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(239, 244, 239, 0.88));
  box-shadow: var(--shadow-soft);
}

.hero-card,
.metric-chip {
  padding: 16px;
}

.hero-card {
  min-height: 120px;
}

.hero-card strong,
.metric-chip strong,
.bundle-block strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.28;
  color: var(--ink);
}

.hero-card strong {
  padding-top: 2px;
  font-family: var(--sans);
  letter-spacing: 0;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.chat-form {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.74), rgba(236, 244, 238, 0.82));
}

.chat-form.is-busy {
  background: linear-gradient(180deg, rgba(244, 249, 246, 0.9), rgba(233, 243, 237, 0.86));
}

#messageInput {
  min-height: 128px;
  max-height: 164px;
}

textarea {
  resize: vertical;
  padding: 16px 18px;
  line-height: 1.75;
}

.composer-meta {
  display: grid;
  gap: 6px;
}

.composer-state {
  font-size: 13px;
  line-height: 1.6;
}

.composer-state.idle,
.quota-state.idle,
.quota-state.loading,
.redeem-state.idle,
.redeem-state.loading,
.form-state.idle,
.form-state.loading {
  color: var(--brand);
}

.composer-state.busy {
  color: var(--accent);
}

.composer-state.done,
.quota-state.success,
.redeem-state.success,
.form-state.success {
  color: var(--success);
}

.composer-state.error,
.quota-state.error,
.redeem-state.error,
.form-state.error {
  color: var(--danger);
}

.quota-state.warning {
  color: #9a6700;
}

.primary-button,
.ghost-button {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #ffffff;
  box-shadow: 0 18px 34px rgba(11, 93, 69, 0.22);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-color: var(--line);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.56;
}

.chat-messages,
.terminal-log {
  overflow: auto;
}

.chat-messages {
  min-height: 480px;
  max-height: min(72vh, 1080px);
  flex: 1;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 14px;
  padding: 20px 20px 24px;
}

.message-item {
  border: 1px solid var(--line);
  min-height: 88px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 246, 242, 0.92));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.message-item.user {
  border-color: rgba(21, 126, 82, 0.16);
}

.message-item.assistant {
  border-color: rgba(11, 93, 69, 0.12);
}

.message-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  min-height: 88px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.message-summary::-webkit-details-marker {
  display: none;
}

.message-summary-main,
.message-summary-side {
  display: grid;
  gap: 6px;
}

.message-summary-side {
  justify-items: end;
  align-content: start;
  min-width: 84px;
}

.message-label,
.message-time,
.message-preview,
.message-toggle {
  font-size: 13px;
}

.message-label {
  font-weight: 700;
  color: var(--brand-strong);
}

.message-toggle {
  color: var(--muted);
}

.message-preview {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.message-content {
  color: var(--ink);
  max-height: min(46vh, 520px);
  overflow: auto;
  padding: 16px 18px 18px;
  line-height: 1.8;
  font-size: 14px;
  white-space: pre-wrap;
  border-top: 1px solid rgba(11, 93, 69, 0.08);
}

.message-item:not([open]) .message-content {
  display: none;
}

.bundle-card {
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
  margin: 0;
}

.read-only-card {
  margin-top: 0;
}

.detail-dock {
  overflow: hidden;
}

.detail-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(248, 252, 250, 0.94), rgba(236, 244, 239, 0.9));
}

.detail-tab {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(11, 93, 69, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-weight: 800;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

.detail-tab:hover {
  transform: translateY(-1px);
}

.detail-tab.is-active {
  border-color: rgba(11, 93, 69, 0.24);
  background: linear-gradient(135deg, rgba(11, 93, 69, 0.14), rgba(6, 63, 48, 0.08));
  color: var(--brand-strong);
}

.detail-panel {
  display: none;
  min-height: 0;
}

.detail-panel.is-active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.detail-panel-scroll {
  flex: 1;
  min-height: 420px;
  overflow: auto;
  display: grid;
  gap: 18px;
  padding: 18px 20px 20px;
}

.file-panel-body {
  flex: 1;
  min-height: 520px;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(320px, 1fr);
  gap: 12px;
  padding: 18px 20px 20px;
}

.file-toolbar {
  display: grid;
  gap: 14px;
}

.file-path-field {
  gap: 8px;
}

.file-path-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.file-upload-bar {
  flex-wrap: wrap;
}

.file-picker {
  display: grid;
  gap: 8px;
  flex: 1;
  min-width: min(280px, 100%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.file-picker input {
  min-height: 52px;
  width: 100%;
  padding: 10px 14px;
  border: 1px dashed rgba(11, 93, 69, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.file-panel-state {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

.file-selection-bar,
.file-list-head,
.file-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1.5fr) minmax(88px, 0.6fr) minmax(96px, 0.6fr) minmax(170px, 0.9fr) minmax(164px, 0.8fr);
  gap: 10px;
  align-items: center;
}

.file-selection-bar {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.file-select-all,
.file-select-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.file-selection-summary {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 13px;
}

.file-list-head {
  padding: 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.file-panel-state.loading {
  color: var(--brand);
}

.file-panel-state.success {
  color: var(--success);
}

.file-panel-state.error {
  color: var(--danger);
}

.file-list {
  min-height: 320px;
  max-height: 62vh;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
  resize: vertical;
}

.file-row {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 246, 242, 0.92));
  box-shadow: var(--shadow-soft);
}

.file-row.is-selected {
  border-color: rgba(11, 93, 69, 0.28);
  background: linear-gradient(180deg, rgba(229, 244, 237, 0.96), rgba(241, 246, 242, 0.92));
}

.file-row-main {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--ink);
}

.file-row.is-directory .file-row-main {
  cursor: pointer;
}

.file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 56px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.file-name {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.file-meta {
  color: var(--muted);
  font-size: 13px;
}

.file-action-button {
  min-width: 72px;
  min-height: 38px;
  padding: 0 12px;
}

.file-action-button.danger {
  color: var(--danger);
  border-color: rgba(182, 67, 77, 0.18);
  background: rgba(255, 247, 248, 0.9);
}

.bundle-block {
  display: grid;
  gap: 8px;
}

.bundle-block pre {
  margin: 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(8, 24, 19, 0.94);
  color: #d3f1e3;
  overflow: auto;
  white-space: pre-wrap;
}

.bundle-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  width: fit-content;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  text-decoration: none;
  font-weight: 700;
}

.terminal-log {
  flex: 0 0 auto;
  height: clamp(320px, 44vh, 520px);
  min-height: 280px;
  max-height: 78vh;
  padding: 18px 20px 22px;
  background:
    linear-gradient(180deg, rgba(9, 21, 17, 0.98), rgba(11, 23, 20, 1)),
    var(--terminal);
  color: #dbe7e0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.terminal-log-large {
  max-height: 78vh;
}

.terminal-line {
  padding: 8px 10px;
  border-radius: 10px;
  white-space: pre-wrap;
}

.terminal-line + .terminal-line {
  margin-top: 6px;
}

.terminal-line.command {
  color: #ffd798;
  background: var(--terminal-line);
}

.terminal-line.output {
  color: #dbe5df;
}

.terminal-line.system {
  color: #8edfc8;
}

.terminal-line.success {
  color: #67e0a4;
}

.terminal-line.error {
  color: #ff97a5;
}

.quota-body {
  flex: 1;
  min-height: 420px;
  padding: 18px 20px 20px;
  overflow: auto;
}

.quota-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quota-body-large {
  gap: 18px;
}

.quota-card {
  padding: 16px;
}

.quota-card h3 {
  font-size: 18px;
}

.quota-card-head p {
  margin-top: 6px;
}

.redeem-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.redeem-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.redeem-form input:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(11, 93, 69, 0.12);
}

.empty-chat,
.empty-state,
.empty-state-block {
  border: 1px dashed rgba(11, 93, 69, 0.2);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.42);
  line-height: 1.75;
}

.empty-state-block {
  margin: 18px 20px 0;
}

.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;
}

@media (max-width: 1320px) {
  .dashboard-layout {
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .workspace-main {
    grid-template-rows: auto auto;
  }
}

@media (max-width: 1024px) {
  .dashboard-layout,
  .workspace-main {
    grid-template-columns: 1fr;
  }

  .workspace-main {
    grid-template-rows: auto auto;
  }

  .workspace-shell {
    min-height: 0;
  }

  .dashboard-layout {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .node-list,
  .chat-messages,
  .detail-panel-scroll,
  .terminal-log,
  .quota-body {
    min-height: 320px;
    max-height: none;
  }

  .config-grid,
  .hero-grid,
  .quota-summary,
  .file-row-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .file-selection-bar,
  .file-list-head,
  .file-row {
    grid-template-columns: 64px minmax(0, 1fr) minmax(88px, 0.7fr) minmax(88px, 0.7fr);
  }

  .file-selection-summary,
  .file-row-actions {
    grid-column: 2 / -1;
  }

  .file-list-head span:nth-child(5),
  .file-list-head span:nth-child(6) {
    display: none;
  }

  .file-row > .file-meta:nth-of-type(3) {
    display: none;
  }

  .command-panel {
    min-height: 760px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 18px, 100%);
    padding: 12px 0 18px;
  }

  .login-card,
  .topbar,
  .panel {
    border-radius: 24px;
  }

  .login-card,
  .topbar,
  .panel-header,
  .chat-form,
  .terminal-log,
  .bundle-card {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar,
  .topbar-actions,
  .chat-form-actions,
  .chat-form-footer,
  .panel-header,
  .quota-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-logo {
    width: 60px;
    height: 60px;
  }

  .redeem-form {
    grid-template-columns: 1fr;
  }

  .detail-tabs,
  .config-grid,
  .quota-summary {
    grid-template-columns: 1fr;
  }

  .file-path-input-wrap,
  .file-row-main {
    grid-template-columns: 1fr;
  }

  .file-selection-bar,
  .file-list-head,
  .file-row {
    grid-template-columns: 1fr;
  }

  .file-selection-summary,
  .file-row-actions {
    grid-column: auto;
  }

  .file-row-actions,
  .detail-header-actions,
  .file-upload-bar {
    width: 100%;
  }

  .file-list {
    max-height: none;
    resize: none;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .message-card {
    max-width: 100%;
  }

  .message-summary {
    grid-template-columns: 1fr;
  }

  .message-summary-side {
    grid-auto-flow: column;
    justify-content: space-between;
    justify-items: start;
    min-width: 0;
  }

  .terminal-log {
    height: 320px;
    max-height: none;
    resize: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
