/**
 * Plugin Name:       PokéPapi LLM Council
 * File:              /var/www/vhosts/pokepapi.com/council/public/css/style.css
 * Plugin URI:        https://pokepapi.com
 * Description:       Refined dark theme for the LLM Council Dashboard
 * Version:           0.1.0
 * Author:            PokéPapi
 * Author URI:        https://pokepapi.com
 * License:           GPL-2.0+
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
 * Text Domain:       pokepapi-llm-council
 * Domain Path:       /languages
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #09090b;
  --bg-secondary: #111114;
  --bg-tertiary: #18181b;
  --bg-surface: #111114;
  --bg-glass: #111114;
  --bg-hover: #1f1f23;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.2);
  --accent-dim: rgba(99, 102, 241, 0.08);
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-dim: #52525b;
  --border: rgba(255, 255, 255, 0.06);
  --border-active: rgba(99, 102, 241, 0.4);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);
  --transition: 150ms ease;
}

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

html, body {
  height: 100%; width: 100%; overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary); color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* === LAYOUT === */
#app { display: flex; height: 100vh; height: 100dvh; width: 100vw; overflow: hidden; }

/* === SIDEBAR === */
#sidebar {
  width: 260px; min-width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100; transition: transform var(--transition);
}
#sidebar.collapsed { transform: translateX(-260px); min-width: 0; width: 0; }

/* Sidebar backdrop overlay (mobile) */
#sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
#sidebar-backdrop.visible { display: block; }

#sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
#sidebar-logo {
  width: 36px; height: 36px; border-radius: 8px;
  object-fit: cover;
}
#sidebar-title { font-size: var(--fs-base); font-weight: 600; letter-spacing: -0.3px; }
#sidebar-subtitle { font-size: var(--fs-xs); color: var(--text-secondary); margin-top: 2px; }

#new-session-btn {
  margin: 12px 16px; padding: 10px;
  background: var(--accent);
  border: none; border-radius: var(--radius-md); color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
#new-session-btn:hover { background: var(--accent-hover); }

#session-list {
  flex: 1; overflow-y: auto; padding: 8px;
  scrollbar-width: thin; scrollbar-color: var(--text-dim) transparent;
}
#session-list::-webkit-scrollbar { width: 4px; }
#session-list::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 2px; }

.session-item {
  padding: 12px 14px; border-radius: var(--radius-md);
  cursor: pointer; transition: all var(--transition);
  margin-bottom: 4px; border: 1px solid transparent;
}
.session-item:hover { background: var(--bg-tertiary); border-color: var(--border); }
.session-item.active {
  background: var(--accent-dim); border-color: var(--border-active);
  box-shadow: inset 0 0 0 1px var(--accent-glow);
}
.session-item-header {
  display: flex; align-items: flex-start; gap: 4px;
}
.session-item-header .session-item-title { flex: 1; min-width: 0; }
.session-item-title {
  font-size: var(--fs-sm); font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px;
}
.session-item-date { font-size: 10px; color: var(--text-dim); margin-top: 4px; }
.session-item-actions {
  display: flex; gap: 2px; opacity: 0;
  transition: opacity var(--transition); flex-shrink: 0;
}
.session-item:hover .session-item-actions { opacity: 1; }
.session-action-btn {
  background: none; border: none; cursor: pointer;
  font-size: 12px; padding: 2px 4px; border-radius: 4px;
  transition: all var(--transition); line-height: 1;
  color: var(--text-dim);
}
.session-action-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.session-action-btn.delete-btn:hover { color: var(--danger); }

.session-rename-input {
  width: 100%; background: var(--bg-primary); border: 1px solid var(--accent);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: inherit; font-size: 13px; padding: 3px 6px;
  outline: none; box-shadow: 0 0 0 2px var(--accent-dim);
}

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

/* === MAIN CONTENT === */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; overflow: hidden; }

/* --- Header Bar --- */
#header {
  height: 48px; padding: 0 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  z-index: 10; flex-shrink: 0;
}
#toggle-sidebar-btn {
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; font-size: 18px; padding: 6px;
  border-radius: var(--radius-sm); transition: all var(--transition);
}
#toggle-sidebar-btn:hover { color: var(--text-primary); background: var(--bg-tertiary); }
#header-title { font-size: var(--fs-base); font-weight: 600; flex: 1; }
.header-status {
  font-size: 11px; padding: 4px 10px; border-radius: 20px;
  display: flex; align-items: center; gap: 6px;
}
.header-status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  animation: pulse-dot 2s infinite;
}
.header-status.connected { background: rgba(63,185,80,0.12); color: var(--success); }
.header-status.connected .dot { background: var(--success); }
.header-status.disconnected { background: rgba(248,81,73,0.12); color: var(--danger); }
.header-status.disconnected .dot { background: var(--danger); }

.header-btn {
  background: none; border: 1px solid var(--border); color: var(--text-secondary);
  cursor: pointer; font-size: var(--fs-sm); padding: 5px 10px;
  border-radius: var(--radius-sm); transition: all var(--transition);
  font-family: inherit;
}
.header-btn:hover { color: var(--text-primary); border-color: var(--text-secondary); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Chat Output Area --- */
#chat-area {
  flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px;
  scroll-behavior: smooth;
  scrollbar-width: thin; scrollbar-color: var(--text-dim) transparent;
}
#chat-area::-webkit-scrollbar { width: 5px; }
#chat-area::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 3px; }

/* Welcome Screen */
#welcome {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px; text-align: center;
  min-height: 60vh;
}
#welcome-logo {
  width: 64px; height: 64px; border-radius: 14px;
  object-fit: cover;
  margin-bottom: 20px;
}
#welcome h1 { font-size: calc(20px * var(--font-scale)); font-weight: 600; margin-bottom: 8px; }
#welcome p { font-size: var(--fs-sm); color: var(--text-secondary); max-width: 400px; line-height: 1.6; }

/* Messages */
.msg { margin-bottom: 16px; display: flex; gap: 10px; animation: msg-in 0.3s ease-out; }
.msg.user { flex-direction: row-reverse; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.msg-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px; overflow: hidden;
}
.msg-avatar img { width: 100%; height: 100%; object-fit: contain; }
.msg.user .msg-avatar { background: var(--accent); font-size: 14px; }
.msg.system .msg-avatar { background: var(--bg-tertiary); border: 1px solid var(--border); padding: 4px; }

.msg-body { max-width: 78%; min-width: 60px; }
.msg-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
  /* [CTRLVIS] wrap so the copy/expand/fullscreen tail never clips on narrow cards */
  flex-wrap: wrap; row-gap: 4px;
}
.msg-model-name {
  font-size: 12px; font-weight: 600; text-transform: capitalize;
  color: var(--accent-hover);
}
.msg-time { font-size: 11px; font-weight: 500; color: var(--text-secondary); opacity: 0.9; }
.msg.user .msg-time { text-align: right; }
.msg.user .msg-header { flex-direction: row-reverse; }

.msg-content {
  padding: 10px 14px; border-radius: var(--radius-md);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  font-size: var(--fs-base); line-height: 1.7; word-break: break-word;
  letter-spacing: 0.01em;
}
.msg.user .msg-content {
  background: var(--accent);
  color: #fff; border-bottom-right-radius: 4px;
}
.msg.system .msg-content {
  background: var(--bg-tertiary); color: var(--text-primary);
  border: 1px solid var(--border); border-bottom-left-radius: 4px;
}
.msg.system .msg-content pre {
  overflow-x: auto; background: var(--bg-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px; margin: 8px 0; font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.msg.system .msg-content code {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  background: var(--bg-primary); padding: 1px 5px; border-radius: 3px;
}
.msg.system .msg-content pre code {
  background: none; padding: 0;
}

/* Code block action toolbar */
.code-toolbar {
  display: flex; gap: 4px; justify-content: flex-end;
  padding: 4px 6px; margin: -10px -10px 6px -10px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.code-action-btn {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 11px; padding: 2px 8px;
  border-radius: 4px; cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.code-action-btn:hover { background: rgba(139, 92, 246, 0.15); color: var(--text-primary); }

.msg.thinking .msg-content {
  border-left: 3px solid var(--accent);
  animation: thinking-pulse 1.5s ease-in-out infinite;
}
@keyframes thinking-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.copy-btn {
  margin-top: 4px; background: none; border: 1px solid var(--border);
  color: var(--text-dim); font-size: 10px; padding: 3px 8px;
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; transition: all var(--transition);
  display: inline-block; margin-right: 4px;
}
.copy-btn:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.edit-btn:hover { color: var(--accent-hover); border-color: var(--accent); }

/* --- Input Area --- */
#input-area {
  padding: 12px 16px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
#input-row {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 6px 6px 6px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
#input-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
#input-row.drag-over {
  border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow);
  background: rgba(139, 92, 246, 0.08);
}

/* Pending file attachments bar */
#pending-files-bar {
  display: none; flex-wrap: wrap; gap: 6px;
  padding: 6px 8px; margin-bottom: 4px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.pending-file-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(139, 92, 246, 0.15); color: var(--text-secondary);
  padding: 3px 8px; border-radius: 12px; font-size: 11px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  animation: chipIn 0.2s ease-out;
}
@keyframes chipIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
.pending-file-remove {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 2px; margin-left: 2px;
  transition: color 0.15s;
}
.pending-file-remove:hover { color: #ef4444; }

/* Scroll to bottom button — circular icon button matching the composer's
   #mobilePlusBtn / #sendBtn (SVG chevron, subtle surface, ~44px circle). */
.scroll-bottom-btn {
  display: none; position: fixed; bottom: 90px; left: 50%;
  transform: translateX(-50%); z-index: 50;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.2s; opacity: 0;
  padding: 0;
}
.scroll-bottom-btn.visible { display: flex; align-items: center; justify-content: center; opacity: 1; }
.scroll-bottom-btn:hover { background: var(--bg-hover); color: var(--text-primary); transform: translateX(-50%) translateY(-1px); }
.scroll-bottom-btn svg { width: 22px; height: 22px; display: block; }

#promptInput {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  font-size: var(--fs-base); resize: none; line-height: 1.6;
  min-height: 22px; max-height: 40vh; padding: 6px 0;
  overflow-y: hidden;
}
#promptInput::placeholder { color: var(--text-dim); }

.input-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all var(--transition); color: var(--text-secondary);
  background: transparent; font-size: 16px; flex-shrink: 0;
}
.input-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

