*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--gold-light); text-decoration: none; }
a:hover { text-decoration: underline; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--btn-primary-text);
  box-shadow: 0 8px 32px var(--gold-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 40px rgba(245, 166, 35, 0.45);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--gold-dim);
  text-decoration: none;
}

.btn-sm {
  padding: 0.35rem 0.85rem !important;
  font-size: 0.78rem !important;
  border-radius: 999px !important;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--gold-dim);
  color: var(--gold-light);
  border: 1px solid var(--border);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

input, textarea, select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-group { margin-bottom: 1rem; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: var(--danger-bg);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--alert-error-text);
}

.alert-ok {
  background: var(--ok-bg);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--alert-ok-text);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.1rem;
  color: var(--gold-light);
  margin: 0 0 1rem;
}

.cell-muted { color: var(--text-muted); font-size: 0.9rem; }

.muted-list { color: var(--text-muted); line-height: 2; margin: 0; padding-left: 1.25rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

.summary-btn {
  cursor: pointer;
  font-weight: 600;
  color: var(--gold-light);
}

.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

.actions-cell form { display: inline; margin-right: 0.25rem; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
}

.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-backdrop);
}

.modal-panel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  width: min(480px, 92vw);
  box-shadow: var(--shadow);
}

.modal-panel h3 { margin: 0 0 0.75rem; }

.perm-bubble-hint {
  margin: 0 0 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.25);
  color: var(--gold-light);
  font-size: 0.85rem;
}

.perm-bubble-hint.hidden { display: none; }

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Landing */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--landing-nav-bg);
  box-shadow: var(--landing-nav-shadow);
  border-bottom: 1px solid var(--border);
}

.landing-nav .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.landing-nav .brand:hover { text-decoration: none; }

.hex-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold) 0%, #c97800 100%);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: #1a1200;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--landing-hero-bg);
  z-index: 0;
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: var(--hero-grid-opacity);
  background-image: var(--hero-grid-pattern);
  background-size: 56px 100px;
}

.hero-content { position: relative; z-index: 1; max-width: 820px; }

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 1rem 0;
  background: var(--hero-title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2rem;
}

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.features {
  padding: 4rem 1.5rem 6rem;
  max-width: 1100px;
  margin: 0 auto;
}

.features h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  color: var(--gold-light);
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.landing-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* Login — embodied / high-tech layout */
.login-body {
  overflow-x: hidden;
}

.login-page-v2 {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr minmax(380px, 480px);
  position: relative;
  isolation: isolate;
}

@media (max-width: 960px) {
  .login-page-v2 {
    grid-template-columns: 1fr;
  }
  .login-hero-panel { display: none; }
  .login-panel-wrap { padding: 2rem 1.25rem; }
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--landing-login-bg);
  overflow: hidden;
}

.login-bg-grid {
  position: absolute;
  inset: 0;
  opacity: var(--hero-grid-opacity, 0.08);
  background-image: var(--hero-grid-pattern);
  background-size: 56px 100px;
  animation: login-grid-drift 48s linear infinite;
}

@keyframes login-grid-drift {
  from { background-position: 0 0; }
  to { background-position: 56px 100px; }
}

.login-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.login-bg-glow-a {
  width: 55vw;
  height: 45vh;
  top: -10%;
  left: 10%;
  background: rgba(245, 166, 35, 0.14);
}

.login-bg-glow-b {
  width: 40vw;
  height: 40vh;
  bottom: 5%;
  right: 5%;
  background: rgba(61, 139, 253, 0.1);
}

.login-bg-orbit {
  position: absolute;
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  top: 15%;
  left: 8%;
  border: 1px solid rgba(245, 166, 35, 0.12);
  border-radius: 50%;
  animation: login-orbit-spin 32s linear infinite;
}

.login-bg-orbit::before {
  content: "";
  position: absolute;
  inset: 18%;
  border: 1px dashed rgba(61, 139, 253, 0.2);
  border-radius: 50%;
}

@keyframes login-orbit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.login-hero-panel {
  display: flex;
  align-items: center;
  padding: 3rem 3.5rem;
  position: relative;
  z-index: 1;
}

.login-hero-inner {
  max-width: 32rem;
}

.login-brand-lockup,
.brand-lockup.login-brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.login-brand-lockup .hex-logo {
  width: 44px;
  height: 44px;
  font-size: 0.7rem;
}

.login-brand-lockup .brand-text strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.login-brand-lockup .brand-text span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.login-hex-pulse {
  animation: login-hex-pulse 3s ease-in-out infinite;
  box-shadow: 0 0 24px rgba(245, 166, 35, 0.25);
}

@keyframes login-hex-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(245, 166, 35, 0.2); }
  50% { box-shadow: 0 0 36px rgba(245, 166, 35, 0.45); }
}

.login-hero-title {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.login-hero-accent {
  background: linear-gradient(90deg, var(--gold), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-hero-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.75;
  margin: 0 0 1.75rem;
}

.login-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.login-hero-tags li {
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(12, 22, 40, 0.5);
  color: var(--text-secondary);
  backdrop-filter: blur(6px);
}

.login-panel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem 2rem 1rem;
  position: relative;
  z-index: 1;
}

.login-card-glass {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(155deg, rgba(18, 28, 48, 0.92), rgba(10, 16, 28, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 2.25rem 2.5rem;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(245, 166, 35, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.login-card-head {
  margin-bottom: 1.25rem;
}

.login-badge {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  margin-bottom: 0.5rem;
}

.login-card-glass h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: var(--landing-login-bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0.5rem 0 0.25rem;
  font-size: 1.5rem;
}

.login-card .hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.login-card .brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.captcha-group .captcha-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.captcha-group .captcha-row input {
  flex: 1 1 8rem;
  min-width: 0;
}

.captcha-img {
  display: block;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-deep);
  cursor: pointer;
}

.captcha-refresh {
  padding: 0.4rem 0.65rem;
  min-width: 2.25rem;
  font-size: 1.1rem;
  line-height: 1;
}

.login-demo-hint {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--overlay-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.82rem;
}

.login-demo-hint p {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
}

.login-demo-hint ul {
  margin: 0;
  padding-left: 1.1rem;
}

.login-type-fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem 1rem;
  margin: 0 0 1.25rem;
}

.login-type-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  padding-top: 0.25rem;
}

.login-type-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 0 0 auto;
}

.login-type-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  flex: 1 1 auto;
}

.login-form label.login-type-option {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0;
  white-space: nowrap;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
  width: auto;
}

.login-form label.login-type-option span {
  display: inline;
  white-space: nowrap;
}

.login-form label.login-type-option input[type="radio"] {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent);
}

.login-enterprise-only {
  display: none;
  margin-bottom: 1rem;
}

.field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.login-submit {
  width: 100%;
  margin-top: 0.25rem;
}

.login-switch {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.login-switch a {
  color: var(--accent);
  text-decoration: none;
}

.login-footer-link {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
}

.login-footer-link a {
  color: var(--text-muted);
  text-decoration: none;
}

.login-form .form-group {
  margin-bottom: 1rem;
}

.login-demo-hint li {
  margin-bottom: 0.25rem;
}

.login-demo-hint code {
  font-size: 0.8rem;
}

/* Workspace layout */
.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  overflow: hidden;
}

.app-shell-v2 {
  grid-template-columns: 320px minmax(0, 1fr) 320px;
}

.app-shell-v2.app-shell-simple {
  grid-template-columns: 320px minmax(0, 1fr);
}

.workspace-center {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, var(--ambient-1), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 50%, var(--ambient-2), transparent),
    var(--bg-deep);
}

.summary-pane {
  background: var(--summary-bg);
  border-left: 1px solid var(--border-subtle);
  box-shadow: inset 1px 0 0 var(--overlay-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.85rem 0.9rem 1rem;
}

.summary-pane.collapsed {
  display: none;
}

.app-shell-v2.summary-collapsed {
  grid-template-columns: 320px minmax(0, 1fr);
}

.summary-pane-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}

.summary-pane-title {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

.summary-pane-lead {
  margin: 0.28rem 0 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.summary-tabs {
  display: flex;
  gap: 0.15rem;
  padding: 0.22rem;
  background: var(--overlay-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.summary-tab {
  flex: 1;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.44rem 0.2rem;
  font-size: 0.73rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.summary-tab-label {
  line-height: 1.2;
}

.summary-tab-badge {
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.28rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--gold-light);
  background: var(--gold-dim);
  border: 1px solid var(--border-accent);
}

.summary-tab-badge.hidden {
  display: none;
}

.summary-tab-plan .summary-tab-badge {
  color: var(--stream-live-text);
  background: var(--stream-live-bg);
  border-color: var(--stream-live-border);
}

.summary-tab:hover {
  color: var(--text);
  background: var(--overlay-surface-hover);
}

.summary-tab.active {
  color: var(--gold-light);
  background: var(--gold-dim);
  box-shadow: 0 1px 6px var(--shadow), inset 0 1px 0 var(--overlay-surface);
  font-weight: 600;
}

.summary-tab-plan.active {
  color: var(--stream-live-text);
  background: var(--stream-live-bg);
  box-shadow: 0 1px 6px rgba(37, 99, 235, 0.1), inset 0 1px 0 var(--overlay-surface);
}

.summary-pane-mount-focus {
  animation: summary-mount-pulse 2.4s ease;
}

.mount-focus-banner {
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.65rem;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--gold-light);
  background: var(--gold-dim);
  border: 1px solid var(--border-accent);
}

.mount-focus-banner.hidden { display: none; }

@keyframes summary-mount-pulse {
  0%, 100% { box-shadow: inset 1px 0 0 var(--overlay-surface); }
  15%, 45% { box-shadow: inset 4px 0 0 var(--gold), 0 0 24px var(--gold-glow); }
}

.plan-callout {
  margin-bottom: 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, var(--overlay-surface) 0%, transparent 100%);
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--text-secondary);
  overflow: hidden;
}

.plan-callout-summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

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

.plan-callout-summary-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.plan-callout-body {
  margin: 0;
  padding: 0 0.65rem 0.6rem;
}

.plan-callout-badge {
  display: inline-block;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--stream-live-text);
  background: var(--stream-live-bg);
  border: 1px solid var(--stream-live-border);
  flex-shrink: 0;
}

.summary-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.15rem 0 0.4rem;
}

.summary-section-head-spaced {
  margin-top: 0.85rem;
}

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

.summary-section-count {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--overlay-surface);
  border: 1px solid var(--border-subtle);
}

.summary-section-count.hidden {
  display: none;
}

.summary-section-desc {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.summary-empty-note {
  margin: 0.35rem 0 0;
  font-size: 0.76rem;
}

.summary-live-strip {
  margin: 0 0 0.55rem;
  padding: 0.45rem 0.6rem;
  border-radius: 9px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--stream-live-text);
  background: var(--stream-live-bg);
  border: 1px solid var(--stream-live-border);
  animation: summary-live-pulse 2.4s ease-in-out infinite;
}

.summary-live-strip.hidden {
  display: none;
}

.session-handoff-history-block {
  margin: 0 0 0.65rem;
  padding: 0.45rem 0.55rem;
  border-radius: 9px;
  border: 1px solid var(--border-subtle, rgba(127, 127, 127, 0.22));
  background: var(--surface-elevated, rgba(127, 127, 127, 0.06));
}

.session-handoff-history-block.hidden {
  display: none;
}

.session-handoff-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.session-handoff-history-item {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-muted);
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  background: var(--surface-muted, rgba(127, 127, 127, 0.08));
  word-break: break-all;
}

@keyframes summary-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.82; }
}

.summary-settled-group {
  margin-top: 0.35rem;
}

.summary-settled-summary {
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.25rem 0.1rem;
  list-style: none;
}

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

.summary-card-list-settled .summary-card {
  opacity: 0.72;
}

.summary-card-list-settled .summary-card.status-completed {
  opacity: 0.58;
}

.summary-turn-group.is-current-turn > summary.summary-turn-group-summary {
  color: var(--gold-light);
  font-weight: 700;
}

.summary-turn-group.is-current-turn {
  border-left: 2px solid var(--border-accent);
  padding-left: 0.35rem;
  margin-left: -0.35rem;
}

.summary-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.summary-card-list:empty {
  display: none;
}

