/* ─── CIDATUM Community Manager — Main Stylesheet ─────────────────────────── */

:root {
  --bg: #0d0d16;
  --bg-card: #131321;
  --bg-card-hover: #181828;
  --bg-elevated: #1c1c2e;
  --bg-input: #11111e;
  --border: #242438;
  --border-hover: #30304c;
  --accent: #e91e8c;
  --accent-dim: rgba(233, 30, 140, 0.10);
  --accent-glow: rgba(233, 30, 140, 0.22);
  --text-primary: #eaeaf5;
  --text-secondary: #9090b0;
  --text-muted: #4e4e70;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --blue: #3b82f6;
  --sidebar-width: 260px;
  --header-height: 56px;
  --avatar-bg: #000000;
}

/* Light mode overrides */
body.light-mode {
  --bg: #f5f5fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f8fe;
  --bg-elevated: #ededf5;
  --bg-input: #f0f0f8;
  --border: #dddde8;
  --border-hover: #c5c5d8;
  --text-primary: #111122;
  --text-secondary: #555570;
  --text-muted: #aaaacc;
  --avatar-bg: #ffffff;
}

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

html {
  font-size: 14px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ─── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 2px;
}

/* ─── Typography ──────────────────────────────────────────────────────────── */
.font-mono {
  font-family: 'IBM Plex Mono', monospace;
}

.text-accent {
  color: var(--accent);
}

.text-muted {
  color: var(--text-secondary);
}

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

/* ─── Header ──────────────────────────────────────────────────────────────── */
header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background 0.15s;
}

.header-brand:hover {
  background: var(--bg-elevated);
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text .name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.divider-v {
  width: 1px;
  height: 20px;
  background: var(--border);
}

/* Platform tabs */
.platform-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 18px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.1px;
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.tab-btn.disabled {
  opacity: 0.5;
  cursor: default;
}

.tab-btn .badge-soon {
  font-size: 9px;
  font-weight: 700;
  background: var(--border);
  color: var(--text-muted);
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Header right */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 6px 12px 6px 34px;
  width: 200px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--accent);
}

.search-box .search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: 16px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.icon-btn .material-symbols-outlined {
  font-size: 18px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  border: 2px solid var(--border);
}

/* ─── Body layout ─────────────────────────────────────────────────────────── */
.body-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  transition: width 0.25s ease;
  overflow: visible;
}

.sidebar-top {
  padding: 16px;
}

.btn-new-draft {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-new-draft:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-new-draft .material-symbols-outlined {
  font-size: 18px;
}

.sidebar-section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0 12px;
  margin: 16px 0 6px;
}

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}

.sidebar-item:hover {
  background: var(--bg-elevated);
}

.sidebar-item.active {
  background: var(--accent-dim);
  border-color: rgba(233, 30, 140, 0.2);
}

.sidebar-item .material-symbols-outlined {
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sidebar-item.active .material-symbols-outlined {
  color: var(--accent);
}

.sidebar-item-info {
  flex: 1;
  min-width: 0;
}

.sidebar-item-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item-meta {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.sidebar-item-time {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sidebar-folder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: color 0.15s;
}

.sidebar-folder:hover {
  color: var(--text-primary);
}

.sidebar-folder .material-symbols-outlined {
  font-size: 16px;
}

.sidebar-bottom {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.credits-box {
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.credits-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}

.credits-icon .material-symbols-outlined {
  font-size: 16px;
  color: var(--accent);
}

.credits-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}

.credits-bar {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
}

.credits-bar-fill {
  height: 100%;
  width: 75%;
  background: var(--accent);
  border-radius: 2px;
}

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

/* ─── Welcome screen ──────────────────────────────────────────────────────── */
#view-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px;
}

.welcome-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(233, 30, 140, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.welcome-logo img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.welcome-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.welcome-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.welcome-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: all 0.2s;
}

.welcome-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.welcome-btn .material-symbols-outlined {
  font-size: 20px;
}

/* ─── Drafts view ─────────────────────────────────────────────────────────── */
#view-drafts {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drafts-header {
  padding: 20px 24px 0;
  flex-shrink: 0;
}

.drafts-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.drafts-title .material-symbols-outlined {
  color: var(--accent);
  font-size: 22px;
}

.drafts-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ─── Post cards grid ─────────────────────────────────────────────────────── */
.cards-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 32px 48px 120px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 1200px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cards-scroll {
    padding: 24px 32px 120px;
  }
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.25s;
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 0 24px rgba(233, 30, 140, 0.35);
}

.post-card.card--selected {
  border: 2px solid #e91e8c;
  box-shadow: 0 0 24px rgba(233, 30, 140, 0.35);
}

/* LinkedIn cards — clean hover without glow */
.post-card.li-card:hover {
  border-color: var(--linkedin);
  box-shadow: none;
  transform: translateY(-3px);
}

.post-card.li-card.card--selected {
  border-color: var(--linkedin);
  box-shadow: none;
}

.card-accent-bar {
  height: 2px;
  background: var(--border);
  flex-shrink: 0;
}

.post-card.best-match .card-accent-bar {
  background: var(--accent);
}

