:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel2: #1c232d;
  --border: #273041;
  --text: #e6ebf2;
  --muted: #93a1b3;
  --accent: #4da3ff;
  --good: #3fd68f;
  --ok: #a8d05a;
  --warn: #ffb454;
  --bad: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }

.ticker {
  overflow: hidden;
  white-space: nowrap;
  background: rgba(14,17,22,.94);
  border-bottom: 1px solid var(--border);
  padding: 5px 0;
  position: relative;
}
.ticker:not(.ready) { display: none; }
.ticker-track {
  display: inline-block;
  white-space: nowrap;
  padding-right: 0;
  animation: ticker-scroll 80s linear infinite;
  will-change: transform;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-right: 30px;
  font-size: 12.5px;
  color: var(--muted);
}
.ticker-item b { color: var(--text); font-weight: 600; }
.ticker-item .stars { font-size: 12px; }
.ticker-text { max-width: 420px; overflow: hidden; text-overflow: ellipsis; }

.site-head {
  position: sticky;
  top: 0;
  z-index: 60;
}

.topbar-menu {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 9px 32px;
  background: rgba(14,17,22,.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.menu-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .3px;
}
.menu-logo .mark { display: flex; }
.menu-logo-text { white-space: nowrap; }

.brand-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel2);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.brand-count::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
}
.mf-reset {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--bad);
  background: rgba(229, 72, 77, .1);
  color: var(--bad);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: .15s;
}
.mf-reset:hover { background: rgba(229, 72, 77, .18); }

.menu-search { flex: 1; max-width: 430px; position: relative; color: var(--muted); }
.menu-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.menu-search input {
  width: 100%;
  padding: 9px 30px 9px 35px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  outline: none;
  font-size: 13.5px;
  font-family: inherit;
}
.menu-search input:focus { border-color: var(--accent); }
.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--border);
  color: var(--text);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: opacity .15s;
}
.search-clear:hover { background: var(--muted); }
.search-clear[hidden] { display: none; }

.menu-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 80px;
  padding: 7px 10px;
  border-radius: 10px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: .15s;
  white-space: nowrap;
}
.menu-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.menu-item.active { color: var(--accent); }
.menu-item.accent { color: var(--warn); }

.menu-user { display: flex; align-items: center; gap: 8px; }
.menu-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.menu-chip:hover { border-color: var(--bad); color: var(--bad); }

.page-head { padding: 22px 0 12px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: .2px; }
.page-head .subtitle { flex-basis: 100%; }
.subtitle { margin: 0; color: var(--muted); font-size: 13.5px; }

main { padding: 0 32px 48px; }

.table-wrap {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: auto;
}

.versus-controls { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.versus-controls .btn-mini { padding: 7px 12px; }
.vs-hint { margin-left: auto; color: var(--muted); font-size: 12px; }
.versus-table { border-collapse: separate; border-spacing: 0; min-width: 700px; }
.versus-table thead th,
.versus-table td {
  border: 1px solid var(--border);
  border-top: none;
  border-left: none;
  vertical-align: top;
  font-size: 13px;
}
.versus-table thead th:first-child,
.versus-table td:first-child { border-left: 1px solid var(--border); }
.versus-table thead th {
  position: static;
  z-index: auto;
  text-transform: none;
  letter-spacing: normal;
  cursor: default;
  padding: 12px;
  font-size: 13px;
  white-space: normal;
}
.versus-table thead th:first-child,
.versus-table td:first-child { width: 200px; }
.versus-table td:first-child {
  color: var(--muted);
  font-weight: 600;
  font-size: 12.5px;
  background: var(--panel2);
}
.vs-corner-th { color: var(--muted); font-weight: 700; }
.vs-head { display: flex; align-items: flex-start; gap: 6px; }
.vs-input-wrap { position: relative; flex: 1; min-width: 0; }
.vs-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.vs-input:focus { border-color: var(--accent); outline: none; }
.vs-drop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
  display: none;
}
.vs-drop.open { display: block; }
.vs-drop li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.vs-drop li:hover { background: var(--panel2); color: var(--accent); }
.vs-drop li .vs-dcnt { margin-left: auto; color: var(--muted); font-size: 11px; }
.vs-drop li.vs-none { color: var(--muted); font-style: italic; cursor: default; }
.vs-drop li.vs-none:hover { background: none; color: var(--muted); }
.vs-x {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 7px;
  background: rgba(229, 72, 77, .12);
  color: var(--bad);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.vs-x:disabled { opacity: .35; cursor: default; }
.vs-sub { margin-top: 7px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.vs-empty { color: var(--muted); font-size: 12px; }
.vs-last-date { font-weight: 600; margin-bottom: 3px; }
.vs-last-txt { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.vs-chart { width: 100%; position: relative; }
.vs-chart svg { display: block; width: 100%; height: auto; touch-action: none; }

table { width: 100%; border-collapse: collapse; min-width: 700px; }

thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--panel2);
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
thead th.no-filter { cursor: default; }
th .sort-ind { margin-left: 6px; font-size: 9px; color: var(--accent); }
.col-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 9px;
  font-style: normal;
  text-transform: lowercase;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: super;
  cursor: help;
  user-select: none;
}
.col-info:hover { background: var(--accent); color: var(--bg); }
th.filtered::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 6px;
  vertical-align: middle;
}

