/* ═══════════════════════════════════════════════════════════════════════════
   Golf Generator PWA — Design System
   Style: Minimal SaaS · Dark-first · 8px grid · SVG icons only
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────────────────────────────── */
:root {
  --brand:        #22c55e;
  --brand-bg:     rgba(34,197,94,.1);
  --brand-border: rgba(34,197,94,.22);

  --bg:           #0c0c0c;
  --surface:      #141414;
  --surface-2:    #1c1c1c;
  --surface-3:    #252525;
  --border:       #272727;
  --border-faint: #1c1c1c;

  --text:         #ebebeb;
  --text-2:       #888;
  --text-3:       #484848;

  --error:        #f87171;
  --error-bg:     rgba(248,113,113,.1);
  --error-border: rgba(248,113,113,.2);

  --radius:    8px;
  --radius-sm: 5px;

  --sidebar-w: 220px;
  --topbar-h:  52px;
  --tabbar-h:  64px;

  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  --dur: 140ms;
}

@media (prefers-color-scheme: light) {
  :root {
    --brand:        #16a34a;
    --brand-bg:     rgba(22,163,74,.08);
    --brand-border: rgba(22,163,74,.2);

    --bg:           #f4f4f5;
    --surface:      #fff;
    --surface-2:    #f0f0f1;
    --surface-3:    #e6e6e8;
    --border:       #e2e2e4;
    --border-faint: #ebebec;

    --text:         #111;
    --text-2:       #666;
    --text-3:       #aaa;

    --error:        #dc2626;
    --error-bg:     rgba(220,38,38,.08);
    --error-border: rgba(220,38,38,.18);
  }
}

/* ── RESET ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg); color: var(--text);
  line-height: 1.5; -webkit-font-smoothing: antialiased;
  min-height: 100dvh; overflow-x: hidden;
}
button { font-family: var(--font); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── APP LAYOUT ──────────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100dvh; }

/* ── SIDEBAR (desktop ≥1024px) ───────────────────────────────────────────── */
.sidebar {
  display: none;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-direction: column;
  position: fixed; top: 0; left: 0;
  height: 100dvh; z-index: 100;
  padding: 18px 10px;
}

@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .mobile-header, .tab-bar { display: none !important; }
  .main-content {
    margin-left: var(--sidebar-w);
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 8px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.logo-mark {
  width: 28px; height: 28px; background: var(--brand);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-mark svg {
  width: 15px; height: 15px; stroke: #000; fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
.logo-text { font-size: 13.5px; font-weight: 650; color: var(--text); letter-spacing: -.02em; }
.logo-sub { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 1px; }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 1px; }

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-2);
  font-size: 13.5px; font-weight: 450;
  border: none; background: none; width: 100%;
  text-align: left;
  transition: color var(--dur), background var(--dur);
}
.nav-item svg {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-bg); color: var(--brand); }

.sidebar-footer {
  padding-top: 12px; border-top: 1px solid var(--border);
}
.sidebar-dna-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
}
.sidebar-dna-label {
  font-size: 11.5px; font-weight: 550; color: var(--text-3);
  letter-spacing: .04em; text-transform: uppercase;
}

