/* ── Reset & base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #111417;
  --surface: #181c20;
  --surface2: #21262c;
  --border: #2c333a;
  --text: #ece6d6;
  --muted: #9a9483;
  --green: #34c46a;
  --green-dim: rgba(52,196,106,0.12);
  --red: #e0533a;
  --red-dim: rgba(224,83,58,0.12);
  --accent: #d18838;
  --accent-dim: rgba(209,136,56,0.10);
  --yellow: #e0a558;
  --radius: 10px;
  --topnav-h: 40px;
  --copper-300: #e0a558;
  --copper-400: #d18838;
  --copper-500: #b86a22;
  --copper-600: #8f4d15;
  --glow-copper: 0 0 0 1px var(--copper-500), 0 0 24px -4px rgba(209,136,56,0.45);
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;
}

[data-theme="light"] {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface2: #f0f1f4;
  --border: #dde1e7;
  --text: #111827;
  --muted: #6b7280;
  --green: #16a34a;
  --green-dim: #dcfce7;
  --red: #dc2626;
  --red-dim: #fee2e2;
  --accent: #b86a22;
  --accent-dim: rgba(184,106,34,0.12);
}

/* ── Koncernen back bar ──────────────────────────────────────────────────────── */
#k-topnav {
  position: sticky; top: 0; z-index: 101;
  height: var(--topnav-h);
  background: rgba(17,20,23,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--copper-600);
  display: flex; align-items: center;
  padding: 0 1.5rem; gap: 0.75rem;
  overflow: hidden;
}
#k-topnav::before {
  content: '';
  position: absolute; inset: 0;
  background: url('/assets/circuit-bg.svg') center / 300px;
  opacity: 0.08; pointer-events: none;
}
.k-back {
  position: relative;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; transition: color .12s;
}
.k-back:hover { color: var(--copper-300); }
.k-spacer { flex: 1; }
#k-theme-btn {
  width: 28px; height: 28px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; color: var(--muted); font-size: 0.85rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s;
}
#k-theme-btn:hover { color: var(--text); border-color: var(--muted); }
.k-coffee {
  width: 28px; height: 28px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; color: var(--muted); font-size: 0.85rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  text-decoration: none; transition: border-color .15s, color .15s;
}
.k-coffee:hover { color: var(--text); border-color: var(--muted); }

html { font-size: 15px; }

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
input[type=text], input[type=email], input[type=password], textarea, select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
.hidden { display: none !important; }

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

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.55rem 1.2rem; border-radius: var(--radius); border: none;
  font-size: 0.88rem; font-weight: 600; transition: all 0.15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #1a1207; }
.btn-primary:hover { box-shadow: var(--glow-copper); }
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid #5a2020; }
.btn-danger:hover { background: #5a2020; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: #555; color: var(--text); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
#navbar {
  position: sticky; top: var(--topnav-h); z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1rem; height: 56px;
}
.nav-logo {
  font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--text); display: flex; align-items: center; gap: 0.4rem;
  flex-shrink: 0;
}
.nav-logo span { font-size: 1.2rem; }
.nav-spacer { flex: 1; }
.nav-user { display: flex; align-items: center; gap: 0.7rem; font-size: 0.82rem; color: var(--muted); }
.nav-username { color: var(--text); font-weight: 600; }
.nav-back { font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 0.3rem; }
.nav-back:hover { color: var(--text); }

/* ── Landing ────────────────────────────────────────────────────────────────── */
#view-landing {
  max-width: 700px; margin: 0 auto; padding: 5rem 1.5rem 3rem;
  text-align: center;
}
.landing-hero { font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 1rem; }
.landing-hero em { font-style: normal; color: var(--accent); }
.landing-sub { font-size: 1.1rem; color: var(--muted); margin-bottom: 2.5rem; line-height: 1.6; }
.landing-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 4rem; }
.landing-features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; text-align: left; margin-bottom: 3rem;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem;
}
.feature-icon { font-size: 1.5rem; }
.feature-title { font-size: 0.9rem; font-weight: 700; }
.feature-desc { font-size: 0.8rem; color: var(--muted); }

