:root {
  --bg: #f4f7fc;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --surface-blue: #f2f7ff;
  --text: #152033;
  --text-soft: #627087;
  --text-faint: #8c99ac;
  --border: #e3e9f2;
  --border-strong: #d4deec;
  --primary: #2764e7;
  --primary-dark: #1d4fc2;
  --primary-soft: #eaf1ff;
  --green: #0ba574;
  --green-dark: #087b58;
  --green-soft: #e8f9f3;
  --orange: #ed8b31;
  --orange-soft: #fff4e8;
  --red: #e35353;
  --red-soft: #fff0f0;
  --purple: #8065d7;
  --purple-soft: #f1edff;
  --yellow: #d99a18;
  --yellow-soft: #fff8df;
  --shadow-sm: 0 2px 8px rgba(30, 58, 100, .05);
  --shadow-md: 0 10px 28px rgba(38, 64, 111, .10);
  --sidebar-width: 258px;
  --topbar-height: 68px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --font: "Leelawadee UI", "Noto Sans Thai", "Tahoma", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

svg {
  display: block;
  width: 1em;
  height: 1em;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
  transition: width .24s ease, transform .24s ease;
}

.brand {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border-bottom: 1px solid transparent;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid #d5e4fb;
  border-radius: 13px;
  color: var(--primary);
  background: linear-gradient(145deg, #f6fbff 20%, #e1eeff);
}

.brand-mark svg {
  width: 34px;
  height: 34px;
}

.brand-mark circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  opacity: .26;
}

.brand-mark circle:nth-child(3),
.brand-mark circle:last-child {
  fill: #33bc99;
  stroke: #33bc99;
  opacity: 1;
}

.brand-mark path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.6;
}

.brand strong,
.business-copy strong {
  display: block;
  overflow: hidden;
  color: #101827;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand span,
.business-copy small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business-switcher {
  display: flex;
  min-height: 62px;
  align-items: center;
  gap: 10px;
  margin: 8px 12px 10px;
  padding: 9px 11px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fbfcfe;
  transition: border .18s, box-shadow .18s;
}

.business-switcher:hover {
  border-color: #cbd8e9;
  box-shadow: var(--shadow-sm);
}

.business-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(140deg, #2867e9, #33a4ee);
  font-size: 11px;
  font-weight: 800;
}

.business-copy {
  min-width: 0;
  flex: 1;
}

.business-copy strong {
  font-size: 13px;
}

.main-nav {
  flex: 1;
  overflow: hidden auto;
  padding: 0 10px 10px;
  scrollbar-color: #d8e0eb transparent;
  scrollbar-width: thin;
}

.nav-section {
  margin-top: 9px;
}

.nav-section-label {
  display: block;
  padding: 5px 11px;
  color: #9aa5b6;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 39px;
  align-items: center;
  gap: 11px;
  margin: 1px 0;
  padding: 8px 11px;
  text-align: left;
  border: 0;
  border-radius: 9px;
  color: #4e5d71;
  background: transparent;
  transition: background .16s, color .16s;
}

.nav-item:hover {
  color: #1c4c9d;
  background: #f4f7fc;
}

.nav-item.active {
  color: #1955bb;
  background: #eaf2ff;
  font-weight: 700;
}

.nav-item.active::before {
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  border-radius: 10px;
  background: var(--primary);
  content: "";
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke-width: 1.8;
}

.nav-label {
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-badge {
  min-width: 22px;
  padding: 1px 6px;
  text-align: center;
  border-radius: 12px;
  color: #08734f;
  background: #ccf4e7;
  font-size: 10px;
  font-weight: 800;
}

.sidebar-footer {
  padding: 9px 11px 12px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.plan-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 3px 9px;
  padding: 10px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #1e5ed4, #307de8);
}

.plan-icon {
  display: grid;
  width: 32px;
  height: 32px;
  grid-row: 1 / span 2;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, .15);
}

.plan-card strong,
.plan-card small {
  display: block;
}

.plan-card strong {
  font-size: 12px;
}

.plan-card small {
  color: rgba(255, 255, 255, .75);
  font-size: 10px;
}

.plan-progress {
  grid-column: 2;
  height: 3px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, .2);
}

.plan-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #fff;
}

.collapse-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--text-soft);
  background: transparent;
  font-size: 12px;
}

.collapse-button:hover {
  background: var(--surface-soft);
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left .24s ease;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
}

.mobile-menu {
  display: none !important;
}

.global-search-wrap {
  position: relative;
  display: flex;
  width: min(520px, 42vw);
  height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcfe;
  transition: border .18s, box-shadow .18s, background .18s;
}

.global-search-wrap:focus-within {
  border-color: #a7c3f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(39, 100, 231, .08);
}

.global-search-wrap > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #8491a5;
}

.global-search-wrap input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.global-search-wrap input::placeholder {
  color: #9ba5b4;
}

kbd {
  padding: 2px 6px;
  border: 1px solid #e1e6ed;
  border-bottom-width: 2px;
  border-radius: 6px;
  color: #8b96a8;
  background: white;
  font: 10px var(--font);
}

.search-results {
  position: absolute;
  z-index: 90;
  top: calc(100% + 8px);
  left: 0;
  width: min(560px, 80vw);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.search-result-group {
  padding: 6px;
}

.search-result-title {
  padding: 6px 9px 3px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.search-result-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px;
  text-align: left;
  border: 0;
  border-radius: 9px;
  background: #fff;
}

.search-result-item:hover {
  background: var(--surface-blue);
}

.search-result-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-soft);
}

.search-result-copy {
  min-width: 0;
  flex: 1;
}