.summary-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.6rem 0.65rem;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: var(--overlay-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.summary-card:hover {
  border-color: var(--border-accent);
}

.summary-card-icon {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.summary-card-icon.is-step-num {
  border-radius: 999px;
  font-size: 0.65rem;
}

.summary-card-icon.status-running,
.summary-card-icon.status-in_progress,
.summary-card-icon.status-executing,
.summary-card-icon.status-pending {
  color: var(--gold-light);
  border-color: var(--border-accent);
  background: var(--gold-dim);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.summary-card-icon.status-completed {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.35);
  background: var(--ok-bg);
}

.summary-card-icon.status-failed {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.summary-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.summary-card-status {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.summary-card.status-running .summary-card-status,
.summary-card.status-in_progress .summary-card-status,
.summary-card.status-executing .summary-card-status {
  color: var(--gold-light);
}

.summary-card.status-completed {
  opacity: 0.62;
  border-color: var(--border-subtle);
  box-shadow: none;
}

.summary-card.status-completed .summary-card-status,
.summary-card.status-completed .summary-card-label {
  color: var(--text-muted);
}

.summary-card-plan.status-pending {
  border-color: var(--border-subtle, rgba(255, 255, 255, 0.08));
  background: var(--overlay-surface);
}

.summary-card-plan.status-pending .summary-card-status {
  color: var(--text-muted);
}

.summary-card-plan.status-in_progress,
.summary-card-plan.status-running {
  border-color: var(--stream-live-border);
  background: linear-gradient(135deg, var(--stream-live-bg) 0%, var(--overlay-surface) 100%);
}

.summary-card-plan.status-in_progress .summary-card-status,
.summary-card-plan.status-running .summary-card-status {
  color: var(--stream-live-text);
}

.summary-card-plan .summary-card-icon.is-step-num {
  color: var(--stream-live-text);
  border-color: var(--stream-live-border);
  background: var(--stream-live-bg);
}

.summary-card.status-failed {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.summary-card.status-failed .summary-card-status {
  color: #ef4444;
}

.summary-card-label {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.summary-card-stop {
  flex-shrink: 0;
  align-self: center;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 0.62rem;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.summary-card-stop:hover {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.08);
}

.exec-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.summary-turn-groups {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.summary-turn-group {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.summary-turn-group.is-current-turn {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.08);
}

.summary-turn-group > summary {
  cursor: pointer;
  padding: 0.5rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  list-style: none;
  user-select: none;
}

.summary-turn-group > summary::-webkit-details-marker {
  display: none;
}

.summary-turn-group > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.summary-turn-group[open] > summary::before {
  transform: rotate(90deg);
}

.summary-turn-group[open] > summary {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary, #e2e8f0);
}

.summary-turn-group-body {
  padding: 0.35rem 0.45rem 0.5rem;
}

.summary-turn-group-body .summary-card-list {
  margin: 0;
}

.exec-timeline:empty {
  display: none;
}

.exec-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0 0 0.32rem 0.15rem;
}

.exec-step:last-child {
  padding-bottom: 0;
}

.exec-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 0.48rem;
  top: 1.15rem;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle);
}

.exec-step-marker {
  flex-shrink: 0;
  width: 0.72rem;
  height: 0.72rem;
  margin-top: 0.18rem;
  border-radius: 999px;
  border: 2px solid var(--border-subtle);
  background: var(--overlay-surface);
  z-index: 1;
}

.exec-step-user .exec-step-marker {
  border-color: var(--border-accent);
  background: var(--gold-dim);
}

.exec-step-start .exec-step-marker {
  border-color: var(--gold-light);
  background: var(--gold-dim);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.exec-step-done .exec-step-marker {
  border-color: var(--ok);
  background: var(--ok-bg);
}

.exec-step-think .exec-step-marker {
  border-color: var(--text-muted);
  background: var(--bg-elevated);
}

.exec-step-task .exec-step-marker {
  border-color: var(--stream-live-border);
  background: var(--stream-live-bg);
}

.exec-step-error .exec-step-marker {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.exec-step-line {
  flex: 1;
  min-width: 0;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
  padding: 0.2rem 0;
}

.exec-step-complete .exec-step-line {
  color: var(--text-muted);
  font-weight: 400;
}

.exec-step-complete .exec-step-marker {
  border-color: var(--border-subtle);
  background: var(--bg-elevated);
  opacity: 0.75;
}

.exec-step-active .exec-step-marker {
  border-color: var(--gold-light);
  background: var(--gold-dim);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.exec-step-active .exec-step-line {
  font-weight: 600;
  color: var(--gold-light);
}

.exec-step-error-state .exec-step-line {
  color: #ef4444;
}

.summary-tab-badge-running {
  background: var(--stream-live-bg);
  color: var(--stream-live-text);
  border: 1px solid var(--stream-live-border);
}

.summary-empty-state.is-syncing .summary-empty-glyph {
  border-color: var(--stream-live-border);
  background: var(--stream-live-bg);
}

.summary-empty-state.is-syncing > p:first-of-type {
  color: var(--stream-live-text);
}

.summary-empty-state.is-offline > p:first-of-type {
  color: var(--text-muted);
}

.summary-card-plan.status-cancelled {
  opacity: 0.52;
  border-style: dashed;
  border-color: var(--border-subtle);
}

.summary-card-plan.status-cancelled .summary-card-status {
  color: var(--text-muted);
}

.summary-card-plan.status-cancelled .summary-card-icon.is-step-num {
  color: var(--text-muted);
  border-color: var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: none;
}

.summary-card-agent.status-cancelled,
.summary-card-agent.status-interrupted {
  opacity: 0.55;
}

.summary-card-plan.status-interrupted {
  opacity: 0.52;
  border-style: dashed;
  border-color: var(--border-subtle);
}

.summary-card-plan.status-interrupted .summary-card-status {
  color: var(--text-muted);
}

.summary-card-plan.status-interrupted .summary-card-icon.is-step-num {
  color: var(--text-muted);
  border-color: var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: none;
}

.tool-json-view {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--tool-output);
}

.tool-json-dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.65rem;
}

.tool-json-dl dt {
  margin: 0;
  font-weight: 600;
  color: var(--text-muted);
}

.tool-json-dl dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}

.tool-json-list {
  margin: 0.15rem 0 0;
  padding-left: 1rem;
}

.tool-run-output-details {
  margin-top: 0.35rem;
  font-size: 0.78rem;
}

.tool-run-output-details > summary {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
}

.tool-run-output-details[open] > summary {
  color: var(--text);
}

.tool-run-output-body {
  margin-top: 0.35rem;
}

.swarm-peer-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.swarm-peer-grid:empty {
  display: none;
}

.swarm-peer-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.45rem 0.28rem 0.28rem;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--text);
  background: var(--overlay-surface);
  border: 1px solid var(--border-subtle);
}

.swarm-peer-chip.is-generic {
  opacity: 0.72;
  font-size: 0.68rem;
}

.swarm-peer-avatar {
  width: 1.25rem;
  height: 1.25rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gold-light);
  background: var(--gold-dim);
  border: 1px solid var(--border-accent);
}

.swarm-peer-dot {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.2);
}

.swarm-team-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.74rem;
}

.swarm-team-list:empty {
  display: none;
}

.swarm-empty-note {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-size: 0.74rem;
  text-align: center;
  border: 1px dashed var(--border-subtle);
}

.summary-panel-plan .session-todos {
  margin-top: 0;
}

.plan-step-item {
  align-items: flex-start;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--stream-live-border);
  background: linear-gradient(135deg, var(--stream-live-bg) 0%, var(--overlay-surface) 100%);
  gap: 0.55rem;
}

.plan-step-item.plan-step-completed {
  opacity: 0.55;
  border-color: var(--border-subtle);
  background: var(--overlay-surface);
  box-shadow: none;
}

.plan-step-item.plan-step-in_progress,
.plan-step-item.plan-step-running {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 1px var(--gold-glow);
}

.plan-step-num {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--stream-live-text);
  background: var(--overlay-surface);
  border: 1px solid var(--stream-live-border);
}

.plan-step-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.plan-step-status {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--stream-live-text);
  text-transform: none;
}

.plan-step-item.plan-step-completed .plan-step-status {
  color: var(--text-muted);
}

.plan-step-item.plan-step-completed .plan-step-label {
  color: var(--text-muted);
}

.plan-step-item.plan-step-completed .plan-step-num {
  opacity: 0.5;
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.plan-step-label {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-step-stop {
  align-self: center;
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
}

.agent-subtask-item {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--overlay-surface);
}

.agent-subtask-item.agent-subtask-running,
.agent-subtask-item.agent-subtask-in_progress,
.agent-subtask-item.agent-subtask-pending {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 1px var(--gold-glow);
}

.agent-subtask-item.agent-subtask-completed {
  opacity: 0.55;
  border-color: var(--border-subtle);
  box-shadow: none;
}

.agent-subtask-item.agent-subtask-completed .plan-step-status,
.agent-subtask-item.agent-subtask-completed .agent-subtask-label {
  color: var(--text-muted);
}

.agent-subtask-item.agent-subtask-failed {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}

.agent-subtask-item.agent-subtask-failed .plan-step-status {
  color: #ef4444;
}

.agent-subtask-label {
  font-size: 0.82rem;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-callout {
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
  font-size: 0.88rem;
  line-height: 1.6;
}

.inbox-callout-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--warning);
  background: var(--overlay-surface);
  border: 1px solid rgba(251, 191, 36, 0.35);
  margin-bottom: 0.35rem;
}

.inbox-gate-card {
  border-left: 4px solid var(--warning);
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.06) 0%, var(--bg-card) 28%);
}

.inbox-tabs {
  display: flex;
  gap: 0.35rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.inbox-tab {
  border: 1px solid var(--border-subtle);
  background: var(--overlay-surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.inbox-tab.is-active {
  color: var(--text-primary);
  border-color: rgba(245, 166, 35, 0.45);
  background: rgba(245, 166, 35, 0.1);
}

.inbox-tab-panel.hidden {
  display: none;
}

.inbox-mail-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.inbox-mail-head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.inbox-mail-type {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--warning);
  margin-right: 0.5rem;
}

.inbox-mail-subject {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  line-height: 1.35;
}

.inbox-mail-meta {
  margin: 0;
  font-size: 0.72rem;
}

.inbox-mail-body {
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.inbox-mail-attachments-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.inbox-attachment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.inbox-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: var(--overlay-surface);
  border: 1px solid var(--border-subtle);
}

.inbox-attachment-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.inbox-mail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.inbox-instructions-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.inbox-instructions-input {
  width: 100%;
}

.inbox-action-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chat-human-gate-bar {
  margin-top: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(245, 166, 35, 0.25);
  background: rgba(245, 166, 35, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.chat-human-gate-head {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--warning);
}

.chat-human-gate-body {
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--text-secondary);
}

.chat-human-gate-foot {
  font-size: 0.68rem;
}

.summary-session-id-foot {
  margin: auto 0 0;
  padding: 0.4rem 0 0;
  font-size: 0.625rem;
  line-height: 1.35;
  color: var(--text-muted);
  opacity: 0.55;
  word-break: break-all;
  user-select: all;
  flex-shrink: 0;
}

.summary-tab-panels {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.summary-tab-panel {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  flex-direction: column;
  gap: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 166, 35, 0.25) transparent;
}

.summary-tab-panel.active {
  display: flex;
}

.resource-mount-panel-tab {
  margin-bottom: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: transparent;
  border: none;
}

.resource-mount-hint {
  font-size: 0.72rem;
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  line-height: 1.4;
}

.summary-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 0.5rem;
  border-radius: 14px;
  border: 1px dashed var(--border-subtle);
  background: var(--overlay-surface);
}

.summary-empty-state.hidden {
  display: none;
}

.summary-empty-glyph {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 200, 87, 0.2);
  background: radial-gradient(circle at 30% 30%, rgba(245, 166, 35, 0.15), transparent 70%);
  position: relative;
}

.summary-empty-glyph::after {
  content: "";
  position: absolute;
  inset: 0.65rem;
  border-radius: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.summary-empty-icon {
  font-size: 1.75rem;
  margin-bottom: 0.65rem;
  opacity: 0.55;
}

.summary-empty-state p {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 14rem;
}

.resource-mount-panel {
  flex-shrink: 0;
  margin-bottom: 0.75rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 0.8rem;
}

.resource-mount-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.resource-mount-panel-head strong {
  font-size: 0.84rem;
  font-weight: 600;
}

.summary-save-btn {
  flex-shrink: 0;
  padding: 0.35rem 0.85rem !important;
  font-size: 0.75rem !important;
  border-radius: 999px !important;
}

.resource-mount-checks {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: none;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.resource-mount-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  background: var(--overlay-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.15s ease;
}

.resource-mount-card:hover {
  border-color: var(--border-accent);
  background: var(--overlay-surface-hover);
}

.resource-mount-card:has(.resource-mount-check:checked) {
  border-color: var(--border-accent);
  background: var(--gold-dim);
  box-shadow: inset 0 1px 0 var(--overlay-surface);
}

.resource-mount-check {
  margin-top: 0.15rem;
  accent-color: var(--gold);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.resource-mount-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.resource-mount-type {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-light);
  opacity: 0.85;
}

.resource-mount-name {
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--text);
}

.resource-mount-label {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  line-height: 1.3;
  cursor: pointer;
}

.resource-mount-empty {
  margin: 0;
  font-size: 0.78rem;
}

.summary-section-title {
  margin: 0.5rem 0 0.45rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

/* legacy section title — prefer .summary-section-head .summary-section-title */

.swarm-teams-list {
  font-size: 0.82rem;
}

.summary-offline {
  font-size: 0.85rem;
  color: var(--danger);
  padding: 0.5rem 0.75rem;
  background: rgba(248, 113, 113, 0.1);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.summary-offline.hidden { display: none; }

.org-context-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.78rem;
  background: var(--overlay-glass);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.org-ctx-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  background: var(--overlay-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  white-space: nowrap;
  max-width: 100%;
}

.org-ctx-chip-brand {
  color: var(--gold-light);
  font-weight: 600;
  border-color: rgba(245, 166, 35, 0.2);
  background: rgba(245, 166, 35, 0.08);
}

.org-ctx-chip-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.65;
}

.org-ctx-chip-agent strong,
.org-ctx-chip-model strong {
  color: var(--text);
  font-weight: 600;
}

.org-ctx-chip-link {
  color: var(--gold-light);
  text-decoration: none;
  transition: background 0.15s ease;
}

.org-ctx-chip-link:hover {
  background: rgba(245, 166, 35, 0.12);
  text-decoration: none;
}

.volume-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
}

.volume-crumb-sep {
  color: var(--text-muted);
  opacity: 0.6;
}

.volume-crumb-current {
  font-weight: 600;
  color: var(--gold-light);
}

.volume-folder-link {
  text-decoration: none;
  color: var(--text);
}

.volume-folder-link:hover {
  color: var(--gold-light);
}

.volume-readonly-tag {
  color: var(--warning, #f59e0b);
  font-weight: 600;
}

.volume-scope-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.volume-scope-hint {
  margin: 0;
}

.volume-quick-folders {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.org-ctx-chip-action {
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.org-ctx-chip-action:hover {
  background: var(--overlay-surface-hover);
  border-color: var(--gold-dim);
}

.session-settings-work-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.session-settings-work-scope {
  width: auto;
  min-width: 7rem;
  flex: 0 0 auto;
}

.session-settings-work-row .session-settings-select:last-child {
  flex: 1;
  min-width: 10rem;
}

.session-settings-panel {
  width: min(640px, 95vw);
  max-width: 640px;
  background: var(--overlay-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-accent);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.session-settings-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 166, 35, 0.25) transparent;
}

.session-settings-body::-webkit-scrollbar {
  width: 6px;
}
.session-settings-body::-webkit-scrollbar-track {
  background: transparent;
}
.session-settings-body::-webkit-scrollbar-thumb {
  background: rgba(245, 166, 35, 0.25);
  border-radius: 3px;
}
.session-settings-body::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 166, 35, 0.4);
}

.session-settings-panel h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  background: var(--hero-title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.session-settings-lead {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.session-settings-panel .form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.session-settings-panel .form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.session-settings-panel .form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.session-settings-panel .form-hint code {
  background: var(--code-inline-bg);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-family: var(--mono);
  color: var(--gold-light);
}

.session-settings-panel .form-hint a {
  color: var(--gold-light);
  text-decoration: none;
  transition: color var(--transition);
}

.session-settings-panel .form-hint a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.session-settings-select,
.session-settings-work-row input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.session-settings-select:hover,
.session-settings-work-row input:hover {
  border-color: rgba(245, 166, 35, 0.4);
}

.session-settings-select:focus,
.session-settings-work-row input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.session-model-hint.hidden {
  display: none;
}

.session-model-hint:not(.hidden) {
  color: var(--warn, #b45309);
  margin-top: 0.35rem;
}

.session-settings-mounts {
  margin-top: 1.5rem;
}

.session-mount-block {
  margin-top: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius, 12px);
  padding: 0.75rem 1rem 1rem;
}

.session-mount-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  letter-spacing: 0.05em;
}

.session-mount-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
  width: 100%;
}

/* 会话设置 · 资源挂载并列 Tab（插件/知识库/数据资产） */
.session-settings-tabs {
  margin-top: 1.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}
.sst-tabbar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}
.sst-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.sst-tab:hover {
  color: var(--text);
}
.sst-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent, #4c8dff);
  font-weight: 600;
}
.sst-panel {
  display: none;
  padding: 0.85rem 0.9rem;
}
.sst-panel.active {
  display: block;
}
.sst-panel .form-group {
  margin-top: 0;
}
.session-settings-plugins-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.85rem;
  user-select: none;
  transition: all var(--transition);
}

.checkbox-row:hover {
  background: var(--overlay-surface-hover);
  border-color: var(--gold-dim);
}

.checkbox-row:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold-light);
  box-shadow: 0 0 10px rgba(245, 166, 35, 0.1);
}

.checkbox-row input[type="checkbox"] {
  accent-color: var(--gold);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.session-settings-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.session-settings-footer a {
  color: var(--gold-light);
  text-decoration: none;
  font-weight: 500;
}

.session-settings-footer a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

.model-enable-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.model-enable-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.model-enable-item:hover {
  background: var(--overlay-surface-hover);
}

.model-enable-item code {
  display: block;
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

.composer-session-model-hint {
  font-size: 0.78rem;
}

.composer-session-model-hint .btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--gold-light);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
}

.org-ctx-chip-quota {
  font-variant-numeric: tabular-nums;
}

