/* ----------------------------------------------------
   PR Intelligence OS - Design System & Stylesheet
   Base layout + components. Brand tokens: css/manifesto-theme.css
   ---------------------------------------------------- */

/* Reset & Variables */
:root {
  --bg-primary: #09090b;
  --bg-secondary: #0f0f12;
  --bg-card: rgba(20, 20, 25, 0.65);
  --bg-card-hover: rgba(28, 28, 35, 0.8);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(229, 25, 55, 0.3);
  
  --accent-indigo: #e51937;
  --accent-purple: #cc0f2b;
  --accent-violet: #b0051e;
  
  --accent-indigo-glow: rgba(229, 25, 55, 0.15);
  --accent-purple-glow: rgba(204, 15, 43, 0.15);
  
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.15);
  --info: #0ea5e9;
  --info-glow: rgba(14, 165, 233, 0.15);
  
  --font-sans: 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  --sidebar-width: 260px;
  --glass-blur: blur(16px);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glow-shadow: 0 0 20px rgba(229, 25, 55, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-indigo);
}

/* Layout Framework */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition-normal);
}

.sidebar-header {
  position: relative;
  padding: 18px 36px 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-collapse-btn {
  position: absolute;
  top: 14px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.sidebar-collapse-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-color-hover);
  background: rgba(255, 255, 255, 0.06);
}

body.sidebar-collapsed .sidebar {
  width: 0;
  min-width: 0;
  opacity: 0;
  border-right-width: 0;
  overflow: hidden;
  pointer-events: none;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.sidebar-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: var(--transition-fast);
  flex-shrink: 0;
  overflow: visible;
  padding: 0;
}

.sidebar-toggle-btn:hover {
  border-color: var(--accent-indigo);
  box-shadow: var(--glow-shadow);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark-wrap {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--text-primary);
}

.brand-subtitle {
  margin: 0;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.2;
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.account-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-indigo);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.7rem;
  color: #fff;
  flex-shrink: 0;
}

.account-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.account-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-role {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 4px;
}

.nav-divider {
  padding: 16px 12px 8px 12px;
}

.nav-divider span {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-tools-group {
  list-style: none;
  margin-top: 4px;
}

.nav-tools-toggle {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.nav-tools-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-tools-chevron {
  margin-left: auto;
  transition: transform 0.15s ease;
}

.nav-tools-group.is-open .nav-tools-chevron {
  transform: rotate(180deg);
}

.nav-tools-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 8px;
}

.nav-tools-list .nav-item {
  font-size: 0.85rem;
  padding: 8px 10px;
}

.page-top-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 32px 8px;
  padding: 16px 20px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
}

.page-top-cta[hidden],
.global-stats-bar[hidden] {
  display: none !important;
}

.page-top-cta-eyebrow {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.page-top-cta-title {
  margin: 4px 0 2px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.page-top-cta-body {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.page-top-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent-indigo, #6366f1);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

.page-top-cta-btn:hover {
  filter: brightness(1.08);
}

.nav-item {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
  text-decoration: none;
  box-sizing: border-box;
}

a.nav-item {
  /* External Companion link — same chrome as button nav items */
  color: inherit;
}

.nav-item i,
.nav-item .nav-icon {
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.nav-item i {
  width: 18px;
  height: 18px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item:hover i {
  color: var(--accent-indigo);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.03) 100%);
  color: var(--text-primary);
  border-left: 3px solid var(--accent-indigo);
  font-weight: 600;
}

.nav-item.active i {
  color: var(--accent-indigo);
}

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

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
  display: inline-block;
  animation: pulse-glow 2s infinite ease-in-out;
}

/* Main Content Panel */
.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  background-image: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 40%),
                    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.03) 0%, transparent 40%);
}

/* Top App Header */
.app-header {
  min-height: 72px;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: var(--glass-blur);
  background: rgba(9, 9, 11, 0.5);
  position: sticky;
  top: 0;
  z-index: 99;
  overflow: visible;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-family: var(--font-display);
  line-height: 1.2;
  white-space: nowrap;
}

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

.breadcrumb .separator {
  color: var(--text-muted);
  opacity: 0.65;
}

.breadcrumb .active-tab-title {
  color: var(--text-primary);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.client-selector-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-selector-container label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.client-dropdown {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: var(--transition-fast);
}

.client-dropdown:hover, .client-dropdown:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
  overflow: visible;
  flex-shrink: 0;
  padding: 0;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color-hover);
  color: var(--text-primary);
}

.sidebar-toggle-btn svg,
.sidebar-toggle-btn i,
.header-btn svg,
.header-btn i {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.notifications-btn .badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-purple);
  box-shadow: 0 0 6px var(--accent-purple);
}

/* Global Stats Ribbon */
.global-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 24px 32px 12px 32px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition-normal);
  box-shadow: var(--glass-shadow);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.2);
  background: var(--bg-card-hover);
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-wrapper i {
  width: 24px;
  height: 24px;
}

.stat-icon-wrapper.blue {
  background: var(--info-glow);
  color: var(--info);
}

.stat-icon-wrapper.purple {
  background: var(--accent-purple-glow);
  color: var(--accent-purple);
}

.stat-icon-wrapper.indigo {
  background: var(--accent-indigo-glow);
  color: var(--accent-indigo);
}

.stat-icon-wrapper.green {
  background: var(--success-glow);
  color: var(--success);
}

