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

:root {
  --bg: #0d0f14;
  --bg2: #131720;
  --bg3: #1a1f2e;
  --border: #232a3b;
  --border-hover: #3b4a68;
  --blue: #3b82f6;
  --blue-dim: #1d3b6b;
  --blue-light: #93c5fd;
  --gold: #f59e0b;
  --gold-dim: #78450a;
  --green: #22c55e;
  --green-dim: #14532d;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #4b5563;
  --card-bg: #131720;
  --card-hover: #1a1f2e;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* ── Light Theme ─────────────────────────────────────────────────────────────── */
body.light {
  --bg: #f4f6fb;
  --bg2: #ffffff;
  --bg3: #e8edf5;
  --border: #d1d9e6;
  --border-hover: #9baac4;
  --blue: #2563eb;
  --blue-dim: #dbeafe;
  --blue-light: #1d4ed8;
  --gold: #d97706;
  --gold-dim: #fde68a;
  --green: #16a34a;
  --green-dim: #dcfce7;
  --text: #0f172a;
  --text-dim: #475569;
  --text-muted: #94a3b8;
  --card-bg: #ffffff;
  --card-hover: #f0f4fb;
  --shadow: 0 4px 20px rgba(0,0,0,0.10);
}

html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 2400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.header-logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.35));
  cursor: pointer;
  transition: filter 0.3s ease;
  outline: none;
}

.header-logo:hover {
  animation: spin-wheel 1.4s linear infinite;
  filter:
    drop-shadow(0 0 8px rgba(245, 158, 11, 0.9))
    drop-shadow(0 0 20px rgba(245, 158, 11, 0.6))
    drop-shadow(0 0 40px rgba(251, 191, 36, 0.4))
    brightness(1.3);
}

.header-logo.logo-spin {
  animation: spin-click 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  filter:
    drop-shadow(0 0 8px rgba(245, 158, 11, 0.9))
    drop-shadow(0 0 20px rgba(245, 158, 11, 0.6))
    drop-shadow(0 0 40px rgba(251, 191, 36, 0.4))
    brightness(1.3);
}

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

/* ── Rolling wheel (refresh) ─────────────────────────────────────────────────── */
.rolling-wheel {
  position: fixed;
  top: 62px;
  left: 0;
  width: 48px;
  height: 48px;
  z-index: 1000;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.75));
  animation: roll-bounce 4s linear infinite;
}

@keyframes roll-bounce {
  0%   { transform: translateX(105vw)  rotate(0deg);    }
  50%  { transform: translateX(-5vw)   rotate(-720deg); }
  100% { transform: translateX(105vw)  rotate(0deg);    }
}

@keyframes spin-click {
  0%   { transform: rotate(0deg)   scale(1); }
  30%  { transform: rotate(180deg) scale(1.12); }
  70%  { transform: rotate(330deg) scale(1.08); }
  90%  { transform: rotate(365deg) scale(1.03); }
  100% { transform: rotate(360deg) scale(1); }
}

.flag { font-size: 2rem; line-height: 1; }

h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.subtitle {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 1px;
}

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

.status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

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

.status-dot.spinning {
  background: var(--gold);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg3);
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 0 16px;
  height: 36px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
}

.btn-refresh:hover { background: var(--border); color: var(--text); }
.btn-refresh:active { transform: scale(0.97); }
.btn-refresh svg { width: 14px; height: 14px; }
.btn-refresh.loading { background: var(--blue-dim); color: var(--blue-light); border-color: var(--blue); }
.btn-refresh.loading svg { animation: spin 1s linear infinite; }

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

