/* ─── CONSCIOUSNESS TWIN — Mobile-First Redesign ─── */

:root {
  --bg-deep: #05050f;
  --bg-primary: #0a0a18;
  --bg-secondary: #0f0f22;
  --bg-tertiary: #1a1a30;
  --bg-card: rgba(18, 18, 40, 0.6);
  --bg-hover: rgba(30, 30, 60, 0.8);
  --text-primary: #e8e8f0;
  --text-secondary: #9898b8;
  --text-muted: #5a5a7a;
  --accent: #7c5cfc;
  --accent-dim: #5a3dc8;
  --accent-glow: rgba(124, 92, 252, 0.15);
  --accent-glow-strong: rgba(124, 92, 252, 0.3);
  --blue: #4fc3f7;
  --purple: #ba68c8;
  --orange: #ffb74d;
  --green: #4ade80;
  --red: #e57373;
  --teal: #4db6ac;
  --pink: #f06292;
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 32px rgba(0,0,0,0.5);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --tab-height: 64px;
  --sidebar-width: 220px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

/* ─── Background Particles ─── */
#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100dvh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

/* ─── App Layout (mobile-first) ─── */
#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100vw;
}

/* ─── Main content area (scrollable, flexes above tab bar) ─── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: radial-gradient(ellipse at 30% 50%, rgba(124,92,252,0.03) 0%, transparent 60%);
  padding-bottom: 0;
}

.view {
  display: none;
  flex: 1;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.view.active { display: flex; }

/* ===================================================================
   MOBILE BOTTOM TAB BAR (visible by default)
   =================================================================== */
#mobile-tabs {
  display: flex;
  align-items: flex-end;
  height: calc(var(--tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(8, 8, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 100;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 9px;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 48px;
}

.tab-btn svg {
  width: 22px;
  height: 22px;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.tab-btn span {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tab-btn.active {
  color: var(--accent);
}

.tab-btn.active svg {
  opacity: 1;
}

/* ===================================================================
   SIDEBAR (desktop only, hidden on mobile)
   =================================================================== */
#sidebar {
  display: none;
}

/* ===================================================================
   SIDEBAR FOOTER STATS (moved to a mini-bar on mobile)
   =================================================================== */
#mobile-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px calc(6px + var(--safe-bottom));
  padding-bottom: calc(6px + var(--safe-bottom));
  background: rgba(8, 8, 20, 0.85);
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-muted);
  gap: 12px;
  flex-shrink: 0;
}

.mobile-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mobile-stat-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
}

.mobile-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

/* ===================================================================
   VIEW HEADER
   =================================================================== */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 24, 0.6);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  padding-top: calc(12px + var(--safe-top));
}

.view-header h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.view-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  display: block;
}

/* ===================================================================
   CHAT VIEW
   =================================================================== */
#chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.message {
  display: flex;
  gap: 8px;
  max-width: 92%;
  animation: msgIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.twin { align-self: flex-start; }

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 4px;
}

.message.user .msg-avatar {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 12px var(--accent-glow);
}

.message.twin .msg-avatar {
  background: rgba(124, 92, 252, 0.1);
  color: var(--accent);
  border: 1px solid rgba(124, 92, 252, 0.2);
}

.msg-content {
  padding: 10px 14px;
  border-radius: var(--radius);
  line-height: 1.6;
  font-size: 14px;
  word-break: break-word;
}

.message.user .msg-content {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: white;
  border-bottom-right-radius: 4px;
}

.message.twin .msg-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  backdrop-filter: blur(10px);
}

.msg-content p { margin-bottom: 6px; }
.msg-content p:last-child { margin-bottom: 0; }
.msg-content strong { color: var(--accent); }
.msg-prompt { color: var(--blue); font-style: italic; font-size: 13px; }