/* ── Auth ────────────────────────────────────────────────────────────────────── */
#view-auth {
  max-width: 380px; margin: 4rem auto; padding: 0 1rem;
}
.auth-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 2rem; display: flex; flex-direction: column; gap: 1.2rem;
}
.auth-box h2 { font-size: 1.2rem; font-weight: 700; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 0.2rem; }
.auth-tab {
  flex: 1; padding: 0.5rem; background: none; border: none;
  color: var(--muted); font-size: 0.88rem; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s;
}
.auth-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.auth-form { display: flex; flex-direction: column; gap: 0.9rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-label { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.auth-error { font-size: 0.82rem; color: var(--red); min-height: 1.2em; text-align: center; }
.auth-divider { text-align: center; font-size: 0.8rem; color: var(--muted); }

/* ── Dashboard ──────────────────────────────────────────────────────────────── */
#view-dashboard { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.dash-title { font-size: 1.5rem; font-weight: 700; }
.ideas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.idea-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.3rem; cursor: pointer; transition: all 0.15s; position: relative;
}
.idea-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.idea-card-badge {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.72rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.6rem;
}
.badge-idea    { background: var(--accent-dim); color: var(--accent); }
.badge-mvp     { background: #1a3a2a; color: #4ade80; }
.badge-scaling { background: #3a2a10; color: #fbbf24; }
.badge-launched{ background: #2a1a3a; color: #c084fc; }
.idea-card-name { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.idea-card-tagline { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.8rem; min-height: 2.5em; }
.idea-card-meta { font-size: 0.75rem; color: var(--muted); }
.idea-card-del {
  position: absolute; top: 0.8rem; right: 0.8rem;
  background: none; border: none; color: var(--border); font-size: 1rem; padding: 0.2rem;
  transition: color 0.15s; display: none;
}
.idea-card:hover .idea-card-del { display: block; }
.idea-card-del:hover { color: var(--red); }
.empty-dash { text-align: center; padding: 4rem 1rem; color: var(--muted); grid-column: 1/-1; }
.empty-dash p { margin-bottom: 1rem; font-size: 1rem; }

/* ── Idea view ──────────────────────────────────────────────────────────────── */
#view-idea { display: flex; flex-direction: column; height: calc(100vh - 56px); overflow: hidden; }

.idea-header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem 0; flex-shrink: 0;
}
.idea-header-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.75rem; }
.idea-title-area { flex: 1; min-width: 0; }
.idea-title {
  font-size: 1.4rem; font-weight: 700; margin-bottom: 0.15rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.idea-tagline-display { font-size: 0.85rem; color: var(--muted); }
.idea-tabs { display: flex; gap: 2px; }
.idea-tab {
  padding: 0.6rem 1.1rem; background: none; border: none;
  color: var(--muted); font-size: 0.86rem; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s;
}
.idea-tab:hover { color: var(--text); }
.idea-tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ── Tab panes ──────────────────────────────────────────────────────────────── */
.tab-pane { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 1.5rem; display: none; }
.tab-pane.active { display: block; }
#tab-chat.active { display: flex; }

/* ── Overview tab ───────────────────────────────────────────────────────────── */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 800px; }
.form-group-lg { grid-column: 1/-1; }
.overview-actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; align-items: center; }
.save-indicator { font-size: 0.8rem; color: var(--muted); }
.save-indicator.saved { color: var(--green); }
.stage-select { background: var(--surface2); }

/* ── Chat tab ───────────────────────────────────────────────────────────────── */
#tab-chat {
  flex-direction: column;
  padding: 0;
  height: calc(100vh - 56px - 106px);
  min-height: 400px;
}

.chat-layout {
  flex: 1; display: flex; gap: 0; overflow: hidden;
}
.chat-dog-panel {
  width: 200px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 1rem;
}
.chat-messages-panel {
  flex: 1; overflow-y: auto; padding: 1.2rem; display: flex; flex-direction: column; gap: 0.75rem;
}
.chat-input-row {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 0.85rem 1.2rem; display: flex; gap: 0.75rem; align-items: flex-end; flex-shrink: 0;
}
.chat-input {
  flex: 1; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); padding: 0.65rem 1rem;
  font-size: 0.9rem; outline: none; resize: none; max-height: 120px;
  transition: border-color 0.15s; line-height: 1.4; overflow-y: auto;
}
.chat-input:focus { border-color: var(--accent); }
.chat-send-btn {
  background: var(--accent); border: none; border-radius: var(--radius);
  color: white; padding: 0.65rem 1.1rem; font-weight: 700; font-size: 0.9rem;
  transition: background 0.15s; flex-shrink: 0;
}
.chat-send-btn:hover:not(:disabled) { background: #9080ff; }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.chat-clear-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--muted); padding: 0.5rem 0.75rem; font-size: 0.8rem; transition: all 0.15s;
}
.chat-clear-btn:hover { border-color: var(--red); color: var(--red); }