.org-ctx-link-inline {
  margin-left: 0.35rem;
  color: var(--gold-light);
  font-size: 0.72rem;
}

.org-ctx-select {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  max-width: 8rem;
}

.org-ctx-select:focus {
  outline: none;
  text-decoration: underline;
  text-decoration-color: var(--gold);
}

.org-ctx-item strong { color: var(--gold-light); font-weight: 600; }
.org-ctx-sep { opacity: 0.35; }
.org-ctx-spacer { flex: 1; }

.runtime-pill {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.runtime-pill.ok {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.runtime-pill.down {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.runtime-banner {
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  background: var(--danger-bg);
  border-bottom: 1px solid rgba(248, 113, 113, 0.25);
  color: var(--alert-error-text);
}

.onboard-strip {
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  background: var(--gold-dim);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.context-mini {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.context-mini-line {
  font-weight: 600;
  color: var(--gold-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-mini-sub {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.workbench-nav {
  display: none;
}

.wb-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
}

.wb-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  background: var(--gold);
  color: #1a1208;
  flex-shrink: 0;
}

.wb-nav-badge.hidden {
  display: none;
}

.wb-nav-item:hover {
  background: var(--gold-dim);
  color: var(--text);
  text-decoration: none;
}

.wb-nav-item.active {
  background: var(--gold-dim);
  color: var(--gold-light);
  font-weight: 600;
}

.wb-nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 0.75rem 0.2rem;
  opacity: 0.85;
}

.wb-nav-section-label:first-child {
  padding-top: 0.15rem;
}

.mount-guide-card {
  margin-bottom: 1rem;
  border-color: var(--border-subtle);
  background: var(--overlay-surface);
}

.mount-guide-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
  line-height: 1.75;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.assets-subnav {
  margin-bottom: 0.85rem;
}

.session-list-label {
  padding: 0.35rem 1rem 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.session-row {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-bottom: 0.25rem;
  border-radius: 8px;
  border: 1px solid transparent;
}

.session-row.active {
  background: var(--gold-dim);
  border-color: var(--border);
}

.session-row .session-item {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  border: none;
  background: transparent;
}

.session-row .session-item.active {
  background: transparent;
  border: none;
}

.session-trash-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-right: 0.25rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}


.session-trash-btn:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

.session-context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 10.5rem;
  padding: 0.4rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.session-context-menu.hidden {
  display: none;
}

.session-context-menu button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.session-menu-icon {
  flex: 0 0 auto;
  opacity: 0.85;
}

.session-menu-separator {
  height: 1px;
  margin: 0.35rem 0.25rem;
  background: var(--border);
}

.session-context-menu button:hover {
  background: var(--bg-hover);
}

.session-context-menu button.danger {
  color: #f87171;
}

.session-context-menu button.danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

.session-context-menu button.is-soon {
  color: var(--text-muted);
  cursor: default;
}

.session-context-menu button.is-soon:hover {
  background: transparent;
  color: var(--text-muted);
}

.running-badge {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  background: var(--gold-dim);
  color: var(--gold-light);
}

.running-badge.hidden { display: none; }

.workspace-page {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-deep);
}

.workspace-page-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

.module-desc {
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  max-width: 52rem;
}

.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-with-rail {
  display: grid;
  grid-template-columns: 52px minmax(200px, 1fr);
  padding: 0;
  overflow: hidden;
  position: relative;
}

.sidebar-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--border-subtle);
}

.sidebar-panel-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 0.85rem 0.55rem;
  border-bottom: 1px solid var(--border-subtle);
}

.session-batch-toggle.active {
  color: var(--accent, #f5a623);
  border-color: var(--border);
}

.session-batch-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  padding: 0.45rem 0.85rem 0.55rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.session-batch-bar.hidden {
  display: none;
}

.session-batch-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.session-batch-count {
  flex: 1;
  min-width: 4.5rem;
}

.session-batch-check-wrap {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  padding-left: 0.55rem;
}

.session-batch-mode .session-batch-check-wrap {
  display: inline-flex;
}

.session-batch-mode .session-row .session-item {
  pointer-events: none;
}

.session-batch-mode .session-row .session-batch-check-wrap,
.session-batch-mode .session-row .session-menu-btn {
  pointer-events: auto;
}

.session-batch-mode .session-actions {
  display: none;
}

.chat-history-sync {
  flex-shrink: 0;
  padding: 0.35rem 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-panel);
}

.chat-history-sync.hidden {
  display: none;
}

.chat-load-older-history {
  align-self: center;
  margin: 0.25rem auto 0.75rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--overlay-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  cursor: pointer;
}

.chat-load-older-history:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--gold-dim);
}

.chat-load-older-history.hidden {
  display: none;
}

.chat-load-older-history:disabled {
  opacity: 0.65;
  cursor: wait;
}

.sidebar-panel-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.sidebar-panel-sub {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-panel-compact .sidebar-panel-head {
  padding-bottom: 0.65rem;
}

.sidebar-panel-compact {
  flex: 1;
}

.sidebar-panel-compact .sidebar-footer {
  margin-top: auto;
}

.wb-rail-groups .wb-rail-group:nth-last-child(2) .wb-rail-flyout,
.wb-rail-groups .wb-rail-group:last-child .wb-rail-flyout {
  top: auto;
  bottom: 0;
  transform: translateY(0) translateX(-6px);
}

.wb-rail-groups .wb-rail-group:nth-last-child(2) .wb-rail-flyout.is-open,
.wb-rail-groups .wb-rail-group:last-child .wb-rail-flyout.is-open {
  transform: translateY(0) translateX(0);
}

.sidebar-shortcut {
  flex-shrink: 0;
  padding: 0.65rem 0.85rem;
}

.sidebar-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}

.sidebar-back-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.sidebar-footer-email {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* —— Icon rail —— */
.wb-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  height: 100%;
  padding: 0.55rem 0;
  background: color-mix(in srgb, var(--bg-card) 92%, var(--bg-deep));
  border-right: 1px solid var(--border-subtle);
  position: relative;
  z-index: 30;
}

.wb-rail-top,
.wb-rail-groups,
.wb-rail-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
}

.wb-rail-spacer {
  flex: 1;
  min-height: 0.5rem;
}

.wb-rail-new-form {
  margin: 0;
}

.wb-rail-new-wrap {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.wb-rail-new-flyout {
  position: absolute;
  left: calc(100% + 0.35rem);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  min-width: 9.5rem;
  padding: 0.35rem 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
  z-index: 40;
}

.wb-rail-new-flyout.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.wb-rail-new-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.wb-rail-new-item:hover {
  background: var(--gold-dim);
  color: var(--gold-light);
  text-decoration: none;
}

.wb-rail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.wb-rail-icon:hover {
  background: var(--gold-dim);
  color: var(--text);
  text-decoration: none;
}

.wb-rail-icon.active,
.wb-rail-group-active > .wb-rail-trigger {
  background: var(--gold-dim);
  color: var(--gold-light);
  border-color: var(--border);
}

.wb-rail-logo {
  width: 1.65rem !important;
  height: 1.65rem !important;
  font-size: 0.5rem !important;
}

.wb-rail-new {
  font-size: 1.15rem;
  font-weight: 500;
}

.wb-rail-glyph {
  font-size: 0.95rem;
  line-height: 1;
}

.wb-rail-group {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.wb-rail-flyout {
  position: absolute;
  left: calc(100% + 0.35rem);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  min-width: 11.5rem;
  padding: 0.35rem 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated, var(--bg-card));
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 100;
}

.wb-rail-flyout.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.wb-rail-flyout-head {
  padding: 0.35rem 0.85rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wb-rail-flyout-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.1s ease, color 0.1s ease;
}

.wb-rail-flyout-item:hover {
  background: var(--gold-dim);
  color: var(--text);
  text-decoration: none;
}

.wb-rail-flyout-item.active {
  color: var(--gold-light);
  font-weight: 600;
  background: var(--gold-dim);
}

.wb-rail-flyout-icon {
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

.wb-rail-flyout-item .wb-nav-badge {
  margin-left: auto;
}

.wb-rail-flyout-sep {
  height: 1px;
  margin: 0.3rem 0.65rem;
  background: var(--border-subtle);
}

.wb-rail-flyout-logout {
  color: var(--text-muted);
}

.wb-rail-bottom {
  flex-shrink: 0;
  padding-bottom: 0.35rem;
}

.wb-rail-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: var(--gold-dim);
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-with-rail .session-list {
  flex: 1;
  padding: 0.35rem 0.5rem 0.5rem;
}

.sidebar-with-rail .session-list-label {
  padding: 0.25rem 0.5rem 0.45rem;
}

.sidebar-with-rail .sidebar-footer {
  flex-shrink: 0;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.72rem;
}

.summary-sync-hint {
  margin: 0 0 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #b45309;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.summary-sync-hint.hidden {
  display: none;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header .brand-mini {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.session-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  min-height: 0;
}

.session-item {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 0;
  border: 1px solid transparent;
  text-decoration: none;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.session-item-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-item-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.session-item:hover {
  background: var(--gold-dim);
  color: var(--text);
  text-decoration: none;
}

.session-item.active {
  background: var(--gold-dim);
  border-color: var(--border);
  color: var(--gold-light);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.main-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-deep);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--overlay-header);
  backdrop-filter: blur(12px);
  gap: 1rem;
}

.session-title-form input {
  background: transparent;
  border: none;
  color: var(--gold-light);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.25rem 0;
  width: 100%;
  max-width: 360px;
}

.session-title-form input:focus {
  outline: none;
  border-bottom: 1px solid var(--gold);
  box-shadow: none;
}

.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }

#stop-btn:not(:disabled),
.composer-stop-btn:not(:disabled) {
  color: #fff !important;
  background: var(--danger) !important;
  border-color: var(--danger) !important;
}

#stop-btn:not(:disabled):hover,
.composer-stop-btn:not(:disabled):hover {
  filter: brightness(1.08);
}

.composer-stop-btn.hidden {
  display: none;
}

.chat-topbar-btn.chat-stop-active {
  color: #fff !important;
  background: var(--danger) !important;
  border-color: var(--danger) !important;
}

.composer-send-btn.hidden {
  display: none;
}

.composer-visibility-toggles {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.composer-visibility-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.composer-visibility-toggle input {
  accent-color: var(--accent-blue);
}

.agent-panel {
  display: none;
}

.summary-pane .agent-plan {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.65rem 0.8rem;
  background: var(--overlay-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  white-space: pre-wrap;
  max-height: 120px;
  overflow-y: auto;
  flex-shrink: 0;
  line-height: 1.5;
}

.summary-pane .agent-task-list {
  flex: 0 1 auto;
  overflow-y: visible;
  min-height: 0;
}

.summary-pane .agent-task-item {
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--overlay-surface);
}

.agent-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.agent-plan {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  white-space: pre-wrap;
  max-height: 80px;
  overflow-y: auto;
}

.agent-plan.hidden { display: none; }

.agent-task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.agent-task-list:empty { display: none; }

.agent-task-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg-elevated);
  border-radius: 6px;
}

.agent-task-item .status {
  font-weight: 600;
  min-width: 4.5rem;
}

.agent-task-item .status.running { color: var(--gold-light); }
.agent-task-item .status.done { color: var(--success); }
.agent-task-item .status.failed { color: var(--danger); }

.agent-task-item .label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

.agent-task-item button {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
}

.session-todos { margin-top: 0.35rem; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  text-decoration: none;
}

.icon-btn:hover {
  color: var(--gold-light);
  border-color: var(--gold);
  text-decoration: none;
}

.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.page-chat .chat-area {
  justify-content: center;
}

.page-chat .chat-area:has(.message-wrap) {
  justify-content: flex-start;
}

/* ---- Assistant turn unified flow (Thinking → Planning → Working Flow → Result) ---- */
.assistant-turn-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.1rem 0 0.35rem;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
}

.assistant-turn--streaming:has(.assistant-turn-flow:empty) .assistant-turn-status {
  display: none;
}

.assistant-turn-flow {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  padding-left: 0.15rem;
  border-left: 1px solid var(--border-subtle);
  margin-left: 0.2rem;
}

.flow-section {
  margin: 0;
  border: none;
  background: transparent;
}

.flow-section.hidden {
  display: none;
}

.flow-section-summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  list-style: none;
  padding: 0.12rem 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
}

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

.flow-section-dots::after {
  content: "…";
  animation: flow-dots 1.4s steps(3, end) infinite;
  opacity: 0.7;
}

@keyframes flow-dots {
  0% { content: ""; }
  33% { content: "."; }
  66% { content: ".."; }
  100% { content: "..."; }
}

.flow-section-body {
  padding: 0.2rem 0 0.35rem 0.85rem;
}

.flow-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.flow-timeline-entry {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
  border-left: 2px solid var(--border-subtle);
  padding: 0.15rem 0 0.15rem 0.55rem;
}