.card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tweet-profile {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tweet-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--avatar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.tweet-avatar img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.tweet-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.tweet-handle {
  font-size: 11px;
  color: var(--text-secondary);
}

.variant-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-best {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(233, 30, 140, 0.3);
}

.badge-professional {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-concise {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.card-content {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  margin-bottom: 12px;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
}

.card-content .hashtag {
  color: var(--accent);
}

.card-content .post-link,
.li-paragraph .post-link {
  color: #1d9bf0;
  text-decoration: none;
  word-break: break-all;
}
.card-content .post-link:hover,
.li-paragraph .post-link:hover {
  text-decoration: underline;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border-radius: 7px;
}

.char-counter {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.char-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.char-dot.green {
  background: var(--green);
}

.char-dot.yellow {
  background: var(--yellow);
}

.char-dot.red {
  background: var(--red);
}

.char-dot.blue {
  background: var(--blue);
}

.char-text {
  color: var(--text-secondary);
}

.char-ok {
  color: var(--green);
}

.char-warn {
  color: var(--yellow);
}

.char-over {
  color: var(--red);
}

.style-notes {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  text-align: right;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-media {
  margin: 12px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  aspect-ratio: 16 / 9;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-media-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.btn-media-edit {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  backdrop-filter: blur(4px);
  z-index: 10;
}

.btn-media-edit:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.8);
}

.card-media:hover .btn-media-edit {
  opacity: 1;
}

.btn-media-edit .material-symbols-outlined {
  font-size: 18px;
}

.card-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: auto;
}

.btn-select {
  flex: 1;
  padding: 8px;
  border-radius: 7px;
  border: 1px solid var(--border-hover);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-select:hover {
  background: var(--border-hover);
}

.post-card.card--selected .btn-select {
  background: var(--accent);
  color: white;
  border: none;
}

.post-card.card--selected .btn-select:hover {
  opacity: 0.85;
}

.btn-icon-action {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon-action:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.btn-icon-action .material-symbols-outlined {
  font-size: 16px;
}

/* ─── Loading skeleton ────────────────────────────────────────────────────── */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skel {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--border) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Fade-in suave al renderizar las cards reales */
.post-card {
  animation: card-in 0.2s ease-out both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card:nth-child(2) {
  animation-delay: 0.05s;
}

.post-card:nth-child(3) {
  animation-delay: 0.10s;
}

/* ─── AI Chat bar ─────────────────────────────────────────────────────────── */
.ai-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 860px;
  z-index: 50;
}

.ai-bar-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(12px);
}

.ai-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid var(--border);
  padding-right: 12px;
  flex-shrink: 0;
}

.ai-bar-label .material-symbols-outlined {
  font-size: 20px;
  color: var(--accent);
}

.ai-bar-label-text {
  display: flex;
  flex-direction: column;
}

.ai-bar-label-text .ai-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ai-bar-label-text .ai-model {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}

.ai-quick-btns {
  display: flex;
  gap: 6px;
}

.ai-quick-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.ai-quick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.ai-quick-btn .material-symbols-outlined {
  font-size: 13px;
}

.ai-divider-v {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.ai-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
}

.ai-input::placeholder {
  color: var(--text-muted);
}

.ai-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: none;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.ai-send-btn:hover {
  opacity: 0.85;
}

.ai-send-btn .material-symbols-outlined {
  font-size: 18px;
}

.ai-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Schedule panel ──────────────────────────────────────────────────────── */
#view-schedule {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px;
  gap: 20px;
}

/* ─── Schedule v2 ────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.schedule-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.schedule-back-btn:hover {
  color: var(--text-primary);
}

.schedule-back-btn .material-symbols-outlined {
  font-size: 18px;
}

#view-schedule {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.schedule-v2-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Sidebar izquierdo ── */
.schedule-v2-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
}

.schedule-v2-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.schedule-v2-heading {
  margin-top: 14px;
}

.schedule-v2-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.schedule-v2-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.schedule-v2-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Mode options ── */
.schedule-mode-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-mode-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  background: var(--bg);
}

.schedule-mode-option:hover {
  border-color: var(--border-hover);
}

.schedule-mode-option--active {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent);
}