.msg-row { display: flex; gap: 0.75rem; max-width: 640px; }
.msg-row.user-row { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble {
  padding: 0.65rem 1rem; border-radius: 14px; font-size: 0.88rem; line-height: 1.55;
  max-width: 100%; word-break: break-word; white-space: pre-wrap;
}
.msg-row.user-row .msg-bubble {
  background: var(--accent-dim); color: #d0ccff; border-bottom-right-radius: 4px;
}
.msg-row.ai-row .msg-bubble {
  background: var(--surface2); color: var(--text); border-bottom-left-radius: 4px;
}
.msg-time { font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; }
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-dim); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; margin-top: 2px; }
.typing-dots { display: flex; gap: 4px; padding: 0.8rem 1rem; }
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }

/* ── Notes tab ──────────────────────────────────────────────────────────────── */
#tab-notes { position: relative; overflow: hidden; padding: 0; }
#tab-notes.active { display: block; }
.notes-toolbar {
  position: absolute; top: 1rem; right: 1rem; z-index: 10;
  display: flex; gap: 0.5rem;
}
.notes-board {
  width: 100%; height: 100%; position: relative; overflow: hidden;
  background: #0b0d0f;
  background-image: radial-gradient(circle, #1a1e22 1px, transparent 1px);
  background-size: 32px 32px;
}
.sticky-note {
  position: absolute; width: 180px; min-height: 120px;
  border-radius: 4px; padding: 0.75rem; cursor: grab; user-select: none;
  box-shadow: 3px 3px 10px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.3);
  display: flex; flex-direction: column; gap: 0.4rem;
  transition: box-shadow 0.15s, transform 0.1s;
}
.sticky-note:active { cursor: grabbing; }
.sticky-note.dragging { box-shadow: 6px 6px 20px rgba(0,0,0,0.7); transform: rotate(1.5deg) scale(1.03); z-index: 1000; }
.note-header { display: flex; justify-content: flex-end; gap: 0.3rem; }
.note-color-btn {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(0,0,0,0.25);
  cursor: pointer; flex-shrink: 0; transition: transform 0.1s;
}
.note-color-btn:hover { transform: scale(1.2); }
.note-delete-btn {
  background: none; border: none; color: rgba(0,0,0,0.4); font-size: 0.85rem;
  line-height: 1; padding: 0; cursor: pointer; transition: color 0.1s;
}
.note-delete-btn:hover { color: rgba(0,0,0,0.8); }
.note-textarea {
  background: transparent; border: none; outline: none; resize: none;
  color: rgba(0,0,0,0.85); font-size: 0.88rem; line-height: 1.5;
  flex: 1; min-height: 80px; font-family: inherit;
  width: 100%;
}
.note-textarea::placeholder { color: rgba(0,0,0,0.35); }