/* ── MOBILE HEADER ───────────────────────────────────────────────────────── */
.mobile-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; z-index: 100;
}
.mobile-logo { display: flex; align-items: center; gap: 8px; }
.mobile-logo-mark {
  width: 24px; height: 24px; background: var(--brand);
  border-radius: 5px; display: flex; align-items: center; justify-content: center;
}
.mobile-logo-mark svg {
  width: 13px; height: 13px; stroke: #000; fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
.mobile-logo-text { font-size: 14px; font-weight: 650; color: var(--text); letter-spacing: -.02em; }

/* ── DNA TOGGLE ──────────────────────────────────────────────────────────── */
.dna-toggle { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.dna-toggle-label {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  letter-spacing: .06em; text-transform: uppercase;
}
.toggle-switch { position: relative; display: inline-flex; }
.toggle-switch input[type=checkbox] {
  opacity: 0; width: 0; height: 0; position: absolute;
}
.toggle-track {
  width: 34px; height: 20px;
  background: var(--surface-3); border-radius: 10px;
  border: 1px solid var(--border); position: relative; cursor: pointer;
  transition: background var(--dur), border-color var(--dur);
}
.toggle-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: var(--text-3); border-radius: 50%;
  transition: transform 180ms ease, background var(--dur);
}
.toggle-switch input:checked + .toggle-track { background: var(--brand); border-color: var(--brand); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(14px); background: #000; }

/* ── MAIN CONTENT ────────────────────────────────────────────────────────── */
.main-content {
  flex: 1; min-width: 0;
  padding-top: calc(var(--topbar-h) + 12px);
  padding-bottom: calc(var(--tabbar-h) + 12px);
}
.tab-pane { display: none; padding: 20px 16px; max-width: 740px; margin: 0 auto; }
.tab-pane.active { display: block; }
@media (min-width: 1024px) { .tab-pane { padding: 36px 48px; } }

/* ── TAB BAR (mobile) ────────────────────────────────────────────────────── */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--tabbar-h);
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  padding: 8px 4px; background: none; border: none;
  cursor: pointer; color: var(--text-3);
  font-size: 10px; font-weight: 500;
  font-family: var(--font);
  transition: color var(--dur); min-height: 44px;
}
.tab-btn svg {
  width: 20px; height: 20px; stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.tab-btn.active { color: var(--brand); }

/* ── PAGE HEADER ─────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-title {
  font-size: 20px; font-weight: 700; color: var(--text);
  letter-spacing: -.025em; line-height: 1.2; margin-bottom: 5px;
}
.page-sub { font-size: 13.5px; color: var(--text-2); line-height: 1.55; }

/* ── FORM ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 12px; font-weight: 550;
  color: var(--text-2); margin-bottom: 6px; letter-spacing: .01em;
}
input[type=text], input[type=url], textarea, select {
  width: 100%;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font); font-size: 14px; padding: 9px 12px;
  transition: border-color var(--dur), box-shadow var(--dur);
  -webkit-appearance: none; appearance: none; outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-bg);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { resize: vertical; line-height: 1.55; min-height: 72px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 32px; cursor: pointer;
}
.hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #000;
  border: none; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 650; font-family: var(--font);
  padding: 10px 18px; cursor: pointer;
  transition: opacity var(--dur), transform 100ms;
  width: 100%; letter-spacing: -.01em; min-height: 40px;
}
.btn-primary:hover { opacity: .86; }
.btn-primary:active { transform: scale(.985); }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; font-family: var(--font);
  padding: 8px 16px; cursor: pointer;
  transition: background var(--dur), color var(--dur); min-height: 36px;
}
.btn-secondary:hover { background: var(--surface-3); color: var(--text); }

.btn-copy {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; color: var(--text-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; font-family: var(--font);
  padding: 6px 11px; cursor: pointer; margin-top: 10px;
  transition: color var(--dur), background var(--dur), border-color var(--dur);
}
.btn-copy:hover, .btn-copy.copied {
  color: var(--brand); border-color: var(--brand-border); background: var(--brand-bg);
}

/* ── LOADER ──────────────────────────────────────────────────────────────── */
.loader { display: none; align-items: center; gap: 12px; padding: 16px 0; }
.loader.active { display: flex; }
.loader-dots { display: flex; gap: 4px; flex-shrink: 0; }
.loader-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
  animation: dotPulse 1.4s ease-in-out infinite;
}
.loader-dots span:nth-child(2) { animation-delay: .2s; }
.loader-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotPulse {
  0%, 80%, 100% { opacity: .2; transform: scale(.8); }
  40% { opacity: 1; transform: scale(1); }
}
.loader-text { font-size: 13px; color: var(--text-2); }

/* ── CARDS ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-top: 14px;
}
.card-label {
  font-size: 10.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 10px; display: flex; align-items: center; gap: 7px;
}
.card-content {
  font-size: 13.5px; color: var(--text);
  line-height: 1.65; white-space: pre-wrap;
}
.card-content.streaming-cursor::after {
  content: '▋'; animation: blink 1s step-end infinite;
  color: var(--brand); font-size: 14px;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── SECTION TITLE ───────────────────────────────────────────────────────── */
.section-title {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
  margin: 24px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-faint);
}