.search-result-copy strong,
.search-result-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy strong {
  font-size: 13px;
}

.search-result-copy small {
  color: var(--text-soft);
  font-size: 11px;
}

.search-empty {
  padding: 22px;
  text-align: center;
  color: var(--text-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.language-switcher {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.lang-button {
  min-width: 38px;
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  color: var(--text-soft);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.lang-button.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 6px rgba(39, 100, 231, .24);
}

.icon-button {
  position: relative;
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #506077;
  background: #fff;
  transition: border .16s, color .16s, background .16s;
}

.icon-button:hover {
  border-color: #cbd8e9;
  color: var(--primary);
  background: #f9fbff;
}

.icon-button svg,
.button svg,
.icon-slot svg,
.collapse-button svg {
  width: 17px;
  height: 17px;
}

.has-dot::after {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 5px;
  height: 5px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--red);
  content: "";
}

.user-menu-button {
  display: flex;
  min-width: 138px;
  align-items: center;
  gap: 9px;
  padding: 3px 7px 3px 4px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
}

.user-menu-button:hover {
  border-color: var(--border);
  background: #fafcff;
}

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #1756c9, #3c82f1);
  font-weight: 800;
}

.user-copy {
  min-width: 0;
  flex: 1;
}

.user-copy strong,
.user-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  color: #1d2838;
  font-size: 12px;
}

.user-copy small {
  color: var(--text-soft);
  font-size: 10px;
}

.user-chevron {
  color: #9ba6b7;
}

.main-content {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px 26px 42px;
  outline: none;
}

.page {
  animation: pageIn .25s ease both;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-header {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 17px;
}

.page-header-copy {
  min-width: 0;
  flex: 1;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: #5377a9;
  font-size: 11px;
  font-weight: 700;
}

.page-header h1 {
  margin: 0;
  color: #121c2b;
  font-size: clamp(22px, 2.1vw, 29px);
  line-height: 1.25;
  letter-spacing: -.02em;
}

.page-header p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 13px;
}

.page-actions,
.table-actions,
.button-row,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.page-actions {
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: #334154;
  background: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: border .16s, box-shadow .16s, transform .16s, background .16s;
}

.button:hover {
  border-color: #bacbe0;
  background: #fbfdff;
  box-shadow: var(--shadow-sm);
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  border-color: var(--primary);
  color: #fff;
  background: linear-gradient(135deg, #3479ee, #215edb);
  box-shadow: 0 5px 13px rgba(39, 100, 231, .2);
}

.button.primary:hover {
  border-color: var(--primary-dark);
  background: linear-gradient(135deg, #2f72e4, #1c54cb);
}

.button.success {
  border-color: #10a879;
  color: #fff;
  background: linear-gradient(135deg, #19b886, #07966a);
}

.button.danger {
  border-color: #f1cccc;
  color: #bf4040;
  background: #fff8f8;
}

.button.ghost {
  border-color: transparent;
  color: var(--primary);
  background: transparent;
}

.button.small {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
}

.button.icon-only {
  width: 34px;
  padding: 0;
}

.compliance-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 17px;
  padding: 10px 13px;
  border: 1px solid #d2e9e5;
  border-radius: 11px;
  color: #38586a;
  background: linear-gradient(90deg, #eef9ff, #effaf4);
  font-size: 11px;
}

.compliance-banner .compliance-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 8px;
  color: #17618b;
  background: rgba(255, 255, 255, .65);
}

.compliance-banner strong {
  color: #285474;
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: minmax(330px, 2fr) repeat(2, minmax(180px, 1fr));
  gap: 14px;
}

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

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(310px, .95fr);
  gap: 14px;
  margin-top: 14px;
}

.dashboard-table-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, .95fr);
  gap: 14px;
  margin-top: 14px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.hero-signal-card {
  position: relative;
  display: flex;
  min-height: 174px;
  align-items: center;
  gap: 23px;
  overflow: hidden;
  padding: 23px 25px;
  border-color: #a9c6eb;
  background:
    radial-gradient(circle at 86% 10%, rgba(82, 147, 245, .12), transparent 30%),
    linear-gradient(135deg, #f7fbff, #f2f7ff);
}

.hero-signal-card::after {
  position: absolute;
  right: -30px;
  bottom: -60px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(61, 130, 231, .12);
  border-radius: 50%;
  content: "";
}

.radar-visual {
  position: relative;
  width: 108px;
  height: 108px;
  flex: 0 0 108px;
  border: 1px solid #b9d2f2;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 49.5%, #bfd4ee 50%, transparent 50.5%),
    linear-gradient(transparent 49.5%, #bfd4ee 50%, transparent 50.5%),
    radial-gradient(circle, transparent 24%, #c6daf1 25%, transparent 26%, transparent 48%, #c6daf1 49%, transparent 50%, transparent 73%, #c6daf1 74%, transparent 75%),
    radial-gradient(circle, #edf7ff, #e6f2ff);
}

.radar-sweep {
  position: absolute;
  inset: 8px 50% 50% 8px;
  border-radius: 100% 0 0 0;
  background: linear-gradient(135deg, rgba(50, 139, 230, .05), rgba(50, 139, 230, .34));
  transform-origin: 100% 100%;
  animation: sweep 6s linear infinite;
}

@keyframes sweep {
  to {
    transform: rotate(360deg);
  }
}

.radar-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 2px solid #d8fff2;
  border-radius: 50%;
  background: #10ad7b;
  box-shadow: 0 0 0 4px rgba(16, 173, 123, .12);
}

.radar-dot.one {
  top: 28px;
  right: 27px;
}

.radar-dot.two {
  bottom: 31px;
  left: 31px;
}

.radar-dot.three {
  top: 51px;
  right: 18px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
  color: #4473a9;
  font-size: 11px;
  font-weight: 700;
}

.hero-copy h2 {
  margin: 0;
  color: #142137;
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1.3;
  letter-spacing: -.02em;
}

.hero-copy h2 strong {
  color: #124fb4;
}

.hero-copy p {
  margin: 4px 0 12px;
  color: var(--text-soft);
  font-size: 12px;
}

.stat-card {
  min-height: 174px;
  padding: 18px;
}

.stat-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 11px;
}

.stat-icon svg {
  width: 19px;
  height: 19px;
}

.tone-blue {
  color: #2460bd;
  background: var(--primary-soft);
}

.tone-green {
  color: var(--green-dark);
  background: var(--green-soft);
}

.tone-purple {
  color: #6c51c5;
  background: var(--purple-soft);
}

.tone-orange {
  color: #ca6f1c;
  background: var(--orange-soft);
}

.tone-yellow {
  color: #ab7712;
  background: var(--yellow-soft);
}

.tone-red {
  color: #cb4848;
  background: var(--red-soft);
}

.stat-label {
  color: var(--text-soft);
  font-size: 11px;
}

.stat-value {
  margin-top: 2px;
  color: #101a29;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.2;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  padding: 2px 7px;
  border-radius: 12px;
  color: #087454;
  background: #e6f8f0;
  font-size: 10px;
  font-weight: 700;
}

.stat-meta {
  margin-top: 5px;
  color: var(--text-faint);
  font-size: 10px;
}

.compact-stat-card {
  display: flex;
  min-height: 128px;
  flex-direction: column;
  padding: 16px;
}

.compact-stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.compact-stat-card .stat-icon {
  width: 34px;
  height: 34px;
  margin: 0;
}

.compact-stat-card .stat-value {
  margin-top: auto;
  font-size: 25px;
}

.compact-stat-card .stat-label {
  color: #4d5b6f;
  font-weight: 600;
}

.mini-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  color: #5073a6;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  min-height: 53px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  min-width: 0;
}

.panel-title h2,
.panel-title h3 {
  margin: 0;
  color: #182334;
  font-size: 15px;
  line-height: 1.3;
}

.panel-title p {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 10px;
}

.panel-body {
  padding: 17px;
}

.period-label {
  color: var(--text-faint);
  font-size: 10px;
}

.bar-chart {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: 112px minmax(100px, 1fr) 25px;
  align-items: center;
  gap: 11px;
}

.bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  font-size: 11px;
}