/* ── Canvas tab ─────────────────────────────────────────────────────────────── */
.bmc-wrap { max-width: 1000px; }
.bmc-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.bmc-subtitle { font-size: 0.8rem; color: var(--muted); margin-bottom: 1.5rem; }
.bmc-grid {
  display: grid;
  grid-template-areas:
    "kp ka vp cr cs"
    "kp kr vp ch cs"
    "co co co re re";
  grid-template-columns: 1fr 1fr 1.5fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 0.7fr;
  gap: 8px;
  height: 520px;
}
.bmc-cell {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.75rem; display: flex; flex-direction: column; gap: 0.4rem; overflow: hidden;
}
.bmc-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); flex-shrink: 0;
}
.bmc-vp-cell .bmc-label { color: var(--accent); }
.bmc-textarea {
  flex: 1; background: transparent; border: none; outline: none; resize: none;
  color: var(--text); font-size: 0.82rem; line-height: 1.5; font-family: inherit;
  overflow-y: auto;
}
.bmc-save-row { margin-top: 1rem; display: flex; gap: 0.75rem; align-items: center; }
.bmc-cell[data-area=kp] { grid-area: kp; }
.bmc-cell[data-area=ka] { grid-area: ka; }
.bmc-cell[data-area=kr] { grid-area: kr; }
.bmc-cell[data-area=vp] { grid-area: vp; }
.bmc-cell[data-area=cr] { grid-area: cr; }
.bmc-cell[data-area=ch] { grid-area: ch; }
.bmc-cell[data-area=cs] { grid-area: cs; }
.bmc-cell[data-area=co] { grid-area: co; }
.bmc-cell[data-area=re] { grid-area: re; }

/* ── Admin ──────────────────────────────────────────────────────────────────── */
#view-admin { max-width: 1000px; margin: 0 auto; padding: 2rem 1.5rem; }
.admin-header { margin-bottom: 2rem; }
.admin-header h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.3rem; }
.admin-header p { font-size: 0.85rem; color: var(--muted); }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.admin-tab {
  padding: 0.55rem 1rem; background: none; border: none;
  color: var(--muted); font-size: 0.86rem; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s;
}
.admin-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
  text-align: left; padding: 0.6rem 0.75rem; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: var(--surface); }
.admin-del-btn {
  background: none; border: none; color: var(--muted); font-size: 0.8rem; cursor: pointer; padding: 0.2rem 0.4rem;
  border-radius: 4px; transition: all 0.15s;
}
.admin-del-btn:hover { color: var(--red); background: var(--red-dim); }
.admin-badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 12px; font-size: 0.72rem; font-weight: 700; }
.admin-badge-admin { background: var(--accent-dim); color: var(--accent); }
.admin-badge-user { background: var(--surface2); color: var(--muted); }
.admin-login-box { max-width: 360px; margin: 6rem auto; padding: 0 1rem; }

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 1rem;
}
.modal-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.8rem; width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 1rem;
}
.modal-box h3 { font-size: 1.1rem; font-weight: 700; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ── Patricia avatar styles ─────────────────────────────────────────────────── */
.patricia-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.patricia-svg { width: 138px; height: auto; filter: drop-shadow(0 4px 12px rgba(112,64,208,0.25)); }
.patricia-name   { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.patricia-status { font-size: 0.72rem; color: var(--muted); }

/* ── Idle: subtle head float ── */
.patricia-svg.patricia-idle { animation: patriciaFloat 4s ease-in-out infinite; }
@keyframes patriciaFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-4px); }
}

/* ── Back hair gentle sway ── */
.p-hair-back { transform-origin: 80px 58px; animation: hairSway 4s ease-in-out infinite; }
@keyframes hairSway {
  0%,100% { transform: rotate(0deg) skewX(0deg); }
  33%     { transform: rotate(1.2deg) skewX(0.5deg); }
  66%     { transform: rotate(-0.8deg) skewX(-0.3deg); }
}

/* ── Eye blink ── */
.p-eye-l, .p-eye-r {
  transform-origin: 63px 97px;
  animation: patriciaBlink 5s ease-in-out infinite;
}
.p-eye-r { transform-origin: 97px 97px; animation-delay: 0.1s; }
@keyframes patriciaBlink {
  0%,88%,100% { transform: scaleY(1); }
  93%          { transform: scaleY(0.04); }
}

/* ── Blush pulse ── */
.p-blush { animation: blushPulse 3s ease-in-out infinite; }
@keyframes blushPulse {
  0%,100% { opacity: 0.32; }
  50%     { opacity: 0.52; }
}

