:root {
  --brand: #04774A;
  --brand-dark: #05613C;
  --brand-light: #E8F3EE;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f5f7f6;
  --card: #ffffff;
  --warn: #fff7ed;
  --danger: #b42318;
  --attention: #b54708;
  font-family: "Golos Text", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.test-banner {
  background: #7a2e0b;
  color: #fff7ef;
  text-align: center;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
}

.navbar-app {
  background: var(--brand);
  color: #fff;
  padding: 0.7rem 1.25rem;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.navbar-app .brand {
  font-family: Onest, "Golos Text", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  text-decoration: none;
}
.navbar-app .brand span { opacity: 0.75; font-weight: 500; margin-left: 0.35rem; }
.navbar-app nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  margin-right: 1rem;
  font-size: 0.95rem;
}
.navbar-app nav a:hover,
.navbar-app nav a.active { color: #fff; text-decoration: underline; }
.navbar-app .scope {
  margin-left: auto;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
}

.coverage-banner {
  background: #fff4e5;
  color: #7a2e0b;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid #f0d7b2;
  font-weight: 600;
}

main { padding: 1.25rem; max-width: 1180px; margin: 0 auto; }
h1 {
  margin: 0 0 0.75rem;
  font-family: Onest, "Golos Text", sans-serif;
  font-size: 1.55rem;
}
h2 { font-size: 1.1rem; margin: 1.5rem 0 0.75rem; }
.muted { color: var(--muted); }

.toolbar, .tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin: 0.6rem 0 1rem; }
.tabs a, button, .btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-size: 0.9rem;
}
.tabs a.active, .btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); }
.search {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.search input, .search select {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  font: inherit;
  min-width: 180px;
  background: #fff;
}

.card-list { display: grid; gap: 0.75rem; }
.review-card, .widget, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}
.review-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
}
.review-card .sp {
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.review-card .text { white-space: pre-wrap; line-height: 1.45; }
.review-card .topics {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--brand-dark);
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rating { font-weight: 700; color: var(--brand-dark); }
.badge {
  display: inline-block;
  background: var(--brand-light);
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.78rem;
}
.widgets { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.widget.severity-critical { border-left: 4px solid var(--danger); }
.widget.severity-attention { border-left: 4px solid var(--attention); }
.widget h2 { margin: 0 0 0.35rem; font-size: 1rem; }
.widget p { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.92rem; }

.grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.9rem;
}
.grid th, .grid td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}
.grid th {
  background: #f8faf9;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
tr.warn td { background: var(--warn); }
.actions button { margin: 0 0.25rem 0.25rem 0; }
.pager { display: flex; gap: 0.75rem; align-items: center; margin-top: 1rem; color: var(--muted); }
.widget-top { display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
.widget .subtitle { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.92rem; }
.widget-bottom { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.widget .metric { font-family: Onest, sans-serif; font-size: 1.35rem; font-weight: 700; color: var(--brand-dark); }
.icon-btn { border: none; background: transparent; cursor: pointer; font-size: 1rem; padding: 0.1rem; }
.empty {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 1.25rem;
  color: var(--muted);
}
.empty-ok { text-align: center; padding: 2rem 1rem; }
.ok-mark { color: var(--brand); font-size: 2rem; margin-bottom: 0.5rem; }
.tone-bar {
  display: flex;
  width: 120px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef2f0;
}
.tone-bar .neg { background: #b42318; }
.tone-bar .neu { background: #9ca3af; }
.tone-bar .pos { background: #04774A; }
.topics-grid tr.row-link { cursor: pointer; }
.topics-grid tr.row-link:hover td { background: #f3faf6; }
.topics-grid tr.critical-topic td:first-child {
  box-shadow: inset 3px 0 0 #b42318;
}
.topic-name { padding-left: 0.35rem; }
td.slow { color: #b42318; font-weight: 600; }
.panel { margin-bottom: 1rem; }
.spark { display: block; }