.stat-data {
  flex: 1;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-trend i {
  width: 12px;
  height: 12px;
}

.stat-trend.positive {
  color: var(--success);
}

.stat-trend.negative {
  color: var(--danger);
}

/* Dynamic Viewport Canvas */
.viewport-canvas {
  flex: 1;
  padding: 12px 32px 32px 32px;
  display: flex;
  flex-direction: column;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.view-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Common Layout Components */
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 16px;
  flex-wrap: nowrap;
}

/* Title left · view toggle (+ primary CTA) top-right — never mid-toolbar */
.panel-header--split {
  align-items: flex-start;
}

.panel-header--split .panel-title {
  flex: 1;
  min-width: 0;
  max-width: min(520px, 58%);
}

.panel-header--split .panel-title p {
  max-width: 42ch;
}

.panel-header-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.panel-title h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.panel-title p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

/* Secondary tools under the header (list mode only) */
.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: -4px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-toolbar[hidden] {
  display: none !important;
}

/* Shared form controls (CRM filters, modals, journalist search) */
.form-control,
select.form-control,
input.form-control,
textarea.form-control {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  font-weight: 500;
  outline: none;
  transition: var(--transition-fast);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px var(--accent-indigo-glow);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23b8b8b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select.form-control option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.crm-campaign-select {
  min-width: 240px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Form Inputs */
.search-input-wrapper {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.search-input-wrapper .search-icon,
.search-input-wrapper i,
.search-input-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

.search-input {
  display: block;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 9px 12px 9px 38px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  width: 260px;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-indigo);
  width: 320px;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

/* Glass Card Grid */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-normal);
}

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

/* Badges & Labels */
.badge-niche {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
}

.badge-niche.web3 { background: rgba(168, 85, 247, 0.1); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.2); }
.badge-niche.ai { background: rgba(14, 165, 233, 0.1); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.2); }
.badge-niche.tech { background: rgba(99, 102, 241, 0.1); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.2); }
.badge-niche.ecommerce { background: rgba(236, 72, 153, 0.1); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.2); }
.badge-niche.lifestyle { background: rgba(245, 158, 11, 0.1); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-niche.news { background: rgba(16, 185, 129, 0.1); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }

.badge-region {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ----------------------------------------------------
   Module-Specific Components
   ---------------------------------------------------- */

/* PR Publication Directory View */
.directory-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0; /* Important for flex child scroll */
  align-items: stretch;
  /* Fill remaining viewport under panel header so filter column can scroll fully */
  height: 100%;
  max-height: calc(100vh - 200px);
}

.directory-layout.is-filters-collapsed {
  grid-template-columns: 52px 1fr;
}

/* Filters Panel — full column scroll + collapsible */
.filters-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  height: 100%;
  max-height: none; /* fill layout row, not arbitrary 75vh clip */
  overflow: hidden; /* body scrolls, not the glass shell */
  padding: 0 !important;
  position: sticky;
  top: 0;
  align-self: stretch;
}

.filters-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.15);
}

.filters-panel__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0;
}

.filters-panel__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.filters-panel__toggle:hover {
  background: rgba(0, 87, 255, 0.12);
  color: #fff;
  border-color: rgba(0, 87, 255, 0.35);
}

/* Scrollable body — entire filter stack visible via scroll */
.filters-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.filters-panel__body::-webkit-scrollbar {
  width: 8px;
}
.filters-panel__body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

/* Collapsed: thin rail */
.filters-panel.is-collapsed {
  min-width: 52px;
}
.filters-panel.is-collapsed .filters-panel__header {
  flex-direction: column;
  padding: 10px 6px;
  gap: 10px;
}
.filters-panel.is-collapsed .filters-panel__title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.12em;
  font-size: 0.65rem;
}
.filters-panel.is-collapsed .filters-panel__body {
  display: none;
}

.filter-group {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.filter-group.is-collapsed .filter-options,
.filter-group.is-collapsed .range-slider-wrapper {
  display: none;
}

.filter-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 0;
  padding: 10px 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
}

.filter-title:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.filter-title__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.filter-title__chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.filter-group.is-collapsed .filter-title__chevron {
  transform: rotate(-90deg);
}

.filter-title button {
  background: none;
  border: none;
  color: var(--accent-indigo);
  font-size: 0.75rem;
  cursor: pointer;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 2px 12px;
}

/* Custom Checkbox Design */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  display: none;
}

.custom-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.checkbox-label input:checked + .custom-checkbox {
  background-color: var(--accent-indigo);
  border-color: var(--accent-indigo);
  box-shadow: 0 0 6px var(--accent-indigo-glow);
}

.checkbox-label input:checked + .custom-checkbox::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

/* Sliders */
.range-slider-wrapper {
  padding: 8px 4px;
}

.range-slider-wrapper input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  background: var(--border-color);
  height: 4px;
  border-radius: 2px;
  outline: none;
}

.range-slider-wrapper input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-indigo);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
  transition: var(--transition-fast);
}

.range-slider-wrapper input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.range-value {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Results Content Area */
.directory-results-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  backdrop-filter: var(--glass-blur);
  overflow: hidden;
  min-height: 0;
}

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

.results-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.results-count strong {
  color: var(--text-primary);
}

.table-wrapper {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
}

.directory-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.directory-table--resizable {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}

.directory-table--resizable th,
.directory-table--resizable td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.directory-table--resizable th:first-child,
.directory-table--resizable td:first-child {
  white-space: normal;
  word-break: break-word;
}

.directory-table--resizable th.col-resizable-th {
  position: relative;
  padding-right: 18px;
}

.col-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 2;
  touch-action: none;
}

.col-resize-handle::after {
  content: "";
  position: absolute;
  top: 18%;
  right: 4px;
  width: 2px;
  height: 64%;
  border-radius: 1px;
  background: var(--border-color);
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.directory-table th:hover .col-resize-handle::after,
.col-resize-handle:hover::after {
  opacity: 1;
}

.col-resize-handle:hover::after,
body.col-resize-active .col-resize-handle::after {
  background: var(--accent-indigo);
  opacity: 1;
}

body.col-resize-active {
  cursor: col-resize !important;
  user-select: none;
}

body.col-resize-active * {
  cursor: col-resize !important;
}

.directory-table th {
  padding: 12px 24px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(20, 20, 25, 0.2);
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
}

.directory-table th:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.directory-table th i {
  width: 12px;
  height: 12px;
  margin-left: 4px;
  vertical-align: middle;
}

.directory-table td {
  padding: 16px 24px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.directory-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

.pub-identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pub-name {
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.pub-name:hover {
  color: var(--accent-indigo);
  text-decoration: underline;
}

.metric-value-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-bar-bg {
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 2px;
}

.metric-bar-fill.da { background: linear-gradient(90deg, var(--accent-indigo), var(--accent-purple)); }
.metric-bar-fill.spam { background: var(--danger); }

.price-tag {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
}

.action-secure {
  padding: 4px 10px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.action-secure:hover {
  background: var(--accent-indigo);
  color: #fff;
  border-color: var(--accent-indigo);
}

/* Modal Overlay & Details Drawer */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 90%;
  max-width: 640px;
  background: #0f0f12;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  transform: translateY(20px);
  transition: var(--transition-normal);
}

.modal-card.modal-card--account {
  max-width: 720px;
  max-height: min(90vh, 880px);
  overflow-y: auto;
  padding: 28px 32px 32px;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

/* ── Account Settings (Admin Portal / Client Portal) ── */
.account-settings {
  color: var(--text-primary);
}

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

.account-settings-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.account-settings-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.account-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  margin: 18px 0 20px;
}

.account-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition-fast);
  font-family: var(--font-sans);
}

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

.account-tab.active {
  color: #fff;
  border-bottom-color: var(--accent-indigo);
}

.account-tab-panel {
  display: none;
}

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

.account-section {
  margin-bottom: 28px;
}

.account-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 4px;
}

.account-section-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.45;
}

.account-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.account-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(229, 25, 55, 0.35), rgba(20, 20, 28, 0.9));
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  letter-spacing: 0.02em;
}

.account-avatar-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-avatar-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.account-avatar-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.account-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.account-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-field-full {
  grid-column: 1 / -1;
}

