:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #94a3b8;
  --accent: #0b3a6e;
  --accent-2: #1256a0;
  --accent-hover: #082a52;
  --focus: #2563eb;
  --soft: #f8fafc;
  --danger: #b91c1c;
  --ok: #0b3a6e;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 18px 40px rgba(15, 23, 42, 0.07);
  --r: 2px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    linear-gradient(180deg, #dbe4ef 0%, transparent 220px),
    var(--bg);
  line-height: 1.45;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: min(1520px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.25rem 0 2.75rem;
}

.topbar {
  display: grid;
  grid-template-columns: 6px 1fr auto;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  background: #0b3a6e;
  color: #fff;
  border: 1px solid #082a52;
  box-shadow: var(--shadow);
}

.topbar-mark {
  width: 6px;
  align-self: stretch;
  background: linear-gradient(180deg, #60a5fa 0%, #38bdf8 100%);
}

.topbar-kicker {
  margin: 0 0 0.15rem;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #93c5fd;
  font-weight: 600;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.topbar-status {
  margin: 0;
  color: #cbd5e1;
  font-size: 12px;
  text-align: right;
  max-width: 420px;
}

.topbar-status.ok {
  color: #bfdbfe;
}

.topbar-status.error {
  color: #fecaca;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 0;
}

.block {
  padding: 1.35rem 1.5rem 1.5rem;
}

.block + .block {
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}

.export-csv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.export-csv-actions button {
  white-space: nowrap;
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.modal-csv-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 0.4rem 0.8rem;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.modal-csv-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.modal-csv-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-head .hint {
  margin: 0;
  text-align: right;
}

.hint {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 13px;
}

.meta-line {
  margin-top: 0.85rem;
  margin-bottom: 0;
}

.charts-top {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 70%);
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.direction-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.other-niche-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1.1rem 0.75rem;
}

#card-page .other-niche-chips,
#card-page .direction-mini-filter {
  padding-left: 0;
  padding-right: 0;
}

#card-page .direction-mini-filter {
  padding-top: 0.35rem;
}

.direction-mini-filter {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0 1.1rem 0.85rem;
}

.direction-mini-filter label {
  display: grid;
  gap: 0.25rem;
  font-size: 12px;
  color: var(--muted);
  min-width: min(16rem, 100%);
  flex: 1;
}

.direction-mini-filter select,
.direction-mini-filter input {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.direction-amount-range {
  display: grid;
  gap: 0.25rem;
  font-size: 12px;
  color: var(--muted);
  min-width: min(16rem, 100%);
  flex: 1;
}

.direction-amount-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.other-niche-chip {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}

.other-niche-chip:hover {
  border-color: var(--accent-2);
  background: #fff;
}

.other-niche-chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.other-niche-chip.is-all {
  font-weight: 600;
}

.dir-stat {
  display: grid;
  gap: 0.35rem;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.dir-stat:hover {
  border-color: var(--accent-2);
  background: #fff;
}

.dir-stat-label {
  font-weight: 600;
  font-size: 13px;
}

.dir-stat-bar {
  height: 4px;
  background: #e2e8f0;
  overflow: hidden;
}

.dir-stat-bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.dir-stat.dir-trauma .dir-stat-bar > i {
  background: #0b3a6e;
}

.dir-stat.dir-endo .dir-stat-bar > i {
  background: #7c3aed;
}

.dir-stat.dir-neuro .dir-stat-bar > i {
  background: #2563eb;
}

.dir-stat.dir-cardio .dir-stat-bar > i {
  background: #0ea5e9;
}

.dir-stat.dir-surgery .dir-stat-bar > i {
  background: #059669;
}

.dir-stat.dir-equipment .dir-stat-bar > i {
  background: #d97706;
}

.dir-stat.dir-power .dir-stat-bar > i {
  background: #be185d;
}

.dir-stat.dir-other .dir-stat-bar > i {
  background: #94a3b8;
}

.dir-stat.dir-other {
  border-style: dashed;
}

.dir-badge.dir-other {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

.dir-badge.dir-unclassified {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.dir-stat-meta {
  font-size: 12px;
  color: var(--muted);
}

.dir-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  background: #f1f5f9;
  color: var(--ink);
  white-space: nowrap;
}

.dir-badge.dir-trauma {
  background: #e8eef5;
  border-color: #9db4ce;
  color: #0b3a6e;
}

.dir-badge.dir-endo {
  background: #f3e8ff;
  border-color: #c4b5fd;
  color: #6d28d9;
}

.dir-badge.dir-neuro {
  background: #eaf1ff;
  border-color: #93b4f0;
  color: #1d4ed8;
}

.dir-badge.dir-cardio {
  background: #e8f7fc;
  border-color: #7cc8e0;
  color: #0369a1;
}

.dir-badge.dir-surgery {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

.dir-badge.dir-equipment {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #b45309;
}

.dir-badge.dir-power {
  background: #fdf2f8;
  border-color: #f9a8d4;
  color: #9d174d;
}

.dir-badge.dir-none {
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

td.tech-spec {
  max-width: 280px;
  white-space: normal;
  font-size: 12px;
  line-height: 1.35;
  color: #334155;
}

td.muted {
  color: var(--muted);
  font-style: italic;
}

.chart-card {
  border: 1px solid var(--line);
  background: #fff;
  padding: 1rem 1.1rem 0.9rem;
  min-width: 0;
  position: relative;
}

.chart-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.chart-card h3 {
  margin: 0 0 0.75rem;
  padding-left: 0.55rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.95rem;
}

.keywords-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
}

label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="search"],
input[type="text"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0.65rem 0.75rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

textarea {
  resize: vertical;
  min-height: 5rem;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #64748b;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.suggest {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  max-height: 220px;
  overflow: auto;
}

.suggest li {
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.suggest li:last-child {
  border-bottom: none;
}

.suggest li:hover,
.suggest li[aria-selected="true"] {
  background: var(--soft);
}

.suggest .meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.suggest-main {
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.suggest-main strong {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.suggest-name {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picked {
  margin: 0.15rem 0 0;
  font-size: 12px;
  color: var(--muted);
}

.actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: var(--r);
  border: 1px solid transparent;
  padding: 0.65rem 1.2rem;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

button.secondary {
  background: #fff;
  color: var(--accent);
  border-color: var(--accent);
}

button.secondary:hover {
  background: #eff6ff;
}

button.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
  padding: 0.55rem 0.9rem;
}

button.ghost:hover {
  background: var(--soft);
  color: var(--ink);
  border-color: var(--line-strong);
}

button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.status {
  min-height: 1.2rem;
  font-size: 13px;
  color: var(--muted);
}

.table-scroll {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--line);
  background: #fff;
}

.lots-table-scroll {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#lots-table {
  width: max-content;
  min-width: 100%;
}

#lots-table th,
#lots-table td {
  white-space: nowrap;
}

#lots-table td.tech-spec {
  white-space: normal;
  min-width: 220px;
  max-width: 320px;
}

#card-page .table-scroll {
  max-height: min(70vh, 720px);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

thead th {
  position: sticky;
  top: 0;
  background: #0b3a6e;
  color: #e2e8f0;
  border-bottom: 1px solid #082a52;
  text-align: left;
  padding: 0.7rem 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 11px;
  white-space: nowrap;
  z-index: 1;
}

tbody td {
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0.75rem;
  vertical-align: top;
}

tbody tr:nth-child(even) td {
  background: #f8fafc;
}

tbody tr:hover td {
  background: #eff6ff;
}

td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

td.empty {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem;
  background: #fff !important;
}

.chart {
  min-height: 320px;
}

.chart-wide {
  min-height: 300px;
}

.chart-empty {
  margin: 0;
  padding: 2.75rem 0.5rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  background: var(--soft);
}

.pie-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 1.25rem;
  align-items: center;
}

.donut-wrap {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.pie-svg {
  width: 100%;
  height: auto;
  display: block;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  padding: 2.5rem;
}

.donut-center-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.donut-center-value {
  margin-top: 0.2rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.donut-center-sub {
  margin-top: 0.15rem;
  font-size: 11px;
  color: var(--muted);
}

.pie-slice {
  cursor: pointer;
  stroke: #fff;
  stroke-width: 2;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform-origin: 150px 150px;
}

.pie-layout:hover .pie-slice {
  opacity: 0.45;
}

.pie-layout:hover .pie-slice.is-hot,
.pie-slice:hover,
.pie-slice.is-hot {
  opacity: 1 !important;
  filter: brightness(1.05);
}

.pie-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 300px;
  overflow: auto;
}

.pie-legend li {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 0.2rem 0.55rem;
  align-items: start;
  font-size: 12px;
  padding: 0.45rem 0.5rem;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  cursor: default;
}

.pie-legend li:hover,
.pie-legend li.is-hot {
  background: var(--soft);
  border-color: var(--line);
  border-left-color: var(--accent);
}

.swatch {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 1px;
}

.leg-name {
  grid-column: 2;
  font-weight: 600;
  word-break: break-word;
  line-height: 1.35;
}

.leg-meta {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}

.leg-meta strong {
  color: var(--accent);
  font-weight: 700;
}

.leg-link {
  display: inline-block;
  margin-left: 0.4rem;
  color: var(--accent-2);
  font-weight: 600;
  font-size: 11px;
}

.pie-slice.is-others,
.leg-item.is-others {
  cursor: pointer;
}

.leg-item.is-others:hover .leg-link {
  text-decoration: underline;
}

body.modal-open {
  overflow: hidden;
}

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: min(80vh, 720px);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
}

.modal-panel-wide {
  width: min(1120px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: #0b3a6e;
  color: #fff;
}

.modal-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.modal-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal .hint {
  margin: 0;
  padding: 0.7rem 1.1rem 0;
}

.modal-body {
  padding: 0.75rem 1.1rem 1.1rem;
  overflow: auto;
}

.card-back {
  display: inline-block;
  margin-bottom: 0.35rem;
  color: var(--accent-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.card-back:hover {
  text-decoration: underline;
}

.company-kicker {
  margin: 0 0 0.2rem;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.card-title {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-transform: none;
}

#card-page .section-head .hint,
#card-page .card-head-block .hint,
#company-page .section-head .hint,
#company-page .card-head-block .hint {
  text-align: left;
}

#home-page[hidden],
#card-page[hidden],
#company-page[hidden] {
  display: none !important;
}

.pie-slice.is-company,
.leg-item.is-company {
  cursor: pointer;
}

.leg-item.is-company:hover .leg-link {
  text-decoration: underline;
}

.opportunity-list {
  display: grid;
  gap: 0.45rem;
  max-height: 360px;
  overflow: auto;
}

.opportunity-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  background: var(--soft);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}

.opportunity-row:hover {
  background: #eff6ff;
  border-color: var(--accent-2);
}

.opportunity-row-title {
  font-weight: 600;
  font-size: 13px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.opportunity-row-meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.opportunity-row-amount {
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
}

.opportunity-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--line-strong);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.opportunity-tag.is-ip {
  border-color: #b45309;
  color: #b45309;
}

.opportunity-tag.is-client {
  border-color: #0b3a6e;
  color: #0b3a6e;
}

.company-opportunity-block .map-layout {
  margin-top: 0.35rem;
}

.niche-panels {
  display: grid;
  gap: 1rem;
  margin-top: 0.75rem;
}

.niche-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.niche-col-title {
  margin: 0 0 0.45rem;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.opp-accordion {
  border: 1px solid var(--line);
  background: #fff;
}

.opp-accordion + .opp-accordion {
  border-top: 0;
}

.opp-accordion-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  background: var(--soft);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.opp-accordion-toggle:hover {
  background: #eff6ff;
}

.opp-accordion.is-open > .opp-accordion-toggle {
  background: #e8eef6;
}

.opp-accordion-body {
  display: none;
  padding: 0.75rem;
  border-top: 1px solid var(--line);
  background: #fff;
}

.opp-accordion.is-open > .opp-accordion-body {
  display: block;
}

.opp-exact-dash {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0.85rem 1rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 70%);
}

.opp-exact-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.opp-exact-kpis-compact {
  margin: 0 0 0.35rem;
}

.opp-exact-kpi {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  background: #fff;
  border: 1px solid var(--line);
}

.opp-exact-kpi strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.opp-exact-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.opp-exact-chart {
  grid-column: 1 / -1;
}

.opp-exact-top {
  grid-column: 1 / -1;
}

.exact-competitors-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.exact-competitor-row .opp-accordion-toggle {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.65rem;
  align-items: center;
}

.exact-competitor-rank {
  grid-row: 1 / span 2;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--muted, #64748b);
  text-align: center;
}

.exact-competitor-row .opportunity-row-title {
  grid-column: 2;
}

.exact-competitor-row .opportunity-row-amount {
  grid-column: 3;
  grid-row: 1;
  text-align: right;
}

.exact-competitor-row .opportunity-row-meta {
  grid-column: 2 / span 2;
}

.exact-beat-tag {
  display: inline-block;
  margin-left: 0.15rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.82rem;
  font-weight: 600;
}

.opp-month-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  min-height: 72px;
  padding: 0.25rem 0 0;
}

.opp-month-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  height: 72px;
  justify-content: flex-end;
}

.opp-month-fill {
  width: 100%;
  max-width: 28px;
  background: #1d4ed8;
  border-radius: 2px 2px 0 0;
  min-height: 3px;
}

.opp-month-bar span {
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@media (max-width: 900px) {
  .opp-exact-dash {
    grid-template-columns: 1fr;
  }
}

.same-products-list {
  display: grid;
  gap: 0;
}

.same-product-card + .same-product-card {
  margin-top: 0;
}

.same-sellers-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.same-seller {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.same-seller-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
}

.same-label {
  font-weight: 650;
  color: #475569;
}

.same-lots-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.same-lot {
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12.5px;
}

.same-lot-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  font-variant-numeric: tabular-nums;
}

.same-lot-title {
  margin-top: 0.2rem;
  color: #0f172a;
  line-height: 1.35;
}

.opp-takeaway {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.65rem;
  background: #f8fafc;
  border-left: 3px solid var(--accent);
  font-size: 13px;
  line-height: 1.4;
}

.opp-mini-list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.opp-mini-list li {
  font-size: 12.5px;
  color: #334155;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.opp-mini-list li:last-child {
  border-bottom: 0;
}

.opp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

@media (max-width: 900px) {
  .niche-split {
    grid-template-columns: 1fr;
  }
}

.others-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.others-table th {
  position: sticky;
  top: 0;
  background: var(--soft);
  border-bottom: 1px solid var(--line-strong);
  text-align: left;
  padding: 0.55rem 0.6rem;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.others-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0.6rem;
  vertical-align: top;
}

.others-table tr:hover td {
  background: #eff6ff;
}

.tender-link {
  color: #0b3a6e;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.tender-link:hover {
  text-decoration: underline;
}

.bars-svg-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 0.25rem 0;
}

.bars-svg {
  width: 100%;
  min-width: 560px;
  height: 280px;
  display: block;
}

.bar-grid {
  stroke: #e2e8f0;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.bar-grid-label {
  fill: #94a3b8;
  font-size: 10px;
  font-family: var(--font);
}

.bar-hit {
  fill: transparent;
  cursor: pointer;
}

.bar-rect {
  fill: #0b3a6e;
  transition: fill 0.15s ease;
}

.bar-item.is-hot .bar-rect,
.bar-item:hover .bar-rect {
  fill: #2563eb;
}

.bar-amount {
  fill: #64748b;
  font-size: 10px;
  font-family: var(--font);
  font-weight: 600;
}

.bar-item.is-hot .bar-amount,
.bar-item:hover .bar-amount {
  fill: #0f172a;
}

.bar-x {
  fill: #334155;
  font-size: 11px;
  font-family: var(--font);
  font-weight: 500;
}

.bar-x-sub {
  fill: #94a3b8;
  font-size: 10px;
  font-weight: 400;
}

.relations-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.2fr);
  gap: 1rem;
  align-items: start;
}