.platform-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 6px;
  background: #edf1f6;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4292ee, #225bd8);
  transform-origin: left;
  animation: barGrow .8s ease both;
}

@keyframes barGrow {
  from {
    transform: scaleX(0);
  }
}

.bar-value {
  text-align: right;
  color: #27344a;
  font-size: 11px;
  font-weight: 800;
}

.donut-layout {
  display: flex;
  min-height: 178px;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.donut {
  position: relative;
  display: grid;
  width: 116px;
  height: 116px;
  flex: 0 0 116px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#3f82ec 0 37%, #16ae7d 37% 57%, #e9a635 57% 69%, #8d72da 69% 78%, #e46b5b 78% 88%, #b7c3d2 88% 100%);
}

.donut::before {
  position: absolute;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-size: 21px;
  line-height: 1.1;
}

.donut-center span {
  color: var(--text-faint);
  font-size: 9px;
}

.legend-list {
  display: grid;
  min-width: 140px;
  gap: 7px;
}

.legend-item {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 7px;
  color: #526073;
  font-size: 10px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-item strong {
  color: #243146;
}

.table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  white-space: nowrap;
}

.data-table th {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: #7d899a;
  background: #fafbfd;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf0f5;
  color: #3b485a;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background .14s;
}

.data-table tbody tr:hover {
  background: #f9fbff;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.lead-person,
.competitor-person {
  display: flex;
  min-width: 165px;
  align-items: center;
  gap: 9px;
}

.lead-avatar,
.competitor-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 9px;
  color: #2253a2;
  background: #eaf2ff;
  font-size: 10px;
  font-weight: 800;
}

.lead-person strong,
.lead-person small,
.competitor-person strong,
.competitor-person small {
  display: block;
}

.lead-person strong,
.competitor-person strong {
  max-width: 170px;
  overflow: hidden;
  color: #243146;
  text-overflow: ellipsis;
}

.lead-person small,
.competitor-person small {
  color: var(--text-faint);
  font-size: 9px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 170px;
  padding: 3px 8px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.badge.blue {
  border-color: #d7e4fa;
  color: #2d62ae;
  background: #edf4ff;
}

.badge.green {
  border-color: #d0efe4;
  color: #087957;
  background: #eaf9f3;
}

.badge.orange {
  border-color: #f8dfc8;
  color: #bd671d;
  background: #fff4e9;
}

.badge.red {
  border-color: #f3d1d1;
  color: #c14646;
  background: #fff0f0;
}

.badge.purple {
  border-color: #dfd8f8;
  color: #674fb1;
  background: #f3f0ff;
}

.badge.gray {
  border-color: #e2e6ec;
  color: #6a7687;
  background: #f5f7f9;
}

.badge.yellow {
  border-color: #f5e4ad;
  color: #997012;
  background: #fff9e7;
}

.status-badge::before,
.temperature::before {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.score {
  display: inline-flex;
  min-width: 33px;
  justify-content: center;
  padding: 4px 7px;
  border-radius: 8px;
  color: #0b7b59;
  background: #e8f8f1;
  font-weight: 800;
}

.score.hot {
  color: #c34848;
  background: #fff0f0;
}

.row-menu {
  position: relative;
}

.action-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: #315d9b;
  background: #fff;
  font-size: 9px;
  font-weight: 700;
}

.action-button:hover {
  border-color: #bcd0eb;
  background: #f4f8ff;
}

.competitor-list {
  display: grid;
  gap: 1px;
}

.competitor-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #edf0f5;
}

.competitor-row:last-child {
  border-bottom: 0;
}

.competitor-rank {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 7px;
  color: #48617f;
  background: #f2f5f9;
  font-size: 10px;
  font-weight: 800;
}

.competitor-info {
  min-width: 0;
}

.competitor-info strong,
.competitor-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competitor-info strong {
  font-size: 11px;
}

.competitor-info small {
  color: var(--text-faint);
  font-size: 9px;
}

.toolbar-card {
  margin-bottom: 14px;
  padding: 15px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
}

.filter-field,
.form-field {
  min-width: 0;
}

.filter-field label,
.form-field label {
  display: block;
  margin-bottom: 5px;
  color: #68758a;
  font-size: 9px;
  font-weight: 700;
}

.select,
.input,
.textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  outline: none;
  color: #354256;
  background: #fff;
  transition: border .16s, box-shadow .16s;
}