#brand-table { table-layout: fixed; }
#brand-table th:nth-child(1) { width: 64px; }
#brand-table th:nth-child(2) { width: 150px; }
#brand-table th[data-key="avg"] { width: 170px; white-space: nowrap; }
#brand-table th[data-key="count"] { width: 120px; white-space: nowrap; }
#brand-table th.c-spark { width: 108px; white-space: nowrap; }

#brand-table.hide-logo .c-logo,
#brand-table.hide-name .c-name,
#brand-table.hide-avg .c-avg,
#brand-table.hide-count .c-count,
#brand-table.hide-spark .c-spark,
#brand-table.hide-last .c-last { display: none; }

#brand-table th:last-child { width: 48px; }
th.no-filter.col-menu { text-align: center; cursor: default; }
.cols-btn {
  background: var(--panel2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s;
}
.cols-btn:hover { border-color: var(--accent); color: var(--accent); }
.cols-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 6px;
  z-index: 45;
  width: 172px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
  padding: 8px;
}
.cols-menu.hidden { display: none; }

tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: #1b222c; }
tbody tr:last-child td { border-bottom: none; }

.logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  color: #fff;
  letter-spacing: .5px;
}
.logo.big { width: 52px; height: 52px; font-size: 17px; border-radius: 12px; }

