* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
.is-hidden { display: none !important; }
.flex-row { display: flex; align-items: center; gap: var(--space-2); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.flex-wrap { flex-wrap: wrap; }
.flex-col { display: flex; flex-direction: column; gap: var(--space-2); }
.flex-1 { flex: 1; min-width: 0; }
.gap-xs { gap: var(--space-1); }
.gap-sm { gap: var(--space-2); }
.gap-md { gap: var(--space-3); }
.mb-sm { margin-bottom: var(--space-2); }
.mb-md { margin-bottom: var(--space-3); }
.mt-sm { margin-top: var(--space-2); }
.text-muted { color: var(--text-muted); font-size: var(--fs-xs); }
.text-secondary { color: var(--text-secondary); font-size: var(--fs-sm); }
.text-bold { font-weight: 700; }
.text-center { text-align: center; }

.login-overlay, .modal-overlay {
  position: fixed; inset: 0; background: var(--bg-overlay); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: var(--space-5);
}
.login-card, .modal-card {
  width: 100%; max-width: var(--login-card-width); background: var(--bg-surface);
  border: 1px solid var(--border-gold); border-radius: var(--radius-xl); box-shadow: var(--shadow-float); overflow: hidden;
}
.login-card-header, .modal-card-header {
  background: var(--bg-obsidian); color: var(--text-on-dark); padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-gold); display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.login-card-body, .modal-card-body {
  padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-3);
}

.app-shell { display: flex; height: 100vh; width: 100vw; overflow: hidden; position: relative; }
.mobile-Menu-backdrop { display: none; position: fixed; inset: 0; background: var(--bg-overlay); z-index: 45; }
.sidebar {
  width: var(--sidebar-width); min-width: var(--sidebar-width); background: var(--bg-surface);
  border-right: 1px solid var(--border-hairline); display: flex; flex-direction: column;
  justify-content: space-between; padding: var(--space-3); overflow-y: auto; z-index: 50;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.brand-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-1) var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-hairline); margin-bottom: var(--space-3);
}
.brand-identity { display: flex; align-items: center; gap: var(--space-2); }
.brand-logo {
  width: var(--avatar-sm); height: var(--avatar-sm); border-radius: var(--radius-sm);
  background: var(--accent-ink); border: 1px solid var(--border-gold); color: var(--accent-gold-light);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-weight: 700; font-size: var(--fs-md);
}
.brand-title { font-size: var(--fs-md); font-weight: 700; color: var(--text-primary); }
.brand-subtitle { font-size: var(--fs-xs); color: var(--text-muted); }
.left-persona-switcher-card {
  background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); box-shadow: var(--shadow-card);
}
.left-persona-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.left-persona-user { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.user-avatar {
  width: var(--avatar-sm); height: var(--avatar-sm); border-radius: var(--radius-pill);
  background: var(--accent-ink); color: var(--accent-gold-light); display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: var(--fs-sm); flex-shrink: 0;
}
.user-avatar.avatar-md { width: var(--avatar-md); height: var(--avatar-md); font-size: var(--fs-md); }
.user-name { font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role-tag { font-size: var(--fs-xs); color: var(--text-muted); }
.persona-groups-row {
  display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2);
  padding-top: var(--space-2); border-top: 1px dashed var(--border-hairline);
}
.nav-section { margin-bottom: var(--space-3); }
.nav-section-label {
  font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted);
  padding: var(--space-1) var(--space-2); display: flex; align-items: center; justify-content: space-between;
}
.nav-list { display: flex; flex-direction: column; gap: var(--space-1); }
.nav-btn {
  width: 100%; border: 1px solid transparent; background: transparent; color: var(--text-secondary);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); font-size: var(--fs-sm); font-weight: 500;
  display: flex; align-items: center; justify-content: space-between; cursor: pointer; transition: all 0.14s ease;
  text-align: left; font-family: inherit;
}
.nav-btn:hover { background: var(--bg-subtle); color: var(--text-primary); }
.nav-btn.active { background: var(--accent-ink); color: var(--text-on-dark); font-weight: 600; box-shadow: var(--shadow-card); }
.nav-btn-left { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.sidebar-footer { border-top: 1px solid var(--border-hairline); padding-top: var(--space-2); display: flex; flex-direction: column; gap: var(--space-1); }
.boss-entry-btn {
  width: 100%; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  border: 1px solid var(--border-gold); background: var(--bg-obsidian); color: var(--accent-gold-light);
  font-size: var(--fs-sm); font-weight: 600; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; font-family: inherit;
}
.boss-entry-btn.active { border-color: var(--accent-gold); }

.workspace-split { flex: 1; display: flex; height: 100vh; overflow: hidden; position: relative; }
.main-stage { flex: 1; display: flex; flex-direction: column; height: 100vh; min-width: 0; overflow: hidden; background: var(--bg-canvas); }
.top-header {
  min-height: var(--header-height); padding: var(--space-2) var(--space-5); background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline); display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.header-left { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.header-right { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.mobile-menu-btn {
  display: none; border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text-primary);
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); font-size: var(--fs-sm); font-weight: 700; cursor: pointer;
}
.stage-pill {
  font-size: var(--fs-xs); font-weight: 600; padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-pill); background: var(--accent-ink); color: var(--accent-gold-light); white-space: nowrap;
}
.stage-title { font-size: var(--fs-md); font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: var(--space-4) var(--space-5) var(--space-6); }
.stage-container { max-width: var(--stage-max-width); margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-3); }