.select:focus,
.input:focus,
.textarea:focus {
  border-color: #9ebef1;
  box-shadow: 0 0 0 3px rgba(39, 100, 231, .08);
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.filter-count {
  color: var(--text-soft);
  font-size: 11px;
}

.table-card {
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  min-height: 55px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
}

.table-toolbar h2 {
  margin: 0;
  font-size: 15px;
}

.table-toolbar p {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 10px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 10px;
}

.pagination-pages {
  display: flex;
  gap: 4px;
}

.page-button {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: #617087;
  background: #fff;
  font-size: 10px;
}

.page-button.active {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.scan-results-card {
  overflow: hidden;
}

.scan-results-toolbar {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.scan-list-search {
  display: flex;
  width: min(290px, 28vw);
  min-width: 210px;
  height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fbfcfe;
  transition: border .16s, box-shadow .16s;
}

.scan-list-search:focus-within {
  border-color: #9ebef1;
  box-shadow: 0 0 0 3px rgba(39, 100, 231, .08);
}

.scan-list-search svg {
  flex: 0 0 16px;
  color: #8995a6;
  font-size: 16px;
}

.scan-list-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.scan-list-search input::placeholder {
  color: #a0a9b7;
}

.scan-status-select {
  min-width: 145px;
  height: 40px;
  padding: 0 32px 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: 0;
  color: #3b485a;
  background: #fff;
}

.filter-toggle-button {
  position: relative;
  min-height: 40px;
}

.filter-toggle-button.active {
  border-color: #abc6ee;
  color: #2259b8;
  background: #f1f6ff;
}

.filter-active-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.scan-toolbar-spacer {
  flex: 1;
}

.scan-result-count {
  color: #59687d;
  font-size: 11px;
  white-space: nowrap;
}

.advanced-lead-filters {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  background: #f8faff;
}

.advanced-lead-filters .filter-footer {
  margin-top: 10px;
}

.lead-bulk-bar {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid #cfe0fa;
  color: #315c96;
  background: #edf5ff;
  font-size: 11px;
}

.lead-bulk-bar[hidden],
.advanced-lead-filters[hidden] {
  display: none;
}

.scan-table-wrap {
  position: relative;
  max-height: calc(100vh - 300px);
  min-height: 420px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c5cedb #f2f5f8;
  scrollbar-width: thin;
}

.scan-results-table {
  width: 2240px;
  table-layout: fixed;
}

.scan-results-table th,
.scan-results-table td {
  padding: 13px 11px;
  white-space: normal;
  vertical-align: top;
}

.scan-results-table th {
  position: sticky;
  z-index: 4;
  top: 0;
  height: 42px;
  color: #68758a;
  background: #f9fbfd;
}

.scan-results-table tbody tr {
  min-height: 72px;
  background: #fff;
}

.scan-results-table tbody tr:hover {
  background: #f8fbff;
}

.scan-results-table th:nth-child(1),
.scan-results-table td:nth-child(1) {
  width: 44px;
}

.scan-results-table th:nth-child(2),
.scan-results-table td:nth-child(2) {
  width: 215px;
}

.scan-results-table th:nth-child(3),
.scan-results-table td:nth-child(3) {
  width: 115px;
}

.scan-results-table th:nth-child(4),
.scan-results-table td:nth-child(4) {
  width: 90px;
}

.scan-results-table th:nth-child(5),
.scan-results-table td:nth-child(5) {
  width: 155px;
}

.scan-results-table th:nth-child(6),
.scan-results-table td:nth-child(6) {
  width: 135px;
}

.scan-results-table th:nth-child(7),
.scan-results-table td:nth-child(7) {
  width: 155px;
}

.scan-results-table th:nth-child(8),
.scan-results-table td:nth-child(8) {
  width: 260px;
}

.scan-results-table th:nth-child(9),
.scan-results-table td:nth-child(9) {
  width: 85px;
}

.scan-results-table th:nth-child(10),
.scan-results-table td:nth-child(10) {
  width: 125px;
}

.scan-results-table th:nth-child(11),
.scan-results-table td:nth-child(11) {
  width: 110px;
}

.scan-results-table th:nth-child(12),
.scan-results-table td:nth-child(12) {
  width: 175px;
}

.scan-results-table th:nth-child(13),
.scan-results-table td:nth-child(13) {
  width: 220px;
}

.scan-results-table th:nth-child(14),
.scan-results-table td:nth-child(14) {
  width: 120px;
}

.scan-results-table th:nth-child(15),
.scan-results-table td:nth-child(15) {
  width: 95px;
}

.scan-results-table th:nth-child(16),
.scan-results-table td:nth-child(16) {
  width: 160px;
}

.select-column {
  text-align: center !important;
}

.select-column input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.sort-hint {
  margin-left: 3px;
  color: #b5beca;
  font-size: 9px;
}

.scan-results-table .lead-person {
  min-width: 0;
  align-items: flex-start;
}

.lead-name-button {
  min-width: 0;
  padding: 0;
  text-align: left;
  border: 0;
  background: transparent;
}

.lead-name-button:hover strong {
  color: var(--primary);
  text-decoration: underline;
}

.lead-name-button strong,
.lead-name-button small {
  display: block;
  max-width: 155px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-name-button strong {
  color: #26344a;
  font-size: 11px;
}

.lead-name-button small {
  margin-top: 2px;
  color: #929dad;
  font-size: 9px;
}

.platform-badge {
  padding: 4px 8px;
  white-space: nowrap;
}

.platform-badge i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
}

.source-link-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  color: #3270bd;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.source-link-button:hover {
  text-decoration: underline;
}

.source-link-button svg {
  font-size: 12px;
}

.keyword-match,
.product-caption {
  display: block;
}

.keyword-match {
  color: #344256;
  font-size: 10px;
  font-weight: 700;
}

.product-caption {
  margin-top: 4px;
  color: #8b97a9;
  font-size: 8px;
}

.intent-pill {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid #d7e4f8;
  border-radius: 18px;
  color: #416698;
  background: #f2f6fd;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.35;
}

.cell-wrap,
.post-summary {
  display: block;
  color: #536075;
  font-size: 10px;
  line-height: 1.55;
}

.post-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.engagement-value {
  color: #435066;
  font-size: 11px;
  font-weight: 700;
}

.score-meter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-track {
  width: 64px;
  height: 6px;
  overflow: hidden;
  border-radius: 10px;
  background: #e8edf3;
}

.score-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.score-track i.high {
  background: #36ad7d;
}

.score-track i.medium {
  background: #e2a028;
}

.score-track i.low {
  background: #b7c5d4;
}

.score-meter strong {
  min-width: 20px;
  color: #758295;
  font-size: 11px;
}

.score-meter:has(.high) strong {
  color: #18805c;
}

.score-meter:has(.medium) strong {
  color: #b47310;
}

.urgency-pill,
.scan-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.urgency-high {
  border-color: #f2d2d2;
  color: #c65050;
  background: #fff0f0;
}

.urgency-medium {
  border-color: #f1dfb9;
  color: #aa7517;
  background: #fff7e6;
}

.urgency-low {
  border-color: #dfe5ec;
  color: #778396;
  background: #f4f6f8;
}

.offer-cell {
  color: #3c4a5f;
}

.scan-status.status-green {
  border-color: #d1eee3;
  color: #13805d;
  background: #eaf8f2;
}

.scan-status.status-purple {
  border-color: #dfd8f5;
  color: #6652a9;
  background: #f3f0fc;
}

.scan-status.status-orange {
  border-color: #f1dfbd;
  color: #a97217;
  background: #fff7e8;
}

.scan-status.status-red {
  border-color: #f1d2d2;
  color: #c04d4d;
  background: #fff1f1;
}

.scan-status.status-blue {
  border-color: #d5e2f7;
  color: #3c65a1;
  background: #eff5fe;
}

.scan-status.status-gray {
  border-color: #e0e5eb;
  color: #737f90;
  background: #f4f6f8;
}

.scan-date {
  display: block;
  color: #4d5b70;
  font-size: 10px;
  line-height: 1.45;
  white-space: normal;
}

.scan-row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.table-icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #64738a;
  background: #fff;
}

.table-icon-button:hover {
  border-color: #b9cde8;
  color: var(--primary);
  background: #f3f7ff;
}

.table-icon-button svg {
  font-size: 14px;
}

.scan-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding: 7px 14px;
  border-top: 1px solid var(--border);
  color: #8793a4;
  background: #fbfcfe;
  font-size: 9px;
}

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