.logo-img-wrap {
  height: 32px;
  width: max-content;
  min-width: 48px;
  padding: 0 7px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-img-wrap .brand-logo { height: 24px; max-width: 46px; object-fit: contain; display: block; }
.logo-img-wrap.big { height: 52px; border-radius: 12px; padding: 0 10px; }
.logo-img-wrap.big .brand-logo { height: 38px; max-width: 74px; }

.brand-cell { vertical-align: middle; }
.brand-inner { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.brand-cell .brand-name { font-weight: 600; font-size: 15px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-cell .brand-country { display: inline-flex; cursor: help; }

.count-cell { font-weight: 700; font-size: 14px; color: var(--text); white-space: nowrap; }
.count-new { font-size: 10px; font-weight: 700; margin-left: 3px; color: var(--good); line-height: 1; cursor: help; }

.flag-line { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.flag-line svg { border-radius: 3px; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,.14); }

.score {
  display: inline-block;
  min-width: 54px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}
.score.g1 { color: var(--good); background: rgba(63,214,143,.12); }
.score.g2 { color: var(--ok); background: rgba(168,208,90,.12); }
.score.g3 { color: var(--warn); background: rgba(255,180,84,.13); }
.score.g4 { color: var(--bad); background: rgba(255,107,107,.15); }

.c-spark { text-align: left; }
.spark {
  display: block;
  height: 26px;
  overflow: visible;
}
.spark polyline,
.spark circle { stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { stroke-width: 1.4; }
.spark-up polyline { stroke: var(--good); }
.spark-up circle { fill: var(--good); }
.spark-down polyline { stroke: var(--bad); }
.spark-down circle { fill: var(--bad); }
.spark-flat polyline { stroke: var(--muted); }
.spark-flat circle { fill: var(--muted); }
.spark-empty {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  height: 100%;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.delta { font-size: 10px; font-weight: 700; margin-left: 4px; line-height: 1; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--muted); }
.delta { cursor: help; }

.lr-text { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-meta { font-size: 12px; color: var(--muted); }

.empty-row td { text-align: center; color: var(--muted); padding: 36px; cursor: default; }
.empty-link { color: var(--accent); cursor: pointer; text-decoration: underline; }

.popover {
  position: absolute;
  z-index: 30;
  width: 264px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
  padding: 12px;
}
.popover.hidden { display: none; }
.pop-title { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 2px 0 8px; }
.pop-body { max-height: 260px; overflow: auto; }

.opt {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 13.5px;
  cursor: pointer;
}
.opt:hover { background: rgba(255,255,255,.05); }
.opt input { accent-color: var(--accent); }
.opt .cnt { margin-left: auto; color: var(--muted); font-size: 11.5px; }

.txt-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
}
.txt-input:focus { border-color: var(--accent); }

.pop-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.btn-mini {
  flex: 1;
  padding: 6px 8px;
  font-size: 12.5px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.btn-mini:hover { border-color: var(--accent); color: var(--accent); }
.btn-mini.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.link-reset {
  margin-left: auto;
  flex: none;
  background: none; border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.link-reset:hover { color: var(--bad); }

.overlay { position: fixed; inset: 0; background: rgba(5,8,12,.62); backdrop-filter: blur(2px); z-index: 70; }
.overlay.hidden { display: none; }

.drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: min(880px, 94vw);
  background: var(--panel);
  border-left: 1px solid var(--border);
  z-index: 80;
  transform: translateX(102%);
  transition: transform .28s ease;
  overflow-y: auto;
  padding: 24px 28px 48px;
}
.drawer.open { transform: translateX(0); }

.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.dh-left { display: flex; align-items: center; gap: 16px; }
.drawer-head h2 { margin: 0 0 4px; font-size: 24px; }
.country-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.country-line a { color: var(--accent); text-decoration: none; }
.country-line a:hover { text-decoration: underline; }

.brand-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.brand-facts .fact { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.fact-flag { flex: 0 0 auto; display: block; width: 22px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); object-fit: cover; }

.brand-desc { font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-line; }
.icon-btn {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 34px; height: 34px;
  border-radius: 9px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  flex: none;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

.stat-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 26px; }
.chip { background: var(--panel2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.chip-label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.chip-value { font-size: 22px; font-weight: 700; }

.drawer h3 { font-size: 16px; margin: 0 0 12px; }

.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 8px; font-size: 12.5px; color: var(--muted); }
.lg { display: flex; align-items: center; gap: 6px; }
.dot-l { width: 10px; height: 10px; border-radius: 3px; }

.chart { position: relative; background: var(--panel2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 6px 4px; }
.chart svg { display: block; width: 100%; height: auto; touch-action: none; }

.grid { stroke: rgba(147,161,179,.14); stroke-width: 1; }
.axis-y { fill: var(--muted); font-size: 10px; text-anchor: end; }
.axis-x { fill: var(--muted); font-size: 8px; text-anchor: start; }
.bar { fill: rgba(77,163,255,.16); }
.pt { fill: rgba(77,163,255,.8); }
.line-avg { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; }
.dot-avg { fill: var(--accent); }
.guide { stroke: rgba(230,235,242,.35); stroke-width: 1; stroke-dasharray: 3 3; }
.focus-ring { fill: none; stroke: #fff; stroke-width: 1.6; }

.tooltip {
  position: absolute;
  transform: translateX(-50%);
  pointer-events: none;
  background: #0b0e13;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  z-index: 5;
  white-space: nowrap;
}
.tooltip b { font-size: 12.5px; }
.tooltip.hidden { display: none; }

.recent ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.review-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.rc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.stars { letter-spacing: 2px; font-size: 13.5px; color: var(--warn); white-space: nowrap; }
.stars.good { color: var(--good); }
.stars.bad { color: var(--bad); }
.src-chip { background: rgba(77,163,255,.12); color: var(--accent); border-radius: 6px; padding: 2px 8px; font-size: 11.5px; }
.rc-author { color: var(--text); font-size: 12.5px; }
.rc-date { margin-left: auto; }
.rc-report {
  background: var(--accent);
  color: #0b0f14;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .15s;
}
.rc-report:hover { filter: brightness(1.12); }
.rc-text { font-size: 13.5px; line-height: 1.5; }
.rc-cat { display: inline-block; margin-top: 8px; font-size: 11.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.rc-sku { font-weight: 700; color: var(--accent); text-decoration: none; cursor: pointer; }
.rc-sku:hover { text-decoration: underline; }

.rv-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rc-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photo-thumb {
  display: block;
  width: 74px;
  height: 74px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: zoom-in;
  flex: none;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(4,6,10,.92);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}
.lightbox.hidden { display: none; }
.lightbox img.lb-img {
  max-width: 94vw;
  max-height: 84vh;
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,.65);
  background: #fff;
}
.lightbox .lb-nav { display: flex; gap: 10px; }
.lightbox .lb-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(20,26,34,.8);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
}
.lightbox .lb-counter { color: var(--muted); font-size: 12.5px; }

.report-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 380px;
  background: var(--panel2);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
  z-index: 95;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  animation: toastIn .25s ease;
}
.report-toast.out { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.rt-count {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #0b0f14;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.reviews-table { min-width: 600px; }
.reviews-table thead th { cursor: default; }
.rv-score { white-space: nowrap; width: 140px; }
.rv-score .stars { font-size: 15px; }
.rv-brand { width: 200px; }
.rv-brand-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.rv-brand-cell:hover { color: var(--accent); }
.rv-text-body { font-size: 13.5px; line-height: 1.5; margin-bottom: 4px; }

.load-more-wrap { display: flex; justify-content: center; padding: 18px 0 4px; }
.btn-more {
  padding: 10px 28px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.btn-more:hover { border-color: var(--accent); color: var(--accent); }

#view-login { display: flex; justify-content: center; padding-top: 7vh; }

.login-card,
.modal-card {
  width: min(380px, 92vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card h2,
.modal-card h2 { margin: 0 0 2px; font-size: 20px; text-align: center; }

.login-card label,
.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.login-card input,
.modal-card select,
.modal-card textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.login-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus { border-color: var(--accent); }
.modal-card textarea { resize: vertical; }
.modal-card select option { background: var(--panel2); }

.login-error {
  color: var(--bad);
  font-size: 13px;
  background: rgba(255,107,107,.1);
  border-radius: 8px;
  padding: 8px 11px;
}

.btn-primary {
  padding: 11px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary:hover { filter: brightness(1.12); }

.modal-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(430px, 94vw);
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
}

.star-picker {
  display: flex;
  gap: 4px;
  font-size: 27px;
  line-height: 1.1;
  cursor: pointer;
  user-select: none;
}
.pick-star { color: #39434f; transition: color .1s, transform .1s; }
.pick-star.on { color: var(--warn); }
.pick-star:hover { transform: scale(1.15); }

.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn-mini { flex: 1; padding: 10px; font-size: 13.5px; }

.m-filters { display: none; }

@media (max-width: 767px) {
  .topbar-menu {
    flex-wrap: wrap;
    padding: 8px 14px;
    gap: 6px 10px;
  }
  .menu-logo-text { display: none; }
  .menu-search { order: 3; flex-basis: 100%; max-width: none; }
  .menu-nav { margin-left: auto; gap: 2px; }
  .menu-item { min-width: 62px; padding: 6px 6px; font-size: 11px; }
  .menu-chip { padding: 6px 10px; font-size: 12px; }

  main { padding: 0 14px 40px; }
  .page-head { padding: 16px 0 10px; }
  .page-head h1 { font-size: 20px; }
  .subtitle { font-size: 12.5px; }

  #view-login { padding-top: 24px; }

  .drawer { width: 100vw; padding: 18px 14px 40px; }
  .stat-chips { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
  .chip-value { font-size: 19px; }

  .table-wrap {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
  }

  #view-versus .table-wrap {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow-x: auto;
  }

  #brand-table, .reviews-table { min-width: 0; }
  #brand-table thead, .reviews-table thead { display: none; }

  .m-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
  }
  .mf-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
  }
  .m-filters button {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel2);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
  }
  .m-filters button:hover { border-color: var(--accent); color: var(--accent); }
  .m-filters button.filtered { border-color: var(--accent); color: var(--accent); }
  .m-filters button.filtered::after { content: ' •'; }

  #brand-table tbody tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px 12px;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
  }
  #brand-table tbody td { display: block; padding: 0; border: none; }
  #brand-table td:nth-child(1) { grid-area: 1 / 1 / 2 / 2; }
  #brand-table td:nth-child(2) { grid-area: 1 / 2 / 2 / 3; font-size: 16px; }
  #brand-table td:nth-child(3) { grid-area: 2 / 1 / 3 / 2; }
  #brand-table td:nth-child(4) { grid-area: 2 / 2 / 3 / 3; justify-self: start; }
  #brand-table td:nth-child(5) { grid-area: 2 / 3 / 3 / 4; justify-self: end; }
  #brand-table td:nth-child(6) { grid-area: 3 / 1 / 4 / -1; }
  #brand-table td[data-l]::before {
    content: attr(data-l);
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin-bottom: 3px;
  }
  .lr-text {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .reviews-table tbody tr {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
  }
  .reviews-table tbody td { display: block; padding: 0; border: none; }
  .rv-score { grid-area: 1 / 1 / 2 / 2; width: auto; }
  .rv-brand { grid-area: 1 / 2 / 2 / 3; width: auto; }
  .rv-text { grid-area: 2 / 1 / 3 / -1; }

  .empty-row td { display: block; }

  .report-toast {
    right: 14px;
    left: 14px;
    bottom: 14px;
    max-width: none;
  }
}

/* brand/product review cell */
.rv-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.rv-brand-name { font-weight: 600; }
.rv-product { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* brand parts breakdown in drawer */
.parts-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.parts-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
}
.pp-name { font-size: 13px; color: var(--text); }
.pp-avg { font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 8px; min-width: 42px; text-align: center; }
.pp-count { font-size: 11px; color: var(--muted); white-space: nowrap; }