.pairs-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 520px;
  overflow: auto;
  padding-right: 0.15rem;
}

.pair-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.55rem;
  align-items: start;
  padding: 0.55rem 0.5rem;
  border: 1px solid var(--line);
  background: #fff;
  cursor: default;
}

.pair-row:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.pair-rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: #0b3a6e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.pair-names {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.45rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
  font-size: 12px;
}

.pair-customer {
  font-weight: 600;
  color: var(--ink);
}

.pair-arrow {
  color: var(--muted);
}

.pair-winner {
  font-weight: 600;
  color: var(--accent-2);
}

.pair-track {
  height: 6px;
  background: #e2e8f0;
  overflow: hidden;
}

.pair-fill {
  height: 100%;
  background: linear-gradient(90deg, #0b3a6e 0%, #2563eb 100%);
}

.pair-meta {
  margin-top: 0.3rem;
  font-size: 11px;
  color: var(--muted);
}

.matrix-wrap {
  min-height: 220px;
}

.matrix-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  max-height: 480px;
}

.matrix-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: 11px;
}

.matrix-table th,
.matrix-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0.5rem;
}

.matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0b3a6e;
  color: #e2e8f0;
  font-weight: 600;
  text-align: center;
  max-width: 110px;
  white-space: normal;
  line-height: 1.25;
  vertical-align: bottom;
}

