* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0f;
  --bg-secondary: #111119;
  --bg-tertiary: #1a1a26;
  --bg-hover: #1f1f2e;
  --border: #2a2a3a;
  --text: #e8e8f0;
  --text-secondary: #7878a0;
  --accent: #7c5cfc;
  --accent-hover: #9070ff;
  --accent-glow: rgba(124, 92, 252, 0.12);
  --accent-glow-strong: rgba(124, 92, 252, 0.25);
  --user-bg: #1e1e40;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-width: 280px;
  --terminal-width: 480px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  overflow: hidden;
}

/* --- Animated Background --- */
#bg-canvas {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
}

/* --- Screens --- */
.screen { display: none; height: 100dvh; position: relative; z-index: 1; }
.screen.active { display: flex; }

/* --- Login --- */
#login-screen { align-items: center; justify-content: center; }

.login-card {
  width: 100%; max-width: 380px; padding: 48px 32px; text-align: center;
  background: rgba(17,17,25,0.85); backdrop-filter: blur(24px);
  border-radius: 24px; border: 1px solid var(--border);
}

.login-logo { margin-bottom: 32px; }

.avatar-photo-lg {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--accent); box-shadow: 0 0 30px var(--accent-glow-strong);
  margin-bottom: 16px;
}
.avatar-photo-sm {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--accent); flex-shrink: 0;
}
.avatar-photo-msg {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; margin-top: 2px;
}

.login-card h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.login-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
#login-form { display: flex; flex-direction: column; gap: 12px; }

#password-input {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; font-size: 15px; color: var(--text); font-family: inherit; outline: none;
  transition: border-color 0.2s;
}
#password-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

#login-btn {
  background: var(--accent); color: white; border: none; border-radius: var(--radius-sm);
  padding: 14px; font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background 0.2s;
}
#login-btn:hover { background: var(--accent-hover); }
.error-text { color: var(--danger); font-size: 13px; min-height: 18px; }

/* --- Chat Layout --- */
#chat-screen { flex-direction: row; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width); height: 100dvh;
  background: rgba(17,17,25,0.94); backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
  transition: transform 0.25s ease, margin 0.25s ease; z-index: 10;
}
.sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-width))); position: absolute; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px; border-bottom: 1px solid var(--border);
}
.sidebar-header h3 { font-size: 13px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-btn {
  background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-secondary); width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
}
.sidebar-btn:hover { color: var(--text); border-color: var(--accent); background: var(--accent-glow); }

.thread-list { flex: 1; overflow-y: auto; padding: 8px; }

.thread-item {
  padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer;
  margin-bottom: 2px; transition: all 0.15s; position: relative;
  border: 1px solid transparent;
}
.thread-item:hover { background: var(--bg-hover); }
.thread-item.active { background: var(--accent-glow); border-color: rgba(124,92,252,0.2); }

.thread-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; padding-right: 20px; }
.thread-meta { display: flex; justify-content: space-between; align-items: center; }
.thread-time { font-size: 11px; color: var(--text-secondary); }
.thread-preview { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }

.thread-delete {
  opacity: 0; position: absolute; top: 8px; right: 8px;
  background: none; border: none; color: var(--danger);
  cursor: pointer; font-size: 14px; transition: opacity 0.15s; padding: 2px 4px;
}
.thread-item:hover .thread-delete { opacity: 0.7; }
.thread-delete:hover { opacity: 1 !important; }

.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.sidebar-btn-full {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-secondary); padding: 10px; font-size: 13px; font-family: inherit;
  cursor: pointer; transition: all 0.2s;
}
.sidebar-btn-full:hover { color: var(--text); border-color: var(--danger); }

/* --- Chat Main (flex container for chat + terminal) --- */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-width: 0;
  position: relative;
}