.insight-card {
  display: flex;
  min-height: 225px;
  flex-direction: column;
  padding: 17px;
}

.insight-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.insight-heading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.insight-heading .stat-icon {
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  margin: 0;
}

.insight-heading h3 {
  margin: 0;
  font-size: 13px;
}

.confidence {
  color: #63728a;
  font-size: 9px;
  white-space: nowrap;
}

.confidence strong {
  color: var(--green-dark);
}

.insight-summary {
  margin: 0 0 10px;
  color: #3b495d;
  font-size: 11px;
}

.bullet-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bullet-list li {
  position: relative;
  padding-left: 13px;
  color: #526075;
  font-size: 10px;
}

.bullet-list li::before {
  position: absolute;
  top: .65em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4b84e6;
  content: "";
}

.recommendation-box {
  margin-top: auto;
  padding: 9px 10px;
  border: 1px solid #dbe9fa;
  border-radius: 9px;
  color: #335780;
  background: #f3f8ff;
  font-size: 10px;
}

.recommendation-box strong {
  color: #22528c;
}

.risk-note {
  margin-top: 7px;
  color: #8a6f42;
  font-size: 8px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(290px, .8fr) minmax(0, 1.35fr);
  gap: 14px;
}

.form-card {
  padding: 18px;
}

.form-card h2,
.output-card h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.form-card > p,
.output-card > p {
  margin: 0 0 16px;
  color: var(--text-soft);
  font-size: 10px;
}

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