#sendBtn {
  background: var(--accent);
  color: #fff; border-radius: 8px; font-size: var(--fs-sm); font-weight: 500;
  width: auto; padding: 8px 16px; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  border: none; cursor: pointer; transition: all var(--transition);
}
#sendBtn img { filter: brightness(10); }
#sendBtn:hover { background: var(--accent-hover); }

#stopBtn {
  background: var(--danger);
  color: #fff; border: none; border-radius: 8px; font-size: 12px; font-weight: 500;
  padding: 8px 12px; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  animation: stopPulse 1.5s ease-in-out infinite; flex-shrink: 0;
}
#stopBtn:hover { opacity: 0.85; }
@keyframes stopPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

#modelSelector {
  background: var(--bg-primary); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm);
  padding: 6px 8px; font-family: inherit; font-size: 12px;
  cursor: pointer; flex-shrink: 0; outline: none;
  transition: border-color var(--transition);
}
#modelSelector:focus { border-color: var(--accent); }

/* === CUSTOM MODEL SELECTOR === */
.custom-select-wrap { position: relative; flex-shrink: 0; }
.custom-select-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-primary); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm);
  padding: 6px 10px; font-family: inherit; font-size: var(--fs-sm);
  cursor: pointer; outline: none; white-space: nowrap;
  transition: border-color var(--transition);
}
.custom-select-btn:hover, .custom-select-btn:focus { border-color: var(--accent); }
.custom-select-btn .sel-icon { font-size: 14px; }
.custom-select-btn .sel-label { font-weight: 500; }
.custom-select-btn .sel-arrow { font-size: 10px; color: var(--text-dim); margin-left: 2px; }

.custom-select-dropdown {
  display: none; position: absolute; bottom: calc(100% + 4px); right: 0;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  z-index: 100;
  min-width: 260px; max-height: 400px; overflow-y: auto;
  padding: 4px 0;
}
.custom-select-dropdown.open { display: block; }
.sel-option {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: var(--fs-sm); cursor: pointer;
  color: var(--text-primary); transition: background 0.1s;
}
.sel-option:hover { background: rgba(139, 92, 246, 0.12); }
.sel-option.active { background: rgba(139, 92, 246, 0.2); color: var(--accent-hover); }
.sel-group-label {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px 2px; font-size: 10px; font-weight: 700;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em;
  border-top: 1px solid var(--border); margin-top: 4px;
}
.sel-group-label:first-child { border-top: none; margin-top: 0; }
.sel-logo { width: 16px; height: 16px; flex-shrink: 0; }
.sel-group-label .sel-logo { width: 12px; height: 12px; opacity: 0.7; }

/* Active-mode header pinned at the top of the mode picker (both desktop dropdown
   and mobile sheet). Shows the current mode + a "tap to switch below" hint so the
   user instantly sees what mode they're in without expanding any group. */
.mode-active-header {
  display: flex; align-items: center; gap: 10px;
  margin: 6px 8px 4px; padding: 10px 12px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid var(--border-active, rgba(139, 92, 246, 0.45));
  border-radius: var(--radius-md, 10px);
}
.mode-active-header .mah-icon {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--accent, #a78bfa);
}
.mode-active-header .mah-icon svg { width: 18px; height: 18px; }
.mode-active-header .mah-icon .sel-logo { width: 18px; height: 18px; }
.mode-active-header .mah-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.mode-active-header .mah-eyebrow {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim, #6b6b75);
}
.mode-active-header .mah-name {
  font-size: 13px; font-weight: 600; color: var(--accent-hover, #c4b5fd);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mode-active-header .mah-hint {
  margin-left: auto; flex-shrink: 0;
  font-size: 10px; font-style: italic; color: var(--text-dim, #6b6b75);
}

/* === QUICK ACTIONS PANEL (HIDDEN) === */
#quick-panel {
  display: none !important;
}
#quick-panel.collapsed { transform: translateX(var(--qp-width)); min-width: 0; width: 0; overflow: hidden; }

/* Scale variants */
#quick-panel[data-scale="small"] { --qp-width: 52px; --qp-btn: 36px; --qp-icon: 12px; --qp-label: 6px; --qp-gap: 3px; }
#quick-panel[data-scale="normal"] { --qp-width: 64px; --qp-btn: 44px; --qp-icon: 14px; --qp-label: 7px; --qp-gap: 4px; }
#quick-panel[data-scale="large"] { --qp-width: 80px; --qp-btn: 56px; --qp-icon: 18px; --qp-label: 8px; --qp-gap: 5px; }
#quick-panel[data-scale="xlarge"] { --qp-width: 96px; --qp-btn: 68px; --qp-icon: 22px; --qp-label: 10px; --qp-gap: 6px; }

.quick-btn {
  width: var(--qp-btn); height: var(--qp-btn); border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--bg-tertiary);
  color: var(--text-secondary); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: var(--qp-icon); transition: all var(--transition);
  position: relative;
}
.quick-btn:hover {
  color: var(--text-primary); border-color: var(--accent);
  background: var(--accent-dim); transform: scale(1.08);
}
.quick-btn-label {
  font-size: var(--qp-label); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.3px; line-height: 1;
}
.quick-btn .tooltip {
  display: none; position: absolute; right: calc(100% + 8px); top: 50%;
  transform: translateY(-50%); background: var(--bg-primary);
  border: 1px solid var(--border); color: var(--text-primary);
  font-size: 11px; padding: 4px 8px; border-radius: var(--radius-sm);
  white-space: nowrap; pointer-events: none;
}
.quick-btn:hover .tooltip { display: block; }

/* Tier toggle badge */
.quick-tier-badge {
  position: absolute; top: 2px; right: 2px;
  font-size: 7px; font-weight: 700; letter-spacing: 0.5px;
  padding: 1px 3px; border-radius: 3px;
  background: rgba(139,92,246,0.3); color: #c4b5fd;
  line-height: 1; pointer-events: none;
}
.quick-model-toggle[data-tier="fast"] { border-color: rgba(251,146,60,0.4); }
.quick-model-toggle[data-tier="fast"] .quick-tier-badge {
  background: rgba(251,146,60,0.3); color: #fb923c;
}

/* Export popup */
.export-popup {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; width: 310px; z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.export-popup.visible { display: block; }
.export-popup-title { font-weight: 600; font-size: 14px; margin-bottom: 10px; color: var(--text-primary); }
.export-popup-dates { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.export-date-label { font-size: 11px; color: var(--text-secondary); flex: 1; min-width: 130px; }
.export-date-input {
  width: 100%; margin-top: 2px; padding: 6px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg-secondary);
  color: var(--text-primary); font-size: 12px;
}
.export-popup-actions { display: flex; gap: 8px; }
.export-btn {
  flex: 1; padding: 8px; border: none; border-radius: 8px;
  color: #fff; font-weight: 600; cursor: pointer; font-size: 13px;
  transition: opacity 0.15s;
}
.export-btn:hover { opacity: 0.85; }
.export-btn-json { background: #3b82f6; }
.export-btn-pdf { background: var(--accent); }
.export-status { font-size: 11px; margin-top: 6px; color: var(--text-dim); }

/* === SETTINGS PANEL === */
#settingsModal {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7);
  align-items: center; justify-content: center;
}
.settings-panel {
  display: flex; background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-xl); max-width: 760px; width: 94%;
  margin: 4% auto; max-height: 85vh; overflow: hidden;
  box-shadow: var(--shadow-lg); animation: scale-in 0.15s ease-out;
}
@keyframes scale-in { from { transform: scale(0.95); opacity: 0; } }

/* Sidebar Nav */
.settings-nav {
  width: 200px; min-width: 200px; background: var(--bg-primary);
  border-right: 1px solid var(--border); padding: 16px 10px;
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
}
.settings-nav-header {
  display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700;
  padding: 4px 8px 14px; color: var(--text-primary);
}
.settings-close {
  margin-left: auto; font-size: 20px; background: none; border: none;
  color: var(--text-dim); cursor: pointer; line-height: 1;
}
.settings-close:hover { color: var(--text-primary); }
.settings-nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.12s;
}
.settings-nav-btn:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.settings-nav-btn.active { background: rgba(139,92,246,0.12); color: var(--accent-hover); }
.settings-nav-btn svg { flex-shrink: 0; opacity: 0.7; }
.settings-nav-btn.active svg { opacity: 1; }
.settings-nav-divider { height: 1px; background: var(--border); margin: 10px 8px; }
.settings-nav-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); padding: 4px 12px;
}

/* Content Panes */
.settings-content {
  flex: 1; padding: 28px 32px; overflow-y: auto; min-height: 0;
}
.settings-pane { display: none; }
.settings-pane.active { display: block; }
.settings-pane h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.settings-desc { font-size: 12px; color: var(--text-dim); margin-bottom: 20px; line-height: 1.5; }

/* Setting Elements */
.setting-group { margin-bottom: 20px; }
.setting-label { font-size: 13px; font-weight: 600; color: var(--text-primary); display: block; margin-bottom: 4px; }
.setting-label-sm { font-size: 11px; font-weight: 600; color: var(--text-dim); display: block; margin-bottom: 4px; }
.setting-hint { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; line-height: 1.4; }
.setting-value-sm { font-size: 12px; color: var(--text-secondary); }
.setting-input, .setting-input-sm {
  width: 100%; padding: 8px 12px; background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-family: inherit; outline: none;
  transition: border-color var(--transition);
}
.setting-input { font-size: 13px; }
.setting-input-sm { font-size: 12px; padding: 6px 10px; }
.setting-input:focus, .setting-input-sm:focus { border-color: var(--accent); }
.setting-textarea {
  width: 100%; min-height: 100px; padding: 10px 12px;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 13px; resize: vertical; outline: none;
  transition: border-color var(--transition);
}
.setting-textarea:focus { border-color: var(--accent); }
.setting-btn-primary {
  padding: 10px 20px; background: var(--accent);
  border: none; border-radius: var(--radius-sm); color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.setting-btn-primary:hover { background: var(--accent-hover); }
.setting-btn-danger {
  width: 100%; padding: 10px; background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--danger); font-family: inherit; font-size: 13px; cursor: pointer;
}
.setting-btn-danger:hover { background: rgba(239,68,68,0.1); border-color: var(--danger); }
/* Subordinate destructive action — muted text link until hover, then red.
   Keeps Delete visually subordinate to the primary Save Project button. */