.account-field label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.account-field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  transition: var(--transition-fast);
}

.account-field input:focus {
  outline: none;
  border-color: rgba(229, 25, 55, 0.55);
  box-shadow: 0 0 0 3px var(--accent-indigo-glow);
}

.account-field input[readonly] {
  opacity: 0.85;
  cursor: default;
  color: var(--text-secondary);
}

.account-portal-badge {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
}

.account-portal-badge strong {
  display: block;
  font-size: 0.9rem;
  color: #fff;
  margin-bottom: 4px;
}

.account-portal-badge span {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.account-portal-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 4px;
  flex-shrink: 0;
}

.account-portal-badge.is-admin {
  border-color: rgba(229, 25, 55, 0.35);
  background: rgba(229, 25, 55, 0.08);
}

.account-portal-badge.is-admin .account-portal-dot {
  background: var(--accent-indigo);
  box-shadow: 0 0 8px rgba(229, 25, 55, 0.5);
}

.account-portal-badge.is-client {
  border-color: rgba(14, 165, 233, 0.3);
  background: rgba(14, 165, 233, 0.06);
}

.account-portal-badge.is-client .account-portal-dot {
  background: var(--info);
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.45);
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.account-btn-primary {
  padding: 12px !important;
  border-radius: 8px;
  font-weight: 600;
}

.account-save-status {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--success);
  text-align: right;
}

@media (max-width: 560px) {
  .account-form-grid {
    grid-template-columns: 1fr;
  }
  .account-actions {
    flex-direction: column-reverse;
  }
  .account-actions .btn {
    width: 100%;
  }
}

/* ── Workspace switcher (header) ── */
.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
}

.workspace-switcher[hidden] {
  display: none !important;
}

.ws-switcher-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.ws-select,
.account-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(0, 0, 0, 0.35)
    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='%23a1a1aa' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: var(--font-sans);
  padding: 8px 28px 8px 12px;
  min-width: 160px;
  max-width: 240px;
  cursor: pointer;
}

.ws-select:focus,
.account-select:focus {
  outline: none;
  border-color: rgba(229, 25, 55, 0.5);
  box-shadow: 0 0 0 3px var(--accent-indigo-glow);
}

.account-field .account-select {
  width: 100%;
  max-width: none;
  padding: 10px 28px 10px 12px;
}

/* Workspace cards (Account Settings) */
.ws-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ws-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-sans);
}

.ws-card:hover {
  border-color: rgba(229, 25, 55, 0.35);
  background: rgba(229, 25, 55, 0.06);
}

.ws-card.is-active {
  border-color: rgba(229, 25, 55, 0.45);
  background: rgba(229, 25, 55, 0.1);
}

.ws-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.ws-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ws-card-body strong {
  font-size: 0.875rem;
  color: #fff;
}

.ws-card-body span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ws-card-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-indigo);
  background: rgba(229, 25, 55, 0.12);
  padding: 4px 8px;
  border-radius: 999px;
}

.ws-admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.ws-admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.ws-admin-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ws-admin-meta strong {
  font-size: 0.85rem;
  color: #fff;
}

.ws-admin-meta span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.ws-admin-meta code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.ws-admin-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .ws-switcher-label {
    display: none;
  }
  .ws-select {
    min-width: 120px;
    max-width: 160px;
  }
}

@media (max-width: 640px) {
  .workspace-switcher {
    display: none; /* use Account Settings → Workspace on mobile */
  }
  .ws-admin-row {
    flex-wrap: wrap;
  }
  .ws-admin-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

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

.drawer-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.drawer-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.chart-wrapper {
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border-color);
}

/* ----------------------------------------------------
   Article & Campaign Tracker View
   ---------------------------------------------------- */
.tracker-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.tracker-scope {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}

.tracker-scope > span {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.tracker-scope .writer-select {
  height: 38px;
  min-width: 180px;
  padding-top: 0;
  padding-bottom: 0;
}

.tracker-sub-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.tracker-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  white-space: nowrap;
}

.sub-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.sub-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.sub-tab-btn:hover {
  background: rgba(255,255,255,0.06);
}

.sub-tab-btn.active {
  background: var(--accent-indigo);
  color: #fff;
  border-color: var(--accent-indigo);
  box-shadow: 0 4px 10px var(--accent-indigo-glow);
}

.tracker-canvas {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1180px) {
  .panel-header,
  .tracker-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(260px, 280px));
  gap: 16px;
  flex: 1;
  min-height: 0;
  width: max-content;
  min-width: 100%;
  padding-bottom: 12px;
}

.kanban-column {
  background: rgba(20, 20, 25, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 260px;
  max-height: 70vh;
  overflow-y: auto;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
}

.column-title-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.column-indicator.draft { background-color: var(--text-secondary); }
.column-indicator.writing { background-color: var(--info); }
.column-indicator.review { background-color: var(--warning); }
.column-indicator.scheduled { background-color: var(--accent-purple); }
.column-indicator.live { background-color: var(--success); }

.column-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.column-count {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 10px;
}

.kanban-cards-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 100px;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  cursor: grab;
  transition: var(--transition-normal);
}

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

.card-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 12px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  margin-top: 8px;
}

.card-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-meta i {
  width: 10px;
  height: 10px;
}

.card-link {
  color: var(--accent-indigo);
  cursor: pointer;
  padding: 2px;
}

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

/* Campaigns Panel Layout */
.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.campaign-card {
  border-radius: 16px;
  padding: 20px;
}

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

.campaign-title h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.campaign-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
  min-height: 38px;
}

.campaign-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
  margin: 16px 0;
}

.campaign-stat-box {
  text-align: center;
}

.campaign-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
}

.campaign-stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-top: 2px;
}

.progress-bar-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}

.progress-bar-bg {
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-purple));
  border-radius: 3px;
}

/* ----------------------------------------------------
   Hermes AI Article Writer View
   ---------------------------------------------------- */
.writer-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  flex: 1;
}

.writer-config-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.writer-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.writer-form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.writer-select, .writer-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  width: 100%;
  transition: var(--transition-fast);
}

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

.writer-editor-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 480px;
}

.editor-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-toolbar {
  display: flex;
  gap: 4px;
}

.editor-toolbar-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.editor-toolbar-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.editor-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  position: relative;
}

.editor-content-area {
  outline: none;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-primary);
  min-height: 300px;
}

.editor-content-area h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: #fff;
}

.editor-content-area p {
  margin-bottom: 16px;
}

/* Writer Simulator Console */
.terminal-simulator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #09090b;
  z-index: 10;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.terminal-dot-group {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background-color: var(--danger); }
.terminal-dot.yellow { background-color: var(--warning); }
.terminal-dot.green { background-color: var(--success); }

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

.terminal-line {
  margin-bottom: 4px;
}

.terminal-line.command {
  color: var(--accent-indigo);
}