.form-field.full {
  grid-column: 1 / -1;
}

.output-card {
  min-height: 480px;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(51, 127, 237, .08), transparent 33%),
    #fff;
}

.offer-preview {
  overflow: hidden;
  border: 1px solid #d8e3f1;
  border-radius: 14px;
  background: #fff;
}

.offer-hero {
  padding: 20px;
  color: #fff;
  background: linear-gradient(135deg, #245ec8, #317be5);
}

.offer-hero small {
  opacity: .76;
}

.offer-hero h3 {
  max-width: 540px;
  margin: 6px 0 4px;
  font-size: 22px;
  line-height: 1.35;
}

.offer-hero p {
  max-width: 600px;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 11px;
}

.offer-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
}

.offer-detail {
  min-height: 92px;
  padding: 14px;
  background: #fff;
}

.offer-detail span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-faint);
  font-size: 9px;
}

.offer-detail strong {
  color: #334156;
  font-size: 11px;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow: auto;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f6f8fb;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  padding: 7px 12px;
  white-space: nowrap;
  border: 0;
  border-radius: 7px;
  color: #657287;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.tab-button.active {
  color: #2259bb;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.message-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
}

.template-list {
  overflow: hidden;
}

.template-list-header {
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.template-list-header h2 {
  margin: 0;
  font-size: 14px;
}

.template-list-header p {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 9px;
}

.template-item {
  display: block;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #edf0f5;
  background: #fff;
}

.template-item:hover,
.template-item.active {
  background: #f3f7ff;
}

.template-item.active {
  box-shadow: inset 3px 0 var(--primary);
}

.template-item strong,
.template-item small {
  display: block;
}

.template-item strong {
  color: #344256;
  font-size: 11px;
}

.template-item small {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 9px;
}

.message-editor {
  padding: 18px;
}

.message-editor-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.message-editor h2 {
  margin: 0;
  font-size: 16px;
}

.message-editor p {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 10px;
}

.message-box {
  min-height: 230px;
  padding: 18px;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  outline: none;
  color: #334155;
  background: #fbfdff;
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.message-box:focus {
  border-color: #9ebef1;
  box-shadow: 0 0 0 3px rgba(39, 100, 231, .08);
}

.message-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.message-note {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green-dark);
  font-size: 9px;
}

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

.report-card {
  display: flex;
  min-height: 178px;
  flex-direction: column;
  padding: 17px;
}

.report-card .stat-icon {
  margin-bottom: 10px;
}

.report-card h3 {
  margin: 0;
  font-size: 13px;
}

.report-card p {
  margin: 5px 0 13px;
  color: var(--text-soft);
  font-size: 10px;
}

.report-card .button-row {
  margin-top: auto;
}

.calendar-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(90px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  overflow: auto;
}

.calendar-day {
  min-width: 90px;
  padding: 10px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #657287;
  background: #fff;
  font-size: 9px;
}

.calendar-day strong {
  display: block;
  margin-top: 2px;
  color: #28364a;
  font-size: 15px;
}

.calendar-day.today {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.calendar-day.today strong {
  color: #fff;
}

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

.settings-section {
  margin-bottom: 14px;
  padding: 18px;
}

.settings-section h2 {
  margin: 0;
  font-size: 15px;
}

.settings-section > p {
  margin: 3px 0 16px;
  color: var(--text-soft);
  font-size: 10px;
}

.keyword-cloud {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.keyword-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #dbe4f1;
  border-radius: 20px;
  color: #3f5e86;
  background: #f7faff;
  font-size: 10px;
}

.keyword-chip button {
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #8090a4;
  background: #e7eef8;
  line-height: 1;
}

.product-list {
  display: grid;
  gap: 8px;
}

.product-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.product-color {
  width: 10px;
  height: 36px;
  flex: 0 0 10px;
  border-radius: 6px;
}

.product-copy {
  min-width: 0;
  flex: 1;
}

.product-copy strong,
.product-copy small {
  display: block;
}

.product-copy strong {
  font-size: 11px;
}

.product-copy small {
  color: var(--text-faint);
  font-size: 9px;
}

.toggle {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  border: 0;
  border-radius: 20px;
  background: #cfd7e2;
}

.toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
  transition: transform .18s;
  content: "";
}

.toggle.on {
  background: var(--primary);
}

.toggle.on::after {
  transform: translateX(16px);
}

.help-list {
  display: grid;
  gap: 9px;
}

.help-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
}

.help-item:hover {
  border-color: #c4d3e7;
  background: #f9fbff;
}

.help-item .stat-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  margin: 0;
}

.help-copy {
  min-width: 0;
  flex: 1;
}

.help-copy strong,
.help-copy small {
  display: block;
}

.help-copy strong {
  color: #344256;
  font-size: 11px;
}

.help-copy small {
  color: var(--text-faint);
  font-size: 9px;
}

.empty-state {
  display: grid;
  min-height: 340px;
  place-items: center;
  padding: 36px;
  text-align: center;
}

.empty-state-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 18px;
  color: var(--primary);
  background: var(--primary-soft);
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.empty-state p {
  max-width: 460px;
  margin: 0 auto 14px;
  color: var(--text-soft);
  font-size: 11px;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(21, 32, 51, .48);
  backdrop-filter: blur(3px);
  animation: fadeIn .18s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden auto;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(12, 29, 54, .28);
  animation: modalIn .2s ease both;
}

.modal.large {
  width: min(1080px, 100%);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.985);
  }
}

.modal-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(10px);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-header p {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 10px;
}

.modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-soft);
  background: #fff;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, .97);
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 15px;
  padding: 16px;
  border: 1px solid #dbe7f6;
  border-radius: 13px;
  background: linear-gradient(135deg, #f7fbff, #f2f7ff);
}

.detail-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  place-items: center;
  border-radius: 15px;
  color: #255ab1;
  background: #dfeeff;
  font-weight: 800;
}

.detail-hero-copy {
  min-width: 0;
  flex: 1;
}

.detail-hero-copy h3 {
  margin: 0;
  font-size: 16px;
}

.detail-hero-copy p {
  margin: 3px 0 7px;
  color: var(--text-soft);
  font-size: 10px;
}

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

.detail-card {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.detail-card.full {
  grid-column: 1 / -1;
}

.detail-card h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 11px;
  font-size: 12px;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.detail-list-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  font-size: 10px;
}

.detail-list-row dt {
  color: var(--text-faint);
}

.detail-list-row dd {
  margin: 0;
  color: #354256;
  font-weight: 600;
}

.ai-summary {
  padding: 12px;
  border-left: 3px solid var(--primary);
  border-radius: 0 9px 9px 0;
  color: #3d526c;
  background: #f3f8ff;
  font-size: 11px;
}

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

.recommended-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: #3d4c61;
  font-size: 10px;
}

.recommended-action span:first-child {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 7px;
  color: var(--green-dark);
  background: var(--green-soft);
}

.scan-modal-content {
  padding: 10px 0;
  text-align: center;
}

.scan-animation {
  position: relative;
  width: 126px;
  height: 126px;
  margin: 5px auto 18px;
  border: 1px solid #bed4f1;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 28%, #cbdcf1 29%, transparent 30%, transparent 56%, #cbdcf1 57%, transparent 58%),
    #f2f8ff;
}

.scan-animation::before {
  position: absolute;
  inset: 10px 50% 50% 10px;
  border-radius: 100% 0 0 0;
  background: linear-gradient(135deg, transparent, rgba(39, 100, 231, .38));
  transform-origin: 100% 100%;
  animation: sweep 1.25s linear infinite;
  content: "";
}

.scan-pulse {
  position: absolute;
  top: 57px;
  left: 57px;
  width: 12px;
  height: 12px;
  border: 3px solid #d9fff2;
  border-radius: 50%;
  background: #10a879;
  box-shadow: 0 0 0 0 rgba(16, 168, 121, .35);
  animation: pulse 1.4s ease-out infinite;
}

@keyframes pulse {
  to {
    box-shadow: 0 0 0 18px rgba(16, 168, 121, 0);
  }
}

.scan-modal-content h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.scan-modal-content p {
  max-width: 460px;
  margin: 0 auto;
  color: var(--text-soft);
  font-size: 11px;
}

.scan-progress {
  width: min(360px, 85%);
  height: 6px;
  overflow: hidden;
  margin: 15px auto 6px;
  border-radius: 10px;
  background: #e8edf4;
}

.scan-progress span {
  display: block;
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f72e4, #10a879);
  transition: width .35s ease;
}

.scan-status {
  color: #56708f;
  font-size: 9px;
}

.toast-region {
  position: fixed;
  z-index: 150;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(360px, calc(100vw - 40px));
  gap: 8px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #d8e2ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-md);
  animation: toastIn .22s ease both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}

.toast-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 8px;
  color: var(--green-dark);
  background: var(--green-soft);
}

.toast-copy {
  min-width: 0;
  flex: 1;
}

.toast-copy strong,
.toast-copy span {
  display: block;
}

.toast-copy strong {
  font-size: 11px;
}

.toast-copy span {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 9px;
}

.toast-close {
  padding: 0;
  border: 0;
  color: #9aa5b5;
  background: transparent;
}

.notification-popover,
.profile-popover,
.business-popover {
  position: fixed;
  z-index: 95;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-md);
  animation: fadeIn .14s ease both;
}

.notification-popover {
  top: 60px;
  right: 150px;
  width: min(350px, calc(100vw - 24px));
}

.profile-popover {
  top: 60px;
  right: 18px;
  width: 220px;
}

.business-popover {
  top: 135px;
  left: 14px;
  width: 228px;
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.popover-header strong {
  font-size: 12px;
}

.popover-header span {
  color: var(--primary);
  font-size: 9px;
}

.notification-item {
  display: flex;
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f5;
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item .stat-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  margin: 0;
}

.notification-copy strong,
.notification-copy small {
  display: block;
}

.notification-copy strong {
  font-size: 10px;
}

.notification-copy small {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 9px;
}

.popover-menu {
  padding: 6px;
}

.popover-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 9px;
  text-align: left;
  border: 0;
  border-radius: 8px;
  color: #4c5a6f;
  background: #fff;
  font-size: 10px;
}

.popover-menu button:hover {
  background: #f4f7fb;
}

.popover-menu button svg {
  width: 15px;
  height: 15px;
}

.business-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border-radius: 9px;
}

.business-option.active {
  background: #f1f6ff;
}

.business-option-copy {
  min-width: 0;
  flex: 1;
}

.business-option-copy strong,
.business-option-copy small {
  display: block;
}

.business-option-copy strong {
  font-size: 10px;
}