/* ── BADGES ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: .03em;
}
.badge-green { background: var(--brand-bg); color: var(--brand); border: 1px solid var(--brand-border); }
.badge-blue  { background: rgba(59,130,246,.1); color: #60a5fa; border: 1px solid rgba(59,130,246,.18); }

/* ── TITLE OPTIONS ───────────────────────────────────────────────────────── */
.title-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.title-option {
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; transition: border-color var(--dur), background var(--dur);
}
.title-option:hover { border-color: var(--brand-border); background: var(--brand-bg); }
.title-option.selected { border-color: var(--brand); background: var(--brand-bg); }
.title-option-text { font-size: 14px; font-weight: 550; color: var(--text); line-height: 1.4; margin-bottom: 3px; }
.title-option-meta { font-size: 11.5px; color: var(--brand); font-weight: 550; }

/* ── TAGS ────────────────────────────────────────────────────────────────── */
.tags-container { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.tag {
  padding: 3px 8px; border-radius: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); font-size: 11.5px;
}

/* ── VIDEO IDEAS ─────────────────────────────────────────────────────────── */
.ideas-category { margin-top: 20px; }
.ideas-category-title {
  font-size: 10.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px;
}
.idea-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 8px;
  cursor: pointer; transition: border-color var(--dur), transform 150ms ease;
}
.idea-card:hover { border-color: var(--brand-border); transform: translateY(-1px); }
.idea-card:active { transform: scale(.99); }
.idea-format { font-size: 10px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.idea-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 5px; line-height: 1.35; }
.idea-why { font-size: 12.5px; color: var(--text-2); line-height: 1.5; margin-bottom: 6px; }
.idea-keywords { display: flex; flex-wrap: wrap; gap: 4px; }
.idea-kw {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-3); font-size: 10.5px; padding: 2px 7px; border-radius: 3px;
}