.wks-delete-link:hover { color: var(--danger); background: rgba(239,68,68,0.1); }
.setting-status { font-size: 12px; text-align: center; margin-top: 8px; }

/* Model Row (Top + Fast side by side) */
.model-row { display: flex; gap: 12px; }
.model-col { flex: 1; }

/* ═══ TABLET (iPad) ═══ */
@media (max-width: 1024px) {
  #sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
    width: 280px; min-width: 280px;
  }
  #sidebar.collapsed { transform: translateX(-260px); min-width: 0; width: 0; }

  #quick-panel { width: 48px; min-width: 48px; }
  .quick-btn { width: 36px; height: 36px; font-size: 13px; }
  .quick-btn-label { display: none; }
  .quick-tier-badge { display: none; }

  #canvas-panel { width: 360px; min-width: 280px; }

  .mode-toggle-btn { padding: 3px 7px; font-size: 10px; }
  #header { padding: 0 12px; gap: 8px; }
  .header-btn { font-size: 12px; padding: 4px 8px; }
}

/* ═══ MOBILE (Phone + Small Tablet) ═══ */
/* ═══════════════════════════════════════════════════════════════════
   VERTICAL TOOL RAIL  (replaces old white [+] popup trigger)
   A persistent thin icon rail docked to the LEFT of the chat area.
   Holds: Attach · Export · Generate image (extensible — add buttons).
   NOT the navigation sidebar (☰ session drawer) — separate tools rail.
   ═══════════════════════════════════════════════════════════════════ */
#main-body {
  flex: 1; min-height: 0; min-width: 0;
  display: flex; flex-direction: row; align-items: stretch;
}
#main-content-col {
  flex: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  position: relative;
}
#tool-rail {
  flex: 0 0 52px; width: 52px;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 14px 0;
  /* Distinct surface so the rail reads as intentional docked chrome, not
     floating icons over the near-black chat (--bg-primary). --bg-tertiary
     is a perceptible step up, paired with a firmer right divider. */
  background: var(--bg-tertiary);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.25);
  z-index: 40;
}
/* The tool buttons in the rail — uniform 40×40 icon targets */
#tool-rail .input-btn,
#tool-rail #exportBtnWrap > .input-btn,
#tool-rail #imageGenBtnWrap > .input-btn {
  width: 40px; height: 40px;
  display: inline-flex !important;
  align-items: center; justify-content: center;
  border-radius: 10px; flex-shrink: 0;
}
#tool-rail .input-btn svg { width: 18px; height: 18px; }
#tool-rail #exportBtnWrap,
#tool-rail #imageGenBtnWrap { position: relative; width: 40px; }

/* Rail tooltips — hover label to the right of each icon */
#tool-rail .input-btn { position: relative; }
#tool-rail .input-btn::after {
  content: attr(aria-label);
  position: absolute; left: calc(100% + 10px); top: 50%;
  transform: translateY(-50%);
  background: var(--bg-tertiary); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 9px; font-size: 11px; font-weight: 500;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity 0.12s; z-index: 200;
  box-shadow: var(--shadow-md);
}
#tool-rail .input-btn:hover::after { opacity: 1; }

/* Popups now open to the RIGHT of the rail (not above — rail is tall+thin) */
#tool-rail .export-popup {
  bottom: auto; top: 0; left: calc(100% + 10px);
}
#tool-rail #imageGenPopup {
  bottom: auto !important; top: 0 !important; left: calc(100% + 10px) !important;
}

@media (max-width: 768px) {
  #app { flex-direction: column; height: 100vh; height: 100dvh; }

  /* Sidebar: overlay */
  #sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
    width: 280px; min-width: 280px;
  }
  #sidebar.collapsed { transform: translateX(-260px); min-width: 0; width: 0; }

  /* Quick panel: hidden on mobile */
  #quick-panel { display: none; }

  /* Canvas panel: full width overlay */
  #canvas-panel {
    position: fixed; right: 0; top: 0; bottom: 0;
    width: 100vw !important; max-width: 100vw; z-index: 150;
  }

  /* Main area takes full space */
  #main { flex: 1; min-height: 0; display: flex; flex-direction: column; }

  /* Header: compact */
  #header {
    height: 46px; padding: 0 10px; gap: 6px;
    flex-shrink: 0;
  }
  #header-title { font-size: 13px; }
  .header-status { font-size: 10px; padding: 3px 8px; }
  .header-btn { font-size: 11px; padding: 4px 6px; }

  /* Hide mode toggle and guide on mobile — save space */
  .mode-toggle { display: none; }
  #help-guide-btn { display: none; }

  /* Chat area */
  #chat-area {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 10px 10px 10px;
    -webkit-overflow-scrolling: touch;
  }

  /* Messages */
  .msg { padding: 6px 0; }
  .msg-avatar { width: 28px; height: 28px; font-size: 14px; }
  .msg-avatar img { width: 28px; height: 28px; }
  .msg-body { max-width: 90%; }
  /* mobile-chat-readability: body text 13→15px, better line-height */
  .msg-content { font-size: 15px !important; padding: 12px 14px !important; line-height: 1.6 !important; }

  /* mobile-chat-readability: filter row (All/Claude/ChatGPT/Gemini/Grok/DeepSeek) — was cramped/wrapping. Now: horizontal scroll one-row, larger taps */
  #discuss-target-wrap {
    display: flex; flex-direction: row; flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 8px; padding: 6px 4px;
    scrollbar-width: none;
  }
  #discuss-target-wrap::-webkit-scrollbar { display: none; }
  .discuss-target-btn {
    flex: 0 0 auto; white-space: nowrap;
    padding: 10px 14px; font-size: 14px;
    min-height: 44px;
    border-radius: 22px;
  }
  .discuss-target-btn img { width: 16px; height: 16px; }

  /* mobile-chat-readability: Parallel — All Fast dropdown — too narrow before; bump min-width + touch target */
  #modelDropdown {
    min-width: 200px; max-width: 70vw;
    min-height: 48px;
    font-size: 14px;
  }
  #modelDropdown .sel-option, #modelDropdown .sel-current {
    padding: 12px 14px; min-height: 44px;
    display: flex; align-items: center; gap: 8px;
  }

  /* mobile-chat-readability: "Showing all messages" + Rows/Columns row — give it breathing room */
  #discussion-mode-bar {
    padding: 10px 8px 8px;
    gap: 10px;
  }
  .msg-header { font-size: 12px; }

  /* Input area: fixed to bottom, safe area aware */
  #input-area {
    padding: 8px 10px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    flex-shrink: 0;
    position: relative;
    z-index: 50;
  }
  #input-row {
    padding: 4px 4px 4px 10px; gap: 4px;
    border-radius: 12px;
  }
  /* mobile-chat-readability: 16px kills iOS auto-zoom on focus (scoped to #promptInput) */
  #promptInput { font-size: 16px; min-height: 22px; }

  .input-btn { width: 30px; height: 30px; font-size: 14px; }
  /* mobile-chat-readability: 44px touch target for send/stop (Apple HIG) */
  #sendBtn { padding: 10px 16px; font-size: 13px; min-height: 44px; }
  #stopBtn { padding: 10px 14px; font-size: 12px; min-height: 44px; }

  /* Export popup: position above input, full width */
  .export-popup {
    width: calc(100vw - 20px); left: -10px;
    bottom: calc(100% + 6px);
  }

  /* Scroll to bottom */
  .scroll-bottom-btn { bottom: 75px; width: 44px; height: 44px; }

  /* Session files bar */
  #session-files-bar { padding: 4px 10px; font-size: 11px; }

  /* Custom model selector */
  .custom-select-dropdown { max-height: 50vh; }
  .sel-option { padding: 8px 10px; font-size: 12px; }

  /* Welcome */
  #welcome h1 { font-size: 20px; }
  #welcome p { font-size: 13px; max-width: 320px; }
  #welcome-logo { width: 64px; height: 64px; }

  /* Settings: full screen */
  .settings-panel { flex-direction: column; max-height: 90vh; width: 95vw; }
  .settings-nav {
    width: 100%; min-width: 100%; flex-direction: row; flex-wrap: wrap;
    padding: 10px; gap: 4px; border-right: none; border-bottom: 1px solid var(--border);
  }
  .settings-nav-header { width: 100%; padding-bottom: 8px; }
  .settings-nav-btn { flex: 0 0 auto; padding: 6px 10px; font-size: 12px; }
  .settings-nav-divider { display: none; }
  .settings-nav-label { display: none; }
  .settings-content { padding: 20px 16px; }
  .model-row { flex-direction: column; gap: 8px; }
}