.msg-meta {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.conf-bar-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.conf-bar-bg {
  flex: 1;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.conf-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.msg-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}

.source-chip {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.reasoning-toggle {
  font-size: 10px;
  color: var(--accent);
  cursor: pointer;
  margin-top: 4px;
  display: inline-block;
  opacity: 0.6;
  transition: opacity var(--transition);
  padding: 4px 0;
  min-height: 28px;
}

.reasoning-toggle:hover { opacity: 1; }

.msg-reasoning {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 10px;
  margin-top: 4px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  display: none;
  line-height: 1.5;
  border-left: 2px solid var(--accent);
}

.msg-reasoning.open { display: block; }

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  align-items: center;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { opacity: 0.2; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-5px); }
}

/* ─── Chat Input ─── */
#chat-input-area {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  padding-bottom: calc(8px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: rgba(10, 10, 24, 0.85);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

#chat-input-wrapper {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: border-color var(--transition);
  display: flex;
  overflow: hidden;
}

#chat-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 100px;
  line-height: 1.5;
}

#chat-input::placeholder { color: var(--text-muted); }

#sendBtn {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
  align-self: flex-end;
  touch-action: manipulation;
}

#sendBtn:active {
  transform: scale(0.92);
}

#sendBtn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

/* ===================================================================
   MIND GRAPH VIEW
   =================================================================== */
#mind-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  padding-top: calc(10px + var(--safe-top));
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 24, 0.6);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.mind-header-left h2 {
  font-size: 15px;
  font-weight: 600;
}

.mind-subtitle {
  font-size: 10px;
  color: var(--text-muted);
}

.mind-controls { display: flex; align-items: center; gap: 8px; }

#graph-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #0a0a1a 0%, #05050f 100%);
  touch-action: none;
}

#graph-canvas { width: 100%; height: 100%; display: block; }

#graph-loading {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.graph-pulse {
  width: 36px; height: 36px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

#graph-tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  pointer-events: none;
  max-width: 220px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  z-index: 10;
}

#graph-tooltip.hidden { display: none; }
.tt-label { font-weight: 600; color: var(--text-primary); font-size: 13px; }
.tt-type { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.tt-content { color: var(--text-secondary); margin-top: 4px; }
.tt-strength { margin-top: 4px; }
.tt-bar { height: 3px; background: var(--bg-tertiary); border-radius: 2px; overflow: hidden; margin: 2px 0; }
.tt-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; }

#graph-legend {
  display: flex;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(10, 10, 24, 0.85);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

/* ===================================================================
   DASHBOARD VIEW
   =================================================================== */
#view-dashboard { display: none; flex-direction: column; }
#view-dashboard.active { display: flex; }

.dash-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px calc(12px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.dash-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  backdrop-filter: blur(12px);
}

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

.card-icon { font-size: 15px; }

.card-header h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.card-body { font-size: 13px; line-height: 1.6; }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  min-height: 32px;
}

.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-secondary); font-size: 12px; }
.stat-value { color: var(--text-primary); font-weight: 600; font-size: 13px; }

.tension-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.5;
}

.tension-item:last-child { border-bottom: none; }
.tension-icon { color: var(--orange); margin-right: 4px; }

.insight-item {
  padding: 8px 10px;
  margin-bottom: 5px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  border-left: 2px solid var(--accent);
}

.cal-dimension {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 11px;
  min-height: 28px;
}

.cal-bar-bg {
  flex: 1;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.cal-bar-fill { height: 100%; border-radius: 2px; transition: width 0.8s ease; }

/* ===================================================================
   IMPRINT VIEW
   =================================================================== */
#imprint-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px calc(12px + var(--safe-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}

.imprint-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
  touch-action: manipulation;
  min-height: 80px;
}

.imprint-card:active {
  transform: scale(0.97);
  border-color: var(--accent);
}

.imprint-card.completed {
  border-color: var(--green);
  opacity: 0.7;
}