.schedule-mode-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.schedule-mode-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.schedule-mode-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.schedule-mode-icon {
  font-size: 20px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.schedule-mode-option--active .schedule-mode-icon {
  color: var(--accent);
}

/* ── Calendar ── */
.schedule-calendar-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-month-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.cal-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.cal-nav-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.cal-nav-btn .material-symbols-outlined {
  font-size: 16px;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 3px 0;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  text-align: center;
  padding: 6px 0;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.1s, color 0.1s;
}

.cal-day:hover:not(.cal-day--past):not(.cal-day--empty) {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.cal-day--empty {
  cursor: default;
}

.cal-day--past {
  color: var(--text-muted);
  cursor: default;
  opacity: 0.35;
}

.cal-day--today {
  color: var(--accent);
  font-weight: 700;
}

.cal-day--selected {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 700;
  border-radius: 50%;
}

.cal-time-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.cal-field-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cal-time-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  transition: border-color 0.2s;
}

.cal-time-input-wrap:focus-within {
  border-color: var(--accent);
}

.cal-time-input-wrap .material-symbols-outlined {
  font-size: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.cal-time-input {
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'IBM Plex Mono', monospace;
  width: 100%;
}

/* ── Status ── */
.schedule-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: 8px;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.pending {
  background: var(--yellow);
}

.status-dot.scheduled {
  background: var(--green);
}

.status-dot.error {
  background: var(--red);
}

/* ── CTA ── */
.schedule-v2-cta {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-card);
}

.btn-schedule-v2 {
  width: 100%;
  padding: 13px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s;
}

.btn-schedule-v2:hover {
  opacity: 0.85;
}

.btn-schedule-v2:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-schedule-v2 .material-symbols-outlined {
  font-size: 16px;
}

.schedule-v2-note {
  margin-top: 10px;
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  font-family: 'IBM Plex Mono', monospace;
}

.schedule-v2-note code {
  color: var(--accent);
  font-size: inherit;
}

/* ── Preview area ── */
.schedule-v2-preview-area {
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 40px;
  background: var(--bg);
}

.schedule-v2-preview-inner {
  width: 100%;
  max-width: 560px;
}

.schedule-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.schedule-preview-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.preview-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.schedule-char-badge {
  font-size: 10px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
}

/* ── Tweet browser frame ── */
.tweet-browser-frame {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}

.tweet-browser-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 50px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.tweet-browser-logo {
  color: var(--text-primary);
  flex-shrink: 0;
}

.tweet-browser-tabs {
  display: flex;
  gap: 28px;
  font-size: 13px;
  font-weight: 700;
}

.tweet-browser-tab {
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 0;
}

.tweet-browser-tab--active {
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent);
}

.tweet-browser-body {
  padding: 20px 24px;
}

.tweet-browser-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

.btn-schedule-edit-content {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.btn-schedule-edit-content:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-schedule-edit-content .material-symbols-outlined {
  font-size: 14px;
}

@media (max-width: 900px) {
  .schedule-v2-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow-y: auto;
  }

  .schedule-v2-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

/* ─── Modal / Wizard ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  transform: scale(0.96) translateY(8px);
  transition: transform 0.25s;
}

.modal-overlay.visible .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.modal-close .material-symbols-outlined {
  font-size: 16px;
}

/* Wizard stepper */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 24px;
  flex-shrink: 0;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s;
}

.wizard-step.active .step-num,
.wizard-step.done .step-num {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.wizard-step.done .step-num::after {
  content: '✓';
}

.step-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.2s;
}

.wizard-step.active .step-label {
  color: var(--text-primary);
}

.step-connector {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 8px;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px;
}

.wizard-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 8px;
}

.wizard-panel.active {
  display: flex;
}

/* Form elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-label .req {
  color: var(--accent);
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 9px 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
}

.form-select {
  cursor: pointer;
  appearance: none;
  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='%238888aa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.form-textarea {
  resize: vertical;
  min-height: 72px;
}

.form-select option {
  background: #1a1a25;
}

body.light-mode .form-select option {
  background: #ffffff;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Chips */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 42px;
  align-items: center;
  cursor: text;
}

.chips-container:focus-within {
  border-color: var(--accent);
}

.chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--accent-dim);
  border: 1px solid rgba(233, 30, 140, 0.3);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
}

.chip-remove {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  line-height: 1;
  font-size: 13px;
  padding: 0;
  display: flex;
  opacity: 0.7;
}

.chip-remove:hover {
  opacity: 1;
}

.chip-input {
  flex: 1;
  min-width: 80px;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
}

