/* ============================================================
   JARVIS — desktop UI
   ============================================================ */
:root {
  --bg:           #08080d;
  --bg-elev-1:    #11111a;
  --bg-elev-2:    #181824;
  --bg-elev-3:    #1f1f2e;
  --border:       rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text:         #e8e8ef;
  --text-muted:   #8a8a9a;
  --text-dim:     #5a5a6a;
  --accent:       #00d9ff;
  --accent-2:     #b794f6;
  --danger:       #ff5e6c;
  --warning:      #ffb454;
  --success:      #4ade80;
  --shadow-lg:    0 24px 64px rgba(0,0,0,0.5);
  --grad:         linear-gradient(135deg, #00d9ff 0%, #b794f6 100%);
  --grad-soft:    linear-gradient(135deg, rgba(0,217,255,0.15), rgba(183,148,246,0.15));
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; background: none; border: none; outline: none; }

kbd {
  background: var(--bg-elev-3);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -100px, rgba(0,217,255,0.06), transparent 60%),
    radial-gradient(1000px 600px at -100px 100%, rgba(183,148,246,0.05), transparent 60%);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  background: rgba(255,255,255,0.015);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 22px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 14px 6px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(0,217,255,0.08);
  box-shadow: 0 0 24px rgba(0,217,255,0.15);
}
.brand-name {
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 14px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.sidebar-section { display: flex; flex-direction: column; gap: 6px; }
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 6px;
  margin-bottom: 4px;
}

.icon-btn {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--text-muted);
  transition: all 0.15s;
  font-size: 16px;
  line-height: 1;
}
.icon-btn:hover {
  background: var(--bg-elev-2);
  color: var(--text);
}

.project-list, .upcoming-list { display: flex; flex-direction: column; gap: 2px; }

.project-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.project-item:hover { background: var(--bg-elev-2); }
.project-item.active {
  background: var(--grad-soft);
  border-color: var(--border-strong);
}
.project-item .name {
  font-weight: 500;
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-item .count {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-elev-3);
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 8px;
}
.project-item.active .name {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.upcoming-item {
  padding: 8px 10px;
  border-radius: var(--r-md);
  font-size: 12px;
}
.upcoming-item .title {
  color: var(--text);
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.upcoming-item .meta {
  display: flex; justify-content: space-between;
  color: var(--text-dim);
  font-size: 11px;
  margin-top: 2px;
}
.upcoming-item .days.urgent { color: var(--danger); font-weight: 600; }
.upcoming-item .days.soon { color: var(--warning); font-weight: 600; }
.upcoming-item .days.fine { color: var(--success); }

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ghost-btn {
  padding: 8px 12px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: 12px;
  border: 1px solid var(--border);
  transition: all 0.15s;
  text-align: center;
}
.ghost-btn:hover { background: var(--bg-elev-2); color: var(--text); }

.status-line {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-dim);
  padding: 0 6px;
}
.credit {
  padding: 10px 6px 2px;
  font-family: 'Orbitron', sans-serif;
  font-size: 8px;
  line-height: 1.8;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  opacity: 0.85;
  display: flex; flex-direction: column; gap: 2px;
}
.credit-line {
  display: block;
  font-size: 7.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}
.credit-name, .credit-org {
  display: block;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 9px;
}
.credit-name {
  background: linear-gradient(90deg, #00d9ff 0%, #b794f6 25%, #ff5e9c 50%, #ffb454 75%, #00d9ff 100%);
  background-size: 400% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation:
    shimmer 3s linear infinite,
    floatChar 2.4s ease-in-out infinite,
    glowPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(0,217,255,0.25));
}
.credit-org {
  background: linear-gradient(90deg, #b794f6 0%, #00d9ff 33%, #4ade80 66%, #b794f6 100%);
  background-size: 400% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation:
    shimmer 4s linear infinite reverse,
    floatChar 2.4s ease-in-out infinite 0.6s,
    glowPulse 2.4s ease-in-out infinite 0.4s;
  filter: drop-shadow(0 0 6px rgba(183,148,246,0.25));
}

@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 400% 50%; }
}
@keyframes creditWobble {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  20%      { transform: rotate(0.8deg) translateY(-1px); }
  40%      { transform: rotate(0deg) translateY(0); }
  60%      { transform: rotate(-0.8deg) translateY(-0.5px); }
  80%      { transform: rotate(0.3deg) translateY(0); }
}
@keyframes floatChar {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  25%      { transform: translateY(-3px) rotate(-2deg) scale(1.02); }
  50%      { transform: translateY(0) rotate(0deg) scale(1); }
  75%      { transform: translateY(-2px) rotate(2deg) scale(1.01); }
}
@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(0,217,255,0.25)); }
  50%      { filter: drop-shadow(0 0 12px rgba(183,148,246,0.5)); }
}
@keyframes dim-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.9; }
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 8px currentColor;
}
.dot.ok { background: var(--success); }
.dot.bad { background: var(--danger); }

/* ============================================================
   MAIN
   ============================================================ */
.main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(8,8,13,0.5);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 40;            /* keep the model dropdown above the chat/HUD */
}
.topbar-left .active-project {
  font-weight: 600;
  font-size: 14px;
}
.topbar-left .active-project .muted { color: var(--text-dim); font-weight: 400; }
.ap-label {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}

/* ============================================================
   CHAT
   ============================================================ */
.chat {
  overflow-y: auto;
  padding: 32px 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
}

.welcome {
  margin: auto;
  max-width: 720px;
  text-align: center;
  padding: 60px 20px;
  animation: fadeIn 0.5s ease;
}
.welcome-logo {
  margin-bottom: 24px;
  filter: drop-shadow(0 0 40px rgba(0,217,255,0.3));
  animation: float 5s ease-in-out infinite;
}
.welcome h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.welcome .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.welcome-sub {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 15px;
}
.suggestion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}
.suggestion {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  text-align: left;
  transition: all 0.2s;
}
.suggestion:hover {
  background: var(--bg-elev-2);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.suggestion-icon { font-size: 22px; }
.suggestion-title { font-weight: 600; font-size: 13px; }
.suggestion-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.msg {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 14px;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 12px;
}
.msg.user .msg-avatar {
  background: var(--bg-elev-3);
  color: var(--accent);
}
.msg.assistant .msg-avatar {
  background: var(--grad);
  color: white;
}

.msg-body { flex: 1; min-width: 0; }
.msg-role {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.msg.assistant .msg-role {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.msg-content {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
  word-wrap: break-word;
}
.msg-content p { margin-bottom: 0.8em; }
.msg-content p:last-child { margin-bottom: 0; }
.msg-content ul, .msg-content ol { margin: 0.5em 0 0.8em 1.5em; }
.msg-content li { margin-bottom: 0.3em; }
.msg-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--bg-elev-2);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.msg-content pre {
  background: var(--bg-elev-2) !important;
  padding: 14px 16px !important;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  overflow-x: auto;
  margin: 0.6em 0;
}
.msg-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.55;
}
.msg-content strong { color: #fff; font-weight: 600; }
.msg-content h1, .msg-content h2, .msg-content h3 {
  margin: 1em 0 0.4em;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.msg-content h1 { font-size: 1.4em; }
.msg-content h2 { font-size: 1.2em; }
.msg-content h3 { font-size: 1.05em; }
.msg-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  color: var(--text-muted);
  margin: 0.6em 0;
}
.msg-content a { color: var(--accent); text-decoration: none; border-bottom: 1px dashed currentColor; }

/* typing indicator */
.typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.4s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ============================================================
   COMPOSER
   ============================================================ */
.composer {
  padding: 16px 32px 22px;
  border-top: 1px solid var(--border);
  background: rgba(8,8,13,0.5);
  backdrop-filter: blur(10px);
}
.composer-inner {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-elev-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: 12px 14px 12px 18px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  transition: all 0.15s;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.composer-inner:focus-within {
  border-color: rgba(0,217,255,0.4);
  box-shadow: 0 0 0 4px rgba(0,217,255,0.08), 0 8px 32px rgba(0,0,0,0.2);
}
#input {
  flex: 1;
  resize: none;
  font-size: 14.5px;
  line-height: 1.5;
  padding: 6px 0;
  max-height: 220px;
  overflow-y: auto;
}
#input::placeholder { color: var(--text-dim); }

.composer-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.send-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad);
  color: white;
  display: grid; place-items: center;
  transition: all 0.15s;
  box-shadow: 0 4px 16px rgba(0,217,255,0.25);
}
.send-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,217,255,0.35); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