/* ═══ SMALL PHONES ═══ */
@media (max-width: 480px) {
  #header { height: 42px; padding: 0 8px; gap: 4px; }
  #header-title { font-size: 12px; }
  .header-status { display: none; } /* Hide connected badge */
  #toggle-canvas-btn { display: none; } /* Canvas not useful on tiny screens */

  #chat-area { padding: 8px 8px; }
  /* mobile-chat-readability: body text 12→14px on small phones */
  .msg-content { font-size: 14px !important; padding: 10px 12px !important; line-height: 1.55 !important; }
  .msg-body { max-width: 92%; }

  /* mobile-chat-readability: smaller phones — keep filter row scrollable, slightly tighter */
  .discuss-target-btn {
    padding: 9px 12px; font-size: 13px;
  }
  #modelDropdown {
    min-width: 180px; font-size: 13px;
  }
  .msg-body { max-width: 92%; }

  #input-area { padding: 6px 8px; padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
  #input-row { padding: 3px 3px 3px 8px; }
  /* mobile-chat-readability: keep ≥16px on smallest phones too */
  #promptInput { font-size: 16px; }

  .export-popup { width: calc(100vw - 16px); left: -8px; }

  #welcome h1 { font-size: 18px; }
  #welcome-logo { width: 48px; height: 48px; }
}
.confirm-cancel { background: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border); }
.confirm-cancel:hover { color: var(--text-primary); }
.confirm-ok { background: var(--danger); color: #fff; }
.confirm-ok:hover { background: #e5443d; }

/* === LLM CONFIG CARDS === */
.llm-config-card {
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 10px; overflow: hidden;
}
.llm-config-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
}
.llm-config-body { padding: 10px 12px; }
.conn-badge {
  margin-left: auto; font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
  background: rgba(139, 92, 246, 0.15); color: var(--accent);
}
.config-select {
  background: var(--bg-primary); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm);
  padding: 4px 6px; font-family: inherit; font-size: 11px;
  outline: none; cursor: pointer;
}
.refresh-models-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-secondary); cursor: pointer; padding: 3px 6px; font-size: 12px;
  transition: all 0.15s;
}
.refresh-models-btn:hover { background: rgba(139, 92, 246, 0.1); color: var(--text-primary); }

/* === CONFIRM DIALOG === */
#confirm-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.15s ease-out;
}
@keyframes fade-in { from { opacity: 0; } }
.confirm-box {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  max-width: 360px; width: 90%; box-shadow: var(--shadow-lg);
}
.confirm-msg { font-size: 14px; line-height: 1.5; margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-cancel, .confirm-ok {
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; transition: all var(--transition);
}
.confirm-cancel { background: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border); }
.confirm-cancel:hover { color: var(--text-primary); }
.confirm-ok { background: var(--danger); color: #fff; }
.confirm-ok:hover { background: #e5443d; }

/* === HELP GUIDE MODAL === */
#help-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.15s ease-out;
}
/* === GLOBAL FONT SCALE === */
:root { --font-scale: 1; --fs-base: calc(15px * var(--font-scale)); --fs-sm: calc(13px * var(--font-scale)); --fs-xs: calc(12px * var(--font-scale)); --fs-lg: calc(18px * var(--font-scale)); --fs-xl: calc(22px * var(--font-scale)); --icon-scale: var(--font-scale); }

/* Scale content areas without breaking viewport height */
#sidebar > * { zoom: var(--font-scale); }
#main > #header { zoom: var(--font-scale); }
#chat-area { zoom: var(--font-scale); }
#input-area { zoom: var(--font-scale); }
.settings-panel { zoom: var(--font-scale); }
.help-modal { zoom: var(--font-scale); }
#confirm-overlay .confirm-box { zoom: var(--font-scale); }

.help-modal {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-xl); max-width: 820px; width: 94%;
  max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.help-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
}
.help-header h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; }
.help-close {
  background: none; border: none; color: var(--text-secondary);
  font-size: 22px; cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-sm); transition: all var(--transition);
}
.help-close:hover { color: var(--text-primary); background: var(--bg-tertiary); }

/* Tabbed guide layout */
.help-layout {
  display: flex; flex: 1; min-height: 0; overflow: hidden;
}
.help-nav {
  width: 180px; min-width: 180px; padding: 12px 8px;
  border-right: 1px solid var(--border); overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg-primary);
}
.help-nav-btn {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-dim);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.12s;
}
.help-nav-btn:hover { background: rgba(255,255,255,0.03); color: var(--text-secondary); }
.help-nav-btn.active { background: var(--accent-dim); color: var(--accent-hover); }
.help-content {
  flex: 1; padding: 24px 28px; overflow-y: auto;
  scrollbar-width: thin;
}
.help-tab { display: none; }
.help-tab.active { display: block; }
.help-tab h3 {
  font-size: 11px; font-weight: 600; margin-bottom: 12px;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.help-tab p {
  font-size: 14px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 14px;
}
.help-tab ul { list-style: none; padding: 0; margin: 0; }
.help-tab li {
  padding: 5px 0; font-size: 14px; line-height: 1.7;
  color: var(--text-secondary);
}
.help-tab li strong { color: var(--text-primary); font-weight: 500; }
.help-tab li::before {
  content: ''; display: inline-block; width: 4px; height: 4px;
  background: var(--accent); border-radius: 50%;
  margin-right: 10px; vertical-align: middle;
}
/* Pipeline stage cards */
.help-stage {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid var(--border-subtle);
}
.help-stage:last-child { border-bottom: none; }
.help-stage-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.help-stage div { font-size: 14px; line-height: 1.6; color: var(--text-secondary); }
.help-stage strong { color: var(--text-primary); }
/* Model cards */
.help-model-card {
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 13px; line-height: 1.5; color: var(--text-secondary);
}
.help-model-card strong { color: var(--text-primary); display: block; margin-bottom: 2px; }
/* Command reference */
.help-cmd {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 0; font-size: 14px; color: var(--text-secondary);
}
.help-cmd code {
  background: var(--bg-tertiary); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 4px; font-size: 13px;
  font-family: 'JetBrains Mono', monospace; color: var(--accent-hover);
  min-width: 100px;
}

/* Legacy help-section (keep for compatibility) */
.help-body { overflow-y: auto; padding: 20px 28px 28px; scrollbar-width: thin; }
.help-section { margin-bottom: 20px; }

/* === DATE INPUT DARK MODE FIX === */
input[type="datetime-local"],
input[type="date"],
input[type="time"] {
  color-scheme: dark;
}
.export-date-input {
  color-scheme: dark;
}
::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* === RANGE SLIDER STYLING === */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--bg-tertiary); border-radius: 2px;
  border: none; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  border: 2px solid var(--bg-primary);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  border: 2px solid var(--bg-primary);
}

/* === QUICK PANEL TIERS === */
.quick-divider {
  width: 80%; height: 1px; margin: 4px auto;
  background: var(--border); opacity: 0.5;
}
.quick-btn-fast {
  opacity: 0.7; transform: scale(0.9);
}
.quick-btn-fast:hover { opacity: 1; transform: scale(1); }
.quick-btn-fast .quick-btn-label { font-size: 8px; }

/* === LEGACY 768px block — superseded by comprehensive overhaul below === */
@media (max-width: 768px) {
  #chat-area { padding: 12px 14px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   v0.3.3 — COMPREHENSIVE RESPONSIVE OVERHAUL
   Goal: Every UI element accessible at every breakpoint. Nothing hidden
   without an alternative entry point. Touch targets ≥36px. Safe-area
   insets respected on notched iPhones. iPad portrait/landscape covered.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Base styles for elements that previously had ZERO CSS ── */

/* Impersonation banner (added v0.3.0) — safe-area-aware (overrides inline style padding) */
#impersonation-banner {
  padding: calc(8px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) 8px calc(16px + env(safe-area-inset-left, 0px)) !important;
}

/* Sidebar Projects section (added v0.3.1) */
.sidebar-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 4px;
  font-size: 11px; font-weight: 600;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px;
}
.sidebar-section-header button {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: 4px;
  cursor: pointer; font-family: inherit;
  font-size: 10px; padding: 3px 10px;
  min-height: 24px;
}
.sidebar-section-header button:hover {
  background: rgba(139,92,246,0.15); color: #c4b5fd;
}
#projects-section { padding-bottom: 4px; }
#projects-recent-list { padding: 0 8px; }
.project-item:hover { background: rgba(255,255,255,0.04); }

/* Active project pill in input row (added v0.3.1) */
#active-project-pill { transition: background 0.15s; max-width: 200px; overflow: hidden; }
#active-project-pill:hover { background: rgba(139,92,246,0.28); }
#active-project-pill #active-project-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Settings logout (the bottom row uses margin-top:auto in flex-column) */
.settings-nav { display: flex; flex-direction: column; }

/* Admin nav visibility — JS toggles .is-admin-nav-visible on the wrapper div */
#admin-nav-items { display: none; }
#admin-nav-items.is-admin-nav-visible { display: block; }

/* ═══════════════════════════════════════════════════════════════════════
   v0.3.4 — MOBILE UX RESTRUCTURE (agent/mobile-ux-overhaul, 2026-05-27)
   Single coherent ≤768px + ≤480px block. Replaces the prior duplicate
   block that was overriding the recent filter-row / touch-target fixes
   with smaller fonts and flex-wrap.

   Goals:
   • One row, horizontal scroll for the 6 model filter chips (44px taps).
   • Discussion bar reduced to ONE compact row on mobile (chips only);
     the secondary meta (Rows/Cols, "Showing all messages", Hide-mine)
     collapses behind a single "Options" disclosure to reclaim vertical
     space (rendered via CSS-only :focus-within trick).
   • Input row never wraps: utility buttons collapse behind a [+] menu
     on small phones (CSS-only — buttons stay in DOM for JS).
   • Stuck-to-bottom input bar with safe-area-inset padding.
   • Header: keep Guide + Chat/Code + Canvas reachable, no horizontal
     scroll (Chrome iOS hides the scrollbar — invisible UX). Sacrificed
     elements (header-title, conn dot text) consolidate at small sizes.
   ═══════════════════════════════════════════════════════════════════════ */

/* === iPad landscape: ≤1024px (kept from prior overhaul) ================= */
@media (max-width: 1024px) {
  #discussion-mode-bar { flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
  #discussion-mode-bar .mode-hint { font-size: 11px; flex-basis: 100%; }
  #header-title { font-size: 14px; }
  .settings-panel { max-width: 92vw; }
}

