/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a25;
  --bg-hover: #222233;
  --bg-input: #15151f;
  --border-color: #2a2a3a;
  --text-primary: #e8e8f0;
  --text-secondary: #8888a0;
  --text-muted: #555570;
  --accent: #6c5ce7;
  --accent-hover: #7c6cf7;
  --accent-dim: rgba(108, 92, 231, 0.15);
  --success: #00c853;
  --warning: #ff9800;
  --error: #ff3b5c;
  --twitter: #1da1f2;
  --instagram: #e1306c;
  --bluesky: #0085ff;
  --sidebar-width: 240px;
  --radius: 8px;
  --radius-sm: 4px;
  --transition: 0.2s ease;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* ===== Screens ===== */
.screen { display: none; }
.screen.active { display: flex; }

#login-screen {
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0a0a0f 0%, #1a1030 50%, #0a0a0f 100%);
}

#main-app {
  min-height: 100vh;
}

/* ===== Login ===== */
.login-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-logo h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  margin-bottom: 32px;
}

.error-text {
  color: var(--error);
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Montserrat', sans-serif;
  font-size: 16px; /* 16px+ prevents iOS Safari zoom-on-focus */
  transition: border-color var(--transition);
}

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

textarea {
  resize: vertical;
  min-height: 80px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--border-color); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.btn-danger {
  background: var(--error);
  color: white;
}
.btn-danger:hover { opacity: 0.85; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; }
.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}
.btn-icon:hover { color: var(--text-primary); }

/* ===== Sidebar ===== */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.nav-list {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

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

.nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-right: 3px solid var(--accent);
}

.nav-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

/* ===== Nav Section Labels ===== */
.nav-section-label {
  padding: 12px 20px 4px;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  list-style: none;
}

/* ===== Sub Navigation ===== */
.nav-sub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-sub-link {
  padding: 6px 20px 6px 40px !important;
  font-size: 12px !important;
  color: var(--text-secondary) !important;
}

.nav-sub-link:hover {
  color: var(--text-primary) !important;
}

.nav-sub-link.active {
  color: var(--accent) !important;
  background: var(--accent-dim) !important;
  border-right: 3px solid var(--accent);
}

/* Hide mobile portfolio selector on desktop */
.mobile-portfolio-item {
  display: none;
}

@media (max-width: 768px) {
  .mobile-portfolio-item {
    display: block;
  }
}

/* ===== Main Content ===== */
#content {
  margin-left: var(--sidebar-width);
  padding: 32px;
  min-height: 100vh;
}

.view { display: none; width: 100%; }
.view.active { display: block; }

/* ===== Page Header ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition);
  min-width: 0;
  overflow: hidden;
}

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

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

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

.card-header > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.card-header .badge {
  flex-shrink: 0;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

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

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

/* ===== Status Badges ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-active { background: rgba(0, 200, 83, 0.15); color: var(--success); }
.badge-paused { background: rgba(255, 152, 0, 0.15); color: var(--warning); }
.badge-pending { background: rgba(108, 92, 231, 0.15); color: var(--accent); }
.badge-published { background: rgba(0, 200, 83, 0.15); color: var(--success); }
.badge-failed { background: rgba(255, 59, 92, 0.15); color: var(--error); }

/* ===== Platform Badges ===== */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
}

.platform-twitter { background: rgba(29, 161, 242, 0.15); color: var(--twitter); }
.platform-instagram { background: rgba(225, 48, 108, 0.15); color: var(--instagram); }
.platform-bluesky { background: rgba(0, 133, 255, 0.15); color: var(--bluesky); }

/* ===== Tags ===== */
.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-hover);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin: 2px;
}

.tag-removable {
  cursor: pointer;
}

.tag-removable:hover {
  background: var(--error);
  color: white;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.tag-input-wrapper {
  display: flex;
  gap: 8px;
}

.tag-input-wrapper input {
  flex: 1;
}

/* ===== Tables ===== */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}

tr:hover td {
  background: var(--bg-hover);
}