#voice-btn.active {
  background: rgba(255,94,108,0.15);
  color: var(--danger);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,94,108,0.4); }
  50% { box-shadow: 0 0 0 10px rgba(255,94,108,0); }
}

.composer-hint {
  max-width: 800px;
  margin: 8px auto 0;
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: 24px;
  width: 90%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn { from { transform: translateY(20px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.modal input, .modal textarea {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  transition: border-color 0.15s;
}
.modal input:focus, .modal textarea:focus { border-color: var(--accent); }
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}
.primary-btn {
  padding: 8px 16px;
  background: var(--grad);
  color: white;
  font-weight: 600;
  border-radius: var(--r-md);
  font-size: 13px;
  transition: transform 0.15s;
}
.primary-btn:hover { transform: translateY(-1px); }

/* ============================================================
   ANIMATIONS / UTIL
   ============================================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

/* small screens */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .suggestion-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   VIEW SWITCHER (sidebar nav)
   ============================================================ */
.nav-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.12s;
  text-align: left;
}
.nav-item svg { flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: var(--bg-elev-2); color: var(--text); }
.nav-item.active {
  color: var(--text);
}
.nav-item.active svg { opacity: 1; color: var(--accent); }
.nav-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--grad);
  color: white;
  display: none;
}
.nav-count.show { display: inline-block; }

/* scrollable middle area (pinned + upcoming) */
.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: 4px;
}

/* hide views based on body[data-view] */
.view { display: none; flex-direction: column; height: 100vh; min-height: 0; }
body[data-view="chat"] .view-chat { display: grid; grid-template-rows: auto 1fr auto; }
body[data-view="skills"] .view-skills { display: grid; grid-template-rows: auto 1fr; }

/* ============================================================
   TOGGLE BUTTONS (sidebar footer)
   ============================================================ */
.toggle-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all 0.15s;
  background: rgba(255,255,255,0.015);
}
.toggle-btn:hover { background: var(--bg-elev-2); color: var(--text); }
.toggle-left { display: flex; align-items: center; gap: 8px; }
.toggle-switch {
  width: 28px;
  height: 16px;
  background: var(--bg-elev-3);
  border-radius: 999px;
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}
.toggle-knob {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  top: 2px; left: 2px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-btn.on { color: var(--text); border-color: rgba(0,217,255,0.3); }
.toggle-btn.on .toggle-switch { background: var(--grad); }
.toggle-btn.on .toggle-knob { background: white; transform: translateX(12px); }
.toggle-btn.loading .toggle-switch::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  animation: pulse2 1s ease-in-out infinite;
}
@keyframes pulse2 { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.6; } }

/* ============================================================
   SKILLS PAGE
   ============================================================ */
.page-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.muted-text { color: var(--text-dim); font-size: 12px; margin-right: 12px; }

.skills-page {
  overflow-y: auto;
  padding: 40px 24px 80px;
}
.skills-content {
  max-width: 880px;
  margin: 0 auto;
}
.skills-hero {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-align: center;
  margin-bottom: 8px;
}
.skills-hero .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.skills-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.skills-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.search-wrap {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color 0.15s;
}
.search-wrap:focus-within { border-color: rgba(0,217,255,0.4); }
.search-wrap svg { color: var(--text-dim); }
.search-wrap input { flex: 1; font-size: 13.5px; }
.filter-pills { display: flex; gap: 4px; }
.pill {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.pill:hover { background: var(--bg-elev-2); color: var(--text); }
.pill.active {
  background: var(--bg-elev-3);
  color: var(--text);
  border-color: var(--border-strong);
}

.skills-section { margin-bottom: 32px; }
.skills-section h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.skills-section.hidden { display: none; }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 10px;
}
.skills-grid:empty::before {
  content: "Nothing here yet.";
  color: var(--text-dim);
  font-size: 13px;
  padding: 16px;
}

.skill-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  transition: all 0.15s;
  cursor: pointer;
  position: relative;
}
.skill-card:hover {
  background: var(--bg-elev-2);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.skill-card.enabled {
  border-color: rgba(0,217,255,0.35);
  box-shadow: 0 0 0 1px rgba(0,217,255,0.15);
}
.skill-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.skill-info { flex: 1; min-width: 0; }
.skill-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}
.skill-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.skill-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: grid;
  place-items: center;
  color: transparent;
  transition: all 0.15s;
  flex-shrink: 0;
}
.skill-card.enabled .skill-check {
  background: var(--grad);
  border-color: transparent;
  color: white;
}
.skill-delete {
  position: absolute;
  top: 8px; right: 38px;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: none;
  place-items: center;
  color: var(--text-dim);
  font-size: 13px;
}
.skill-card.custom:hover .skill-delete { display: grid; }
.skill-delete:hover { background: rgba(255,94,108,0.15); color: var(--danger); }

/* ============================================================
   NEW: page title style for non-chat views
   ============================================================ */
.view-skills .topbar { padding-left: 28px; padding-right: 28px; }

/* ============================================================
   PROJECT VIEW
   ============================================================ */
body[data-view="project"] .view-project { display: grid; grid-template-rows: auto 1fr; }
body[data-view="projects"] .view-projects { display: grid; grid-template-rows: auto 1fr; }

/* ===== All projects grid ===== */
.projects-page {
  overflow-y: auto;
  padding: 28px 32px 60px;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
}
.project-card {
  position: relative;
  padding: 18px 18px 16px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: all 0.15s;
  cursor: pointer;
}
.project-card:hover {
  background: var(--bg-elev-2);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.project-card .pc-name {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  color: var(--text);
}
.project-card .pc-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
  min-height: 16px;
}
.project-card .pc-stats {
  display: flex;
  gap: 14px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.project-card .pc-stats strong { color: var(--text); font-weight: 600; }
.project-card .pc-actions {
  position: absolute;
  top: 12px; right: 12px;
  display: flex;
  gap: 4px;
}
.project-card .pc-action {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--text-dim);
  transition: all 0.15s;
  font-size: 13px;
}
.project-card .pc-action:hover {
  background: var(--bg-elev-3);
  color: var(--text);
}
.project-card .pc-action.pin.pinned {
  color: var(--accent);
}
.project-card .pc-action.delete:hover {
  background: rgba(255,94,108,0.18);
  color: var(--danger);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.back-btn:hover { background: var(--bg-elev-2); color: var(--text); }
.back-btn.hidden { display: none; }
.badge.ghost { background: transparent; }

.project-page {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  padding: 28px 32px 56px;
  overflow-y: auto;
  min-height: 0;
}

.project-main { min-width: 0; }

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}
.project-title {
  font-family: 'Fraunces', 'Inter', serif;
  font-size: 42px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
.project-icons { display: flex; gap: 4px; }
.project-icons .icon-btn { width: 32px; height: 32px; font-size: 14px; }

.project-composer {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: 18px 18px 12px;
  transition: border-color 0.15s;
}
.project-composer:focus-within { border-color: rgba(0,217,255,0.35); }
.project-composer textarea {
  width: 100%;
  resize: none;
  font-size: 16px;
  line-height: 1.5;
  background: transparent;
  color: var(--text);
}
.project-composer textarea::placeholder { color: var(--text-muted); }
.project-composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.project-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin: 18px 0 18px;
}
.suggestion-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-lg);
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  text-align: left;
  transition: all 0.15s;
}
.suggestion-chip:hover {
  background: var(--bg-elev-2);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.suggestion-chip .chip-icon { font-size: 16px; }

.new-conv-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-lg);
  background: var(--bg-elev-1);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 26px;
}
.new-conv-row:hover {
  background: var(--bg-elev-2);
  color: var(--text);
  border-color: var(--accent);
  border-style: solid;
}