.flow-timeline-entry--running,
.flow-timeline-entry--active {
  border-left-color: var(--accent, #f5a623);
}

.flow-timeline-entry--done {
  border-left-color: var(--border);
}

.flow-timeline-entry--error {
  border-left-color: #e55;
  color: #e88;
}

.flow-timeline-entry--subagent .flow-timeline-entry-head {
  font-weight: 600;
}

.flow-timeline-entry--progress .flow-timeline-entry-head,
.flow-timeline-entry--plan .flow-timeline-entry-head {
  font-size: 0.76rem;
  color: var(--text-muted, #888);
}

.flow-timeline-entry--plan.flow-timeline-entry--running .flow-timeline-entry-head {
  color: var(--accent, #f5a623);
}

.flow-timeline-entry--liveness .flow-timeline-entry-head {
  color: var(--accent, #f5a623);
  font-style: italic;
}

.flow-timeline-entry--liveness.flow-timeline-entry--running {
  animation: timeline-liveness-pulse 2.4s ease-in-out infinite;
}

@keyframes timeline-liveness-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

.flow-timeline-entry-head {
  font-weight: 500;
}

.flow-timeline-entry-body {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.flow-tool-block--timeline-backed {
  display: none;
}

.assistant-turn--unified-timeline .assistant-turn-flow > .flow-section {
  display: none !important;
}

.assistant-turn--unified-timeline.assistant-turn--streaming .assistant-turn-flow > .flow-section {
  display: none !important;
}

.assistant-turn--unified-timeline .flow-timeline {
  display: flex;
}

.assistant-turn--unified-timeline .flow-timeline-entry--agent .flow-timeline-entry-body {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.assistant-turn--unified-timeline .flow-timeline-entry--subagent .flow-timeline-entry-body {
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.55;
  max-height: min(42vh, 420px);
  overflow-y: auto;
  margin-top: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: var(--surface-muted, rgba(255, 255, 255, 0.03));
}

.flow-timeline-entry--subagent.flow-timeline-entry--running .flow-timeline-entry-head {
  color: var(--accent, #f5a623);
}

.flow-timeline-entry--subagent .flow-subagent-live {
  margin-top: 0.35rem;
  border: none;
  padding: 0;
}

.flow-subagent-nested {
  margin-left: 0.65rem;
  padding-left: 0.55rem;
  border-left: 2px solid var(--border, rgba(255, 255, 255, 0.08));
}

.flow-timeline-entry--depth-1 .flow-timeline-entry-head,
  .flow-timeline-entry--depth-2 .flow-timeline-entry-head,
  .flow-timeline-entry--depth-3 .flow-timeline-entry-head,
  .flow-timeline-entry--depth-4 .flow-timeline-entry-head {
  font-size: 0.78rem;
}

  .flow-timeline-entry--depth-2 .flow-timeline-entry-body,
  .flow-timeline-entry--depth-3 .flow-timeline-entry-body,
  .flow-timeline-entry--depth-4 .flow-timeline-entry-body {
  font-size: 0.78rem;
}

/* 扁平管道里用左缩进表达子代理层级（不再 DOM 嵌套） */
.flow-timeline-entry--depth-1 { margin-left: 0.8rem; }
.flow-timeline-entry--depth-2 { margin-left: 1.6rem; }
.flow-timeline-entry--depth-3 { margin-left: 2.4rem; }
.flow-timeline-entry--depth-4 { margin-left: 3.2rem; }

/* ── 主次分层：结果（主）突出、过程（次）淡化 ───────────────────────────
   统一时间线模式下，最终答复渲染为 flow-timeline-entry--agent 的正文。
   把它当作「结果」强调：更大字号、主色、去掉过程式的左边框；
   工具/进度/计划/子任务等「过程」条目整体收窄、淡化，让用户一眼分清。 */
.assistant-turn--unified-timeline .flow-timeline-entry--agent {
  border-left: none;
  padding-left: 0;
  margin: 0.45rem 0 0.25rem;
}
.assistant-turn--unified-timeline .flow-timeline-entry--agent .flow-timeline-entry-head {
  display: none;
}
.assistant-turn--unified-timeline .flow-timeline-entry--agent .flow-timeline-entry-body {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-top: 0;
}
/* 过程类条目：次要信息，淡化收窄 */
.assistant-turn--unified-timeline .flow-timeline-entry--tool,
.assistant-turn--unified-timeline .flow-timeline-entry--progress,
.assistant-turn--unified-timeline .flow-timeline-entry--plan,
.assistant-turn--unified-timeline .flow-timeline-entry--subagent,
.assistant-turn--unified-timeline .flow-timeline-entry--thinking {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.assistant-turn--unified-timeline .flow-timeline-entry--tool .flow-timeline-entry-head,
.assistant-turn--unified-timeline .flow-timeline-entry--progress .flow-timeline-entry-head,
.assistant-turn--unified-timeline .flow-timeline-entry--plan .flow-timeline-entry-head {
  font-weight: 500;
  color: var(--text-muted);
}
/* 过程的正文（工具输出预览等）进一步压低，避免与结果抢注意力 */
.assistant-turn--unified-timeline .flow-timeline-entry--tool .flow-timeline-entry-body,
.assistant-turn--unified-timeline .flow-timeline-entry--progress .flow-timeline-entry-body {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.92;
}
/* 完成后，过程进一步退到背景，结果保持清晰 */
.assistant-turn--unified-timeline.assistant-turn--done .flow-timeline-entry--tool,
.assistant-turn--unified-timeline.assistant-turn--done .flow-timeline-entry--progress,
.assistant-turn--unified-timeline.assistant-turn--done .flow-timeline-entry--plan,
.assistant-turn--unified-timeline.assistant-turn--done .flow-timeline-entry--thinking {
  opacity: 0.7;
}

/* ── 真实等待指示（#2）：仅在真有任务在跑时出现，呼吸动效 + 真实耗时 ──
   liveness 条目由真实运行状态（countActiveWorkItems）驱动，不伪造进度。 */
.assistant-turn--unified-timeline .flow-timeline-entry--liveness {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-left: none;
  padding-left: 0;
}
.assistant-turn--unified-timeline .flow-timeline-entry--liveness .flow-timeline-entry-head::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.4rem;
  border-radius: 999px;
  background: var(--accent, #f5a623);
  vertical-align: middle;
  animation: timeline-wait-breathe 1.6s ease-in-out infinite;
}
/* 任务完成后隐藏等待指示，避免残留误导 */
.assistant-turn--unified-timeline.assistant-turn--done .flow-timeline-entry--liveness {
  display: none;
}
@keyframes timeline-wait-breathe {
  0%, 100% { transform: scale(0.7); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* 子任务结果块：子代理完成后按完成顺序逐字播放的完整结果，需要清晰可读
   （区别于被淡化的过程类条目）。打字进行中带一个闪烁光标。 */
.assistant-turn--unified-timeline .flow-timeline-entry--subresult {
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-left-color: var(--border);
}
.assistant-turn--unified-timeline .flow-timeline-entry--subresult .flow-timeline-entry-head {
  font-weight: 600;
  color: var(--text-secondary);
}
.assistant-turn--unified-timeline .flow-timeline-entry--subresult .flow-timeline-entry-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-top: 0.3rem;
  max-height: none;
}
.assistant-turn--unified-timeline
  .flow-timeline-entry--subresult.flow-timeline-entry--running
  .flow-timeline-entry-body::after {
  content: "▋";
  margin-left: 1px;
  color: var(--accent, #f5a623);
  animation: subresult-caret 1s steps(1) infinite;
}
@keyframes subresult-caret {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* 等待期临时单行流（ticker）：看完即焚的实时活动，弱化、斜体、单行省略，
   不喧宾夺主，正式结果块开始播放时会被移除。 */
.assistant-turn--unified-timeline .flow-timeline-entry--ticker {
  font-size: 0.76rem;
  font-style: italic;
  opacity: 0.8;
}
.assistant-turn--unified-timeline .flow-timeline-entry--ticker .flow-timeline-entry-head {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted, #8a8f98);
  font-weight: 400;
}

.chat-scroll-bottom-btn {
  position: absolute;
  right: 1.25rem;
  bottom: 7.5rem;
  z-index: 12;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-elevated, rgba(30, 30, 30, 0.92));
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  font-size: 1rem;
  line-height: 1;
}

.chat-scroll-bottom-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent, #f5a623);
}

.flow-run-status-line {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.15rem 0;
}

.flow-stream-text {
  margin: 0;
  font-family: inherit;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.flow-stream-text--planning,
.flow-plan-list {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.flow-plan-item {
  padding: 0.15rem 0;
  border-left: 2px solid var(--border-subtle);
  padding-left: 0.55rem;
  margin: 0.15rem 0;
}

.flow-tool-block {
  margin: 0.35rem 0;
  border: none;
  background: transparent;
}

.flow-tool-summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.1rem 0;
}

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

.flow-tool-body {
  padding: 0.15rem 0 0.25rem 0.75rem;
  border-left: 1px dashed var(--border-subtle);
  margin-left: 0.35rem;
}

.flow-subagent-live {
  margin: 0.35rem 0 0.25rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: var(--surface-muted, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
}

.flow-subagent-live-head {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.flow-subagent-live-thinking {
  margin: 0.2rem 0;
  padding: 0.35rem 0.45rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 8rem;
  overflow: auto;
  border-left: 2px solid var(--border-subtle);
}

.flow-subagent-live-body {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
  line-height: 1.4;
}

.flow-subagent-live-tools {
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.flow-subagent-live-tool {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.flow-tool-wait-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.15rem 0 0.15rem 0.55rem;
  border-left: 2px solid var(--border-subtle);
  margin: 0.15rem 0;
}

.flow-tool-wait-inline {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.2rem;
  padding-left: 0.35rem;
}

.flow-timeline-entry .chat-artifact-bar {
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.chat-artifact-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-top: 0.5rem;
  padding: 0.45rem 0.55rem;
  background: var(--blue-dim, rgba(59, 130, 246, 0.08));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 6px);
  font-size: 0.82rem;
}

.chat-artifact-bar-label {
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.chat-artifact-item {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.session-settings-mounts .session-mount-block {
  margin-top: 0.5rem;
}

.session-settings-mounts .session-mount-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.chat-inline-artifact {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0.15rem;
  vertical-align: baseline;
}

.chat-inline-artifact-dl {
  padding: 0 0.35rem;
  font-size: 0.82rem;
}

.chat-artifact-name {
  font-size: 0.8rem;
  padding: 0.1rem 0.35rem;
  background: var(--surface-elevated, rgba(0, 0, 0, 0.04));
  border-radius: 4px;
}

.chat-artifact-link {
  font-size: 0.82rem;
  color: var(--link, #2563eb);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: font-size 0.15s ease, opacity 0.2s ease, font-weight 0.15s ease;
}

.chat-artifact-link--checking {
  opacity: 0.7;
  cursor: wait;
}

.chat-artifact-link--ready {
  font-size: 0.96rem;
  font-weight: 600;
}

.chat-artifact-link--missing {
  color: inherit;
  text-decoration: none;
  cursor: default;
  font-weight: normal;
  font-size: 0.82rem;
  opacity: 0.85;
  pointer-events: none;
}

.chat-artifact-open-wb {
  margin-left: 0.15rem;
}

.flow-tool-phase {
  margin: 0.2rem 0;
}

.flow-tool-phase.hidden {
  display: none;
}

.flow-phase-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.flow-tool-thinking .flow-phase-text {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.flow-tool-block--error .flow-tool-summary {
  color: #ef4444;
}

.flow-run-progress-line {
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text-secondary);
  padding: 0.1rem 0;
}

.flow-run-progress-line.flow-run-pending {
  color: var(--text-muted);
  font-style: italic;
}

.flow-run-error-line {
  font-size: 0.74rem;
  color: #ef4444;
  padding: 0.15rem 0;
  white-space: pre-wrap;
}

.flow-subtools {
  margin-top: 0.25rem;
  padding-left: 0.5rem;
}

.flow-result-cycle {
  margin: 0.15rem 0 0.35rem;
}

.flow-result-thinking {
  margin-bottom: 0.35rem;
}

.flow-result-think-text {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.flow-result-out-text {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.flow-info-line {
  font-size: 0.74rem;
  color: var(--text-muted);
  padding: 0.1rem 0;
}

.exec-timeline-root > .exec-step-has-children {
  flex-direction: column;
  align-items: stretch;
}

.exec-timeline-children {
  list-style: none;
  margin: 0.25rem 0 0 1.1rem;
  padding: 0 0 0 0.65rem;
  border-left: 1px dashed var(--border-subtle);
}

.exec-step-nested {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.summary-card-nested-timeline {
  flex: 1 1 100%;
  width: 100%;
  margin-top: 0.35rem;
  padding-left: 2.1rem;
}

.summary-card-nested-timeline .exec-timeline-nested {
  margin: 0;
}

/* ---- Assistant turn (Cursor-style trace + response) ---- */
.assistant-turn {
  align-self: stretch;
  max-width: 100%;
  width: 100%;
  margin: 0.35rem 0 0.85rem;
  animation: assistant-turn-in 0.22s ease-out;
}

@keyframes assistant-turn-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.assistant-turn--streaming .assistant-turn-response {
  min-height: 1.25rem;
}

.assistant-turn-trace {
  margin: 0 0 0.35rem;
  border: none;
  background: transparent;
}

.assistant-turn-trace--compact {
  margin-bottom: 0.25rem;
}

.assistant-turn-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  padding-left: 0.15rem;
  border-left: 1px solid var(--border-subtle);
  margin-left: 0.2rem;
}

.timeline-process-step {
  padding: 0.05rem 0 0.05rem 0.65rem;
}

.timeline-process-step .trace-step {
  font-size: 0.76rem;
}

.timeline-process-step--subagent .trace-step-label {
  color: var(--text-secondary);
}

.assistant-turn-response-segment {
  padding: 0.2rem 0 0.35rem 0.65rem;
  max-width: 100%;
}

.assistant-turn-response-segment--sealed {
  opacity: 0.92;
}

.assistant-turn-response-segment .assistant-turn-response {
  font-size: 0.95rem;
  line-height: 1.65;
}

.assistant-turn-trace--empty {
  display: none;
}

.assistant-turn-trace-summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  list-style: none;
  padding: 0.15rem 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  user-select: none;
}

.assistant-turn-trace-summary::-webkit-details-marker {
  display: none;
}

.trace-pulse-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--text-muted);
  opacity: 0.55;
  flex-shrink: 0;
}

.assistant-turn--streaming .trace-pulse-dot {
  background: var(--gold-light);
  opacity: 1;
  animation: stream-pulse 1.2s ease-in-out infinite;
}

.assistant-turn-trace-body {
  padding: 0.15rem 0 0.35rem 0.95rem;
  border-left: 1px solid var(--border-subtle);
  margin-left: 0.2rem;
}

.trace-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.trace-step {
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.trace-step-label {
  display: block;
}

.trace-step--active .trace-step-label {
  color: var(--text-secondary);
}

.trace-step--active .trace-step-label::after {
  content: " …";
  opacity: 0.65;
}

.trace-step--error .trace-step-label,
.trace-step--kind-error .trace-step-label {
  color: #ef4444;
}

.trace-step-details {
  margin: 0;
}

.trace-step-details > summary {
  cursor: pointer;
  list-style: none;
}

.trace-step-details > summary::-webkit-details-marker {
  display: none;
}

.trace-step-detail-body {
  margin-top: 0.25rem;
  padding: 0.35rem 0.5rem;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-muted);
  background: var(--overlay-surface);
  border-radius: 6px;
  max-height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.assistant-turn-detail-panel {
  margin-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.assistant-turn-detail-panel.hidden {
  display: none;
}

.assistant-turn-detail-panel .tool-run-card {
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  background: color-mix(in srgb, #ef4444 6%, var(--overlay-surface));
}

.assistant-turn-response-wrap {
  max-width: 100%;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
}

.assistant-turn-response {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.assistant-turn--done .assistant-turn-response-wrap,
.assistant-turn--done .assistant-turn-response-segment {
  padding-top: 0.15rem;
}

.assistant-turn--done .timeline-process-step--tool,
.assistant-turn--done .timeline-process-step--subagent {
  display: block;
}

.assistant-turn--done .assistant-turn-response-wrap .message-actions {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.assistant-turn--done .assistant-turn-response-wrap:hover .message-actions,
.assistant-turn--done .assistant-turn-response-wrap:focus-within .message-actions {
  opacity: 1;
}

body.chat-turn-streaming #stream-live {
  display: none !important;
}

body.chat-process-hidden .assistant-turn-trace-body .trace-steps,
body.chat-process-hidden .assistant-turn-detail-panel,
body.chat-process-hidden .timeline-process-step--tool,
body.chat-process-hidden .timeline-process-step--info,
body.chat-process-hidden .flow-section--working,
body.chat-process-hidden .flow-tool-block,
body.chat-process-hidden .flow-info-lines {
  display: none !important;
}

body.chat-process-hidden .timeline-process-step--subagent,
body.chat-process-hidden .flow-section--planning {
  display: block !important;
}

body.chat-process-hidden .timeline-process-step--thinking,
body.chat-process-hidden .flow-section--thinking {
  display: block !important;
}

body.chat-thinking-hidden .timeline-process-step--thinking,
body.chat-thinking-hidden .flow-section--thinking,
body.chat-thinking-hidden .flow-tool-thinking,
body.chat-thinking-hidden .flow-result-thinking {
  display: none !important;
}

body.chat-process-hidden .assistant-turn-trace--empty {
  display: none !important;
}

body.chat-thinking-hidden .trace-step--kind-thinking {
  display: none !important;
}

body.chat-thinking-hidden .flow-timeline-entry--subagent.flow-timeline-entry--thinking {
  display: block !important;
}

.chat-area > * {
  flex-shrink: 0 !important;
}

.message-wrap {
  display: flex;
  width: 100%;
}

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

.message-wrap.assistant {
  justify-content: flex-start;
}

.message {
  max-width: 75%;
  padding: 0.75rem 1.15rem;
  font-size: 0.95rem;
  line-height: 1.55;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

.message-author {
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
  opacity: 0.9;
}

.message-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.message.user {
  background: var(--msg-user-bg);
  border: 1px solid var(--msg-user-border);
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.message.user:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.message-wrap.user .message-author {
  color: var(--msg-user-author);
  text-align: right;
  display: none; /* User author is hidden */
}

.message.assistant {
  background: var(--msg-assistant-bg);
  border: 1px solid var(--msg-assistant-border);
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.message.assistant:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.message-wrap.assistant .message-author {
  color: var(--msg-assistant-author);
}

.message-body-wrap {
  position: relative;
}

.message-body-wrap:hover .message-copy-btn,
.message-body-wrap:focus-within .message-copy-btn {
  opacity: 1;
  pointer-events: auto;
}

.message-copy-btn {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  border: 1px solid var(--border-subtle);
  background: var(--overlay-surface);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
}

.message-copy-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-top: 0.45rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border-subtle);
}

.message-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.35rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}

.message-action-btn:hover {
  color: var(--text);
  background: var(--overlay-surface);
}

.message-action-btn.is-active {
  color: var(--accent);
}

.message-action-btn.is-active-negative {
  color: #ef4444;
}

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

.message.system, .message.repl {
  align-self: stretch;
  max-width: 100%;
  background: var(--msg-system-bg);
  border: 1px solid var(--msg-system-border);
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
  white-space: pre-wrap;
  color: var(--msg-system-text);
}

.message.system.llm-error-notice {
  font-family: var(--font);
  font-size: 0.92rem;
  line-height: 1.45;
  background: var(--danger-bg);
  border: 1px solid rgba(248, 113, 113, 0.42);
  border-left: 4px solid var(--tool-error);
  color: var(--text-secondary);
  padding: 0.85rem 1rem;
  border-radius: 10px;
  white-space: normal;
}

.llm-error-notice__title {
  font-weight: 650;
  font-size: 1rem;
  color: var(--alert-error-text);
  margin-bottom: 0.35rem;
}

.llm-error-notice__body {
  color: inherit;
}

.llm-error-notice__action {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(248, 113, 113, 0.2);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.message.repl.repl-turn {
  color: var(--msg-repl-muted);
  border-style: dashed;
  font-size: 0.78rem;
}

.message.repl.repl-tool-start {
  border-color: rgba(245, 166, 35, 0.45);
  color: var(--msg-tool-start);
}

.message.repl.repl-tool-end {
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--msg-tool-end);
}

.message.repl.repl-progress {
  color: var(--msg-progress);
  font-size: 0.78rem;
}

.stream-live {
  margin: 0 1.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--stream-live-bg);
  border: 1px solid var(--stream-live-border);
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
  color: var(--stream-live-text);
}

.stream-live.hidden {
  display: none;
}

.stream-activity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin: 0 1.25rem 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--stream-live-bg) 0%, var(--overlay-surface) 100%);
  border: 1px solid var(--stream-live-border);
  font-size: 0.8rem;
  color: var(--stream-live-text);
}

.stream-activity.hidden {
  display: none;
}

.stream-activity-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--gold-light);
  box-shadow: 0 0 0 2px var(--gold-glow);
  animation: stream-pulse 1.2s ease-in-out infinite;
  transition: background 0.6s ease, box-shadow 0.6s ease;
}

.stream-activity--connecting .stream-activity-dot {
  animation-duration: 0.55s;
}

.stream-activity--thinking .stream-activity-dot {
  animation-duration: 2s;
}

.stream-activity--tool .stream-activity-dot {
  animation-duration: 0.9s;
}

.stream-activity--retry .stream-activity-dot {
  animation-duration: 0.75s;
  background: var(--warning, #e6a23c);
}

.stream-activity--context_compact .stream-activity-dot {
  animation-duration: 1.4s;
  background: var(--accent, #6b8cff);
}

.stream-activity--waiting.stream-activity--stalled .stream-activity-dot {
  background: #ab2b3f;
  box-shadow: 0 0 0 2px rgba(171, 43, 63, 0.35);
  animation-duration: 1.6s;
}

.perm-edit-diff {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: pre;
  color: var(--text-muted);
}

@keyframes stream-pulse {
  50% { opacity: 0.35; transform: scale(0.85); }
}

.stream-activity-meta {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: "Cascadia Code", "Consolas", monospace;
}

.stream-activity-notice {
  margin: 0.35rem 1.25rem 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--stream-live-text);
  background: var(--stream-live-bg);
  border: 1px dashed var(--stream-live-border);
}

.stream-activity-notice.hidden {
  display: none;
}

.turn-divider {
  margin: 0.75rem 1.25rem 0.35rem;
  padding: 0.55rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

.exec-timeline {
  border-left: 2px solid var(--border-subtle);
  margin-left: 0.35rem;
  padding-left: 0.15rem;
}

.exec-step {
  padding-left: 0.35rem;
}

.exec-step::before {
  left: 0.62rem !important;
}

.exec-step-kind-badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.exec-step-active .exec-step-kind-badge {
  color: var(--gold-light);
  border-color: var(--border-accent);
}

.exec-step-retry .exec-step-marker {
  border-color: var(--tv-warn, #b45309);
  background: #fff8e6;
}

.exec-step-model .exec-step-marker {
  border-color: var(--stream-live-border);
  background: var(--stream-live-bg);
}

.tool-run-card.tool-run-running .tool-run-card-head {
  color: var(--stream-live-text);
}

.tool-run-running-pulse {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  animation: stream-pulse 1.4s ease-in-out infinite;
}

.summary-card-hint {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  line-height: 1.35;
  word-break: break-word;
}

.summary-card.status-failed .summary-card-hint {
  color: #ef4444;
}

.org-ctx-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  margin-left: 0.35rem;
}

.execution-log .label {
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.78rem;
}

.repl-panel {
  align-self: flex-start;
  flex-shrink: 0 !important;
  max-width: 85%;
  margin: 0.5rem 0;
  border: 1px solid var(--process-panel-border);
  border-radius: 10px;
  background: var(--process-panel-bg);
  overflow: visible;
  color: var(--text);
}

.repl-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--process-panel-border);
  letter-spacing: 0.02em;
}

.repl-panel-title {
  text-transform: none;
}

.repl-panel-toggle {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--process-panel-border);
  background: var(--overlay-surface);
  color: var(--text-muted);
  cursor: pointer;
}

.repl-panel-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.repl-panel.repl-panel-collapsed .tool-runs-panel,
.repl-panel.repl-panel-collapsed .message.repl,
.repl-panel.repl-panel-collapsed .thinking-block {
  display: none;
}

.thinking-block {
  margin: 0.35rem 0.75rem 0.5rem;
  border: 1px dashed var(--thinking-border);
  border-radius: 8px;
  background: var(--thinking-bg);
}

.thinking-block--streaming .thinking-block-body {
  font-size: 0.72rem;
  color: var(--thinking-stream);
  opacity: 0.82;
}

.thinking-block--done {
  border-style: solid;
  border-color: color-mix(in srgb, var(--thinking-border) 60%, transparent);
  background: color-mix(in srgb, var(--thinking-bg) 50%, transparent);
}

.thinking-block--done .thinking-block-summary {
  color: var(--text-muted);
  font-weight: 500;
}

.thinking-block--done .thinking-block-body {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.88;
}

.thinking-block-summary {
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--thinking-summary);
  list-style: none;
}

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

.thinking-block-body {
  padding: 0 0.65rem 0.55rem;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--thinking-body);
  white-space: pre-wrap;
  max-height: 280px;
  overflow-y: auto;
}

body.chat-thinking-hidden .thinking-block {
  display: none !important;
}

body.chat-process-hidden .repl-panel {
  display: none !important;
}

.tool-search-results {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

.tool-search-results a {
  color: var(--accent);
  text-decoration: none;
}

.tool-search-results a:hover {
  text-decoration: underline;
}

.tool-run-output-preview {
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.5rem;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--tool-output);
  background: var(--overlay-surface);
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.tool-run-raw-details {
  margin-top: 0.35rem;
  font-size: 0.75rem;
}

.tool-run-raw-details summary {
  cursor: pointer;
  color: var(--text-muted);
}

.tool-run-output-raw {
  margin-top: 0.25rem;
  padding: 0.4rem;
  font-size: 0.72rem;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--tool-output);
  background: var(--code-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.repl-panel .message.repl {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid rgba(30, 41, 59, 0.8);
}

.repl-panel .message.repl:last-child {
  border-bottom: none;
}

.tool-runs-panel {
  padding: 0.5rem 0.65rem 0.65rem;
  border-bottom: 1px solid var(--process-panel-border);
}

.tool-run-group {
  margin-bottom: 0.55rem;
}

.tool-run-group:last-child {
  margin-bottom: 0;
}

.tool-run-group-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--process-head-text);
  margin-bottom: 0.35rem;
}

.tool-run-icon {
  font-size: 0.85rem;
  opacity: 0.9;
}

.tool-run-card {
  border: 1px solid var(--process-card-border);
  border-radius: 8px;
  background: var(--process-card-bg);
  margin-bottom: 0.35rem;
  overflow: hidden;
}

.tool-run-card:last-child {
  margin-bottom: 0;
}

.tool-run-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.76rem;
}

.tool-run-status {
  flex-shrink: 0;
  width: 1.1rem;
  text-align: center;
  color: var(--tool-muted);
}

.tool-run-input {
  color: var(--tool-input);
  word-break: break-all;
}

.tool-run-running .tool-run-status {
  color: var(--tool-running);
}

.tool-run-worker .tool-run-status {
  color: var(--tool-worker);
}

.tool-run-done .tool-run-status {
  color: var(--tool-done);
}

.tool-run-error .tool-run-status {
  color: var(--tool-error);
}

.tool-run-progress {
  padding: 0 0.55rem 0.35rem;
  font-size: 0.72rem;
  color: var(--tool-progress);
  font-family: "Cascadia Code", "Consolas", monospace;
}

.tool-run-output {
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--tool-output);
  max-height: 12rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.assistant.message-final {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.12);
}

.result-caption {
  flex-shrink: 0;
  align-self: flex-start;
  max-width: 85%;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0.75rem 0 0.25rem;
  letter-spacing: 0.03em;
}

.settings-callout {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(61, 139, 253, 0.08);
  border: 1px solid rgba(61, 139, 253, 0.2);
  font-size: 0.88rem;
  line-height: 1.5;
}

.settings-effective-box {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.35);
  font-size: 0.88rem;
}

.composer-model-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--overlay-surface);
}

.composer-model-prefix {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.composer-model-label select {
  max-width: 180px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.composer-model-label select:focus {
  outline: none;
}

.message.tool {
  align-self: stretch;
  max-width: 100%;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.25);
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
}

.composer {
  padding: 0.75rem 1.25rem 1.25rem;
  border-top: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg-deep) 92%, transparent) 35%);
}

.composer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: var(--overlay-glass);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.75rem 1rem 0.65rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.composer-input-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.composer-input-row textarea {
  flex: 1;
  min-width: 0;
}

.composer-plus-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-top: 0.1rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--overlay-surface);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.composer-plus-btn:hover,
.composer-plus-btn[aria-expanded="true"] {
  color: var(--text);
  border-color: var(--accent);
  background: var(--overlay-surface);
}

.composer-plus-menu {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 0;
  min-width: 13.5rem;
  padding: 0.35rem 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated, #fff);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
  z-index: 50;
}

.composer-plus-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
}