/* Toggle */
.form-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.toggle {
  width: 40px;
  height: 22px;
  background: var(--border-hover);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.toggle.on {
  background: var(--accent);
}

.toggle-thumb {
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.toggle.on .toggle-thumb {
  transform: translateX(18px);
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.drop-zone .material-symbols-outlined {
  font-size: 28px;
  margin-bottom: 6px;
  display: block;
}

.drop-zone-text {
  font-size: 12px;
}

.drop-zone input[type="file"] {
  display: none;
}

/* Modal footer */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-back,
.btn-next {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-back:hover,
.btn-next:hover {
  border-color: var(--border-hover);
}

.btn-next-primary {
  border: none;
  background: var(--accent);
  color: white;
  box-shadow: 0 3px 12px var(--accent-glow);
}

.btn-next-primary:hover {
  opacity: 0.9;
}

.btn-next .material-symbols-outlined,
.btn-back .material-symbols-outlined {
  font-size: 16px;
}

/* Generating spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Inline edit ─────────────────────────────────────────────────────────── */
.inline-edit {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  padding: 8px 10px;
  resize: vertical;
  outline: none;
  min-height: 80px;
}

/* ─── Toast notifications ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 13px;
  max-width: 320px;
  pointer-events: all;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.3);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.3);
}

.toast .material-symbols-outlined {
  font-size: 18px;
  flex-shrink: 0;
}

.toast.success .material-symbols-outlined {
  color: var(--green);
}

.toast.error .material-symbols-outlined {
  color: var(--red);
}

.toast-msg {
  color: var(--text-primary);
  flex: 1;
}

/* ─── Utility ─────────────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

#media-upload-section:not(.hidden) {
  display: flex;
}

.loading-dots::after {
  content: '...';
  animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {

  0%,
  33% {
    content: '.';
  }

  34%,
  66% {
    content: '..';
  }

  67%,
  100% {
    content: '...';
  }
}

/* ─── Sidebar toggle ──────────────────────────────────────────────────────── */
.sidebar-toggle {
  position: absolute;
  right: -13px;
  top: 68px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
  flex-shrink: 0;
  line-height: 1;
}

.sidebar-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Sidebar collapsed ───────────────────────────────────────────────────── */
.sidebar.collapsed {
  width: 48px;
}

.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-item-info,
.sidebar.collapsed .sidebar-item-time,
.sidebar.collapsed .history-actions,
.sidebar.collapsed .btn-label,
.sidebar.collapsed .collection-label,
.sidebar.collapsed .collection-count,
.sidebar.collapsed .collection-chevron,
.sidebar.collapsed .collection-platform-label,
.sidebar.collapsed .collection-accordion-body,
.sidebar.collapsed .sidebar-plat-badges,
.sidebar.collapsed .credits-label,
.sidebar.collapsed .credits-bar {
  display: none;
}

.sidebar.collapsed .collection-accordion-header {
  justify-content: center;
  padding: 7px;
}

.sidebar.collapsed .sidebar-top {
  padding: 8px;
}

.sidebar.collapsed .btn-new-draft {
  padding: 10px;
  justify-content: center;
}

.sidebar.collapsed .sidebar-list {
  padding: 0 4px;
}

.sidebar.collapsed .sidebar-item {
  padding: 8px;
  justify-content: center;
}

.sidebar.collapsed .sidebar-bottom {
  padding: 8px;
}

.sidebar.collapsed .credits-box {
  justify-content: center;
}

/* ─── Tweet preview date & stats ─────────────────────────────────────────── */
.tweet-date {
  font-size: 11px;
  color: var(--text-secondary);
}

.tweet-stats {
  display: flex;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── History items ───────────────────────────────────────────────────────── */
.history-item {
  position: relative;
}

.history-actions {
  display: none;
  gap: 2px;
  flex-shrink: 0;
}

.history-item:hover .history-actions {
  display: flex;
}

.history-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: color 0.15s;
}

.history-btn:hover {
  color: var(--text-primary);
}

/* ─── Collections ─────────────────────────────────────────────────────────── */
.collection-item {
  border-radius: 8px;
  overflow: hidden;
}

.collection-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: color 0.15s;
  user-select: none;
}

.collection-header:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.collection-header .material-symbols-outlined {
  font-size: 16px;
  flex-shrink: 0;
}

.collection-label {
  flex: 1;
}

.collection-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 1px 5px;
  border-radius: 4px;
}

.collection-chevron {
  font-size: 16px !important;
  transition: transform 0.2s;
}

.collection-tweets {
  padding: 4px 8px 8px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.collection-tweet {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  transition: background 0.15s;
}

.collection-tweet:hover {
  background: var(--bg-elevated);
}

.collection-tweet-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collection-tweet-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 0 2px;
  flex-shrink: 0;
}

.collection-tweet:hover .collection-tweet-delete {
  opacity: 0.6;
}

.collection-tweet-delete:hover {
  opacity: 1 !important;
}

.collection-add-btn {
  margin-top: 4px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px dashed var(--border);
  background: none;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.collection-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.collection-add-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.collection-add-textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  padding: 7px 9px;
  resize: vertical;
  outline: none;
  width: 100%;
}

.collection-add-actions {
  display: flex;
  gap: 6px;
}

.collection-save-btn,
.collection-cancel-btn {
  flex: 1;
  padding: 5px 8px;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.collection-save-btn {
  background: var(--accent);
  color: white;
  border: none;
}

.collection-save-btn:hover {
  opacity: 0.9;
}

.collection-cancel-btn {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.collection-cancel-btn:hover {
  border-color: var(--border-hover);
}

/* ─── Media preview en cards ──────────────────────────────────────────────── */
.card-media {
  margin: 0 0 12px;
  border-radius: 10px;
  overflow: hidden;
}

.card-media-el {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* ─── Media preview en wizard ─────────────────────────────────────────────── */
.media-preview-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

.media-preview-el {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.media-preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.media-preview-remove:hover {
  background: var(--red);
}

/* ─── Sidebar footer "Impulsado por Claude" ───────────────────────────────── */
.powered-by {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
}

body.light-mode .powered-by {
  color: rgba(0, 0, 0, 0.3);
}

.powered-by svg {
  flex-shrink: 0;
  opacity: 0.5;
}

.powered-by strong {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
}

body.light-mode .powered-by strong {
  color: rgba(0, 0, 0, 0.45);
}

.sidebar.collapsed .powered-by span {
  display: none;
}

/* ─── History inline rename input ────────────────────────────────────────── */
.history-rename-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 5px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  padding: 2px 6px;
  outline: none;
}

.history-confirm-text {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.history-confirm-yes {
  color: var(--red) !important;
}

.history-confirm-no {
  color: var(--text-muted) !important;
}

/* ─── History delete confirmation modal ──────────────────────────────────── */
.history-delete-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.history-delete-modal-overlay.visible {
  opacity: 1;
}
.history-delete-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 28px 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  transform: scale(0.95);
  transition: transform 0.18s ease;
}
.history-delete-modal-overlay.visible .history-delete-modal {
  transform: scale(1);
}
.history-delete-modal-icon {
  font-size: 0;
  margin-bottom: 14px;
}
.history-delete-modal-icon .material-symbols-outlined {
  font-size: 40px;
  color: #ef4444;
}
.history-delete-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.history-delete-modal-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 24px;
}
.history-delete-modal-text strong {
  color: var(--text-primary);
}
.history-delete-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn-delete-cancel {
  flex: 1;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-delete-cancel:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.btn-delete-confirm {
  flex: 1;
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.15s;
}
.btn-delete-confirm .material-symbols-outlined {
  font-size: 16px;
}
.btn-delete-confirm:hover {
  background: #dc2626;
}

/* ─── Auth — login screen ─────────────────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(233, 30, 140, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.login-logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.login-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: all 0.2s;
  width: 100%;
}

.login-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.login-domain-note {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--red);
  width: 100%;
  text-align: left;
}

/* ─── Auth — user in header ───────────────────────────────────────────────── */
.user-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.user-display-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ─── Inline edit — contenteditable ───────────────────────────────────────── */
.editable-content {
  cursor: default;
  border-radius: 6px;
  transition: border 0.15s;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  border: none;
  padding: 0;
}

.editable-content.editing {
  cursor: text;
  border: 1.5px dashed var(--accent);
  padding: 6px 8px;
  background: var(--bg-input);
}

.inline-edit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.btn-edit-save {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}

.btn-edit-cancel {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.btn-edit-save:hover {
  opacity: 0.85;
}

.btn-edit-cancel:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.inline-save-indicator {
  font-size: 11px;
  color: var(--green);
  font-family: 'IBM Plex Mono', monospace;
}

/* ─── Regenerar — botón y popover ─────────────────────────────────────────── */
.btn-regenerate {
  color: var(--text-secondary);
}

.btn-regenerate:hover {
  color: var(--accent);
}

.regenerate-popover {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  padding: 12px;
  margin-top: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.15s ease;
}

.regen-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 8px 10px;
  resize: none;
  outline: none;
}

.regen-textarea:focus {
  border-color: var(--accent);
}

.regen-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-regen-confirm {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}

.btn-regen-cancel {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

.btn-regen-confirm:hover {
  opacity: 0.85;
}

.btn-regen-cancel:hover {
  border-color: var(--border-hover);
}

/* ─── Media en cards — overlay y zona vacía ───────────────────────────────── */
.card-media {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
}

.card-media-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.2s;
}

.post-card.card--editing .card-media-overlay {
  opacity: 1;
}

.btn-media-action {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s;
}

.btn-media-action:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-media-remove {
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-media-remove:hover {
  background: rgba(239, 68, 68, 0.3);
}

.card-media-empty {
  margin: 10px 0;
}

.btn-add-media {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 1.5px dashed var(--border-hover);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 10px;
  cursor: pointer;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}

.btn-add-media:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Panel secundario de colecciones ─────────────────────────────────────── */
.collection-panel {
  position: fixed;
  top: var(--header-height);
  left: var(--sidebar-width);
  bottom: 0;
  width: 420px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

.collection-panel.panel--visible {
  transform: translateX(0);
  opacity: 1;
}

.collection-panel.panel--hidden {
  transform: translateX(-100%);
  opacity: 0;
}

.collection-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-collection-back {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.btn-collection-back:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.collection-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.collection-panel-search {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.collection-search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
  font-family: 'DM Sans', sans-serif;
}

.collection-search-input:focus {
  border-color: var(--accent);
}

.collection-panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
}

.collection-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px 0;
  text-align: center;
}

.collection-panel-footer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  flex-shrink: 0;
}

.btn-add-ref-tweet {
  background: var(--accent-dim);
  border: 1px dashed var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}

.btn-add-ref-tweet:hover {
  background: var(--accent-glow);
}

/* Card de tweet de referencia en el panel */
.collection-ref-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.collection-ref-card:hover {
  border-color: var(--border-hover);
}

.collection-ref-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.collection-ref-handle {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  flex: 1;
}

.collection-ref-actions {
  display: flex;
  gap: 4px;
}

.btn-ref-edit,
.btn-ref-delete {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
}

.btn-ref-edit:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-ref-delete:hover {
  color: var(--red);
  background: rgba(239, 68, 68, 0.1);
}

.collection-ref-content {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.collection-ref-edit-form {
  margin-top: 8px;
}

.collection-ref-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 10px;
  resize: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
}

/* ─── Tweet media — imagen completa sin recorte ───────────────────────────── */
.tweet-media {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  margin: 8px 0;
  background: #000;
}

.tweet-media img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  display: block;
  border-radius: 12px;
}

.tweet-media video {
  width: 100%;
  height: auto;
  max-height: 400px;
  display: block;
  border-radius: 12px;
}

.tweet-media-inner {
  width: 100%;
  height: auto;
  display: block;
}

/* Wrapper para posicionar overlay encima del tweet-media */
.card-media {
  position: relative;
}

.card-media .card-media-overlay {
  position: absolute;
  inset: 0;
  border-radius: 12px;
}

/* ─── Sidebar — colección sin expand inline (solo botón) ──────────────────── */
.collection-header {
  cursor: pointer;
}

.collection-chevron {
  font-size: 18px;
  color: var(--text-muted);
}

/* ─── Toast — animación de salida ─────────────────────────────────────────── */
.toast {
  transition: opacity 0.3s, transform 0.3s;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .schedule-layout {
    grid-template-columns: 1fr;
  }

  .search-box {
    display: none;
  }

  .ai-bar-label {
    display: none;
  }

  .ai-quick-btns {
    display: none;
  }

  .collection-panel {
    left: 0;
    width: 100%;
  }
}

/* ─── LinkedIn variables ──────────────────────────────────────────────────── */
:root {
  --linkedin: #0A66C2;
  --linkedin-dim: rgba(10, 102, 194, 0.1);
  --linkedin-hover: rgba(10, 102, 194, 0.18);
}

/* ─── Tab indicator: has-content dot ─────────────────────────────────────── */
.tab-btn--has-content {
  position: relative;
}

.tab-btn--has-content::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* ─── Wizard platform selector ────────────────────────────────────────────── */
.wizard-platform-selector {
  display: flex;
  gap: 8px;
}

.platform-select-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 8px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.platform-select-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.platform-select-btn.active[data-platforms="twitter"] {
  border-color: var(--text-secondary);
  color: var(--text-primary);
  background: var(--bg-card);
}

.platform-select-btn.active[data-platforms="linkedin"] {
  border-color: var(--linkedin);
  color: var(--linkedin);
  background: var(--linkedin-dim);
}

.platform-select-btn.active[data-platforms="both"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ─── LinkedIn card ───────────────────────────────────────────────────────── */
.li-accent-bar {
  background: var(--linkedin) !important;
}

.li-profile {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.li-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--linkedin-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}

.li-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.li-profile-info {
  flex: 1;
  min-width: 0;
}

.li-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.25;
}

.li-headline {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.li-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* LinkedIn content with paragraph formatting */
.li-content {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-primary);
  margin: 12px 0 8px;
  cursor: default;
  border: none;
  padding: 0;
  white-space: normal;
}

.li-content .li-paragraph {
  margin: 0 0 10px;
}

.li-content .li-paragraph:last-child {
  margin-bottom: 0;
}

.li-content.editing {
  cursor: text;
  border: 1.5px solid var(--linkedin);
  border-radius: 8px;
  padding: 10px;
  background: var(--bg-elevated);
  outline: none;
  white-space: pre-wrap;
}

/* Cosmetic engagement bar */
.li-engagement-bar {
  padding: 6px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 10px 0 4px;
}

.li-reactions-count {
  display: flex;
  align-items: center;
  gap: 2px;
}

.li-reaction-emoji {
  font-size: 14px;
}

.li-reactions-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 5px;
}

/* LinkedIn action bar (cosmetic, non-interactive) */
.li-action-bar {
  display: flex;
  gap: 0;
  margin: 4px 0 10px;
}

.li-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 4px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: default;
  pointer-events: none;
}

/* LinkedIn select button uses LinkedIn blue */
.li-btn-select {
  background: var(--linkedin) !important;
  border-color: var(--linkedin) !important;
}

.li-btn-select:hover {
  background: #0958a8 !important;
  border-color: #0958a8 !important;
}

body.light-mode .li-btn-select {
  color: #fff !important;
}

/* ─── Not-generated state ────────────────────────────────────────────────── */
.not-generated-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 40px;
  text-align: center;
  grid-column: 1 / -1;
}

.not-generated-icon {
  opacity: 0.2;
  color: var(--text-primary);
}

.not-generated-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.not-generated-desc {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.55;
}

.btn-generate-platform {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 4px;
}

.btn-generate-platform:hover {
  opacity: 0.85;
}

.btn-generate-platform:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* --- PUBLICATIONS HUB --- */

.btn-publications {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 8px;
}

.btn-publications:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-publications.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}