/* === iPad portrait + phone: ≤768px ====================================== */
@media (max-width: 768px) {

  /* — IMPERSONATION BANNER — */
  #impersonation-banner { font-size: 11px; line-height: 1.4; padding-top: calc(6px + env(safe-area-inset-top, 0px)); padding-bottom: 6px; }
  #impersonation-banner button { padding: 4px 10px !important; font-size: 11px !important; min-height: 28px; }

  /* — HEADER —
     Compact, no horizontal scroll. The 5 essential controls fit:
     [☰] [Guide] [Chat|Code] [Canvas]. Header title hidden — sidebar
     header carries the session name. Conn status reduced to dot only. */
  #header {
    height: 48px; padding: 0 8px; gap: 6px;
    flex-shrink: 0; flex-wrap: nowrap;
    overflow: visible;
  }
  #header-title { display: none; }
  .header-status {
    font-size: 0; padding: 6px; gap: 0;
    border-radius: 50%; width: 14px; height: 14px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .header-status .dot { width: 8px; height: 8px; }
  .mode-toggle { display: flex !important; gap: 2px; padding: 2px; flex-shrink: 0; }
  .mode-toggle-btn { padding: 6px 9px; font-size: 11px; min-height: 36px; }
  #help-guide-btn { display: inline-flex !important; padding: 6px 9px; font-size: 11px; min-height: 36px; flex-shrink: 0; }
  #toggle-canvas-btn { padding: 6px 9px; font-size: 11px; min-height: 36px; flex-shrink: 0; }
  #toggle-sidebar-btn { padding: 8px; min-width: 40px; min-height: 40px; flex-shrink: 0; }

  /* — SIDEBAR overlay — */
  #app { flex-direction: column; height: 100vh; height: 100dvh; }
  #sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
    width: min(85vw, 320px); min-width: 0;
  }
  #sidebar.collapsed { transform: translateX(-100%); width: 0; min-width: 0; }
  #quick-panel { display: none; }
  #canvas-panel {
    position: fixed; right: 0; top: 0; bottom: 0;
    width: 100vw !important; max-width: 100vw; z-index: 150;
  }
  #main { flex: 1; min-height: 0; display: flex; flex-direction: column; }

  /* — DISCUSSION MODE BAR — single compact row (chips only).
     Meta row (Rows/Cols toggle, filter status, hide-mine, label)
     is moved into a collapsed "Options" surface that the user can
     expand. We do this in CSS by giving the meta items order:99 and
     hiding them unless #discussion-mode-bar is .show-options.
     JS for the toggle button is added in HTML; backwards-compat:
     on desktop/tablet the bar still shows everything.
     NOTE: gated on .active — the bar must stay hidden on the empty welcome
     screen and only appear once a debate exists (see app.js showDiscussionBar). */
  #discussion-mode-bar { display: none; }
  #discussion-mode-bar.active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 6px 8px;
    overflow: visible;
  }
  #discussion-mode-bar .mode-label,
  #discussion-mode-bar #filter-status,
  #discussion-mode-bar #chat-layout-toggle,
  #discussion-mode-bar #hide-user-toggle {
    display: none;
  }
  #discussion-mode-bar.show-options .mode-label,
  #discussion-mode-bar.show-options #filter-status,
  #discussion-mode-bar.show-options #chat-layout-toggle,
  #discussion-mode-bar.show-options #hide-user-toggle {
    display: flex; align-items: center; gap: 6px;
  }
  #discussion-mode-bar.show-options .mode-label {
    font-size: 11px; line-height: 1.3;
  }
  #mobile-options-toggle {
    display: none;  /* desktop hides this */
  }

  /* Chips row — one horizontal-scroll line, 44px taps, no wrap */
  #discuss-target-wrap {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 4px 2px 6px;
    scrollbar-width: none;
    margin: 0;
  }
  #discuss-target-wrap::-webkit-scrollbar { display: none; }
  .discuss-target-btn {
    flex: 0 0 auto !important;
    white-space: nowrap;
    padding: 9px 14px !important;
    font-size: 14px !important;
    min-height: 40px;
    border-radius: 20px;
    display: inline-flex; align-items: center; gap: 6px;
  }
  .discuss-target-btn img { width: 16px !important; height: 16px !important; }

  /* Round + New Debate buttons — sized for touch when visible */
  #continue-debate-btn, #new-debate-btn {
    font-size: 12px; padding: 8px 12px; min-height: 36px;
  }

  /* Mobile Options toggle button — only shows on mobile */
  .mobile-options-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 6px;
  }
  .mobile-options-bar #mobile-options-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(139, 92, 246, 0.10);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px 12px; font-size: 12px;
    font-family: inherit; cursor: pointer; min-height: 32px;
  }
  .mobile-options-bar #mobile-options-toggle:hover,
  .mobile-options-bar #mobile-options-toggle.active {
    background: rgba(139, 92, 246, 0.20);
    color: var(--text-primary);
  }

  /* — SIDEBAR PROJECTS — */
  .sidebar-section-header { padding: 6px 12px 2px; font-size: 10px; }
  .sidebar-section-header button { font-size: 9px; padding: 2px 7px; min-height: 22px; }
  #projects-recent-list { padding: 0 6px; }
  #active-project-pill { max-width: 130px; font-size: 10px; padding: 3px 8px; }

  /* — CHAT AREA — */
  #chat-area {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 12px 12px 16px;
    -webkit-overflow-scrolling: touch;
  }
  .msg { padding: 6px 0; }
  .msg-avatar { width: 28px; height: 28px; font-size: 14px; }
  .msg-avatar img { width: 28px; height: 28px; }
  .msg-body { max-width: 92%; }
  .msg-header { font-size: 12px; }
  .msg-content {
    font-size: 15px !important;
    padding: 12px 14px !important;
    line-height: 1.6 !important;
  }

  /* — INPUT AREA — sticky to bottom, safe-area-aware, no wrap.
     Utility buttons (attach, export, image-gen, project pill) collapse
     under [+] menu visually — they stay in DOM (JS unaffected). Action
     surface: [+] [textarea] [model] [send]. */
  #input-area {
    padding: 8px 10px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    flex-shrink: 0;
    position: relative;
    z-index: 50;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
  }
  #input-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 6px;
    padding: 6px 6px 6px 8px;
    border-radius: 14px;
  }
  /* iOS auto-zoom kill (≥16px on focusable inputs) */
  #promptInput {
    font-size: 16px !important;
    min-height: 24px;
    line-height: 1.45;
    flex: 1 1 auto;
    order: 50;
    padding: 8px 4px;
  }
  /* Tools now live in the persistent vertical #tool-rail (left of chat),
     not behind the old [+] popup. Keep them visible on mobile per user
     request to SEE the tools — rail narrows to 44px to preserve chat width.
     The old .show-utilities / .mobile-plus-btn rules are retired. */
  #tool-rail {
    flex: 0 0 44px; width: 44px; padding: 8px 0; gap: 4px;
  }
  #tool-rail .input-btn,
  #tool-rail #exportBtnWrap > .input-btn,
  #tool-rail #imageGenBtnWrap > .input-btn {
    width: 38px; height: 38px;
  }
  #tool-rail #exportBtnWrap, #tool-rail #imageGenBtnWrap { width: 38px; }
  /* On touch, tooltips are noise — hide the hover label */
  #tool-rail .input-btn::after { display: none; }
  /* Rail popups: full-width sheets anchored from the rail on small screens */
  #tool-rail .export-popup {
    top: auto; bottom: 64px; left: 4px;
    width: calc(100vw - 52px);
  }
  #tool-rail #imageGenPopup {
    top: auto !important; bottom: 64px !important; left: 4px !important;
    width: calc(100vw - 52px) !important; max-height: 70vh; overflow-y: auto;
  }
  /* Hide active-project pill in input row on mobile — sidebar already shows project */
  #active-project-pill { display: none !important; }

  .input-btn { width: 38px; height: 38px; font-size: 15px; flex-shrink: 0; }

  /* Model selector — wider tap, readable */
  #modelSelectorWrap { order: 60; flex-shrink: 0; }
  #modelSelectorBtn {
    min-height: 44px;
    font-size: 13px;
    padding: 8px 10px;
    max-width: 38vw;
  }
  #modelSelectorBtn .sel-label {
    max-width: 22vw;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  #modelDropdown {
    min-width: min(280px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: 60vh; overflow-y: auto;
    font-size: 14px;
    right: 0; left: auto;
  }
  #modelDropdown .sel-option, #modelDropdown .sel-current {
    padding: 12px 14px; min-height: 44px;
    display: flex; align-items: center; gap: 8px;
    font-size: 14px;
  }

  #sendBtn { padding: 10px 14px; font-size: 13px; min-height: 44px; order: 70; flex-shrink: 0; }
  #stopBtn { padding: 10px 12px; font-size: 12px; min-height: 44px; order: 70; flex-shrink: 0; }

  /* Smart-send action-mode toggle (Discuss/Round/Arbiter) — tighter on mobile */
  #action-mode-toggle .action-seg {
    font-size: 12px; padding: 6px 10px; min-height: 36px;
  }
  #action-mode-toggle .action-seg span { font-size: 12px; }

  /* — POPUPS — */
  .export-popup {
    width: calc(100vw - 20px); left: -10px;
    bottom: calc(100% + 6px);
  }
  #imageGenPopup { width: calc(100vw - 20px) !important; left: -10px !important; max-height: 70vh; overflow-y: auto; }
  .custom-select-dropdown { max-height: 60vh; }

  /* — SCROLL TO BOTTOM — moved higher so it doesn't sit ON the input bar */
  .scroll-bottom-btn { bottom: 110px; width: 44px; height: 44px; }

  /* — SESSION FILES BAR — */
  #session-files-bar { padding: 4px 10px; font-size: 11px; }

  /* — WELCOME — */
  #welcome h1 { font-size: 22px; }
  #welcome p { font-size: 14px; max-width: 320px; line-height: 1.5; }
  #welcome-logo { width: 72px; height: 72px; }

  /* — SETTINGS PANEL — full screen, vertical nav stack — */
  .settings-panel {
    width: 100vw; max-width: 100vw;
    height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh;
    border-radius: 0; flex-direction: column;
  }
  .settings-nav {
    flex-direction: column !important; flex-wrap: nowrap !important;
    overflow-x: visible; overflow-y: auto;
    max-height: 45vh;
    -webkit-overflow-scrolling: touch;
    padding: 8px; gap: 2px;
    width: 100%; min-width: 0;
    border-right: none; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .settings-nav-header {
    flex: 0 0 auto; padding: 0 8px 6px 0;
    width: 100%; border-right: none; border-bottom: 1px solid var(--border);
    margin-right: 0; margin-bottom: 4px;
  }
  .settings-nav-btn {
    flex: 0 0 auto; white-space: nowrap;
    padding: 12px 14px; font-size: 14px; min-height: 44px;
    width: 100%; text-align: left; justify-content: flex-start;
  }
  .settings-nav-divider {
    display: block !important; width: auto; height: 1px;
    background: var(--border); margin: 6px 0; flex: 0 0 auto;
  }
  .settings-nav-label {
    display: block; font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.5px; opacity: 0.6;
    padding: 8px 14px 4px;
  }
  #admin-nav-items.is-admin-nav-visible { display: contents !important; }
  .settings-nav > div:last-child {
    margin-top: 8px !important; margin-left: 0 !important;
    padding-top: 0 !important; border-top: none !important;
    flex: 0 0 auto;
  }
  .settings-content {
    padding: 16px 12px;
    flex: 1; overflow-y: auto;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .setting-input, .setting-input-sm, .setting-textarea, select.setting-input, input.setting-input {
    font-size: 16px;
  }
  .llm-config-card { margin-bottom: 8px; }
  .model-row { flex-direction: column !important; gap: 8px; }
  #pane-council, #pane-models { padding-bottom: 100px; }

  /* — PROJECTS MODAL — */
  #projects-all-modal > div { max-height: 80vh; padding: 16px !important; }

  /* — CANVAS PANEL fullscreen overlay — */
  #canvas-panel.visible {
    position: fixed; inset: 0; width: 100vw !important; max-width: 100vw;
    z-index: 200;
  }

  /* — CONFIRM DIALOG — */
  .confirm-box { width: 90vw; max-width: 360px; padding: 18px; }

  /* — HELP / GUIDE MODAL — */
  .help-modal { width: 100vw !important; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; border-radius: 0; }
  .help-layout { flex-direction: column; }
  .help-nav {
    width: 100%; min-width: 100%; flex-direction: row; flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden; padding: 8px;
    border-right: none; border-bottom: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
  }
  .help-nav-btn { flex: 0 0 auto; white-space: nowrap; padding: 8px 14px; min-height: 36px; }
  .help-content { padding: 16px; flex: 1; overflow-y: auto; }
  .help-close { padding: 8px 12px !important; font-size: 26px !important; min-width: 40px; min-height: 40px; }

  /* — DEBATE CARDS — */
  .debate-card-content { padding: 10px 14px 14px 14px; font-size: 15px; line-height: 1.6; }
  .debate-card-preview { padding: 0 14px 8px 14px; font-size: 13px; }
  .debate-card-header { padding: 10px 14px; gap: 10px; }
  .debate-stage-header { padding: 10px 14px; }
  .debate-stage.brainstorm-round .debate-card-content { padding: 10px 14px 14px 14px; }
  .brainstorm-synthesis-header { padding: 11px 14px; }
  .brainstorm-synthesis-content { padding: 12px 16px 16px 16px; font-size: 15px; }
  .mode-progress-chip { margin: 12px 14px; max-width: none; }
  .debate-stage { margin: 10px 0; }
  .msg.system .msg-content pre,
  .debate-card-content pre { font-size: 13px; padding: 10px 12px; max-width: 100%; }

  /* — DISABLE the buggy iOS zoom property on mobile —
     `zoom: var(--font-scale)` on #chat-area / #input-area was causing
     fixed-position math errors and bleed-through on Chrome iOS. */
  #main > #header,
  #chat-area,
  #input-area { zoom: 1 !important; }
}