.business-option-copy small {
  color: var(--text-soft);
  font-size: 8px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: #edf1f6;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.2s infinite;
  content: "";
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

body.sidebar-collapsed {
  --sidebar-width: 76px;
}

body.sidebar-collapsed .brand {
  padding: 0 17px;
}

body.sidebar-collapsed .brand > div:last-child,
body.sidebar-collapsed .business-copy,
body.sidebar-collapsed .business-switcher > .icon-slot,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .plan-card > div,
body.sidebar-collapsed .plan-progress,
body.sidebar-collapsed .collapse-label {
  display: none;
}

body.sidebar-collapsed .business-switcher {
  justify-content: center;
  margin-inline: 10px;
  padding: 8px;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .nav-section {
  margin-top: 5px;
}

body.sidebar-collapsed .plan-card {
  display: flex;
  justify-content: center;
  padding: 7px;
}

body.sidebar-collapsed .collapse-button {
  justify-content: center;
}

body.sidebar-collapsed .collapse-button svg {
  transform: rotate(180deg);
}

@media (max-width: 1180px) {
  .dashboard-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .filters-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .insight-grid,
  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-copy,
  .user-chevron {
    display: none;
  }

  .user-menu-button {
    min-width: auto;
    padding-right: 4px;
  }
}

@media (max-width: 920px) {
  :root {
    --sidebar-width: 258px;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-md);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-collapsed .sidebar {
    width: 258px;
  }

  body.sidebar-collapsed .brand > div:last-child,
  body.sidebar-collapsed .business-copy,
  body.sidebar-collapsed .business-switcher > .icon-slot,
  body.sidebar-collapsed .nav-section-label,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-badge,
  body.sidebar-collapsed .plan-card > div,
  body.sidebar-collapsed .plan-progress,
  body.sidebar-collapsed .collapse-label {
    display: block;
  }

  body.sidebar-collapsed .business-switcher,
  body.sidebar-collapsed .nav-item,
  body.sidebar-collapsed .collapse-button {
    justify-content: flex-start;
  }

  body.sidebar-collapsed .plan-card {
    display: grid;
    justify-content: initial;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 55;
    inset: 0;
    pointer-events: none;
    background: rgba(19, 31, 49, .36);
    opacity: 0;
    transition: opacity .2s;
  }

  body.sidebar-open .sidebar-backdrop {
    pointer-events: auto;
    opacity: 1;
  }

  .workspace {
    margin-left: 0;
  }

  .mobile-menu {
    display: grid !important;
  }

  .global-search-wrap {
    width: min(480px, 55vw);
  }

  .main-content {
    padding-inline: 18px;
  }

  .dashboard-summary-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(180px, .8fr);
  }

  .dashboard-summary-grid > :last-child {
    grid-column: 2;
  }

  .hero-signal-card {
    grid-row: span 2;
  }

  .dashboard-chart-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .business-popover {
    left: 15px;
  }

  .scan-table-wrap {
    max-height: calc(100vh - 280px);
  }
}

@media (max-width: 700px) {
  .topbar {
    gap: 8px;
    padding-inline: 12px;
  }

  .global-search-wrap {
    width: auto;
    min-width: 0;
    flex: 1;
  }

  .global-search-wrap kbd,
  .desktop-only,
  .language-switcher,
  .user-menu-button {
    display: none;
  }

  .main-content {
    padding: 17px 12px 32px;
  }

  .page-header {
    display: block;
  }

  .page-actions {
    margin-top: 12px;
    justify-content: flex-start;
  }

  .page-actions .button {
    flex: 1;
  }

  .scan-results-toolbar {
    flex-wrap: wrap;
  }

  .scan-list-search {
    width: 100%;
    min-width: 100%;
  }

  .scan-status-select,
  .filter-toggle-button {
    flex: 1;
  }

  .scan-toolbar-spacer {
    display: none;
  }

  .scan-result-count {
    margin-left: auto;
  }

  .lead-bulk-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .scan-table-wrap {
    max-height: 58vh;
    min-height: 380px;
  }

  .dashboard-summary-grid,
  .dashboard-stat-grid,
  .dashboard-chart-grid,
  .dashboard-table-grid,
  .insight-grid,
  .report-grid,
  .split-layout,
  .message-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-summary-grid > :last-child,
  .hero-signal-card {
    grid-row: auto;
    grid-column: auto;
  }

  .hero-signal-card {
    align-items: flex-start;
    padding: 18px;
  }

  .radar-visual {
    width: 78px;
    height: 78px;
    flex-basis: 78px;
  }

  .hero-copy h2 {
    font-size: 20px;
  }

  .stat-card {
    min-height: 145px;
  }

  .filters-grid,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-footer,
  .table-toolbar,
  .message-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-actions,
  .message-footer .button-row {
    width: 100%;
  }

  .table-actions .button,
  .message-footer .button {
    flex: 1;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-card.full {
    grid-column: auto;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal,
  .modal.large {
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
  }

  .notification-popover {
    right: 10px;
  }
}

@media (max-width: 450px) {
  .filters-grid,
  .form-grid,
  .offer-details,
  .recommended-actions {
    grid-template-columns: 1fr;
  }

  .hero-signal-card {
    display: block;
  }

  .radar-visual {
    margin-bottom: 12px;
  }

  .compliance-banner {
    align-items: flex-start;
  }

  .bar-row {
    grid-template-columns: 78px minmax(80px, 1fr) 20px;
  }

  .donut-layout {
    align-items: flex-start;
    flex-direction: column;
  }

  .legend-list {
    width: 100%;
  }

  .detail-list-row {
    grid-template-columns: 95px 1fr;
  }

  .scan-status-select,
  .filter-toggle-button {
    width: calc(50% - 5px);
    min-width: 0;
  }

  .scan-results-toolbar > .button:last-child {
    min-width: 74px;
  }
}

@media print {
  .sidebar,
  .topbar,
  .page-actions,
  .compliance-banner,
  .button,
  .pagination {
    display: none !important;
  }

  .workspace {
    margin: 0;
  }

  .main-content {
    max-width: none;
    padding: 0;
  }

  body {
    background: #fff;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
  }
}