.btn-publications .material-symbols-outlined {
  font-size: 17px;
}

.pub-count-badge {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.pub-count-badge.hidden {
  display: none;
}

#view-publications {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.pub-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 28px 32px 0;
  flex-shrink: 0;
}

.pub-hub-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.pub-hub-title .material-symbols-outlined {
  color: var(--accent);
  font-size: 22px;
}

.pub-hub-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.pub-platform-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 4px;
}

.pub-filter-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.pub-filter-btn:hover {
  color: var(--text-primary);
}

.pub-filter-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
}

.pub-bulk-bar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 32px;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.pub-bulk-bar--visible {
  display: flex;
}

.pub-bulk-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.pub-bulk-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pub-bulk-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.pub-bulk-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pub-bulk-btn--success:hover {
  border-color: #4caf50;
  color: #4caf50;
}

.pub-bulk-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.pub-bulk-btn--ghost:hover {
  color: var(--text-primary);
  border-color: var(--border);
}

.pub-bulk-btn .material-symbols-outlined {
  font-size: 15px;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 16px 32px 32px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  align-items: start;
}

.kanban-col {
  background: var(--bg-elevated);
  border-radius: 14px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  overflow: hidden;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.kanban-col-icon {
  font-size: 16px;
}

.kanban-col-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 1;
}