.composer-plus-item:hover {
  background: var(--overlay-surface);
}

.composer-plus-icon {
  width: 1.15rem;
  flex-shrink: 0;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.88;
}

.composer-plus-label {
  flex: 1;
  min-width: 0;
}

.composer-plus-arrow {
  color: var(--text-muted);
  font-size: 0.95rem;
  opacity: 0.55;
}

.composer-plus-check {
  color: var(--accent);
  font-size: 0.78rem;
  opacity: 0;
}

.composer-plus-sep {
  height: 1px;
  margin: 0.25rem 0.65rem;
  background: var(--border-subtle);
}

.composer-submenu-wrap {
  position: relative;
}

.composer-plus-submenu {
  position: absolute;
  left: calc(100% + 0.25rem);
  top: 0;
  min-width: 10.5rem;
  padding: 0.35rem 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated, #fff);
  box-shadow: var(--shadow);
  z-index: 51;
}

.composer-plus-subitem {
  padding-left: 0.75rem;
}

.composer-recent-wrap .composer-recent-scope {
  position: relative;
}

.composer-recent-flyout {
  position: absolute;
  left: calc(100% + 0.25rem);
  top: 0;
  min-width: 14rem;
  max-width: 20rem;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.35rem 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated, #fff);
  box-shadow: var(--shadow);
  z-index: 52;
}

.composer-recent-file {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}

.composer-recent-file:hover {
  background: var(--gold-dim);
}

.composer-recent-file-name {
  font-size: 0.85rem;
  word-break: break-all;
}

.composer-recent-file-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.composer-recent-empty {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

.composer-pill-web.composer-pill-active,
.composer-pill-web[aria-pressed="true"] {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
}

.composer-pill-thinking {
  transition: opacity 0.12s ease, border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.composer-pill-thinking[aria-pressed="false"] {
  opacity: 0.5;
  color: var(--text-muted);
  border-color: var(--border-subtle);
  background: transparent;
}

.composer-pill-thinking[aria-pressed="true"],
.composer-pill-thinking.composer-pill-active {
  opacity: 1;
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.45);
  background: rgba(124, 58, 237, 0.12);
  font-weight: 600;
}

.mention-item-loading {
  pointer-events: none;
  opacity: 0.75;
  font-style: italic;
}

.composer textarea {
  border: none;
  background: transparent;
  resize: none;
  min-height: 56px;
  max-height: 200px;
  padding: 0.15rem 0.35rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
}

.composer textarea::placeholder {
  color: color-mix(in srgb, var(--text-muted) 75%, transparent);
}

.composer textarea:focus { box-shadow: none; border: none; outline: none; }

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.15rem;
  border-top: 1px solid var(--border-subtle);
}

.composer-toolbar-left,
.composer-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.composer-hints {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.composer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--overlay-surface);
  font-size: 0.76rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}

.composer-pill:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
}

.composer-pill-active,
.composer-pill[aria-pressed="true"] {
  color: #059669;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.composer-pill-icon {
  font-size: 0.72rem;
  opacity: 0.85;
}

.composer-chevron {
  font-size: 0.62rem;
  opacity: 0.65;
  margin-left: -0.1rem;
}

.composer-refs-count:empty {
  display: none;
}

.composer-refs-count:not(:empty)::before {
  content: " · ";
}

.composer-menu-wrap {
  position: relative;
}

.composer-dropdown {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  left: 0;
  min-width: 11rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated, var(--overlay-glass));
  box-shadow: var(--shadow);
  z-index: 40;
}

.composer-dropdown-attach {
  left: auto;
  right: 0;
}

.composer-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.composer-dropdown-item:hover {
  background: var(--overlay-surface);
}

.composer-dropdown-check {
  width: 0.85rem;
  color: var(--accent);
  opacity: 0;
  font-size: 0.72rem;
}

.composer-dropdown-item.is-on .composer-dropdown-check {
  opacity: 1;
}

.composer-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--overlay-surface);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}

.composer-icon-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.composer-send-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  border: none;
  background: color-mix(in srgb, var(--text-muted) 25%, var(--border-subtle));
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, transform 0.1s ease;
}

