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

:root {
  --bg:        #f0f4f8;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --text:      #1a202c;
  --muted:     #718096;
  --primary:   #3b82f6;
  --primary-h: #2563eb;
  --danger:    #ef4444;
  --success:   #22c55e;
  --warning:   #f59e0b;
  --radius:    8px;
  --sidebar-w: 200px;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

.hidden { display: none !important; }

/* ── Auth / Login ──────────────────────────────────────────────────────────── */
.screen.center { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }

.auth-card {
  background: white; border-radius: 20px; padding: 40px 36px;
  box-shadow: 0 8px 32px rgba(0,0,0,.1); width: 380px; max-width: 95vw;
}
.auth-logo { font-size: 40px; text-align: center; margin-bottom: 8px; }
.auth-title { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 20px; }
.auth-tabs { display: flex; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 9px; background: white; border: none; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--muted); transition: all .15s; }
.auth-tab.active { background: #6366f1; color: white; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field label { font-size: 12px; font-weight: 600; color: var(--text); }
.auth-field input {
  border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 12px;
  font-size: 14px; outline: none; transition: border-color .15s; font-family: inherit;
}
.auth-field input:focus { border-color: #6366f1; }
.auth-hint { font-weight: 400; color: var(--muted); }
.auth-error { background: #fee2e2; color: #991b1b; border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.auth-submit { width: 100%; padding: 11px; font-size: 14px; margin-top: 4px; }

/* Connect channels screen */
.connect-card {
  background: white; border-radius: 20px; padding: 48px 40px;
  box-shadow: 0 8px 32px rgba(0,0,0,.1); width: 400px; max-width: 95vw;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.connect-icon { font-size: 52px; }
.connect-card h2 { font-size: 22px; font-weight: 800; }
.connect-card p { color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 280px; }
.connect-skip { margin-top: 4px; font-size: 13px; }

.btn-fb { display: flex; align-items: center; justify-content: center; gap: 8px; background: #1877f2; color: white; text-decoration: none; padding: 12px 24px; border-radius: var(--radius); font-weight: 600; font-size: 15px; transition: background .15s; border: none; cursor: pointer; width: 100%; }
.btn-fb:hover { background: #166fe5; }
.btn-fb.btn-sm { font-size: 12px; padding: 7px 12px; width: auto; }

/* ── Layout ────────────────────────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

.sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 0; flex-shrink: 0; }
.sidebar-logo { font-size: 16px; font-weight: 700; padding: 0 16px 20px; color: var(--text); }
.sidebar nav { flex: 1; }
.nav-item { display: block; padding: 10px 16px; color: var(--muted); text-decoration: none; cursor: pointer; transition: background .12s, color .12s; font-size: 13px; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: #eff6ff; color: var(--primary); font-weight: 600; border-left: 3px solid var(--primary); }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.user-info { font-size: 12px; color: var(--muted); margin-bottom: 8px; }

.main { flex: 1; overflow-y: auto; padding: 24px; min-width: 0; }

/* ── Tabs ──────────────────────────────────────────────────────────────────── */
.tab { display: none; }
.tab.active { display: block; }

/* ── Page Header ───────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 20px; }
.page-header h2 { font-size: 20px; font-weight: 700; }
.page-header p { color: var(--muted); margin-top: 4px; font-size: 13px; }

/* ── Create Post Layout ────────────────────────────────────────────────────── */
.create-layout { display: grid; grid-template-columns: 220px 1fr 260px; gap: 16px; align-items: start; }

/* Channel Panel */
.channel-panel { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 12px; }
.channel-search { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; margin-bottom: 12px; outline: none; }
.channel-search:focus { border-color: var(--primary); }
.channel-group { margin-bottom: 12px; }
.channel-group-header { padding: 6px 4px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.ch-check-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ch-check-wrap input { accent-color: var(--primary); }
.channel-list { display: flex; flex-direction: column; gap: 2px; }
.channel-item { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-radius: 6px; cursor: pointer; transition: background .1s; }
.channel-item:hover { background: var(--bg); }
.channel-item input { accent-color: var(--primary); flex-shrink: 0; }
.channel-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #667eea, #764ba2); display: flex; align-items: center; justify-content: center; color: white; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.channel-avatar.fb { background: linear-gradient(135deg, #1877f2, #0a5bc4); }
.channel-avatar.ig { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); }
.channel-name { font-size: 12px; font-weight: 500; line-height: 1.3; }
.channel-sub  { font-size: 11px; color: var(--muted); }

/* Form Panel */
.form-panel { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.post-type-tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--bg); }
.type-tab { flex: 1; padding: 10px 4px; background: none; border: none; border-bottom: 2px solid transparent; font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer; transition: all .15s; text-align: center; }
.type-tab:hover { color: var(--text); background: var(--surface); }
.type-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--surface); font-weight: 600; }
.form-body { padding: 16px; }
.form-section { margin-bottom: 16px; }
.form-label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.form-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; color: var(--text); outline: none; transition: border-color .15s; background: white; }
.form-input:focus { border-color: var(--primary); }
textarea.form-input { resize: vertical; line-height: 1.5; }
select.form-input { cursor: pointer; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.media-upload-row { display: flex; gap: 8px; margin-bottom: 8px; }
.url-input { flex: 1; }
.notice-box { background: #fef3c7; border: 1px solid #fcd34d; border-radius: var(--radius); padding: 10px 12px; font-size: 12px; color: #92400e; line-height: 1.5; margin-bottom: 8px; }

/* Emoji */
.emoji-btn { background: none; border: none; cursor: pointer; font-size: 16px; padding: 0 4px; vertical-align: middle; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.emoji-picker span { font-size: 20px; cursor: pointer; padding: 4px; border-radius: 4px; transition: background .1s; }
.emoji-picker span:hover { background: var(--bg); }

/* Toggle */
.toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 20px; cursor: pointer; transition: background .2s; }
.toggle-slider::before { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: transform .2s; }
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle-label { font-size: 13px; font-weight: 500; }

/* Input with suffix */
.input-suffix-wrap { display: flex; align-items: center; }
.input-suffix-wrap .form-input { border-radius: var(--radius) 0 0 var(--radius); }
.input-suffix { padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-left: none; border-radius: 0 var(--radius) var(--radius) 0; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Selected media row */
.selected-media-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.selected-thumb { position: relative; width: 64px; height: 64px; border-radius: 6px; overflow: hidden; border: 2px solid var(--primary); flex-shrink: 0; }
.selected-thumb img { width: 100%; height: 100%; object-fit: cover; }
.selected-thumb .rm-btn { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.6); color: white; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }

/* Submit */
.btn-wide { width: 100%; padding: 12px; font-size: 14px; }

/* Preview Panel */
.preview-panel { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 14px; }
.preview-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.preview-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.preview-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.preview-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.preview-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #667eea, #764ba2); flex-shrink: 0; }
.preview-name { font-size: 13px; font-weight: 600; }
.preview-time { font-size: 11px; color: var(--muted); }
.preview-media { aspect-ratio: 1; background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.preview-media img { width: 100%; height: 100%; object-fit: cover; }
.preview-placeholder { color: var(--muted); font-size: 12px; text-align: center; padding: 20px; }
.preview-caption-text { padding: 10px 12px; font-size: 12px; line-height: 1.5; color: var(--text); min-height: 36px; word-break: break-word; }
.preview-actions { display: flex; gap: 16px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius); border: 1px solid transparent; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-h); border-color: var(--primary-h); }
.btn-outline { background: white; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }

/* ── Dashboard ──────────────────────────────────────────────────────────────── */
.dash-ch-hd { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 10px; }
.dash-ch-hd h3 { margin: 0; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-num { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.page-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.page-card h4 { font-size: 14px; margin-bottom: 4px; }
.page-card p { font-size: 12px; color: var(--muted); }

/* ── Media Grid ─────────────────────────────────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.media-item { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color .15s; background: var(--bg); }
.media-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-item.selected { border-color: var(--primary); }
.media-item .sel-badge { position: absolute; top: 4px; right: 4px; background: var(--primary); color: white; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; display: none; align-items: center; justify-content: center; font-weight: 700; }
.media-item.selected .sel-badge { display: flex; }
.media-item .video-badge { position: absolute; bottom: 4px; left: 4px; background: rgba(0,0,0,.6); color: white; padding: 2px 5px; border-radius: 4px; font-size: 10px; }

/* ── Upload Zone ────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px; text-align: center; cursor: pointer; transition: border-color .15s; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); }
.upload-icon { font-size: 40px; margin-bottom: 12px; }
.upload-zone p { color: var(--muted); margin-bottom: 4px; }
.hint { font-size: 12px; color: var(--muted); }
.link { color: var(--primary); cursor: pointer; text-decoration: underline; }
#upload-preview { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
#upload-preview img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius); }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: var(--primary); width: 0; transition: width .2s; }

/* ── Posts page ─────────────────────────────────────────────────────────────── */
.posts-hd { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.posts-hd h2 { font-size: 20px; font-weight: 800; }
.posts-hd-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.posts-hd-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Channel filter chips */
.cal-ch-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-ch-chip { padding: 5px 12px; border-radius: 20px; border: 1.5px solid var(--border); background: white; font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer; transition: all .15s; display: flex; align-items: center; gap: 5px; }
.cal-ch-chip:hover { border-color: #a5b4fc; color: #6366f1; }
.cal-ch-chip.active { background: linear-gradient(135deg,#6366f1,#3b82f6); color: white; border-color: transparent; box-shadow: 0 2px 8px rgba(99,102,241,.3); }
.cal-ch-chip .ch-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }

/* View toggle */
.view-toggle { display: flex; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; }
.view-btn { padding: 6px 12px; background: white; border: none; font-size: 14px; cursor: pointer; color: var(--muted); transition: all .15s; }
.view-btn.active { background: #6366f1; color: white; }
.view-btn:hover:not(.active) { background: var(--bg); }

/* ── Calendar ────────────────────────────────────────────────────────────────── */
.cal-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 16px; }
.cal-nav-btn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border); background: white; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text); transition: all .15s; }
.cal-nav-btn:hover { background: #6366f1; color: white; border-color: #6366f1; }
.cal-nav-label { font-size: 17px; font-weight: 700; min-width: 160px; text-align: center; }
.cal-dow { display: grid; grid-template-columns: repeat(7,1fr); margin-bottom: 4px; }
.cal-dow span { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 0; }

/* Calendar grid */
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.cal-day { min-height: 90px; background: white; border-radius: 10px; border: 1.5px solid var(--border); padding: 8px 6px 6px; cursor: pointer; transition: border-color .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 3px; }
.cal-day:hover { border-color: #a5b4fc; box-shadow: 0 2px 8px rgba(99,102,241,.1); }
.cal-day.today { border-color: #6366f1; background: #f5f3ff; }
.cal-day.today .cal-day-num { background: #6366f1; color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.cal-day.other-month { background: var(--bg); opacity: .5; }
.cal-day.selected { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.cal-day-num { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 3px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.cal-chips { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: hidden; }
.cal-chip { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-chip.scheduled  { background: #dbeafe; color: #1d4ed8; }
.cal-chip.publishing { background: #fef3c7; color: #92400e; }
.cal-chip.published  { background: #dcfce7; color: #15803d; }
.cal-chip.failed     { background: #fee2e2; color: #991b1b; }
.cal-more { font-size: 10px; color: var(--muted); font-weight: 600; padding: 1px 4px; }

/* Day detail panel */
.cal-detail { background: white; border-radius: 14px; border: 1.5px solid #c7d2fe; padding: 16px; margin-top: 16px; box-shadow: 0 4px 20px rgba(99,102,241,.1); }
.cal-detail-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-detail-hd span { font-size: 15px; font-weight: 700; color: #6366f1; }
.cal-detail-close { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.cal-detail-close:hover { background: var(--bg); }
#cal-detail-posts { display: flex; flex-direction: column; gap: 8px; }

/* ── Posts List ─────────────────────────────────────────────────────────────── */
.list-filter-row { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-btn { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: white; color: var(--muted); font-size: 12px; cursor: pointer; transition: all .15s; }
.filter-btn.active, .filter-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.posts-list { display: flex; flex-direction: column; gap: 10px; }
.post-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 14px; align-items: flex-start; }
.post-thumb { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.post-thumb-placeholder { width: 56px; height: 56px; border-radius: 6px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.post-body { flex: 1; min-width: 0; }
.post-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.post-caption { font-size: 13px; color: var(--text); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-info { font-size: 11px; color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-scheduled  { background: #dbeafe; color: #1d4ed8; }
.badge-publishing { background: #fef3c7; color: #92400e; }
.badge-published  { background: #dcfce7; color: #15803d; }
.badge-failed     { background: #fee2e2; color: #991b1b; }
.badge-fb   { background: #e8f0fe; color: #1565c0; }
.badge-ig   { background: #fce4ec; color: #ad1457; }
.badge-type { background: var(--bg); color: var(--muted); }
.post-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: flex-start; }

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.modal-box { position: relative; background: var(--surface); border-radius: 12px; width: 700px; max-width: 95vw; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal-hint { padding: 8px 20px; font-size: 12px; color: var(--muted); background: var(--bg); }
#modal-media-grid { padding: 16px 20px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

/* ── Toast ──────────────────────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; right: 24px; background: #1a202c; color: white; padding: 12px 20px; border-radius: var(--radius); font-size: 13px; z-index: 2000; box-shadow: 0 4px 12px rgba(0,0,0,.2); max-width: 320px; animation: slideUp .2s ease; }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

h3 { font-size: 16px; margin: 16px 0 10px; }

/* ═══════════════════════════════════════════════════════════════════════════
   CREATE POST — full redesign
═══════════════════════════════════════════════════════════════════════════ */

/* Hero bar */
.cp-hero { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.cp-hero-text h2 { font-size: 22px; font-weight: 800; background: linear-gradient(135deg, #6366f1, #3b82f6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.cp-hero-text p  { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cp-preview-btn  { display: none; padding: 8px 14px; border-radius: 20px; border: 1px solid var(--border); background: white; font-size: 13px; cursor: pointer; }

/* Layout */
.cp-layout { display: grid; grid-template-columns: 230px 1fr 270px; gap: 16px; align-items: start; }

/* ── Channels sidebar ─────────────────────────────────────────────────────── */
.cp-channels { background: var(--surface); border-radius: 14px; border: 1px solid var(--border); padding: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.cp-section-label { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.cp-sel-count { background: linear-gradient(135deg, #6366f1, #3b82f6); color: white; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 700; }
.cp-search { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 20px; font-size: 12px; outline: none; background: var(--bg); margin-bottom: 14px; transition: border-color .15s; }
.cp-search:focus { border-color: #6366f1; background: white; }

.cp-ch-group { margin-bottom: 14px; }
.cp-ch-group-hd { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer; padding: 4px 0; margin-bottom: 6px; }
.cp-ch-group-hd input { accent-color: #6366f1; }
.cp-platform-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 4px; font-size: 10px; font-weight: 900; color: white; flex-shrink: 0; }
.cp-platform-badge.fb { background: #1877f2; }
.cp-platform-badge.ig { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); font-size: 8px; }
.cp-ch-list { display: flex; flex-direction: column; gap: 2px; padding-left: 2px; }

/* Channel item */
.cp-ch-item { display: flex; align-items: center; gap: 9px; padding: 8px 8px; border-radius: 10px; cursor: pointer; transition: background .12s; border: 1.5px solid transparent; }
.cp-ch-item:hover { background: var(--bg); }
.cp-ch-item.active { background: #f0f4ff; border-color: #c7d2fe; }
.cp-ch-item input { accent-color: #6366f1; flex-shrink: 0; width: 15px; height: 15px; }
.cp-ch-avatar { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.cp-ch-avatar.fb { background: linear-gradient(135deg, #1877f2, #0d5fcb); }
.cp-ch-avatar.ig { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); }
.cp-ch-name { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.3; }
.cp-ch-sub  { font-size: 10px; color: var(--muted); }

/* ── Form ─────────────────────────────────────────────────────────────────── */
.cp-form { display: flex; flex-direction: column; gap: 12px; }

/* Post type pills */
.cp-type-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.cp-type-row .type-tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 12px; border: 1.5px solid var(--border); background: white; font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .15s; }
.cp-type-row .type-tab span:first-child { font-size: 20px; }
.cp-type-row .type-tab:hover { border-color: #a5b4fc; background: #f5f3ff; color: #6366f1; }
.cp-type-row .type-tab.active { border-color: #6366f1; background: linear-gradient(135deg, #6366f1, #3b82f6); color: white; box-shadow: 0 4px 12px rgba(99,102,241,.3); }
.cp-type-row .type-tab.active span:first-child { filter: none; }

/* Cards */
.cp-card { background: white; border-radius: 14px; border: 1px solid var(--border); padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.04); transition: box-shadow .15s; }
.cp-card:focus-within { box-shadow: 0 0 0 3px rgba(99,102,241,.1), 0 1px 4px rgba(0,0,0,.04); border-color: #c7d2fe; }
.cp-card-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }

/* Inputs */
.cp-input { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 13px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; background: white; }
.cp-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.cp-textarea { resize: vertical; min-height: 110px; line-height: 1.6; font-family: inherit; }
select.cp-input { cursor: pointer; }

/* Media picker */
.cp-media-row { display: flex; gap: 8px; margin-bottom: 10px; }
.cp-media-row .cp-input { flex: 1; }
.cp-pick-btn { padding: 10px 16px; border-radius: 10px; border: 1.5px solid #6366f1; background: white; color: #6366f1; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .15s; }
.cp-pick-btn:hover { background: #6366f1; color: white; }
.cp-notice { background: #fefce8; border: 1px solid #fde047; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #713f12; margin-bottom: 10px; }
.cp-sel-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.cp-sel-thumb { position: relative; width: 68px; height: 68px; border-radius: 10px; overflow: hidden; border: 2px solid #6366f1; flex-shrink: 0; box-shadow: 0 2px 8px rgba(99,102,241,.2); }
.cp-sel-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-sel-thumb .rm-btn { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.65); color: white; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 9px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Caption */
.cp-caption-wrap { position: relative; }
.cp-caption-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.cp-emoji-btn { background: none; border: none; font-size: 18px; cursor: pointer; padding: 2px; border-radius: 6px; transition: transform .15s; }
.cp-emoji-btn:hover { transform: scale(1.2); }
.cp-char-count { font-size: 11px; color: var(--muted); }
.cp-char-count.warn { color: var(--warning); font-weight: 600; }
.cp-char-count.over { color: var(--danger); font-weight: 600; }
.cp-emoji-picker { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; background: white; border: 1px solid var(--border); border-radius: 12px; margin-top: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.cp-emoji-picker span { font-size: 22px; cursor: pointer; padding: 4px; border-radius: 6px; transition: transform .1s, background .1s; }
.cp-emoji-picker span:hover { background: var(--bg); transform: scale(1.2); }

/* Post now row */
.cp-now-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.cp-now-label { font-size: 14px; font-weight: 600; color: var(--text); }
.cp-now-hint   { font-size: 12px; color: var(--muted); margin-left: 2px; }
.cp-schedule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.cp-field-label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }

/* Repeat */
.cp-suffix-wrap { display: flex; }
.cp-suffix-wrap .cp-input { border-radius: 10px 0 0 10px; }
.cp-suffix { display: flex; align-items: center; padding: 0 12px; background: var(--bg); border: 1.5px solid var(--border); border-left: none; border-radius: 0 10px 10px 0; font-size: 13px; font-weight: 700; color: var(--muted); }

/* Submit button */
.cp-submit { width: 100%; padding: 15px; border: none; border-radius: 14px; background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%); color: white; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: all .2s; box-shadow: 0 4px 15px rgba(99,102,241,.35); letter-spacing: .02em; }
.cp-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,.45); }
.cp-submit:active { transform: translateY(0); }
.cp-submit:disabled { opacity: .65; transform: none; cursor: not-allowed; }
.cp-submit-icon { font-size: 18px; }

/* ── Preview panel ────────────────────────────────────────────────────────── */
.cp-preview { display: flex; flex-direction: column; gap: 12px; }
.cp-preview-head { display: flex; align-items: center; justify-content: space-between; }

/* Platform toggle */
.cp-plat-switch { display: flex; border: 1.5px solid var(--border); border-radius: 20px; overflow: hidden; cursor: pointer; }
.cp-plat-switch input { display: none; }
.cp-plat-opt { padding: 4px 14px; font-size: 12px; font-weight: 600; color: var(--muted); transition: all .15s; }
.cp-plat-switch input:not(:checked) ~ .cp-plat-opt[data-val="ig"] { background: #6366f1; color: white; border-radius: 18px 0 0 18px; }
.cp-plat-switch input:checked ~ .cp-plat-opt[data-val="fb"] { background: #1877f2; color: white; border-radius: 0 18px 18px 0; }

/* Mock phone frame */
.cp-mock { background: white; border-radius: 18px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.cp-mock-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #f1f5f9; }
.cp-mock-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.cp-mock-avatar.ig { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); }
.cp-mock-avatar.fb { background: linear-gradient(135deg, #1877f2, #0d5fcb); }
.cp-mock-info { flex: 1; font-size: 12px; font-weight: 600; }
.cp-mock-info span { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.cp-mock-more { color: var(--muted); font-size: 16px; cursor: pointer; }
.cp-mock-img { aspect-ratio: 1; background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cp-mock-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-mock-placeholder { font-size: 12px; color: var(--muted); text-align: center; }
.cp-mock-actions { display: flex; align-items: center; gap: 14px; padding: 10px 14px; font-size: 18px; }
.cp-mock-caption { padding: 4px 14px 14px; font-size: 12px; line-height: 1.5; }
.cp-mock-caption-text { color: var(--text); word-break: break-word; white-space: pre-wrap; }
.cp-mock-fb-actions { display: flex; gap: 0; border-top: 1px solid var(--border); }
.cp-mock-fb-actions span { flex: 1; text-align: center; padding: 10px 4px; font-size: 12px; color: var(--muted); font-weight: 600; border-right: 1px solid var(--border); cursor: pointer; }
.cp-mock-fb-actions span:last-child { border-right: none; }

/* Mobile overlay */
.cp-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; }
.cp-overlay-box { background: white; border-radius: 20px 20px 0 0; padding: 20px; width: 100%; max-height: 90vh; overflow-y: auto; }
.cp-overlay-close { float: right; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .cp-layout { grid-template-columns: 200px 1fr; }
  .cp-preview { display: none; }
  .cp-preview-btn { display: flex; align-items: center; gap: 6px; }
}

@media (max-width: 720px) {
  .cp-layout { grid-template-columns: 1fr; gap: 12px; }
  .cp-hero { flex-wrap: wrap; gap: 8px; }

  /* Channels become horizontal scroll chips */
  .cp-channels { padding: 12px; }
  .cp-ch-group-hd { font-size: 11px; }
  .cp-ch-list { flex-direction: row; flex-wrap: wrap; gap: 6px; padding-left: 0; }
  .cp-ch-item { flex-direction: column; gap: 4px; padding: 8px 10px; width: auto; text-align: center; border-radius: 12px; min-width: 70px; }
  .cp-ch-item input { display: none; }
  .cp-ch-avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 15px; }
  .cp-ch-name { font-size: 10px; }
  .cp-ch-sub  { display: none; }

  /* Type pills full row */
  .cp-type-row { grid-template-columns: repeat(4,1fr); gap: 6px; }
  .cp-type-row .type-tab { padding: 10px 4px; font-size: 10px; }
  .cp-type-row .type-tab span:first-child { font-size: 18px; }

  /* Schedule grid stack */
  .cp-schedule-grid { grid-template-columns: 1fr; }

  /* Submit sticky */
  .cp-submit { position: sticky; bottom: 12px; z-index: 10; box-shadow: 0 8px 24px rgba(99,102,241,.4); }
}

/* ── Comments Page ─────────────────────────────────────────────────────────── */
.cm-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - 80px);
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
}

/* Left panel */
.cm-left { border-right: 1.5px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.cm-left-hd { padding: 18px 16px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.cm-left-hd h2 { font-size: 16px; font-weight: 800; }
.cm-count { font-size: 12px; color: var(--muted); margin-top: 3px; }
.cm-ch-filter { display: flex; gap: 5px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.cm-ch-chip { padding: 4px 10px; border-radius: 20px; border: 1.5px solid var(--border); background: white; font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .15s; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.cm-ch-chip:hover { border-color: #a5b4fc; color: #6366f1; }
.cm-ch-chip.active { background: linear-gradient(135deg,#6366f1,#3b82f6); color: white; border-color: transparent; }
.cm-ch-chip .ch-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cm-posts-list { overflow-y: auto; flex: 1; }

.cm-post-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.cm-post-item:hover { background: #f8f9ff; }
.cm-post-item.active { background: #eef0ff; border-left: 3px solid #6366f1; padding-left: 11px; }
.cm-post-icon { width: 42px; height: 42px; border-radius: 8px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; overflow: hidden; }
.cm-post-icon img { width: 100%; height: 100%; object-fit: cover; }
.cm-post-info { flex: 1; min-width: 0; }
.cm-post-cap { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-post-badges { display: flex; gap: 5px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.cm-post-date { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Right panel */
.cm-right { display: flex; flex-direction: column; overflow: hidden; }
.cm-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); text-align: center; padding: 40px; }
.cm-empty-icon { font-size: 52px; }
.cm-empty p { font-size: 13px; line-height: 1.6; }

.cm-thread { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.cm-thread-hd {
  padding: 14px 18px;
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: #fafbff;
}
.cm-thread-hd-icon { font-size: 22px; }
.cm-thread-hd-info { flex: 1; min-width: 0; }
.cm-thread-hd-cap { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-thread-hd-meta { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; align-items: center; }
.cm-thread-hd-link { font-size: 11px; color: #6366f1; text-decoration: none; font-weight: 600; }
.cm-thread-hd-link:hover { text-decoration: underline; }
.cm-reload-btn { background: none; border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; color: var(--muted); transition: all .15s; flex-shrink: 0; }
.cm-reload-btn:hover { border-color: #6366f1; color: #6366f1; }

.cm-comments-list { overflow-y: auto; flex: 1; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.cm-loading { display: flex; align-items: center; justify-content: center; padding: 48px; color: var(--muted); font-size: 13px; gap: 8px; }

/* Comment card */
.cm-comment {
  background: #f8f9ff;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid #e8ecff;
}
.cm-comment-hd { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.cm-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg,#6366f1,#3b82f6);
  color: white; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cm-comment-from { font-size: 13px; font-weight: 600; }
.cm-comment-time { font-size: 11px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.cm-comment-msg { font-size: 13px; line-height: 1.55; margin-bottom: 10px; color: var(--text); }
.cm-comment-footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cm-like { font-size: 12px; color: var(--muted); }
.cm-btn {
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: 6px; border: 1.5px solid var(--border);
  background: white; cursor: pointer; color: var(--muted);
  transition: all .15s;
}
.cm-btn:hover { border-color: #6366f1; color: #6366f1; background: #f5f3ff; }
.cm-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: #fff5f5; }
.cm-btn.hide-btn.hidden-active { background: #fef3c7; color: #92400e; border-color: #fbbf24; }

/* Replies section */
.cm-replies { margin-top: 10px; padding-top: 10px; border-top: 1px solid #dde3ff; display: flex; flex-direction: column; gap: 8px; }
.cm-reply { display: flex; gap: 8px; align-items: flex-start; }
.cm-reply-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg,#f59e0b,#ef4444);
  color: white; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cm-reply-body { flex: 1; background: white; border-radius: 8px; padding: 8px 10px; border: 1px solid var(--border); }
.cm-reply-hd { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.cm-reply-from { font-size: 12px; font-weight: 600; }
.cm-reply-time { font-size: 10px; color: var(--muted); margin-left: auto; }
.cm-reply-msg { font-size: 12px; color: var(--text); line-height: 1.5; }
.cm-reply-del { font-size: 11px; color: var(--muted); border: none; background: none; cursor: pointer; padding: 2px 4px; margin-top: 4px; display: block; }
.cm-reply-del:hover { color: var(--danger); }

/* Inline reply form */
.cm-reply-form { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #dde3ff; }
.cm-reply-input {
  flex: 1; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 7px 12px; font-size: 12px; resize: none; height: 36px;
  line-height: 20px; outline: none; font-family: inherit;
  transition: border-color .15s;
}
.cm-reply-input:focus { border-color: #6366f1; }
.cm-send-btn {
  background: #6366f1; color: white; border: none; border-radius: 8px;
  padding: 0 14px; font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .15s; height: 36px;
}
.cm-send-btn:hover { background: #4f46e5; }
.cm-send-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Empty comments state */
.cm-no-comments { text-align: center; padding: 48px 24px; color: var(--muted); font-size: 13px; }
.cm-no-comments-icon { font-size: 40px; margin-bottom: 12px; }

@media (max-width: 768px) {
  .cm-layout { grid-template-columns: 1fr; height: auto; }
  .cm-left { max-height: 280px; border-right: none; border-bottom: 1.5px solid var(--border); }
  .cm-thread { min-height: 400px; }
}

/* ── API Docs ────────────────────────────────────────────────────────────────── */
.api-hero { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.api-hero h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.api-hero-sub { font-size: 13px; color: var(--muted); }
.api-base-url { background: #1a202c; border-radius: 10px; padding: 10px 16px; display: flex; flex-direction: column; gap: 3px; }
.api-base-label { font-size: 10px; font-weight: 700; color: #718096; text-transform: uppercase; letter-spacing: .06em; }
.api-base-url code { font-size: 13px; color: #68d391; font-family: 'Courier New', monospace; }

/* Group filter */
.api-groups { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.api-group-btn { padding: 7px 16px; border-radius: 20px; border: 1.5px solid var(--border); background: white; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .15s; }
.api-group-btn:hover { border-color: #a5b4fc; color: #6366f1; }
.api-group-btn.active { background: #6366f1; color: white; border-color: #6366f1; }

/* Section header */
.api-section { margin-bottom: 28px; }
.api-section-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.api-section-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.api-section-title { font-size: 15px; font-weight: 800; }
.api-section-count { font-size: 11px; color: var(--muted); background: var(--bg); padding: 2px 8px; border-radius: 12px; }

/* Endpoint card */
.api-card { background: white; border: 1.5px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; transition: box-shadow .15s; }
.api-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.api-card-hd { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; user-select: none; }
.api-card-hd:hover { background: #fafbff; }
.method-badge { padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 800; font-family: monospace; letter-spacing: .04em; flex-shrink: 0; }
.method-GET    { background: #dcfce7; color: #15803d; }
.method-POST   { background: #dbeafe; color: #1d4ed8; }
.method-DELETE { background: #fee2e2; color: #991b1b; }
.api-path { font-family: 'Courier New', monospace; font-size: 13px; font-weight: 600; color: #1a202c; flex: 1; }
.api-desc-short { font-size: 12px; color: var(--muted); display: none; }
.api-card-hd .api-auth { font-size: 10px; background: #fef9c3; color: #854d0e; padding: 2px 7px; border-radius: 10px; font-weight: 600; flex-shrink: 0; }
.api-expand-icon { font-size: 12px; color: var(--muted); flex-shrink: 0; transition: transform .2s; }
.api-card.open .api-expand-icon { transform: rotate(180deg); }

/* Endpoint body */
.api-card-body { border-top: 1px solid var(--border); background: #fafbff; padding: 16px; display: none; flex-direction: column; gap: 14px; }
.api-card.open .api-card-body { display: flex; }
.api-desc-full { font-size: 13px; color: #4a5568; line-height: 1.6; }

/* Why section */
.api-why { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 10px 14px; font-size: 12px; color: #92400e; line-height: 1.6; }
.api-why strong { font-weight: 700; display: block; margin-bottom: 3px; }

/* Params / body fields */
.api-fields-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.api-fields { display: flex; flex-direction: column; gap: 8px; }
.api-field-row { display: flex; align-items: center; gap: 8px; }
.api-field-name { font-size: 12px; font-weight: 600; font-family: monospace; color: #6366f1; min-width: 120px; flex-shrink: 0; }
.api-field-required { font-size: 10px; color: #ef4444; margin-left: 2px; }
.api-input { flex: 1; border: 1.5px solid var(--border); border-radius: 7px; padding: 7px 10px; font-size: 12px; outline: none; font-family: inherit; transition: border-color .15s; background: white; }
.api-input:focus { border-color: #6366f1; }
.api-textarea { resize: vertical; font-family: 'Courier New', monospace; font-size: 11px; line-height: 1.5; min-height: 72px; }
.api-select { flex: 1; border: 1.5px solid var(--border); border-radius: 7px; padding: 7px 10px; font-size: 12px; outline: none; background: white; cursor: pointer; }
.api-field-block { align-items: flex-start !important; }
.api-field-hint { font-size: 11px; color: var(--muted); background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 6px; padding: 6px 10px; white-space: pre; font-family: inherit; line-height: 1.6; }

/* Try it button + response */
.api-try-row { display: flex; align-items: center; gap: 10px; }
.api-try-btn { background: linear-gradient(135deg,#6366f1,#3b82f6); color: white; border: none; border-radius: 8px; padding: 9px 20px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.api-try-btn:hover { opacity: .88; }
.api-try-btn:disabled { opacity: .5; cursor: not-allowed; }
.api-status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 6px; }
.api-status.ok  { background: #dcfce7; color: #15803d; }
.api-status.err { background: #fee2e2; color: #991b1b; }
.api-response { background: #1a202c; border-radius: 10px; padding: 14px 16px; overflow-x: auto; }
.api-response pre { font-size: 12px; color: #e2e8f0; font-family: 'Courier New', monospace; white-space: pre-wrap; word-break: break-all; margin: 0; line-height: 1.6; }
.api-response pre .json-key    { color: #90cdf4; }
.api-response pre .json-str    { color: #68d391; }
.api-response pre .json-num    { color: #f6ad55; }
.api-response pre .json-bool   { color: #fc8181; }
.api-response pre .json-null   { color: #a0aec0; }