/* ===== Copy Library ===== */
.copy-entry {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.copy-text {
  font-size: 14px;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.copy-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Image Gallery ===== */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.image-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
  position: relative;
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-thumb:hover {
  border-color: var(--accent);
}

.image-thumb .image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
}

.image-thumb:hover .image-overlay {
  display: flex;
}

/* ===== Upload Zone ===== */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.upload-zone p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ===== Calendar ===== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-header-cell {
  text-align: center;
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.calendar-cell {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-height: 100px;
  padding: 8px;
  cursor: pointer;
  transition: border-color var(--transition);
}

.calendar-cell:hover {
  border-color: var(--accent);
}

.calendar-cell.today {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.calendar-cell.other-month {
  opacity: 0.3;
}

.calendar-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.calendar-post {
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 10px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.calendar-nav h2 {
  font-size: 18px;
  font-weight: 600;
  min-width: 200px;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.hidden { display: none; }

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 13px;
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--error); }
.toast-info { border-left: 3px solid var(--accent); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  margin-bottom: 20px;
}

/* ===== Section ===== */
.section {
  margin-bottom: 32px;
}

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

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== Accounts Page ===== */
.account-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}

.account-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
}

.account-icon.twitter { background: var(--twitter); }
.account-icon.instagram { background: var(--instagram); }
.account-icon.bluesky { background: var(--bluesky); }

.account-info { flex: 1; }

.account-info h3 {
  font-size: 15px;
  font-weight: 600;
}

.account-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

.account-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

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

.status-dot.connected { background: var(--success); }
.status-dot.disconnected { background: var(--error); }

/* ===== Loading ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
  #sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 100;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
  }

  .sidebar-header h2 { font-size: 16px; margin: 0; }
  .sidebar-header .sidebar-subtitle { display: none; }
  .sidebar-header #mobile-menu-toggle { order: -1; }

  .nav-list {
    display: none;
    padding: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    max-height: 70vh;
    overflow-y: auto;
    z-index: 200;
  }

  .nav-list.mobile-open {
    display: block;
  }

  .nav-link {
    border-right: none;
  }

  .nav-link.active {
    border-right: none;
    border-left: 3px solid var(--accent);
  }

  .nav-sub-list {
    padding-left: 0;
  }

  .nav-sub-link {
    padding-left: 48px !important;
  }

  .nav-section-label {
    padding: 8px 16px 4px;
  }

  /* Portfolio selector in mobile */
  #sidebar > div:nth-child(2) {
    display: none;
  }

  .nav-list .mobile-portfolio-selector {
    display: block;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
  }

  #content {
    margin-left: 0;
    margin-top: 56px;
    padding: 16px;
    min-height: calc(100vh - 56px);
  }

  #main-app {
    flex-direction: column;
  }

  .sidebar-footer {
    display: none;
  }

  /* Page headers */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-header h1 {
    font-size: 20px;
  }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-label { font-size: 10px; }
  .stat-value { font-size: 22px; }

  /* Card grid */
  .card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card {
    padding: 14px;
  }

  /* Tables */
  .table-container {
    margin: 0 -16px;
    width: calc(100% + 32px);
  }

  table {
    font-size: 12px;
  }

  th, td {
    padding: 8px 10px;
  }

  /* Calendar */
  .calendar-grid {
    gap: 2px;
  }

  .calendar-cell {
    min-height: 60px;
    padding: 4px;
  }

  .calendar-date {
    font-size: 11px;
  }

  .calendar-post {
    font-size: 8px;
    padding: 2px 3px;
  }

  .calendar-nav h2 {
    font-size: 15px;
    min-width: 150px;
  }

  /* Modal */
  .modal-container {
    width: 95%;
    max-height: 90vh;
    margin: 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  /* Image grid */
  .image-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  /* Copy entries */
  .copy-entry {
    padding: 12px;
  }

  .copy-meta {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  /* Account cards */
  .account-card {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
  }

  /* Tags */
  .tag-input-wrapper {
    flex-direction: column;
  }

  /* Buttons */
  .btn-full-mobile {
    width: 100%;
  }

  /* Post editor platforms */
  .post-platform-group {
    flex-direction: column;
    gap: 8px;
  }

  /* Upload zone */
  .upload-zone {
    padding: 24px;
  }

  /* Toast */
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    max-width: 100%;
  }

  /* Login */
  .login-container {
    padding: 32px 24px;
    margin: 16px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .calendar-header-cell {
    font-size: 9px;
    padding: 4px;
  }
}

/* ===== Tabs ===== */
.tabs-container {
  margin-top: 20px;
}

.tabs-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

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

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.tab-panel-header h2 {
  margin: 0;
  font-size: 18px;
}

/* ===== Platform checkboxes (used in campaign create/edit modal) ===== */
/* Use higher specificity to override .form-group label's
   display:block + text-transform:uppercase */
.form-group .platform-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.form-group label.platform-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  background: var(--bg-input);
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
  white-space: nowrap;
  width: auto;
  margin: 0;
}

.form-group label.platform-checkbox:hover {
  border-color: var(--accent);
}

.form-group label.platform-checkbox input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  width: auto;
  padding: 0;
  font-size: inherit;
}

.form-group label.platform-checkbox input[type="checkbox"]:checked + span {
  color: var(--accent);
  font-weight: 500;
}

.form-group label.platform-checkbox span {
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: var(--text-primary);
}

/* ===== Tag input row (tabs) ===== */
.tag-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 480px;
  width: 100%;
}

.tag-input-row input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
}

.tag-input-row .btn {
  flex-shrink: 0;
}

/* Break long URLs within overview card so they don't overflow */
.tab-panel .card a,
.tab-panel .card p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ===== Plan / Pricing Page ===== */
.interval-toggle {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.interval-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.interval-toggle-btn.active {
  background: var(--accent);
  color: white;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 28px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.plan-card-highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.plan-card-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 12px;
}

.plan-name {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px;
}

.plan-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 16px;
  min-height: 36px;
}

.plan-price {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.plan-price-suffix {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 4px;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex-grow: 1;
}

.plan-features li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 0 6px 22px;
  position: relative;
}

.plan-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