.panel-card {
  background: var(--bg-card); border: 1px solid var(--border-hairline); border-radius: var(--radius-lg);
  padding: var(--space-4); box-shadow: var(--shadow-card);
}
.panel-subbox {
  background: var(--bg-surface); border: 1px solid var(--border-hairline); border-radius: var(--radius-md); padding: var(--space-3);
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin-bottom: var(--space-3); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border-hairline); flex-wrap: wrap;
}
.panel-title { font-size: var(--fs-md); font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: var(--space-2); }
.panel-subtitle { font-size: var(--fs-xs); color: var(--text-muted); margin-top: var(--space-1); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.stat-box {
  background: var(--bg-surface); border: 1px solid var(--border-hairline); border-radius: var(--radius-md);
  padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-1);
}
.stat-label { font-size: var(--fs-xs); color: var(--text-secondary); font-weight: 500; }
.stat-value { font-size: var(--fs-lg); font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.stat-meta { font-size: var(--fs-xs); color: var(--text-muted); }

.btn {
  border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text-primary);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm); font-size: var(--fs-sm); font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1);
  transition: all 0.15s ease; font-family: inherit; white-space: nowrap; text-decoration: none;
}
.btn:hover:not(:disabled) { background: var(--bg-subtle); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { padding: var(--space-1) var(--space-2); font-size: var(--fs-xs); border-radius: var(--radius-xs); }
.btn-primary { background: var(--accent-ink); color: var(--text-on-dark); border-color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-ink-hover); }
.btn-emerald { background: var(--accent-emerald); color: var(--bg-card); border-color: var(--accent-emerald); }
.btn-emerald:hover:not(:disabled) { background: var(--accent-emerald-hover); }
.btn-amber { background: var(--accent-gold-soft); color: var(--accent-amber-text); border-color: var(--accent-gold); }
.btn-terracotta { background: var(--accent-terracotta); color: var(--bg-card); border-color: var(--accent-terracotta); }
.btn-rose { background: var(--accent-rose-soft); color: var(--accent-rose); border-color: var(--accent-rose-border); }
.btn-ghost-dark { background: var(--bg-glass-light); color: var(--text-on-dark); border-color: var(--border-on-dark); }