/* ── CHECKLIST ───────────────────────────────────────────────────────────── */
.format-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 20px; }
.format-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 16px 8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; color: var(--text-2);
  font-size: 12.5px; font-weight: 500; font-family: var(--font);
  transition: border-color var(--dur), color var(--dur), background var(--dur);
}
.format-btn svg {
  width: 20px; height: 20px; stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.format-btn:hover { border-color: var(--brand-border); color: var(--text); }
.format-btn.active { border-color: var(--brand); color: var(--brand); background: var(--brand-bg); }

.checklist-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--dur);
}
.checklist-item:hover { background: var(--surface-2); }
.checklist-item + .checklist-item { border-top: 1px solid var(--border-faint); }
.checklist-item input[type=checkbox] {
  width: 16px; height: 16px; flex-shrink: 0;
  margin-top: 2px; accent-color: var(--brand); cursor: pointer;
}
.check-label { font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.checklist-tip { font-size: 12px; color: var(--text-2); line-height: 1.45; }
.checklist-item.done .check-label { color: var(--text-3); text-decoration: line-through; }

/* ── CHIP CHECKBOXES ─────────────────────────────────────────────────────── */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-checkbox { display: none; }
.chip-label {
  display: inline-flex; align-items: center;
  padding: 5px 12px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-size: 12.5px; font-weight: 500;
  cursor: pointer; user-select: none; transition: all var(--dur);
}
.chip-checkbox:checked + .chip-label {
  background: var(--brand-bg); border-color: var(--brand); color: var(--brand);
}

/* ── EMPTY STATE ─────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state p { font-size: 13.5px; margin-top: 12px; color: var(--text-2); }
.empty-icon {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin: 0 auto;
}
.empty-icon svg {
  width: 32px; height: 32px; stroke: var(--text-3); fill: none;
  stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round;
}

/* ── ERROR ───────────────────────────────────────────────────────────────── */
.error-msg {
  display: none; background: var(--error-bg);
  border: 1px solid var(--error-border); border-radius: var(--radius-sm);
  color: var(--error); font-size: 13px; padding: 10px 12px;
  margin-top: 12px; line-height: 1.5;
}
.error-msg.active { display: block; }

/* ── SAVE ────────────────────────────────────────────────────────────────── */
.save-indicator { display: none; font-size: 12.5px; color: var(--brand); font-weight: 550; }
.save-indicator.active { display: inline; }
.save-btn-wrap { display: flex; align-items: center; gap: 12px; margin-top: 8px; }

/* ── SETTINGS FOOTER ─────────────────────────────────────────────────────── */
.settings-footer {
  margin-top: 40px; padding-top: 16px;
  border-top: 1px solid var(--border); text-align: center;
}
.settings-footer p { font-size: 11.5px; color: var(--text-3); line-height: 2; }

/* ── TAB BAR SCROLLABLE (7 tabs) ─────────────────────────────────────────── */
.tab-bar { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-bar { justify-content: flex-start; padding: 0 4px; gap: 0; }
.tab-btn { min-width: 52px; flex: 0 0 auto; padding: 6px 10px; font-size: 10px; }
.tab-btn svg { width: 18px; height: 18px; }

/* ── SUB-TABS ────────────────────────────────────────────────────────────── */
.sub-tabs {
  display: flex; gap: 2px; margin: 0 0 20px;
  background: var(--surface-2); border-radius: var(--radius);
  padding: 3px;
}
.sub-tab {
  flex: 1; padding: 8px 12px; font-size: 13px; font-weight: 500;
  border: none; background: transparent; color: var(--text-2);
  border-radius: calc(var(--radius) - 2px); cursor: pointer;
  transition: background var(--dur), color var(--dur);
}
.sub-tab.active {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.sub-pane { display: none; }
.sub-pane.active { display: block; }

.sub-tabs-inner {
  display: flex; gap: 2px; margin: 0 0 16px;
  background: var(--surface-3); border-radius: var(--radius-sm);
  padding: 2px;
}
.sub-tab-inner {
  flex: 1; padding: 7px 10px; font-size: 12px; font-weight: 500;
  border: none; background: transparent; color: var(--text-2);
  border-radius: calc(var(--radius-sm) - 1px); cursor: pointer;
  transition: background var(--dur), color var(--dur);
}
.sub-tab-inner.active {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}

/* ── CONNECT CARD ────────────────────────────────────────────────────────── */
.connect-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px;
  text-align: center; max-width: 420px; margin: 0 auto;
}
.connect-icon { width: 48px; height: 48px; margin: 0 auto 16px; }
.connect-icon svg { width: 48px; height: 48px; }
.connect-title { font-size: 17px; font-weight: 650; margin-bottom: 8px; }
.connect-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.6; margin-bottom: 20px; }
.coming-soon-badge {
  display: inline-block; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 100px; letter-spacing: .04em;
}

/* ── ANALYTICS DASHBOARD ─────────────────────────────────────────────────── */
.analytics-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px;
}
.analytics-channel-name { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.analytics-stats-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-chip {
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px; min-width: 80px;
}
.stat-chip span { font-size: 17px; font-weight: 700; color: var(--brand); }
.stat-chip small { font-size: 10.5px; color: var(--text-2); margin-top: 2px; }
.stat-chip-accent { background: var(--brand-bg); border-color: var(--brand-border); }
.stat-chip-accent span { color: var(--brand); }

/* Performance cards */
.perf-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.perf-card {
  flex: 1; min-width: 100px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.perf-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.perf-label { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; }
.perf-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }

.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text-2);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--dur), color var(--dur);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-small { padding: 6px 12px; font-size: 12.5px; }

/* Best days grid */
.best-days-grid {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px;
}
.day-bar {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; min-width: 70px;
}
.day-bar.best { border-color: var(--brand-border); background: var(--brand-bg); }
.day-bar .day-name { font-size: 12px; font-weight: 600; color: var(--text-2); }
.day-bar .day-views { font-size: 15px; font-weight: 700; }
.day-bar.best .day-views { color: var(--brand); }
.day-bar .day-rank { font-size: 10px; color: var(--text-3); }
.day-bar.best .day-rank { color: var(--brand); }