.btn-theme {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  color: var(--text-dim);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.btn-theme:hover { background: var(--border); color: var(--text); }
.btn-theme svg { width: 16px; height: 16px; }

/* ── Main layout ────────────────────────────────────────────────────────────── */
.main {
  max-width: 2400px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Stats Bar ──────────────────────────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

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

.stat-card--clickable {
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
}

.stat-card--clickable:hover {
  border-color: var(--blue-light);
  background: var(--bg3);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99, 179, 237, 0.15);
}

.stat-card--clickable:active {
  transform: translateY(0);
  box-shadow: none;
}

.stat-label--link {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-link-icon {
  font-size: 0.65rem;
  opacity: 0;
  transform: translate(-2px, 2px);
  transition: opacity 0.18s, transform 0.18s;
  color: var(--blue-light);
}

.stat-card--clickable:hover .stat-link-icon {
  opacity: 1;
  transform: translate(0, 0);
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


.kw-tag.top { background: var(--gold-dim); color: var(--gold); border-color: #f59e0b44; }

/* ── Filters ─────────────────────────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.filters-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

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

.search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 40px 10px 38px;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--blue); }
.search-input::placeholder { color: var(--text-muted); }

.search-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  line-height: 1;
}

.search-clear:hover { color: var(--text); }

.filter-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 4px;
  white-space: nowrap;
}

.pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 13px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.pill:hover { border-color: var(--gold); color: var(--gold); }
.pill--active,
.market-vertical-tab--active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

.pill--topic-active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

.btn-reset-filters {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin-top: 2px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-reset-filters:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #ef444418;
}

/* ── Articles ─────────────────────────────────────────────────────────────────── */
.articles-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.articles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

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

.sort-pills { display: flex; align-items: center; gap: 7px; }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

/* Article Card */
.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
  color: inherit;
}

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

.card-readmore {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--blue);
  text-decoration: none;
  align-self: flex-start;
  border: 1px solid var(--blue-dim);
  border-radius: 6px;
  padding: 3px 10px;
  transition: background 0.15s, color 0.15s;
}

.card-readmore:hover {
  background: var(--blue-dim);
  color: var(--blue-light);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-source {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.card-lang {
  font-size: 0.65rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 4px;
  color: var(--text-muted);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-summary {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

.card-kw {
  background: var(--bg3);
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 500;
}

.card-cat {
  font-size: 0.68rem;
  color: #A0622A;
  background: #2A1F0F;
  border: 1px solid #A0622A;
  padding: 1px 8px;
  border-radius: 4px;
}

/* ── Fav (star) Button ───────────────────────────────────────────────────────── */
.card-fav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 5px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s, transform 0.15s;
}
.card-fav-btn:hover { color: var(--gold); transform: scale(1.15); }
.card-fav-btn--active { color: var(--gold); }
.card-fav-btn svg { width: 15px; height: 15px; }

/* ── Pin Button ──────────────────────────────────────────────────────────────── */
.card-pin-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 3px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 4px;
  transition: color 0.2s, transform 0.15s;
  margin-left: auto;
}

.card-pin-btn:hover { color: var(--gold); transform: scale(1.15); }
.card-pin-btn--active { color: var(--gold); }
.card-pin-btn svg { width: 15px; height: 15px; }

/* ── Header Actions (saved btn + sort pills) ────────────────────────────────── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-saved {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-saved:hover { border-color: var(--gold); color: var(--gold); }

.btn-saved--active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

.btn-saved svg { width: 14px; height: 14px; flex-shrink: 0; }

.saved-count {
  background: var(--gold);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
}

/* ── Empty state ────────────────────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: 0.3;
}

.empty-state h3 { margin-bottom: 8px; font-size: 1.1rem; }
.empty-state p { font-size: 0.85rem; }

/* ── Loading ──────────────────────────────────────────────────────────────── */
.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

/* ── Pagination ─────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 0;
}

.page-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
}

.page-btn:hover { border-color: var(--border-hover); color: var(--text); }
.page-btn.active {
  background: var(--blue-dim);
  border-color: var(--blue);
  color: var(--blue-light);
  font-weight: 600;
}
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Auth Button ─────────────────────────────────────────────────────────────── */
.btn-login {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0 14px;
  height: 36px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-login:hover { border-color: var(--blue); color: var(--blue-light); }
.btn-login svg   { width: 15px; height: 15px; flex-shrink: 0; }

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 5px 12px 5px 8px;
  border-radius: 8px;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue-dim);
  border: 1px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--blue-light);
  flex-shrink: 0;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
  white-space: nowrap;
}

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

/* ── Auth Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: 16px;
}

.modal-overlay.visible { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border-hover);
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.modal-close:hover { color: var(--text); background: var(--bg3); }

/* ── Sources Modal ───────────────────────────────────────────────────────────── */
.modal--sources {
  max-width: 520px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sources-modal-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}

.sources-modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
}

.sources-modal-item--active {
  cursor: pointer;
  border-color: rgba(34, 197, 94, 0.3);
  transition: background 0.15s, border-color 0.15s;
}

.sources-modal-item--active:hover {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.6);
}