/* ── Star clip twinkle ── */
.p-star-clip { animation: starTwinkle 2.8s ease-in-out infinite; }
@keyframes starTwinkle {
  0%,100% { transform: translate(108px,54px) scale(1) rotate(0deg); }
  50%     { transform: translate(108px,54px) scale(1.25) rotate(18deg); }
}

/* ── Bow wiggle ── */
.p-bow { animation: bowWiggle 3.5s ease-in-out infinite; }
@keyframes bowWiggle {
  0%,100% { transform: translate(52px,52px) rotate(0deg); }
  50%     { transform: translate(52px,52px) rotate(-8deg); }
}

/* ── Thinking: head tilt ── */
.patricia-svg.patricia-thinking { animation: none; }
.patricia-svg.patricia-thinking .p-hair-bangs,
.patricia-svg.patricia-thinking .p-hair-back,
.patricia-svg.patricia-thinking .p-eye-l,
.patricia-svg.patricia-thinking .p-eye-r {
  animation-play-state: paused;
}
/* Tilt entire SVG slightly while thinking */
.patricia-svg.patricia-thinking { animation: patriciaTilt 1.6s ease-in-out infinite; }
@keyframes patriciaTilt {
  0%,100% { transform: rotate(0deg); }
  50%     { transform: rotate(8deg); }
}
/* Eyes look up/sideways when thinking */
.patricia-svg.patricia-thinking .p-eye-l { transform-origin: 63px 97px; animation: eyeLookUp 1.6s ease-in-out infinite; }
.patricia-svg.patricia-thinking .p-eye-r { transform-origin: 97px 97px; animation: eyeLookUp 1.6s ease-in-out infinite; }
@keyframes eyeLookUp {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-3px); }
}

/* ── Excited: bounce ── */
.patricia-svg.patricia-excited { animation: patriciaExcited 0.36s ease-in-out 5; }
@keyframes patriciaExcited {
  0%,100% { transform: translateY(0) scale(1); }
  50%     { transform: translateY(-14px) scale(1.04); }
}

/* ── Sparkle animations ── */
.p-sp1 { animation: spFloat 0.55s ease-in-out infinite; }
.p-sp2 { animation: spFloat 0.55s ease-in-out infinite 0.18s; }
.p-sp3 { animation: spFloat 0.55s ease-in-out infinite 0.09s; }
.p-sp4 { animation: spFloat 0.55s ease-in-out infinite 0.27s; }
@keyframes spFloat {
  0%,100% { transform: translateY(0) scale(1); opacity: 1; }
  50%     { transform: translateY(-9px) scale(1.25); opacity: 0.85; }
}

/* ── Toaster ─────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999;
  display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end;
}
.toast {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.65rem 1rem; font-size: 0.85rem; box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: toastIn 0.2s ease-out; max-width: 300px;
}
.toast.toast-error { border-color: var(--red); color: var(--red); }
.toast.toast-success { border-color: var(--green); color: var(--green); }
@keyframes toastIn { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:translateX(0)} }

/* ── Note color palette popup ───────────────────────────────────────────────── */
.color-picker-popup {
  position: absolute; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.5rem; display: flex; gap: 6px; flex-wrap: wrap;
  width: 130px; z-index: 200; box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.color-swatch {
  width: 22px; height: 22px; border-radius: 4px; cursor: pointer; border: 2px solid transparent;
  transition: transform 0.1s;
}
.color-swatch:hover { transform: scale(1.2); border-color: rgba(255,255,255,0.3); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .overview-grid { grid-template-columns: 1fr; }
  .form-group-lg { grid-column: auto; }
  .chat-dog-panel { width: 80px; }
  .rex-svg { width: 70px; }
  .bmc-grid {
    grid-template-areas: "vp" "kp" "ka" "kr" "cr" "ch" "cs" "co" "re";
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: auto;
  }
  .bmc-cell { min-height: 100px; }
  .ideas-grid { grid-template-columns: 1fr; }
}

/* ── Misc ───────────────────────────────────────────────────────────────────── */
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