.matrix-corner {
  text-align: left !important;
  min-width: 160px;
  left: 0;
  z-index: 3 !important;
}

.matrix-row-head {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  max-width: 200px;
  white-space: normal;
  line-height: 1.3;
}

.matrix-cell {
  text-align: center;
  cursor: default;
  background: rgba(11, 58, 110, var(--cell-a, 0.04));
  min-width: 78px;
  font-variant-numeric: tabular-nums;
}

.matrix-cell:hover {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.matrix-cell-val {
  color: var(--ink);
  font-weight: 600;
  font-size: 11px;
}

.matrix-legend {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.65rem;
  font-size: 11px;
  color: var(--muted);
}

.matrix-scale {
  flex: 1;
  height: 8px;
  max-width: 180px;
  background: linear-gradient(90deg, rgba(11, 58, 110, 0.08), #0b3a6e);
  border: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .relations-grid {
    grid-template-columns: 1fr;
  }

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

.tip {
  position: fixed;
  z-index: 1000;
  max-width: min(420px, calc(100vw - 24px));
  pointer-events: none;
  background: #0f172a;
  color: #fff;
  border: 1px solid #020617;
  padding: 0.7rem 0.8rem;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  border-radius: var(--r);
}

.tip .tip-title {
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-size: 13px;
}

.tip .tip-row {
  color: #cbd5e1;
}

.map-block {
  margin-top: 0.25rem;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.7fr);
  gap: 1.25rem;
  align-items: start;
}

.map-main {
  min-width: 0;
}

.kz-map {
  width: 100%;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  line-height: 0;
}

.kz-map svg {
  width: 100%;
  height: auto;
  display: block;
}

.kz-map .kz-regions path {
  cursor: pointer;
  fill: #c5d4e8;
  transition: fill 0.18s ease, stroke 0.15s ease, stroke-width 0.15s ease, filter 0.15s ease;
}

.kz-map .kz-regions path:hover {
  stroke: #0b3a6e;
  stroke-width: 1.6;
  filter: brightness(0.93);
}

.kz-map .kz-regions path.is-selected {
  stroke: #1256a0;
  stroke-width: 2.2;
  filter: brightness(0.88);
}

/* Cities of republican significance — small but easy to hit */
.kz-map .kz-regions path#KZ71,
.kz-map .kz-regions path#KZ75,
.kz-map .kz-regions path#KZ79 {
  stroke: #0b3a6e;
  stroke-width: 1.4;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 12px;
}

.map-legend-bar {
  width: 120px;
  height: 8px;
  border-radius: 1px;
  background: linear-gradient(90deg, #c5d4e8 0%, #2563eb 55%, #0b3a6e 100%);
  border: 1px solid var(--line);
}

.map-side {
  padding: 1rem 1.1rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--r);
  min-height: 140px;
}

.region-dominant {
  margin: 0 0 0.75rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.region-top {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.region-top li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 0.75rem;
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}

.region-top li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.region-top .name {
  color: var(--ink);
  font-weight: 500;
  grid-column: 1 / -1;
}

.region-top .share {
  color: var(--accent);
  font-weight: 600;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.products-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 520px;
  overflow: auto;
  padding-right: 0.15rem;
}

.show-more-btn {
  margin-top: 0.65rem;
  width: 100%;
  border: 1px dashed var(--line-strong);
  background: var(--soft);
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}

.show-more-btn:hover {
  border-color: var(--accent-2);
  background: #fff;
}

.product-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.55rem;
  align-items: start;
  padding: 0.5rem 0.45rem;
  border: 1px solid var(--line);
  background: #fff;
}

.product-row:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.product-body {
  min-width: 0;
  display: grid;
  gap: 0.28rem;
}

.product-name {
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.35;
  font-weight: 500;
}

.product-meta {
  font-size: 11px;
  color: var(--muted);
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.35fr);
  gap: 1rem;
  align-items: start;
}

