:root {
  --ink: #17201e;
  --muted: #68716e;
  --paper: #f3f1e9;
  --card: #fffef9;
  --line: #d5d9d0;
  --soft-line: #e8e9e3;
  --acid: #caff3f;
  --blue: #376ff4;
  --coral: #ff735d;
  --amber: #ffc94a;
  --purple: #9974ff;
  --sidebar: #17201e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Manrope, Arial, sans-serif; }
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 238px; padding: 28px 18px;
  display: flex; flex-direction: column; background: var(--sidebar); color: #f8f5e9;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; margin: 0 8px 45px; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--acid); color: var(--acid); font: 500 12px "DM Mono", monospace;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 13px; letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: #97a09d; font-size: 10px; }
nav { display: grid; gap: 5px; }
.nav-item {
  width: 100%; padding: 12px 13px; border: 0; border-left: 2px solid transparent;
  display: flex; align-items: center; gap: 12px; background: transparent; color: #aab1ae;
  cursor: pointer; text-align: left; font-size: 12px;
}
.nav-item span { color: #69736f; font: 400 9px "DM Mono", monospace; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: rgba(202,255,63,.08); border-left-color: var(--acid); }
.nav-item.active span { color: var(--acid); }
.sidebar-note {
  margin-top: auto; padding: 14px 12px; border: 1px solid #38413e;
  display: flex; align-items: flex-start; gap: 9px;
}
.live-dot { width: 8px; height: 8px; margin-top: 3px; background: var(--acid); border-radius: 50%; box-shadow: 0 0 0 4px rgba(202,255,63,.12); }
.sidebar-note p { margin: 0; }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 10px; }
.sidebar-note small { margin-top: 4px; color: #87908d; font: 400 8px/1.4 "DM Mono", monospace; }

main { grid-column: 2; width: 100%; max-width: 1500px; margin: 0 auto; padding: 0 42px 70px; }
.topbar {
  min-height: 110px; display: flex; align-items: center; justify-content: space-between; gap: 25px;
  border-bottom: 1px solid var(--ink);
}
.eyebrow {
  margin: 0 0 7px; color: var(--muted); font: 500 9px/1.3 "DM Mono", monospace;
  letter-spacing: .14em;
}
.topbar h1 { margin: 0; font: 600 27px/1 Newsreader, Georgia, serif; letter-spacing: -.04em; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.freshness { display: flex; align-items: center; gap: 7px; color: var(--muted); font: 400 9px "DM Mono", monospace; }
.freshness i { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); border: 1px solid #6e8f16; }
.button {
  min-height: 38px; padding: 0 14px; border: 1px solid var(--ink); cursor: pointer;
  font: 500 10px "DM Mono", monospace; background: var(--acid);
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button.ghost { background: transparent; }
.button.dark { color: white; background: var(--ink); }
.mobile-menu { display: none; }
.loading-state { min-height: 50vh; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); }
.loading-state > span { width: 26px; height: 26px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
.loading-state p { font: 400 10px "DM Mono", monospace; }
@keyframes spin { to { transform: rotate(360deg); } }

.view { display: none; }
.view.active { display: block; }
.intro-grid {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 8vw; align-items: end;
  padding: 52px 0 38px;
}
.intro-grid h2 { margin: 0; font: 600 clamp(40px, 5vw, 69px)/.94 Newsreader, Georgia, serif; letter-spacing: -.055em; max-width: 790px; }
.intro-grid h2 em { color: var(--blue); font-weight: 500; }
.intro-grid > p { margin: 0 0 4px; color: var(--muted); font: 500 14px/1.65 Manrope, sans-serif; max-width: 450px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: var(--line); gap: 1px; }
.kpi-card { min-height: 155px; padding: 20px; background: var(--card); position: relative; }
.kpi-card > span { position: absolute; right: 15px; top: 15px; color: #9aa19e; font: 400 9px "DM Mono", monospace; }
.kpi-card strong { display: block; font-size: 44px; line-height: 1; letter-spacing: -.075em; }
.kpi-card h3 { margin: 14px 0 3px; font-size: 12px; }
.kpi-card p { margin: 0; color: var(--muted); font-size: 9px; }
.kpi-1 { border-top: 3px solid var(--acid); }
.kpi-2 { border-top: 3px solid var(--blue); }
.kpi-3 { border-top: 3px solid var(--amber); }
.kpi-4 { border-top: 3px solid var(--coral); }

.section { margin-top: 42px; padding-top: 18px; border-top: 1px solid var(--ink); }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.section-head h2, .ranking-intro h2 { margin: 0; font: 600 27px/1 Newsreader, Georgia, serif; letter-spacing: -.04em; }
.section-note { max-width: 600px; margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.text-button { padding: 2px 0; border: 0; border-bottom: 1px solid var(--ink); background: none; cursor: pointer; font-size: 10px; }
.split-section { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; }

.topic-list { border-top: 1px solid var(--line); }
.topic-row {
  width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr) 100px 76px 18px;
  gap: 17px; align-items: center; padding: 18px 4px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; cursor: pointer; text-align: left;
}
.topic-row:hover { background: rgba(255,255,255,.52); }
.topic-rank { color: #8d9692; font: 400 11px "DM Mono", monospace; }
.topic-copy { min-width: 0; }
.topic-copy > strong { display: block; margin: 6px 0 3px; font-size: 15px; letter-spacing: -.025em; overflow-wrap: anywhere; }
.topic-copy > small { display: block; max-width: 650px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-source { display: block; margin-top: 6px; color: #8a928f; font: 400 8px "DM Mono", monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-block; padding: 4px 6px; background: #e9ece5; color: var(--ink); font: 500 8px/1 "DM Mono", monospace; font-style: normal; }
.tag.lime, .category-dot.lime { background: var(--acid); }
.tag.blue, .category-dot.blue { background: #cddcff; }
.tag.purple, .category-dot.purple { background: #dfd6ff; }
.tag.coral, .category-dot.coral { background: #ffd3cb; }
.tag.amber, .category-dot.amber { background: #ffe5a6; }
.tag.outline { border: 1px solid var(--line); background: transparent; color: var(--muted); }
.tag.status-confirmed { background: #e6f7ba; }
.tag.status-pending { background: #ffe5a6; }
.topic-timing small, .topic-timing b { display: block; }
.topic-timing small, .topic-score small { color: var(--muted); font: 400 8px "DM Mono", monospace; }
.topic-timing b { margin-top: 4px; font-size: 10px; }
.topic-score { text-align: right; }
.topic-score b { display: block; font-size: 27px; line-height: 1; letter-spacing: -.07em; }
.row-arrow { color: var(--muted); }
.empty-state { padding: 45px 20px; text-align: center; border: 1px dashed var(--line); color: var(--muted); }
.empty-state strong { color: var(--ink); }
.empty-state p { margin: 7px 0 0; font-size: 11px; }

.region-grid { display: grid; grid-template-columns: repeat(2, 1fr); background: var(--line); border: 1px solid var(--line); gap: 1px; }
.region-grid article { min-height: 132px; padding: 15px; background: var(--card); position: relative; }
.region-grid article > span { position: absolute; right: 12px; top: 12px; color: var(--muted); font: 400 9px "DM Mono", monospace; }
.region-grid strong { display: block; font-size: 27px; }
.region-grid h3 { margin: 8px 0 5px; font-size: 11px; }
.region-grid p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.category-grid { display: grid; gap: 12px; }
.category-grid article { display: grid; grid-template-columns: 1fr 30px; gap: 8px; align-items: center; }
.category-grid article > div:first-child { display: flex; align-items: center; gap: 8px; font-size: 10px; }
.category-dot { display: inline-block; width: 8px; height: 8px; }
.category-grid article > span { text-align: right; font: 500 10px "DM Mono", monospace; }
.bar { grid-column: 1/-1; height: 4px; background: var(--line); }
.bar i { display: block; height: 100%; min-width: 2px; background: var(--ink); }

.collection-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.collection-list.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.collection-card { min-width: 0; padding: 15px; background: var(--card); border: 1px solid var(--line); }
.collection-card.warning { border-color: #e4a441; background: #fffaf0; }
.collection-card header { display: flex; justify-content: space-between; align-items: center; gap: 9px; }
.collection-card header > div { min-width: 0; display: flex; align-items: center; gap: 9px; }
.source-icon { flex: 0 0 auto; width: 31px; height: 31px; display: grid; place-items: center; color: white; background: var(--ink); font: 500 8px "DM Mono", monospace; }
.collection-card header strong, .collection-card header small { display: block; }
.collection-card header strong { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collection-card header small { color: var(--muted); font-size: 8px; margin-top: 3px; }
.health { color: #357342; font: 500 8px "DM Mono", monospace; font-style: normal; white-space: nowrap; }
.health.bad { color: #c14836; }
.run-note { min-height: 30px; margin: 11px 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.collection-card ul { list-style: none; margin: 0; padding: 0; max-height: 270px; overflow: auto; border-top: 1px solid var(--soft-line); }
.collection-card li { display: flex; justify-content: space-between; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--soft-line); font-size: 9px; }
.collection-card li > div { min-width: 0; }
.collection-card li a, .collection-card li div > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.collection-card li a:hover { color: var(--blue); }
.collection-card li small { display: block; margin-top: 3px; color: var(--muted); font: 400 7px "DM Mono", monospace; }
.collection-card li > b { flex: 0 0 auto; color: var(--blue); font: 500 8px "DM Mono", monospace; }
.collection-card .no-events { color: var(--muted); }

.ranking-intro { padding: 47px 0 27px; display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.ranking-intro h2 { font-size: 46px; }
.ranking-intro > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.filter-bar { display: grid; grid-template-columns: minmax(200px, 1.5fr) repeat(3, minmax(130px, .5fr)) auto; gap: 7px; padding: 14px; border: 1px solid var(--line); background: #ebe9e1; }
.filter-bar input, .filter-bar select {
  min-width: 0; height: 39px; padding: 0 11px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); outline: none; font-size: 10px;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(55,111,244,.12); }
.history-filters { grid-template-columns: minmax(190px, 1.5fr) repeat(4, minmax(105px, .5fr)) auto auto; }
.result-summary { padding: 13px 3px; color: var(--muted); font: 400 9px "DM Mono", monospace; }
.result-summary strong { color: var(--ink); }
.inline-loading, .dialog-loading { padding: 50px; text-align: center; color: var(--muted); font: 400 10px "DM Mono", monospace; }

.timeline-list { border-top: 1px solid var(--line); }
.timeline-row {
  width: 100%; display: grid; grid-template-columns: 110px 22px minmax(0, 1fr) 60px;
  align-items: stretch; gap: 14px; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer;
}
.timeline-row:hover { background: rgba(255,255,255,.45); }
.timeline-date { padding: 20px 0; color: var(--muted); font: 400 9px "DM Mono", monospace; }
.timeline-line { position: relative; border-left: 1px solid var(--line); }
.timeline-line i { position: absolute; top: 22px; left: -4px; width: 7px; height: 7px; background: var(--acid); border: 1px solid var(--ink); border-radius: 50%; }
.timeline-copy { padding: 17px 0; border-bottom: 1px solid var(--line); }
.timeline-copy strong, .timeline-copy small { display: block; }
.timeline-copy strong { margin: 6px 0 4px; font-size: 13px; }
.timeline-copy small { color: var(--muted); font-size: 9px; }
.timeline-score { padding: 20px 0; border-bottom: 1px solid var(--line); text-align: right; font-size: 21px; font-weight: 700; }

.source-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.source-card { min-width: 0; padding: 17px; border: 1px solid var(--line); background: var(--card); }
.source-card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.source-card h3 { margin: 16px 0 7px; font-size: 13px; }
.source-card > p { min-height: 39px; margin: 0 0 15px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.source-card dl { margin: 0; border-top: 1px solid var(--soft-line); }
.source-card dl div { display: flex; justify-content: space-between; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--soft-line); font-size: 8px; }
.source-card dt { color: var(--muted); }
.source-card dd { margin: 0; text-align: right; }
.source-card > a { display: inline-block; margin-top: 13px; font-size: 9px; text-decoration: none; border-bottom: 1px solid; }
.source-error { display: block; margin-top: 10px; color: #bd4031; font-size: 8px; overflow-wrap: anywhere; }

dialog {
  width: min(830px, calc(100vw - 30px)); max-height: calc(100vh - 34px); margin: auto;
  padding: 0; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); box-shadow: 0 30px 90px rgba(0,0,0,.23);
}
dialog::backdrop { background: rgba(12,18,16,.68); backdrop-filter: blur(2px); }
.dialog-close { position: sticky; z-index: 2; top: 13px; left: calc(100% - 46px); width: 32px; height: 32px; border: 1px solid var(--ink); background: var(--card); cursor: pointer; font-size: 20px; }
#topic-detail { margin-top: -32px; }
.detail-header { padding: 47px 42px 30px; background: var(--card); border-bottom: 1px solid var(--ink); }
.detail-header h2 { margin: 15px 0 8px; font: 600 42px/1 Newsreader, Georgia, serif; letter-spacing: -.05em; overflow-wrap: anywhere; }
.detail-header > p { max-width: 650px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 25px; border: 1px solid var(--line); }
.detail-stats div { padding: 13px; border-right: 1px solid var(--line); }
.detail-stats div:last-child { border: 0; }
.detail-stats strong, .detail-stats span { display: block; }
.detail-stats strong { font-size: 26px; }
.detail-stats span { color: var(--muted); font: 400 8px "DM Mono", monospace; }
.detail-section { padding: 25px 42px; border-bottom: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 16px; font: 600 20px Newsreader, Georgia, serif; }
.score-breakdown { display: grid; gap: 9px; }
.score-breakdown > div { display: grid; grid-template-columns: 85px 25px 1fr; gap: 9px; align-items: center; font-size: 9px; }
.score-breakdown b { text-align: right; }
.score-breakdown i { height: 5px; background: var(--line); }
.score-breakdown em { display: block; height: 100%; background: var(--blue); }
.method-note { margin: 14px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.region-evidence { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.region-evidence span { padding: 10px; border: 1px solid var(--line); background: var(--card); }
.region-evidence b, .region-evidence small { display: block; }
.region-evidence b { font-size: 10px; }
.region-evidence small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.evidence-list { display: grid; gap: 9px; }
.evidence-list article { padding: 13px; border: 1px solid var(--line); background: var(--card); }
.evidence-list h4 { margin: 8px 0 4px; font-size: 11px; }
.evidence-list h4 a { text-decoration: none; }
.evidence-list h4 a:hover { color: var(--blue); }
.evidence-list p { margin: 0 0 8px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.evidence-list small { color: #8a928f; font: 400 8px "DM Mono", monospace; }
.snapshot-strip { min-height: 95px; display: flex; align-items: flex-end; gap: 5px; overflow-x: auto; }
.snapshot-strip > span { min-width: 37px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.snapshot-strip i { width: 14px; background: var(--blue); }
.snapshot-strip small { margin-top: 5px; color: var(--muted); font: 400 6px "DM Mono", monospace; }

.provider-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 15px 17px; border: 1px solid var(--line); background: var(--card);
}
.provider-banner > div { display: flex; align-items: center; gap: 10px; }
.provider-banner i { width: 9px; height: 9px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 4px rgba(202,255,63,.2); }
.provider-banner strong { font-size: 11px; }
.provider-banner span, .provider-banner small { color: var(--muted); font-size: 9px; }
.provider-banner.needs-config { border-color: #dfa53c; background: #fff8e7; }
.provider-banner.needs-config i { background: var(--amber); box-shadow: 0 0 0 4px rgba(255,201,74,.2); }
.competitor-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 12px;
  gap: 1px; border: 1px solid var(--line); background: var(--line);
}
.competitor-kpis article { padding: 17px; background: var(--card); }
.competitor-kpis strong, .competitor-kpis span { display: block; }
.competitor-kpis strong { font-size: 29px; letter-spacing: -.06em; }
.competitor-kpis span { margin-top: 6px; color: var(--muted); font: 400 8px "DM Mono", monospace; }
.competitor-toolbar {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  margin-top: 34px; padding-top: 17px; border-top: 1px solid var(--ink);
}
.competitor-toolbar label { display: grid; gap: 6px; color: var(--muted); font: 400 8px "DM Mono", monospace; }
.competitor-toolbar select { min-width: 150px; height: 38px; padding: 0 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 10px; }
.keyword-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.keyword-tabs button { padding: 9px 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; text-align: left; }
.keyword-tabs button.active { border-color: var(--ink); background: var(--acid); }
.keyword-tabs strong, .keyword-tabs small { display: block; }
.keyword-tabs strong { font-size: 10px; }
.keyword-tabs small { margin-top: 3px; color: var(--muted); font: 400 7px "DM Mono", monospace; }
.competitor-table-wrap { width: 100%; overflow-x: auto; border-top: 1px solid var(--line); }
.competitor-table { width: 100%; min-width: 930px; border-collapse: collapse; }
.competitor-table th {
  padding: 10px 8px; color: var(--muted); border-bottom: 1px solid var(--line);
  text-align: left; font: 400 8px "DM Mono", monospace;
}
.competitor-table td { padding: 15px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 10px; }
.rank-site { min-width: 290px; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; }
.rank-site > b { color: var(--blue); font: 700 18px Manrope, sans-serif; }
.rank-site span { min-width: 0; }
.rank-site a, .rank-site small, .rank-site em { display: block; max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-site a { font-weight: 700; text-decoration: none; }
.rank-site a:hover { color: var(--blue); }
.rank-site small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.rank-site em { margin-top: 5px; color: #8d9491; font: 400 7px "DM Mono", monospace; font-style: normal; }
.age-badge { display: inline-block; padding: 5px 7px; font: 500 8px "DM Mono", monospace; }
.age-badge.confirmed { background: var(--acid); }
.age-badge.likely { background: #dce6ff; }
.age-badge.older { background: #e7e8e3; color: var(--muted); }
.age-badge.unknown { background: #ffe6ad; }
.age-basis { display: block; margin-top: 5px; color: var(--muted); font-size: 7px; white-space: nowrap; }
.metric-cell { font-size: 13px; letter-spacing: -.04em; }
.row-detail { padding: 7px 9px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 8px; white-space: nowrap; }
.row-detail:hover { border-color: var(--ink); background: var(--card); }
.method-card { max-width: 760px; margin-top: 32px; padding: 18px; border-left: 3px solid var(--blue); background: rgba(255,255,255,.4); }
.method-card h3 { margin: 0 0 8px; font: 600 18px Newsreader, Georgia, serif; }
.method-card > p:last-child { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.visit-site { display: inline-block; margin-top: 14px; padding-bottom: 2px; border-bottom: 1px solid var(--ink); text-decoration: none; font-size: 9px; }
.detail-stats.four { grid-template-columns: repeat(4, 1fr); }
.ranking-history { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ranking-history > span { padding: 11px; border: 1px solid var(--line); background: var(--card); }
.ranking-history b, .ranking-history strong, .ranking-history small { display: block; }
.ranking-history b { color: var(--blue); font-size: 18px; }
.ranking-history strong { margin-top: 5px; font-size: 9px; }
.ranking-history small { margin-top: 4px; color: var(--muted); font-size: 7px; }
.backlink-list { display: grid; gap: 8px; }
.backlink-list article { padding: 12px; border: 1px solid var(--line); background: var(--card); }
.backlink-list article > div { display: flex; justify-content: space-between; gap: 10px; }
.backlink-list article > div strong { font-size: 10px; }
.backlink-list article > div span { color: var(--blue); font: 500 8px "DM Mono", monospace; }
.backlink-list a { display: block; margin-top: 7px; color: var(--muted); font-size: 8px; overflow-wrap: anywhere; }
.backlink-list p { margin: 7px 0 4px; font-size: 8px; }
.backlink-list small { color: var(--muted); font: 400 7px "DM Mono", monospace; }
.age-evidence { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.age-evidence > div { padding: 12px; border: 1px solid var(--line); background: var(--card); }
.age-evidence span, .age-evidence strong { display: block; }
.age-evidence span { color: var(--muted); font-size: 8px; }
.age-evidence strong { margin-top: 5px; font-size: 10px; }

.site-action-panel {
  display: grid; grid-template-columns: minmax(260px, .8fr) minmax(460px, 1.2fr);
  gap: 28px; padding: 22px; border: 1px solid var(--ink); background: var(--card);
}
.site-action-copy h3 { margin: 5px 0 9px; font: 600 25px Newsreader, Georgia, serif; }
.site-action-copy > p:last-child { max-width: 500px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.site-action-form { display: grid; grid-template-columns: 1.25fr .75fr; gap: 9px; align-items: end; }
.site-action-form label { display: grid; gap: 6px; color: var(--muted); font: 400 8px "DM Mono", monospace; }
.site-action-form input {
  width: 100%; min-width: 0; height: 40px; padding: 0 11px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); outline: none;
}
.site-action-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(55,111,244,.12); }
.site-action-buttons { grid-column: 1/-1; display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }
.site-action-buttons .button { min-width: 135px; }
#site-provider { margin-top: 12px; }
.site-section { margin-top: 42px; }
.site-monitor-table { min-width: 900px; }
.site-domain-cell { min-width: 235px; }
.site-domain-cell > a, .site-domain-cell > strong, .site-domain-cell > small {
  display: block; max-width: 390px; overflow: hidden; text-overflow: ellipsis;
}
.site-domain-cell > a { font-weight: 700; text-decoration: none; white-space: nowrap; }
.site-domain-cell > a:hover { color: var(--blue); }
.site-domain-cell > small, .site-domain-cell > a + a {
  margin-top: 5px; color: var(--muted); font-size: 7px; overflow-wrap: anywhere;
}
.site-domain-cell > a + a { white-space: normal; font-weight: 400; }
.monitor-status {
  display: inline-block; padding: 5px 7px; background: #e8f5c5;
  font: 500 8px "DM Mono", monospace; white-space: nowrap;
}
.monitor-status.bad { background: #ffd5ce; color: #9e2f23; }
.monitor-status.pending { background: #ffe6ad; color: #79540e; }
.monitor-error { display: block; max-width: 230px; margin-top: 6px; color: #a53629; font-size: 7px; line-height: 1.4; }
.sitemap-change-list { margin-top: 23px; border-top: 1px solid var(--ink); }
.change-list-head { padding: 18px 0 9px; }
.change-list-head h3 { margin: 2px 0 0; font: 600 20px Newsreader, Georgia, serif; }
.sitemap-change-list > article {
  display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px;
  align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line);
}
.change-badge { display: inline-block; padding: 5px 7px; text-align: center; font: 500 8px "DM Mono", monospace; }
.change-badge.added { background: var(--acid); }
.change-badge.removed { background: #ffd3cb; }
.change-badge.updated { background: #cddcff; }
.sitemap-change-list article a, .sitemap-change-list article small { display: block; }
.sitemap-change-list article a { overflow: hidden; color: var(--ink); font-size: 9px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.sitemap-change-list article a:hover { color: var(--blue); }
.sitemap-change-list article small { margin-top: 4px; color: var(--muted); font: 400 7px "DM Mono", monospace; }
.compact-empty { margin-top: 15px; padding: 24px 15px; }
#backlink-target-tabs { margin-bottom: 13px; }
.backlink-summary-head { padding: 14px 16px; border: 1px solid var(--line); background: var(--card); }
.backlink-summary-head strong, .backlink-summary-head small { display: block; }
.backlink-summary-head strong { font-size: 15px; }
.backlink-summary-head small { margin-top: 5px; color: var(--muted); font: 400 8px "DM Mono", monospace; }
.backlink-kpis { margin: 0 0 18px; border-top: 0; }
.backlink-explorer-table { min-width: 940px; }
.backlink-explorer-table td { max-width: 310px; }

.toast {
  position: fixed; z-index: 50; right: 24px; bottom: 24px; padding: 12px 16px;
  background: var(--ink); color: white; opacity: 0; transform: translateY(15px); pointer-events: none;
  transition: .2s ease; font-size: 10px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a53629; }

@media (max-width: 1150px) {
  .collection-list.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-overview { grid-template-columns: repeat(2, 1fr); }
  .ranking-history { grid-template-columns: repeat(2, 1fr); }
  .site-action-panel { grid-template-columns: 1fr; }
  .filter-bar, .history-filters { grid-template-columns: repeat(3, 1fr); }
  .filter-bar input { grid-column: span 2; }
}

@media (max-width: 800px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 10px 0 40px rgba(0,0,0,.25); }
  body.nav-open .sidebar { transform: translateX(0); }
  main { padding: 0 18px 50px; }
  .mobile-menu { display: block; width: 34px; height: 34px; border: 1px solid var(--ink); background: transparent; cursor: pointer; }
  .topbar { min-height: 86px; }
  .topbar > div:nth-child(2) { margin-right: auto; }
  .topbar-actions .freshness { display: none; }
  .intro-grid, .split-section { grid-template-columns: 1fr; gap: 20px; }
  .intro-grid { padding-top: 36px; }
  .intro-grid h2 { font-size: 45px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .topic-row { grid-template-columns: 32px minmax(0, 1fr) 58px 13px; }
  .topic-timing { display: none; }
  .collection-list, .collection-list.compact { grid-template-columns: 1fr; }
  .ranking-intro { display: block; }
  .ranking-intro h2 { font-size: 38px; }
  .ranking-intro > p { margin-top: 13px; }
  .site-action-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 570px) {
  .topbar h1 { font-size: 22px; }
  .topbar-actions .button { padding: 0 9px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-card { min-height: 130px; padding: 15px; }
  .kpi-card strong { font-size: 36px; }
  .filter-bar, .history-filters { grid-template-columns: 1fr 1fr; }
  .filter-bar input { grid-column: 1/-1; }
  .topic-row { grid-template-columns: 26px minmax(0, 1fr) 47px; gap: 9px; }
  .row-arrow { display: none; }
  .topic-copy > small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .topic-score b { font-size: 22px; }
  .source-overview { grid-template-columns: 1fr; }
  .provider-banner, .competitor-toolbar { display: block; }
  .provider-banner > small { display: block; margin-top: 8px; }
  .competitor-kpis { grid-template-columns: repeat(2, 1fr); }
  .competitor-toolbar label { margin-top: 14px; }
  .ranking-history, .age-evidence { grid-template-columns: 1fr; }
  .site-action-panel { padding: 16px; }
  .site-action-form { grid-template-columns: 1fr; }
  .site-action-buttons { display: grid; }
  .site-action-buttons .button { width: 100%; }
  .timeline-row { grid-template-columns: 78px 15px minmax(0, 1fr) 38px; gap: 8px; }
  .timeline-date { font-size: 7px; }
  .detail-header, .detail-section { padding-left: 20px; padding-right: 20px; }
  .detail-header h2 { font-size: 32px; }
}