.tag {
  font-size: var(--fs-xs); font-weight: 600; padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-pill); background: var(--bg-subtle); color: var(--text-secondary);
  border: 1px solid var(--border-hairline); white-space: nowrap; display: inline-flex; align-items: center; gap: var(--space-1);
}
.tag.emerald { background: var(--accent-emerald-soft); color: var(--accent-emerald); border-color: var(--accent-emerald-border); }
.tag.amber { background: var(--accent-gold-soft); color: var(--accent-amber-text); border-color: var(--accent-amber-border); }
.tag.rose { background: var(--accent-rose-soft); color: var(--accent-rose); border-color: var(--accent-rose-border); }
.tag.obsidian { background: var(--accent-ink); color: var(--accent-gold-light); border-color: var(--accent-gold); }

.form-field { display: flex; flex-direction: column; gap: var(--space-1); }
.form-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea {
  border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text-primary);
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); font-size: var(--fs-sm);
  font-family: inherit; outline: none; width: 100%;
}
.form-select-compact { width: auto; min-width: 130px; }
.form-textarea { resize: vertical; min-height: 72px; line-height: 1.45; }

.clean-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.clean-table th {
  text-align: left; padding: var(--space-2) var(--space-3); background: var(--bg-surface);
  color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid var(--border-hairline);
}
.clean-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-hairline); color: var(--text-primary); vertical-align: middle; }

.error-alert-box {
  background: var(--accent-rose-soft); border: 1px solid var(--accent-rose); color: var(--accent-rose-dark);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); font-size: var(--fs-sm); font-weight: 600;
}
.success-alert-box {
  background: var(--accent-emerald-soft); border: 1px solid var(--accent-emerald-border); color: var(--accent-emerald);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); font-size: var(--fs-sm); font-weight: 600;
}

.status-dot { width: var(--dot-size); height: var(--dot-size); border-radius: var(--radius-pill); display: inline-block; flex-shrink: 0; }
.status-dot.green { background: var(--status-green); }
.status-dot.yellow { background: var(--status-yellow); }
.status-dot.red { background: var(--status-red); }

.server-status-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); background: var(--bg-surface); border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md); cursor: pointer; user-select: none; transition: background 0.14s ease;
}
.server-status-bar:hover { background: var(--bg-subtle); }
.server-status-summary { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-base); font-weight: 600; color: var(--text-primary); }

.row-action-cell { position: relative; }
.row-more-menu {
  position: absolute; right: var(--space-2); top: 100%; min-width: 140px; background: var(--bg-card);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-popover);
  padding: var(--space-1); display: flex; flex-direction: column; gap: var(--space-1); z-index: 80;
}
.row-more-item {
  width: 100%; border: none; background: transparent; color: var(--text-primary);
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-xs); font-size: var(--fs-sm);
  text-align: left; cursor: pointer; font-family: inherit;
}
.row-more-item:hover { background: var(--bg-subtle); }
.row-more-item.danger { color: var(--accent-rose); }
.row-inline-reset {
  margin-top: var(--space-2); padding: var(--space-2); background: var(--bg-surface);
  border: 1px solid var(--border-hairline); border-radius: var(--radius-sm); display: flex; align-items: center; gap: var(--space-1);
}

