/* CreatorOS Shared Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; min-width: 240px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.main { flex: 1; overflow-y: auto; min-height: 100vh; }

/* Sidebar */
.sidebar-header { padding: 20px 20px 16px; border-bottom: 1px solid var(--border); }
.sidebar-logo { font-weight: 700; font-size: 18px; letter-spacing: -0.3px; }
.sidebar-logo span { opacity: 0.45; font-weight: 400; }

.creator-profile { padding: 20px; border-bottom: 1px solid var(--border); text-align: center; }
.creator-avatar { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; }
.creator-name { font-weight: 600; font-size: 14px; }
.creator-handle { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: 14px; color: var(--text-secondary); cursor: pointer; border-radius: 0; transition: background 0.15s, color 0.15s; text-decoration: none; border: none; background: none; width: 100%; text-align: left; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { color: var(--accent); background: var(--accent-bg); font-weight: 600; }
.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.back-link { font-size: 13px; color: var(--text-secondary); text-decoration: none; display: flex; align-items: center; gap: 6px; }
.back-link:hover { color: var(--text); }

/* Page header */
.page-header { padding: 32px 32px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; }

/* Metric cards */
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 24px 32px; }
.metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.metric-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.metric-value { font-size: 28px; font-weight: 700; margin: 6px 0 4px; letter-spacing: -0.5px; }
.metric-change { font-size: 13px; color: #22c55e; display: flex; align-items: center; gap: 3px; }
.metric-change.down { color: #ef4444; }
.metric-change.neutral { color: var(--text-secondary); }

/* Content area */
.content-area { padding: 24px 32px; display: flex; flex-direction: column; gap: 20px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* Progress bars */
.bar-item { margin-bottom: 12px; }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.bar-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--accent); }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-yt { background: #fee2e2; color: #b91c1c; }
.badge-tw { background: #ede9fe; color: #5b21b6; }
.badge-tt { background: #ccfbf1; color: #0f766e; }
.badge-ig { background: #fce7f3; color: #9d174d; }
.badge-blog { background: #dbeafe; color: #1e40af; }
.badge-yt-s { background: #fee2e2; color: #b91c1c; }

/* Platform badge pills */
.platform-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; background: var(--bg); border: 1px solid var(--border); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: opacity 0.15s, transform 0.1s; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.88; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font); background: var(--surface); color: var(--text); outline: none; transition: border-color 0.15s; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.form-textarea { resize: vertical; min-height: 80px; }

/* Chips */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { padding: 6px 14px; border: 1px solid var(--border); border-radius: 20px; font-size: 13px; cursor: pointer; background: var(--surface); color: var(--text); transition: background 0.15s, border-color 0.15s; }
.chip:hover, .chip.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

/* AI result sections */
.ai-section { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 12px; }
.ai-section-header { padding: 10px 16px; background: var(--bg); display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.ai-section-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; }
.ai-section-body { padding: 14px 16px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }

/* Progress steps */
.ai-steps { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.ai-step { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-secondary); }
.ai-step .step-icon { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.ai-step.done .step-icon { background: #22c55e; border-color: #22c55e; color: #fff; }
.ai-step.active .step-icon { border-color: var(--accent); border-width: 2px; animation: pulse 1s infinite; }
.ai-step.done { color: var(--text); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day-header { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-secondary); padding: 6px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.cal-cell { min-height: 90px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.cal-cell.other-month { background: var(--bg); opacity: 0.6; }
.cal-cell.today { border-color: var(--accent); }
.cal-date { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.cal-cell.today .cal-date { color: var(--accent); }
.cal-event { font-size: 11px; padding: 2px 6px; border-radius: 4px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.cal-event.yt { background: #fee2e2; color: #b91c1c; }
.cal-event.tw { background: #ede9fe; color: #5b21b6; }
.cal-event.tt { background: #ccfbf1; color: #0f766e; }
.cal-event.blog { background: #dbeafe; color: #1e40af; }
.cal-event.holiday { background: #fef3c7; color: #92400e; }
.cal-event.ig { background: #fce7f3; color: #9d174d; }

/* Event cards */
.event-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.event-info { flex: 1; }
.event-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.event-date { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.event-angle { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.event-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }

/* Brand deals */
.deal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.deal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.deal-name { font-weight: 700; font-size: 16px; }
.deal-amount { font-size: 18px; font-weight: 700; color: var(--accent); }
.deal-status { font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 500; }
.deal-status.active { background: #dcfce7; color: #15803d; }
.deal-status.negotiating { background: #fef3c7; color: #92400e; }
.deal-status.outreach { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.deal-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* AI insight */
.insight-card { background: var(--accent-bg); border: 1px solid var(--accent); border-radius: var(--radius); padding: 16px 20px; display: flex; gap: 12px; align-items: flex-start; }
.insight-icon { font-size: 20px; flex-shrink: 0; }
.insight-text { font-size: 14px; line-height: 1.6; }
.insight-text strong { color: var(--accent); }

/* Schedule list */
.schedule-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.schedule-item:last-child { border-bottom: none; }
.schedule-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.schedule-info { flex: 1; }
.schedule-title { font-size: 14px; font-weight: 500; }
.schedule-time { font-size: 12px; color: var(--text-secondary); }
.schedule-platform { flex-shrink: 0; }

/* AI assistant panel */
.ai-panel { width: 300px; min-width: 300px; border-left: 1px solid var(--border); display: flex; flex-direction: column; background: var(--surface); height: 100vh; position: sticky; top: 0; }
.ai-panel-header { padding: 20px; border-bottom: 1px solid var(--border); }
.ai-panel-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.ai-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ai-msg { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.6; }
.ai-msg.assistant { background: var(--bg); color: var(--text); }
.ai-msg.user { background: var(--accent); color: #fff; align-self: flex-end; max-width: 85%; }
.ai-input-area { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.ai-input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; outline: none; font-family: var(--font); }
.ai-input:focus { border-color: var(--accent); }
.ai-send { background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); padding: 9px 14px; cursor: pointer; font-size: 13px; }

/* Generate page layout */
.generate-layout { display: flex; height: calc(100vh - 73px); }
.generate-main { flex: 1; overflow-y: auto; padding: 24px 32px; }

/* Tabs */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg); border-radius: var(--radius-sm); width: fit-content; margin-bottom: 24px; }
.tab { padding: 8px 18px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--text-secondary); border: none; background: none; transition: background 0.15s, color 0.15s; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

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

/* Spinner */
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Table */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

/* Weekly schedule grid */
.week-grid { display: grid; grid-template-columns: 80px repeat(7, 1fr); gap: 4px; font-size: 13px; }
.week-header { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-secondary); padding: 6px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.week-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; padding: 6px 8px 6px 0; display: flex; align-items: center; }
.week-cell { background: var(--bg); border-radius: 6px; min-height: 36px; display: flex; align-items: center; justify-content: center; padding: 4px; }
.week-post { font-size: 11px; padding: 3px 6px; border-radius: 4px; text-align: center; width: 100%; font-weight: 500; }

/* Repurpose buttons */
.repurpose-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Media modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.media-modal { background: var(--surface); border-radius: 20px 20px 0 0; width: 100%; max-width: 560px; padding: 24px; max-height: 70vh; overflow-y: auto; }
.modal-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 16px; }
.media-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.media-thumb { aspect-ratio: 1; border-radius: 8px; cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; font-weight: 600; overflow: hidden; border: 2px solid transparent; }
.media-thumb:hover, .media-thumb.selected { border-color: var(--accent); }
.media-duration { position: absolute; bottom: 4px; right: 4px; background: rgba(0,0,0,0.6); color: #fff; font-size: 10px; padding: 1px 4px; border-radius: 3px; }
.drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--text-secondary); font-size: 14px; cursor: pointer; }
.drop-zone:hover { border-color: var(--accent); background: var(--accent-bg); }

/* Responsive */
@media (max-width: 1024px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .ai-panel { display: none; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); padding: 16px; }
  .content-area { padding: 16px; }
}

/* ── COMMENTS ANALYSER ────────────────────── */
.comments-layout { display: flex; gap: 20px; align-items: flex-start; }
.comments-main { flex: 1; min-width: 0; }
.comments-right { width: 280px; flex-shrink: 0; }

.platform-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.platform-pill { padding: 6px 16px; border-radius: 100px; border: 1px solid var(--border); background: transparent; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-secondary); transition: all 0.15s; }
.platform-pill:hover { border-color: var(--accent); color: var(--accent); }
.platform-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.comments-progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin: 10px 0; }
.comments-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s ease; width: 0%; }

.summary-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.summary-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 8px; text-align: center; }
.summary-stat-value { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; color: var(--text); }
.summary-stat-value.green { color: #15803d; }
.summary-stat-value.blue { color: #1d4ed8; }
.summary-stat-value.amber { color: #b45309; }
.summary-stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-pill { padding: 5px 12px; border-radius: 100px; border: 1px solid var(--border); background: transparent; font-size: 12px; font-weight: 500; cursor: pointer; color: var(--text-secondary); transition: all 0.15s; white-space: nowrap; }
.filter-pill:hover { border-color: var(--accent); color: var(--accent); }
.filter-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.comment-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 10px; animation: cFadeUp 0.3s ease both; }
.comment-card.spam-card { opacity: 0.5; }
@keyframes cFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.comment-original { font-size: 14px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.55; }
.comment-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.category-badge { padding: 2px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.cat-question { background: #dbeafe; color: #1d4ed8; }
.cat-compliment { background: #dcfce7; color: #15803d; }
.cat-criticism { background: #fef3c7; color: #b45309; }
.cat-collab { background: #f3e8ff; color: #7c3aed; }
.cat-spam { background: #f3f4f6; color: #6b7280; }
.sentiment-dot { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sentiment-positive { background: #dcfce7; }
.sentiment-neutral { background: #f3f4f6; }
.sentiment-negative { background: #fef3c7; }
.reply-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.reply-box { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.reply-textarea { width: 100%; background: transparent; border: none; outline: none; font-family: var(--font); font-size: 13px; color: var(--text); line-height: 1.55; resize: none; min-height: 56px; }
.reply-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.char-count { font-size: 11px; color: var(--text-secondary); }
.char-count.near-limit { color: #d97706; }
.char-count.over-limit { color: #dc2626; }
.reply-actions { display: flex; gap: 6px; }

.stat-summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.stat-summary-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--text); }

@media (max-width: 900px) {
  .comments-layout { flex-direction: column; }
  .comments-right { width: 100%; }
  .summary-bar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .filter-row { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .summary-bar { grid-template-columns: repeat(2, 1fr); }
}

/* ── AI Event Finder ───────────────────────────────────────────────── */

/* AI calendar event colours */
.cal-event.ai-pink   { background: #fce7f3; color: #9d174d; }
.cal-event.ai-teal   { background: #ccfbf1; color: #0f766e; }
.cal-event.ai-amber  { background: #fef3c7; color: #92400e; }
.cal-event.ai-purple { background: #ede9fe; color: #5b21b6; }
.cal-event.ai-green  { background: #dcfce7; color: #15803d; }
.cal-event.ai-blue   { background: #dbeafe; color: #1e40af; }

/* Reminder banner */
.aif-reminder { padding: 0; }
.aif-reminder-inner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent); color: #fff;
  padding: 12px 20px; font-size: 13px; font-weight: 500; line-height: 1.5;
}
.aif-reminder-inner strong { font-weight: 700; }
.aif-reminder-x {
  margin-left: auto; background: none; border: none; color: #fff;
  font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1;
  opacity: 0.7; flex-shrink: 0;
}
.aif-reminder-x:hover { opacity: 1; }

/* Floating wrapper */
.aif-wrap {
  position: absolute; bottom: 24px; right: 24px; z-index: 200;
  width: 340px; display: flex; flex-direction: column; align-items: flex-end;
}

/* Pill button */
.aif-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 40px; padding: 10px 20px;
  font-size: 13px; font-weight: 600; cursor: pointer; letter-spacing: 0.2px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18); transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
}
.aif-pill:hover { opacity: 0.88; transform: translateY(-1px); }

/* Panel */
.aif-panel {
  width: 340px; max-height: 520px; min-height: 400px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.14);
  overflow: hidden; margin-bottom: 10px;
  animation: aifSlideUp 0.22s ease;
}
.aif-panel.aif-in { display: flex !important; }

@keyframes aifSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.aif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 0; flex-shrink: 0;
}
.aif-panel-title { font-weight: 700; font-size: 14px; color: var(--accent); letter-spacing: 0.2px; }
.aif-close-btn {
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: var(--text-secondary); padding: 0 4px; line-height: 1;
}
.aif-close-btn:hover { color: var(--text); }

.aif-panel-sub {
  font-size: 12px; color: var(--text-secondary); padding: 4px 16px 12px;
  border-bottom: 1px solid var(--border); flex-shrink: 0; line-height: 1.5;
}

/* Chat area */
.aif-chat-area {
  flex: 1; overflow-y: auto; padding: 12px; display: flex;
  flex-direction: column; gap: 8px; min-height: 0;
}

/* Starter chips */
.aif-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 6px; }
.aif-chip {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 20px;
  font-size: 12px; cursor: pointer; background: var(--bg); color: var(--text);
  transition: background 0.15s, border-color 0.15s; font-family: var(--font);
}
.aif-chip:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

/* Bubbles */
.aif-user-msg { display: flex; flex-direction: column; align-items: flex-end; }
.aif-ai-msg   { display: flex; align-items: flex-start; gap: 6px; }
.aif-ai-right { display: flex; flex-direction: column; flex: 1; }
.aif-ai-icon  {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-bg); color: var(--accent);
  font-size: 11px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; margin-top: 2px;
}
.aif-bubble {
  max-width: 88%; padding: 8px 12px; border-radius: 12px;
  font-size: 13px; line-height: 1.55; word-break: break-word;
}
.aif-user-bubble {
  background: var(--accent); color: #fff;
  border-bottom-right-radius: 4px;
}
.aif-ai-bubble {
  background: var(--bg); color: var(--text);
  border-bottom-left-radius: 4px; border: 1px solid var(--border);
}
.aif-ts {
  font-size: 10px; color: var(--text-light); margin-top: 3px; padding: 0 2px;
}

/* Animated loading dots */
.aif-dots { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.aif-dots span {
  width: 6px; height: 6px; background: var(--text-secondary);
  border-radius: 50%; animation: aifDot 1.2s infinite;
}
.aif-dots span:nth-child(2) { animation-delay: 0.2s; }
.aif-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aifDot {
  0%,80%,100% { opacity: 0.25; transform: scale(0.85); }
  40%          { opacity: 1;    transform: scale(1); }
}

/* Event confirmation card */
.aif-event-card {
  background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 12px 14px; font-size: 13px;
}
.aif-ev-title   { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.aif-ev-date    { color: var(--text-secondary); font-size: 12px; margin-bottom: 8px; }
.aif-ev-section { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.aif-ev-ideas   { padding-left: 16px; color: var(--text-secondary); line-height: 1.7; font-size: 12px; margin-bottom: 8px; }
.aif-ev-meta    { font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; }
.aif-ev-actions { display: flex; gap: 8px; margin-top: 10px; }
.aif-add-btn {
  flex: 1; padding: 7px 12px; background: var(--accent); color: #fff;
  border: none; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s; font-family: var(--font);
}
.aif-add-btn:hover { opacity: 0.85; }
.aif-dismiss-btn {
  padding: 7px 12px; background: var(--bg); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 8px; font-size: 12px;
  cursor: pointer; font-family: var(--font);
}
.aif-dismiss-btn:hover { background: var(--border); }
.aif-added-pill {
  font-size: 12px; font-weight: 600; color: #15803d;
  background: #dcfce7; padding: 6px 14px; border-radius: 20px;
  display: inline-flex; align-items: center;
}

/* Input row */
.aif-input-row {
  display: flex; gap: 6px; padding: 10px 12px;
  border-top: 1px solid var(--border); flex-shrink: 0; background: #fff;
}
.aif-input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 20px; font-size: 13px; font-family: var(--font);
  outline: none; background: var(--bg); color: var(--text);
  transition: border-color 0.15s;
}
.aif-input:focus { border-color: var(--accent); }
.aif-send-btn {
  width: 36px; height: 36px; background: var(--accent); color: #fff;
  border: none; border-radius: 50%; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  transition: opacity 0.15s;
}
.aif-send-btn:hover { opacity: 0.85; }

/* Mobile: full width panel, fixed at bottom */
@media (max-width: 640px) {
  .aif-wrap { width: calc(100vw - 48px); right: 16px; bottom: 16px; }
  .aif-panel { width: 100%; }
}