/* === Small phones: ≤480px =============================================== */
@media (max-width: 480px) {
  #impersonation-banner { font-size: 10px; padding-left: 10px; padding-right: 10px; }
  #impersonation-banner button { font-size: 10px !important; padding: 3px 8px !important; }

  /* Header even tighter; hide canvas badge text */
  #header { height: 46px; padding: 0 6px; gap: 4px; }
  .mode-toggle-btn { padding: 5px 7px; font-size: 10px; min-height: 36px; }
  #help-guide-btn { padding: 5px 7px; font-size: 10px; min-height: 36px; }
  #toggle-canvas-btn { padding: 5px 7px; font-size: 10px; min-height: 36px; }
  #toggle-canvas-btn .canvas-count { font-size: 9px; padding: 1px 5px; }

  #active-project-pill { max-width: 100px; padding: 2px 6px; font-size: 9px; }
  #active-project-pill svg { width: 10px; height: 10px; }

  /* Chips — slightly tighter but still 40px tap */
  .discuss-target-btn {
    padding: 8px 12px !important; font-size: 13px !important;
    min-height: 40px;
  }
  .discuss-target-btn img { width: 14px !important; height: 14px !important; }
  #continue-debate-btn, #new-debate-btn { font-size: 11px; padding: 7px 10px; min-height: 34px; }

  #chat-area { padding: 10px 10px 14px; }
  .msg-content { font-size: 14px !important; padding: 11px 13px !important; line-height: 1.55 !important; }
  .msg-body { max-width: 94%; }

  #input-area { padding: 6px 8px; padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
  #input-row { padding: 4px 4px 4px 6px; gap: 4px; }
  #promptInput { font-size: 16px !important; }
  .mobile-plus-btn { width: 36px; height: 36px; font-size: 18px; }
  #modelSelectorBtn { font-size: 12px; padding: 7px 8px; max-width: 34vw; min-height: 40px; }
  #modelSelectorBtn .sel-label { max-width: 18vw; }
  #sendBtn { padding: 9px 12px; font-size: 12px; min-height: 40px; }
  #stopBtn { padding: 9px 10px; font-size: 11px; min-height: 40px; }

  .settings-nav-btn { padding: 10px 12px; font-size: 13px; min-height: 40px; }
  .settings-nav-title-wrap { display: none; }
  .settings-nav-header { padding: 0 4px !important; gap: 0 !important; }
  .settings-close { font-size: 22px !important; padding: 4px 8px !important; min-width: 36px; min-height: 36px; }

  #welcome h1 { font-size: 20px; }
  #welcome p { font-size: 13px; max-width: 92vw; }
  #welcome-logo { width: 56px; height: 56px; }

  .custom-select-dropdown { left: 0; right: 0; max-width: 100vw; min-width: 0; }
  .sel-group-label { font-size: 9px; padding: 6px 10px 2px; }
  .sel-option { padding: 10px 12px; font-size: 13px; }
  .sel-option .sel-logo { width: 14px; height: 14px; }

  #imageGenPopup { width: calc(100vw - 16px) !important; left: -8px !important; }
  #imageGenPopup .setting-input-sm { font-size: 14px !important; padding: 6px 8px !important; }

  .quick-model-toggle .quick-tier-badge { display: none; }

  .debate-card-content { padding: 9px 12px 12px 12px; font-size: 14px; line-height: 1.55; }
  .debate-card-preview { padding: 0 12px 8px 12px; font-size: 12px; }
  .debate-card-header { padding: 9px 12px; gap: 8px; }
  .debate-stage-header { padding: 9px 12px; }
  .msg.system .msg-content pre,
  .debate-card-content pre { font-size: 12px; padding: 9px 11px; }

  .export-popup { width: calc(100vw - 16px); left: -8px; }
  .scroll-bottom-btn { bottom: 100px; width: 44px; height: 44px; }
}

/* === Phone landscape (short height) ===================================== */
@media (max-height: 500px) and (orientation: landscape) {
  #header { height: 42px; }
  #welcome { padding: 8px; }
  #welcome-logo { width: 40px; height: 40px; }
  #welcome h1 { font-size: 16px; margin: 2px 0; }
  #welcome p { font-size: 12px; line-height: 1.4; }
  #input-area { padding: 4px 8px; padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
  #discussion-mode-bar { padding: 4px 8px; }
  .settings-content { padding: 10px 12px; }
  .help-modal { max-height: 92vh; }
}

/* === Touch-coarse devices (any width) =================================== */
@media (hover: none) and (pointer: coarse) {
  /* Minimum touch targets per Apple HIG */
  .session-action-btn,
  .discuss-target-btn,
  .input-btn,
  .mode-toggle-btn,
  .header-btn,
  .settings-nav-btn,
  .quick-btn,
  #stopBtn,
  #sendBtn,
  .refresh-models-btn { min-width: 32px; min-height: 36px; }
  /* mobile-chat-readability: primary chat actions get 44px (Apple HIG) */
  #sendBtn, #stopBtn { min-width: 44px; min-height: 44px; }
  /* No long-press text selection on tap targets */
  button, .sel-option, .session-item, .project-item {
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  }
  /* iOS-style momentum scrolling on long lists */
  .settings-content, #chat-area, .canvas-code-area, #projects-recent-list, .help-content,
  .custom-select-dropdown, #projects-all-list {
    -webkit-overflow-scrolling: touch;
  }
}

/* === Notched-device safe areas (covers all the iPhone Pro Max-class) ==== */
@supports (padding: env(safe-area-inset-bottom)) {
  #input-area { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  #sidebar-footer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

/* === SESSION FILES BAR === */
#session-files-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 20px; background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
  font-size: 12px;
}
.files-label { color: var(--text-secondary); flex-shrink: 0; }
.session-file-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-dim); border: 1px solid var(--border-active);
  border-radius: 20px; padding: 3px 10px; font-size: 11px; color: var(--text-primary);
}
.session-file-del {
  background: none; border: none; color: var(--danger); cursor: pointer;
  font-size: 12px; padding: 0 2px; line-height: 1;
}
.session-file-add {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-primary); border: 1px dashed var(--border);
  color: var(--text-secondary); font-size: 14px; cursor: pointer;
  transition: all var(--transition);
}
.session-file-add:hover { border-color: var(--accent); color: var(--accent); }

/* === UPLOAD AREA === */
.upload-area {
  display: block; padding: 14px; text-align: center;
  background: var(--bg-tertiary); border: 1px dashed var(--border);
  border-radius: var(--radius-md); cursor: pointer;
  font-size: 12px; color: var(--text-secondary);
  transition: all var(--transition);
}
.upload-area:hover { border-color: var(--accent); color: var(--text-primary); }