.kanban-col-count {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
}

.kanban-col-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.kanban-empty {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0;
  opacity: 0.6;
}

.pub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: default;
  transition: border-color 0.15s;
}

.pub-card:hover {
  border-color: var(--border-hover);
}

.pub-card--selected {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-card));
}

.pub-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pub-checkbox-wrap {
  display: flex;
  align-items: center;
}

.pub-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.pub-platform-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.pub-platform-badge--twitter {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
}

.pub-platform-badge--linkedin {
  background: color-mix(in srgb, #0A66C2 15%, transparent);
  color: #5b9bd5;
}

.pub-card-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pub-action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 3px 5px;
  border-radius: 6px;
  opacity: 0.6;
  transition: all 0.15s;
  line-height: 1;
}

.pub-action-btn:hover {
  opacity: 1;
  background: var(--bg-elevated);
}

.pub-card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pub-card-content {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pub-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pub-meta-item {
  font-size: 10px;
  color: var(--text-muted);
}

.pub-category {
  background: var(--bg-elevated);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 500;
}

.pub-meta-date {
  margin-left: auto;
}

.pub-card-media {
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
}

.pub-card-media img {
  width: 100%;
  max-height: 80px;
  object-fit: cover;
  display: block;
}

.pub-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.pub-dialog--open {
  display: flex;
}

.pub-dialog-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.pub-dialog-box {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  width: 340px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.pub-dialog-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.pub-dialog-header .material-symbols-outlined {
  color: var(--accent);
  font-size: 20px;
}

.pub-dialog-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.pub-dialog-body {
  margin-bottom: 20px;
}

.pub-dialog-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pub-datetime-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  box-sizing: border-box;
}

.pub-datetime-input:focus {
  outline: none;
  border-color: var(--accent);
}

.pub-dialog-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.pub-dialog-cancel {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.pub-dialog-cancel:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.pub-dialog-confirm {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.pub-dialog-confirm:hover {
  opacity: 0.85;
}

.pub-dialog-confirm .material-symbols-outlined {
  font-size: 15px;
}

body.light-mode .kanban-col {
  background: var(--bg-elevated);
}

body.light-mode .pub-card {
  background: #fff;
}

body.light-mode .pub-dialog-box {
  background: #fff;
}

body.light-mode .pub-datetime-input {
  background: #f5f5f5;
}


/* --- DRAG & DROP + SCHEDULE MODE TOGGLE --- */

/* Draggable cards */
.pub-card[draggable="true"] {
  cursor: grab;
}

.pub-card[draggable="true"]:active {
  cursor: grabbing;
}

.pub-card--dragging {
  opacity: 0.35;
  transform: scale(0.97);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Drag handle icon */
.pub-drag-handle {
  font-size: 14px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s;
  cursor: grab;
  padding: 0 2px;
  line-height: 1;
}

.pub-card:hover .pub-drag-handle {
  opacity: 0.5;
}

.pub-drag-handle:hover {
  opacity: 1 !important;
}

/* Drop target highlight */
.kanban-col-body.kanban-drop-target {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
  border-radius: 10px;
  min-height: 60px;
}

.kanban-col-body.kanban-drop-forbidden {
  background: rgba(255, 60, 60, 0.05);
  outline: 2px dashed rgba(255, 80, 80, 0.25);
  outline-offset: -4px;
  border-radius: 10px;
}

/* Column hint text */
.kanban-col-hint {
  font-size: 10px;
  color: var(--text-muted);
  padding: 4px 16px 8px;
  opacity: 0.6;
  text-align: center;
}

/* Schedule mode toggle (inside dialog) */
.pub-schedule-mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.pub-schedule-mode-toggle.hidden {
  display: none;
}

.pub-schedule-mode-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.15s;
  user-select: none;
}

.pub-schedule-mode-opt:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.pub-schedule-mode-opt--active,
.pub-schedule-mode-opt:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.pub-schedule-mode-opt input {
  display: none;
}

.pub-schedule-mode-opt .material-symbols-outlined {
  font-size: 15px;
}

/* Unschedule button style */
.pub-unschedule-btn {
  font-size: 16px !important;
}

/* ─── Platform tabs — estado deshabilitado (publicaciones/dashboard) ──────── */
.tab-btn--disabled,
.tab-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}

/* ─── Sidebar — botón Inicio ─────────────────────────────────────────────── */
.btn-dashboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  position: relative;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 4px;
}

.btn-dashboard:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-dashboard.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}