.chat-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 320px;
  transition: flex 0.3s ease;
}

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: rgba(17,17,25,0.9); backdrop-filter: blur(12px); flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-info h2 { font-size: 15px; font-weight: 600; line-height: 1.2; }
.header-info .status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); margin-right: 4px; vertical-align: middle; }
.header-info .status-text { font-size: 12px; color: var(--text-secondary); }
.header-right { display: flex; align-items: center; gap: 8px; }

.usage-badge { font-size: 12px; color: var(--text-secondary); background: var(--bg-tertiary); padding: 5px 10px; border-radius: 20px; border: 1px solid var(--border); }
.usage-badge.warning { color: var(--warning); border-color: var(--warning); }
.usage-badge.danger { color: var(--danger); border-color: var(--danger); }

.icon-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-secondary); height: 36px; padding: 0 10px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; transition: all 0.2s; font-family: inherit; font-size: 12px; font-weight: 700;
  position: relative;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-secondary); background: var(--bg-tertiary); }

.count-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--accent); color: white; font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.count-badge.hidden { display: none; }

/* --- Messages --- */
.messages-container { flex: 1; overflow-y: auto; padding: 20px; scroll-behavior: smooth; }

.welcome-message { text-align: center; padding: 40px 20px; max-width: 480px; margin: 0 auto; }
.welcome-message h3 { font-size: 20px; margin-top: 16px; margin-bottom: 8px; }
.welcome-message p { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }
.quick-action {
  background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 20px;
  padding: 8px 16px; font-size: 13px; color: var(--text); font-family: inherit;
  cursor: pointer; transition: all 0.2s;
}
.quick-action:hover { border-color: var(--accent); background: var(--accent-glow); }

.message { display: flex; gap: 10px; margin-bottom: 16px; max-width: 800px; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.message.user { margin-left: auto; flex-direction: row-reverse; }

.message .bubble {
  padding: 12px 16px; border-radius: var(--radius); font-size: 14px;
  line-height: 1.65; max-width: 640px; word-wrap: break-word; overflow-wrap: break-word;
}
.message.user .bubble { background: var(--user-bg); border: 1px solid rgba(124,92,252,0.2); border-top-right-radius: 4px; }
.message.aria .bubble { background: var(--bg-secondary); border: 1px solid var(--border); border-top-left-radius: 4px; }

.message .bubble p { margin-bottom: 8px; } .message .bubble p:last-child { margin-bottom: 0; }
.message .bubble code { background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: 'SF Mono', 'Cascadia Code', monospace; }
.message .bubble pre { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin: 8px 0; overflow-x: auto; font-size: 13px; font-family: 'SF Mono', 'Cascadia Code', monospace; line-height: 1.5; }
.message .bubble pre code { background: none; padding: 0; }
.message .bubble strong { font-weight: 600; } .message .bubble em { font-style: italic; color: var(--text-secondary); }
.message .bubble ul, .message .bubble ol { margin: 8px 0; padding-left: 20px; } .message .bubble li { margin-bottom: 4px; }
.message .bubble h1, .message .bubble h2, .message .bubble h3 { font-weight: 600; margin: 12px 0 6px; }
.message .bubble h1 { font-size: 18px; } .message .bubble h2 { font-size: 16px; } .message .bubble h3 { font-size: 15px; }
.message .bubble a { color: var(--accent); text-decoration: none; } .message .bubble a:hover { text-decoration: underline; }
.message .bubble hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.message .bubble table { border-collapse: collapse; margin: 8px 0; font-size: 13px; width: 100%; }
.message .bubble th, .message .bubble td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.message .bubble th { background: var(--bg-tertiary); font-weight: 600; }
.msg-gif { max-width: 260px; border-radius: 10px; margin-top: 4px; display: block; }

.typing-indicator { display: flex; gap: 4px; padding: 4px 0; }
.typing-indicator span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-secondary); animation: pulse 1.4s infinite; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%,80%,100% { opacity:0.3; transform:scale(0.8); } 40% { opacity:1; transform:scale(1); } }