/* === DEBATE STAGE CARDS === */
.debate-stage {
  margin: 12px 0; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-secondary); overflow: hidden;
}
.debate-stage-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border); cursor: pointer;
  user-select: none;
}
.debate-stage-header:hover { background: var(--bg-hover, rgba(255,255,255,0.03)); }
.debate-stage-title {
  font-size: var(--fs-sm, 13px); font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.debate-stage-toggle {
  font-size: 11px; color: var(--text-dim); transition: transform 0.2s;
}
.debate-stage.collapsed .debate-stage-body { display: none; }
.debate-stage.collapsed .debate-stage-toggle { transform: rotate(-90deg); }
.debate-stage-body { padding: 0; }

/* Individual model card within a stage */
.debate-card {
  border-bottom: 1px solid var(--border);
}
.debate-card:last-child { border-bottom: none; }
.debate-card-header {
  display: flex; align-items: center; gap: 10px;
  /* [CTRLVIS] flex-wrap so the right-edge control tail (Flag · Reconsider ·
     copy/expand/fullscreen) DROPS to a visible second line on narrow column
     cards instead of overflowing the clipped right edge and disappearing. */
  flex-wrap: wrap; row-gap: 6px;
  padding: 8px 16px; cursor: pointer; user-select: none;
  transition: background 0.1s;
}
.debate-card-header:hover { background: rgba(255,255,255,0.02); }
/* [CTRLVIS] The universal copy/expand/fullscreen group must never be clipped.
   It keeps its margin-left:auto (set inline) to ride the right edge; flex-shrink:0
   keeps the icons intact, and the wrapping header guarantees it stays in-bounds.
   These rules were missing from style_v1.css entirely (only existed in the
   disabled style_v2.css), so the buttons rendered as unstyled, clipped defaults. */
.debate-card-header .msg-actions,
.msg-header .msg-actions {
  display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0;
}
.debate-card-header .msg-action-btn,
.msg-header .msg-action-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-dim); padding: 4px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; line-height: 1;
  transition: color 0.12s, background 0.12s;
}
.debate-card-header .msg-action-btn:hover,
.msg-header .msg-action-btn:hover {
  color: var(--text-primary); background: rgba(255,255,255,0.08);
}
.debate-card-header .msg-action-btn svg,
.msg-header .msg-action-btn svg { width: 15px; height: 15px; }
.debate-card-avatar {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  overflow: hidden; padding: 3px;
}
.debate-card-avatar img { width: 100%; height: 100%; object-fit: contain; }
.debate-card-name {
  font-size: var(--fs-sm, 13px); font-weight: 500; color: var(--text-primary);
  /* [CTRLVIS] min-width:0 lets the name shrink so the control tail wraps cleanly
     to line 2 rather than forcing a horizontal overflow that clips the actions. */
  flex: 1 1 auto; min-width: 0;
}
/* [CARDMATCH] brand-colored provider names (trivial mirror of the v2 rule so the
   v1 baseline shows the iOS brand colors too). Layout unchanged. */