.recents-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.recents-list { display: flex; flex-direction: column; gap: 6px; }
.recent-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all 0.15s;
}
.recent-card:hover {
  background: var(--bg-elev-2);
  border-color: var(--border-strong);
}
.recent-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-elev-3);
  display: grid; place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.recent-info { flex: 1; min-width: 0; }
.recent-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-preview {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-time {
  font-size: 11.5px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.recents-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

/* Right rail cards */
.project-aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aside-card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.aside-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.aside-card-header .icon-btn {
  width: 22px; height: 22px; font-size: 13px;
  color: var(--text-dim);
}
.aside-card-body {
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
}
.aside-card-body.muted-body { color: var(--text-dim); font-style: italic; }

.context-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  background: var(--bg-elev-2);
  font-size: 12px;
  color: var(--text);
  margin-bottom: 4px;
}
.context-item .label { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; padding-left: 2px; }

/* responsive: collapse rail */
@media (max-width: 1080px) {
  .project-page { grid-template-columns: 1fr; }
}

/* ============================================================
   MODEL PICKER
   ============================================================ */
.model-picker { position: relative; }
.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'JetBrains Mono', monospace;
}
.model-badge:hover {
  border-color: rgba(0,217,255,0.35);
  color: var(--text);
}
.model-badge svg { opacity: 0.6; }

.model-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #0d0d15;     /* fully opaque so nothing shows through */
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 6px;
  min-width: 280px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: modalIn 0.15s ease;
}
.model-dropdown.hidden { display: none; }
.model-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.15s;
}
.model-option:hover { background: var(--bg-elev-2); }
.model-option .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.model-option .name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.model-option .desc {
  font-size: 11.5px;
  color: var(--text-dim);
}
.model-option.active .name { font-weight: 700; }
.model-option .check { color: var(--accent); opacity: 0; }
.model-option.active .check { opacity: 1; }

/* ════════════════════════════════════════════════════════════
   MOTION & POLISH LAYER  ·  GTM
   ════════════════════════════════════════════════════════════ */

/* ---- App entrance ---- */
.app { position: relative; isolation: isolate; animation: appIn 0.6s ease both; }
@keyframes appIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- Animated ambient background ---- */
.app::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(620px 520px at 18% 12%, rgba(0,217,255,0.10), transparent 62%),
    radial-gradient(720px 600px at 84% 82%, rgba(183,148,246,0.10), transparent 62%);
  animation: drift 26s ease-in-out infinite alternate;
  filter: blur(20px);
}
.app::after {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(520px 520px at 62% 38%, rgba(255,94,156,0.05), transparent 60%);
  animation: drift2 32s ease-in-out infinite alternate;
  filter: blur(30px);
}
@keyframes drift {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(2.5%, -2%) scale(1.06); }
  100% { transform: translate(-2.5%, 2%) scale(1); }
}
@keyframes drift2 {
  0%   { transform: translate(0,0) scale(1.05); }
  100% { transform: translate(3%, -3%) scale(1); }
}