/* --- GIF Picker --- */
.gif-picker { background: var(--bg-secondary); border-top: 1px solid var(--border); max-height: 280px; display: flex; flex-direction: column; }
.gif-picker.hidden { display: none; }
.gif-search-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.gif-search-bar input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: var(--text); font-family: inherit; outline: none; }
.gif-search-bar input:focus { border-color: var(--accent); }
.gif-close-btn { background: none; border: none; color: var(--text-secondary); font-size: 22px; cursor: pointer; padding: 0 4px; line-height: 1; }
.gif-close-btn:hover { color: var(--text); }
.gif-results { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.gif-hint { color: var(--text-secondary); font-size: 13px; padding: 20px; text-align: center; width: 100%; }
.gif-item { width: calc(33.33% - 4px); aspect-ratio: 1; border-radius: 8px; overflow: hidden; cursor: pointer; transition: transform 0.15s; }
.gif-item:hover { transform: scale(1.05); }
.gif-item img { width: 100%; height: 100%; object-fit: cover; }

/* --- Input --- */
.input-container { padding: 10px 16px 14px; border-top: 1px solid var(--border); background: rgba(17,17,25,0.9); backdrop-filter: blur(12px); flex-shrink: 0; }
.input-wrapper { display: flex; align-items: flex-end; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; transition: border-color 0.2s; }
.input-wrapper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
#message-input { flex: 1; background: none; border: none; color: var(--text); font-size: 14px; font-family: inherit; resize: none; outline: none; line-height: 1.5; max-height: 120px; padding: 4px 0; }
#message-input::placeholder { color: var(--text-secondary); }
.send-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); border: none; color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; flex-shrink: 0; }
.send-btn:disabled { background: var(--bg-tertiary); color: var(--text-secondary); cursor: not-allowed; }
.send-btn:not(:disabled):hover { background: var(--accent-hover); transform: scale(1.05); }

.gif-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-secondary); font-size: 11px; font-weight: 800; font-family: inherit;
  padding: 4px 8px; cursor: pointer; transition: all 0.2s; flex-shrink: 0;
  letter-spacing: 0.5px;
}
.gif-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }

/* ============================================================================
   TERMINAL PANEL
   ============================================================================ */
.terminal-panel {
  width: 0;
  overflow: hidden;
  transition: width 0.3s ease;
  display: flex;
  flex-direction: column;
  background: #0d0d14;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}

.terminal-panel:not(.hidden) {
  width: var(--terminal-width);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #080810;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title-text { margin-left: 4px; }

.terminal-status {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 2px 10px;
  background: var(--bg-tertiary);
  border-radius: 100px;
  border: 1px solid var(--border);
}

.terminal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}
.terminal-close-btn:hover { color: var(--text); }

.terminal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  font-family: 'Cascadia Code', 'Fira Code', 'SF Mono', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: #d4d4d4;
}

.terminal-placeholder {
  color: var(--text-secondary);
  font-style: italic;
}

.terminal-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-line.info { color: var(--warning); }
.terminal-line.success { color: var(--success); }
.terminal-line.error { color: var(--danger); }
.terminal-line.code { color: var(--accent); }
.terminal-line.output { color: #d4d4d4; }

/* ============================================================================
   ASSET LIBRARY DRAWER
   ============================================================================ */
.asset-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0;
  overflow: hidden;
  transition: height 0.3s ease;
  background: rgba(17,17,25,0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.asset-drawer:not(.hidden) {
  height: 260px;
}

.asset-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.asset-drawer-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.asset-drawer-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.asset-drawer-close:hover { color: var(--text); }

.asset-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  align-content: start;
}

.asset-empty {
  color: var(--text-secondary);
  font-size: 13px;
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
}

.asset-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
  cursor: default;
}
.asset-card:hover { border-color: var(--accent); background: var(--bg-hover); }

