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

/* ── VARIABLES ── */
:root {
  --brand: #FF6B35;
  --brand-dark: #E65A2B;
  --brand-light: #FFE8DC;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --sidebar-w: 224px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
}

/* ── AUTH ── */
#authScreen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(135deg, #FF6B35, #E65A2B);
}
.auth-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
}
.auth-nav-brand { display: flex; align-items: center; gap: 8px; color: white; font-weight: 700; font-size: 15px; }
.auth-nav-links { display: flex; gap: 24px; }
.auth-nav-links a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .15s; }
.auth-nav-links a:hover { color: white; }
.auth-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-footer {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 32px; font-size: 12px;
}
.auth-footer a { color: rgba(255,255,255,0.75); text-decoration: none; }
.auth-footer a:hover { color: white; text-decoration: underline; }
.auth-footer span { color: rgba(255,255,255,0.5); }
.auth-footer-copy { margin-left: 8px; color: rgba(255,255,255,0.5); }
.auth-box {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.auth-logo { margin-bottom: 4px; }
.auth-sub  { color: var(--gray-400); font-size: 13px; margin-bottom: 24px; }
.auth-tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; }
.auth-tab  { flex: 1; text-align: center; padding: 9px; cursor: pointer; color: var(--gray-400); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s; }
.auth-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.auth-terms-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.auth-terms-row input[type="checkbox"] { flex-shrink: 0; width: auto !important; margin-top: 3px; accent-color: var(--brand); }
.auth-terms-row label { flex: 1; min-width: 0; font-size: 0.85rem; color: var(--gray-600); cursor: pointer; line-height: 1.4; }
.auth-terms-row label a { color: var(--brand); }

/* ── APP SHELL ── */
#appScreen {
  display: none;
  height: 100vh;
  overflow: hidden;
  flex-direction: column;
}
#appScreen.visible { display: flex; }

/* ── LAYOUT ── */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: #FFFFFF;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--gray-100);
}
.sidebar-logo img { height: 44px; }
.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-600);
  transition: all .15s;
  border: none;
  border-left: 2px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: var(--gray-50); color: var(--gray-800); }
.nav-item.active { 
      color: #000;
    border-left-color: var(--brand);
  background: var(--gray-50);}
.nav-item i { font-size: 17px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-divider { height: 1px; background: var(--gray-100); margin: 6px 10px; }

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--gray-100);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-user-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--gray-600);
  font: inherit;
  text-align: left;
}
.sidebar-user-btn:hover { background: var(--gray-50); }
.sidebar-user-btn .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-user-btn .email {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--gray-600);
}
.signout-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: var(--gray-400);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.signout-btn i { font-size: 16px; }
.signout-btn:hover { color: var(--red); background: var(--gray-50); }

/* ── MAIN ── */
.main-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── VIEWS ── */
.view {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}
.view.active { display: block; }

/* ── VIEW HEADER ── */
.view-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.view-title { font-size: 22px; font-weight: 700; color: var(--gray-800); }
.view-sub { font-size: 13px; color: var(--gray-400); margin-top: 3px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--brand); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-800); border: 1px solid var(--gray-200); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-200); }
.btn-danger    { background: #fee2e2; color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red); color: white; }
.btn-ghost     { background: none; color: var(--brand); padding: 6px 10px; }
.btn-ghost:hover { background: var(--brand-light); }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-xs  { padding: 3px 8px; font-size: 11px; border-radius: 4px; }
.btn-icon { padding: 6px; border-radius: 4px; background: none; border: none; cursor: pointer; color: var(--gray-400); font-size: 16px; transition: all .15s; }
.btn-icon:hover { background: var(--gray-100); color: var(--gray-800); }

/* ── FORMS ── */
.form-group { margin-bottom: 14px; }

/* ── PASSWORD TOGGLE ── */
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-right: 38px !important; }
.pw-toggle { position: absolute; right: 0; top: 0; height: 100%; width: 36px; background: none; border: none; cursor: pointer; color: var(--gray-400); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.pw-toggle:hover { color: var(--gray-800); }

/* ── LINK BUTTON ── */
.link-btn { background:none;border:none;color:var(--brand);cursor:pointer;font-size:0.85rem;padding:0;text-decoration:underline; }
.link-btn:hover { color:var(--brand-dark); }

/* ── ONBOARDING ── */
.onboarding-options { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.onboarding-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--gray-200); cursor: pointer;
  font-size: 0.9rem; transition: border-color 0.15s, background 0.15s;
}
.onboarding-option:hover { border-color: var(--brand); background: var(--brand-light); }
.onboarding-option input[type="radio"] { accent-color: var(--brand); flex-shrink: 0; width: auto !important; }