.terminal-line.success {
  color: var(--success);
}

.terminal-line.loading::after {
  content: '...';
  display: inline-block;
  animation: dots 1.5s infinite;
  width: 12px;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* ----------------------------------------------------
   Coverage Book Generator View
   ---------------------------------------------------- */
.coverage-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  flex: 1;
}

.coverage-selector-card {
  max-height: 75vh;
  overflow-y: auto;
}

.coverage-checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.coverage-checklist-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-fast);
}

.coverage-checklist-item:hover {
  background: rgba(255,255,255,0.04);
}

.coverage-checklist-item.selected {
  border-color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.04);
}

.coverage-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 4px;
}

.coverage-report-preview {
  background: #fff;
  color: #1f2937;
  border-radius: 16px;
  min-height: 600px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

.report-header {
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.report-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.report-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #111827;
}

.report-badge {
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #4b5563;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.report-title-container {
  margin-top: 16px;
}

.report-title-container h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: #111827;
}

.report-title-container p {
  color: #6b7280;
  font-size: 0.85rem;
  margin-top: 4px;
}

.report-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.report-metric-card {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}

.report-metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  display: block;
}

.report-metric-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: #111827;
  margin-top: 4px;
}

.report-charts-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  margin-bottom: 32px;
  border-bottom: 1.5px dashed #e5e7eb;
  padding-bottom: 32px;
}

.report-chart-container {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  height: 200px;
}

.report-articles-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-article-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.report-article-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-article-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #111827;
}

.report-article-pub {
  font-size: 0.75rem;
  color: #6b7280;
}

.report-article-metrics {
  display: flex;
  gap: 20px;
}

.report-sub-metric {
  text-align: right;
}

.report-sub-metric-label {
  font-size: 0.65rem;
  color: #9ca3af;
  display: block;
}

.report-sub-metric-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: #374151;
}

/* Empty State Styling */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text-secondary);
}

.empty-state i {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ----------------------------------------------------
   SEO Keyword Research View
   ---------------------------------------------------- */
.seo-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.seo-card-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.seo-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.seo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.seo-list-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.seo-list-item:hover {
  border-color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.02);
}

.seo-list-item.selected {
  border-color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.05);
}

.keyword-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.keyword-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.keyword-intent-chip {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.keyword-intent-chip.info { background: rgba(14, 165, 233, 0.1); color: #0ea5e9; }
.keyword-intent-chip.trans { background: rgba(168, 85, 247, 0.1); color: #a855f7; }

.keyword-metrics {
  display: flex;
  gap: 20px;
  align-items: center;
}

.difficulty-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.difficulty-badge.easy { background: var(--success-glow); color: var(--success); }
.difficulty-badge.med { background: var(--warning-glow); color: var(--warning); }
.difficulty-badge.hard { background: var(--danger-glow); color: var(--danger); }

/* Smart Match Pub Deck */
.smart-match-card {
  padding: 12px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.01);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.match-score {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-indigo-glow);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ----------------------------------------------------
   Founder Branding View
   ---------------------------------------------------- */
.branding-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

.profile-card {
  text-align: center;
  padding: 20px;
}

.profile-pic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--border-color);
}

.profile-socials {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.profile-social-link {
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.profile-social-link:hover {
  color: var(--accent-indigo);
}

.profile-social-link i {
  width: 16px;
  height: 16px;
}

.branding-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mention-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.01);
  border-radius: 10px;
  margin-bottom: 10px;
}

.mention-sentiment {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.mention-sentiment.pos { background-color: var(--success); box-shadow: 0 0 6px var(--success); }
.mention-sentiment.neu { background-color: var(--text-secondary); }
.mention-sentiment.neg { background-color: var(--danger); box-shadow: 0 0 6px var(--danger); }

/* ----------------------------------------------------
   Podcast & Newsletter Tracker View
   ---------------------------------------------------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.media-channel-card {
  padding: 20px;
}

.media-channel-header {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.media-channel-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-indigo);
}

.media-channel-icon i {
  width: 24px;
  height: 24px;
}

.media-channel-info {
  flex: 1;
}

.media-channel-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.media-channel-host {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ----------------------------------------------------
   Events & IR Calendar View
   ---------------------------------------------------- */
.events-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

.events-list-deck {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-item-card {
  padding: 16px 20px;
  display: flex;
  gap: 18px;
  align-items: center;
  overflow: visible;
}

.event-date-stamp {
  flex-shrink: 0;
  min-width: 76px;
  width: auto;
  min-height: 68px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--font-display);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.15);
  text-align: center;
  overflow: visible;
}

.event-date-stamp .day {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.event-date-stamp .month {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}

.event-details {
  flex: 1;
}

.event-details h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.event-meta-line {
  display: flex;
  gap: 16px;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.event-meta-line span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-meta-line i {
  width: 12px;
  height: 12px;
}

/* Checklist items */
.action-check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.action-check-item {
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-check-item.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* ----------------------------------------------------
   PR Intelligence OS - Phase 6 Custom Styling Additions
   ---------------------------------------------------- */

/* 1. Light Theme — base overrides (manifesto-theme.css extends these) */
body.light-theme .drawer-sheet {
  background: #ffffff;
  color: var(--text-primary);
  border-color: rgba(17, 17, 17, 0.12);
  box-shadow: 0 8px 32px rgba(17, 17, 17, 0.1);
}

/* 2. Theme Toggle Switch Styles */
.theme-toggle-btn {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: var(--transition-fast);
  overflow: visible;
  flex-shrink: 0;
  padding: 0;
}

.theme-toggle-btn svg,
.theme-toggle-btn i {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-indigo);
  box-shadow: var(--glow-shadow);
  transform: rotate(20deg);
}

/* 3. Interactive Spreadsheet Master Sheet Grid Styles */
.mastersheet-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}

.spreadsheet-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.spreadsheet-wrapper {
  max-height: 520px;
  overflow-y: auto;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
}

.spreadsheet-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  text-align: left;
}

.spreadsheet-grid th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 10px 14px;
  border-right: 1px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
  user-select: none;
}

body.light-theme .spreadsheet-grid th {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

.spreadsheet-grid td {
  padding: 0;
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  height: 38px;
}

.spreadsheet-grid tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

body.light-theme .spreadsheet-grid tr:hover {
  background: rgba(0, 0, 0, 0.01);
}

.cell-input {
  width: 100%;
  height: 38px;
  border: none;
  background: transparent;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.8rem;
  transition: background var(--transition-fast);
}

.cell-input:focus {
  outline: 2px solid var(--accent-indigo);
  background: rgba(99, 102, 241, 0.05) !important;
  z-index: 5;
}

.cell-input.numeric {
  font-family: var(--font-mono);
  text-align: right;
}

.cell-input.url {
  color: var(--info);
  text-decoration: underline;
}

.cell-select {
  width: 100%;
  height: 38px;
  border: none;
  background: transparent;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
}

.cell-select:focus {
  outline: 2px solid var(--accent-indigo);
}

/* 4. Google Sheets Sync Console & Terminal */
.sync-console-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  min-height: 240px;
}

