:root {
  --bg: #fbfcfe;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --ink: #2d3440;
  --muted: #7a8491;
  --line: #e0e5ec;
  --brand: #c41230;
  --brand-dark: #8d1025;
  --gold: #f0b323;
  --green: #28715d;
  --green-soft: #e8f3ee;
  --red-soft: #fff0f2;
  --shadow: 0 10px 24px rgba(45, 52, 64, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

body.client-snp {
  --brand: #c8182d;
  --brand-dark: #8f1828;
  --gold: #f4b33f;
  --green: #2d7b57;
  --green-soft: #edf7ef;
  --red-soft: #fff1f3;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #211a14;
  color: #fff;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.client-snp .sidebar {
  background: #491821;
}

.client-snp .sidebar-logo-window {
  height: 112px;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
}

.client-snp .sidebar-logo-window img {
  width: 100%;
  height: 88px;
  object-fit: contain;
}

.client-snp .brand-mark p,
.client-snp .side-panel .label {
  color: #f1c2ca;
}

.brand-mark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.siam-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.82;
  user-select: none;
}

.siam-word {
  display: block;
  font-family: "Big Shoulders Display", Impact, sans-serif;
  font-weight: 900;
  letter-spacing: 0;
}

.siam-divider {
  display: flex;
  align-items: center;
}

.siam-divider i {
  display: block;
  height: 2px;
}

.siam-divider b {
  display: block;
  transform: rotate(45deg);
}

.sidebar-logo-window {
  width: 100%;
  height: 128px;
}

.sidebar-logo-window img {
  display: block;
  width: 180px;
  height: 128px;
  object-fit: contain;
}

.brand-mark h1,
.brand-mark p,
.topbar h2,
.topbar p,
.panel h3,
.panel p {
  margin: 0;
}

.brand-mark h1 {
  font-size: 15px;
  line-height: 1.15;
}

.brand-mark p {
  color: #aeb6a8;
  font-size: 12px;
  margin-top: 3px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  color: #f1f4ed;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 900;
}

.nav-group-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-group-toggle b {
  color: #aeb6a8;
  font-size: 12px;
  transition: transform 0.18s ease;
}

.nav-group:not(.open) .nav-group-toggle b {
  transform: rotate(-90deg);
}

.nav-sublist {
  display: grid;
  gap: 3px;
  padding-left: 12px;
  margin-left: 11px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.nav-group:not(.open) .nav-sublist {
  display: none;
}

.nav-item {
  border: 0;
  color: #cdd5c7;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 7px;
  cursor: pointer;
}

.nav-subitem {
  padding: 8px 10px;
  font-size: 12px;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-link {
  text-decoration: none;
}

.language-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.language-toggle button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  color: #cdd5c7;
  background: transparent;
  font-weight: 800;
}

.language-toggle button.active {
  color: #171915;
  background: #fff;
}

.side-panel {
  margin-top: auto;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-partner {
  margin-top: -12px;
  padding: 10px 12px 4px;
}

.sidebar-partner img {
  display: block;
  width: 112px;
  max-width: 100%;
  height: auto;
  opacity: 0.9;
}

.label,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
}

.side-panel .label {
  color: #9da79a;
  margin-top: 7px;
}

.side-panel .label:first-child {
  margin-top: 0;
}

.main {
  min-width: 0;
  padding: 24px 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h2 {
  font-size: 27px;
  line-height: 1.12;
  margin-top: 4px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(132px, 1fr));
  gap: 10px;
  width: 100%;
}

.primary-filters {
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.1fr) minmax(360px, 1.1fr);
  gap: 18px;
}

.filter-group {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.filter-group h3 {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  margin: 0;
}

.filter-controls {
  display: grid;
  gap: 10px;
}

.period-controls {
  grid-template-columns: repeat(2, minmax(132px, 1fr));
}

.selected-store-controls,
.benchmark-store-controls {
  grid-template-columns: minmax(132px, 1fr) minmax(132px, 1fr) minmax(220px, 1.35fr);
}

.individual-store-filters {
  display: none;
}

.individual-store-controls {
  grid-template-columns: minmax(220px, 320px);
}

.primary-filters,
.theme-filter-row {
  grid-column: 1;
}

.topbar > .benchmark-filters {
  grid-template-columns: minmax(132px, 1fr) minmax(132px, 1fr) minmax(260px, 2fr);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.theme-filter-row {
  grid-template-columns: minmax(160px, 240px);
  margin-top: 10px;
}

.score-local-filter {
  display: grid;
  grid-template-columns: minmax(180px, 260px);
  margin: -4px 0 4px;
}

.score-local-filter label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.check-filter {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dropdown-check {
  position: relative;
}

.dropdown-button {
  width: 100%;
  min-height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 11px;
  cursor: pointer;
  text-align: left;
}

.dropdown-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-panel {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  width: min(320px, 92vw);
  max-height: 250px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 16px 32px rgba(45, 52, 64, 0.14);
}

.dropdown-check.open .dropdown-panel {
  display: grid;
  gap: 1px;
}

.check-chip {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 7px;
  min-height: 24px;
  padding: 3px 6px;
  border-radius: 5px;
  background: transparent;
  color: #596371;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.check-chip input {
  width: 13px;
  height: 13px;
  min-height: 0;
  margin: 0;
  justify-self: center;
  align-self: center;
}

.check-chip span,
.check-chip small {
  line-height: 13px;
}

.check-chip small {
  color: var(--muted);
}

.all-chip {
  background: #f2f5f8;
  color: #2f3947;
}

select,
input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 11px;
  outline: none;
}

select:focus,
input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(196, 18, 48, 0.12);
}

.section {
  display: none;
}

.section.active {
  display: grid;
  gap: 18px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.campaign-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi-card {
  padding: 16px;
  display: grid;
  gap: 6px;
  min-height: 116px;
}

.kpi-card span,
.kpi-card small {
  color: var(--muted);
}

.kpi-card strong {
  font-size: 27px;
  line-height: 1.05;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.wide {
  min-width: 0;
}

.panel {
  padding: 16px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.panel h3 {
  font-size: 17px;
}

.panel p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.campaign-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}

.campaign-hero h3 {
  font-size: 24px;
  margin-top: 4px;
}

.campaign-status {
  display: grid;
  gap: 4px;
  min-width: 180px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.campaign-status span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.campaign-status strong {
  font-size: 18px;
}

.campaign-results,
.campaign-verbatims,
.campaign-accordion-list {
  display: grid;
  gap: 10px;
}

.campaign-accordion {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.campaign-accordion summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.campaign-accordion summary::-webkit-details-marker {
  display: none;
}

.campaign-accordion summary::after {
  content: "▾";
  color: var(--muted);
  margin-left: auto;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.campaign-accordion[open] summary::after {
  content: "▴";
}

.campaign-accordion summary span:first-child {
  display: grid;
  gap: 3px;
}

.campaign-accordion summary small {
  color: var(--muted);
}

.campaign-accordion-body {
  display: grid;
  gap: 16px;
  padding: 0 16px 16px;
}

.campaign-question {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.campaign-question h4,
.campaign-question p {
  margin: 0;
}

.campaign-question strong {
  font-size: 18px;
}

.choice-results,
.open-answer-results {
  display: grid;
  gap: 10px;
}

.choice-result-row {
  display: grid;
  gap: 5px;
}

.choice-results p {
  margin: 0;
  color: var(--muted);
}

.inline-metrics {
  gap: 8px;
}

.inline-verbatims {
  display: grid;
  gap: 8px;
}

.campaign-theme-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.bonus-setup-form {
  display: grid;
  gap: 16px;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.setup-grid.compact {
  grid-template-columns: 220px 1fr;
}

.setup-grid label,
.setup-question label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.setup-question-list {
  display: grid;
  gap: 12px;
}

.setup-question {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.setup-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.primary-action {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: #00b050;
  color: #fff;
  font-weight: 900;
}

.trend-grid {
  grid-template-columns: minmax(0, 1fr);
}

.trend-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#allStoresTrendMatrix {
  column-gap: 42px;
  row-gap: 34px;
}

.all-stores-trend-panel {
  background: var(--bg);
  border-color: transparent;
  box-shadow: none;
}

.trend-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  min-width: 0;
}

.trend-card.compact {
  padding-bottom: 6px;
}

#allStoresTrendMatrix .trend-card {
  background: #fff;
  padding: 18px 26px 24px;
}

.mini-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.mini-table.single {
  grid-template-columns: 1fr;
}

.trend-card.compact .mini-table {
  grid-template-columns: minmax(0, 1.35fr) minmax(104px, 0.65fr);
}

.mini-table div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fff;
}

.mini-table strong,
.mini-table span,
.mini-table b {
  display: block;
}

.trend-card.compact .mini-table strong {
  font-size: 12px;
  white-space: nowrap;
}

.mini-table span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.mini-table b {
  font-size: 16px;
  margin-top: 2px;
}

.line-chart {
  width: 100%;
  height: auto;
  min-height: 154px;
}

#allStoresTrendMatrix .line-chart {
  display: block;
  width: 74%;
  min-height: 115px;
  margin: 18px auto 0;
}

.line-chart line {
  stroke: var(--line);
}

.line-chart text {
  fill: var(--muted);
  font-size: 8px;
}

.line-chart .score-label {
  fill: #4e5967;
  font-size: 8px;
  font-weight: 700;
}

.line-chart .axis-label {
  fill: #65707e;
  font-size: 5.8px;
  font-weight: 700;
}

.line-chart .base-label {
  font-size: 5.8px;
  fill: #8b95a1;
}

.line-chart .month-label {
  font-size: 6.2px;
  fill: #65707e;
}

.line-chart .zero-line {
  stroke: #cfd6df;
  stroke-dasharray: 3 3;
}

.line-chart .benchmark-line {
  opacity: 1;
}

.line-marker {
  stroke: #fff;
  stroke-width: 1.4;
}

.line-marker.band-bottom,
.bar-fill.band-bottom {
  fill: #c00000;
  background: #c00000;
}

.line-marker.band-low,
.bar-fill.band-low {
  fill: #ff0000;
  background: #ff0000;
}

.line-marker.band-mid,
.bar-fill.band-mid {
  fill: #ffc000;
  background: #ffc000;
}

.line-marker.band-high,
.bar-fill.band-high {
  fill: #92d050;
  background: #92d050;
}

.line-marker.band-top,
.bar-fill.band-top {
  fill: #3b7d23;
  background: #3b7d23;
}

.percentile-legend {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin: 0 0 4px;
}

.percentile-legend strong {
  color: #465160;
  font-size: 11px;
}

.percentile-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.percentile-legend i {
  display: inline-block;
  width: 18px;
  height: 8px;
  border-radius: 99px;
}

.percentile-legend i.band-bottom {
  background: #c00000;
}

.percentile-legend i.band-low {
  background: #ff0000;
}

.percentile-legend i.band-mid {
  background: #ffc000;
}

.percentile-legend i.band-high {
  background: #92d050;
}

.percentile-legend i.band-top {
  background: #3b7d23;
}

.trend-values-grid {
  display: grid;
  grid-template-columns: 72px repeat(var(--point-count), minmax(0, 1fr)) 22px;
  margin: 6px 0 8px;
  font-size: 9px;
  color: #596371;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.trend-values-grid > * {
  padding: 3px 2px;
  text-align: center;
}

.trend-values-label {
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}

#allStoresTrendMatrix .trend-values-grid {
  width: 74%;
  margin: 10px auto 8px;
}

.trend-values-month {
  color: #65707e;
  font-weight: 700;
}

.trend-values-cell {
  color: #596371;
}

.ai-commentary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.commentary-item {
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.commentary-item strong {
  display: block;
  margin-bottom: 4px;
}

.commentary-item p {
  margin: 0;
  color: var(--muted);
}

.rank-list,
.theme-table,
.store-table,
.response-list {
  display: grid;
  gap: 9px;
}

.rank-row,
.theme-row,
.store-row,
.response-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.rank-row {
  padding: 11px 12px;
  display: grid;
  gap: 8px;
}

.row-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.meter {
  height: 8px;
  overflow: hidden;
  background: #e8ece4;
  border-radius: 99px;
}

.meter-fill {
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
}

.meter-fill.good {
  background: var(--green);
}

.store-row {
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 12px;
}

.store-row {
  grid-template-columns: minmax(110px, 1.2fr) 100px 116px 90px 74px 74px 74px;
}

.theme-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-column {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
}

.metric-column h4 {
  margin: 0 0 2px;
  font-size: 15px;
}

.metric-row {
  display: grid;
  gap: 7px;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.bar-track,
.signed-track {
  position: relative;
  height: 10px;
  background: #e8ece4;
  border-radius: 99px;
  overflow: hidden;
}

.dual-bar {
  display: grid;
  gap: 3px;
}

.bar-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 7px;
}

.bar-line span {
  color: #596371;
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-line.single-bar {
  grid-template-columns: minmax(0, 1fr) 48px;
}

.benchmark-track {
  height: 8px;
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: var(--brand);
}

.bar-fill.good {
  background: #00b050;
}

.bar-fill.bad {
  background: #ff0000;
}

.bar-fill.net {
  background: #ff9300;
}

.bar-fill.benchmark {
  background: #bfbfbf;
  opacity: 1;
}

.theme-score-columns .metric-row {
  min-height: 58px;
}

.theme-score-row .signed-track {
  height: 10px;
}

.score-stack {
  display: grid;
  gap: 18px;
}

.score-panel {
  display: grid;
  gap: 14px;
}

.score-section {
  display: grid;
  gap: 12px;
}

.inline-score-filter {
  display: grid;
  gap: 6px;
  max-width: 260px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inline-score-filter select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #273142;
  padding: 0 10px;
  font-weight: 800;
}

.theme-score-summary .metric-row {
  background: #fff;
}

.signed-track {
  height: 10px;
}

.zero-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #b9c1ca;
}

.negative-side {
  right: auto;
}

.table-head {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sort-head {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  padding: 0;
  cursor: pointer;
}

.sort-head span {
  color: #384252;
}

.summary-bars {
  display: grid;
  gap: 7px;
}

.mini-score {
  display: grid;
  grid-template-columns: 52px 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.mini-score span {
  color: var(--muted);
  font-size: 12px;
}

.mini-score b {
  font-size: 12px;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ecefe8;
  color: #3f463b;
  font-size: 12px;
  font-weight: 700;
}

.pill.positive {
  background: var(--green-soft);
  color: var(--green);
}

.pill.negative {
  background: var(--red-soft);
  color: var(--brand-dark);
}

.theme-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
}

.keyword-filter {
  width: min(420px, 100%);
}

.keyword-list {
  max-height: 96px;
}

.keyword-trend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.keyword-selection {
  display: grid;
  gap: 8px;
}

.keyword-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2px;
}

.keyword-selection-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #384252;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.keyword-selection-actions button:hover {
  border-color: #c6cdd6;
  background: var(--surface-soft);
}

.keyword-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
}

.keyword-check input {
  width: auto;
  min-height: auto;
}

.keyword-check small {
  color: var(--muted);
  font-weight: 700;
}

.response-header {
  align-items: center;
}

.response-header input {
  max-width: 360px;
}

.response-list {
  max-height: 680px;
  overflow: auto;
  padding-right: 4px;
}

.response-card {
  padding: 14px;
}

.response-card blockquote {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.main.verbatim-active .benchmark-filters {
  display: none;
}

.main.all-stores-active .topbar {
  display: none;
}

.main.score-page-active .primary-filters {
  grid-template-columns: minmax(280px, 540px);
}

.main.score-page-active .selected-store-filters,
.main.score-page-active .benchmark-filters,
.main.score-page-active .theme-filter-row label:nth-of-type(n + 2) {
  display: none;
}

.main.score-page-active .theme-filter-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px);
}

.main.theme-score-active .theme-filter-row,
.main.selected-theme-score-active .theme-filter-row,
.main.subtheme-score-active .theme-filter-row,
.main.selected-subtheme-score-active .theme-filter-row,
.main.individual-theme-score-active .theme-filter-row,
.main.individual-subtheme-score-active .theme-filter-row,
.main.individual-keyword-score-active .theme-filter-row {
  display: none;
}

.main.individual-store-active .primary-filters {
  grid-template-columns: minmax(260px, 0.8fr) minmax(260px, 1fr);
}

.main.individual-store-active .selected-store-filters,
.main.individual-store-active .benchmark-filters,
.main.individual-store-active .theme-filter-row {
  display: none;
}

.main.individual-store-active .individual-store-filters {
  display: grid;
}

.main.period-only-active .primary-filters {
  grid-template-columns: minmax(260px, 540px);
}

.main.period-only-active .selected-store-filters,
.main.period-only-active .benchmark-filters,
.main.period-only-active .individual-store-filters,
.main.period-only-active .theme-filter-row {
  display: none;
}

.main.bonus-active .filters,
.main.survey-active .filters {
  display: none;
}

.survey-dashboard-panel {
  min-height: calc(100vh - 48px);
}

.survey-dashboard-frame {
  width: 100%;
  min-height: 820px;
  border: 0;
  border-radius: 8px;
  background: #f4f5f7;
}

.translation {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.snippet-match {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.snippet-match span {
  border-left: 3px solid var(--gold);
  background: var(--surface-soft);
  border-radius: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  padding: 7px 9px;
}

.response-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.small-action {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
  font-weight: 700;
}

.live-summary {
  display: grid;
  gap: 14px;
}

.live-empty {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.live-empty strong {
  color: var(--ink);
}

.live-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.live-kpis div,
.live-recents article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.live-kpis span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.live-kpis strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.live-recents {
  display: grid;
  gap: 8px;
}

.live-recents p,
.live-recents small {
  margin: 5px 0 0;
  color: var(--muted);
}

.survey-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f4f5f7;
}

.survey-shell {
  width: min(460px, 100%);
  min-height: 720px;
  overflow: hidden;
  border: 1px solid #cbd3df;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 20px 46px rgba(45, 52, 64, 0.12);
}

.survey-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 26px 26px 22px;
}

.survey-dashboard-back {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: #273142;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.dashboard-survey-mode .survey-body,
.dashboard-survey-mode {
  background: transparent;
}

.dashboard-survey-mode.survey-body {
  min-height: auto;
  padding: 8px;
}

.dashboard-survey-mode .survey-shell {
  box-shadow: none;
}

.dashboard-survey-mode .survey-dashboard-back {
  display: none;
}

.siam-logo-survey {
  grid-column: 1;
  grid-row: 1 / span 2;
  flex: 0 0 auto;
  color: #c8342c;
}

.siam-logo-survey .siam-word {
  font-size: 31px;
}

.siam-logo-survey .siam-divider {
  gap: 5px;
  margin: 5px 0 6px;
}

.siam-logo-survey .siam-divider i {
  width: 20px;
  background: #c8342c;
}

.siam-logo-survey .siam-divider b {
  width: 6px;
  height: 6px;
  background: #e8a53c;
}

.survey-header-copy {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
}

.survey-header-copy h1 {
  overflow-wrap: anywhere;
}

.survey-language-toggle {
  grid-column: 3;
  grid-row: 2;
  width: 104px;
  margin-left: 0;
  flex: 0 0 auto;
  border-color: #d7dee8;
  background: #f7f9fc;
}

.survey-dashboard-back {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.survey-language-toggle button {
  color: #637086;
}

.survey-language-toggle button.active {
  color: #fff;
  background: #2d3440;
}

.snp-survey-body {
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 232, 218, 0.95), transparent 32%),
    radial-gradient(circle at 86% 4%, rgba(255, 244, 207, 0.9), transparent 28%),
    linear-gradient(160deg, #fff9f3 0%, #f7f2ef 58%, #fff2f3 100%);
}

.snp-survey-body .survey-shell {
  border-color: #ead0c7;
  background: #fffdfb;
  box-shadow: 0 22px 54px rgba(122, 20, 31, 0.16);
}

.snp-survey-header {
  position: relative;
  gap: 14px;
  background: linear-gradient(180deg, #fff 0%, #fff8f4 100%);
  border-bottom: 1px solid #efd9d1;
}

.snp-survey-header::after {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #c9162e 0%, #c9162e 62%, #f4a72d 62%, #f4a72d 100%);
}

.snp-logo-survey {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(122, 20, 31, 0.14);
}

.survey-header p,
.survey-header h1,
.survey-card h2,
.survey-card p {
  margin: 0;
}

.survey-header p {
  color: #637086;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.survey-header h1 {
  font-size: 23px;
  line-height: 1.1;
}

.snp-survey-body .survey-header p {
  color: #8b1726;
}

.snp-survey-body .survey-header h1 {
  color: #2a2630;
}

.snp-survey-body .survey-language-toggle {
  border-color: #ead0c7;
  background: #fff8f4;
}

.snp-survey-body .survey-language-toggle button {
  color: #7d6260;
}

.snp-survey-body .survey-language-toggle button.active {
  color: #fff;
  background: #2b1618;
}

.survey-progress {
  height: 4px;
  background: #e6ebf2;
}

.survey-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: #00b050;
  transition: width 0.25s ease;
}

.snp-survey-body .survey-progress {
  background: #f3ded8;
}

.snp-survey-body .survey-progress span {
  background: linear-gradient(90deg, #c9162e, #f4a72d);
}

.survey-card {
  margin: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.survey-demo-note {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
  border: 1px solid #d7e7d2;
  border-radius: 8px;
  padding: 10px;
  background: #f4fbf1;
  color: #3d4a37;
  font-size: 12px;
}

.survey-demo-note strong {
  color: #273142;
}

.snp-survey-body .survey-card {
  border-color: #efd7ce;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffaf6 0%, #fff 100%);
}

.survey-card h2 {
  margin-top: 12px;
  font-size: 26px;
  line-height: 1.12;
}

.survey-card p {
  margin-top: 12px;
  color: #637086;
  font-size: 17px;
  line-height: 1.38;
}

.survey-card label,
.choice-block {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: var(--ink);
  font-weight: 800;
}

.choice-block {
  border: 0;
  padding: 0;
}

.choice-block legend {
  padding: 0;
  font-weight: 800;
}

.survey-card input,
.survey-card select,
.survey-card textarea {
  width: 100%;
  border: 1px solid #cbd3df;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  color: var(--ink);
  font-weight: 700;
}

.snp-survey-body .survey-card input,
.snp-survey-body .survey-card select,
.snp-survey-body .survey-card textarea {
  border-color: #e2c8c0;
  background: #fff;
}

.snp-survey-body .survey-card input:focus,
.snp-survey-body .survey-card select:focus,
.snp-survey-body .survey-card textarea:focus {
  outline: 2px solid rgba(201, 22, 46, 0.18);
  border-color: #c9162e;
}

.survey-card textarea {
  resize: vertical;
}

.voice-answer {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

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

.voice-record-btn {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: #28a745;
  color: #fff;
  padding: 0 28px;
  font-weight: 900;
}

.voice-record-btn.recording {
  color: #fff;
  border-color: #e60023;
  background: #e60023;
}

.type-mode-btn {
  min-height: 48px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #f0f0f0;
  color: var(--ink);
  padding: 0 28px;
  font-weight: 900;
}

.voice-record-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.voice-textarea.hidden {
  display: none;
}

.voice-status-text {
  min-width: 0;
  color: #637086;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.recording-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  color: #e60023;
  font-size: 13px;
  font-weight: 800;
}

.recording-indicator.active {
  display: flex;
}

.recording-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #e60023;
  animation: pulse 1.3s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.45);
    opacity: 0.45;
  }
}

.survey-tag {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff1d8;
  color: #a45d00;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.snp-survey-body .survey-tag {
  background: #fff1d8;
  color: #9b5a00;
}

.primary-btn,
.secondary-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 900;
}

.primary-btn {
  color: #fff;
  background: #00b050;
}

.snp-survey-body .primary-btn,
.snp-survey-body .voice-record-btn,
.snp-survey-body .rating-round.active,
.snp-survey-body .choice-btn.active {
  border-color: #c9162e;
  background: #c9162e;
}

.snp-survey-body .primary-btn:hover,
.snp-survey-body .voice-record-btn:hover {
  background: #a90f25;
}

.snp-survey-body .secondary-btn,
.snp-survey-body .type-mode-btn {
  border-color: #e7d2ca;
  background: #fff8f4;
}

.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.secondary-btn {
  color: var(--ink);
  background: #fff;
  border-color: #cbd3df;
}

.survey-next {
  width: 100%;
  margin-top: 18px;
}

.survey-rating-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 18px;
}

.rating-round {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd3df;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.rating-round.active,
.choice-btn.active {
  color: #fff;
  border-color: #00b050;
  background: #00b050;
}

.button-row,
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.choice-grid {
  margin-top: 0;
}

.choice-btn {
  min-height: 48px;
  border: 1px solid #cbd3df;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.offer-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.offer-compare div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.offer-compare span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.coupon-code {
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed #00b050;
  border-radius: 8px;
  background: #e8f8ef;
  color: #086b33;
  text-align: center;
  font-size: 28px;
  font-weight: 900;
}

.table-card-body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 14% 14%, rgba(255, 231, 196, 0.85), transparent 34%),
    linear-gradient(135deg, #fff8ef 0%, #f4f6f0 56%, #fbe6e6 100%);
}

.table-card-sheet {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.table-card {
  min-height: 620px;
  display: flex;
  flex-direction: column;
  padding: 34px;
  border: 0;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(80, 21, 20, 0.16);
}

.table-card-front {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #fff 0%, #fff8ef 54%, #fde1df 100%);
}

.table-card-back {
  justify-content: center;
  border-top: 10px solid #00a651;
}

.table-card-brand-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.table-card-brand-row img {
  width: 70px;
  height: 70px;
  border-radius: 14px;
  object-fit: cover;
}

.table-card-brand-row span,
.table-card-brand-row strong {
  display: block;
  text-align: left;
}

.table-card-brand-row span {
  color: #d71920;
  font-size: 16px;
  font-weight: 900;
}

.table-card-brand-row strong {
  margin-top: 2px;
  color: #2d3440;
  font-size: 18px;
}

.table-card-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 20px;
  margin-top: 36px;
}

.table-card-copy-block {
  text-align: left;
}

.table-card-kicker {
  display: inline-flex;
  margin: 0;
  padding: 9px 14px;
  border-radius: 999px;
  background: #d71920;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.table-card h1 {
  margin: 18px 0 0;
  color: #d71920;
  font-size: clamp(52px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

.table-card-copy {
  max-width: 430px;
  margin: 20px 0 0;
  color: #2d3440;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.28;
}

.table-card-copy strong {
  color: #00a651;
}

.table-card-product {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 20px 12px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 1px rgba(215, 25, 32, 0.12);
}

.table-card-product img {
  display: block;
  width: 220px;
  height: 172px;
  object-fit: cover;
  object-position: center 45%;
  border-radius: 16px;
}

.table-card-product span {
  color: #2d3440;
  font-size: 18px;
  font-weight: 900;
}

.receipt-scan-panel {
  display: grid;
  gap: 6px;
  margin-top: 34px;
  padding: 24px;
  border-radius: 18px;
  background: #00a651;
  color: #fff;
  text-align: center;
}

.receipt-scan-panel span {
  font-size: 24px;
  font-weight: 900;
}

.receipt-scan-panel strong {
  font-size: 34px;
  line-height: 1.12;
}

.table-card-small {
  margin: auto 0 0;
  color: #7a4d4b;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.table-card-back h2 {
  margin: 0;
  color: #00a651;
  font-size: 34px;
}

.table-card-back ol {
  margin: 28px 0;
  padding-left: 24px;
  color: #2d3440;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
}

.table-card-back li + li {
  margin-top: 16px;
}

.table-card-back p {
  margin: 0;
  padding: 18px;
  border-radius: 12px;
  background: #f0f8f3;
  color: #28715d;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.35;
}

@media print {
  .table-card-body {
    padding: 0;
    background: #fff;
  }

  .table-card-sheet {
    width: 100%;
    gap: 0;
  }

  .table-card {
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
    page-break-inside: avoid;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .side-panel {
    display: none;
  }

  .topbar,
  .content-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .primary-filters,
  .benchmark-filters,
  .theme-filter-row {
    grid-column: 1;
  }

  .filters,
  .kpi-grid,
  .campaign-kpis,
  .live-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-filters,
  .selected-store-controls,
  .benchmark-store-controls {
    grid-template-columns: 1fr;
  }

  .trend-grid,
  .trend-matrix,
  .theme-columns,
  .campaign-theme-grid,
  .keyword-trend-grid,
  .ai-commentary {
    grid-template-columns: 1fr;
  }

  .campaign-hero {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 16px;
  }

  .sidebar {
    padding: 18px 14px;
  }

  .nav-list,
  .filters,
  .kpi-grid,
  .campaign-kpis,
  .live-kpis,
  .button-row,
  .offer-compare {
    grid-template-columns: 1fr;
  }

  .survey-body {
    padding: 0;
  }

  .survey-shell {
    min-height: 100vh;
    border-radius: 0;
  }

  .survey-header {
    gap: 10px;
    padding: 18px 14px 16px;
  }

  .snp-logo-survey {
    width: 60px;
    height: 60px;
  }

  .survey-language-toggle {
    width: 92px;
  }

  .survey-rating-row {
    gap: 5px;
  }

  .rating-round {
    width: 32px;
    height: 32px;
  }

  .store-row {
    grid-template-columns: 1fr;
  }

  .table-card-body {
    padding: 12px;
  }

  .table-card-sheet {
    grid-template-columns: 1fr;
  }

  .table-head {
    display: none;
  }
}