/* Top videos list */
.top-videos-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.video-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.video-thumb {
  width: 72px; height: 40px; border-radius: 4px;
  object-fit: cover; flex-shrink: 0; background: var(--surface-2);
}
.video-info { flex: 1; min-width: 0; }
.video-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-meta { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.video-views { font-size: 13px; font-weight: 650; color: var(--brand); flex-shrink: 0; }

/* Audience grid */
.audience-grid { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.audience-card {
  flex: 1; min-width: 140px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.audience-card-title { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.audience-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13px; }
.audience-bar-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.audience-label { font-size: 12px; color: var(--text-2); min-width: 60px; }
.audience-bar { flex: 1; height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.audience-bar-fill { height: 100%; background: var(--brand); border-radius: 3px; }
.audience-pct { font-size: 12px; font-weight: 600; min-width: 32px; text-align: right; }

/* ── ADD CUSTOM CHANNEL ──────────────────────────────────────────────────── */
.add-channel-row {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.add-channel-input {
  flex: 1; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 13.5px; min-width: 0;
  transition: border-color var(--dur);
}
.add-channel-input:focus { outline: none; border-color: var(--brand-border); }
.btn-sm {
  padding: 9px 14px; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: opacity .15s;
}
.btn-sm:hover { opacity: .85; }
.btn-sm:disabled { opacity: .5; cursor: default; }

/* Candidate picker (search results) */
.candidate-list { margin-bottom: 12px; }
.candidate-label { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-2); margin-bottom: 8px; }
.candidate-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  cursor: pointer; transition: border-color var(--dur); margin-bottom: 6px;
}
.candidate-card:hover { border-color: var(--brand-border); }

/* Custom channel badge + remove button */
.custom-channel-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 100px; margin-left: 6px;
  background: var(--brand-bg); border: 1px solid var(--brand-border);
  color: var(--brand); vertical-align: middle; text-transform: uppercase;
  letter-spacing: .04em;
}
.channel-remove-btn {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: all .15s;
}
.channel-remove-btn:hover { background: rgba(248,113,113,.15); border-color: #f87171; color: #f87171; }

/* ── INSPIRATION / CHANNELS ──────────────────────────────────────────────── */
.channels-grid { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.channel-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  cursor: pointer; transition: border-color var(--dur);
}
.channel-card:hover { border-color: var(--brand-border); }
.channel-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0; background: var(--surface-2);
}
.channel-info { flex: 1; min-width: 0; }
.channel-name { font-size: 14px; font-weight: 600; }
.channel-stats { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.channel-desc { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-arrow { color: var(--text-3); flex-shrink: 0; }

.channel-detail-back {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--text-2); cursor: pointer; margin-bottom: 16px;
  background: none; border: none; padding: 0;
}
.channel-detail-back:hover { color: var(--text); }

.analysis-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px;
}
.analysis-block-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-2); margin-bottom: 10px;
}
.analysis-pill {
  display: inline-block; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-size: 12px; padding: 4px 10px;
  border-radius: 100px; margin: 3px;
}
.analysis-pill.gap { border-color: var(--brand-border); color: var(--brand); background: var(--brand-bg); }
.analysis-text { font-size: 13.5px; color: var(--text); line-height: 1.6; }

/* ── THUMBNAIL CHANNEL LIST ──────────────────────────────────────────────── */
.thumb-channel-list { margin-top: 4px; }
.thumb-channel-row {
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; overflow: hidden; background: var(--surface);
  transition: border-color var(--dur);
}
.thumb-channel-row.open { border-color: var(--brand-border); }
.thumb-channel-header {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  cursor: pointer; user-select: none;
}
.thumb-channel-header:hover { background: var(--surface-2); }
.thumb-ch-arrow {
  color: var(--text-3); flex-shrink: 0; margin-left: auto;
  transition: transform .2s;
}
.thumb-channel-expand {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}

/* Thumbnail mini-grid inside expanded channel row */
.thumb-mini-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; margin-top: 12px;
}
@media (min-width: 500px) { .thumb-mini-grid { grid-template-columns: repeat(5, 1fr); } }
.thumb-mini-item {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer; aspect-ratio: 16/9; background: var(--surface-2);
  border: 1px solid var(--border); transition: border-color var(--dur);
}
.thumb-mini-item:hover { border-color: var(--brand-border); }
.thumb-mini-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-mini-views {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
  color: #fff; font-size: 10px; font-weight: 600;
  padding: 12px 4px 3px; text-align: center;
}