.btn-dashboard .material-symbols-outlined {
  font-size: 17px;
  flex-shrink: 0;
}

/* ─── Dashboard view ─────────────────────────────────────────────────────── */
#view-dashboard {
  padding: 32px 40px;
  overflow-y: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

#view-dashboard.hidden {
  display: none;
}

.dashboard-header {}

.dashboard-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.dashboard-title .material-symbols-outlined {
  font-size: 24px;
  color: var(--accent);
}

.dashboard-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Stats grid */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s, transform 0.1s;
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.stat-card--skeleton {
  min-height: 84px;
  position: relative;
  overflow: hidden;
}

.stat-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--bg-elevated) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon .material-symbols-outlined {
  font-size: 22px;
}

.stat-card--blue .stat-icon {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.stat-card--yellow .stat-icon {
  background: rgba(234, 179, 8, 0.12);
  color: #eab308;
}

.stat-card--accent .stat-icon {
  background: var(--accent-dim);
  color: var(--accent);
}

.stat-card--green .stat-icon {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.stat-body {}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Dashboard section */
.dashboard-section {}

.dashboard-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dashboard-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.dashboard-section-title .material-symbols-outlined {
  font-size: 18px;
  color: var(--text-secondary);
}

.btn-dash-new {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-glow);
  border-radius: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-dash-new:hover {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

.btn-dash-new .material-symbols-outlined {
  font-size: 15px;
}

.dashboard-recent-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.dash-recent-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.dash-recent-icon {
  font-size: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.dash-recent-info {
  flex: 1;
  min-width: 0;
}

.dash-recent-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-recent-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.dashboard-empty {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 16px;
  text-align: center;
}

.dashboard-empty-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  font-size: 13px;
}

/* ─── Collections — acordeón plataforma ──────────────────────────────────── */
.collection-accordion {
  margin-bottom: 4px;
}

.collection-accordion-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}

.collection-accordion-header:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.collection-platform-icon {
  display: flex;
  align-items: center;
}

.collection-platform-label {
  flex: 1;
}

.collection-accordion-header .collection-chevron {
  font-size: 16px;
  transition: transform 0.2s;
}

.collection-accordion-header .collection-chevron.open {
  transform: rotate(0deg);
}

.collection-accordion-header .collection-chevron:not(.open) {
  transform: rotate(-90deg);
}

.collection-accordion-body {
  padding-left: 4px;
}

.collection-accordion-body.hidden {
  display: none;
}

/* Platform pill en collection panel */
.collection-platform-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.collection-platform-pill--twitter {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.collection-platform-pill--linkedin {
  background: rgba(10, 102, 194, 0.15);
  color: #0A66C2;
}

body.light-mode .collection-platform-pill--linkedin {
  background: rgba(10, 102, 194, 0.1);
}

/* ─── Sidebar buttons — centrado y collapsed ─────────────────────────────── */
.btn-dashboard,
.btn-publications {
  justify-content: center;
}

/* En collapsed: solo icono */
.sidebar.collapsed .btn-dashboard,
.sidebar.collapsed .btn-publications {
  padding: 10px;
  justify-content: center;
  margin-top: 4px;
  margin-bottom: 4px;
}

.sidebar.collapsed .pub-count-badge,
.sidebar.collapsed .dashboard-platform-badges {
  display: none;
}

/* Dashboard platform badges en botón Inicio */
.dashboard-platform-badges {
  display: flex;
  align-items: center;
  gap: 3px;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.dash-plat-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.dash-plat-badge--li {
  background: rgba(10, 102, 194, 0.18);
  color: #0A66C2;
}

body.light-mode .dash-plat-badge {
  background: rgba(0, 0, 0, 0.08);
}

/* ─── Sidebar history — platform badges ──────────────────────────────────── */
.sidebar-plat-badges {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  margin-left: auto;
}

.sidebar-plat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.sidebar-plat-icon--li {
  background: rgba(10, 102, 194, 0.18);
  color: #5b9bd5;
}

body.light-mode .sidebar-plat-icon {
  background: rgba(0, 0, 0, 0.08);
}

/* ─── Help button in sidebar ──────────────────────────────────────────────── */
.btn-help {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  margin-bottom: 4px;
  text-align: left;
}

.btn-help:hover {
  color: var(--text-secondary);
  background: var(--bg-elevated);
}

.btn-help .material-symbols-outlined {
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar.collapsed .btn-help {
  padding: 8px;
  justify-content: center;
}

.sidebar.collapsed .btn-help .btn-label {
  display: none;
}

/* ─── Help modal ──────────────────────────────────────────────────────────── */
.help-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.help-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.help-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(233, 30, 140, 0.3);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', monospace;
}

.help-step-body {
  flex: 1;
}

.help-step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.help-step-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.help-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.help-note {
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── Publications preview modal ─────────────────────────────────────────── */
.pub-preview-box {
  width: 480px !important;
  max-width: calc(100vw - 32px);
}

.pub-preview-content {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px 0;
}

.pub-preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Tab buttons now show icon + text — no override needed */

.platform-select-btn {
  gap: 0;
  padding: 10px 14px;
}
/* ─── URL Research field ─────────────────────────────────────────────────── */
.url-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Override width:100% from .form-input so the flex row fits correctly */
.url-input-row .form-input,
.url-input-row .url-text-input {
  flex: 1;
  min-width: 0;
  width: auto;
}

.btn-add-url {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-url:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.url-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 0;
}

.url-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-secondary);
  max-width: 280px;
  font-family: 'IBM Plex Mono', monospace;
}

.url-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}

.url-chip-remove:hover {
  color: var(--red);
}

.form-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* ─── AI Provider Selector (wizard step 3) ──────────────────────────────── */
.ai-provider-selector {
  display: flex;
  gap: 8px;
}

.ai-provider-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.ai-provider-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.ai-provider-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.ai-provider-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-provider-logo--anthropic {
  background: #cc785c;
  color: white;
}

.ai-provider-logo--google {
  background: #ffffff;
  padding: 6px;
}

.ai-provider-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-provider-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
}

.ai-provider-model {
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.ai-provider-btn.active .ai-provider-name {
  color: var(--accent);
}

.ai-provider-btn.active .ai-provider-model {
  color: var(--accent);
  opacity: 0.7;
}