.asset-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-type-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.asset-type-icon.pdf { background: rgba(248,113,113,0.2); color: var(--danger); }
.asset-type-icon.doc { background: rgba(96,165,250,0.2); color: #60a5fa; }
.asset-type-icon.csv { background: rgba(52,211,153,0.2); color: var(--success); }
.asset-type-icon.flowchart { background: rgba(124,92,252,0.2); color: var(--accent); }
.asset-type-icon.visual { background: rgba(251,191,36,0.2); color: var(--warning); }
.asset-type-icon.html_app { background: rgba(244,114,182,0.2); color: #f472b6; }

.asset-card-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.asset-card-meta {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.asset-card-actions {
  display: flex;
  gap: 6px;
}

.asset-action-btn {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  padding: 5px 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.asset-action-btn:hover { color: var(--accent); border-color: var(--accent); }
.asset-action-btn.delete:hover { color: var(--danger); border-color: var(--danger); }

/* ============================================================================
   BUILD STATUS BUBBLES
   ============================================================================ */
.build-status-bubble {
  background: linear-gradient(135deg, rgba(124,92,252,0.1), rgba(0,245,212,0.05));
  border: 1px solid rgba(124,92,252,0.25) !important;
  border-radius: var(--radius);
  padding: 14px 16px;
}

.build-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.build-status-badge.pending_approval { background: rgba(251,191,36,0.2); color: var(--warning); }
.build-status-badge.approved, .build-status-badge.building { background: rgba(124,92,252,0.2); color: var(--accent); }
.build-status-badge.complete { background: rgba(52,211,153,0.2); color: var(--success); }
.build-status-badge.rejected { background: rgba(248,113,113,0.2); color: var(--danger); }
.build-status-badge.failed { background: rgba(248,113,113,0.2); color: var(--danger); }

.build-terminal-btn {
  display: inline-block;
  margin-top: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.build-terminal-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Waiting pulse animation */
@keyframes waitingPulse {
  0%   { box-shadow: 0 0 0 0 rgba(124,92,252,0.4); }
  70%  { box-shadow: 0 0 0 10px rgba(124,92,252,0); }
  100% { box-shadow: 0 0 0 0 rgba(124,92,252,0); }
}
.build-waiting-pulse { animation: waitingPulse 2s infinite; }

/* --- Status dot states --- */
.status-dot.thinking { background: var(--warning); animation: statusPulse 1s infinite; }
.status-dot.error { background: var(--danger); }
@keyframes statusPulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

/* --- Thinking status --- */
.thinking-status { display: flex; align-items: center; gap: 10px; }
.thinking-time { font-size: 12px; color: var(--text-secondary); }

/* --- Export bar --- */
.export-bar {
  display: flex; gap: 6px; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border); opacity: 0; transition: opacity 0.2s;
}
.message.aria:hover .export-bar { opacity: 1; }
.export-btn {
  background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-secondary); font-size: 11px; font-weight: 600; font-family: inherit;
  padding: 4px 10px; cursor: pointer; transition: all 0.2s; letter-spacing: 0.3px;
}
.export-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }
.export-btn:disabled { opacity: 0.5; cursor: wait; }

/* --- Toast --- */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--bg-secondary); border: 1px solid var(--accent); border-radius: 10px;
  padding: 10px 20px; color: var(--text); font-size: 13px; z-index: 100;
  animation: toastIn 0.3s ease; box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.toast-error { border-color: var(--danger); color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar { position: absolute; left: 0; top: 0; height: 100%; }
  .sidebar.collapsed { transform: translateX(-100%); }

  .terminal-panel:not(.hidden) {
    position: fixed;
    right: 0; top: 0; bottom: 0;
    width: 100vw;
    z-index: 100;
  }

  .asset-drawer:not(.hidden) {
    height: 50vh;
  }

  .asset-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}
@media (min-width: 769px) {
  .sidebar.collapsed { position: relative; margin-left: calc(-1 * var(--sidebar-width)); transform: translateX(calc(-1 * var(--sidebar-width))); }
}