/* ── THUMBNAIL GRID ──────────────────────────────────────────────────────── */
.thumbnail-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 8px; margin-top: 8px;
}
@media (min-width: 600px) { .thumbnail-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .thumbnail-grid { grid-template-columns: repeat(4, 1fr); } }

.thumb-item {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer; aspect-ratio: 16/9; background: var(--surface-2);
  border: 1px solid var(--border); transition: border-color var(--dur);
}
.thumb-item:hover { border-color: var(--brand-border); }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-item-title {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  color: #fff; font-size: 10px; padding: 16px 6px 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb-analyzing {
  position: absolute; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
}

/* Thumbnail analysis overlay */
.thumb-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.thumb-overlay-inner {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); max-width: 520px; width: 100%;
  max-height: 85vh; overflow-y: auto; padding: 20px;
}
.thumb-overlay-img { width: 100%; border-radius: var(--radius-sm); margin-bottom: 16px; }
.thumb-overlay-close {
  display: block; margin-top: 16px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text); padding: 10px;
  border-radius: var(--radius-sm); cursor: pointer; width: 100%; font-size: 13.5px;
}
.effectiveness-score {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 22px; font-weight: 800; color: var(--brand);
}
.effectiveness-score small { font-size: 13px; color: var(--text-2); font-weight: 400; }

/* Thumbnail concept cards */
.concept-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 10px;
}
.concept-name { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: var(--brand); }
.concept-row { margin-bottom: 12px; }
.concept-row-label { display: block; font-size: 10px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 3px; }
.concept-row-val { display: block; font-size: 13px; color: var(--text); line-height: 1.6; }
.concept-text-overlay {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 4px;
}
.concept-text-main { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.concept-text-sub { font-size: 12px; color: var(--text-2); margin-top: 3px; }

/* ── ANALYTICS CHAT ──────────────────────────────────────────────────────── */
.chat-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.chat-header-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-bg); border: 1px solid var(--brand-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand); flex-shrink: 0;
}
.chat-header-title { font-size: 14px; font-weight: 600; }
.chat-header-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; }

.chat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border-faint); }
.chat-chip {
  font-size: 12px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 12px; cursor: pointer; transition: all var(--dur);
}
.chat-chip:hover { color: var(--brand); border-color: var(--brand-border); background: var(--brand-bg); }

.chat-messages {
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px; max-height: 420px; overflow-y: auto;
}
.chat-messages:empty { display: none; }

.chat-msg { display: flex; flex-direction: column; max-width: 92%; }
.chat-msg-user { align-self: flex-end; }
.chat-msg-ai   { align-self: flex-start; }
.chat-msg-user .chat-msg-content {
  background: var(--brand-bg); border: 1px solid var(--brand-border);
  border-radius: var(--radius) var(--radius) 2px var(--radius);
  padding: 9px 13px; font-size: 13.5px; color: var(--text); line-height: 1.5;
}
.chat-msg-ai-label {
  font-size: 10px; font-weight: 700; color: var(--brand);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px;
}
.chat-msg-ai .chat-msg-content {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 2px var(--radius) var(--radius) var(--radius);
  padding: 12px 14px; font-size: 13px; line-height: 1.6; color: var(--text);
}
.chat-msg-ai .chat-msg-content h3,
.chat-msg-ai .chat-msg-content h4 { font-size: 13px; font-weight: 700; margin: 8px 0 4px; }
.chat-msg-ai .chat-msg-content p  { margin: 3px 0; }
.chat-msg-ai .chat-msg-content ul { margin: 4px 0; padding-left: 18px; }
.chat-msg-ai .chat-msg-content li { margin: 3px 0; }
.chat-msg-ai .chat-msg-content strong { color: var(--brand); font-weight: 700; }
.chat-msg-ai .chat-msg-content code {
  font-family: monospace; font-size: 12px;
  background: var(--surface-3); padding: 1px 5px; border-radius: 3px;
}
.chat-msg-ai .chat-msg-content br { display: none; }

.chat-table-wrap { overflow-x: auto; margin: 8px 0; }
.chat-table { border-collapse: collapse; font-size: 12px; width: 100%; }
.chat-table th, .chat-table td {
  border: 1px solid var(--border); padding: 5px 10px; text-align: left;
}
.chat-table th { background: var(--surface-3); font-weight: 600; color: var(--text-2); }
.chat-table tr:nth-child(even) td { background: var(--surface-3); }