.composer-send-circle:not(:disabled):not(.hidden).composer-send-ready {
  background: var(--text);
  color: var(--bg-deep, #fff);
}

.composer-send-circle:not(:disabled):hover {
  transform: scale(1.04);
}

.composer-send-circle.hidden {
  display: none;
}

.composer-send-circle.composer-stop-active {
  background: #ef4444;
  color: #fff;
}

.composer-audio-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--overlay-surface);
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.composer-audio-btn:hover {
  border-color: rgba(255, 200, 87, 0.25);
  color: var(--text);
}

.composer-send-btn {
  padding: 0.45rem 1.15rem !important;
  font-size: 0.85rem !important;
  border-radius: 999px !important;
}

.mention-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  z-index: 50;
  margin-bottom: 0.5rem;
}

.mention-menu.open { display: block; }

.mention-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mention-item:hover { background: var(--gold-dim); }

.mention-item-group {
  font-weight: 600;
  border-top: 1px solid var(--border);
}

.mention-item-nested {
  padding-left: 1.25rem;
}

.mention-item-pending {
  opacity: 0.65;
}

.mention-item .tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--gold-dim);
  color: var(--gold-light);
}

.composer-wrap { position: relative; }

/* Settings layout v2 — labeled sidebar (enterprise) */
.settings-shell {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  height: 100vh;
  background: var(--bg);
}

.settings-shell-embed {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  background: var(--bg);
}

.settings-embed-body {
  overflow: hidden;
  height: 100%;
  margin: 0;
}