.sources-modal-item--active:focus-visible {
  outline: 2px solid rgba(34, 197, 94, 0.7);
  outline-offset: 2px;
}

.sources-modal-item--inactive { opacity: 0.45; }

.sources-modal-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sources-modal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
}

.sources-modal-dot--active { background: #22c55e; }

.sources-modal-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sources-modal-domain {
  font-size: 0.73rem;
  color: var(--blue-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.sources-modal-item--active .sources-modal-domain {
  color: #22c55e;
}

.sources-modal-count {
  font-size: 0.73rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.sources-modal-count--none { opacity: 0.5; }

.auth-tabs {
  display: flex;
  gap: 3px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.auth-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.auth-tab--active {
  background: var(--bg2);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.auth-form input:focus       { border-color: var(--blue); }
.auth-form input::placeholder { color: var(--text-muted); }

.btn-auth-submit {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 11px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 2px;
}

.btn-auth-submit:hover { background: #2563eb; }

.auth-error {
  color: #f87171;
  font-size: 0.8rem;
  min-height: 1em;
  text-align: center;
  line-height: 1.4;
}

.auth-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  opacity: 0.8;
}

.auth-success {
  color: #4ade80;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.5;
  padding: 4px 0;
}

.auth-form-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: 4px;
}

.btn-forgot-password {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.78rem;
  cursor: pointer;
  text-align: center;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-forgot-password:hover { color: var(--text); }

/* ── Account Modal ───────────────────────────────────────────────────────────── */
.account-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 4px;
}

.account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-username {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin: 0 0 2px;
}

.account-email {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Country Picker Popover ──────────────────────────────────────────────────── */
.country-picker-popover {
  position: fixed;
  z-index: 500;
  background: var(--bg2);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  gap: 8px;
  min-width: 210px;
}

.country-picker-popover.visible { display: flex; }

.country-picker-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.country-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.country-picker-grid button {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.country-picker-grid button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Country badge on cards (saved mode) */
.card-country-badge {
  font-size: 0.65rem;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid #f59e0b44;
  padding: 1px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 14px 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-policy {
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.7;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.5;
}

.footer-credit {
  font-size: 0.72rem;
  margin-top: 4px;
  font-weight: 600;
  background: linear-gradient(90deg, #60a5fa, #a78bfa, #f472b6, #fb923c, #60a5fa);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine-credit 3s linear infinite;
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.6));
}

@keyframes shine-credit {
  0%   { background-position: 0% center; }
  100% { background-position: 300% center; }
}

/* ── Page Navigation ────────────────────────────────────────────────────────── */
.page-nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 71px;
  z-index: 90;
}

.page-nav-inner {
  max-width: 2400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 2px;
}

.page-nav-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 11px 16px 9px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.page-nav-tab:hover { color: var(--text); }

.page-nav-tab--active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

.page-nav-tab svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Insights Page ──────────────────────────────────────────────────────────── */
.page-insights-wrapper {
  max-width: 2400px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.insights-header { display: flex; flex-direction: column; gap: 4px; }

.insights-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.insights-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Company filter tabs */
.insights-company-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.insights-company-tab {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

/* Colored agency tabs: show their brand color on hover */
.insights-company-tab[style*="--tab-accent"]:hover {
  color: var(--tab-accent);
  border-color: var(--tab-accent);
}

.insights-company-tab:hover { border-color: var(--border-hover); color: var(--text); }

.insights-company-tab--active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

/* When a colored tab is active, show its brand color instead of gold */
.insights-company-tab--active[style*="--tab-accent"] {
  background: color-mix(in srgb, var(--tab-accent) 12%, transparent);
  border-color: var(--tab-accent);
  color: var(--tab-accent);
}

/* Cards grid */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.insights-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.1s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.insights-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.insights-card-accent {
  height: 4px;
  width: 100%;
  flex-shrink: 0;
}

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

/* Company header */
.insights-company-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.insights-company-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.insights-company-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.insights-ticker {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Metrics block */
.insights-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.insights-metric { display: flex; flex-direction: column; gap: 3px; }

.insights-metric--full { grid-column: 1 / -1; }

.insights-metric-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.insights-metric-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.insights-revenue-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.insights-revenue {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}

.insights-growth {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 12px;
}

.insights-growth.positive { background: var(--green-dim); color: var(--green); }
.insights-growth.negative { background: #450a0a;           color: #f87171; }

/* Margin bar */
.insights-margin-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.insights-margin-track {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 5px;
}

.insights-margin-fill {
  height: 100%;
  border-radius: 3px;
}

/* Agency tags */
.insights-agencies {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.insights-agency-tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2px 9px;
  border-radius: 11px;
  font-size: 0.67rem;
}

/* Strategic note */
.insights-note {
  font-size: 0.77rem;
  color: var(--text-dim);
  line-height: 1.55;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex: 1;
}

/* IR link */
.insights-ir-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--blue);
  text-decoration: none;
  border: 1px solid var(--blue-dim);
  border-radius: 6px;
  padding: 5px 12px;
  align-self: flex-start;
  transition: background 0.15s, color 0.15s;
  margin-top: auto;
}

.insights-ir-link:hover { background: var(--gold-dim); color: var(--gold); }

/* Merger badge */
.insights-merger-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.67rem;
  font-weight: 600;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid #f59e0b44;
  padding: 2px 9px;
  border-radius: 11px;
  white-space: nowrap;
}

/* ── Language Toggle ─────────────────────────────────────────────────────────── */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  height: 36px;
}

.btn-lang {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.04em;
}

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

.btn-lang--active {
  background: var(--gold-dim);
  color: var(--gold);
}

/* ── Finance & Market — Section headers ──────────────────────────────────────── */
.fm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 6px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  flex-wrap: wrap;
}

.fm-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.03em;
}

.fm-section-title svg { color: var(--gold); flex-shrink: 0; }

.fm-section-badge {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 10px;
}

.fm-empty-state {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 20px 0;
}

/* ── Market Page ─────────────────────────────────────────────────────────────── */
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

/* ── Individual brand card (insights-card style) ────────────────────────────── */
.brand-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.1s, box-shadow 0.2s;
}

.brand-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

.brand-card-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.brand-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-card-meta {
  font-size: 0.67rem;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-card-revenue {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}

.brand-card-note {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-style: italic;
}

.brand-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.brand-vertical-tag {
  font-size: 0.67rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}

.brand-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.brand-card-links .insights-ir-link { margin-top: 0; }

.brand-ag-source-link {
  border-color: var(--gold-dim);
  color: var(--gold);
}
.brand-ag-source-link:hover { background: var(--gold-dim); color: var(--gold); }

/* Brand nuggets */
.brand-nuggets {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.brand-nugget {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.67rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.brand-nugget svg { color: var(--text-dim); flex-shrink: 0; }
.brand-nugget--article svg { color: #60a5fa; }
.brand-nugget--collab svg { color: #34d399; }
.nugget-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 1px;
}
.nugget-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.67rem;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.nugget-link:hover { text-decoration: underline; }
.nugget-desc {
  color: var(--text-muted);
  font-size: 0.67rem;
  display: block;
}
.nugget-date {
  color: var(--text-dim);
  font-size: 0.6rem;
  margin-left: 4px;
}

/* Market group tabs (brand agency filter) */
.market-group-tab { transition: border-color 0.15s, color 0.15s, background 0.15s; }
.market-group-tab--active {
  background: var(--accent-dim, rgba(99,102,241,0.15));
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.market-geo-tab--active {
  background: var(--pill-accent, var(--accent));
  border-color: var(--pill-accent, var(--accent));
  color: #fff;
  font-weight: 700;
}

/* Brand vertical card — styled like insights card (kept for fallback) */
.market-vertical-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.1s, box-shadow 0.2s;
}

.market-vertical-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Reuse insights-card-accent inside market card */
.market-vertical-card .insights-card-accent {
  height: 4px;
  width: 100%;
  flex-shrink: 0;
}

.market-vertical-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.market-vertical-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.market-vertical-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.market-vertical-count {
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--blue-dim);
  color: var(--blue-light);
  padding: 1px 7px;
  border-radius: 10px;
}

.market-brands-list {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.market-brand-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.market-brand-name {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
}

.market-agency-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

/* Card footer: holding group tags */
.market-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.market-holding-tag {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
  border: 1px solid;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.market-vertical-tabs {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (min-width: 1600px) {
  .articles-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .main { padding: 28px 36px; }
  .header-inner { padding: 14px 36px; }
}

@media (min-width: 2000px) {
  .articles-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .main { padding: 28px 48px; }
  .header-inner { padding: 14px 48px; }
}

@media (max-width: 640px) {
  html, body { overflow-x: clip; }
  /* Layout */
  .main { padding: 10px 12px; gap: 10px; }
  .articles-section { min-width: 0; }
  .articles-grid { grid-template-columns: 1fr; min-width: 0; }

  /* Nav tabs : scrollable horizontalement, aligné avec le contenu */
  .page-nav { top: 53px; }
  .page-nav-inner { padding: 0 12px; }
  .page-nav-tab { flex: 1; justify-content: center; padding: 10px 4px 8px; font-size: 0.75rem; gap: 4px; }
  .page-nav-tab svg { display: none; }

  /* Header */
  .header-inner { padding: 10px 14px; gap: 10px; }
  .header-logo { width: 32px; height: 32px; }
  .header-left { gap: 10px; min-width: 0; }
  .header-right { gap: 4px; flex-shrink: 0; }
  h1 { font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .subtitle { display: none; }

  /* Status badge : point seul, sans pilule */
  .status-badge { background: transparent; border-color: transparent; padding: 0 4px; gap: 0; box-shadow: none; }
  .status-badge #statusText { display: none; }

  /* Connexion : bouton carré uniforme */
  .btn-login { width: 36px; height: 36px; padding: 0; gap: 0; justify-content: center; }
  .btn-login span { display: none; }
  .btn-login svg { width: 16px; height: 16px; }

  /* User info : avatar + déconnexion, sans le nom */
  .user-name { display: none; }
  .user-info { padding: 0 8px; height: 36px; gap: 6px; }

  /* Refresh : bouton carré uniforme, même taille que btn-theme */
  .btn-refresh { width: 36px; height: 36px; padding: 0; gap: 0; justify-content: center; border-radius: 8px; }
  .btn-refresh span { display: none; }

  /* Stats */
  .stats-bar { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card { padding: 10px 6px; }
  .stat-value { font-size: 1.1rem; }
  .stat-label { font-size: 0.58rem; letter-spacing: 0; line-height: 1.2; }

  /* Filtres : passage à la ligne sur mobile */
  .filters { padding: 12px; gap: 8px; flex-direction: column; overflow-x: clip; }
  .btn-reset-filters { align-self: flex-start; }
  .filter-pills {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 6px;
  }
  .filter-label { flex-shrink: 0; }

  /* Section articles : empiler le compteur et les actions */
  .articles-header { flex-direction: column; align-items: stretch; gap: 8px; }
  .header-actions { justify-content: space-between; flex-wrap: nowrap; gap: 8px; }
  .sort-pills { gap: 5px; flex-shrink: 0; }

  /* Cartes : padding réduit, empêche tout débordement horizontal */
  .article-card { padding: 14px; gap: 8px; min-width: 0; overflow: hidden; }

  /* Pin button : zone de tap agrandie verticalement, pas de débordement à droite */
  .card-pin-btn {
    padding: 12px 10px;
    margin-top: -10px;
    margin-bottom: -10px;
    margin-right: 0;
    flex-shrink: 0;
  }
  .card-pin-btn svg { width: 17px; height: 17px; }

  /* Pagination : prev/next sur leur propre ligne en dessous des numéros */
  .pagination { flex-wrap: wrap; gap: 6px; padding: 8px 0 4px; }
  .page-btn { padding: 10px 14px; font-size: 0.85rem; }
  .page-btn-prev, .page-btn-next { flex: 1; order: 10; justify-content: center; }
  .page-btn-prev { text-align: center; }
  .page-btn-next { text-align: center; }

  /* Adtech : stack cards on mobile */
  .adtech-grid { grid-template-columns: 1fr; }
  .adtech-card { flex-direction: column; }
  .adtech-card-left { width: 100%; min-height: 140px; border-right: none !important; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; justify-content: flex-start; padding: 16px; gap: 12px; }
  .adtech-spec-row { grid-template-columns: 80px 1fr; }
}

/* ── Adtech Players Page ─────────────────────────────────────────────────────── */
.page-adtech-wrapper {
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 56px;
}

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

.adtech-page-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.adtech-page-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Grid ── */
.adtech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(540px, 100%), 1fr));
  gap: 20px;
}

/* ── Card shell ── */
.adtech-card {
  display: flex;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 230px;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.adtech-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ── LEFT panel ── */
.adtech-card-left {
  width: 36%;
  min-width: 155px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 16px;
  gap: 9px;
  text-align: center;
}

.adtech-logo-circle {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  flex-shrink: 0;
  letter-spacing: -1px;
}

.adtech-brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

.adtech-brand-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.adtech-brand-meta span {
  font-size: 0.64rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.adtech-type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 4px;
}

.adtech-type-chip {
  font-size: 0.59rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  color: #fff;
  white-space: nowrap;
}

/* ── RIGHT panel ── */
.adtech-card-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 14px;
  gap: 10px;
  min-width: 0;
}

.adtech-specs {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.adtech-spec-row {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 10px;
  align-items: baseline;
}

.adtech-spec-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding-top: 2px;
}

.adtech-spec-val {
  font-size: 0.71rem;
  color: var(--text-dim);
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.adtech-spec-val strong {
  color: var(--text);
  font-weight: 700;
}

.adtech-tag-row {
  gap: 3px;
}

.adtech-fmt-tag {
  font-size: 0.59rem;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}

.adtech-buy-tag {
  font-size: 0.59rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  color: #10b981;
  white-space: nowrap;
}

.adtech-emp-tag {
  font-size: 0.61rem;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Strength callout ── */
.adtech-strength-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 11px;
  background: var(--bg3);
  border-radius: 9px;
  border: 1px solid var(--border);
}

.adtech-strength-row > span {
  font-size: 0.71rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.45;
}

/* ── Footer row ── */
.adtech-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.adtech-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.adtech-tech-tag {
  font-size: 0.57rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.adtech-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--bg3);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.adtech-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg2);
  color: var(--text);
}

.adtech-btn--ir {
  background: transparent;
  font-weight: 700;
}

/* ── Adtech: articles panel (top-right) ─────────────────────────────────────── */
.adtech-articles-panel { display: flex; flex-direction: column; gap: 7px; }

/* ── Adform Favorites Page ───────────────────────────────────────────────────── */
.adform-fav-group {
  margin-bottom: 36px;
}

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

.adform-fav-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.adform-fav-card:hover {
  border-color: #0066CC55;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px #0066CC18;
  text-decoration: none;
}

.adform-fav-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.adform-fav-source {
  font-size: 0.68rem;
  font-weight: 600;
  color: #0066CC;
  background: #0066CC12;
  border: 1px solid #0066CC22;
  border-radius: 4px;
  padding: 2px 7px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

.adform-fav-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
  flex: 1;
}

.adform-fav-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.adform-fav-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg3);
  border-radius: 4px;
  padding: 2px 6px;
}

.adtech-articles-hdr {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.adtech-articles-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.adtech-art-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg3);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  min-width: 0;
}

.adtech-art-row:hover {
  border-color: var(--border-hover);
  background: var(--bg2);
}

.adtech-art-title {
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.adtech-art-meta {
  font-size: 0.61rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adtech-art-empty {
  font-size: 0.67rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
}