.debate-card[data-provider="claude"]   .debate-card-name { color: #d97706; }
.debate-card[data-provider="chatgpt"]  .debate-card-name { color: #10b981; }
.debate-card[data-provider="gemini"]   .debate-card-name { color: #4d8bf5; }
.debate-card[data-provider="grok"]     .debate-card-name { color: #f4f4f5; }
.debate-card[data-provider="deepseek"] .debate-card-name { color: #4d6bfe; }
.debate-card[data-provider="qwen"]     .debate-card-name { color: #a855f7; }
.debate-card[data-provider="minimax"]  .debate-card-name { color: #ef4444; }
.debate-card-meta {
  font-size: 11px; color: var(--text-dim);
}
.debate-card-confidence {
  font-size: 11px; font-weight: 600; padding: 1px 6px;
  border-radius: 10px; background: var(--accent-dim); color: var(--accent-hover);
}
.debate-card-arrow {
  font-size: 10px; color: var(--text-dim); transition: transform 0.2s;
}
.debate-card.collapsed .debate-card-content { display: none; }
.debate-card.collapsed .debate-card-arrow { transform: rotate(-90deg); }
.debate-card-content {
  padding: 8px 16px 12px 48px;
  font-size: var(--fs-base, 14px); line-height: 1.7; color: var(--text-primary);
  word-break: break-word;
}
.debate-card-content pre {
  overflow-x: auto; background: var(--bg-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px; margin: 8px 0; font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.debate-card-content code {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  background: var(--bg-primary); padding: 1px 5px; border-radius: 3px;
}
.debate-card-content pre code { background: none; padding: 0; }
.debate-card-preview {
  padding: 0 16px 8px 48px; font-size: var(--fs-sm, 12px);
  color: var(--text-dim); line-height: 1.4;
  max-height: 40px; overflow: hidden;
}
.debate-card.collapsed .debate-card-preview { display: block; }
.debate-card:not(.collapsed) .debate-card-preview { display: none; }

/* Arbiter card — always prominent */
.debate-stage.arbiter { border-color: var(--accent-dim); }
.debate-stage.arbiter .debate-stage-header {
  background: var(--accent-dim);
}
.debate-stage.arbiter .debate-stage-title { color: var(--accent-hover); }

/* === CONSENSUS PRESENTATION === */
/* Parity with brainstorm: member rounds get a labeled tinted band ("Round 1 ·
   Takes" / "Round 2 · Converge"); the FINAL spokesperson card is the primary,
   accent-tinted answer card labeled "Consensus · <model>". */
.debate-stage.consensus-round { border-color: rgba(16,185,129,0.22); }
.debate-stage.consensus-round .debate-stage-header { background: rgba(16,185,129,0.08); }
.debate-stage.consensus-round .debate-stage-title { color: #6ee7b7; }
.debate-stage.consensus-round .debate-card { max-width: none; }
/* Final consensus card — visually PRIMARY (tinted border + tinted bg + gradient
   header band), overriding the generic .arbiter look it also carries. */
.debate-stage.arbiter.consensus-final {
  border-color: var(--accent, #6366f1); border-width: 1px;
  background: rgba(99,102,241,0.05);
  box-shadow: 0 4px 24px rgba(99,102,241,0.14);
}
.debate-stage.arbiter.consensus-final > .debate-stage-header {
  background: linear-gradient(90deg, var(--accent-dim, rgba(99,102,241,0.16)), rgba(99,102,241,0.04));
  border-bottom: 1px solid var(--accent-dim, rgba(99,102,241,0.30));
}
.debate-stage.arbiter.consensus-final > .debate-stage-header .debate-stage-title { color: var(--accent-hover); }
.debate-stage.arbiter.consensus-final .debate-card { max-width: none; }

/* === BRAINSTORM PRESENTATION === */
/* Each round is its own clearly-bounded group with a labeled, collapsible header.
   Member cards inside show their FULL idea (no truncation) for legibility. */
.debate-stage.brainstorm-round { border-color: rgba(139,92,246,0.22); }
.debate-stage.brainstorm-round .debate-stage-header {
  background: rgba(139,92,246,0.08);
}
.debate-stage.brainstorm-round .debate-stage-title { color: #c4b5fd; }
/* Brainstorm member cards stay expanded + full-width — readable vertical flow, no
   cramped column truncation. Reset any inherited column caps. */
.debate-stage.brainstorm-round .debate-card,
.debate-stage.brainstorm-synthesis-stage .debate-card { max-width: none; }
.debate-stage.brainstorm-round .debate-card-content { padding: 8px 16px 14px 48px; }

/* Synthesis stage (live) — primary accent treatment beyond the generic arbiter look. */
.debate-stage.brainstorm-synthesis-stage {
  border-color: var(--accent); border-width: 1px;
  box-shadow: 0 4px 24px rgba(99,102,241,0.12);
}
.debate-stage.brainstorm-synthesis-stage > .debate-stage-header {
  background: linear-gradient(90deg, var(--accent-dim, rgba(99,102,241,0.16)), rgba(99,102,241,0.04));
}
.debate-stage.brainstorm-synthesis-stage > .debate-stage-header .debate-stage-title { color: var(--accent-hover); }

/* Synthesis card (reload path) — the answer, made visually PRIMARY. */
.brainstorm-synthesis-card {
  margin: 16px 0; border: 1px solid var(--accent, #6366f1);
  border-radius: var(--radius-md, 12px); background: var(--bg-secondary);
  overflow: hidden; box-shadow: 0 4px 24px rgba(99,102,241,0.14);
}
.brainstorm-synthesis-header {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px;
  background: linear-gradient(90deg, var(--accent-dim, rgba(99,102,241,0.16)), rgba(99,102,241,0.04));
  border-bottom: 1px solid var(--accent-dim, rgba(99,102,241,0.30));
}
.brainstorm-synthesis-avatar {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; padding: 5px;
}
.brainstorm-synthesis-avatar svg { width: 100%; height: 100%; }
.brainstorm-synthesis-title {
  font-size: var(--fs-base, 15px); font-weight: 700; color: var(--accent-hover, #a5b4fc);
  letter-spacing: 0.01em;
}
.brainstorm-synthesis-sub {
  font-size: 11px; color: var(--text-secondary); margin-top: 1px; font-weight: 500;
}
/* Collapse/expand affordance — mirrors .debate-stage-toggle on the round groups so the
   synthesis card collapses exactly like a Round. The chevron rotates and the content is
   hidden when the card carries .collapsed. */
.brainstorm-synthesis-toggle {
  margin-left: auto; flex-shrink: 0; background: none; border: none; cursor: pointer;
  font-size: 11px; color: var(--text-dim); padding: 4px 6px; line-height: 1;
  transition: transform 0.2s; user-select: none;
}
.brainstorm-synthesis-toggle:hover { color: var(--text-secondary); }
.brainstorm-synthesis-card.collapsed .brainstorm-synthesis-content { display: none; }
.brainstorm-synthesis-card.collapsed .brainstorm-synthesis-toggle { transform: rotate(-90deg); }
.brainstorm-synthesis-content {
  padding: 14px 20px 18px 20px;
  font-size: var(--fs-base, 15px); line-height: 1.7; color: var(--text-primary);
  word-break: break-word;
}
/* [BSUI2] Default-cap the Brainstorm Results body to ~half the viewport with internal
   scroll so the card never dominates the screen — the user can scroll past it to the
   member cards. JS sets max-height:50vh + overflow-y:auto inline; the inline "Expand"
   control (decorateAiCard adds .expanded to the card) lifts the cap below. */
.brainstorm-synthesis-card.expanded .brainstorm-synthesis-content {
  max-height: none !important;
  overflow-y: visible !important;
}
/* [BSUI2] Same cap for the LIVE synthesis stage (rendered as a debate-stage card,
   not the reload .brainstorm-synthesis-card). The card's own .expanded toggle lifts it. */
.brainstorm-synthesis-stage .debate-card-content {
  max-height: 50vh;
  overflow-y: auto;
}
.brainstorm-synthesis-stage .debate-card.expanded .debate-card-content {
  max-height: none;
  overflow-y: visible;
}
.brainstorm-synthesis-content pre {
  overflow-x: auto; background: var(--bg-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px; margin: 8px 0; font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

/* === LIVE MODE PROGRESS CHIP === */
/* A single in-thread "working" indicator at the bottom of the chat. Pulses while
   a mode/debate runs; removed the moment the result lands or an error shows. */
.mode-progress-chip {
  display: flex; align-items: center; gap: 10px;
  margin: 14px auto; padding: 11px 18px;
  max-width: 560px;
  background: var(--accent-dim, rgba(99,102,241,0.12));
  border: 1px solid rgba(99,102,241,0.30);
  border-radius: 999px;
  color: var(--accent-hover, #a5b4fc);
  font-size: 13px; font-weight: 600;
  box-shadow: 0 2px 12px rgba(99,102,241,0.10);
  animation: mode-progress-fade 0.25s ease;
}
.mode-progress-text { line-height: 1.3; }
.mode-progress-spinner {
  width: 15px; height: 15px; flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(99,102,241,0.30);
  border-top-color: var(--accent, #6366f1);
  animation: mode-progress-spin 0.8s linear infinite;
}
@keyframes mode-progress-spin { to { transform: rotate(360deg); } }
@keyframes mode-progress-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Streaming indicator on cards */
.debate-card.streaming .debate-card-name::after {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent); margin-left: 8px;
  animation: pulse-dot 1.5s infinite;
}

/* === DISCUSSION MODE INDICATOR === */
#discussion-mode-bar {
  display: none; align-items: center; gap: 8px;
  padding: 6px 16px;
  background: rgba(99, 102, 241, 0.06);
  border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-secondary);
}
#discussion-mode-bar.active { display: flex; }
#discussion-mode-bar .mode-label {
  font-weight: 500; color: var(--accent-hover);
}
#discussion-mode-bar .mode-hint {
  color: var(--text-dim); font-size: 11px;
}
#new-debate-btn {
  margin-left: auto; padding: 4px 12px;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  font-size: 11px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: all var(--transition);
}
#new-debate-btn:hover { color: var(--text-primary); border-color: var(--accent); }

/* Discussion target selector */
#discuss-target-wrap {
  display: none; align-items: center; gap: 6px;
}
#discuss-target-wrap.active { display: flex; }
.discuss-target-btn {
  padding: 3px 8px; border-radius: var(--radius-sm);
  background: none; border: 1px solid var(--border);
  color: var(--text-dim); font-size: 11px; cursor: pointer;
  font-family: inherit; transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 4px;
}
.discuss-target-btn:hover { border-color: var(--text-secondary); color: var(--text-secondary); }
.discuss-target-btn.active {
  border-color: var(--accent); color: #fff;
  background: var(--accent); /* solid accent fill — much more visible than the prior dim version */
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
  font-weight: 600;
}
.discuss-target-btn img { width: 14px; height: 14px; }

/* === TRANSCRIPT FILTER ===
   When chat-area has data-filter set (claude/chatgpt/gemini/grok/deepseek), hide AI
   messages from non-matching providers. Human + system messages stay visible regardless. */
/* Descendant selector + !important so filter wins over .msg-row > .msg.system
   display: flex layout rules that would otherwise re-show the card. */
#chat-area[data-filter="claude"]   .msg[data-provider]:not([data-provider="claude"]):not([data-provider="human"]):not([data-provider="system"]) { display: none !important; }
#chat-area[data-filter="chatgpt"]  .msg[data-provider]:not([data-provider="chatgpt"]):not([data-provider="human"]):not([data-provider="system"]) { display: none !important; }
#chat-area[data-filter="gemini"]   .msg[data-provider]:not([data-provider="gemini"]):not([data-provider="human"]):not([data-provider="system"]) { display: none !important; }
#chat-area[data-filter="grok"]     .msg[data-provider]:not([data-provider="grok"]):not([data-provider="human"]):not([data-provider="system"]) { display: none !important; }
#chat-area[data-filter="deepseek"] .msg[data-provider]:not([data-provider="deepseek"]):not([data-provider="human"]):not([data-provider="system"]) { display: none !important; }
/* Same filter for live debate-cards (separate DOM structure from .msg cards). */
#chat-area[data-filter="claude"]   .debate-card[data-provider]:not([data-provider="claude"]) { display: none !important; }
#chat-area[data-filter="chatgpt"]  .debate-card[data-provider]:not([data-provider="chatgpt"]) { display: none !important; }
#chat-area[data-filter="gemini"]   .debate-card[data-provider]:not([data-provider="gemini"]) { display: none !important; }
#chat-area[data-filter="grok"]     .debate-card[data-provider]:not([data-provider="grok"]) { display: none !important; }
#chat-area[data-filter="deepseek"] .debate-card[data-provider]:not([data-provider="deepseek"]) { display: none !important; }

/* Purple top-stripe removed — filter status text + highlighted button already
   signal that a filter is active, the stripe was visual noise. */
@keyframes fadeOut {
  0%, 60% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

/* Mode toggle refinement */
.mode-toggle {
  display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden;
}
.mode-toggle-btn {
  padding: 4px 12px; background: none; border: none;
  color: var(--text-dim); font-size: 11px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  font-family: inherit;
}
.mode-toggle-btn.active {
  background: var(--accent-dim); color: var(--accent-hover);
}
.mode-toggle-btn.active[data-mode="code"] {
  background: rgba(234, 179, 8, 0.12); color: #eab308;
}
.mode-toggle-btn:hover:not(.active) { color: var(--text-secondary); }

/* === END OF FILE (FILENAME: /var/www/vhosts/pokepapi.com/council/public/css/style.css) === */

/* ── MEMBER-ATTRIBUTION CHIPS (final-result cards) ─────────────────────────── */
/* Small inline pills replacing the trailing " — [Name, …]" tag on Brainstorm  */
/* Results / Arbiter / Consensus points. Clickable → jump to that member's card.*/
.attr-chip-group { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: baseline; margin-left: 4px; }
.attr-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px 1px 6px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.5; letter-spacing: .01em;
  white-space: nowrap; user-select: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--text-primary, #e8e8ec);
  cursor: pointer; transition: background .12s, border-color .12s, transform .08s;
}
.attr-chip[role="button"]:hover { background: rgba(255,255,255,0.12); transform: translateY(-1px); }
.attr-chip[role="button"]:active { transform: translateY(0); }
.attr-chip:focus-visible { outline: 2px solid var(--accent, #a78bfa); outline-offset: 1px; }
.attr-chip-static { cursor: default; }
.attr-chip-icon { width: 13px; height: 13px; border-radius: 3px; flex-shrink: 0; object-fit: contain; }
.attr-chip-label { display: inline-block; }
/* Per-provider tint — matches the debate-card brand accents. */
.attr-chip-claude   { border-color: rgba(217,119,6,0.55);  background: rgba(217,119,6,0.14); }
.attr-chip-chatgpt  { border-color: rgba(16,185,129,0.55); background: rgba(16,185,129,0.14); }
.attr-chip-gemini   { border-color: rgba(139,92,246,0.55); background: rgba(139,92,246,0.14); }
.attr-chip-grok     { border-color: rgba(239,68,68,0.55);  background: rgba(239,68,68,0.14); }
.attr-chip-deepseek { border-color: rgba(77,107,254,0.55); background: rgba(77,107,254,0.14); }
.attr-chip-qwen     { border-color: rgba(124,58,237,0.55); background: rgba(124,58,237,0.14); }
.attr-chip-minimax  { border-color: rgba(236,72,153,0.55); background: rgba(236,72,153,0.14); }
.attr-chip-arbiter  { border-color: rgba(167,139,250,0.5); background: rgba(167,139,250,0.12); }
/* Run-mode LENS roles (strategize/monitor) — static analytic pills, styled
   like the Arbiter pill (muted slate, no brand color, no click affordance). */
.attr-chip-strategist { border-color: rgba(148,163,184,0.5); background: rgba(148,163,184,0.12); }
.attr-chip-skeptic    { border-color: rgba(148,163,184,0.5); background: rgba(148,163,184,0.12); }
.attr-chip-researcher { border-color: rgba(148,163,184,0.5); background: rgba(148,163,184,0.12); }
.attr-chip-analyst    { border-color: rgba(148,163,184,0.5); background: rgba(148,163,184,0.12); }

/* Flash-highlight the target member card after a chip jump. */
@keyframes attrJumpFlash {
  0%   { box-shadow: 0 0 0 0 rgba(167,139,250,0.0);  outline-color: rgba(167,139,250,0.95); }
  15%  { box-shadow: 0 0 0 3px rgba(167,139,250,0.55); }
  100% { box-shadow: 0 0 0 0 rgba(167,139,250,0.0);  outline-color: rgba(167,139,250,0.0); }
}
.attr-jump-flash {
  animation: attrJumpFlash 1.8s ease-out;
  outline: 2px solid rgba(167,139,250,0.95);
  outline-offset: 2px;
  border-radius: 10px;
}