.settings-embed-topbar {
  flex-shrink: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.settings-embed-topbar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.settings-embed-topbar-row .settings-nav-back {
  margin: 0;
  width: auto;
  padding: 0.35rem 0.5rem;
}

.settings-embed-title {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.settings-embed-full {
  padding: 0.3rem 0.65rem !important;
  font-size: 0.8rem !important;
}

.settings-embed-nav-hint {
  margin: 0;
  padding: 0.35rem 0.75rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.onboard-strip-warn {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.settings-next-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.settings-next-steps-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.scenario-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
}

.scenario-link-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scenario-link-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, background 0.12s;
}

.scenario-link-card:hover {
  border-color: rgba(212, 175, 55, 0.4);
  background: var(--gold-dim);
  text-decoration: none;
}

.scenario-link-card strong {
  font-size: 0.9rem;
  color: var(--gold-light);
}

.scenario-link-card span {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.scenario-link-card-sm {
  padding: 0.5rem 0.65rem;
  text-align: center;
}

.scenario-link-card-sm strong {
  font-size: 0.82rem;
}

.de-template-btn {
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
}

body.runtime-offline .composer-inner textarea {
  border-color: rgba(251, 191, 36, 0.35);
}

body.runtime-offline .composer-hints::after {
  content: " · 引擎离线";
  color: var(--gold-light);
}

.settings-embed-tabs,
.settings-module-tabs {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.5rem 1.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.settings-embed-tabs::-webkit-scrollbar,
.settings-module-tabs::-webkit-scrollbar {
  height: 4px;
}

.settings-embed-tab,
.settings-module-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.settings-embed-tab:hover,
.settings-module-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
}

.settings-embed-tab.active,
.settings-module-tab.active {
  background: var(--gold-dim);
  border-color: rgba(212, 175, 55, 0.35);
  color: var(--gold-light);
  font-weight: 500;
}

.settings-embed-tab-icon,
.settings-module-tab-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.settings-embed-tab-sep,
.settings-module-tab-sep {
  width: 1px;
  align-self: stretch;
  margin: 0.25rem 0.15rem;
  background: var(--border);
  flex-shrink: 0;
}

.settings-main-embed {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.settings-header-compact {
  padding: 0.85rem 1.25rem 0.65rem;
}

.settings-header-compact .settings-header-title {
  font-size: 1.15rem;
}

.settings-header-compact .settings-header-desc {
  font-size: 0.8rem;
}

.settings-main-embed .settings-content {
  padding: 1rem 1.25rem 1.5rem;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.settings-main-embed .settings-content .data-table,
.settings-main-embed .settings-content .card,
.settings-main-embed .settings-scene-card {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.settings-nav-v2 {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  gap: 0.25rem;
  overflow-y: auto;
  min-width: 220px;
  min-height: 0;
}

.settings-nav-back {
  display: block;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  border-radius: 8px;
}

.settings-nav-back:hover {
  background: var(--gold-dim);
  color: var(--gold-light);
}

.settings-nav-group {
  margin-bottom: 1rem;
}

.settings-nav-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.25rem 0.75rem 0.5rem;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.settings-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.settings-nav-item.active {
  background: var(--gold-dim);
  color: var(--gold-light);
  font-weight: 500;
}

.settings-nav-icon {
  width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.settings-nav-text {
  flex: 1;
  min-width: 0;
}

.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 2rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.settings-header-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.settings-header-desc {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.settings-user-pill {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* Legacy icon-only nav (fallback) */
.settings-nav {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  gap: 0.5rem;
}

.settings-nav a {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 1.25rem;
  text-decoration: none;
  position: relative;
}

.settings-nav a:hover,
.settings-nav a.active {
  background: var(--gold-dim);
  color: var(--gold-light);
  text-decoration: none;
}

.settings-nav a[title]::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}

.settings-nav a:hover::after { opacity: 1; }

.settings-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  width: 100%;
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem 2rem;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.settings-content .data-table,
.settings-content .card,
.settings-content .settings-scene-card,
.settings-content .settings-stat-row {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.settings-content h1 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}

.settings-content .module-desc {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* In-page section tabs (tools: 内置 / MCP) */
.settings-subnav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.settings-subnav a {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.settings-subnav a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.settings-subnav a.active {
  background: var(--gold-dim);
  color: var(--gold-light);
  font-weight: 500;
}

.settings-scene-card {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.06) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.settings-scene-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.settings-scene-card strong {
  color: var(--text);
}

.settings-stat-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.settings-stat {
  flex: 1;
  min-width: 120px;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.settings-stat-value {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--gold-light);
}

.settings-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state.compact {
  padding: 1.25rem;
  margin: 0.5rem;
  border: none;
  background: var(--gold-dim);
}

.chat-welcome {
  border: none;
  margin: auto;
  max-width: 480px;
  padding: 2.5rem 1.5rem 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat-welcome-visual {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: 1.25rem;
}

.chat-welcome-logo {
  position: relative;
  z-index: 1;
  width: 4.5rem !important;
  height: 4.5rem !important;
  font-size: 0.85rem !important;
  box-shadow: 0 8px 32px rgba(245, 166, 35, 0.25);
}

.chat-welcome-ring {
  position: absolute;
  inset: -0.35rem;
  border-radius: 50%;
  border: 1px solid rgba(245, 166, 35, 0.25);
  animation: chat-welcome-pulse 3s ease-in-out infinite;
}

@keyframes chat-welcome-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 0.25; }
}

.chat-welcome-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

.chat-welcome-lead {
  margin: 0 0 1.35rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 22rem;
}

.chat-welcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.chat-prompt-chip {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 200, 87, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.chat-prompt-chip:hover {
  border-color: rgba(245, 166, 35, 0.45);
  background: rgba(245, 166, 35, 0.1);
  transform: translateY(-1px);
}

.chat-welcome-details {
  width: 100%;
  max-width: 26rem;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--overlay-surface);
  overflow: hidden;
}

.chat-welcome-details summary {
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

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

.chat-welcome-details summary::after {
  content: " ›";
  float: right;
  opacity: 0.5;
}

.chat-welcome-details[open] summary {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
}

.chat-welcome-details-body {
  padding: 0.75rem 0.85rem 0.85rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.chat-welcome-details-body p {
  margin: 0 0 0.5rem;
}

.chat-welcome code {
  color: var(--gold-light);
  background: var(--code-inline-bg);
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  font-size: 0.78rem;
}

.compose-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  margin-bottom: 0.35rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.compose-preview.hidden { display: none; }

.compose-preview.error {
  color: var(--alert-error-text);
  border-color: rgba(248, 113, 113, 0.4);
  background: var(--danger-bg);
}

/* Settings drawer — overlay from chat (keeps conversation context) */
.settings-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: flex-end;
}

.settings-drawer[hidden] {
  display: none !important;
}

.settings-drawer-backdrop {
  flex: 1;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.settings-drawer-panel {
  width: min(1280px, 96vw);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

.settings-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}

.settings-drawer-frame {
  flex: 1;
  border: none;
  width: 100%;
  background: var(--bg);
}

@media (max-width: 1100px) {
  .app-shell-v2 { grid-template-columns: 280px minmax(0, 1fr); }
  .summary-pane.collapsed { display: none; }
}

@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-shell-v2 { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .feature-grid[style*="repeat(3"] { grid-template-columns: 1fr !important; }
  .arch-row-3 { grid-template-columns: 1fr !important; }
}

/* ── Landing enterprise sections ── */
.hero-stats {
  display: flex;
  gap: 2rem;
  margin: 1.75rem 0;
  flex-wrap: wrap;
}

.hero-stats div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hero-stats strong {
  color: var(--gold-light);
  font-size: 0.95rem;
}

.hero-stats span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.feature-card-pro {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
}

.feature-icon {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.architecture {
  padding: 4rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.architecture h2,
.trust-section h2 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2rem;
}

.arch-diagram {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.arch-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.arch-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.arch-box {
  flex: 1;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  font-size: 0.9rem;
}

.arch-box small {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.arch-box.arch-highlight {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(245, 166, 35, 0.12);
}

.arch-box.arch-user {
  max-width: 360px;
  width: 100%;
}

.arch-arrow {
  text-align: center;
  color: var(--text-muted);
  padding: 0.75rem 0;
}

.trust-section {
  background: var(--landing-section-band);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ── Landing v2 — scenario storytelling ── */
.landing-page { scroll-behavior: smooth; }

.landing-nav-links {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  margin-right: 1.5rem;
}

.landing-nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

.landing-nav-links a:hover {
  color: var(--gold-light);
  text-decoration: none;
}

.landing-nav-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.landing-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.landing-container-narrow {
  max-width: 820px;
}

.landing-section {
  padding: 5rem 0;
}

.section-eyebrow {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.75rem;
}

.landing-section h2 {
  text-align: center;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin: 0 0 1rem;
  line-height: 1.2;
}

.landing-section .section-lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 2.5rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

.landing-section .section-lead strong {
  color: var(--text);
  font-weight: 600;
}

.hero-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 2rem 0 2.25rem;
  text-align: left;
}

.hero-pillar {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem;
  background: var(--landing-section-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--landing-panel-shadow);
}

.hero-pillar-icon {
  color: var(--gold);
  font-size: 0.65rem;
}

.hero-pillar strong {
  color: var(--gold-light);
  font-size: 1rem;
}

.hero-pillar span:last-child {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.audience-section {
  background: var(--landing-section-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.audience-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.audience-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.audience-card-alt {
  border-color: var(--landing-audience-alt-border);
  background: var(--landing-audience-alt-bg);
}

.audience-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  color: var(--gold-light);
}

.audience-tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
}

.audience-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  line-height: 1.85;
}

.audience-card li { margin-bottom: 0.35rem; }

.scenario-section-alt {
  background: var(--landing-section-deep);
  border-top: 1px solid var(--border);
}

.story-block {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 2rem;
}

.story-panel {
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.story-panel h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
}

.story-panel ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.story-panel li { margin-bottom: 0.5rem; }

.story-pain {
  border-color: rgba(248, 113, 113, 0.25);
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--landing-story-pain-tint) 100%);
}

.story-pain h3 { color: var(--story-pain); }

.story-solution {
  border-color: rgba(245, 166, 35, 0.35);
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--gold-dim) 100%);
}

.story-solution h3 { color: var(--gold-light); }

.story-outcome {
  border-color: rgba(52, 211, 153, 0.3);
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--landing-story-outcome-tint) 100%);
}

.story-outcome h3 { color: var(--story-outcome); }

.story-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.5rem;
  opacity: 0.5;
}

.scenario-example {
  padding: 1.5rem 2rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--landing-scenario-tint);
}

.scenario-example-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.scenario-example p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 1rem;
}

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

.scenario-example-robot {
  border-style: solid;
  background: var(--bg-card);
}

.robot-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.robot-node {
  flex: 1;
  min-width: 140px;
  max-width: 200px;
  padding: 1rem;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.robot-node-title {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--gold-light);
  margin-bottom: 0.35rem;
}

.robot-node-desc {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.robot-connector {
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--border), var(--gold), var(--border));
  flex-shrink: 0;
}

.robot-flow-caption {
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

.unify-section {
  text-align: center;
  padding: 4rem 0;
  background: var(--landing-unify-bg);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.why-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.why-card {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

.why-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.why-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  color: var(--gold-light);
}

.why-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.deploy-section {
  background: var(--landing-section-muted);
  border-top: 1px solid var(--border);
}

.deploy-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.deploy-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.platform-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.platform-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.platform-card-featured {
  border-color: rgba(245, 166, 35, 0.3);
  box-shadow: var(--landing-panel-shadow);
}

.platform-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--gold-light);
}

.platform-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}

.platform-card-shot {
  border-radius: 8px;
  overflow: hidden;
}

.platform-card-shot .browser-frame,
.platform-card-shot .landing-visual {
  box-shadow: none;
}

.scenario-compact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.scenario-compact-card {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.scenario-compact-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--gold-light);
}

.scenario-compact-lead {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.scenario-compact-example {
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: var(--landing-scenario-tint);
}

.scenario-compact-example p {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.scenario-compact-card ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.cloud-advantages {
  margin-top: 2.5rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cloud-advantages-title {
  margin: 0 0 1.25rem;
  text-align: center;
  font-size: 1.15rem;
  color: var(--gold-light);
}

.cloud-advantages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.cloud-adv-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.15rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.cloud-adv-item strong {
  color: var(--text);
  font-size: 0.95rem;
}

.cloud-adv-item span {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.deploy-path {
  margin-top: 2.5rem;
}

.deploy-path h3 {
  text-align: center;
  margin: 0 0 1.5rem;
  color: var(--gold-light);
  font-size: 1.15rem;
}

.steps-row-inline {
  margin-bottom: 0;
}

.trust-layers {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: 520px;
  margin: 0 auto;
}

.trust-layer {
  width: 100%;
  padding: 1rem 1.25rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.trust-layer-accent {
  border-color: rgba(245, 166, 35, 0.35);
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--gold-dim) 100%);
}

.trust-layer-label {
  display: block;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 0.25rem;
}

.trust-layer-desc {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.trust-layer-arrow {
  color: var(--text-muted);
  opacity: 0.45;
  font-size: 1.1rem;
}

.landing-fold-section {
  background: var(--landing-section-deep);
  border-top: 1px solid var(--border);
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.landing-fold-note {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.cta-block-lead {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.cta-block-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.deploy-card {
  padding: 1.75rem 1.25rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.deploy-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.deploy-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--text);
}

.deploy-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.steps-section {
  padding-bottom: 6rem;
}

.steps-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.step-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--border);
  color: var(--gold-light);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.step-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.step-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.cta-block {
  text-align: center;
  padding: 2.5rem;
  background: var(--landing-cta-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.cta-block h3 {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
}

.btn-lg {
  padding: 1rem 2.25rem;
  font-size: 1.05rem;
}

.landing-footer-sub {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  color: var(--text-muted);
}

/* ── Product screenshot mocks (Web + TUI) ── */
.hero-with-showcase {
  min-height: auto;
  padding: 5.5rem 0 3.5rem;
  text-align: left;
}

.hero-with-showcase .hero-content { max-width: none; }

.hero-with-showcase .hero-copy h1 {
  text-align: left;
  font-size: clamp(2.15rem, 4.2vw, 3.35rem);
  line-height: 1.15;
  margin: 0.85rem 0 1rem;
}

.hero-with-showcase .badge { margin-bottom: 0.25rem; }

.browser-url-dim { color: var(--text-muted); font-style: italic; }

.hero-split-wrap {
  position: relative;
  z-index: 1;
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 3rem;
  align-items: center;
}

.hero-copy .subtitle {
  text-align: left;
  margin: 0 0 1.35rem;
  max-width: 36rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

.hero-highlights {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 36rem;
}

.hero-highlights li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: baseline;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-card) 82%, transparent);
  border: 1px solid var(--border-subtle);
}

.hero-highlights strong {
  color: var(--gold-light);
  font-size: 0.88rem;
  font-weight: 700;
}

.hero-highlights span {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.hero-actions-left { justify-content: flex-start; }

.hero-showcase-stack {
  position: relative;
}

.hero-visual-panel {
  padding: 1.15rem 1.15rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, color-mix(in srgb, var(--bg-card) 94%, var(--gold-dim)) 0%, var(--bg-elevated) 100%);
  box-shadow: var(--landing-panel-shadow);
}

.hero-visual-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-visual-panel-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero-visual-panel-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.hero-visual-panel .landing-visual-hero {
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.hero-visual-panel-foot {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
}

/* Landing concept visuals (not product UI mocks) */
.landing-visual {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, var(--bg-card) 0%, var(--bg-elevated) 55%, var(--bg-deep) 100%);
  box-shadow: var(--landing-panel-shadow);
}

.landing-visual-svg {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.landing-visual-hero {
  padding: 0.35rem;
}

.landing-visual-lg {
  padding: 0.25rem;
}

.landing-visual-sm {
  padding: 0.15rem;
}

.landing-visual-sm .landing-visual-svg {
  min-height: 140px;
}

.platform-card-shot .landing-visual {
  box-shadow: none;
}

.hero-tui-float {
  position: absolute;
  right: -0.5rem;
  bottom: -1.5rem;
  width: 58%;
  z-index: 2;
  box-shadow: var(--mock-float-shadow);
}

.showcase-caption,
.product-gallery figcaption,
.scenario-visual-shot figcaption,
.deploy-showcase-shots figcaption,
.deploy-thumb + h3 + p + figcaption {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0.65rem 0 0;
}

.showcase-caption {
  margin-top: 2rem;
  font-size: 0.82rem;
}

.browser-frame {
  color: var(--text);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--mock-frame-border);
  box-shadow: var(--mock-frame-shadow);
  background: var(--mock-frame-bg);
}

.browser-chrome {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: var(--mock-chrome-bg);
  border-bottom: 1px solid var(--border-subtle);
}

.browser-dots {
  display: flex;
  gap: 0.35rem;
}

.browser-dots i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4b5563;
}

.browser-dots i:nth-child(1) { background: #ef4444; }
.browser-dots i:nth-child(2) { background: #eab308; }
.browser-dots i:nth-child(3) { background: #22c55e; }

.browser-url {
  flex: 1;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--code-inline-bg);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  font-family: "Cascadia Code", "Consolas", monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-label {
  font-size: 0.68rem;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
}

.browser-body {
  background: var(--mock-body-bg);
  overflow: hidden;
}

.product-shot-wrap { font-size: 10px; line-height: 1.4; }

.product-shot-lg .product-shot-wrap { font-size: 11px; }

.product-shot-mini .product-shot-wrap { font-size: 7px; }

.product-shot-mini .browser-chrome { padding: 0.35rem 0.5rem; }

.product-shot-mini .browser-dots i { width: 6px; height: 6px; }

.ps-app-shell {
  display: grid;
  grid-template-columns: 118px 1fr 92px;
  min-height: 220px;
  background: var(--mock-body-bg);
}

.ps-app-shell-compact { grid-template-columns: 100px 1fr; min-height: 160px; }

.ps-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 0.5rem 0;
}

.ps-sidebar-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  font-weight: 700;
  font-size: 1em;
  border-bottom: 1px solid var(--border);
}

.ps-context {
  padding: 0.35rem 0.55rem;
  font-size: 0.85em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.ps-nav-label {
  padding: 0.5rem 0.55rem 0.15rem;
  font-size: 0.68em;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.ps-nav-item {
  padding: 0.35rem 0.55rem;
  font-size: 0.9em;
  color: var(--text-muted);
}

.ps-nav-item.active {
  color: var(--gold-light);
  background: var(--gold-dim);
}

.ps-session-label {
  padding: 0.5rem 0.55rem 0.2rem;
  font-size: 0.72em;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ps-session {
  padding: 0.35rem 0.55rem;
  margin: 0.15rem 0.35rem;
  border-radius: 6px;
  font-size: 0.88em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ps-session.active {
  background: var(--gold-dim);
  color: var(--text);
  border: 1px solid var(--border);
}

.ps-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ps-org-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.85em;
  background: var(--mock-org-bar-bg);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.ps-org-bar strong { color: var(--text); }

.ps-sep { opacity: 0.35; }

.ps-pill {
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.78em;
  border: 1px solid var(--border);
}

.ps-pill.ok {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.35);
}

.ps-chat {
  flex: 1;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow: hidden;
}

.ps-msg-row { display: flex; width: 100%; }

.ps-msg-row.user { justify-content: flex-end; }

.ps-msg-row.assistant { justify-content: flex-start; }

.ps-msg {
  max-width: 88%;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-size: 0.95em;
}

.ps-msg.user {
  background: var(--msg-user-bg);
  border: 1px solid var(--msg-user-border);
}

.ps-msg.assistant {
  background: var(--msg-assistant-bg);
  border: 1px solid var(--msg-assistant-border);
}

.ps-msg-author {
  font-size: 0.75em;
  font-weight: 700;
  margin-bottom: 0.2rem;
  opacity: 0.85;
}

.ps-msg.user .ps-msg-author { color: var(--msg-user-author); }

.ps-msg.assistant .ps-msg-author { color: var(--msg-assistant-author); }

.ps-msg-body { color: var(--text); line-height: 1.5; }

.ps-repl {
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.82em;
  padding: 0.35rem 0.5rem;
  background: var(--msg-system-bg);
  border: 1px solid var(--msg-system-border);
  border-radius: 6px;
  color: var(--msg-system-text);
}

.ps-repl.ok {
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--msg-tool-end);
}

.ps-repl.warn {
  border-color: rgba(245, 166, 35, 0.45);
  color: var(--msg-tool-start);
}

.ps-composer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.ps-composer-ph {
  flex: 1;
  font-size: 0.88em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ps-send {
  font-size: 0.85em;
  font-weight: 700;
  color: #1a1200;
  background: linear-gradient(135deg, var(--gold), #e8890b);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

.ps-summary {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 0.45rem 0.5rem;
}

.ps-summary-head {
  font-weight: 700;
  font-size: 0.95em;
  margin-bottom: 0.45rem;
  color: var(--gold-light);
}

.ps-todo {
  font-size: 0.85em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.ps-todo.done { color: var(--story-outcome); }

.ps-todo.active { color: var(--gold-light); }

.ps-mount {
  margin-top: 0.5rem;
  font-size: 0.82em;
  color: var(--text-muted);
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border);
}

.ps-robot-chip {
  font-size: 0.82em;
  padding: 0.25rem 0.35rem;
  margin-bottom: 0.25rem;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.ps-robot-chip.online {
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--alert-ok-text);
}

.ps-tui {
  padding: 0.65rem 0.75rem;
  min-height: 180px;
  background: var(--mock-tui-bg);
  font-family: "Cascadia Code", "Consolas", "Courier New", monospace;
  font-size: 10px;
  line-height: 1.65;
}

.product-shot-tui-wrap .browser-body { background: var(--mock-tui-bg); }

.ps-tui-title {
  color: var(--mock-tui-title-text);
  font-weight: 700;
  margin-bottom: 0.35rem;
  border: 1px solid var(--mock-tui-title-border);
  padding: 0.35rem 0.5rem;
  background: var(--mock-tui-title-bg);
}

.ps-tui-meta {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-size: 0.92em;
}

.ps-tui-line { margin-bottom: 0.15rem; }

.ps-tui-line.dim { color: var(--msg-repl-muted); }

.ps-tui-line.tool { color: var(--msg-tool-start); }

.ps-tui-line.ok { color: var(--msg-tool-end); }

.ps-tui-line.assist { color: var(--stream-live-text); }

.ps-tui-line.stream { color: var(--msg-progress); }

.ps-tui-prompt {
  margin-top: 0.5rem;
  color: var(--mock-tui-prompt);
}

.ps-tui-cursor {
  color: var(--gold);
  animation: ps-blink 1s step-end infinite;
}

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

.ps-tui-compact { min-height: 100px; font-size: 8px; }

.product-gallery-section {
  background: var(--landing-section-gallery);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-top: 4rem;
}

.product-gallery {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.product-gallery-item { margin: 0; }

.product-gallery-main { grid-row: span 1; }

.scenario-visual-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 2rem;
  align-items: center;
  margin-top: 2rem;
}

.scenario-visual-row-reverse {
  grid-template-columns: 1.25fr 1fr;
}

.scenario-visual-row-reverse .scenario-visual-text { order: 2; }

.scenario-visual-row-reverse .scenario-visual-shot { order: 1; }

.scenario-visual-text p {
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0 0 1rem;
}

.scenario-visual-bullets {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  line-height: 1.85;
  font-size: 0.92rem;
}

.scenario-visual-shot { margin: 0; }

.robot-flow-compact {
  margin-bottom: 1rem;
}

.robot-flow-compact .robot-node {
  min-width: 90px;
  padding: 0.65rem 0.5rem;
}

.deploy-card-featured {
  border-color: rgba(245, 166, 35, 0.25);
}

.deploy-thumb {
  margin: -0.25rem -0.25rem 1rem;
  border-radius: 8px;
  overflow: hidden;
}

.deploy-thumb .browser-frame,
.deploy-thumb .landing-visual {
  box-shadow: none;
  border: none;
  border-radius: 0;
  background: var(--bg-elevated);
}

.ps-deploy-icon,
.ps-deploy-code {
  display: grid;
  place-items: center;
  min-height: 72px;
  font-size: 1.5rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.ps-deploy-code {
  font-size: 0.85rem;
  font-family: "Cascadia Code", "Consolas", monospace;
  line-height: 1.6;
}

.deploy-showcase-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.deploy-showcase-copy h3 {
  margin: 0 0 0.75rem;
  color: var(--gold-light);
  font-size: 1.25rem;
}

.deploy-showcase-copy p {
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 1rem;
}

.deploy-showcase-copy ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  line-height: 1.9;
}

.deploy-showcase-shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.deploy-showcase-shots figure { margin: 0; }

@media (max-width: 960px) {
  .landing-nav-links { display: none; }
  .hero-split { grid-template-columns: 1fr; gap: 2rem; }
  .hero-highlights li { grid-template-columns: 1fr; gap: 0.2rem; }
  .hero-tui-float {
    position: static;
    width: 100%;
    margin-top: 1rem;
  }
  .hero-pillars { grid-template-columns: 1fr; }
  .product-gallery { grid-template-columns: 1fr; }
  .scenario-visual-row,
  .scenario-visual-row-reverse {
    grid-template-columns: 1fr;
  }
  .scenario-visual-row-reverse .scenario-visual-text,
  .scenario-visual-row-reverse .scenario-visual-shot { order: unset; }
  .audience-grid,
  .audience-grid-3 { grid-template-columns: 1fr; }
  .platform-trio { grid-template-columns: 1fr; }
  .scenario-compact-grid { grid-template-columns: 1fr; }
  .why-grid-3 { grid-template-columns: 1fr; }
  .deploy-grid-3 { grid-template-columns: 1fr; }
  .cloud-advantages-grid { grid-template-columns: 1fr; }
  .story-block {
    grid-template-columns: 1fr;
  }
  .story-arrow {
    transform: rotate(90deg);
    padding: 0.25rem 0;
  }
  .why-grid { grid-template-columns: 1fr; }
  .deploy-grid { grid-template-columns: repeat(2, 1fr); }
  .deploy-showcase-row { grid-template-columns: 1fr; }
  .deploy-showcase-shots { grid-template-columns: 1fr; }
  .steps-row { grid-template-columns: 1fr; }
  .robot-flow { flex-direction: column; }
  .robot-connector {
    width: 2px;
    height: 20px;
    background: linear-gradient(180deg, var(--border), var(--gold), var(--border));
  }
}

@media (max-width: 560px) {
  .deploy-grid { grid-template-columns: 1fr; }
  .landing-container { padding: 0 1.25rem; }
  .landing-section { padding: 3.5rem 0; }
}

/* Digital employee capabilities */
.cap-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 1.25rem;
  margin: 1rem 0;
}

.cap-fieldset legend {
  padding: 0 0.5rem;
  font-weight: 600;
  color: var(--gold-light);
}

.cap-section { margin-bottom: 1rem; }

.cap-subtitle {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.cap-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.cap-provider-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--bg-elevated);
}

.cap-provider-title {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text);
}

.cap-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  margin: 0.1rem 0.15rem 0.1rem 0;
  border-radius: 4px;
  font-size: 0.75rem;
  background: var(--gold-dim);
  color: var(--gold-light);
  border: 1px solid var(--border);
}

/* —— List pages: toolbar + modal —— */
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-toolbar-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.page-toolbar-desc {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.page-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.page-section {
  margin-bottom: 2rem;
}

.page-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.page-section-head h2,
.page-section-head h3 {
  margin: 0;
  font-size: 1rem;
}

.list-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.list-panel-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.app-modal {
  border: none;
  padding: 0;
  max-width: none;
  max-height: none;
  background: transparent;
}

.app-modal::backdrop {
  background: var(--overlay-modal);
  backdrop-filter: blur(4px);
}

.app-modal-panel {
  width: min(520px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  margin: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.app-modal-panel-wide {
  width: min(780px, calc(100vw - 2rem));
}

.app-modal-panel-xwide {
  width: min(1040px, calc(100vw - 1.5rem));
}

.app-modal-panel-xwide .cap-grid {
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}

.de-form-page-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: none;
  padding: 1rem;
  background: transparent;
}

.de-form-page-modal::backdrop {
  background: var(--overlay-modal);
  backdrop-filter: blur(4px);
}

.de-form-page-modal .app-modal-panel {
  margin: auto;
}

.de-form-collapse {
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.de-form-collapse > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.de-form-collapse > summary::-webkit-details-marker {
  display: none;
}

.de-form-collapse > summary::after {
  content: "▸";
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: transform 0.15s ease;
}

.de-form-collapse[open] > summary::after {
  transform: rotate(90deg);
}

.de-form-collapse-body {
  padding: 0 0.9rem 0.9rem;
  border-top: 1px solid var(--border);
}

.de-form-collapse-body .cap-fieldset {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.de-form-collapse-hint {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
}

.de-form-scope-hint {
  margin: 0;
  font-size: 0.82rem;
}

.de-form-delete-row {
  max-width: min(1040px, calc(100vw - 1.5rem));
  margin: 0.75rem auto 0;
  text-align: center;
}

.app-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.app-modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.app-modal-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  text-decoration: none;
}

.app-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  overflow-x: visible;
  max-height: min(70vh, calc(100vh - 11rem));
  flex: 1 1 auto;
  min-height: 0;
}

.app-modal-body select,
.app-modal-body .portal-model-select {
  position: relative;
  z-index: 2;
}

.app-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--overlay-footer);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.page-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-tab {
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.page-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ── Landing UI Mockup Enhancement ── */
.scenario-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 2rem;
}

.screenshot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screenshot-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(255, 200, 87, 0.25);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.6), 
    0 0 40px rgba(245, 166, 35, 0.08), 
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
}

.screenshot-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 4px);
  object-fit: cover;
  transition: transform 0.5s ease;
}

.screenshot-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.7), 
    0 0 50px rgba(245, 166, 35, 0.2), 
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 200, 87, 0.5);
}

.screenshot-card:hover img {
  transform: scale(1.01);
}

.screenshot-caption {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--gold-light);
  margin-top: 0.75rem;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.85;
}

.screenshot-caption::before {
  content: "●";
  color: var(--success);
  font-size: 0.65rem;
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

/* Terminal TUI Mockup styling */
.tui-showcase-section {
  margin-top: 3.5rem;
  background: var(--landing-tui-showcase-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem 2rem;
}

.tui-showcase-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.terminal-window {
  background: var(--mock-terminal-bg);
  border: 1px solid var(--mock-terminal-border);
  border-radius: 12px;
  box-shadow: var(--mock-terminal-shadow);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.terminal-window:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
}

.terminal-header {
  background: var(--mock-terminal-header);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-buttons {
  display: flex;
  gap: 0.35rem;
}

.terminal-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-btn.close { background: #ff5f56; }
.terminal-btn.minimize { background: #ffbd2e; }
.terminal-btn.maximize { background: #27c93f; }

.terminal-title {
  margin: 0 auto;
  font-family: var(--font);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  transform: translateX(-15px); /* balance spacing */
}

.terminal-body {
  padding: 6px;
}

.terminal-body img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

@media (max-width: 960px) {
  .scenario-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .tui-showcase-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ── Portal UX helpers (2026-06) ── */
.hidden { display: none !important; }

.form-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.status-pill-active {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.35);
}

.status-pill-ok {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.35);
}

.status-pill-danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.35);
}

.status-pill-muted {
  opacity: 0.85;
}

.usage-progress {
  height: 6px;
  background: var(--progress-track);
  border-radius: 999px;
  overflow: hidden;
}

.usage-progress-lg {
  height: 10px;
  margin-top: 0.75rem;
}

.usage-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold, #c9a227), var(--gold-light, #e8c96a));
  border-radius: 999px;
  min-width: 2px;
  transition: width 0.3s ease;
}

.usage-stat-row {
  margin-bottom: 1.25rem;
}

.usage-stat-card {
  min-width: 0;
}

.quota-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.quota-card-pct {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold-light, #e8c96a);
}

.checkbox-list-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 10rem;
  overflow-y: auto;
  padding: 0.5rem 0.65rem;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.checkbox-row {
  font-size: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.model-usage-steps {
  margin-top: 0.75rem;
}

.usage-steps-list {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
  line-height: 1.65;
  font-size: 0.9rem;
}

.model-picker-mock {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
}

.page-chat .chat-topbar {
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--overlay-header);
  backdrop-filter: blur(12px);
}

.page-chat .chat-topbar-title {
  flex: 1;
  min-width: 0;
}

.page-chat .session-title-form input {
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.page-chat .chat-topbar-btn {
  padding: 0.35rem 0.75rem !important;
  font-size: 0.78rem !important;
  border-radius: 999px !important;
}

.page-chat .chat-topbar-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--overlay-surface);
}

.page-chat .runtime-pill {
  font-size: 0.68rem;
  padding: 0.2rem 0.6rem;
  letter-spacing: 0.02em;
}

.model-picker-mock-select {
  padding: 0.25rem 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  color: var(--gold-light);
}

.login-theme-bar {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  margin-right: 0.35rem;
  flex: 0 0 auto;
  pointer-events: none;
}

.session-pin-btn,
.session-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.session-action-icon {
  display: block;
  flex-shrink: 0;
}

.session-row.pinned .session-pin-btn,
.session-row.pinned .session-pin-btn.active {
  opacity: 1;
  color: var(--gold);
}

.session-row:hover .session-pin-btn,
.session-row:hover .session-menu-btn,
.session-row:has(.session-item-title:hover) .session-pin-btn,
.session-row:has(.session-item-title:hover) .session-menu-btn,
.session-row:has(.session-actions:hover) .session-pin-btn,
.session-row:has(.session-actions:hover) .session-menu-btn {
  opacity: 1;
}

.session-pin-btn:hover,
.session-pin-btn.active:hover {
  background: rgba(212, 163, 89, 0.14);
  color: var(--gold);
}

.session-menu-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ── Inbox Email List Redesign ── */
.inbox-list {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 1rem;
}

.inbox-header-row {
  display: grid;
  grid-template-columns: 90px 90px 130px 1fr 120px 170px;
  background: var(--overlay-header);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  align-items: center;
}

.inbox-row {
  display: grid;
  grid-template-columns: 90px 90px 130px 1fr 120px 170px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.inbox-row:hover {
  background-color: var(--bg-hover);
}

.inbox-row.is-pending {
  font-weight: 600;
  color: var(--text);
  background: rgba(212, 163, 89, 0.03);
}

.inbox-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 0.5rem;
}

.inbox-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.inbox-status-dot::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.inbox-status-dot.status-pending {
  color: var(--gold-light);
}
.inbox-status-dot.status-pending::before {
  background-color: #f5a623;
  box-shadow: 0 0 8px #f5a623;
}

.inbox-status-dot.status-approved {
  color: var(--success);
}
.inbox-status-dot.status-approved::before {
  background-color: var(--success);
}

.inbox-status-dot.status-rejected {
  color: var(--danger);
}
.inbox-status-dot.status-rejected::before {
  background-color: var(--danger);
}

.inbox-type-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
}

.inbox-type-badge.type-approval {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.inbox-type-badge.type-question {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.inbox-type-badge.type-report {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(107, 114, 128, 0.25);
}

.inbox-cell-subject {
  color: var(--text);
  font-size: 0.9rem;
}

.inbox-cell-session {
  color: var(--text-muted);
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
}

.inbox-cell-time {
  color: var(--text-muted);
}

/* Modal UI styles */
.inbox-modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
}

.inbox-modal-meta-item {
  color: var(--text-muted);
}

.inbox-modal-meta-item strong {
  color: var(--text);
  font-weight: 600;
}

.inbox-modal-body-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 25vh;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.inbox-modal-attachments-section {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-bottom: 1rem;
}

.inbox-modal-action-section {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.inbox-instructions-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.inbox-resolved-banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.inbox-resolved-banner.decision-approve {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.inbox-resolved-banner.decision-reject {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ==========================================
   Permission Dialog Premium Redesign
   ========================================== */

#permission-modal .modal-panel {
  width: min(520px, 94vw);
  max-height: min(90vh, 720px);
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  overflow-x: hidden;
  overflow-y: auto;
  animation: perm-modal-zoom 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes perm-modal-zoom {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.perm-header {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.85rem;
}

.perm-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
}

.perm-icon-wrap.risk-high {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.perm-icon-wrap.risk-medium {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(245, 166, 35, 0.25);
}

.perm-icon-wrap.risk-low {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(91, 156, 245, 0.25);
}

.perm-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.perm-title-group h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.perm-bubble-hint {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  border-radius: 6px;
  background: rgba(245, 166, 35, 0.08);
  border: 1px solid rgba(245, 166, 35, 0.15);
  color: var(--gold-light);
  line-height: 1.4;
}

.perm-bubble-hint.hidden {
  display: none;
}

.perm-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.perm-info-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.perm-info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.perm-info-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.perm-info-value.perm-target-path {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--code-inline-bg);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  margin-top: 0.25rem;
  max-height: 80px;
  overflow-y: auto;
  white-space: pre-wrap;
  border: 1px solid var(--border-subtle);
}

.perm-risk-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.perm-risk-banner.risk-high {
  background: var(--danger-bg);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: var(--alert-error-text);
}

.perm-risk-banner.risk-medium {
  background: var(--gold-dim);
  border: 1px solid rgba(245, 166, 35, 0.2);
  color: var(--gold-light);
}

.perm-risk-banner.risk-low {
  background: var(--blue-dim);
  border: 1px solid rgba(91, 156, 245, 0.2);
  color: var(--text-secondary);
}

.perm-risk-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  flex-shrink: 0;
  letter-spacing: 0.05em;
  margin-top: 0.1rem;
}

.perm-risk-banner.risk-high .perm-risk-badge {
  background: var(--danger);
  color: var(--btn-primary-text);
}

.perm-risk-banner.risk-medium .perm-risk-badge {
  background: var(--gold);
  color: var(--btn-primary-text);
}

.perm-risk-banner.risk-low .perm-risk-badge {
  background: var(--blue);
  color: #fff;
}

.perm-risk-desc {
  flex: 1;
}

.perm-raw-details {
  margin-top: 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-deep);
  overflow: hidden;
}

.perm-raw-details summary {
  padding: 0.5rem 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--overlay-surface);
  user-select: none;
  font-weight: 600;
  outline: none;
}

.perm-raw-details summary:hover {
  background: var(--overlay-surface-hover);
  color: var(--text);
}

.perm-raw-details[open] summary {
  border-bottom: 1px solid var(--border-subtle);
}

.perm-raw-details pre.code-block {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.75rem;
}

/* Modal Actions specific adjustments */
.perm-modal-actions {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

/* Ask-user questionnaire (permission modal + chat inline) */
.perm-modal--ask-user .modal-panel {
  max-width: 36rem;
  max-height: min(92vh, 680px);
}

.perm-modal--ask-user .perm-body {
  overflow-y: auto;
  max-height: calc(92vh - 11rem);
}

.perm-ask-user-panel {
  margin-bottom: 0.75rem;
}

.perm-ask-user-panel.hidden {
  display: none;
}

.perm-ask-user-intro {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.perm-ask-user-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.perm-ask-user-question {
  padding: 0.65rem 0.75rem;
  background: var(--overlay-surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.perm-ask-user-qtext {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.perm-ask-user-option {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.35rem 0;
  font-size: 0.86rem;
  line-height: 1.4;
  cursor: pointer;
}

.perm-ask-user-option input[type="radio"],
.perm-ask-user-option input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.perm-ask-user-other-text {
  flex: 1;
  min-width: 0;
  margin-left: 0.25rem;
  padding: 0.25rem 0.45rem;
  font-size: 0.84rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-deep);
  color: inherit;
}

.perm-ask-user-free {
  width: 100%;
  padding: 0.45rem 0.55rem;
  font-size: 0.86rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-deep);
  color: inherit;
  resize: vertical;
}

.chat-ask-user-bar {
  margin-top: 0.55rem;
  padding: 0.55rem 0.65rem;
  background: rgba(245, 166, 35, 0.08);
  border: 1px solid rgba(245, 166, 35, 0.22);
  border-radius: var(--radius-sm, 6px);
  font-size: 0.84rem;
}

.chat-ask-user-head {
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--gold-light, var(--text-primary));
}

.chat-ask-user-question + .chat-ask-user-question {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-subtle);
}

.chat-ask-user-qtext {
  font-weight: 600;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.chat-ask-user-options {
  margin: 0.15rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.chat-ask-user-options li + li {
  margin-top: 0.15rem;
}

.chat-ask-user-answer {
  margin-top: 0.25rem;
  color: var(--text-primary);
  font-weight: 500;
}

.chat-ask-user-answer--summary {
  margin-top: 0.45rem;
  font-weight: 400;
  color: var(--text-muted);
}

.chat-ask-user-hint {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  color: var(--gold-light, var(--text-muted));
  font-style: italic;
}

.chat-ask-user-bar--interactive {
  border-color: rgba(245, 166, 35, 0.35);
}

.chat-ask-user-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.chat-ask-user-bar--interactive .perm-ask-user-question {
  padding: 0.55rem 0.65rem;
  background: var(--bg-card, rgba(0, 0, 0, 0.15));
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.chat-ask-user-bar--interactive .perm-ask-user-qtext {
  color: var(--text-primary);
  font-size: 0.88rem;
}

.chat-ask-user-bar--interactive .perm-ask-user-option {
  color: var(--text-primary);
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.3rem 0;
  cursor: pointer;
}

.chat-ask-user-bar--interactive .perm-ask-user-option-text {
  color: var(--text-primary);
  line-height: 1.45;
}

.chat-ask-user-bar--interactive .perm-ask-user-other-text,
.chat-ask-user-bar--interactive .perm-ask-user-free {
  color: var(--text-primary);
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
}

.chat-ask-user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.perm-ask-user-option-text {
  color: var(--text-primary);
  line-height: 1.45;
}

.btn-danger-hover {
  transition: all 0.2s ease;
}

.btn-danger-hover:hover {
  background: var(--danger-bg) !important;
  color: var(--danger) !important;
  border-color: rgba(248, 113, 113, 0.4) !important;
}

.btn-gold-hover {
  transition: all 0.2s ease;
}

.btn-gold-hover:hover {
  background: var(--gold-dim) !important;
  color: var(--gold-light) !important;
  border-color: var(--border-accent) !important;
}

/* --- Project mode & workspace panel (chat) --- */
.sidebar-panel-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-panel-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.5rem;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}
.sidebar-panel-tab.active {
  color: var(--text);
  background: var(--overlay-surface);
}
.sidebar-tab-panel { display: none; flex: 1; min-height: 0; flex-direction: column; overflow: hidden; }
.sidebar-tab-panel.active { display: flex; }
.sidebar-panel:has([data-sidebar-tab="workspace"].active) .session-batch-toggle { visibility: hidden; }
.sidebar-panel:has([data-sidebar-tab="workspace"].active) #session-batch-bar { display: none !important; }

.workspace-tree-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem 0.35rem;
}
.workspace-tree-breadcrumbs {
  font-size: 0.75rem;
  padding: 0 0.75rem 0.35rem;
  color: var(--text-muted);
  word-break: break-all;
}
.workspace-tree-breadcrumbs a { color: var(--gold); text-decoration: none; }
.workspace-tree-list {
  flex: 1;
  overflow: auto;
  padding: 0.25rem 0.5rem 0.75rem;
}
.workspace-tree-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
}
.workspace-tree-item:hover { background: var(--overlay-surface); }
.workspace-tree-item.is-dir { font-weight: 600; }
.workspace-tree-hint {
  font-size: 0.72rem;
  padding: 0 0.75rem 0.65rem;
  margin: 0;
}

.chat-right-column {
  display: contents;
  min-height: 0;
}

.wb-rail-project.active,
.wb-rail-workspace.active {
  color: var(--gold-light);
  background: var(--gold-dim);
}

.create-project-panel {
  max-width: 480px;
}

.cron-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
}
.cron-template-card {
  text-align: left;
  border: 1px solid var(--border-subtle);
  background: var(--overlay-surface);
  border-radius: var(--radius-sm, 8px);
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.12s;
}
.cron-template-card:hover {
  border-color: var(--gold-light);
}
.cron-template-card-title {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}
.cron-template-card-desc {
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
  margin-bottom: 0.35rem;
}
.cron-template-card-meta {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