.kanban-list { display: flex; flex-direction: column; gap: var(--space-2); }
.kanban-row, .kanban-card {
  background: var(--bg-surface); border: 1px solid var(--border-hairline); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4); display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); cursor: pointer; transition: all 0.14s ease;
}
.kanban-row:hover, .kanban-card:hover { border-color: var(--accent-gold); background: var(--accent-gold-soft); }
.kanban-row-title { font-size: var(--fs-base); font-weight: 600; color: var(--text-primary); }
.kanban-row-right { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

.passkey-gate-card {
  max-width: var(--passkey-card-width); margin: var(--space-6) auto; background: var(--bg-obsidian);
  color: var(--text-on-dark); border: 1px solid var(--accent-gold); border-radius: var(--radius-xl);
  padding: var(--space-6); box-shadow: var(--shadow-float); display: flex; flex-direction: column; gap: var(--space-3);
}
.passkey-input-big {
  font-family: var(--font-mono); font-size: var(--fs-passkey); font-weight: 700; letter-spacing: 0.35em;
  text-align: center; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  border: 1px solid var(--accent-gold); background: var(--bg-obsidian-elevated); color: var(--accent-gold-light);
  width: 100%; outline: none;
}
.ai-member-card, .skill-card {
  background: var(--bg-surface); border: 1px solid var(--border-hairline); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; justify-content: space-between;
  gap: var(--space-2); cursor: pointer; transition: all 0.15s ease;
}
.ai-member-card:hover, .skill-card:hover { border-color: var(--accent-gold); background: var(--accent-gold-soft); }
.memory-split-grid { display: grid; grid-template-columns: var(--sidebar-width) 1fr; gap: var(--space-3); min-height: 360px; }
.memory-file-list { display: flex; flex-direction: column; gap: var(--space-1); border-right: 1px solid var(--border-hairline); padding-right: var(--space-2); }
.memory-file-btn {
  width: 100%; text-align: left; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline); background: var(--bg-surface); cursor: pointer; font-family: inherit;
}
.memory-file-btn.active, .memory-file-btn:hover { background: var(--accent-ink); color: var(--accent-gold-light); border-color: var(--accent-gold); }
.memory-pre-box { white-space: pre-wrap; word-break: break-word; font-family: var(--font-sans); font-size: var(--fs-sm); line-height: 1.65; color: var(--text-primary); }
.upload-dropzone {
  background: var(--bg-surface); border: 2px dashed var(--accent-gold); border-radius: var(--radius-lg);
  padding: var(--space-4); text-align: center; cursor: pointer;
}
.upload-dropzone.dragover { background: var(--accent-gold-soft); border-color: var(--accent-ink); }
.audit-log-box { max-height: 200px; overflow-y: auto; font-size: var(--fs-xs); display: flex; flex-direction: column; gap: var(--space-1); }
.audit-log-row { padding: var(--space-1) var(--space-2); background: var(--bg-surface); border-radius: var(--radius-xs); border: 1px solid var(--border-hairline); }

.chat-stream-box {
  background: var(--bg-surface); border: 1px solid var(--border-hairline); border-radius: var(--radius-md);
  padding: var(--space-3); min-height: 300px; max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-3);
}
.chat-bubble-row { display: flex; flex-direction: column; max-width: 84%; gap: var(--space-1); }
.chat-bubble-row.out { align-self: flex-end; align-items: flex-end; }
.chat-bubble-row.in { align-self: flex-start; align-items: flex-start; }
.chat-meta-line { font-size: var(--fs-xs); color: var(--text-muted); display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.chat-bubble {
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); font-size: var(--fs-base);
  line-height: 1.55; word-break: break-word; box-shadow: var(--shadow-card);
}
.chat-bubble-row.out .chat-bubble { background: var(--accent-ink); color: var(--text-on-dark); border: 1px solid var(--border-gold); }
.chat-bubble-row.in .chat-bubble { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-strong); }
.chat-attachments { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.attachment-pill {
  display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-xs); font-weight: 600;
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--accent-gold-soft);
  color: var(--accent-amber-text); border: 1px solid var(--accent-amber-border); text-decoration: none;
}
.bottom-dock { background: var(--bg-surface); border-top: 1px solid var(--border-hairline); padding: var(--space-2) var(--space-5); }
.dock-inner { max-width: var(--stage-max-width); margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-2); position: relative; }
.direct-model-banner {
  background: var(--accent-amber-soft); border: 1px solid var(--accent-gold); color: var(--accent-amber-text);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm); font-size: var(--fs-sm); font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.pending-attachments-strip { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.pending-attachment-item {
  display: inline-flex; align-items: center; gap: var(--space-2); background: var(--bg-card);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2); font-size: var(--fs-xs);
}
.attachment-thumb-img {
  width: var(--thumb-size); height: var(--thumb-size); object-fit: cover; border-radius: var(--radius-xs); border: 1px solid var(--border-hairline);
}
.attachment-remove-btn {
  border: none; background: var(--accent-rose-soft); color: var(--accent-rose); border-radius: var(--radius-pill);
  width: 18px; height: 18px; font-size: var(--fs-xs); font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.omnibar {
  display: flex; align-items: center; gap: var(--space-2); background: var(--bg-card);
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill); padding: var(--space-1) var(--space-2); position: relative;
}
.omnibar.dragover { border-color: var(--accent-gold); background: var(--accent-gold-soft); }
.omnibar-plus-btn {
  width: var(--avatar-sm); height: var(--avatar-sm); border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-primary);
  font-size: var(--fs-lg); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.omnibar-plus-btn:hover { background: var(--bg-subtle); }