@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.chat-cursor {
  display: inline-block; width: 2px; height: 14px; background: var(--brand);
  vertical-align: middle; margin-left: 2px; border-radius: 1px;
  animation: blink 1s step-end infinite;
}

.chat-input-row {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.chat-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13.5px;
  color: var(--text); outline: none; transition: border-color var(--dur);
}
.chat-input:focus { border-color: var(--brand-border); }
.chat-input:disabled { opacity: .5; }
.chat-send-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--brand); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--dur); flex-shrink: 0;
}
.chat-send-btn:hover   { background: #16a34a; }
.chat-send-btn:disabled { background: var(--surface-3); color: var(--text-3); cursor: default; }

/* ── Idébank ─────────────────────────────────────────────────────────────── */
.idea-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.idea-card:hover { border-color: var(--brand-border); transform: translateY(-1px); }

.idea-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.idea-card-topic {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
.idea-card-preview {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.idea-card-meta {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .02em;
}
.idea-card-delete {
  flex-shrink: 0;
  padding: 5px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
}
.idea-card-delete:hover { background: var(--error-bg); border-color: var(--error-border); color: var(--error); }

/* Own idea form */
.own-idea-form {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 4px;
}
.own-idea-form input[type="text"],
.own-idea-form textarea {
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 9px 12px;
  resize: none;
  box-sizing: border-box;
  font-family: inherit;
}
.own-idea-form input[type="text"]:focus,
.own-idea-form textarea:focus { outline: none; border-color: var(--brand-border); }

/* Type badge */
.idea-type-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 100px;
  letter-spacing: .03em;
  flex-shrink: 0;
}
.idea-type-own { background: rgba(99,179,237,.12); color: #63b3ed; border: 1px solid rgba(99,179,237,.25); }
.idea-type-ai  { background: var(--brand-bg); color: var(--brand); border: 1px solid var(--brand-border); }

/* Detail view */
.idea-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 20px;
  transition: color .15s;
}
.idea-back-btn:hover { color: var(--brand); }

.idea-detail-header { margin-bottom: 20px; }
.idea-detail-topic  { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.idea-detail-date   { font-size: 12px; color: var(--text-2); }

.idea-detail-title-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin: 8px 0 6px;
}
.idea-detail-why {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

.idea-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 24px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--error-border);
  background: var(--error-bg);
  color: var(--error);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.idea-delete-btn:hover { background: rgba(248,113,113,.2); }

/* ── Date filter bar ─────────────────────────────────────────────────────── */
.date-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.date-chip {
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.date-chip:hover  { border-color: var(--brand); color: var(--brand); }
.date-chip.active { background: var(--brand-bg); border-color: var(--brand-border); color: var(--brand); font-weight: 600; }

.custom-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.date-input {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  color-scheme: dark;
}
.date-sep { color: var(--text-2); font-size: 13px; }

/* ── Expand button ───────────────────────────────────────────────────────── */
.expand-btn {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.expand-btn:hover     { border-color: var(--brand); color: var(--brand); }
.expand-btn.expand-btn-open { color: var(--text-2); }

/* ── Reporting API (Historik) ─────────────────────────────────────────────── */
.reporting-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.reporting-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.reporting-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
  letter-spacing: .03em;
}
.reporting-badge-on  { background: var(--brand-bg); color: var(--brand); border: 1px solid var(--brand-border); }
.reporting-badge-off { background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.reporting-desc {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
  line-height: 1.5;
}
.reporting-jobs { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.reporting-job-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
}
.reporting-job-name  { font-size: 13px; font-weight: 500; color: var(--text); }
.reporting-job-meta  { font-size: 11px; color: var(--text-2); margin-top: 2px; }

/* ── Report modal ──────────────────────────────────────────────────────────── */
.report-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.report-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.report-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.report-modal-title { font-size: 15px; font-weight: 600; }
.report-modal-sub   { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.report-modal-table-wrap { overflow: auto; flex: 1; padding: 16px 20px; }
.report-table { font-size: 11px; }
.report-table th, .report-table td { padding: 6px 10px; white-space: nowrap; }
