@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap");

:root {
  color-scheme: light;
  --navy: #303132;
  --blue: #ff5300;
  --blue-dark: #d94700;
  --green: #ff5300;
  --ink: #212529;
  --muted: #5d5e60;
  --line: #dee2e6;
  --surface: #ffffff;
  --background: #f8f9fa;
  --navigation-hover-color: #c43f00;
  --navigation-hover-background: #fff3ed;
  --app-header-height: 64px;
  --sidebar-expanded-width: 220px;
  --sidebar-collapsed-width: 64px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Global application shell */
.has-sidebar {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding-top: var(--app-header-height);
  padding-left: var(--sidebar-expanded-width);
  transition: padding-left .2s ease;
}

.has-sidebar.sidebar-collapsed { padding-left: var(--sidebar-collapsed-width); }

.app-header {
  position: fixed;
  z-index: 70;
  inset: 0 0 auto 0;
  display: flex;
  height: var(--app-header-height);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
  padding: 0 20px 0 calc((var(--sidebar-collapsed-width) - 42px) / 2);
  border-bottom: 1px solid #e4e7ea;
  background: #fff;
  box-shadow: 0 3px 12px rgba(33, 37, 41, .06);
}

.app-header-left { display: flex; min-width: 0; align-items: center; gap: 14px; }

.sidebar-toggle {
  display: grid;
  width: 42px;
  min-height: 42px;
  flex: 0 0 42px;
  padding: 0;
  border-radius: 10px;
  place-items: center;
  color: #617083;
  background: transparent;
}

.sidebar-toggle:hover { color: var(--blue); background: #fff3ed; }
.sidebar-toggle:focus-visible,
.pharmacy-menu-trigger:focus-visible,
.app-header-brand:focus-visible { outline: 3px solid rgba(255, 83, 0, .2); outline-offset: 2px; }
.sidebar-toggle svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; }

.app-header-brand {
  display: flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.app-brand-logo { display: block; width: 38px; height: 38px; flex: 0 0 38px; margin-right: -2px; }
.app-brand-logo svg { display: block; width: 38px; height: 38px; }
.app-header-brand strong { font-family: Montserrat, Inter, ui-sans-serif, system-ui, sans-serif; font-size: 1.15rem; font-weight: 600; letter-spacing: -.035em; }

.header-account-area { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 16px; }
.header-pharmacy-name { max-width: min(260px, 27vw); overflow: hidden; color: #40506a; font-size: 1rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.header-account-divider { width: 1px; height: 40px; flex: 0 0 1px; background: #d9e0e8; }
.pharmacy-menu { position: relative; min-width: 0; }
.pharmacy-menu-trigger {
  display: flex;
  width: auto;
  max-width: min(280px, 34vw);
  min-height: 52px;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  border: 0;
  border-radius: 12px;
  color: #344158;
  background: transparent;
  font-size: .98rem;
  font-weight: 750;
}
.pharmacy-menu-trigger:hover { color: #263247; background: #f4f8fb; }
.account-menu-avatar { display: grid; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; place-items: center; color: #006aa6; background: #ddf3ff; font-size: 1rem; font-weight: 800; }
.account-menu-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pharmacy-menu-chevron { width: 14px; height: 14px; flex: 0 0 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s ease; }
.pharmacy-menu-trigger[aria-expanded="true"] .pharmacy-menu-chevron { transform: rotate(180deg); }

.pharmacy-menu-popover {
  position: absolute;
  z-index: 75;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: 210px;
  overflow: hidden;
  padding: 6px;
  border: 1px solid #e1e4e7;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(33, 37, 41, .15);
}
.pharmacy-menu-popover a,
.pharmacy-menu-popover button { display: flex; width: 100%; min-height: 40px; align-items: center; gap: 10px; padding: 0 11px; border-radius: 8px; color: var(--ink); background: transparent; font-size: .82rem; font-weight: 700; text-align: left; text-decoration: none; }
.pharmacy-menu-popover a:hover,
.pharmacy-menu-popover button:hover { color: var(--navigation-hover-color); background: var(--navigation-hover-background); }
.pharmacy-menu-popover button:disabled { cursor: not-allowed; color: #9aa0a6; background: transparent; opacity: 1; }
.pharmacy-menu-popover a > svg,
.pharmacy-menu-popover button > svg { width: 19px; height: 19px; flex: 0 0 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.app-sidebar {
  z-index: 50;
  inset: var(--app-header-height) auto 0 0;
  width: var(--sidebar-expanded-width);
  padding: 22px 14px 16px;
  transition: width .2s ease, padding .2s ease;
}
.app-sidebar.is-collapsed { width: var(--sidebar-collapsed-width); padding: 14px 9px; }
.app-sidebar.is-collapsed .sidebar-nav-link span { display: none; }
.app-sidebar.is-collapsed .sidebar-nav-link { justify-content: center; padding: 0; }

.sidebar-backdrop {
  position: fixed;
  z-index: 45;
  inset: var(--app-header-height) 0 0 var(--sidebar-collapsed-width);
  width: auto;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: rgba(33, 37, 41, .35);
  backdrop-filter: blur(2px);
}
.sidebar-backdrop:hover { background: rgba(33, 37, 41, .35); }

@media (max-width: 760px) {
  .has-sidebar,
  .has-sidebar.sidebar-collapsed { padding-left: var(--sidebar-collapsed-width); }
  .has-sidebar.sidebar-mobile-open { overflow: hidden; }
  .app-header { gap: 10px; padding: 0 10px 0 calc((var(--sidebar-collapsed-width) - 38px) / 2); }
  .app-header-left { gap: 5px; }
  .sidebar-toggle { width: 38px; min-height: 38px; flex-basis: 38px; }
  .sidebar-toggle svg { width: 24px; height: 24px; }
  .app-brand-logo { width: 32px; height: 32px; flex-basis: 32px; }
  .app-brand-logo svg { width: 32px; height: 32px; }
  .app-header-brand strong { font-size: .98rem; }
  .header-account-area { gap: 8px; }
  .header-pharmacy-name { max-width: 25vw; font-size: .8rem; }
  .header-account-divider { height: 30px; }
  .pharmacy-menu-trigger { min-height: 42px; gap: 6px; padding: 2px 4px; }
  .account-menu-avatar { width: 36px; height: 36px; flex-basis: 36px; font-size: .9rem; }
  .account-menu-name { display: none; }
  .app-sidebar { width: var(--sidebar-collapsed-width); padding: 14px 9px; }
  .app-sidebar.is-expanded { width: var(--sidebar-expanded-width); padding: 18px 14px 16px; }
  .app-sidebar.is-expanded .sidebar-nav-link { justify-content: flex-start; padding: 0 12px; }
  .app-sidebar.is-expanded .sidebar-nav-link span { display: inline; }
}

@media (max-width: 430px) {
  .app-header-brand strong { font-size: .86rem; }
  .header-pharmacy-name { max-width: 22vw; }
}

@media (prefers-reduced-motion: reduce) {
  .has-sidebar,
  .app-sidebar,
  .pharmacy-menu-chevron,
  button,
  .app-button { transition: none; }
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--background);
}

body.search-empty-state {
  background: var(--background);
}

.has-sidebar.search-empty-state .search-container { padding-bottom: 0; }

.has-sidebar {
  padding-top: var(--app-header-height);
  padding-left: var(--sidebar-expanded-width);
}

.app-sidebar {
  position: fixed;
  z-index: 50;
  inset: var(--app-header-height) auto 0 0;
  display: flex;
  width: var(--sidebar-expanded-width);
  flex-direction: column;
  padding: 22px 14px 16px;
  border-right: 1px solid #eceff1;
  background: rgba(255, 255, 255, .97);
  box-shadow: 8px 0 28px rgba(33, 37, 41, .04);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 7px 30px;
  color: var(--ink);
  text-decoration: none;
}

.sidebar-brand > span {
  display: block;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  overflow: hidden;
  background: transparent;
  margin-right: -3px;
}

.sidebar-logo svg {
  display: block;
  width: 36px;
  height: 36px;
}

.brand-gear-gray { fill: #777a7d; }
.brand-gear-orange { fill: var(--blue); }

.sidebar-brand strong {
  font-family: Montserrat, Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: .94rem;
  font-weight: 600;
  letter-spacing: -.035em;
}
.brand-name-flex { color: #6d6f72; }
.brand-name-prices { color: #f15a29; }
.sidebar-nav { display: grid; gap: 6px; }

.sidebar-nav-link {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-radius: 11px;
  color: var(--muted);
  font-size: .9375rem;
  font-weight: 750;
  line-height: 20px;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}

.sidebar-nav-link:hover,
.sidebar-nav-link.active {
  color: var(--navigation-hover-color);
  background: var(--navigation-hover-background);
}

.sidebar-nav-link svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-nav-link .sidebar-ai-spark-icon { width: 24px; height: 24px; flex-basis: 24px; overflow: visible; stroke-width: 1.75; }
.sidebar-ai-spark-icon .ai-spark-main { fill: currentColor; stroke: none; }
.sidebar-ai-spark-icon .ai-spark-small { fill: currentColor; stroke: none; opacity: .42; }

.sidebar-admin-return { margin-top: auto; padding-top: 16px; border-top: 1px solid #eceff1; }
.sidebar-admin-return .sidebar-nav-link { width: 100%; border: 0; background: transparent; text-align: left; }
.sidebar-admin-return .sidebar-nav-link:hover { color: var(--navigation-hover-color); background: var(--navigation-hover-background); }
.sidebar-admin-return .sidebar-nav-link:disabled { cursor: wait; opacity: .65; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.search-container { width: min(1180px, calc(100% - 40px)); }

header { margin-bottom: 18px; }

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 700px;
  margin-bottom: 6px;
  color: var(--navy);
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.subtitle { color: var(--muted); font-size: 1.1rem; }

.eyebrow {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.search-card {
  padding: 24px;
  border: 1px solid rgba(23, 50, 77, .08);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(33, 37, 41, .09);
}

.search-form-card {
  position: static;
}

.search-fields {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: 16px;
}

.search-term-field,
.search-category-field { min-width: 0; }

label {
  display: block;
  margin-bottom: 7px;
  color: var(--navy);
  font-size: .86rem;
  font-weight: 700;
}

input, select, button {
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  font: inherit;
}

input, select {
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fbfdff;
}

select {
  appearance: none;
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%235d5e60' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 12px 8px;
}

input:focus, select:focus {
  outline: 3px solid rgba(255, 83, 0, .18);
  border-color: var(--blue);
}

.search-input-wrap { position: relative; }
.search-input-wrap input { padding-right: 48px; }

.search-term-help {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}

.search-settings-error { margin-top: 16px; }

.clear-search {
  position: absolute;
  top: 50%;
  right: 9px;
  display: grid;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 8px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-50%);
}

.clear-search:hover { color: var(--blue); background: #fff0e8; }
.clear-search[hidden] { display: none; }

button {
  border: 0;
  color: white;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
  transition: color .22s ease, background-color .22s ease, border-color .22s ease, opacity .22s ease, box-shadow .22s ease;
}

button:hover { background: var(--blue-dark); }

button:disabled {
  cursor: wait;
  opacity: .7;
}

.search-card > button { margin-top: 16px; }

.welcome-empty {
  margin-top: 14px;
  padding: 34px 24px 30px;
  border: 1px solid rgba(255, 83, 0, .14);
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(252, 226, 196, .3));
}

.empty-search-illustration {
  width: 240px;
  max-width: 80%;
  margin: 0 auto 18px;
}

.empty-search-illustration svg,
.loading-search-illustration svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.empty-ground {
  fill: none;
  stroke: #d9dee2;
  stroke-width: 3;
  stroke-linecap: round;
}

.pharmacy-building {
  fill: #fff;
  stroke: #ffb48f;
  stroke-width: 2;
}

.pharmacy-awning {
  fill: #fff0e8;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linejoin: round;
}

.pharmacy-awning-detail,
.pharmacy-window,
.pharmacy-door {
  fill: #fff;
  stroke: #ffb48f;
  stroke-width: 2;
}

.pharmacy-cross { fill: var(--blue); }

.price-tag {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.price-tag circle { fill: #fff0e8; }
.price-tag-left { transform: rotate(-6deg); transform-origin: 44px 87px; }
.price-tag-right { transform: rotate(6deg); transform-origin: 202px 101px; }

.competitor-store-right .pharmacy-awning,
.competitor-store-right .pharmacy-cross { opacity: .78; }

.comparison-price-card rect {
  fill: #fff;
  stroke: #ffb48f;
  stroke-width: 2;
}

.comparison-price-card path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linecap: round;
}

.comparison-price-card-right { opacity: .78; }

.comparison-mark circle {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 2;
}

.comparison-mark path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.loading-search-illustration {
  width: 220px;
  max-width: 90%;
  margin: 0 auto 18px;
}

.medicine-box {
  fill: #fff;
  stroke: #ffb48f;
  stroke-width: 2;
}

.medicine-detail {
  fill: none;
  stroke: #f9cb94;
  stroke-width: 3;
  stroke-linecap: round;
}

.medicine-pill {
  fill: #fce2c4;
  stroke: var(--blue);
  stroke-width: 2;
}

.medicine-pill-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
}

.welcome-magnifier {
  fill: rgba(255, 255, 255, .72);
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  transform-box: view-box;
  transform-origin: center;
  animation: welcome-scan 2.8s ease-in-out infinite;
  filter: drop-shadow(0 5px 5px rgba(255, 83, 0, .16));
}

.welcome-empty h2 {
  margin-bottom: 8px;
  color: var(--navy);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
}

.welcome-empty > p {
  max-width: 570px;
  margin: 0 auto;
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.55;
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 20px;
}

.welcome-empty .recent-searches-empty {
  margin: 18px auto 0;
  color: var(--muted);
  font-size: .82rem;
}

.suggestion-chip {
  width: auto;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid #f9cb94;
  border-radius: 999px;
  color: #9a3608;
  background: #fff;
  font-size: .86rem;
}

.suggestion-chip:hover {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

@keyframes welcome-scan {
  0%, 100% { transform: translate(-3px, 3px) rotate(-5deg); }
  48%, 58% { transform: translate(104px, -7px) rotate(6deg); }
}

.results { margin-top: 4px; }

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.results-heading h2 { margin-bottom: 0; color: var(--navy); }
.results-status-heading { justify-content: space-between; margin-top: 8px; }
.results-status-heading .result-badges { justify-content: flex-start; }

.result-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.badge {
  padding: 7px 10px;
  border-radius: 999px;
  color: #7e2a00;
  background: #fce2c4;
  font-size: .8rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge-cache { color: #444546; background: #e9ecef; }
.badge-fresh { color: #7e2a00; background: #fce2c4; }

.cache-meta {
  margin: -5px 0 16px;
  color: var(--muted);
  font-size: .84rem;
}

.pbm-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 4px 0 16px;
  padding: 16px 18px;
  border: 1px solid #9fd8b2;
  border-radius: 14px;
  color: #174c2c;
  background: #eaf8ef;
}

.pbm-alert strong { display: block; margin-bottom: 3px; color: #123d24; }
.pbm-alert p { margin: 0; font-size: .88rem; }
.pbm-alert a {
  flex: 0 0 auto;
  color: #174c2c;
  font-size: .82rem;
  font-weight: 800;
}

.pbm-alert a:hover { color: #0c2f1a; }

.result-list { display: grid; gap: 10px; }

.price-comparison-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
  align-items: start;
  gap: 18px;
  transition: grid-template-columns .22s ease, gap .22s ease;
}

.competitor-price-column {
  grid-column: 1;
  grid-row: 1;
}

.price-column { min-width: 0; }

.price-column-heading {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.price-column-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.price-column-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 700;
}

.price-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
}

.comparison-sidebar {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  min-width: 0;
}

.comparison-sidebar-content {
  position: sticky;
  z-index: 10;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.price-simulator-panel,
.own-price-column {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(33, 37, 41, .1);
  transition: padding .22s ease, border-color .22s ease, background-color .22s ease, box-shadow .22s ease;
}

.price-simulator-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .98);
}

.own-price-column {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .98);
}

.price-simulator {
  margin: 0;
}

.decision-panel-heading { margin-bottom: 16px; }

.decision-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .65rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.price-simulator h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.08rem;
  font-weight: 800;
}

.price-simulator label { margin-bottom: 6px; font-size: .76rem; }

.simulator-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #cfd5da;
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.simulator-input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(255, 83, 0, .13);
}

.simulator-input-wrap > span {
  padding-left: 13px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
}

.simulator-input-wrap input {
  min-width: 0;
  height: 44px;
  padding: 0 12px 0 7px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 1rem;
  font-weight: 700;
}

.simulator-help {
  margin: 6px 2px 14px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.4;
}

.market-reference {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.market-reference > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.market-reference dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 750;
  text-transform: uppercase;
}

.market-reference dd {
  margin: 0;
  color: var(--navy);
  font-size: .84rem;
  font-weight: 850;
  white-space: nowrap;
}

.simulation-summary {
  margin-top: 12px;
  padding: 12px;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
}

.simulation-summary[hidden] { display: none; }
.simulation-position { margin-bottom: 9px; color: var(--navy); font-size: .82rem; font-weight: 800; }

.simulation-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.simulation-counts span {
  color: var(--muted);
  font-size: .65rem;
  text-align: center;
}

.simulation-counts strong { display: block; color: var(--ink); font-size: 1rem; }

.simulation-nearest {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.4;
}

.related-prices-note {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.45;
}

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

.related-prices-more summary {
  padding: 10px 4px 2px;
  color: var(--blue);
  font-size: .75rem;
  font-weight: 800;
  cursor: pointer;
}

.related-prices-more[open] summary { margin-bottom: 8px; }

.use-own-price {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(242, 106, 33, .32);
  color: var(--blue);
  background: #fff;
  font-size: .68rem;
}

.use-own-price:hover { color: #fff; background: var(--blue); }

.refresh-action {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.refresh-action button { max-width: 360px; }

.search-unavailable-state {
  display: grid;
  justify-items: center;
  margin-top: 14px;
  padding: 38px 28px 34px;
  border: 1px solid #f1c999;
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(145deg, #fff, #fff8ef);
  box-shadow: 0 14px 38px rgba(75, 55, 32, .07);
}

.search-unavailable-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  border-radius: 22px;
  color: #c55b16;
  background: #fff0dd;
  place-items: center;
}

.search-unavailable-icon svg {
  width: 46px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-unavailable-state h2 {
  margin: 0 0 9px;
  color: var(--navy);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
}

.search-unavailable-state > p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.6;
}

.search-unavailable-state .search-unavailable-cache-date,
.search-unavailable-state .search-unavailable-no-cache {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #734318;
  background: #fff0dd;
  font-size: .84rem;
}

.search-unavailable-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.search-unavailable-actions button {
  width: auto;
  min-width: 190px;
  min-height: 44px;
  margin: 0;
  padding: 0 18px;
}

.no-results-state {
  padding: 38px 24px 34px;
  border: 1px dashed rgba(255, 83, 0, .35);
  border-radius: 18px;
  text-align: center;
  background: rgba(255, 248, 244, .58);
}

.no-results-illustration {
  width: 220px;
  max-width: 75%;
  margin: 0 auto 18px;
}

.no-results-illustration svg { display: block; width: 100%; overflow: visible; }
.no-results-ground,
.no-results-product rect,
.no-results-product > path:not(.no-results-cross),
.no-results-search circle,
.no-results-handle,
.no-results-x,
.no-results-detail {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.no-results-ground { stroke: #d9dee2; stroke-width: 3; }
.no-results-product rect { fill: #fff; stroke: #ffb48f; stroke-width: 2.3; }
.no-results-product > path:not(.no-results-cross) { stroke: #ffb48f; stroke-width: 2; }
.no-results-cross { fill: #ffd2bc; }
.no-results-search circle { fill: rgba(255, 255, 255, .92); stroke: var(--blue); stroke-width: 3; }
.no-results-handle { stroke: var(--blue); stroke-width: 6; }
.no-results-x { stroke: var(--blue); stroke-width: 3; }
.no-results-detail { stroke: #ff9b6b; stroke-width: 2.2; }

.no-results-state h2 {
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 1.15rem;
}

.no-results-state p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.55;
}

.product-card {
  display: grid;
  grid-template-columns: 155px 1fr;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.own-price-column .product-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-color: var(--line);
  background: #fbfcfd;
  box-shadow: none;
}

.related-price-summary { min-width: 0; }

.related-price-summary > strong {
  display: block;
  margin-bottom: 3px;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 900;
}

.related-price-summary .product-name {
  overflow: hidden;
  margin: 0 0 3px;
  color: var(--navy);
  font-size: .72rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-price-summary > span { color: var(--muted); font-size: .66rem; }

.store-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  margin-bottom: 6px;
}

.store-heading .store { margin-bottom: 0; }

.price-breakdown {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  margin: 0;
}

.price-breakdown-row {
  display: grid;
  gap: 1px;
  margin: 0;
}

.price-breakdown-row dt {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.price-breakdown-row dd {
  margin: 0;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 800;
}

.price-breakdown-table dd { color: var(--muted); }
.price-breakdown-discount dd { color: #9a4b13; }
.price-breakdown-discount dd span { white-space: nowrap; }

.price-breakdown-final dd {
  color: var(--green);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.1;
}

.product-info h3 { margin-bottom: 6px; color: var(--navy); font-size: 1rem; }
.product-info p { margin-bottom: 4px; color: var(--muted); font-size: .88rem; }
.product-info .store { color: var(--ink); font-weight: 800; }
.product-info .product-name { margin-bottom: 7px; color: var(--navy); font-weight: 700; }
.product-info .meta { margin: 9px 0 0; color: var(--blue); font-weight: 700; }

.product-info .simulated-comparison {
  margin: 11px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 800;
}

.simulated-comparison[hidden] { display: none; }
.simulated-comparison.is-more-expensive { color: #9b2c2c; background: #fce8e8; }
.simulated-comparison.is-cheaper { color: #176b3a; background: #e7f6ed; }
.simulated-comparison.is-equal { color: #4f565c; background: #eceff1; }

.column-empty { margin-top: 0; }

.message {
  margin-top: 24px;
  padding: 16px;
  border-radius: 10px;
  background: #eaf1f6;
}

.message.error { color: #8b2929; background: #fbeaea; }
.message.warning { color: #705414; background: #fff2cd; }
.message.success { color: #303132; background: #fce2c4; }

.toast {
  position: fixed;
  z-index: 90;
  top: 18px;
  left: 50%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  width: min(430px, calc(100% - 32px));
  align-items: center;
  gap: 11px;
  overflow: hidden;
  padding: 14px 12px 14px 15px;
  border: 1px solid #f9cb94;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 16px 45px rgba(33, 37, 41, .18);
  transform: translateX(-50%);
  animation: toast-enter .25s ease-out both;
}

.toast.is-closing { animation: toast-leave .2s ease-in both; }

.toast-icon {
  display: grid;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-size: .9rem;
  font-weight: 900;
}

.toast-message { font-size: .9rem; font-weight: 700; }

.toast-close {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 1.3rem;
  line-height: 1;
}

.toast-close:hover { color: var(--ink); background: #f1f3f5; }

.toast-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--blue);
  transform-origin: left;
  animation: toast-progress var(--toast-duration, 4000ms) linear forwards;
}

.toast-success {
  border-color: #b7e0c4;
  background: #dff5e6;
}

.toast-success .toast-icon {
  background: #246b3b;
}

.toast-success .toast-progress {
  background: #246b3b;
}

.toast-error {
  border-color: #edc1c1;
  background: #fbeaea;
}

.toast-error .toast-icon {
  background: #8b2929;
}

.toast-error .toast-progress {
  background: #8b2929;
}

@keyframes toast-enter {
  from { opacity: 0; transform: translate(-50%, -12px); }
}

@keyframes toast-leave {
  to { opacity: 0; transform: translate(-50%, -10px); }
}

@keyframes toast-progress {
  to { transform: scaleX(0); }
}

.loading-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(33, 37, 41, .56);
  backdrop-filter: blur(4px);
}

.loading-modal[hidden] { display: none; }

body.loading-active { overflow: hidden; }

.loading-modal-card {
  width: min(390px, 100%);
  padding: 32px 28px 26px;
  border: 1px solid rgba(255, 83, 0, .18);
  border-radius: 18px;
  text-align: center;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(12, 14, 16, .28);
}

.loading-visual {
  position: relative;
  width: 116px;
  height: 70px;
  margin: 0 auto 20px;
  color: var(--blue);
}

.loading-magnifier {
  position: absolute;
  z-index: 2;
  top: 15px;
  left: 2px;
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 3px 4px rgba(255, 83, 0, .18));
  transform-origin: center;
  animation: magnifier-scan 1.7s ease-in-out infinite;
}

.loading-price-lines {
  position: absolute;
  inset: 9px 4px 9px 18px;
  display: grid;
  align-content: center;
  gap: 9px;
}

.loading-price-lines span {
  position: relative;
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceff1;
}

.loading-price-lines span:nth-child(2) { width: 82%; }
.loading-price-lines span:nth-child(3) { width: 64%; }

.loading-price-lines span::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -24px;
  width: 24px;
  border-radius: inherit;
  content: "";
  background: linear-gradient(90deg, #ffd4bd, var(--blue));
  animation: price-highlight 1.7s ease-in-out infinite;
}

.loading-modal-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 1.15rem;
}

.loading-modal-card p {
  max-width: 310px;
  margin: 0 auto;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.loading-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  animation: loading-dot 1s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: .14s; }
.loading-dots span:nth-child(3) { animation-delay: .28s; }

@keyframes loading-dot {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-5px); }
}

@keyframes magnifier-scan {
  0%, 100% { transform: translate(0, 4px) rotate(-8deg); }
  45%, 55% { transform: translate(72px, -3px) rotate(7deg); }
}

@keyframes price-highlight {
  0%, 100% { transform: translateX(0); opacity: .35; }
  45%, 55% { transform: translateX(94px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-magnifier,
  .loading-magnifier,
  .loading-price-lines span::after,
  .loading-dots span { animation: none; }
  .toast,
  .toast-progress { animation: none; }
  .price-comparison-layout,
  .own-price-column { transition: none; }
}

.settings-container {
  width: min(1180px, calc(100% - 40px));
  max-width: none;
}

.settings-container header { margin: 10px 0 14px; }

.settings-container header h1 { margin-bottom: 0; }

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

.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.settings-tabs button {
  width: auto;
  padding: 12px 18px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
}

.settings-tabs button[aria-selected="true"] {
  border-bottom-color: var(--orange);
  color: var(--text);
}

.settings-tabs button:focus-visible {
  outline: 3px solid rgba(255, 82, 20, .24);
  outline-offset: 2px;
}

.tenant-settings-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-field-wide { grid-column: 1 / -1; }

.settings-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: center;
  margin-top: 2px;
}

.settings-actions button { width: 40%; }

.field-help {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.back-link {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover { color: var(--blue); }

.competitors-container { width: min(1180px, calc(100% - 40px)); }

.competitors-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.competitors-header h1 { margin-bottom: 8px; }
.competitors-header .subtitle { margin-bottom: 0; font-size: .95rem; }

.scope-badge {
  padding: 8px 12px;
  border: 1px solid #f9cb94;
  border-radius: 999px;
  color: #8c3108;
  background: #fff8f4;
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
}

.competitor-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr auto;
  align-items: end;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(33, 37, 41, .06);
}

.competitor-filters label { font-size: .78rem; }
.competitor-filters input,
.competitor-filters select { min-height: 44px; }
.competitor-filters button { width: auto; min-height: 44px; padding: 0 20px; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.summary-card {
  min-height: 138px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
}

.summary-card > span,
.competitor-metric > span,
.competitor-stat > span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 750;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.summary-card > strong {
  display: block;
  margin-bottom: 5px;
  color: var(--navy);
  font-size: 2rem;
  line-height: 1.1;
}

.summary-card-text > strong { font-size: 1.05rem; line-height: 1.3; }
.summary-card small { color: var(--muted); font-size: .76rem; }
.ranking-section { margin-top: 34px; }

.ranking-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.ranking-heading h2 { margin-bottom: 0; }
.ranking-heading > p { margin-bottom: 2px; color: var(--muted); font-size: .8rem; }

.own-insight-card {
  position: sticky;
  z-index: 25;
  top: 12px;
  display: grid;
  grid-template-columns: minmax(250px, 1.25fr) minmax(430px, 2fr);
  align-items: center;
  gap: 24px;
  margin-bottom: 12px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 83, 0, .5);
  border-left: 5px solid var(--blue);
  border-radius: 15px;
  background: rgba(255, 248, 244, .97);
  box-shadow: 0 14px 34px rgba(33, 37, 41, .14);
  backdrop-filter: blur(10px);
}

.own-insight-card-empty { grid-template-columns: 1fr; }

.own-insight-label {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--blue);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.own-insight-intro h3 {
  margin-bottom: 6px;
  color: var(--navy);
  font-size: 1.05rem;
}

.own-insight-message {
  margin-bottom: 0;
  color: var(--muted);
  font-size: .79rem;
  line-height: 1.45;
}

.own-insight-message strong { color: var(--navy); }

.own-insight-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, .55fr)) repeat(2, minmax(135px, 1.15fr));
  gap: 10px;
}

.own-insight-metrics > div {
  min-width: 0;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 83, 0, .2);
}

.own-insight-metrics span,
.own-insight-metrics small {
  display: block;
  color: var(--muted);
  font-size: .66rem;
}

.own-insight-metrics span {
  margin-bottom: 4px;
  font-weight: 750;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.own-insight-metrics strong {
  display: block;
  color: var(--navy);
  font-size: 1rem;
  white-space: nowrap;
}

.own-insight-market-gap small,
.own-insight-score small { margin-top: 3px; }

.own-insight-metric-heading {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-bottom: 4px;
}
.own-insight-metric-heading > span { margin-bottom: 0; }
.own-insight-metric-heading .insight-tip-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  color: inherit;
  font-size: inherit;
  letter-spacing: 0;
  text-transform: none;
}
.insight-tip-trigger {
  display: inline-flex;
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border: 1px solid #a8adb2;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: #686d72;
  background: transparent;
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  line-height: 16px;
  text-align: center;
}
.insight-tip-trigger:hover,
.insight-tip-trigger:focus-visible { color: white; border-color: var(--blue); background: var(--blue); }
.insight-tooltip {
  position: fixed;
  z-index: 160;
  display: block;
  width: min(310px, calc(100vw - 24px));
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  color: white;
  background: #272a2d;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  font: 500 .75rem/1.45 Inter, ui-sans-serif, sans-serif;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
}
.insight-tooltip[hidden] { display: none; }
.competitor-list { display: grid; gap: 10px; }

.competitor-card {
  display: grid;
  grid-template-columns: 34px minmax(210px, 1.6fr) repeat(2, minmax(130px, 1fr)) minmax(72px, .55fr) minmax(115px, .8fr);
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.competitor-rank {
  display: grid;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  place-items: center;
  color: #8c3108;
  background: #fff0e8;
  font-size: .78rem;
  font-weight: 900;
}

.competitor-identity h3 { margin-bottom: 5px; font-size: .96rem; }
.competitor-identity p { margin-bottom: 5px; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.competitor-identity small,
.competitor-metric small,
.competitor-stat small { color: #777; font-size: .7rem; }
.competitor-metric strong,
.competitor-stat strong { display: block; color: var(--navy); font-size: 1rem; }

.metric-bar {
  height: 5px;
  margin: 7px 0 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f2;
}

.metric-bar i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }

.competitors-empty {
  margin-top: 24px;
  padding: 70px 24px;
  border: 1px dashed #efb99e;
  border-radius: 18px;
  text-align: center;
  background: rgba(255, 255, 255, .75);
}

.competitors-empty h2 { margin-bottom: 8px; }
.competitors-empty p { margin-bottom: 22px; color: var(--muted); }
.empty-chart { display: flex; height: 54px; align-items: end; justify-content: center; gap: 7px; margin-bottom: 20px; }
.empty-chart span { width: 14px; border-radius: 4px 4px 0 0; background: #ffd2bc; }
.empty-chart span:nth-child(1) { height: 22px; }
.empty-chart span:nth-child(2) { height: 38px; background: #ff9b6b; }
.empty-chart span:nth-child(3) { height: 52px; background: var(--blue); }
.terms-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.terms-summary > div:not(.terms-legend) {
  display: flex;
  min-width: 180px;
  align-items: baseline;
  gap: 9px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
}

.terms-summary strong { color: var(--navy); font-size: 1.35rem; }
.terms-summary > div > span { color: var(--muted); font-size: .78rem; }

.terms-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  color: var(--muted);
  font-size: .76rem;
}

.terms-legend span { display: flex; align-items: center; gap: 6px; }
.terms-legend i { display: block; width: 10px; height: 10px; border-radius: 3px; }
.legend-success { background: var(--blue); }
.legend-empty { background: #aeb4b9; }
.terms-ranking { margin-top: 34px; }
.terms-chart { display: grid; gap: 10px; }

.term-chart-row {
  display: grid;
  grid-template-columns: minmax(210px, .9fr) minmax(300px, 2fr) 82px;
  align-items: center;
  gap: 22px;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.term-chart-label { display: flex; min-width: 0; align-items: center; gap: 11px; }
.term-position {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  place-items: center;
  color: #8c3108;
  background: #fff0e8;
  font-size: .76rem;
  font-weight: 900;
}

.term-chart-label h3 {
  overflow: hidden;
  margin-bottom: 4px;
  font-size: .96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.term-chart-label small,
.term-breakdown { color: var(--muted); font-size: .7rem; }
.term-bar-track { height: 13px; overflow: hidden; border-radius: 999px; background: #edf0f2; }
.term-bar-total { display: flex; min-width: 5px; height: 100%; overflow: hidden; border-radius: inherit; }
.term-bar-success { height: 100%; background: var(--blue); }
.term-bar-empty { height: 100%; background: #aeb4b9; }
.term-breakdown { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }
.term-chart-value { text-align: right; }
.term-chart-value strong { display: block; color: var(--navy); font-size: 1.2rem; }
.term-chart-value span { color: var(--blue); font-size: .76rem; font-weight: 800; }
.terms-filter-empty { padding-top: 58px; padding-bottom: 58px; }
.empty-search-symbol { margin-bottom: 13px; color: var(--blue); font-size: 3rem; line-height: 1; }

.ai-analyze-button { display: inline-flex; width: auto; min-height: 36px; align-items: center; gap: 7px; margin-top: 11px; padding: 0 13px; border: 1px solid rgba(255, 83, 0, .35); color: var(--blue); background: white; font-size: .75rem; }
.ai-analyze-button:hover { color: white; background: var(--blue); }
.ai-analyze-button svg { width: 17px; height: 17px; fill: currentColor; }
.assistant-container { width: min(1180px, calc(100% - 40px)); }
.assistant-page-body { height: 100vh; height: 100dvh; overflow: hidden; }
.assistant-page-body .assistant-container { display: flex; height: 100%; min-height: 0; flex-direction: column; padding-bottom: 28px; }
.assistant-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.assistant-page-body .assistant-page-header { flex: 0 0 auto; }
.assistant-page-header .subtitle { margin-bottom: 0; font-size: .95rem; }
.ai-model-status { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; color: var(--muted); background: #eceff1; font-size: .72rem; font-weight: 750; white-space: nowrap; }
.ai-model-status span { width: 8px; height: 8px; border-radius: 50%; background: #9aa0a6; }
.ai-model-status.is-online { color: #176b3a; background: #e7f6ed; }
.ai-model-status.is-online span { background: #239255; box-shadow: 0 0 0 3px rgba(35, 146, 85, .13); }
.ai-model-status.is-offline { color: #8b2929; background: #fbeaea; }
.ai-model-status.is-offline span { background: #c54949; }
.assistant-shell { min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 18px 45px rgba(33, 37, 41, .08); }
.assistant-shell-page { display: grid; height: calc(100vh - 178px); min-height: 590px; grid-template-columns: 280px minmax(0, 1fr); }
.assistant-page-body .assistant-shell-page { height: auto; min-height: 0; flex: 1; }
.assistant-history { display: flex; min-width: 0; min-height: 0; flex-direction: column; padding: 17px 14px; border-right: 1px solid var(--line); background: #fbfcfd; }
.assistant-history-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.assistant-history-heading h2 { margin: 0; font-size: 1rem; }
.assistant-new-button { display: flex; width: 34px; height: 34px; min-height: 34px; align-items: center; justify-content: center; padding: 0; border-radius: 9px; }
.assistant-new-button span { display: block; font-size: 1.2rem; line-height: 1; transform: translateY(-1px); }
.assistant-scope-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 15px; }
.assistant-scope-fields label { font-size: .65rem; }
.assistant-scope-fields input { min-width: 0; min-height: 39px; padding: 0 7px; font-size: .72rem; }
.assistant-conversation-list { display: grid; gap: 6px; max-height: calc(100% - 105px); overflow-y: auto; }
.assistant-page-body .assistant-conversation-list { min-height: 0; flex: 1; max-height: none; overscroll-behavior: contain; }
.assistant-conversation-item { display: block; min-height: 0; padding: 10px; border: 1px solid transparent; border-radius: 10px; color: var(--ink); background: transparent; text-align: left; }
.assistant-conversation-item:hover, .assistant-conversation-item.active { border-color: #ffd2bc; color: var(--ink); background: #fff3ed; }
.assistant-conversation-item strong { display: block; overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.assistant-conversation-item small { display: block; margin-top: 4px; color: var(--muted); font-size: .62rem; }
.assistant-history-empty { padding: 12px 5px; color: var(--muted); font-size: .72rem; }
.assistant-chat { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; background: var(--background); }
.assistant-chat-toolbar { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: white; }
.assistant-chat-toolbar span { display: block; color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.assistant-chat-toolbar strong { font-size: .78rem; }
.assistant-delete-button { width: auto; min-height: 34px; padding: 0 11px; color: #8b2929; background: #fbeaea; font-size: .68rem; }
.assistant-delete-button:hover { color: white; background: #a73838; }
.assistant-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 22px; overscroll-behavior: contain; scrollbar-gutter: stable; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.assistant-welcome { max-width: 620px; margin: 7vh auto 0; text-align: center; }
.assistant-welcome[hidden] { display: none; }
.assistant-welcome h2 { margin-bottom: 7px; font-size: 1.2rem; }
.assistant-welcome > p { color: var(--muted); font-size: .84rem; }
.assistant-orb { position: relative; display: grid; width: 70px; height: 70px; margin: 0 auto 17px; border-radius: 24px; place-items: center; background: linear-gradient(145deg, #fff, #ffe2d3); box-shadow: 0 12px 28px rgba(255, 83, 0, .16); }
.assistant-orb::before, .assistant-orb::after, .assistant-orb span { position: absolute; content: ""; border-radius: 50%; background: var(--blue); }
.assistant-orb::before { width: 23px; height: 23px; opacity: .9; }
.assistant-orb::after { width: 8px; height: 8px; top: 13px; right: 15px; opacity: .55; }
.assistant-orb span { width: 6px; height: 6px; bottom: 14px; left: 15px; opacity: .35; }
.assistant-suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 17px; }
.assistant-suggestions button { width: auto; min-height: 36px; padding: 0 12px; border: 1px solid #f9cb94; color: #8c3108; background: white; font-size: .72rem; }
.assistant-suggestions button:hover { color: white; background: var(--blue); }
.assistant-message { width: min(700px, 86%); margin-bottom: 14px; }
.assistant-message-user { margin-left: auto; }
.assistant-message-label { display: block; margin: 0 4px 5px; color: var(--muted); font-size: .64rem; font-weight: 750; }
.assistant-message-user .assistant-message-label { text-align: right; }
.assistant-message-content { padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; color: var(--ink); background: white; font-size: .82rem; line-height: 1.55; white-space: pre-wrap; }
.assistant-message-user .assistant-message-content { border-color: var(--blue); border-radius: 14px 14px 4px 14px; color: white; background: var(--blue); }
.assistant-message-error .assistant-message-content { border-color: #efb4b4; color: #8b2929; background: #fbeaea; }
.assistant-message.is-streaming .assistant-message-content:empty::after { content: ""; display: inline-block; width: 8px; height: 15px; background: var(--blue); animation: ai-cursor .8s infinite; }
@keyframes ai-cursor { 50% { opacity: .15; } }
.assistant-evidence-list { display: grid; gap: 7px; margin-top: 7px; }
.assistant-evidence-card { padding: 10px 12px; border: 1px solid #f5c5ad; border-radius: 11px; background: #fff8f4; }
.assistant-evidence-card > strong { display: block; color: var(--navy); font-size: .75rem; }
.assistant-evidence-card > span { display: block; margin-top: 2px; color: var(--muted); font-size: .65rem; }
.assistant-evidence-prices { margin-top: 7px; color: var(--blue); font-size: .78rem; font-weight: 850; }
.assistant-evidence-card small { display: block; margin-top: 4px; color: var(--muted); font-size: .63rem; }
.assistant-stream-status { padding: 4px 20px 8px; color: var(--muted); font-size: .7rem; }
.assistant-stream-status::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--blue); animation: ai-pulse 1s infinite; }
@keyframes ai-pulse { 50% { opacity: .25; transform: scale(.8); } }
.assistant-composer { display: flex; align-items: flex-end; gap: 9px; margin: 0 16px; padding: 8px; border: 1px solid #cfd5da; border-radius: 14px; background: white; box-shadow: 0 8px 22px rgba(33, 37, 41, .08); }
.assistant-composer:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(255, 83, 0, .12); }
.assistant-composer textarea { width: 100%; min-height: 40px; max-height: 130px; resize: none; padding: 9px 8px; border: 0; outline: 0; background: transparent; font: inherit; font-size: .82rem; line-height: 1.35; }
.assistant-composer button { display: grid; width: 40px; min-height: 40px; flex: 0 0 40px; padding: 0; border-radius: 10px; place-items: center; }
.assistant-composer button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.assistant-disclaimer { margin: 7px 18px 11px; color: #777; font-size: .61rem; text-align: center; }
.assistant-retry-button { width: auto; min-height: 34px; margin-top: 7px; padding: 0 11px; font-size: .68rem; }
.assistant-panel-backdrop { position: fixed; z-index: 79; inset: 0; background: rgba(33, 37, 41, .35); backdrop-filter: blur(2px); }
.assistant-panel { position: fixed; z-index: 80; inset: 0 0 0 auto; display: flex; width: min(470px, calc(100% - 64px)); flex-direction: column; background: var(--background); box-shadow: -18px 0 50px rgba(33, 37, 41, .2); }
.assistant-panel[hidden], .assistant-panel-backdrop[hidden] { display: none; }
.assistant-panel-open { overflow: hidden; }
.assistant-panel-header { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; padding: 17px 54px 15px 18px; border-bottom: 1px solid var(--line); background: white; }
.assistant-panel-header > div:first-child span { color: var(--blue); font-size: .63rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.assistant-panel-header h2 { margin: 2px 0 0; font-size: 1.1rem; }
.assistant-panel-close { position: absolute; top: 13px; right: 13px; display: flex; width: 36px; height: 36px; min-height: 36px; align-items: center; justify-content: center; padding: 0; border-radius: 9px; color: var(--muted); background: #f1f3f5; font-weight: 400; }
.assistant-panel-close span { display: block; font-size: 1.45rem; line-height: 1; transform: translateY(-1px); }
.assistant-panel-close:hover { color: white; background: var(--blue); }
.assistant-panel .assistant-messages { padding: 17px; }
.assistant-panel .assistant-welcome { margin-top: 5vh; }
.assistant-panel .assistant-message { width: 92%; }
.assistant-panel .assistant-evidence-card:nth-child(n+6) { display: none; }
@media (prefers-reduced-motion: reduce) { .assistant-message.is-streaming .assistant-message-content:empty::after, .assistant-stream-status::before { animation: none; } }

@media (max-width: 1050px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .competitor-card { grid-template-columns: 34px minmax(190px, 1.5fr) repeat(2, minmax(120px, 1fr)); }
  .competitor-stat { padding-left: 52px; }
  .term-chart-row { grid-template-columns: minmax(190px, .9fr) minmax(240px, 1.5fr) 70px; }
  .settings-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .own-insight-card { grid-template-columns: minmax(230px, 1fr) minmax(360px, 1.7fr); gap: 16px; }
  .own-insight-card.own-insight-card-empty { grid-template-columns: 1fr; }
  .own-insight-metrics { grid-template-columns: repeat(3, minmax(58px, .5fr)) repeat(2, minmax(120px, 1.1fr)); }
}

@media (max-width: 760px) {
  .has-sidebar { padding-left: 64px; }
  .app-sidebar { width: 64px; padding: 14px 9px; }
  .sidebar-brand { justify-content: center; margin: 0 0 24px; }
  .sidebar-brand > span { margin-right: 0; }
  .sidebar-brand strong,
  .sidebar-nav-link span { display: none; }
  .sidebar-nav-link { justify-content: center; padding: 0; }
  .container { padding-top: 20px; }
  .search-fields { grid-template-columns: 1fr; }
  .price-comparison-layout { grid-template-columns: 1fr; }
  .comparison-sidebar {
    position: relative;
    grid-column: 1;
    grid-row: auto;
    order: 1;
    max-height: none;
  }
  .comparison-sidebar-content {
    position: relative;
    top: auto;
    max-height: none;
  }
  .own-price-column { max-height: none; }
  .competitor-price-column {
    grid-column: 1;
    grid-row: auto;
    order: 2;
  }
  .price-column-scroll {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .welcome-empty { padding: 26px 18px 24px; }
  .search-unavailable-state { padding: 28px 18px 26px; }
  .search-unavailable-actions { width: 100%; flex-direction: column; }
  .search-unavailable-actions button { width: 100%; }
  .no-results-state { padding: 28px 18px 26px; }
  .no-results-illustration { width: 185px; margin-bottom: 14px; }
  .product-card { grid-template-columns: 1fr; }
  .own-price-column .product-card { grid-template-columns: 1fr; }
  .product-card { gap: 6px; }
  .results-heading { align-items: start; flex-direction: column; }
  .pbm-alert { align-items: flex-start; flex-direction: column; }
  .results-status-heading { width: 100%; align-items: center; flex-direction: row; }
  .result-badges { justify-content: flex-start; }
  .settings-actions button { width: 100%; }
  .settings-container { width: min(100% - 24px, 680px); }
  .assistant-container { width: min(100% - 24px, 680px); }
  .assistant-page-header { align-items: flex-start; flex-direction: column; }
  .assistant-shell-page { height: auto; min-height: calc(100vh - 180px); grid-template-columns: 1fr; }
  .assistant-page-body .assistant-shell-page { min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
  .assistant-history { padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .assistant-conversation-list { display: flex; max-height: none; overflow-x: auto; }
  .assistant-conversation-item { min-width: 190px; }
  .assistant-chat { min-height: 560px; }
  .assistant-page-body .assistant-chat { min-height: 0; }
  .assistant-panel { width: 100%; }
  .assistant-panel-header { grid-template-columns: 1fr; }
  .assistant-panel .ai-model-status { width: fit-content; }
  .assistant-messages { padding: 15px; }
  .assistant-message { width: 94%; }
  .assistant-welcome { margin-top: 3vh; }
  .assistant-suggestions { display: grid; }
  .assistant-suggestions button { width: 100%; }
  .settings-card { grid-template-columns: 1fr; }
  .search-container,
  .competitors-container,
  .assistant-container { width: min(100% - 24px, 680px); }
  .competitors-header { align-items: flex-start; flex-direction: column; }
  .scope-badge { max-width: 100%; white-space: normal; }
  .competitor-filters { grid-template-columns: 1fr 1fr; }
  .filter-sort { grid-column: 1 / -1; }
  .competitor-filters button { grid-column: 1 / -1; width: 100%; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: auto; }
  .ranking-heading { align-items: flex-start; flex-direction: column; }
  .own-insight-card {
    top: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 11px 12px;
    border-left-width: 4px;
    border-radius: 12px;
  }
  .own-insight-card-empty { grid-template-columns: 1fr; }
  .own-insight-label { margin-bottom: 2px; font-size: .62rem; }
  .own-insight-intro h3 { margin-bottom: 3px; font-size: .86rem; }
  .own-insight-message { font-size: .7rem; line-height: 1.3; }
  .own-insight-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .own-insight-metrics > div:not(.own-insight-market-gap):not(.own-insight-score) { display: none; }
  .own-insight-metrics > div { padding-left: 10px; }
  .own-insight-metrics span { font-size: .58rem; }
  .own-insight-metrics strong { font-size: .86rem; }
  .own-insight-score small { font-size: .6rem; }
  .competitor-card { grid-template-columns: 30px 1fr; }
  .competitor-metric,
  .competitor-stat { grid-column: 2; padding-left: 0; }
  .terms-summary { align-items: stretch; flex-direction: column; }
  .terms-summary > div:not(.terms-legend) { min-width: 0; }
  .terms-legend { margin: 2px 0 0; }
  .term-chart-row { grid-template-columns: 1fr auto; gap: 13px; }
  .term-chart-visual { grid-column: 1 / -1; grid-row: 2; }
  .term-chart-value { grid-column: 2; grid-row: 1; }
}

@media (max-width: 430px) {
  .competitor-filters { grid-template-columns: 1fr; }
  .filter-sort,
  .competitor-filters button { grid-column: auto; }
  .own-insight-card { grid-template-columns: 1fr; }
}

/* Central de oportunidades */
.opportunities-container { width: min(1220px, calc(100% - 40px)); }

.opportunities-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.opportunities-header h1 { margin: 2px 0 7px; }
.opportunities-header .subtitle { margin: 0; }
.opportunities-header-actions { display: flex; align-items: center; gap: 10px; }
.calculation-guide-button { width: auto; min-height: 38px; padding: 0 14px; white-space: nowrap; }
.calculation-guide-button > span { display: inline-grid; width: 20px; height: 20px; place-items: center; border: 1px solid currentColor; border-radius: 50%; }

.calculation-guide {
  position: relative;
  margin-top: 18px;
  padding: 23px 54px 22px 24px;
  border: 1px solid #ffc7aa;
  border-radius: 16px;
  background: #fff8f4;
  box-shadow: 0 14px 38px rgba(95, 45, 19, .07);
}
.calculation-guide[hidden] { display: none; }
.calculation-guide h2 { margin: 3px 0 14px; font-size: 1.18rem; }
.calculation-guide ol { display: grid; gap: 7px; margin: 0; padding-left: 22px; color: #4f5154; font-size: .86rem; line-height: 1.5; }
.calculation-guide .icon-close-button { position: absolute; top: 14px; right: 14px; }
.calculation-formulas { display: flex; gap: 12px; margin-top: 16px; }
.calculation-formulas p { flex: 1; margin: 0; padding: 10px 12px; border-radius: 10px; background: white; font-size: .8rem; }
.calculation-warning { margin: 14px 0 0; color: #86511f; font-size: .78rem; font-weight: 700; }

.icon-close-button {
  display: grid;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  place-items: center;
  color: var(--muted);
  background: #f1f3f5;
  font-size: 1.35rem;
  line-height: 1;
}
.icon-close-button:hover { color: var(--ink); background: #e8eaec; }

.opportunity-filters {
  display: grid;
  grid-template-columns: .85fr .85fr 1.8fr 1.15fr;
  align-items: end;
  gap: 11px;
  margin-top: 18px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  box-shadow: 0 12px 36px rgba(33, 37, 41, .055);
}
.opportunity-filters label { font-size: .72rem; }
.opportunity-filters input, .opportunity-filters select { min-height: 44px; }
.opportunity-filters button { width: auto; min-height: 44px; padding: 0 18px; }
.opportunity-filter-actions { display: grid; grid-template-columns: auto auto; align-items: end; gap: 8px; }
.opportunity-filter-actions button { width: auto; padding: 0 14px; white-space: nowrap; }
.opportunity-clear-filters {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--blue);
  border-radius: 10px;
  color: var(--blue-dark);
  background: transparent;
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.opportunity-clear-filters:hover, .opportunity-clear-filters:focus-visible { color: white; background: var(--blue); }
.opportunity-clear-filters:focus-visible { outline: 3px solid rgba(255, 83, 0, .18); outline-offset: 1px; }
.opportunity-percentage-filter { min-width: 0; margin: 0; padding: 0; border: 0; grid-column: span 2; }
.opportunity-percentage-filter legend { margin: 0 0 5px; padding: 0; font-size: .72rem; font-weight: 700; }
.opportunity-range-values { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: var(--ink); font-size: .68rem; font-weight: 800; }
.opportunity-range-values output { min-width: 42px; }
.opportunity-range-values output:last-child { text-align: right; }
.opportunity-dual-range { position: relative; height: 27px; margin-top: 1px; }
.opportunity-range-track { position: absolute; top: 12px; right: 0; left: 0; height: 5px; border-radius: 999px; background: linear-gradient(to right, #d9dde1 0 var(--range-start, 0%), var(--blue) var(--range-start, 0%) var(--range-end, 100%), #d9dde1 var(--range-end, 100%) 100%); }
.opportunity-filters .opportunity-range-input { position: absolute; inset: 0; width: 100%; min-height: 27px; margin: 0; padding: 0; -webkit-appearance: none; appearance: none; border: 0; background: transparent; pointer-events: none; }
.opportunity-range-input::-webkit-slider-runnable-track { height: 5px; background: transparent; }
.opportunity-range-input::-webkit-slider-thumb { width: 17px; height: 17px; margin-top: -6px; -webkit-appearance: none; appearance: none; border: 3px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 2px 6px rgba(33, 37, 41, .2); cursor: grab; pointer-events: auto; }
.opportunity-range-input::-moz-range-track { height: 5px; background: transparent; }
.opportunity-range-input::-moz-range-thumb { width: 11px; height: 11px; border: 3px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 2px 6px rgba(33, 37, 41, .2); cursor: grab; pointer-events: auto; }
.opportunity-range-input:focus-visible { outline: 0; }
.opportunity-range-input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(255, 83, 0, .25), 0 0 0 1px var(--blue); }
.opportunity-range-input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px rgba(255, 83, 0, .25), 0 0 0 1px var(--blue); }

.opportunity-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.opportunity-summary-card { min-height: 132px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.opportunity-summary-card > span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.opportunity-summary-card > strong { display: block; margin: 12px 0 4px; color: var(--navy); font-size: 2rem; line-height: 1; }
.opportunity-summary-card small { display: block; overflow: hidden; color: var(--muted); font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.opportunity-summary-alert { border-color: #ffd2bc; background: #fffaf7; }
.opportunity-summary-alert > strong { color: #c84307; }
.opportunity-summary-good { border-color: #cfe8d7; background: #f8fcf9; }
.opportunity-summary-good > strong { color: #237441; }
.opportunity-summary-text > strong { font-size: 1.5rem; }

.opportunity-tip-wrap { position: relative; display: inline-flex; align-items: center; text-transform: none; }
.opportunity-tip-trigger {
  display: inline-flex;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 1px solid #a8adb2;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: #686d72;
  background: transparent;
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  line-height: 18px;
  text-align: center;
}
.opportunity-tip-trigger:hover, .opportunity-tip-trigger:focus-visible { color: white; border-color: var(--blue); background: var(--blue); }
.opportunity-tooltip {
  position: fixed;
  z-index: 160;
  width: min(280px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 9px;
  color: white;
  background: #272a2d;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  font: 500 .75rem/1.45 Inter, ui-sans-serif, sans-serif;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
}
.opportunity-tooltip[hidden] { display: none; }

.opportunity-list-section { margin-top: 30px; }
.opportunity-list-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.opportunity-list-heading h2 { margin: 2px 0 0; }
.opportunity-list-heading > p { margin: 0 0 2px; color: var(--muted); font-size: .8rem; }
.opportunity-list { display: grid; gap: 11px; }
.opportunity-card {
  display: grid;
  grid-template-columns: minmax(250px, 1.65fr) minmax(135px, .75fr) minmax(150px, .85fr) minmax(150px, .9fr) auto;
  align-items: center;
  gap: 18px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid #9ca2a7;
  border-radius: 14px;
  background: white;
  box-shadow: 0 7px 22px rgba(33, 37, 41, .035);
}
.opportunity-card-scored { grid-template-columns: minmax(230px, 1.5fr) minmax(115px, .68fr) minmax(130px, .78fr) minmax(125px, .76fr) 112px auto; }
.opportunity-card-above { border-left-color: #e74e0a; }
.opportunity-card-below { border-left-color: #2c8a50; }
.opportunity-card-equal { border-left-color: #7b8187; }
.opportunity-product h3 { margin: 5px 0 5px; font-size: .94rem; line-height: 1.3; }
.opportunity-product p { margin: 0; color: var(--muted); font-size: .72rem; }
.opportunity-score {
  grid-column: 5;
  grid-row: 1 / 3;
  display: flex;
  min-width: 108px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 4px 3px;
  color: var(--navy);
  text-align: center;
}
.opportunity-score-label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .63rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.opportunity-score-gauge { position: relative; width: 106px; height: 82px; margin-top: 2px; }
.opportunity-score-gauge svg { display: block; width: 100%; height: auto; overflow: visible; }
.opportunity-gauge-track, .opportunity-gauge-value { fill: none; stroke-width: 10; stroke-linecap: round; }
.opportunity-gauge-track { stroke: #e5e8ea; }
.opportunity-gauge-needle { stroke: #30353a; stroke-width: 2.4; stroke-linecap: round; transform-origin: 60px 59px; transition: transform .45s ease; }
.opportunity-gauge-center { fill: #30353a; }
.opportunity-score-number { position: absolute; top: 63px; right: 0; left: 0; display: flex; align-items: baseline; justify-content: center; gap: 2px; }
.opportunity-score-number strong { font-size: 1.2rem; line-height: 1; }
.opportunity-score-number small { color: var(--muted); font-size: .58rem; font-weight: 800; }
.opportunity-score-level { min-height: 17px; margin-top: 8px; font-size: .68rem; line-height: 1.2; }
.opportunity-score-needs_adjustment .opportunity-score-level { color: #b63a14; }
.opportunity-score-attention .opportunity-score-level { color: #9a6309; }
.opportunity-score-good .opportunity-score-level { color: #377560; }
.opportunity-score-competitive .opportunity-score-level { color: #237441; }
.opportunity-score-info-trigger { flex: 0 0 18px; width: 18px; min-height: 18px; margin: 0; padding: 0; font-size: 10px; letter-spacing: 0; text-transform: none; }
.opportunity-score-pending, .opportunity-score-unavailable { color: var(--muted); }
.opportunity-score-pending .opportunity-gauge-needle,
.opportunity-score-unavailable .opportunity-gauge-needle { stroke: #8c9297; }
.opportunity-score-tooltip { width: min(370px, calc(100vw - 24px)); padding: 14px 15px; }
.opportunity-score-tooltip > strong { display: block; color: white; font-size: .8rem; }
.opportunity-score-tooltip > p { margin: 7px 0 0; color: #f1f3f4; font-size: .7rem; font-weight: 750; line-height: 1.45; }
.opportunity-score-dimensions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.opportunity-score-dimensions span { padding: 3px 6px; border-radius: 999px; color: #53575b; background: rgba(255, 255, 255, .75); font-size: .62rem; font-weight: 750; }
.opportunity-score-tooltip .opportunity-score-dimensions span { color: white; background: rgba(255, 255, 255, .14); }
.opportunity-score-tooltip ul { display: grid; gap: 3px; margin: 9px 0 7px; padding-left: 17px; color: #f1f3f4; font-size: .67rem; line-height: 1.4; }
.opportunity-score-tooltip > span { display: block; color: white; font-size: .67rem; font-weight: 800; }
.opportunity-score-tooltip > small { display: block; margin-top: 6px; color: #cfd3d6; font-size: .61rem; line-height: 1.4; }
.opportunity-status { color: #a53b0c; font-size: .66rem; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.opportunity-card-below .opportunity-status { color: #237441; }
.opportunity-card-equal .opportunity-status { color: #666c72; }
.opportunity-price-block > span, .opportunity-difference > span { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; color: var(--muted); font-size: .68rem; font-weight: 750; }
.opportunity-price-block > strong, .opportunity-difference > strong { display: block; color: var(--ink); font-size: 1.02rem; }
.opportunity-price-block small, .opportunity-difference small { display: block; margin-top: 4px; color: var(--muted); font-size: .68rem; line-height: 1.35; }
.opportunity-card-above .opportunity-difference strong { color: #c84307; }
.opportunity-card-below .opportunity-difference strong { color: #237441; }
.opportunity-meta { grid-column: 1 / -2; display: flex; flex-wrap: wrap; gap: 7px 18px; color: var(--muted); font-size: .7rem; }
.opportunity-card-scored .opportunity-meta { grid-column: 1 / 5; }
.opportunity-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.opportunity-competitor-control { gap: 5px; }
.opportunity-competitor-toggle {
  display: inline-flex;
  width: auto;
  min-height: 26px;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 0;
  border-radius: 7px;
  color: #4e5358;
  background: #eef0f2;
  font-size: .7rem;
  font-weight: 800;
}
.opportunity-competitor-toggle:hover,
.opportunity-competitor-toggle:focus-visible { color: #a63807; background: #ffede4; }
.opportunity-competitor-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .18s ease; }
.opportunity-competitor-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.stale-badge { padding: 3px 7px; border-radius: 999px; color: #8a560f; background: #fff1cf; font-weight: 800; }
.simulate-opportunity-action { grid-column: 5; grid-row: 1 / 3; display: flex; align-items: center; gap: 6px; }
.opportunity-card-scored .simulate-opportunity-action { grid-column: 6; }
.simulate-opportunity-button { width: auto; min-width: 116px; min-height: 40px; padding: 0 14px; font-size: .78rem; }

.opportunity-competitor-panel {
  grid-column: 1 / -1;
  max-height: 0;
  overflow: hidden;
  padding: 15px 16px 4px;
  border-top: 1px solid #eceff1;
  opacity: 1;
  transition: max-height .18s ease, padding .18s ease, opacity .14s ease;
}
.opportunity-competitor-panel.is-open { max-height: var(--competitor-panel-height, 2400px); }
.opportunity-competitor-panel.is-expanded { max-height: none; overflow: visible; }
.opportunity-competitor-panel[hidden] { display: none; }
.opportunity-competitor-panel:not(.is-open) { max-height: 0; padding-top: 0; padding-bottom: 0; border-top-color: transparent; opacity: 0; }
.opportunity-competitor-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.opportunity-competitor-panel-heading strong { font-size: .78rem; }
.opportunity-competitor-panel-heading span { color: var(--muted); font-size: .68rem; }
.opportunity-competitor-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.opportunity-competitor-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(145px, auto);
  align-items: center;
  gap: 14px;
  padding: 9px 11px;
  border: 1px solid #e5e8ea;
  border-radius: 9px;
  background: #fafbfc;
}
.opportunity-competitor-row.is-reference { border-color: #ffc6aa; background: #fff8f4; }
.opportunity-competitor-row > div { display: flex; min-width: 0; align-items: center; gap: 7px; }
.opportunity-competitor-row > div > strong { overflow: hidden; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.reference-price-badge { flex: 0 0 auto; padding: 3px 6px; border-radius: 999px; color: #a63807; background: #ffe7db; font-size: .61rem; font-weight: 850; }
.opportunity-competitor-price { color: var(--ink); font-size: .78rem; font-weight: 850; white-space: nowrap; }
.opportunity-competitor-row time { color: var(--muted); font-size: .68rem; text-align: right; white-space: nowrap; }

.opportunities-empty { margin-top: 26px; padding: 50px 24px; border: 1px dashed #f6b28e; border-radius: 17px; text-align: center; background: white; }
.opportunity-empty-icon { display: grid; width: 62px; height: 62px; margin: 0 auto 15px; border-radius: 18px; place-items: center; color: var(--blue); background: #fff1ea; font-size: 2rem; font-weight: 900; }
.opportunities-empty h2 { margin-bottom: 8px; }
.opportunities-empty p { max-width: 590px; margin: 0 auto 18px; color: var(--muted); }

.opportunity-simulator-backdrop { position: fixed; z-index: 119; inset: 0; background: rgba(25, 27, 29, .34); backdrop-filter: blur(2px); }
.opportunity-simulator-backdrop[hidden], .opportunity-simulator[hidden] { display: none; }
.opportunity-simulator {
  position: fixed;
  z-index: 120;
  inset: 0 0 0 auto;
  width: min(430px, 100%);
  overflow-y: auto;
  padding: 24px;
  border-left: 1px solid #f6b28e;
  background: #fff;
  box-shadow: -18px 0 55px rgba(33, 37, 41, .16);
}
.opportunity-simulator > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.opportunity-simulator h2 { margin: 2px 0 0; }
.opportunity-simulator > h3 { margin: 26px 0 5px; font-size: 1rem; line-height: 1.4; }
.simulator-gtin { margin: 0 0 22px; color: var(--muted); font-size: .78rem; }
.opportunity-simulator > label { display: flex; align-items: center; gap: 6px; font-size: .78rem; }
.simulator-money-input { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; margin-top: 7px; padding-left: 13px; border: 2px solid #ffb28c; border-radius: 11px; }
.simulator-money-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(255, 83, 0, .11); }
.simulator-money-input span { color: var(--blue); font-weight: 850; }
.simulator-money-input input { border: 0; box-shadow: none; font-size: 1.25rem; font-weight: 850; }
.simulator-money-input input:focus { box-shadow: none; }
.simulator-help { margin: 8px 0 18px; color: var(--muted); font-size: .74rem; line-height: 1.45; }
.simulator-results { display: grid; gap: 9px; }
.simulator-result { padding: 13px; border: 1px solid var(--line); border-left: 4px solid #858b90; border-radius: 11px; }
.simulator-result-above { border-left-color: #e74e0a; background: #fffaf7; }
.simulator-result-below { border-left-color: #2c8a50; background: #f8fcf9; }
.simulator-result > strong { display: block; font-size: .82rem; }
.simulator-result > span { display: block; margin-top: 4px; color: var(--muted); font-size: .7rem; }
.simulator-result > p { margin: 8px 0 0; font-size: .76rem; font-weight: 800; }
.simulator-result-above > p { color: #b53e09; }
.simulator-result-below > p { color: #237441; }
body.simulator-open { overflow: hidden; }

@media (max-width: 1100px) {
  .opportunity-filters { grid-template-columns: repeat(2, 1fr); }
  .opportunity-filter-search, .opportunity-percentage-filter { grid-column: 1 / -1; }
  .opportunity-percentage-filter { min-height: 58px; }
  .opportunity-filter-actions { grid-column: 1 / -1; }
  .opportunity-filter-actions button { width: 100%; }
  .opportunity-card, .opportunity-card-scored { grid-template-columns: minmax(230px, 1.5fr) repeat(3, minmax(125px, .8fr)); }
  .opportunity-score { grid-column: 3; grid-row: 2; }
  .simulate-opportunity-action, .opportunity-card-scored .simulate-opportunity-action { grid-column: 4; grid-row: 2; }
  .opportunity-meta { grid-column: 1 / 4; }
  .opportunity-card-scored .opportunity-meta { grid-column: 1 / 3; }
}

@media (max-width: 760px) {
  .opportunities-container { width: min(100% - 24px, 680px); }
  .opportunities-header { align-items: flex-start; flex-direction: column; }
  .opportunities-header-actions { width: 100%; align-items: flex-start; flex-direction: column; }
  .calculation-guide-button { width: 100%; }
  .calculation-formulas { flex-direction: column; }
  .opportunity-filters { grid-template-columns: 1fr 1fr; }
  .opportunity-filter-search { grid-column: 1 / -1; }
  .opportunity-percentage-filter { grid-column: 1 / -1; }
  .opportunity-filter-actions { grid-column: 1 / -1; }
  .opportunity-summary-grid { grid-template-columns: 1fr 1fr; }
  .opportunity-summary-card { min-height: 118px; }
  .opportunity-list-heading { align-items: flex-start; flex-direction: column; }
  .opportunity-card { grid-template-columns: 1fr 1fr; gap: 14px; }
  .opportunity-product { grid-column: 1 / -1; }
  .opportunity-difference { grid-column: 1 / -1; }
  .opportunity-meta, .opportunity-card-scored .opportunity-meta { grid-column: 1 / -1; }
  .opportunity-score { grid-column: 1; grid-row: auto; }
  .simulate-opportunity-action, .opportunity-card-scored .simulate-opportunity-action { grid-column: 2; grid-row: auto; }
  .simulate-opportunity-button { flex: 1; width: 100%; }
  .opportunity-competitor-row { grid-template-columns: 1fr auto; }
  .opportunity-competitor-row time { grid-column: 1 / -1; text-align: left; }
  .opportunity-simulator { inset: 0; width: 100%; border-left: 0; }
}

@media (max-width: 430px) {
  .opportunity-filters, .opportunity-summary-grid { grid-template-columns: 1fr; }
  .opportunity-filter-search, .opportunity-percentage-filter, .opportunity-filter-actions { grid-column: auto; }
  .opportunity-filter-actions { grid-template-columns: 1fr; }
  .opportunity-card { grid-template-columns: 1fr; }
  .opportunity-product, .opportunity-difference, .opportunity-meta, .opportunity-card-scored .opportunity-meta, .opportunity-score, .simulate-opportunity-action, .opportunity-card-scored .simulate-opportunity-action { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .calculation-guide { scroll-behavior: auto; }
  .opportunity-gauge-value,
  .opportunity-gauge-needle,
  .opportunity-competitor-panel,
  .opportunity-competitor-toggle svg { transition: none; }
}
