/* journal-trends — layout + components */

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  padding: 28px 36px;
  line-height: 1.45;
}

/* ── Top nav ──────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;          /* Tour/About wrap to a new line on tiny viewports */
  gap: 10px;
  margin-bottom: clamp(20px, 4vw, 32px);
  padding: clamp(6px, 1.5vw, 10px) 0 clamp(14px, 2.5vw, 22px);
  border-bottom: 1px solid var(--grid);
}

.topbar .topbar-spacer { flex: 1; }

.brand {
  display: inline-flex;
  align-items: center;
  /* Fluid gap: 8 px on phones, up to 18 px on wide screens. */
  gap: clamp(8px, 2vw, 18px);
  text-decoration: none;
  color: var(--text-strong);
  --brand-color: var(--tips-pct);
}
.brand:hover { color: #fff; }

.brand-mark {
  /* Slightly slimmer than before so the now-bigger wordmark fits.
     ~36 px on 320 px phones, up to 88 px on desktop. */
  width:  clamp(36px, 10vw, 88px);
  height: clamp(36px, 10vw, 88px);
  flex-shrink: 0;
}

.brand-text {
  /* Divs naturally stack — display:block via the element type — but we
     keep flex-column explicit for any browser that defaults <div> oddly. */
  display: flex;
  flex-direction: column;
  line-height: 1;
  min-width: 0;
}

.brand-name {
  /* Bigger wordmark across every viewport:
       320 px → ~28 px,
       375 px → ~32 px,
       768 px → ~62 px,
       1200 px+ → 80 px (5 rem cap). */
  font-size: clamp(1.75rem, 8.5vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  white-space: nowrap;
  display: block;
}
.brand .brand-journal { color: #2ea8f5; font-weight: 800; }
.brand .brand-trends  { color: #f7b731; font-weight: 800; padding-left: 0.35ch; }
.brand:hover .brand-journal { color: #58a6ff; }
.brand:hover .brand-trends  { color: #ffc847; }

.brand-tagline {
  /* Much smaller per user request: 10.4–14.4 px range. */
  font-size: clamp(0.65rem, 1.8vw, 0.9rem);
  color: var(--text-muted);
  margin-top: clamp(2px, 0.8vw, 6px);
  font-weight: 500;
  letter-spacing: 0.02em;
  display: block;
}

/* ── Mobile: compact body padding so the brand has more room ─────────────── */
@media (max-width: 600px) {
  body { padding: 16px; }

  /* Card chrome — slim padding so the canvases get more pixels. */
  .card { padding: 14px 14px; }

  /* Card header row: stack title above controls so neither overflows.
     Without this, on phones the "Country: <dropdown> Stacked % Absolute"
     row in the PPS / institution cards gets cut off horizontally. */
  .card-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .card-controls {
    flex-wrap: wrap;
    /* Tighter button padding so 2-3 buttons + a dropdown fit on one row. */
    gap: 6px;
  }
  .card-controls .btn { padding: 5px 10px; font-size: 0.74rem; }
  .country-select { font-size: 0.78rem; padding: 5px 8px; max-width: 160px; }

  /* Tabs row — let extra tabs wrap to a second line rather than scroll. */
  .tabs { flex-wrap: wrap; }
  .tab { padding: 7px 12px; font-size: 0.8rem; }

  /* Canvas height variants — shrink so the chart card stays above the fold
     on phones. The Chart.js responsive option auto-scales the width. */
  .canvas-wrap        { height: 280px; }
  .canvas-wrap-sm     { height: 220px; }
  .canvas-wrap-md     { height: 300px; }
  .canvas-wrap-lg     { height: 340px; }

  /* PPS-tab specifics. */
  .pps-status      { font-size: 0.72rem; gap: 10px; }
  .pps-status .pps-key { font-size: 0.72rem; }

  /* The legend wrap on stacked-bar charts gets unwieldy with 15-20 chips.
     Cap its height on mobile so it scrolls instead of pushing the chart
     below the fold. */
  .legend-wrap {
    max-height: 100px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 380px) {
  body { padding: 12px; }
  .brand-tagline { white-space: normal; }
  .canvas-wrap        { height: 240px; }
  .canvas-wrap-sm     { height: 200px; }
  .canvas-wrap-md     { height: 260px; }
  .canvas-wrap-lg     { height: 300px; }
}

.topbar-link {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-family: inherit;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.topbar-link:hover { color: var(--text); border-color: var(--border); background: var(--surface); }

/* ── Page header (under nav) ─────────────────────────────────────── */

header.app-header {
  margin-bottom: 22px;
}

header.app-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 6px;
  line-height: 1.25;
}

header.app-header .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 760px;
}

header.app-header .subtitle a { color: var(--link); text-decoration: none; }
header.app-header .subtitle a:hover { text-decoration: underline; }

/* ── Search bar ───────────────────────────────────────────────────── */

.search-wrap {
  position: relative;
  margin-bottom: 22px;
  max-width: 720px;
}

.search-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.search-input {
  flex: 1;
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}

#search-lookup-btn { padding: 0 20px; font-size: 0.9rem; }

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

.autocomplete-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 360px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: var(--shadow-tooltip);
}

.autocomplete-list.visible { display: block; }

.autocomplete-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--grid);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--surface-2);
}

.autocomplete-name { color: var(--text); font-size: 0.88rem; }
.autocomplete-meta { color: var(--text-muted); font-size: 0.72rem; }
.autocomplete-meta strong { color: var(--text-body); font-weight: 600; }

.autocomplete-empty {
  padding: 14px;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

/* ── Selected source banner ───────────────────────────────────────── */

.selected-source {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.selected-source.visible { display: flex; }

.selected-source .name { font-weight: 600; color: var(--text-strong); }
.selected-source .meta { color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; }
.selected-source .actions { display: flex; gap: 8px; }

/* ── Buttons ──────────────────────────────────────────────────────── */

.btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.btn:hover { border-color: var(--link); color: var(--link); }
.btn.primary { background: var(--link-strong); border-color: var(--link-strong); color: #fff; }
.btn.primary:hover { background: #1664d6; border-color: #1664d6; color: #fff; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.active { background: var(--link-strong); border-color: var(--link-strong); color: #fff; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* One-shot pulse that runs three times to draw the user's eye to a non-default
   toggle option (e.g. "Stacked %" when "Absolute" is the default). Triggered
   by adding the .blink-hint class after each chart render. */
.btn.blink-hint {
  animation: blink-hint-pulse 0.55s ease-in-out 3;
}
@keyframes blink-hint-pulse {
  0%, 100% {
    background: var(--surface);
    color: var(--text-muted);
    border-color: var(--border);
    box-shadow: 0 0 0 0 rgba(46, 168, 245, 0);
  }
  50% {
    background: rgba(46, 168, 245, 0.18);
    color: var(--link);
    border-color: var(--link);
    box-shadow: 0 0 0 4px rgba(46, 168, 245, 0.18);
  }
}

/* ── Modal ────────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

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

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  max-width: 520px;
  width: calc(100% - 40px);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  box-shadow: var(--shadow-tooltip);
}

.modal.modal-wide { max-width: 720px; }
.modal h3 {
  margin-top: 18px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.modal .about-list {
  list-style: disc inside;
  font-size: 0.86rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 16px;
}
.modal .about-list li { margin-bottom: 4px; }
.modal .disclaimer {
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--text-body);
  background: rgba(248, 81, 73, 0.06);
  border: 1px solid rgba(248, 81, 73, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 18px;
}

.modal h2 {
  font-size: 1.15rem;
  color: var(--text-strong);
  margin-bottom: 8px;
}

.modal p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 18px;
  line-height: 1.55;
}

.modal label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal input[type="email"],
.modal input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.modal input:focus { border-color: var(--link); }

.modal .modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}

.modal .field-group { margin-bottom: 14px; }

.modal .radio-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.modal .radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.modal .radio-row:hover { border-color: var(--link); }
.modal .radio-row.selected { border-color: var(--link); background: var(--surface-2); }

/* ── Progress ─────────────────────────────────────────────────────── */

.progress-wrap {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 22px;
}

.progress-wrap.visible { display: block; }

.progress-status {
  font-size: 0.85rem;
  color: var(--text-body);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.progress-status .pct { color: var(--link); font-weight: 600; }

.progress-bar {
  height: 8px;
  background: var(--grid);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--link-strong);
  width: 0%;
  transition: width .2s;
}

/* ── Tabs ─────────────────────────────────────────────────────────── */

.tabs-wrap {
  display: none;
  margin-top: 8px;
}

.tabs-wrap.visible { display: block; }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 9px 18px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}

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

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

/* ── Cards / charts ───────────────────────────────────────────────── */

.charts-grid { display: grid; gap: 22px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;            /* anchor for .card-share */
}

/* ── Per-chart share button + popover (v0.10) ────────────────────────── */

.card-share {
  position: absolute;
  top: 10px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px 5px 8px;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: 500 0.72rem/1 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
  z-index: 5;
  transition: color .15s, border-color .15s, background .15s;
}
.card-share:hover,
.card-share[aria-expanded="true"] {
  color: var(--link);
  border-color: var(--link);
  background: var(--surface-2);
}
.card-share svg { display: block; }
.card-share .card-share-label { letter-spacing: 0.02em; }

@media (max-width: 600px) {
  /* On phones, drop the text and just show the icon to save space. */
  .card-share { padding: 6px; }
  .card-share .card-share-label { display: none; }
}

.share-popover {
  position: fixed;
  z-index: 9000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-tooltip);
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.share-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  color: var(--text-body);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  width: 100%;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.share-action:hover {
  background: var(--surface-2);
  color: var(--text-strong);
}

.share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
/* Brand monograms for LinkedIn / X / Instagram — small CSS-only marks so we
   don't ship any image assets. */
.share-icon-linkedin::before {
  content: "in";
  font-weight: 800;
  font-size: 11px;
  color: #fff;
  background: #0a66c2;
  padding: 2px 4px;
  border-radius: 3px;
  font-style: italic;
}
.share-icon-x::before {
  content: "𝕏";
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.share-icon-instagram::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f9ce34 0%, #ee2a7b 50%, #6228d7 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}

/* Transient toast for "Copied" / Instagram-hint messages */
.share-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-tooltip);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 9999;
}
.share-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.card-title {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 14px;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.card-header-row .card-title { margin-bottom: 0; }
.card-controls { display: flex; gap: 6px; align-items: center; }

/* PPS tab specifics */
.pps-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.pps-status .pps-key { color: var(--text); font-weight: 600; }
.pps-status .pps-missing { color: var(--text-dim); font-style: italic; }

.pps-empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  color: var(--text-body);
  font-size: 0.9rem;
}
.pps-empty p { margin-bottom: 6px; }
.pps-empty p:last-child { margin-bottom: 0; }

.canvas-wrap        { position: relative; height: 360px; }
.canvas-wrap-sm     { height: 300px; }
.canvas-wrap-md     { height: 380px; }
.canvas-wrap-lg     { height: 420px; }

/* ── Controls (mode toggles, etc.) ────────────────────────────────── */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.controls-label { font-size: 0.8rem; color: var(--text-muted); }

.country-select {
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.country-select:focus { border-color: var(--link); }

/* ── Legend ───────────────────────────────────────────────────────── */

.legend-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-bottom: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  user-select: none;
  transition: opacity .18s, border-color .15s, background .15s;
}

.legend-item:hover          { border-color: #444c56; background: var(--surface); }
.legend-item.dimmed         { opacity: 0.15; }
.legend-item.locked         { border-color: var(--link) !important; background: var(--surface); }
.legend-item.legend-hovered { border-color: #555; background: var(--surface); }

.legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.legend-label { font-size: 0.78rem; color: var(--text-body); white-space: nowrap; }

/* ── Tooltip ──────────────────────────────────────────────────────── */

#tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 15px;
  font-size: 0.77rem;
  color: var(--text);
  z-index: 9999;
  min-width: 220px;
  max-width: 320px;
  box-shadow: var(--shadow-tooltip);
  opacity: 0;
  transition: opacity .1s;
}

#tooltip.vis { opacity: 1; }

.tt-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 9px;
}
.tt-year { font-size: 1rem; font-weight: 700; color: var(--link); }
.tt-total { font-size: 0.72rem; color: var(--text-muted); }
.tt-divider { border: none; border-top: 1px solid var(--grid); margin: 7px 0; }
.tt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 1.5px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.tt-row.on    { color: var(--text-body); }
.tt-row.focus { color: #fff; font-weight: 700; }
.tt-left { display: flex; align-items: center; gap: 5px; }
.tt-swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.tt-right { white-space: nowrap; flex-shrink: 0; }
.tt-foot { font-size: 0.67rem; color: var(--text-dim); margin-top: 7px; }

/* ── Misc ─────────────────────────────────────────────────────────── */

/* ── Tour ──────────────────────────────────────────────────────────── */

.tour-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1500;
  pointer-events: auto;
}
.tour-spotlight {
  position: fixed;
  border-radius: 8px;
  /* cut a hole in the backdrop using a giant box-shadow trick */
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55), 0 0 0 2px var(--link), 0 0 22px rgba(31, 111, 235, 0.6);
  background: transparent;
  pointer-events: none;
  transition: top .15s, left .15s, width .15s, height .15s;
  /* Spotlight sits above backdrop's solid colour. */
  z-index: 1501;
}

.tour-popover {
  position: fixed;
  z-index: 1600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  width: 360px;
  max-width: calc(100vw - 24px);
  box-shadow: var(--shadow-tooltip);
  color: var(--text);
}
.tour-counter {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 6px;
}
.tour-title {
  font-size: 1.05rem;
  color: var(--text-strong);
  margin-bottom: 8px;
}
.tour-body {
  font-size: 0.86rem;
  color: var(--text-body);
  line-height: 1.55;
  margin-bottom: 14px;
}
.tour-body code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.84em;
  color: var(--text);
}
.tour-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tour-actions .tour-spacer { flex: 1; }
.tour-actions .tour-skip {
  font-size: 0.74rem;
  border-color: transparent;
  color: var(--text-muted);
}
.tour-actions .tour-skip:hover { color: var(--text); border-color: var(--border); }

.tour-help-pill {
  display: inline-block;
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 0 7px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
}

/* (The floating "?" tour-launch button was removed in v0.5.0 — its job is now
   the "Tour" link in the top nav.) */

/* ── Attributions footer ───────────────────────────────────────────── */

.attributions {
  margin-top: 40px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: grid;
  gap: 14px;
  font-size: 0.78rem;
}

.attributions .attr-block { display: flex; flex-direction: column; gap: 4px; }
.attributions .attr-label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .07em;
  font-size: 0.7rem;
}
.attributions .attr-body { color: var(--text-body); line-height: 1.55; }
.attributions .attr-cite { color: var(--text-muted); }
.attributions a { color: var(--link); text-decoration: none; }
.attributions a:hover { text-decoration: underline; }
.attributions .disclaimer-block .attr-body {
  color: var(--text-body);
  background: rgba(248, 81, 73, 0.05);
  border: 1px solid rgba(248, 81, 73, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
.link-btn:hover { color: #fff; }

.muted { color: var(--text-muted); }
.error {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  font-size: 0.85rem;
  line-height: 1.55;
}
.error p { margin: 0; }
.error p + p,
.error p + ul,
.error ul + p { margin-top: 8px; }
.error ul {
  list-style: disc;
  padding-left: 22px;
  color: var(--text-body);   /* lighter than the danger red — easier to read */
}
.error ul li { margin-bottom: 2px; }
.error strong { color: var(--text); font-weight: 600; }
.error em { color: var(--text-body); font-style: italic; }
.error a {
  color: #ff8a82;            /* a brighter danger so link reads against the muted ul text */
  text-decoration: underline;
  font-weight: 600;
}
.error a:hover { color: #fff; }
.hidden { display: none !important; }

/* ── Recently-checked box (v0.11) ────────────────────────────────────── */

.recent-wrap {
  margin-bottom: 18px;
}
.recent-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.recent-item {
  flex: 1 1 auto;
  min-width: 220px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-body);
  transition: border-color .15s, background .15s;
}
.recent-item:hover {
  border-color: var(--link);
  background: var(--surface-2);
}
.recent-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-meta {
  display: flex;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.recent-meta strong { color: var(--text-body); font-weight: 600; }
.recent-meta .recent-date { color: var(--text-dim); }

@media (max-width: 600px) {
  .recent-list { gap: 6px; }
  .recent-item { min-width: 100%; max-width: 100%; padding: 8px 12px; }
}

/* ── Journals-analysed ticker (v0.11) ────────────────────────────────── */

.ticker {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 20px auto 12px;
  padding: 6px 12px;
  text-align: center;
  flex-wrap: wrap;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.ticker-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.ticker-count {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--tips-pct);
  letter-spacing: -0.005em;
  font-variant-numeric: tabular-nums;
}

/* ── Follow-us LinkedIn block (v0.11.3) ──────────────────────────────── */

.follow-us {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px auto 18px;
  padding: 0 12px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.follow-linkedin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.follow-linkedin:hover,
.follow-linkedin:focus-visible {
  transform: translateY(-1px);
  background: rgba(10, 102, 194, 0.12);    /* LinkedIn brand blue tint */
  box-shadow: 0 0 0 2px rgba(10, 102, 194, 0.35);
  outline: none;
}
.follow-linkedin svg { display: block; }

/* ── Visible FAQ accordion (v0.12 — SEO content) ─────────────────────── */

.faq {
  margin: 56px auto 12px;
  max-width: 880px;
  padding: 0 4px;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.faq-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 10px;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  transition: background .12s, color .12s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "+";
  color: var(--link);
  font-weight: 800;
  font-size: 1.05rem;
  width: 14px;
  flex-shrink: 0;
  text-align: center;
  transition: transform .15s;
}
.faq-item[open] summary::before {
  content: "−";
}
.faq-item summary:hover { background: var(--surface-2); color: var(--text-strong); }
.faq-item[open] { border-color: rgba(46, 168, 245, 0.45); }
.faq-item > p {
  margin: 0;
  padding: 4px 16px 16px 40px;
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--text-body);
}
.faq-item > p a { color: var(--link); text-decoration: none; }
.faq-item > p a:hover { text-decoration: underline; }
.faq-item > p strong { color: var(--text-strong); }
.faq-item > p code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
}

@media (max-width: 600px) {
  .faq { margin-top: 36px; }
  .faq-item summary { font-size: 0.86rem; padding: 11px 12px; }
  .faq-item > p { padding-left: 28px; padding-right: 12px; font-size: 0.83rem; }
}

/* ── Scopus indexing card (v0.14 — Scopus extension list join) ─────────── */

#scopus-card-host { max-width: 1200px; margin: 14px auto 0; padding: 0 16px; }
#scopus-card-host.hidden { display: none; }

.scopus-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid #f5a623;            /* Scopus accent — orange */
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scopus-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.scopus-row-source { gap: 10px; }
.scopus-row-empty .scopus-source-title { color: var(--text-muted); }
.scopus-row-disc {
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

.scopus-pill {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(245, 166, 35, 0.13);     /* orange tint */
  color: #f5a623;
  border: 1px solid rgba(245, 166, 35, 0.35);
}
.scopus-pill-brand { /* Same — kept distinct in case we add a secondary pill */ }

.scopus-source-title {
  font-weight: 600;
  color: var(--text-strong, var(--text));
}

.scopus-meta {
  color: var(--text-muted);
  font-size: 0.81rem;
  margin-left: auto;
}
.scopus-meta code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-ok {
  background: rgba(38, 222, 129, 0.13);
  color: #4ee08a;
  border-color: rgba(38, 222, 129, 0.35);
}
.badge-danger {
  background: rgba(252, 92, 101, 0.14);
  color: #fc5c65;
  border-color: rgba(252, 92, 101, 0.40);
}
.badge-muted {
  background: rgba(140, 148, 159, 0.13);
  color: #c9d1d9;
  border-color: rgba(140, 148, 159, 0.35);
}

.scopus-discont-hard {
  color: #f5a623;
  font-weight: 700;
}
.scopus-discont-soft {
  color: #c9d1d9;
  font-weight: 600;
}

.scopus-foot {
  color: var(--text-muted);
  font-size: 0.72rem;
  border-top: 1px dashed var(--border);
  padding-top: 6px;
  margin-top: 2px;
}

@media (max-width: 600px) {
  #scopus-card-host { padding: 0 12px; }
  .scopus-card { font-size: 0.82rem; padding: 10px 12px; }
  .scopus-meta { margin-left: 0; width: 100%; }
  .scopus-foot { font-size: 0.7rem; }
}