/* Grouped form sections with visual headings */
.form-section {
  padding: 14px 0 4px;
  border-top: 1px solid var(--gray-100);
  margin-top: 4px;
}
.form-section:first-of-type {
  border-top: none;
  padding-top: 4px;
}
.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin-bottom: 12px;
}
label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-600); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }
input, select, textarea { width: 100%; padding: 9px 12px; border: 1.5px solid var(--gray-200); border-radius: 4px; font-size: 14px; font-family: inherit; transition: border-color .2s; background: white; color: var(--gray-800); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
textarea { resize: vertical; min-height: 90px; }
small { color: var(--gray-400); font-size: 12px; margin-top: 3px; display: block; }

/* ── CARDS ── */
.card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--gray-200); margin-bottom: 16px; overflow: hidden; }
.card-header { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--gray-100); }
.card-header h2 { font-size: 14px; font-weight: 700; }
.card-body { padding: 18px; }

/* ── ALERTS ── */
.alert { padding: 11px 14px; border-radius: 4px; font-size: 13px; margin-bottom: 14px; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error   { background: #fee2e2; color: #991b1b; }
.alert-info    { background: var(--brand-light); color: var(--brand-dark); }
.alert-warn    { background: #fef9c3; color: #854d0e; }

/* ── BADGES ── */
.badge { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge-linkedin  { background: #0077b5; color: white; }
.badge-facebook  { background: #1877f2; color: white; }
.badge-instagram    { background: #e4405f; color: white; }
.badge-github_pages { background: #24292e; color: white; }
.badge-reddit       { background: #ff4500; color: white; }
.badge-x            { background: #000;    color: white; }
.badge-bluesky      { background: #0085ff; color: white; }
.badge-pending   { background: #fef3c7; color: #92400e; }
.badge-published { background: #d1fae5; color: #065f46; }
.badge-failed    { background: #fee2e2; color: #991b1b; }
.badge-cancelled { background: var(--gray-100); color: var(--gray-400); }
.badge-connected { background: #d1fae5; color: #065f46; }
.badge-missing   { background: #fee2e2; color: #991b1b; }

/* ── PROJECT CARD GRID ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.project-card {
  background: #FFFFFF;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.25rem;
  padding-bottom: 2.25rem;
  transition: all .2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}
.project-card:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 20px rgba(255,107,53,.12);
  transform: translateY(-2px);
}
.project-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* 3-dot menu button in top-right */
.project-card-menu-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all .15s ease;
}
.project-card-menu-btn:hover {
  background: #fff;
  border-color: var(--gray-200);
  color: var(--brand);
}

/* Dropdown menu */
.project-card-menu {
  display: none;
  position: absolute;
  top: 44px;
  right: 10px;
  z-index: 10;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 4px;
  min-width: 160px;
}
.project-card-menu.open { display: block; }
.project-card-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  font-size: 13px;
  text-align: left;
  color: var(--gray-700);
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
}
.project-card-menu button:hover { background: var(--gray-100); color: var(--gray-900); }
.project-card-menu button.danger { color: #dc2626; }
.project-card-menu button.danger:hover { background: #fef2f2; color: #b91c1c; }
.project-card-menu button i { font-size: 14px; }

/* Decorative arrow bottom-right — animates on hover */
.project-card-arrow {
  position: absolute;
  bottom: 12px;
  right: 14px;
  color: var(--gray-300);
  font-size: 18px;
  opacity: 0;
  transform: translateX(-4px);
  transition: all .2s ease;
  pointer-events: none;
}
.project-card:hover .project-card-arrow {
  opacity: 1;
  color: var(--brand);
  transform: translateX(0);
}

/* Project logo banner */
.project-logo {
  width: 100%;
  height: 110px;
  background: var(--gray-100);
  border-radius: 4px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.project-logo img { width: 100%; height: 100%; object-fit: cover; }
.project-logo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F0F4F8 0%, #F9FAFB 100%);
  color: var(--gray-400);
  font-size: 36px;
}

.project-card-title { font-size: 15px; font-weight: 600; color: var(--gray-800); margin-bottom: 2px; }
.project-card-meta  { font-size: 12px; color: var(--gray-400); margin-bottom: 10px; }
.platform-badges    { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; margin-bottom: 12px; }

/* Pill-style platform badges on cards */
.badge-pill-linkedin  { background: #E6F1FB; color: #185FA5; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-pill-facebook  { background: #EBF1FB; color: #1877f2; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-pill-instagram { background: #FBE8F0; color: #e4405f; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; }


/* ── PROJECT DETAIL VIEW ── */
.project-detail{    background: #FFFFFF;
    border: 0.5px solid #E5E7EB;
    border-radius: 12px;
    padding: 2rem;}
.detail-back { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); background: none; border: none; cursor: pointer; font-size: 13px; font-weight: 500; padding: 0; margin-bottom: 20px; font-family: inherit; }
.detail-back:hover { opacity: .8; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.detail-title  { font-size: 22px; font-weight: 700; color: var(--gray-800); }
.detail-meta   { font-size: 13px; color: var(--gray-400); margin-top: 3px; margin-bottom: 0; }
.detail-actions { display: flex; gap: 8px; }

/* ── PROJECT TABS ── */
.project-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  margin: 20px 0 0 0;
}
.project-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-600);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  bottom: -1px;
  font-family: inherit;
}
.project-tab:hover { color: var(--gray-800); }
.project-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.project-tab i { font-size: 15px; }

.project-tab-content { display: none; padding-top: 1.5rem; }
.project-tab-content.active { display: block; animation: fadeIn .2s ease-in; }

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

/* ── CONNECTIONS ── */
.connections-row { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.connection-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
}
.connection-chip.connected { border-color: var(--green); background: #f0fdf4; }
.connection-chip i { font-size: 25px; }
.connection-chip-label  { font-weight: 600; font-size: 13px; }
.connection-chip-status { font-size: 11px; color: var(--gray-400); }
.connection-chip.connected .connection-chip-status { color: var(--green); }

/* ── POST ITEMS ── */
.plan-section { margin-bottom: 24px; }
.plan-platform-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--gray-600); }
.plan-platform-line { flex: 1; height: 1px; background: var(--gray-200); }

.post-item { background: white; border: 1.5px solid var(--gray-200); border-radius: 4px; margin-bottom: 7px; overflow: hidden; transition: border-color .15s; }
.post-item:hover { border-color: var(--gray-400); }
.post-item.editing { border-color: var(--brand); }
.post-preview { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; }
.post-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.post-dot.pending   { background: var(--yellow); }
.post-dot.published { background: var(--green); }
.post-dot.failed    { background: var(--red); }
.post-dot.cancelled { background: var(--gray-400); }
.post-thumb { width: 36px; height: 36px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.post-preview-text { flex: 1; font-size: 13px; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-preview-time { font-size: 11px; color: var(--gray-400); white-space: nowrap; flex-shrink: 0; }
.post-cancel-btn { background: none; border: none; cursor: pointer; color: var(--gray-400); padding: 3px; flex-shrink: 0; display: flex; align-items: center; }
.post-cancel-btn:hover { color: var(--red); }
.post-error-msg { padding: 10px 14px; background: #fee; border-top: 1px solid var(--gray-100); font-size: 12px; color: var(--red); font-family: monospace; white-space: pre-wrap; word-break: break-word; }

.post-editor { display: none; padding: 14px; border-top: 1px solid var(--gray-100); background: var(--gray-50); }
.post-item.editing .post-editor { display: block; }
.editor-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.editor-row input[type="datetime-local"] { flex: 1; min-width: 180px; }

.add-post-btn { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 14px; background: none; border: 1.5px dashed var(--gray-200); border-radius: 4px; color: var(--gray-400); font-size: 13px; cursor: pointer; transition: all .15s; font-family: inherit; }
.add-post-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.add-post-form { background: white; border: 1.5px solid var(--brand); border-radius: 4px; padding: 14px; margin-bottom: 8px; }
.add-form-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.add-form-row input[type="datetime-local"] { flex: 1; min-width: 160px; }

.past-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--gray-400); font-size: 13px; padding: 8px 0; border: none; background: none; font-family: inherit; }
.past-toggle:hover { color: var(--gray-600); }
.past-list { display: none; margin-top: 6px; }
.past-list.open { display: block; }

/* ── IMAGE PICKER ── */
.img-picker { margin-top: 10px; }
.img-picker-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--brand); background: none; border: none; cursor: pointer; font-family: inherit; padding: 3px 0; }
.img-picker-toggle:hover { opacity: .8; }
.img-picker-body { margin-top: 8px; background: white; border: 1px solid var(--gray-200); border-radius: 4px; padding: 12px; }
.pexels-search { display: flex; gap: 6px; margin-bottom: 10px; }
.pexels-search input { flex: 1; }
.pexels-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin-bottom: 8px; }
.pexels-photo { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 5px; cursor: pointer; border: 2px solid transparent; transition: border-color .15s; }
.pexels-photo:hover { opacity: .85; }
.pexels-photo.selected { border-color: var(--brand); }
.pexels-credit { font-size: 10px; color: var(--gray-400); text-align: right; margin-bottom: 8px; }
.img-divider { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 11px; color: var(--gray-400); }
.img-divider::before, .img-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }
.img-preview-wrap { position: relative; margin-top: 8px; border-radius: 4px; overflow: hidden; }
.img-preview-wrap img { width: 100%; max-height: 140px; object-fit: cover; display: block; }
.img-remove-btn { position: absolute; top: 5px; right: 5px; background: rgba(0,0,0,.55); color: white; border: none; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; }

/* ── OVERVIEW STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 6px; padding: 16px; }
.stat-label { font-size: 12px; color: var(--gray-400); margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--gray-800); }

/* ── SECTION HEADING ── */
.section-heading { font-size: 14px; font-weight: 600; color: var(--gray-800); margin: 0 0 12px; }

/* ── SCHEDULED VIEW ── */
.sched-project-group { margin-bottom: 24px; }
.sched-project-name { font-size: 14px; font-weight: 700; color: var(--gray-600); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

/* ── INTEGRATIONS ── */
.integration-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 12px; }
.integration-card { border: 1.5px solid var(--gray-200); border-radius: var(--radius); padding: 18px; background: white; transition: border-color .2s; }
.integration-card:hover { border-color: var(--gray-400); }
.integration-icon { font-size: 24px; margin-bottom: 8px; }
.integration-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.integration-desc { font-size: 12px; color: var(--gray-400); margin-bottom: 14px; line-height: 1.5; }
.integration-form { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gray-100); }
.integration-form.open { display: block; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 9px 14px; font-size: 11px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--gray-200); }
td { padding: 11px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.content-preview { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── EMPTY STATE ── */
.empty { text-align: center; padding: 48px; color: var(--gray-400); }
.empty i { font-size: 44px; margin-bottom: 12px; display: block; }
.empty h3 { font-size: 15px; color: var(--gray-600); margin-bottom: 4px; }
.empty p { font-size: 13px; margin-bottom: 16px; }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: 14px; width: 100%; max-width: 500px; box-shadow: 0 20px 60px rgba(0,0,0,.2); max-height: 90vh; overflow-y: auto; }
.modal.modal-wide { max-width: 780px; }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: white; z-index: 1; }
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 8px; }
.close-btn { background: none; border: none; cursor: pointer; color: var(--gray-400); line-height: 1; display: flex; align-items: center; justify-content: center; font-size: 20px; }

/* ── AI SEO PANEL ── */
.aico-block { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 6px; padding: 16px; margin-bottom: 14px; }
.aico-block-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.aico-block-title { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.aico-block-desc { font-size: 12px; color: var(--gray-600); line-height: 1.55; }

/* Visibility score pills */
.visibility-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 12px; }
.visibility-pill { background: white; border: 1px solid var(--gray-200); border-radius: 4px; padding: 12px; text-align: center; }
.visibility-pill-label { font-size: 11px; color: var(--gray-400); margin-bottom: 4px; }
.visibility-pill-score { font-size: 20px; font-weight: 700; color: var(--gray-800); }

/* ── SCHEDULE FILTER BAR ── */
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn { padding: 5px 14px; border-radius: 20px; border: 1.5px solid var(--gray-200); background: white; color: var(--gray-600); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; }
.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-btn.active { background: var(--brand); border-color: var(--brand); color: white; }

/* ── SCHEDULE CARDS (date-grouped view) ── */
.schedule-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.schedule-controls-right { display: flex; align-items: center; gap: 8px; }
.sched-sort-select { padding: 5px 10px; border: 1.5px solid var(--gray-200); border-radius: 4px; font-size: 12px; font-weight: 600; color: var(--gray-600); font-family: inherit; background: white; cursor: pointer; }
.sched-sort-select:focus { outline: none; border-color: var(--brand); }

.schedule-period { margin-bottom: 24px; }
.schedule-period-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.schedule-period-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-600); }
.sched-count { background: var(--gray-100); color: var(--gray-600); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.schedule-period-line { flex: 1; height: 1px; background: var(--gray-200); }

.sched-card { background: white; border: 1px solid var(--gray-200); border-left: 4px solid var(--gray-300); border-radius: 4px; margin-bottom: 8px; overflow: hidden; transition: box-shadow .15s; }
.sched-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.sched-card-main { display: flex; align-items: flex-start; gap: 14px; padding: 13px 16px; cursor: pointer; }
.sched-left { flex-shrink: 0; width: 96px; }
.sched-date { font-size: 11px; font-weight: 700; color: var(--gray-800); background: var(--gray-100); padding: 3px 8px; border-radius: 4px; display: inline-block; margin-bottom: 4px; white-space: nowrap; }
.sched-time { font-size: 12px; color: var(--gray-400); padding-left: 2px; }
.sched-body { flex: 1; min-width: 0; }
.sched-badges { display: flex; gap: 5px; margin-bottom: 5px; flex-wrap: wrap; }
.sched-content { font-size: 13px; color: var(--gray-800); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.sched-thumb { width: 38px; height: 38px; border-radius: 5px; object-fit: cover; margin-top: 4px; display: block; }
.sched-relative { font-size: 11px; color: var(--gray-400); margin-top: 3px; }
.sched-actions { display: flex; gap: 2px; flex-shrink: 0; align-items: flex-start; padding-top: 2px; }
.sched-action-btn { background: none; border: none; font-size: 12px; font-weight: 600; color: var(--gray-400); cursor: pointer; font-family: inherit; padding: 4px 7px; border-radius: 5px; transition: all .12s; }
.sched-action-btn:hover { background: var(--gray-100); color: var(--gray-800); }
.sched-action-btn.danger:hover { background: #fee2e2; color: var(--red); }
.sched-editor { display: none; padding: 14px 16px; border-top: 1px solid var(--gray-100); background: var(--gray-50); }
.sched-card.editing .sched-editor { display: block; }
.sched-card.editing .sched-card-main { border-bottom: none; }

/* ── POST EDIT DRAWER ── */
.post-drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); display: none; z-index: 999; }
.post-drawer-overlay.open { display: block; }
.post-drawer { position: fixed; right: 0; top: 0; height: 100vh; width: 420px; background: white; box-shadow: -2px 0 12px rgba(0,0,0,.15); display: none; flex-direction: column; z-index: 1000; transform: translateX(100%); transition: transform .25s ease-out; }
.post-drawer.open { display: flex; transform: translateX(0); }
@media (max-width: 900px) { .post-drawer { width: 90vw; max-width: 420px; } }

.drawer-header { padding: 18px 20px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.drawer-title { font-size: 16px; font-weight: 700; color: var(--gray-800); }
.drawer-close { background: none; border: none; cursor: pointer; color: var(--gray-400); font-size: 20px; display: flex; align-items: center; justify-content: center; }
.drawer-close:hover { color: var(--gray-800); }

.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-footer { padding: 16px 20px; border-top: 1px solid var(--gray-200); display: flex; gap: 8px; flex-shrink: 0; }
.drawer-footer-btn { flex: 1; }
.drawer-footer-delete { padding: 16px 20px; border-top: 1px solid var(--gray-200); display: flex; gap: 8px; }

.drawer-section { margin-bottom: 18px; }
.drawer-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-600); margin-bottom: 8px; }

.add-post-panel { display: none; }
.add-post-panel.open { display: block; }

/* ── AI SEO SECTIONS ── */
.aico-section { background: white; border: 1px solid var(--gray-200); border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.aico-section.tinted { background: #f0f7ff; border-color: #c7dff7; }
.aico-section-title { font-size: 14px; font-weight: 700; color: var(--gray-800); display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.aico-section-desc { font-size: 12px; color: var(--gray-400); margin-bottom: 14px; line-height: 1.5; }
.aico-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }

/* Model score cards */
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: 10px; margin-top: 4px; }
.model-score-card { background: white; border: 1px solid var(--gray-200); border-radius: 6px; padding: 14px; text-align: center; }
.model-score-name { font-size: 11px; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.model-score-value { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.score-bar-wrap { background: var(--gray-100); border-radius: 4px; height: 5px; overflow: hidden; }
.score-bar { height: 5px; border-radius: 4px; transition: width .4s ease; }
.score-bar.high   { background: var(--green); }
.score-bar.medium { background: var(--yellow); }
.score-bar.low    { background: var(--red); }
.model-score-meta { font-size: 10px; color: var(--gray-400); margin-top: 5px; }

/* Toggle switch */
.toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 4px 0; }
.toggle-text { flex: 1; }
.toggle-label { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.toggle-desc { font-size: 12px; color: var(--gray-400); margin-top: 2px; line-height: 1.4; }
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; margin-top: 1px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--gray-200); border-radius: 24px; transition: .2s; }
.toggle-slider:before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
input:checked + .toggle-slider { background: var(--brand); }
input:checked + .toggle-slider:before { transform: translateX(18px); }

/* ── MISC ── */
.monospace { font-family: 'SF Mono','Fira Code',monospace; font-size: 12px; background: var(--gray-100); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
.divider { height: 1px; background: var(--gray-200); margin: 18px 0; }
.row { display: flex; gap: 14px; }
.row .form-group { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .row { flex-direction: column; gap: 0; }
}
.flash { position: fixed; bottom: 24px; right: 24px; z-index: 9999; padding: 10px 18px; border-radius: 4px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,.15); display: flex; align-items: center; gap: 7px; }