.imprint-dim-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.imprint-dim-icon { font-size: 16px; }
.imprint-dim-name { font-weight: 600; font-size: 12px; }
.imprint-dim-desc { font-size: 10px; color: var(--text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.imprint-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.imprint-status {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.imprint-status.ready { background: var(--accent); animation: pulse-dot 2s infinite; }
.imprint-status.completed { background: var(--green); }

.imprint-questions {
  font-size: 9px;
  color: var(--text-muted);
}

.primary-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  border: none;
  color: white;
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  touch-action: manipulation;
  white-space: nowrap;
}

.primary-btn:active {
  transform: scale(0.97);
}

/* ===================================================================
   UTILITIES
   =================================================================== */
.badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  touch-action: manipulation;
  min-width: 32px;
  min-height: 32px;
}

.icon-btn:active { background: var(--bg-hover); }

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 6px 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

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

/* ===================================================================
   TABLET & DESKTOP (768px+)
   =================================================================== */
@media (min-width: 768px) {
  #app {
    flex-direction: row;
  }

  /* Sidebar returns */
  #sidebar {
    display: flex;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: rgba(8, 8, 20, 0.85);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 10px;
    gap: 4px;
    height: 100dvh;
    overflow-y: auto;
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 16px 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
  }

  .twin-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .rotating-ring {
    animation: spinRing 8s linear infinite;
    transform-origin: center;
  }

  .rotating-ring-reverse {
    animation: spinRing 12s linear infinite reverse;
    transform-origin: center;
  }

  @keyframes spinRing {
    to { transform: rotate(360deg); }
  }

  .twin-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .twin-name {
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, #7c5cfc, #4fc3f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .twin-status {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
    animation: pulse-dot 2s infinite;
  }

  .twin-status.offline .status-dot { background: var(--red); }

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

  .sidebar-nav-section {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 8px;
  }

  .nav-section-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 8px 10px 4px;
    font-weight: 600;
  }

  .nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    width: 100%;
    text-align: left;
  }

  .nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
  }

  .nav-btn.active {
    background: var(--accent-glow);
    color: var(--accent);
    box-shadow: inset 2px 0 0 var(--accent);
  }

  .nav-btn svg { flex-shrink: 0; opacity: 0.8; }
  .nav-btn.active svg { opacity: 1; }

  .sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .sidebar-stats {
    display: flex;
    gap: 12px;
    padding: 4px 6px;
  }

  .mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }

  .mini-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
  }

  .mini-stat-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
  }

  /* Hide mobile elements on desktop */
  #mobile-tabs { display: none; }
  #mobile-status-bar { display: none; }

  /* Desktop main area */
  #main {
    padding-bottom: 0;
  }

  /* Restore original desktop padding for chat */
  #chat-messages {
    padding: 24px 28px;
    gap: 16px;
  }

  .message { max-width: 80%; }
  .msg-content { padding: 12px 18px; font-size: 14px; }

  #chat-input-area {
    padding: 16px 28px 20px;
    gap: 8px;
  }

  #chat-input-wrapper { border-radius: 8px; }
  #chat-input { padding: 10px 14px; }

  #sendBtn {
    width: auto;
    height: auto;
    border-radius: var(--radius-sm);
    padding: 0 18px;
  }

  .view-header {
    padding: 18px 28px;
    padding-top: 18px;
  }

  .view-header h2 { font-size: 18px; }

  #mind-header {
    padding: 14px 28px;
    padding-top: 14px;
  }

  .mind-header-left h2 { font-size: 16px; }

  .dash-scroll { padding: 20px 28px; }

  .dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .dash-card { padding: 20px; }

  #imprint-grid {
    padding: 20px 28px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
  }

  .imprint-card { padding: 16px; min-height: auto; }
  .imprint-dim-name { font-size: 14px; }
  .imprint-dim-desc { font-size: 12px; }

  #graph-legend {
    padding: 10px 28px;
    gap: 18px;
  }

  .legend-item { font-size: 11px; }
}

/* ─── Correction prompt inline styles override ─── */
#correction-input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

#correction-send {
  background: var(--accent);
  border: none;
  color: white;
  padding: 10px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  white-space: nowrap;
}