.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 640px;
  overflow: auto;
  padding-right: 0.15rem;
}

.catalog-supplier {
  display: grid;
  gap: 0.2rem;
  text-align: left;
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.catalog-supplier:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.catalog-supplier.is-active {
  border-color: var(--accent);
  background: #eff6ff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.catalog-supplier-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.catalog-supplier-meta {
  font-size: 11.5px;
  color: var(--muted);
}

.catalog-detail {
  min-height: 200px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.85rem 1rem;
}

.catalog-placeholder {
  margin: 2rem 0;
  text-align: center;
}

.catalog-detail-head {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.catalog-detail-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}

.catalog-products {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 560px;
  overflow: auto;
}

.catalog-product {
  border: 1px solid var(--line);
  background: #fafbfc;
}

.catalog-product-toggle {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.7rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.catalog-product-toggle:hover {
  background: #f0f7ff;
}

.catalog-product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.catalog-product-prices {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.catalog-product-meta {
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--muted);
}

.catalog-items {
  display: none;
  border-top: 1px solid var(--line);
  padding: 0.45rem 0.7rem 0.65rem;
  background: #fff;
}

.catalog-product.is-open .catalog-items {
  display: block;
}

.catalog-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #eef2f7;
  font-size: 12px;
}

.catalog-item:last-child {
  border-bottom: none;
}

.catalog-item-main {
  color: var(--ink);
  line-height: 1.35;
}

.catalog-item-sub {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.catalog-item-price {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

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

  .catalog-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .charts-row,
  .keywords-grid {
    grid-template-columns: 1fr;
  }

  .pie-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 6px 1fr;
  }

  .topbar-status {
    grid-column: 2;
    text-align: left;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 1rem, 1520px);
    padding-top: 0.85rem;
  }

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

  .direction-stats {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-head .hint {
    text-align: left;
  }

  .actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-row button,
  .actions-row .ghost {
    width: 100%;
  }
}

.qa-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.qa-stat {
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
}

.qa-stat span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.qa-stat strong {
  font-size: 1.25rem;
}

.qa-stat-ok {
  border-color: #86efac;
  background: #f0fdf4;
}

.qa-stat-mute {
  background: #f8fafc;
}

.qa-stat-warn {
  border-color: #fbbf24;
  background: #fffbeb;
}

.qa-filters {
  margin-bottom: 0.75rem;
}

.qa-tender {
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.qa-tender-head {
  margin-bottom: 0.5rem;
}

.qa-tender-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.65rem;
  color: #0b3a6e;
  text-decoration: none;
  font-weight: 600;
}

.qa-tender-link:hover .qa-tender-title,
.qa-tender-link:hover .qa-tender-open {
  text-decoration: underline;
}

.qa-tender-id {
  font-variant-numeric: tabular-nums;
}

.qa-tender-title {
  font-weight: 600;
}

.qa-tender-open {
  font-size: 12px;
  font-weight: 600;
  color: #1256a0;
  white-space: nowrap;
}

.qa-tender h3 {
  margin: 0.6rem 0 0.3rem;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.qa-lots {
  margin: 0;
  padding-left: 1.1rem;
}

.qa-lots-other {
  color: var(--muted);
}

.qa-lots-unclassified {
  color: #92400e;
}

.qa-lot-link {
  color: #0b3a6e;
  font-weight: 600;
  text-decoration: none;
}

.qa-lot-link:hover {
  text-decoration: underline;
}

.qa-lot-desc {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 12.5px;
}

.spec-lot {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.spec-lot-differ {
  background: #fff7ed;
  border: 1px solid #fdba74;
  padding: 0.75rem;
}

.spec-compare {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.35rem 0;
}

.spec-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
}

.spec-badge-endo,
.spec-badge-trauma,
.spec-badge-neuro,
.spec-badge-cardio {
  background: #ecfdf5;
  border-color: #86efac;
}

.spec-badge-other {
  background: #f8fafc;
}

.spec-badge-unclassified {
  background: #fffbeb;
  border-color: #fbbf24;
  color: #92400e;
}

.spec-text {
  margin: 0.35rem 0;
}

.spec-text pre {
  white-space: pre-wrap;
  font: inherit;
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 0.6rem 0.75rem;
  max-height: 240px;
  overflow: auto;
}

.spec-group {
  margin-top: 1rem;
}

.spec-group-title {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.spec-group-sample {
  border-top: 3px solid #0b3a6e;
}

.spec-tender-fold > summary {
  cursor: pointer;
  list-style: none;
}

.spec-tender-fold > summary::-webkit-details-marker {
  display: none;
}