.omnibar-mode-wrap { position: relative; display: inline-flex; align-items: center; }
.omnibar-mode-select {
  border: 1px solid var(--border-hairline); background: var(--bg-surface); color: var(--text-secondary);
  border-radius: var(--radius-pill); padding: var(--space-1) var(--space-2); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; outline: none;
}
.omnibar-input {
  flex: 1; border: none; background: transparent; color: var(--text-primary);
  font-size: var(--fs-base); font-family: inherit; outline: none; min-width: 0;
}
.omnibar-send-btn { border-radius: var(--radius-pill); padding: var(--space-1) var(--space-4); }

.deliverable-drawer {
  width: 0; min-width: 0; background: var(--bg-card); border-left: 0 solid var(--border-hairline);
  display: flex; flex-direction: column; height: 100vh; overflow: hidden;
  transition: width 0.24s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-drawer); z-index: 40;
}
.deliverable-drawer.open { width: var(--drawer-width); min-width: var(--drawer-width); border-left-width: 1px; }
.drawer-top-bar {
  padding: var(--space-3) var(--space-4); background: var(--bg-obsidian); color: var(--text-on-dark);
  display: flex; flex-direction: column; gap: var(--space-2); border-bottom: 1px solid var(--border-gold);
}
.drawer-top-row1 { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.drawer-kicker { font-size: var(--fs-sm); font-weight: 700; color: var(--accent-gold-light); }
.drawer-scroll-body { flex: 1; overflow-y: auto; padding: var(--space-4); background: var(--bg-canvas); }
.finished-paper-sheet {
  background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  padding: var(--space-4); box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: var(--space-3);
}
.paper-stamp-header {
  border-bottom: 2px solid var(--accent-ink); padding-bottom: var(--space-2);
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2);
}
.paper-doc-title { font-family: var(--font-serif); font-size: var(--fs-lg); font-weight: 700; color: var(--text-primary); }
.toast-box {
  position: fixed; bottom: 74px; left: 50%; transform: translateX(-50%); background: var(--bg-obsidian);
  color: var(--accent-gold-light); border: 1px solid var(--border-gold); padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill); font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow-float);
  display: none; z-index: 2100;
}
.toast-box.is-error { background: var(--accent-rose-dark); color: var(--accent-rose-soft); }

@media (max-width: 768px) {
  .direct-model-banner { flex-direction: column; align-items: flex-start; gap: var(--space-1); }
  .tag { white-space: normal; }
  .mobile-menu-btn { display: inline-flex; align-items: center; gap: var(--space-1); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-104%); box-shadow: var(--shadow-float); width: var(--sidebar-mobile-width); min-width: var(--sidebar-mobile-width); }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-Menu-backdrop.open { display: block; }
  .memory-split-grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .deliverable-drawer.open { position: fixed; right: 0; top: 0; bottom: 0; width: 100vw; min-width: 100vw; z-index: 90; }
  .top-header, .stage-body, .bottom-dock { padding: var(--space-2) var(--space-3); }
  .chat-bubble-row { max-width: 96%; }
  .clean-table { display: block; overflow-x: auto; white-space: nowrap; }
}