/* ---- View transitions ---- */
body[data-view="chat"] .view-chat,
body[data-view="skills"] .view-skills,
body[data-view="projects"] .view-projects,
body[data-view="project"] .view-project {
  animation: viewIn 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Logo glow ---- */
.brand-logo {
  background: none !important;
  box-shadow: none !important;
  overflow: visible;
}
.brand-logo img {
  border-radius: 10px;
  animation: logoPulse 4.5s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 7px rgba(0,217,255,0.35)); }
  50%      { filter: drop-shadow(0 0 16px rgba(0,217,255,0.65)); }
}
.brand-name {
  background: linear-gradient(90deg, #00d9ff, #b794f6, #00d9ff);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}

/* ---- Nav active: sliding accent bar ---- */
.nav-item { position: relative; }
.nav-item::before {
  content: "";
  position: absolute;
  left: -2px; top: 50%;
  width: 3px; height: 0;
  border-radius: 2px;
  background: var(--grad);
  transform: translateY(-50%);
  transition: height 0.22s cubic-bezier(0.16,1,0.3,1);
}
.nav-item.active::before { height: 60%; }

/* ---- Streaming caret ---- */
.msg-content.streaming::after {
  content: "▋";
  display: inline;
  color: var(--accent);
  margin-left: 2px;
  animation: caret 1s steps(2, start) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* ---- Button press / feedback states ---- */
.send-btn:active,
.primary-btn:active,
.suggestion:active,
.suggestion-chip:active,
.skill-card:active,
.project-card:active,
.recent-card:active,
.nav-item:active,
.pill:active { transform: scale(0.97); }

.icon-btn:active { transform: scale(0.9); }

/* ---- Send button loading spinner ---- */
.send-btn.loading svg { display: none; }
.send-btn.loading::after {
  content: "";
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Suggestion stagger entrance ---- */
.suggestion, .suggestion-chip {
  animation: fadeUp 0.5s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Recents / project cards stagger ---- */
.recent-card, .project-card {
  animation: fadeUp 0.45s cubic-bezier(0.16,1,0.3,1) both;
}

/* ---- Refined card hover glow ---- */
.skill-card, .project-card, .suggestion, .recent-card, .suggestion-chip {
  transition: transform 0.18s cubic-bezier(0.16,1,0.3,1),
              box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.skill-card:hover, .project-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,217,255,0.12);
}

/* ---- Skeleton loaders ---- */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-elev-1) 25%, var(--bg-elev-2) 50%, var(--bg-elev-1) 75%);
  background-size: 200% 100%;
  animation: shimmerSkel 1.3s ease-in-out infinite;
  border-radius: var(--r-md);
}
@keyframes shimmerSkel { to { background-position: -200% 0; } }
.skel-line { height: 14px; margin-bottom: 10px; }
.skel-card { height: 64px; margin-bottom: 8px; border-radius: var(--r-lg); }

/* ---- Project title entrance ---- */
.project-title { animation: titleIn 0.5s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes titleIn {
  from { opacity: 0; transform: translateY(-6px); letter-spacing: 0.04em; }
  to   { opacity: 1; transform: none; letter-spacing: -0.02em; }
}

/* ---- Avatar pulse on assistant turns ---- */
.msg.assistant .msg-avatar {
  box-shadow: 0 0 0 0 rgba(0,217,255,0.5);
  animation: avatarPop 0.5s ease both;
}
@keyframes avatarPop {
  0% { transform: scale(0.7); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

/* ---- Toggle spring ---- */
.toggle-knob { transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s; }

/* ---- Composer focus lift ---- */
.composer-inner { transition: border-color 0.2s, box-shadow 0.25s, transform 0.2s; }
.composer-inner:focus-within { transform: translateY(-1px); }

/* ---- Send arrow nudge on hover ---- */
.send-btn svg { transition: transform 0.15s; }
.send-btn:hover svg { transform: translateX(1px); }

/* ---- Smooth scrolling ---- */
.chat, .skills-page, .projects-page, .project-page, .sidebar-scroll { scroll-behavior: smooth; }

/* ---- Status dot pulse ---- */
.dot.ok { animation: dotPulse 2.4s ease-in-out infinite; }
@keyframes dotPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(74,222,128,0.5); }
  50%     { box-shadow: 0 0 0 5px rgba(74,222,128,0); }
}

/* ---- Reduce motion for accessibility ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ════════════════════════════════════════════════════════════
   OVER-THE-TOP TECH FX  ·  HUD / arc-reactor / grid / scanlines
   ════════════════════════════════════════════════════════════ */

/* ---- Cyber grid ---- */
.fx-grid {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,217,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,217,255,0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask: radial-gradient(ellipse 85% 75% at 50% 38%, #000 28%, transparent 78%);
  mask: radial-gradient(ellipse 85% 75% at 50% 38%, #000 28%, transparent 78%);
  animation: gridFloat 18s linear infinite;
}
@keyframes gridFloat { to { background-position: 46px 46px, 46px 46px; } }

/* ---- Scanline sweep + fine lines ---- */
.fx-scan {
  position: fixed; inset: 0; z-index: 9997; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(255,255,255,0.015) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.fx-scan::after {
  content: "";
  position: absolute; left: 0; right: 0; height: 180px;
  background: linear-gradient(180deg, transparent, rgba(0,217,255,0.05), transparent);
  animation: scanSweep 7s linear infinite;
}
@keyframes scanSweep {
  0%   { transform: translateY(-200px); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

/* ---- Vignette ---- */
.fx-vignette {
  position: fixed; inset: 0; z-index: 9996; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,0.45) 100%);
}

/* ════════════════════════════════════════════════════════════
   WELCOME — arc reactor HUD
   ════════════════════════════════════════════════════════════ */
.welcome { position: relative; }

/* HUD corner brackets */
.hud {
  position: absolute;
  width: 26px; height: 26px;
  border: 2px solid rgba(0,217,255,0.4);
  opacity: 0;
  z-index: 0;
  animation: hudIn 0.6s ease forwards;
}
.hud.tl { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.hud.tr { top: 8px; right: 8px; border-left: none; border-bottom: none; animation-delay: 0.08s; }
.hud.bl { bottom: 8px; left: 8px; border-right: none; border-top: none; animation-delay: 0.16s; }
.hud.br { bottom: 8px; right: 8px; border-left: none; border-top: none; animation-delay: 0.24s; }
@keyframes hudIn { from { opacity: 0; transform: scale(1.4); } to { opacity: 1; transform: scale(1); } }

/* Arc reactor */
.reactor {
  position: relative;
  width: 140px; height: 140px;
  margin: 0 auto 28px;
  display: grid;
  place-items: center;
  animation: reactorIn 0.9s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes reactorIn {
  from { opacity: 0; transform: scale(0.6) rotate(-40deg); }
  to   { opacity: 1; transform: none; }
}
.reactor > * { position: absolute; border-radius: 50%; }
.reactor-glow {
  width: 90px; height: 90px;
  background: radial-gradient(circle, rgba(0,217,255,0.55), transparent 70%);
  filter: blur(14px);
  animation: reactorPulse 2.6s ease-in-out infinite;
}
@keyframes reactorPulse {
  0%,100% { opacity: 0.5; transform: scale(0.9); }
  50%     { opacity: 1;   transform: scale(1.12); }
}
.reactor-ring {
  border-style: solid;
  border-color: transparent;
}
.ring-1 {
  width: 140px; height: 140px;
  border-width: 2px;
  border-top-color: #00d9ff; border-right-color: rgba(0,217,255,0.3);
  box-shadow: 0 0 18px rgba(0,217,255,0.35), inset 0 0 18px rgba(0,217,255,0.15);
  animation: spin 7s linear infinite;
}
.ring-2 {
  width: 108px; height: 108px;
  border-width: 1.5px;
  border-bottom-color: #b794f6; border-left-color: rgba(183,148,246,0.35);
  animation: spin 5s linear infinite reverse;
}
.ring-3 {
  width: 78px; height: 78px;
  border-width: 1px;
  border-top-color: rgba(255,255,255,0.5); border-bottom-color: rgba(255,255,255,0.2);
  animation: spin 3.4s linear infinite;
}
/* radial tick marks */
.reactor-ticks {
  width: 124px; height: 124px;
  background: repeating-conic-gradient(from 0deg,
    rgba(0,217,255,0.6) 0deg 0.6deg, transparent 0.6deg 12deg);
  -webkit-mask: radial-gradient(circle, transparent 56%, #000 57%, #000 62%, transparent 63%);
  mask: radial-gradient(circle, transparent 56%, #000 57%, #000 62%, transparent 63%);
  animation: spin 22s linear infinite;
  opacity: 0.7;
}
.reactor-core {
  width: 38px; height: 38px;
  background: radial-gradient(circle at 40% 35%, #ffffff, #7fd4ff 45%, #00a6d6 80%);
  box-shadow:
    0 0 16px rgba(0,217,255,0.9),
    0 0 40px rgba(0,217,255,0.5),
    inset 0 0 10px rgba(255,255,255,0.8);
  animation: corePulse 2.6s ease-in-out infinite;
}
@keyframes corePulse {
  0%,100% { transform: scale(1);    box-shadow: 0 0 16px rgba(0,217,255,0.9), 0 0 40px rgba(0,217,255,0.45), inset 0 0 10px rgba(255,255,255,0.8); }
  50%     { transform: scale(1.08); box-shadow: 0 0 24px rgba(0,217,255,1),   0 0 60px rgba(0,217,255,0.7),  inset 0 0 14px rgba(255,255,255,1); }
}
/* crosshair ticks like the icon */
.reactor-crosshair span {
  position: absolute;
  background: rgba(0,217,255,0.8);
  box-shadow: 0 0 6px rgba(0,217,255,0.8);
}
.reactor-crosshair span:nth-child(1) { width: 2px; height: 12px; top: 6px; left: 69px; }
.reactor-crosshair span:nth-child(2) { width: 2px; height: 12px; bottom: 6px; left: 69px; }
.reactor-crosshair span:nth-child(3) { height: 2px; width: 12px; left: 6px; top: 69px; }
.reactor-crosshair span:nth-child(4) { height: 2px; width: 12px; right: 6px; top: 69px; }

/* ---- Boot log ---- */
.boot-log {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.7;
  color: var(--success);
  text-align: left;
  display: inline-block;
  min-height: 0;
  margin-bottom: 18px;
  text-shadow: 0 0 8px rgba(74,222,128,0.4);
}
.boot-log .bl-line { white-space: pre; }
.boot-log .bl-ok { color: var(--accent); }
.boot-log .bl-dim { color: var(--text-dim); }

/* ---- Welcome title: techy glow + entrance ---- */
.welcome-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  animation: titleGlitch 0.6s steps(2) both;
}
.welcome-title .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(0,217,255,0.4);
}
@keyframes titleGlitch {
  0%   { opacity: 0; transform: translateY(6px); clip-path: inset(0 0 100% 0); }
  100% { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
}
.welcome-sub { animation: fadeUp 0.5s ease 0.2s both; }

/* ════════════════════════════════════════════════════════════
   WELCOME — cursor-reactive interactivity
   ════════════════════════════════════════════════════════════ */
.welcome { perspective: 1000px; }
.reactor {
  transition: transform 0.18s ease-out;
  transform-style: preserve-3d;
  cursor: crosshair;
}
.reactor.boost .reactor-glow { opacity: 1 !important; transform: scale(1.35); }
.reactor.boost .reactor-core { animation-duration: 1s; }
.reactor.boost .ring-1 { animation-duration: 2.5s; }
.reactor.boost .ring-2 { animation-duration: 1.8s; }
.reactor.boost .ring-3 { animation-duration: 1.2s; }

.suggestion {
  will-change: transform;
  transform-style: preserve-3d;
}
.suggestion-icon { transition: transform 0.15s; display: inline-block; }
.suggestion:hover .suggestion-icon { animation: jitter 0.45s ease-in-out infinite; }

@keyframes jitter {
  0%, 100% { transform: translate(0,0) rotate(0deg) scale(1.15); }
  25%      { transform: translate(-1.5px, 1px) rotate(-7deg) scale(1.2); }
  50%      { transform: translate(1.5px, -1px) rotate(7deg) scale(1.18); }
  75%      { transform: translate(-1px, -1.5px) rotate(-4deg) scale(1.2); }
}

/* welcome title twirl on hover */
.welcome-title { display: inline-block; transition: transform 0.2s; }
.welcome-title:hover { animation: titleTwirl 0.6s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes titleTwirl {
  0%   { transform: rotate(0) scale(1); }
  35%  { transform: rotate(-3deg) scale(1.04); }
  70%  { transform: rotate(2deg) scale(1.02); }
  100% { transform: rotate(0) scale(1); }
}

/* parallax-friendly transitions */
.welcome-title, .welcome-sub, .boot-log { transition: transform 0.25s ease-out; }

/* ════════════════════════════════════════════════════════════
   PER-MODEL ANIMATED NAME STYLES
   ════════════════════════════════════════════════════════════ */
.m-name {
  display: inline-block;
  font-weight: 700;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* J@rv1s 1.0 (Opus) — full rainbow, jittery */
.m-opus {
  background-image: linear-gradient(90deg,
    #ff5e6c, #ffb454, #ffd93d, #4ade80, #00d9ff, #b794f6, #ff5e6c);
  background-size: 300% 100%;
  animation: mShimmer 2.4s linear infinite, mJitter 0.5s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(0,217,255,0.35));
}

/* Mini J@r 1.0 (Haiku) — green→blue, smooth (no jitter) */
.m-haiku {
  background-image: linear-gradient(90deg, #4ade80, #22d3ee, #00d9ff, #34d399, #4ade80);
  background-size: 260% 100%;
  animation: mShimmer 3.6s linear infinite;
  filter: drop-shadow(0 0 6px rgba(74,222,128,0.3));
}

/* Jarvix 1.1 (Sonnet) — orange→yellow, slight jitter */
.m-sonnet {
  background-image: linear-gradient(90deg, #ff8c42, #ffd93d, #ffb454, #ff7849, #ff8c42);
  background-size: 260% 100%;
  animation: mShimmer 3s linear infinite, mJitterSlight 0.6s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(255,180,84,0.35));
}

@keyframes mShimmer { to { background-position: 300% 50%; } }
@keyframes mJitter {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  20%      { transform: translate(-0.5px, 0.4px) rotate(-0.7deg); }
  45%      { transform: translate(0.5px, -0.4px) rotate(0.7deg); }
  70%      { transform: translate(-0.4px, -0.3px) rotate(-0.4deg); }
  90%      { transform: translate(0.3px, 0.4px) rotate(0.3deg); }
}
@keyframes mJitterSlight {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  50%      { transform: translate(0.3px, -0.2px) rotate(0.3deg); }
}

/* ---- Reactor rings are driven by JS (proximity spin); disable CSS spin ---- */
.reactor .ring-1, .reactor .ring-2, .reactor .ring-3, .reactor .reactor-ticks {
  animation: none !important;
  will-change: transform;
}

/* ---- File uploads (project context card) ---- */
.file-item { gap: 8px; }
.file-item .fi-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-item .fi-meta { color: var(--text-dim); font-size: 10.5px; }
.file-item .fi-del {
  width: 18px; height: 18px; border-radius: 5px;
  color: var(--text-dim); font-size: 14px; line-height: 1;
  display: grid; place-items: center;
}
.file-item .fi-del:hover { background: rgba(255,94,108,0.18); color: var(--danger); }
.dropzone {
  display: block;
  margin-top: 8px;
  padding: 14px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.dropzone:hover { color: var(--text); border-color: var(--accent); }
.dropzone.drag {
  border-color: var(--accent);
  background: rgba(0,217,255,0.08);
  color: var(--accent);
}

/* ---- sub-toggle (Safe Sites Only) ---- */
.toggle-btn.sub {
  margin-top: -4px;
  margin-left: 14px;
  padding: 7px 10px;
  font-size: 11px;
  border-style: dashed;
}

/* ---- Assignment / scheduled rows ---- */
.assign-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.assign-row:last-child { border-bottom: none; }
.assign-check {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 1.5px solid var(--border-strong); border-radius: 5px;
  display: grid; place-items: center;
  color: var(--success); font-size: 12px; line-height: 1;
}
.assign-check:hover { border-color: var(--success); }
.assign-row.done .assign-check { background: var(--success); color: #06210f; border-color: transparent; }
.assign-row.done .assign-title { text-decoration: line-through; color: var(--text-dim); }
.assign-info { flex: 1; min-width: 0; }
.assign-title { font-size: 13px; color: var(--text); font-weight: 500; }
.assign-due { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.modal select {
  background: var(--bg-elev-2); border: 1px solid var(--border);
  padding: 10px 14px; border-radius: var(--r-md); font-size: 14px; color: var(--text);
}

/* ════════════════════════════════════════════════════════════
   LIGHT THEME
   ════════════════════════════════════════════════════════════ */
body[data-theme="light"] {
  --bg:           #eef1f8;
  --bg-elev-1:    #ffffff;
  --bg-elev-2:    #f3f5fb;
  --bg-elev-3:    #e7ebf5;
  --border:       rgba(20, 22, 40, 0.08);
  --border-strong: rgba(20, 22, 40, 0.16);
  --text:         #161826;
  --text-muted:   #4a4e63;
  --text-dim:     #8186a0;
  --accent:       #0a8fc9;
  --accent-2:     #7c4ddb;
  --shadow-lg:    0 24px 64px rgba(40,50,90,0.18);
}
body[data-theme="light"] .sidebar { background: rgba(255,255,255,0.65); }
body[data-theme="light"] .topbar,
body[data-theme="light"] .composer { background: rgba(255,255,255,0.7); }
body[data-theme="light"] .model-dropdown { background: #ffffff; }
body[data-theme="light"] .fx-grid {
  background-image:
    linear-gradient(rgba(10,143,201,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,143,201,0.05) 1px, transparent 1px);
}
body[data-theme="light"] .fx-vignette {
  background: radial-gradient(ellipse at center, transparent 60%, rgba(40,50,90,0.10) 100%);
}
body[data-theme="light"] .msg.user .msg-avatar { background: var(--bg-elev-3); }
body[data-theme="light"] .app {
  background:
    radial-gradient(1200px 600px at 80% -100px, rgba(10,143,201,0.07), transparent 60%),
    radial-gradient(1000px 600px at -100px 100%, rgba(124,77,219,0.06), transparent 60%);
}
/* theme toggle icon swap */
.theme-ico-sun { display: none; }
body[data-theme="light"] .theme-ico-sun { display: inline; }
body[data-theme="light"] .theme-ico-moon { display: none; }

/* ════════════════════════════════════════════════════════════
   ⌘K COMMAND PALETTE
   ════════════════════════════════════════════════════════════ */
.palette-backdrop {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 14vh;
  animation: fadeIn 0.15s ease;
}
.palette-backdrop.hidden { display: none; }
.palette {
  width: 92%; max-width: 560px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,217,255,0.1);
  overflow: hidden;
  animation: modalIn 0.18s cubic-bezier(0.16,1,0.3,1);
}
.palette-search {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.palette-search input { flex: 1; font-size: 15px; color: var(--text); }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: var(--r-md);
  cursor: pointer; font-size: 13.5px; color: var(--text);
}
.palette-item .pi-hint {
  font-size: 10.5px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid var(--border); padding: 1px 7px; border-radius: 999px;
}
.palette-item.sel, .palette-item:hover {
  background: var(--grad-soft);
}
.palette-item.sel { box-shadow: inset 2px 0 0 var(--accent); }
.palette-empty { padding: 24px; text-align: center; color: var(--text-dim); font-size: 13px; }

/* ════════════════════════════════════════════════════════════
   HUD CHAT BUBBLES + TRANSITIONS
   ════════════════════════════════════════════════════════════ */
.msg.assistant .msg-body {
  position: relative;
  background: linear-gradient(180deg, rgba(0,217,255,0.04), rgba(183,148,246,0.02));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 16px 12px 18px;
  overflow: hidden;
}
.msg.assistant .msg-body::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(0,217,255,0.5);
}
.msg.assistant .msg-body::after {
  content: "";
  position: absolute; top: 7px; right: 8px;
  width: 9px; height: 9px;
  border-top: 1px solid rgba(0,217,255,0.45);
  border-right: 1px solid rgba(0,217,255,0.45);
}
.msg.assistant .msg-avatar {
  box-shadow: 0 0 14px rgba(0,217,255,0.4);
}
.msg.user .msg-body {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 10px 14px;
}

/* message reveal */
.msg { animation: msgReveal 0.34s cubic-bezier(0.16,1,0.3,1); }
@keyframes msgReveal {
  from { opacity: 0; transform: translateY(10px); clip-path: inset(0 0 8% 0); }
  to   { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
}

/* aside cards: animated top accent on hover */
.aside-card { position: relative; }
.aside-card::before {
  content: "";
  position: absolute; top: 0; left: 12px; right: 12px; height: 1px;
  background: var(--grad);
  opacity: 0; transition: opacity 0.2s;
}
.aside-card:hover::before { opacity: 0.6; }

/* skill cards: corner tick when enabled */
.skill-card.enabled::after {
  content: "";
  position: absolute; bottom: 7px; left: 8px;
  width: 8px; height: 8px;
  border-bottom: 1px solid rgba(0,217,255,0.5);
  border-left: 1px solid rgba(0,217,255,0.5);
}

/* smoother view + project transitions already exist; add stagger to topbar */
.topbar { animation: viewIn 0.4s cubic-bezier(0.16,1,0.3,1); }

/* ════════════════════════════════════════════════════════════
   AUTH SCREEN (hosted mode)
   ════════════════════════════════════════════════════════════ */
.auth-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: var(--bg);
}
.auth-overlay.hidden { display: none; }
.auth-card {
  width: 90%; max-width: 360px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: 36px 30px 28px;
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0,217,255,0.12);
  animation: modalIn 0.3s cubic-bezier(0.16,1,0.3,1);
}
.auth-logo {
  border-radius: 14px;
  animation: logoPulse 4.5s ease-in-out infinite;
  margin-bottom: 14px;
}
.auth-title {
  font-size: 26px; font-weight: 800; letter-spacing: 0.04em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 4px;
}
.auth-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 22px; }
.auth-card input {
  width: 100%;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px; margin-bottom: 10px;
  font-size: 14px; color: var(--text);
  transition: border-color 0.15s;
}
.auth-card input:focus { border-color: var(--accent); }
.auth-submit { width: 100%; padding: 12px; margin-top: 6px; font-size: 14px; }
.auth-error { color: var(--danger); font-size: 12px; min-height: 16px; margin-bottom: 4px; }
.auth-switch { margin-top: 18px; font-size: 12.5px; color: var(--text-dim); }
.auth-switch a { color: var(--accent); cursor: pointer; margin-left: 6px; }
.auth-switch a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   BILLING / PAY PAGE
   ════════════════════════════════════════════════════════════ */
.upgrade-cta {
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 12.5px; font-weight: 700;
  color: #06210f;
  background: linear-gradient(135deg, #ffd93d, #ffb454);
  box-shadow: 0 4px 16px rgba(255,180,84,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.upgrade-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(255,180,84,0.45); }

.billing-modal { max-width: 560px; }
.billing-tagline { color: var(--text-muted); font-size: 13px; margin-bottom: 18px; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 16px;
  background: var(--bg-elev-2);
}
.plan-card.pro {
  border-color: rgba(255,180,84,0.5);
  background: linear-gradient(180deg, rgba(255,180,84,0.08), transparent);
  box-shadow: 0 0 0 1px rgba(255,180,84,0.2);
}
.plan-badge {
  position: absolute; top: -10px; right: 14px;
  background: linear-gradient(135deg, #ffd93d, #ffb454);
  color: #06210f; font-size: 10.5px; font-weight: 800;
  padding: 3px 10px; border-radius: 999px; letter-spacing: 0.04em;
}
.plan-name { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.plan-price { font-size: 30px; font-weight: 800; margin: 6px 0 14px; }
.plan-price span { font-size: 14px; color: var(--text-dim); font-weight: 500; }
.plan-feats { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; font-size: 12.5px; color: var(--text); }
.plan-feats li::before { content: "✓ "; color: var(--success); font-weight: 700; }
.plan-current { font-size: 11.5px; color: var(--text-dim); text-align: center; padding: 8px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); }
.plan-card .primary-btn { width: 100%; padding: 11px; }
.plan-card.dimmed { opacity: 0.5; }
.billing-note { font-size: 11.5px; color: var(--text-dim); text-align: center; margin-top: 14px; min-height: 14px; }
@media (max-width: 520px) { .plan-grid { grid-template-columns: 1fr; } }

/* ---- Subscription paywall ---- */
.paywall-card { max-width: 380px; }
.plan-badge-lg {
  display: inline-block;
  background: linear-gradient(135deg, #ffd93d, #ffb454);
  color: #06210f; font-size: 11px; font-weight: 800;
  padding: 3px 12px; border-radius: 999px; letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.paywall-price { font-size: 34px; font-weight: 800; margin: 6px 0 16px; }
.paywall-price span { font-size: 15px; color: var(--text-dim); font-weight: 500; }
.paywall-feats { text-align: left; max-width: 220px; margin: 0 auto 18px; }
.paywall-refresh { width: 100%; margin-top: 8px; }

/* ---- Two-tier paywall ---- */
.paywall-wrap {
  width: 96%; max-width: 1480px; text-align: center;
  animation: modalIn 0.3s cubic-bezier(0.16,1,0.3,1);
}
.paywall-wrap .auth-logo { animation: logoPulse 4.5s ease-in-out infinite; }
.paywall-plans {
  display: flex; flex-direction: column; gap: 16px;
  margin: 18px 0 14px; text-align: left;
}
.pw-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
.pw-card { padding: 20px 14px; }   /* tighter so 5 fit comfortably */
.pw-card .pw-price { font-size: 24px; }
.pw-card .pw-name { font-size: 11px; }
.pw-card ul { font-size: 12px; gap: 7px; }
@media (max-width: 1180px) { .pw-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .pw-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .pw-grid { grid-template-columns: 1fr; } }
.billing-toggle {
  display: inline-flex; align-self: center;
  background: var(--bg-elev-1); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 4px; gap: 2px;
}
.billing-toggle button {
  background: transparent; border: 0; color: var(--text-muted);
  padding: 8px 18px; border-radius: 999px; cursor: pointer; font: inherit;
  font-size: 13px; font-weight: 600; transition: all 0.15s ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.billing-toggle button:hover { color: var(--text); }
.billing-toggle button.on {
  background: linear-gradient(135deg,#4ade80,#22d3ee); color: #04261a;
  box-shadow: 0 4px 14px rgba(74,222,128,0.25);
}
.bt-save {
  background: rgba(0,0,0,0.18); color: inherit;
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 999px;
}
.billing-toggle button:not(.on) .bt-save {
  background: rgba(74,222,128,0.15); color: #4ade80;
}
.pw-card .pw-sub {
  font-size: 12px; color: var(--text-dim); margin: -10px 0 16px;
}
.pw-card {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 22px 20px;
  background: var(--bg-elev-1);
  display: flex; flex-direction: column;
}
.pw-card.pro {
  border-color: rgba(255,180,84,0.55);
  background: linear-gradient(180deg, rgba(255,180,84,0.08), transparent);
  box-shadow: 0 0 0 1px rgba(255,180,84,0.2), 0 12px 40px rgba(0,0,0,0.3);
}
.pw-card .pw-name { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.pw-card .pw-price { font-size: 30px; font-weight: 800; margin: 6px 0 16px; }
.pw-card .pw-price span { font-size: 14px; color: var(--text-dim); font-weight: 500; }
.pw-card ul { list-style: none; display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; font-size: 13px; flex: 1; }
.pw-card li::before { content: "✓ "; color: var(--success); font-weight: 700; }
.pw-card .primary-btn { width: 100%; padding: 11px; }
.pw-card.current { opacity: 0.6; }
.pw-tag { position: absolute; top: -10px; right: 16px; background: linear-gradient(135deg,#ffd93d,#ffb454); color:#06210f; font-size:10px; font-weight:800; padding:3px 10px; border-radius:999px; letter-spacing:0.05em; }
.paywall-refresh { margin-top: 6px; }

/* ════════════════════════════════════════════════════════════
   TRIAL BANNER + ADMIN DASHBOARD
   ════════════════════════════════════════════════════════════ */
.trial-banner {
  margin: 2px 2px 0;
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 11.5px; font-weight: 600;
  color: #06210f;
  background: linear-gradient(135deg, #ffd93d, #ffb454);
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s;
}
.trial-banner:hover { transform: translateY(-1px); }

body[data-view="admin"] .view-admin { display: grid; grid-template-rows: auto 1fr; }
.admin-page { overflow-y: auto; padding: 32px; }
.admin-hero { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 24px; }
.admin-hero .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px; max-width: 900px; }
.stat-card {
  background: var(--bg-elev-1); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 18px;
  position: relative; overflow: hidden;
}
.stat-card::before { content:""; position:absolute; top:0; left:14px; right:14px; height:1px; background: var(--grad); opacity:0.4; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.stat-value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }
.stat-value.money { background: linear-gradient(90deg,#4ade80,#22d3ee); -webkit-background-clip:text; background-clip:text; color:transparent; }
.stat-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }
.admin-note { margin-top: 18px; color: var(--text-dim); font-size: 12px; max-width: 900px; }

/* ════════════════════════════════════════════════════════════
   SETTINGS
   ════════════════════════════════════════════════════════════ */
body[data-view="settings"] .view-settings { display: grid; grid-template-rows: auto 1fr; }
.settings-page { overflow-y: auto; padding: 28px 32px 60px; max-width: 720px; margin: 0 auto; width: 100%; }
.settings-card {
  background: var(--bg-elev-1); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 6px 20px; margin-bottom: 16px;
}
.settings-card-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); padding: 16px 0 12px; border-bottom: 1px solid var(--border);
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.settings-row:last-of-type { border-bottom: none; }
.sr-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.sr-value { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.settings-row.danger .sr-label { color: var(--danger); }
.danger-btn {
  padding: 8px 14px; border-radius: var(--r-md); font-size: 12.5px; font-weight: 600;
  color: var(--danger); border: 1px solid rgba(255,94,108,0.4); background: rgba(255,94,108,0.06);
  transition: all 0.15s;
}
.danger-btn:hover { background: rgba(255,94,108,0.16); }
.settings-links { padding: 14px 0 4px; font-size: 12px; color: var(--text-dim); }
.settings-links a { color: var(--accent); text-decoration: none; }
.settings-links a:hover { text-decoration: underline; }
.about-credit {
  padding: 12px 0; font-size: 11.5px; color: var(--text-dim); font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.04em;
}
.about-credit b { color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   ONBOARDING TUTORIAL
   ════════════════════════════════════════════════════════════ */
.tutorial-card {
  width: 92%; max-width: 460px;
  background: var(--bg-elev-1); border: 1px solid var(--border-strong);
  border-radius: var(--r-xl); padding: 32px 30px 24px; text-align: center;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0,217,255,0.12);
  animation: modalIn 0.3s cubic-bezier(0.16,1,0.3,1);
}
.tut-dots { display: flex; gap: 7px; justify-content: center; margin-bottom: 22px; }
.tut-dots .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bg-elev-3); transition: all 0.2s; box-shadow: none; }
.tut-dots .dot.on { background: var(--accent); width: 22px; border-radius: 4px; }
.tut-body { min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; animation: fadeIn 0.25s ease; }
.tut-icon { font-size: 48px; margin-bottom: 16px; filter: drop-shadow(0 0 16px rgba(0,217,255,0.3)); animation: float 4s ease-in-out infinite; }
.tut-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 10px; }
.tut-title .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tut-text { font-size: 14px; color: var(--text-muted); line-height: 1.6; max-width: 340px; }
.tut-nav { display: flex; gap: 8px; justify-content: space-between; margin-top: 24px; align-items: center; }
.tut-nav .primary-btn { padding: 10px 22px; }
.tut-nav .ghost-btn { padding: 9px 14px; }

.paywall-back {
  position: absolute; top: 0; left: 0;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  padding: 6px 10px; border-radius: var(--r-md); transition: all 0.15s;
}
.paywall-back:hover { background: var(--bg-elev-2); color: var(--text); }
.paywall-wrap { position: relative; }

/* featured (Professional) plan emphasis */
.pw-card.featured { transform: scale(1.04); z-index: 1; }
.pw-card.featured .pw-tag { background: linear-gradient(135deg,#4ade80,#22d3ee); color:#04261a; }
@media (max-width: 820px){ .pw-card.featured { transform: none; } }

/* ---- Password field with show/hide toggle ---- */
.pw-field { position: relative; }
.pw-field input { width: 100%; padding-right: 44px !important; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; display: grid; place-items: center;
  color: var(--text-dim); border-radius: 8px; transition: all 0.15s;
}
.pw-toggle:hover { color: var(--text); background: var(--bg-elev-2); }
/* the auth card already gives inputs margin-bottom: 10px; keep the wrapper consistent */
.auth-card .pw-field { margin-bottom: 10px; }
.auth-card .pw-field input { margin-bottom: 0; }

/* ---- Forgot password link on auth screen ---- */
.auth-forgot { margin-top: 12px; font-size: 12.5px; }
.auth-forgot a { color: var(--text-dim); cursor: pointer; }
.auth-forgot a:hover { color: var(--accent); text-decoration: underline; }

/* "Get the desktop app" link in the sidebar */
.download-link {
  display: block;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  background: linear-gradient(180deg, rgba(0,217,255,0.07), transparent);
  border-color: rgba(0,217,255,0.25);
}
.download-link:hover { color: var(--accent); border-color: rgba(0,217,255,0.5); }

/* ════════════════════════════════════════════════════════════
   ACCOUNT CARD (sidebar bottom-left, Claude-style)
   ════════════════════════════════════════════════════════════ */
.account-card {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  margin-top: 4px;
}
.account-card:hover {
  background: var(--bg-elev-2);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.ac-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg,#00d9ff,#b794f6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(0,217,255,0.35);
}
.ac-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ac-name {
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ac-plan {
  font-size: 10.5px; color: var(--text-dim);
  text-transform: capitalize;
}
.ac-chev { color: var(--text-dim); flex-shrink: 0; }

/* nav keyboard hint (⌘K) */
.nav-kbd {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-dim);
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
}

/* recent-chats list in sidebar */
.recent-chats { display: flex; flex-direction: column; gap: 1px; }
.recent-chat-item {
  display: block;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: all 0.12s;
}
.recent-chat-item:hover { background: var(--bg-elev-1); color: var(--text); }
.recent-chats .empty { font-size: 11px; color: var(--text-dim); padding: 4px 10px; }

/* ════════════════════════════════════════════════════════════
   TASKS VIEW (school-platform assignments)
   ════════════════════════════════════════════════════════════ */
body[data-view="tasks"] .view-tasks { display: grid; grid-template-rows: auto 1fr; }

.tasks-body {
  flex: 1; overflow-y: auto; padding: 24px 32px 60px;
}
.tasks-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 80px 24px; text-align: center;
  gap: 14px;
}
.tasks-empty .empty-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle,#00d9ff 0%, transparent 70%);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; box-shadow: 0 0 60px rgba(0,217,255,0.3);
}
.tasks-empty h3 { font-size: 22px; font-weight: 700; margin: 0; }
.tasks-empty p {
  font-size: 14px; color: var(--text-dim);
  margin: 0; max-width: 460px; line-height: 1.6;
}
.tasks-empty .primary-btn { margin-top: 10px; }

.task-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.task-card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  transition: all 0.15s;
  position: relative;
}
.task-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.task-card.done { opacity: 0.55; }
.task-head { display: flex; align-items: center; gap: 10px; }
.task-subject {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  padding: 2px 8px; background: rgba(0,217,255,0.08);
  border-radius: 999px;
}
.task-due {
  margin-left: auto; font-size: 11px; color: var(--text-dim);
}
.task-due.urgent { color: #ff5e9c; font-weight: 700; }
.task-due.soon { color: #ffb454; }
.task-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.task-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.task-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.task-actions button, .task-actions a {
  font-size: 12px; padding: 7px 12px;
  border-radius: var(--r-md);
  text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  transition: all 0.12s;
}
.task-actions button.do-it,
.task-actions a.do-it {
  background: linear-gradient(135deg,#00d9ff,#b794f6);
  color: #04111a; font-weight: 700; border: 0;
  box-shadow: 0 6px 18px rgba(0,217,255,0.25);
}
.task-actions button:hover { background: var(--bg-elev-2); color: var(--text); }
.task-actions button.do-it:hover { transform: translateY(-1px); }
.task-actions .task-done-check { margin-left: auto; }

/* ════════════════════════════════════════════════════════════
   SCHOOL ONBOARDING MODAL
   ════════════════════════════════════════════════════════════ */
.school-modal { max-width: 580px; width: 92%; }
.modal-sub { color: var(--text-dim); font-size: 13px; margin: -4px 0 18px; line-height: 1.55; }
.platform-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.platform-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.12s;
  text-align: left;
  color: var(--text);
}
.platform-btn:hover {
  background: var(--bg-elev-2);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.pf-icon { font-size: 22px; }
.pf-name { font-weight: 600; font-size: 14px; }

.mode-btn {
  display: flex; align-items: flex-start; gap: 14px;
  width: 100%;
  padding: 16px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  margin-bottom: 10px;
  transition: all 0.12s;
}
.mode-btn:hover {
  border-color: var(--accent);
  background: var(--bg-elev-2);
}
.mode-icon { font-size: 28px; flex-shrink: 0; }
.mode-text { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mode-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.mode-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 999px;
}
.mode-tag.good { background: rgba(74,222,128,0.15); color: #4ade80; }
.mode-tag.warn { background: rgba(255,180,84,0.15); color: #ffb454; }
.mode-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.55; }

.school-step input, .school-step textarea, .modal input, .modal textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 10px;
  font-family: inherit;
}
.school-step input:focus, .modal input:focus { outline: none; border-color: var(--accent); }

.warn-box {
  background: rgba(255,180,84,0.06);
  border: 1px solid rgba(255,180,84,0.25);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 12.5px;
  color: #c9b385;
  margin-bottom: 14px;
  line-height: 1.55;
}

.school-actions {
  display: flex; justify-content: space-between;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
}

.run-modes { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.run-mode-btn {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; padding: 14px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer; text-align: left;
  transition: all 0.12s;
}
.run-mode-btn:hover { border-color: var(--accent); background: var(--bg-elev-2); }
.rm-icon { font-size: 26px; flex-shrink: 0; }
.rm-text { display: flex; flex-direction: column; gap: 4px; }
.rm-text strong { font-size: 14px; }
.rm-text span { font-size: 12px; color: var(--text-dim); }

@media (max-width: 600px) {
  .platform-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════
   MEMORY IMPORT MODAL
   ════════════════════════════════════════════════════════════ */
.mem-import-modal, .mem-view-modal { max-width: 620px; width: 92%; }
.mem-step { margin: 16px 0; }
.mem-step-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.mem-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-elev-2); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  flex-shrink: 0;
}
.mem-step-label { font-size: 13.5px; color: var(--text); font-weight: 500; }
.mem-codebox {
  position: relative;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  max-height: 220px; overflow-y: auto;
}
.mem-codebox pre {
  margin: 0; padding-right: 80px;
  font-size: 12px; font-family: ui-monospace, monospace;
  color: var(--text-muted); white-space: pre-wrap; line-height: 1.5;
}
.mem-copy {
  position: absolute; top: 10px; right: 10px;
  background: var(--bg-elev-2); border: 1px solid var(--border);
  color: var(--text); padding: 6px 12px; border-radius: var(--r-sm);
  font-size: 12px; cursor: pointer; transition: all 0.12s;
}
.mem-copy:hover { background: var(--accent); color: #04111a; border-color: var(--accent); }
.mem-copy.copied { background: #4ade80; color: #04261a; border-color: #4ade80; }

#mem-paste, #mem-view-text {
  width: 100%; min-height: 140px;
  background: var(--bg-elev-1); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px;
  color: var(--text); font-size: 13px;
  font-family: ui-monospace, monospace;
  resize: vertical;
}
#mem-paste:focus, #mem-view-text:focus { outline: none; border-color: var(--accent); }

.mem-source-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; font-size: 12px; color: var(--text-dim);
}
.mem-source-row select {
  background: var(--bg-elev-1); border: 1px solid var(--border);
  color: var(--text); padding: 6px 10px; border-radius: var(--r-sm);
  font-size: 12.5px; font-family: inherit;
}