.sync-status-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border-color);
  padding-right: 20px;
}

.sync-metric {
  margin-bottom: 15px;
}

.sync-metric h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sync-metric p {
  font-size: 1.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
}

.terminal-panel {
  display: flex;
  flex-direction: column;
  background: #09090b;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  padding: 12px;
  height: 220px;
  overflow: hidden;
}

body.light-theme .terminal-panel {
  background: #09090b; /* keep terminal dark for tech aesthetic */
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

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

.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.green { background: #10b981; }

.terminal-title {
  font-size: 0.7rem;
  color: #71717a;
  text-transform: uppercase;
}

.terminal-logs {
  flex: 1;
  overflow-y: auto;
  font-size: 0.75rem;
  color: #10b981;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
  text-align: left;
}

.terminal-line {
  line-height: 1.4;
}

.terminal-line.error { color: #ef4444; }
.terminal-line.info { color: #0ea5e9; }
.terminal-line.system { color: #a855f7; }

/* 5. Agent OS Workspace Layout */
.agent-grid-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
}

.agent-console-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.agent-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid var(--accent-indigo-glow);
  padding: 12px 18px;
  border-radius: 8px;
}

.agent-status-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulse-glow-anim 2s infinite;
}

@keyframes pulse-glow-anim {
  0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); opacity: 0.8; box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.agent-autonomy-modes {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: 8px;
}

.mode-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.mode-toggle.active {
  background: var(--accent-indigo);
  color: #ffffff;
  box-shadow: var(--glow-shadow);
}

.agent-controls-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.control-slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-slider-group label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.control-slider-header {
  display: flex;
  justify-content: space-between;
}

.agent-terminal-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.agent-terminal-header {
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.light-theme .agent-terminal-header {
  background: rgba(0,0,0,0.03);
}

.agent-terminal {
  background: #09090b;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  padding: 16px;
  height: 300px;
  overflow-y: auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-terminal-line {
  line-height: 1.5;
  word-break: break-all;
}

.agent-terminal-line .timestamp {
  color: var(--text-muted);
  margin-right: 6px;
}

.agent-terminal-line.success { color: var(--success); }
.agent-terminal-line.warning { color: var(--warning); }
.agent-terminal-line.info { color: var(--info); }
.agent-terminal-line.agent { color: var(--accent-purple); }

.cursor-blink {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--text-primary);
  animation: blink-anim 1s infinite steps(2);
  vertical-align: middle;
  margin-left: 2px;
}

@keyframes blink-anim {
  0% { opacity: 1; }
  50% { opacity: 0; }
}

/* Automated Matching Pitch Recommendations */
.agent-recs-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.rec-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.rec-card:hover {
  border-color: var(--accent-indigo);
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow);
}

.rec-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.rec-outlet {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.rec-score-chip {
  background: var(--accent-indigo-glow);
  color: var(--accent-indigo);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.rec-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.rec-reason {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--accent-purple);
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
  color: var(--text-secondary);
}

body.light-theme .rec-reason {
  background: rgba(0, 0, 0, 0.02);
}

.rec-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* 6. Agency Notes details panel styling */
.notes-textarea-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}

.notes-save-status {
  font-size: 0.7rem;
  color: var(--success);
  margin-left: 8px;
  display: none;
}

.notes-save-status.active {
  display: inline-block;
  animation: fade-out 3s forwards;
}

@keyframes fade-out {
  0% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* Segment switcher for dual directory view */
.directory-view-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: 6px;
  align-self: center;
}

body.light-theme .directory-view-toggle {
  background: rgba(0, 0, 0, 0.03);
}

.view-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.725rem;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.view-toggle-btn.active {
  background: var(--accent-indigo);
  color: #ffffff;
}

/* Client Mode CSS Locks for security */
body.client-mode .action-secure,
body.client-mode #btn-import-csv,
body.client-mode #csv-file-input,
body.client-mode #btn-agent-crawl {
  display: none !important;
}

body.client-mode .directory-table th:nth-child(6),
body.client-mode .directory-table td:nth-child(6) {
  display: none !important; /* Hide Pricing Column completely from client views */
}

/* Auth shake animation on invalid login */
.shake-anim {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Publication Logos CSS */
.pub-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pub-logo.large {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

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

.pub-logo span {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.pub-logo.large span {
  font-size: 1.2rem;
}

/* Custom Tooltip for Verification Badges */
.tooltip-trigger {
  position: relative;
}

.tooltip-trigger .custom-tooltip {
  visibility: hidden;
  opacity: 0;
  width: 240px;
  background-color: rgba(15, 15, 18, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  text-align: left;
  border-radius: 6px;
  padding: 10px;
  position: absolute;
  z-index: 1000;
  bottom: 125%; /* Position above the badge */
  left: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  line-height: 1.5;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.tooltip-trigger .custom-tooltip strong {
  color: #fbbf24;
  font-weight: 600;
}

.tooltip-trigger:hover .custom-tooltip {
  visibility: visible;
  opacity: 1;
}

body.light-theme .tooltip-trigger .custom-tooltip {
  background-color: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.spinning {
  animation: spin 1s linear infinite;
  display: inline-block;
}

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

/* —— Journalists directory (compact toolbar + density) —— */
.j-panel .j-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.j-panel-sub {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.j-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.j-result-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding: 0 4px;
}

.j-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.j-tool-btn i,
.j-tool-btn svg {
  width: 14px;
  height: 14px;
}

.j-tool-btn:hover {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--text-primary);
  background: rgba(239, 68, 68, 0.08);
}

.j-tool-btn.is-on {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
}

/* Filter bar */
.j-filter-bar {
  padding: 10px 12px;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.j-filter-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.j-search-wrap {
  position: relative;
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 320px;
}

.j-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.j-search-input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  font-size: 0.82rem;
}

.j-search-input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.j-chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.j-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.j-chip:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.j-chip.is-on {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
}

.j-filter-extra {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.j-filter-extra.is-open {
  display: block;
}

.j-filter-extra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.j-extra-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.j-aws-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.j-aws-range input[type="range"] {
  flex: 1;
}

.j-aws-range #j-aws-val {
  font-variant-numeric: tabular-nums;
  min-width: 1.5rem;
  color: var(--text-primary);
  font-size: 0.8rem;
}

.j-extra-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  padding-bottom: 4px;
}

.j-results-card {
  padding: 0;
  overflow: hidden;
}

.j-loading,
.j-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.j-directory-scroll {
  max-height: calc(100vh - 240px);
  overflow: auto;
  padding: 10px 12px 18px;
}

.j-directory-head {
  display: grid;
  gap: 8px;
  padding: 0 12px 8px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  position: sticky;
  top: 0;
  background: var(--bg-card, var(--surface, #121218));
  z-index: 2;
}

.j-panel:not(.j-more-cols) .j-directory-head {
  grid-template-columns: minmax(160px, 1.5fr) minmax(110px, 1.1fr) 110px 72px 48px;
}

.j-panel.j-more-cols .j-directory-head {
  grid-template-columns: minmax(150px, 1.3fr) minmax(100px, 1fr) minmax(80px, 0.85fr) 100px 64px 72px 48px;
}

.j-col-actions {
  text-align: center;
}

.j-directory-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.j-row {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.j-row--compact {
  grid-template-columns: minmax(160px, 1.5fr) minmax(110px, 1.1fr) 110px 72px 48px;
}

.j-row--wide {
  grid-template-columns: minmax(150px, 1.3fr) minmax(100px, 1fr) minmax(80px, 0.85fr) 100px 64px 72px 48px;
}

.j-row__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.j-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.j-action-btn i,
.j-action-btn svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.j-action-btn:hover,
.j-action-btn:focus-visible {
  color: #93c5fd;
  background: rgba(0, 87, 255, 0.12);
  border-color: rgba(0, 87, 255, 0.28);
  outline: none;
}

.j-action-btn:active {
  transform: scale(0.96);
}

/* Dense mode: tighter rows */
.j-density-dense .j-directory-list {
  gap: 4px;
}

.j-density-dense .j-row {
  padding: 6px 10px;
  border-radius: 8px;
}

.j-density-dense .j-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.72rem;
}

.j-density-dense .j-name-btn {
  font-size: 0.82rem;
}

.j-density-dense .j-row__pub-name {
  font-size: 0.75rem;
}

.j-density-dense .j-directory-scroll {
  max-height: calc(100vh - 220px);
}

.j-row:hover,
.j-row:focus-visible {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.06);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12);
  outline: none;
}

.j-row__articles {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: right;
}

.j-row__date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.j-row__person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.j-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #a855f7);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.j-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Profile drawer only — list rows stay letter initials */
.j-avatar--photo {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  padding: 0;
}

.j-avatar--lg {
  width: 56px;
  height: 56px;
  font-size: 1.25rem;
}

.j-avatar--xl {
  width: 88px;
  height: 88px;
  font-size: 1.75rem;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.j-name-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.j-name-btn:hover {
  color: #f87171;
}

.j-row__meta,
.j-row__muted {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.j-row__pub {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.j-row__pub-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.j-pub-icon {
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.j-pub-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.j-pub-icon__fallback,
.j-pub-icon--fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(99, 102, 241, 0.2);
}

.j-beat-chip {
  font-size: 0.65rem !important;
  padding: 2px 6px !important;
}

.j-row__beats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Profile drawer */
.j-profile-drawer.side-drawer,
#j-detail-drawer.side-drawer,
#j-detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  width: min(420px, 100vw);
  max-width: 100%;
  background: var(--bg-card, #121218);
  border-left: 1px solid var(--border-color);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.22s ease, visibility 0.22s ease;
}

#j-detail-drawer.open {
  transform: translateX(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.j-drawer-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
}

.j-drawer-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.j-drawer-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #f5f5f5;
}

.btn-close-drawer {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}

.btn-close-drawer:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.j-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.j-drawer-hero {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Reference-style profile card hero (centered avatar + role chip) */
.j-profile-card-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 8px 8px 4px;
}

.j-drawer-name--centered {
  margin: 4px 0 0;
  text-align: center;
  font-size: 1.2rem;
}

.j-role-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.j-role-chip--hot {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.j-role-chip--active {
  background: rgba(0, 87, 255, 0.12);
  border-color: rgba(0, 87, 255, 0.35);
  color: #93c5fd;
}

.j-role-chip--slow {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.j-role-chip--quiet {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.28);
  color: #fca5a5;
}

.j-drawer-pub-chip--hero {
  margin-top: 2px;
}

/* KPI pair tiles (Task Done / Project Done style) */
.j-kpi-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.j-kpi-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 10px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.j-kpi-tile__icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.j-kpi-tile__n {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #f5f5f5;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.j-kpi-tile__l {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Details label | value list */
.j-details-card {
  padding-top: 12px;
}

.j-details-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.j-details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
}

.j-details-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.j-details-label {
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 500;
}

.j-details-val {
  color: #f5f5f5;
  text-align: right;
  word-break: break-word;
}

.j-details-val--mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.j-details-aws {
  font-weight: 700;
  color: #f87171;
  font-variant-numeric: tabular-nums;
}

.j-details-pub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.j-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
  background: #737373;
}

.j-status-dot--hot { background: #22c55e; }
.j-status-dot--active { background: #3b82f6; }
.j-status-dot--slow { background: #f59e0b; }
.j-status-dot--quiet { background: #ef4444; }

.j-drawer-actions--pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.j-drawer-actions--pair .btn {
  width: 100%;
}

.j-drawer-actions--stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.j-drawer-actions--stack .btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-ghost,
.j-drawer-actions .btn-ghost {
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost:hover {
  color: #93c5fd;
  border-color: rgba(0, 87, 255, 0.4);
  background: rgba(0, 87, 255, 0.08);
}

.j-brief-hint {
  margin: 4px 0 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
}

/* Article activity timeline */
.j-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.j-timeline-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
  padding: 10px 0;
  position: relative;
}

.j-timeline-item:not(:last-child) .j-timeline-dot::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 22px;
  bottom: -10px;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.j-timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  border: 2px solid rgba(147, 197, 253, 0.55);
  background: rgba(0, 87, 255, 0.25);
  position: relative;
  justify-self: center;
}

.j-timeline-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #f5f5f5;
  text-decoration: none;
  line-height: 1.35;
}

a.j-timeline-title:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.j-timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.j-timeline-when {
  margin-left: auto;
}

.j-timeline-empty {
  text-align: center;
  padding: 16px 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.j-timeline-empty p {
  margin: 6px 0 0;
}

/* Publications list (full profile) */
.j-pubs-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.j-pubs-head,
.j-pubs-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.6fr) 100px 72px 36px;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
}

.j-pubs-head {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.j-pubs-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.j-pubs-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.j-pubs-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.j-pubs-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: #f5f5f5;
}

.j-pubs-role,
.j-pubs-count {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.j-pubs-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Full profile overlay — solid chrome (not transparent over list) */
.j-full-profile {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
}

.j-full-profile.is-open {
  display: block;
}

.j-full-profile__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 7, 10, 0.78);
  backdrop-filter: blur(10px);
}

.j-full-profile__shell {
  position: absolute;
  inset: 20px;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #111318;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.j-full-profile__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  padding: 12px 16px 12px 20px;
  background: #191c22;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.j-full-profile__toolbar-left {
  min-width: 0;
}

.j-full-profile__eyebrow {
  display: block;
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.j-full-profile__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f5f5f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(52vw, 420px);
}

.j-full-profile__toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.j-full-profile__toolbar-right .btn-sm {
  padding: 7px 12px;
  font-size: 0.75rem;
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.j-full-profile__close {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e5e5;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.j-full-profile__close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.j-full-profile__close i,
.j-full-profile__close svg {
  width: 16px;
  height: 16px;
}

.j-full-profile__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 0;
  overflow: hidden;
  background: #111318;
}

.j-full-profile__card {
  background: #151820;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  min-height: 0;
  box-shadow: none;
}

.j-full-profile__main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 20px;
  background: #111318;
}

.j-full-panel {
  background: #191c22;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: none;
}

.j-full-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.j-full-panel__head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #f5f5f5;
}

.j-full-panel--timeline {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.j-full-panel--timeline .j-full-panel__body {
  flex: 1;
  max-height: none;
  overflow: auto;
  min-height: 180px;
}

body.j-full-profile-open {
  overflow: hidden;
}

body.light-theme .j-full-profile__shell {
  background: #f8f7f4;
  border-color: #e4e2dd;
}

body.light-theme .j-full-profile__toolbar,
body.light-theme .j-full-panel {
  background: #fff;
  border-color: #e4e2dd;
}

body.light-theme .j-full-profile__body,
body.light-theme .j-full-profile__main {
  background: #f8f7f4;
}

body.light-theme .j-full-profile__card {
  background: #fff;
  border-color: #e4e2dd;
}

body.light-theme .j-full-profile__title {
  color: #171717;
}

@media (max-width: 900px) {
  .j-full-profile__shell {
    inset: 8px;
  }
  .j-full-profile__body {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .j-full-profile__card {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    max-height: none;
  }
  .j-full-profile__toolbar-right .btn-sm {
    display: none;
  }
  .j-pubs-head,
  .j-pubs-row {
    grid-template-columns: 1fr 72px 36px;
  }
  .j-pubs-head span:nth-child(2),
  .j-pubs-row .j-pubs-role {
    display: none;
  }
}

/* Profile tabs */
.j-profile-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-color);
}

.j-profile-tab {
  flex: 1;
  padding: 7px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

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

.j-profile-tab.is-on {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.35);
}

.j-profile-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.j-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.j-mini-stat {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
}

.j-mini-stat__n {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #f5f5f5;
  font-variant-numeric: tabular-nums;
}

.j-mini-stat__n--sm {
  font-size: 0.78rem;
  letter-spacing: -0.02em;
}

.j-mini-stat__l {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.j-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.j-stat-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.j-stat-val {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #f5f5f5;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 6px;
}

.j-stat-val--aws {
  color: #f87171;
}

.j-stat-val--sm {
  font-size: 0.95rem;
}

.j-stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.j-activity-summary,
.j-tip-text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.j-drawer-tip {
  border-style: dashed;
}

.j-drawer-name {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.j-drawer-pub-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  color: #e5e5e5;
}

.j-drawer-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.j-drawer-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a3a3a3;
  margin-bottom: 8px;
}

.j-drawer-score {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.j-drawer-score-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: #f87171;
  margin-top: 2px;
}

.j-drawer-pub-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.j-drawer-beats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.j-contact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.j-contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
}

.j-contact-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a3a3a3;
  flex-shrink: 0;
}

/* Simple Icons (https://github.com/simple-icons/simple-icons) */
.si-icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  fill: currentColor;
}

.j-contact-si,
.j-contact-label .si-icon {
  width: 13px;
  height: 13px;
  opacity: 0.9;
}

.profile-social-link .si-icon,
.profile-socials .si-icon {
  width: 16px;
  height: 16px;
}

a:hover .si-icon {
  opacity: 1;
}

.j-contact-value {
  font-family: var(--font-mono);
  color: #f5f5f5;
  text-align: right;
  word-break: break-all;
}

.j-contact-link {
  color: #93c5fd !important;
  text-decoration: none;
}

.j-contact-link:hover {
  text-decoration: underline;
}

.j-contact-empty {
  color: #737373;
  font-size: 0.78rem;
}

.j-verify-btn {
  margin-top: 12px;
  width: 100%;
  background: var(--accent-indigo, #6366f1);
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

.j-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.j-drawer-actions .btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

body.light-theme .j-row {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .j-directory-head {
  background: var(--bg-card, #fafafa);
}

body.light-theme .j-drawer-name,
body.light-theme .j-contact-value {
  color: var(--text-primary);
}

body.light-theme .j-drawer-card {
  background: rgba(0, 0, 0, 0.02);
}

body.light-theme .j-chip.is-on {
  background: rgba(0, 87, 255, 0.1);
  color: #0047d6;
}

body.light-theme .j-profile-tab.is-on {
  background: rgba(0, 87, 255, 0.1);
  color: #0047d6;
}

body.light-theme .j-search-input {
  background: #fff;
}

body.light-theme .j-mini-stat__n,
body.light-theme .j-stat-val,
body.light-theme .j-kpi-tile__n,
body.light-theme .j-details-val {
  color: var(--text-primary);
}

body.light-theme .j-action-btn:hover,
body.light-theme .j-action-btn:focus-visible {
  color: #0047d6;
  background: rgba(0, 87, 255, 0.08);
  border-color: rgba(0, 87, 255, 0.22);
}

body.light-theme .j-details-row {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .j-kpi-tile {
  background: rgba(0, 0, 0, 0.02);
}

@media (max-width: 900px) {
  .j-filter-main {
    flex-direction: column;
    align-items: stretch;
  }
  .j-search-wrap {
    max-width: none;
  }
  .j-chip-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .j-panel.j-more-cols .j-directory-head,
  .j-row--wide {
    grid-template-columns: 1.4fr 1fr 90px 64px 48px;
  }
  .j-panel.j-more-cols .j-directory-head span:nth-child(3),
  .j-panel.j-more-cols .j-directory-head span:nth-child(6),
  .j-row--wide .j-row__beats,
  .j-row--wide .j-row__date {
    display: none;
  }
  .j-drawer-actions--pair {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .j-tool-btn span {
    display: none;
  }
  .j-panel-sub {
    display: none;
  }
}


/* ── PR OS Calendar ── */
.cal-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 0;
}

.cal-panel-header {
  flex-shrink: 0;
}

.cal-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cal-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 4px 8px;
}

.cal-month-label {
  margin: 0;
  min-width: 150px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cal-nav-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.cal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.cal-nav-btn--sm {
  width: 28px;
  height: 28px;
}

.cal-nav-btn i,
.cal-nav-btn svg {
  width: 16px;
  height: 16px;
}

.cal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
  padding-bottom: 8px;
}

.cal-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px;
  min-height: 0;
  overflow: auto;
}

.cal-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-mini-label {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text-primary);
}

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

.cal-mini-dow {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0;
}

.cal-mini-day {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  border-radius: 8px;
  height: 28px;
  cursor: pointer;
}

.cal-mini-day.is-empty {
  pointer-events: none;
}

.cal-mini-day.has-items {
  font-weight: 700;
  color: #e5e5e5;
}

.cal-mini-day.is-today {
  box-shadow: inset 0 0 0 1px rgba(0, 87, 255, 0.55);
  color: #93c5fd;
}

.cal-mini-day.is-selected,
.cal-mini-day:hover {
  background: rgba(0, 87, 255, 0.18);
  color: #fff;
}

.cal-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.cal-filters-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.cal-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.cal-filter input {
  accent-color: #0057ff;
}

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

.cal-dot--campaign { background: #a78bfa; }
.cal-dot--article { background: #3b82f6; }
.cal-dot--event { background: #f59e0b; }
.cal-dot--appearance { background: #22c55e; }

.cal-day-detail {
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.cal-day-detail-empty {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cal-day-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-day-item {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 8px;
  align-items: start;
}

.cal-day-item-title {
  font-size: 0.8rem;
  color: #f5f5f5;
  line-height: 1.35;
}

.cal-day-item-title a {
  color: #93c5fd;
  text-decoration: none;
}

.cal-day-item-title a:hover {
  text-decoration: underline;
}

.cal-day-item-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.cal-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.cal-dow span {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 0;
}

.cal-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(96px, 1fr);
  gap: 4px;
  overflow: auto;
}

.cal-cell {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 6px 8px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-cell:hover {
  border-color: rgba(0, 87, 255, 0.35);
  background: rgba(0, 87, 255, 0.05);
}

.cal-cell.is-muted {
  opacity: 0.4;
}

.cal-cell.is-today {
  border-color: rgba(0, 87, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(0, 87, 255, 0.2);
}

.cal-cell.is-selected {
  border-color: rgba(0, 87, 255, 0.65);
  background: rgba(0, 87, 255, 0.1);
}

.cal-cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-cell-num {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.cal-cell.is-today .cal-cell-num {
  color: #93c5fd;
}

.cal-cell-count {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 1px 6px;
}

.cal-cell-pills {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  overflow: hidden;
}

.cal-pill {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f5f5f5;
}

.cal-pill--campaign {
  background: rgba(167, 139, 250, 0.22);
  color: #ddd6fe;
}

.cal-pill--article {
  background: rgba(59, 130, 246, 0.22);
  color: #bfdbfe;
}

.cal-pill--event {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

.cal-pill--appearance {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.cal-pill--more {
  background: transparent;
  color: var(--text-muted);
  padding-left: 2px;
}

.live-data-badge--footer {
  display: block;
  margin-top: 8px;
  font-size: 0.65rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-lockup .brand-title {
  margin: 0;
  line-height: 1.2;
}

@media (max-width: 960px) {
  .cal-layout {
    grid-template-columns: 1fr;
  }
  .cal-grid {
    grid-auto-rows: minmax(80px, auto);
  }
}

/* List | Calendar — compact segmented control (top-right only) */
.pr-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.pr-view-toggle__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 650;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.pr-view-toggle__btn:hover {
  color: var(--text-primary);
}

.pr-view-toggle__btn.is-on {
  background: rgba(0, 87, 255, 0.22);
  color: #e0ecff;
  box-shadow: inset 0 0 0 1px rgba(0, 87, 255, 0.4);
}

.pr-view-toggle__btn i,
.pr-view-toggle__btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.section-cal-host {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.section-cal-host .cal-panel--embedded {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.cal-embedded-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.cal-layout--embedded {
  flex: 1;
  min-height: 420px;
}

.cal-scope-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.media-channel-icon--brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.media-channel-icon--brand .si-icon {
  width: 18px;
  height: 18px;
}

.sub-tab-btn .si-icon {
  width: 12px;
  height: 12px;
  vertical-align: middle;
}

/* ——— PR metrics / feed (Competitive Analysis, Appearances, Events) ——— */
.pr-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.pr-kpi-card {
  padding: 14px 16px !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}
.pr-kpi-card__value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.pr-kpi-card__value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}
.pr-kpi-card__delta {
  font-size: 0.75rem;
  font-weight: 600;
}
.pr-kpi-card__title {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.pr-kpi-card__sub {
  font-size: 0.65rem;
  color: var(--text-secondary);
}
.pr-kpi-card__chart {
  height: 52px;
  margin-top: auto;
}

.pr-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(62vh, 640px);
  overflow-y: auto;
  padding-right: 4px;
}
.pr-activity-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 16px !important;
}
.pr-activity-card__date {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  text-align: center;
  padding: 8px 4px;
  line-height: 1.15;
}
.pr-activity-card__date .day {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}
.pr-activity-card__date .month {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.pr-activity-card__body h4 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-primary);
}
.pr-activity-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.pr-activity-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pr-activity-card__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.pr-platform-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}
.pr-platform-badge--x { background: rgba(255,255,255,0.1); }
.pr-platform-badge--ig { background: rgba(225,48,108,0.15); color: #f9a8d4; }
.pr-platform-badge--yt { background: rgba(255,0,0,0.12); color: #fca5a5; }
.pr-platform-badge--tt { background: rgba(0,242,234,0.1); color: #67e8f9; }
.pr-platform-badge--web { background: rgba(0,87,255,0.12); color: #93c5fd; }
.pr-platform-badge--spaces { background: rgba(29,155,240,0.15); color: #7dd3fc; }

.pr-section-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  scrollbar-width: thin;
}
.pr-section-rail .pr-rail-card {
  min-width: 240px;
  max-width: 280px;
  flex: 0 0 auto;
  padding: 12px 14px !important;
}
.pr-events-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .pr-events-split { grid-template-columns: 1fr; }
  .pr-activity-card { grid-template-columns: 48px 1fr; }
  .pr-activity-card__actions { grid-column: 2; flex-direction: row; }
}
.pr-chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.pr-chip-toggle input { accent-color: var(--accent-indigo); }
.pr-coming-soon-pill {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
.media-channel-card .pr-est-views {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.media-channel-card .pr-est-views strong {
  color: #86efac;
  font-size: 0.85rem;
}
.pr-chart-panel {
  padding: 16px !important;
  min-height: 220px;
}
.pr-chart-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.pr-chart-panel__head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-family: var(--font-display);
  color: #fff;
}
.pr-chart-panel__head span {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.pr-chart-panel canvas {
  width: 100% !important;
  height: 180px !important;
}
.audit-subtabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
