/* ===== СТРАНИЦА ИП: контент-грид (карточка + сайдбар) ===== */

.content {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(0, 0.7fr);
  gap: 20px;
  padding: 18px clamp(16px, 3vw, 44px) 20px;
}

.content.content-ip-index {
  display: block !important;
  grid-template-columns: none !important;
}

.content.content-ip-index > .main {
  display: block;
  background: transparent;
  width: 100%;
  max-width: none;
}

.content.content-ip-index .home-grid,
.content.content-ip-index .section,
.content.content-ip-index .okved-grid {
  width: 100%;
  max-width: none;
}

.content.content-ip-index .section#org {
  background: #ffffff;
}

.content.content-ip-index .section#org::before {
  display: none;
}

.content.content-ip-index .section#org-okved {
  background: #ffffff;
}

.content.content-ip-index .section#org-okved::before {
  display: none;
}

.catalog-page-title {
  margin: 0 0 4px;
  max-width: 980px;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: 0;
  color: #111827;
}

.catalog-page-title-detail {
  display: block;
  margin-top: 6px;
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.35;
  color: #64748b;
}

.brand-search-disabled,
.adv-search-disabled {
  opacity: 0.72;
}

.brand-search-disabled input,
.brand-search-disabled button,
.adv-search-disabled input,
.adv-search-disabled select,
.adv-search-disabled button {
  cursor: not-allowed;
}

.ip-search-results {
  background: #ffffff;
}

.ip-search-results::before {
  display: none;
}

.search-results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.search-results-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 9px;
}

.search-results-title-row h2 {
  margin: 0;
}

.search-results-context {
  color: #4b5563;
  font-size: clamp(12px, 0.35vw + 11px, 15px);
  font-weight: 500;
  line-height: 1.35;
  text-transform: none;
  overflow-wrap: anywhere;
}

.search-results-reset {
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid rgba(199, 210, 254, 0.9);
  background: rgba(238, 242, 255, 0.9);
  color: var(--tag-text);
  padding: 6px 12px;
  text-decoration: none;
  font-size: clamp(12px, 0.3vw + 11px, 14px);
}

.search-results-reset:hover {
  background: rgba(224, 231, 255, 0.98);
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-result-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.search-result-main {
  min-width: 0;
}

.search-result-title {
  display: inline-block;
  color: #111827;
  font-size: clamp(15px, 0.4vw + 14px, 18px);
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}

.search-result-title:hover {
  color: var(--link-hover);
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 7px;
  color: #6b7280;
  font-size: clamp(12px, 0.3vw + 11px, 14px);
}

.search-result-activity {
  margin-top: 8px;
  color: #4b5563;
  font-size: clamp(12px, 0.3vw + 11px, 14px);
  line-height: 1.45;
}

.search-result-activity strong {
  color: #111827;
  margin-right: 6px;
}

.search-result-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  flex-shrink: 0;
  text-align: right;
}

.search-result-status,
.search-result-msp {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: clamp(11px, 0.3vw + 10px, 13px);
  white-space: nowrap;
}

.search-result-status.is-active {
  background: rgba(22, 163, 74, 0.07);
  color: #166534;
  border: 1px solid rgba(134, 239, 172, 0.95);
}

.search-result-status.is-terminated {
  background: rgba(185, 28, 28, 0.07);
  color: #991b1b;
  border: 1px solid rgba(252, 165, 165, 0.95);
}

.search-result-msp {
  background: rgba(238, 242, 255, 0.95);
  color: var(--tag-text);
  border: 1px solid rgba(199, 210, 254, 0.9);
}

.search-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.search-page {
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(209, 213, 219, 0.9);
  background: #ffffff;
  color: #374151;
  text-decoration: none;
  font-size: 13px;
}

.search-page.is-current {
  background: var(--tag-text);
  border-color: var(--tag-text);
  color: #eff6ff;
}

.sections-mobile-wrapper {
  display: none;
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.sections-mobile-toggle {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  color: var(--tag-text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.sections-mobile-toggle:hover,
.sections-mobile-toggle:focus-visible {
  background: rgba(224, 231, 255, 0.98);
}

.sections-mobile-wrapper.is-open .sections-mobile-toggle {
  background: rgba(224, 231, 255, 0.98);
  color: var(--tag-text);
}

.sections-mobile-toggle svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
  stroke: none;
}

body.sections-mobile-open {
  overflow: hidden;
}

.sections-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 89;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.sections-mobile-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  width: 80vw;
  max-width: 420px;
  padding: 14px 12px calc(18px + env(safe-area-inset-bottom));
  background: #ffffff;
  border-radius: 0 18px 18px 0;
  box-shadow: none;
  transform: translateX(-100%);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: none;
  box-sizing: border-box;
}

.sections-mobile-wrapper.is-open .sections-mobile-overlay {
  opacity: 1;
  pointer-events: auto;
}

.sections-mobile-wrapper.is-open .sections-mobile-panel {
  transform: translateX(0);
  box-shadow: 18px 0 32px rgba(15, 23, 42, 0.16);
  pointer-events: auto;
}

.sections-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 2px 13px;
  color: #111827;
  font-size: 18px;
  font-weight: 600;
}

.sections-mobile-close {
  appearance: none;
  border: 1px solid rgba(199, 210, 254, 0.95);
  background: rgba(238, 242, 255, 0.98);
  color: var(--tag-text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  font-size: 23px;
  line-height: 1;
  padding: 0 0 2px;
}

.sections-mobile-close:hover,
.sections-mobile-close:focus-visible {
  background: rgba(224, 231, 255, 0.98);
}

.sections-mobile-panel .sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 0;
}

.sections-mobile-panel .sidebar-menu a {
  padding: 8px 10px;
  font-size: 15px;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: transparent;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 18px;
  align-self: flex-start;
}

.card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
  padding: clamp(18px, 1.2vw + 16px, 24px) clamp(18px, 1.2vw + 17px, 26px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: none;
  opacity: 0;
  pointer-events: none;
}

.card-inner {
  position: relative;
  z-index: 1;
}

/* ===== ШАПКА КАРТОЧКИ ===== */

.header-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: flex-start;
}

.summary-main {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.summary-layout {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.summary-left {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

.summary-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  flex: 0 0 auto;
  text-align: right;
}

.ip-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: clamp(11px, 0.3vw + 10px, 15px);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.ip-label-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  font-size: clamp(11px, 0.3vw + 10px, 14px);
  font-weight: 500;
  color: #374151;
  border: 1px solid rgba(209, 213, 219, 0.9);
}

.name-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.name-main {
  margin: 0;
  font-size: clamp(24px, 2.2vw + 16px, 40px);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #0f172a;
  white-space: normal;
  line-height: 1.1;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: clamp(12px, 0.3vw + 11px, 15px);
  font-weight: 500;
  background: rgba(22, 163, 74, 0.07);
  color: #166534;
  border: 1px solid rgba(134, 239, 172, 0.95);
  margin-top: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
}

.status-badge.is-liquidated {
  background: rgba(185, 28, 28, 0.07);
  color: #991b1b;
  border: 1px solid rgba(252, 165, 165, 0.95);
}

.status-badge.is-liquidated .status-dot {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
}

.tags-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 5px;
  width: max-content;
  align-items: flex-end;
  font-size: clamp(11px, 0.3vw + 10px, 13px);
  max-width: 100%;
}

.tag {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid rgba(199, 210, 254, 0.9);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  justify-content: flex-end;
}

.tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.6);
}

/* ===== СЕТКА СЕКЦИЙ ИП ===== */

.grid {
  margin-top: 15px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

#general {
  grid-column: 1;
  grid-row: 1;
}

#classifiers {
  grid-column: 1;
  grid-row: 2;
}

#activity {
  grid-column: 1;
  grid-row: 3;
}

#taxmsp {
  grid-column: 1;
  grid-row: 4;
}

#procurement {
  grid-column: 1;
  grid-row: 5;
}

.section {
  height: 100%;
}

#procurement.section,
#taxmsp.section {
  height: auto;
}

/* ===== ПОЛЯ В СЕКЦИЯХ ИП ===== */

.fields {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.fields.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.field .label {
  color: #6b7280;
}

.field .value {
  color: #111827;
}

.field .value strong {
  font-weight: 600;
  color: #111827;
}

.value-activities .activity-line {
  margin-bottom: 6px;
}

.value-activities .activity-line:last-child {
  margin-bottom: 0;
}

#general .field,
#classifiers .field,
#taxmsp .field,
#procurement .field {
  line-height: 1.4;
}

#general .field.field-line,
#classifiers .field.field-line,
#taxmsp .field.field-line,
#procurement .field.field-line {
  flex-direction: row;
  align-items: flex-start;
  gap: 40px;
}

#general .field.field-line .label,
#classifiers .field.field-line .label,
#taxmsp .field.field-line .label,
#procurement .field.field-line .label {
  width: 220px;
  flex-shrink: 0;
  white-space: nowrap;
}

#general .field.field-line .value,
#classifiers .field.field-line .value,
#taxmsp .field.field-line .value,
#procurement .field.field-line .value {
  flex: 1;
}

/* ===== РИСК-ПРОФИЛЬ ===== */

.risk-score {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 10px;
}

.risk-score-main {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
}

.risk-score-label {
  color: #111827;
}

.risk-score-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(209, 213, 219, 0.8);
  overflow: hidden;
  position: relative;
}

.risk-score-bar-fill {
  position: absolute;
  inset: 0;
  width: 28%;
  background: linear-gradient(90deg, #22c55e, #eab308);
}

.risk-check {
  width: 14px;
  display: inline-flex;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  color: #16a34a;
  margin-top: 1px;
  flex-shrink: 0;
}

.risk-box-text-danger {
  color: #4b5563;
}

.risk-alert {
  width: 14px;
  display: inline-flex;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  color: var(--danger);
  margin-top: 1px;
  flex-shrink: 0;
}

#riskprofile-main .risk-boxes {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#riskprofile-main .risk-box {
  border-radius: 0;
  border: none;
  background: transparent;
  padding: 2px 0;
}

#riskprofile-main .risk-box-title {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  margin-bottom: 1px;
}

#riskprofile-main .risk-box-text {
  font-size: 14px;
  color: #4b5563;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

#riskprofile-main .risk-note {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: #4b5563;
}

/* ===== РАСКРЫВАЮЩИЕСЯ БЛОКИ ===== */

.arb-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--tag-text);
  font: inherit;
  cursor: pointer;
  border-bottom: 1px solid var(--tag-text);
  padding-bottom: 1px;
}

.arb-toggle-text {
  text-decoration: inherit;
}

.arb-arrow {
  font-size: 10px;
  display: inline-block;
  position: relative;
  top: 1.5px;
  line-height: 1;
  text-decoration: inherit;
}

.arb-details {
  margin-left: 20px;
  margin-top: 6px;
  font-size: 13px;
  color: #4b5563;
}

.arb-details ol {
  margin: 6px 0 0 18px;
  padding: 0;
}

.arb-list > li {
  margin-bottom: 10px;
}

.arb-list > li:last-child {
  margin-bottom: 0;
}

.arb-case {
  margin-bottom: 10px;
}

.arb-case-title {
  font-weight: 600;
}

.arb-label {
  font-weight: 600;
}

.arb-details--noindent {
  margin-left: 0;
}

.arb-accent {
  color: var(--tag-text);
}

.aff-company {
  color: var(--tag-text);
}

/* ===== ИСТОРИЯ ===== */

#history .fields {
  gap: 8px;
}

#history .field.field-line {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

#history .field.field-line .label {
  font-weight: 500;
  color: #6b7280;
}

#history .field.field-line .value {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.history-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #4ade80;
  margin-top: 3px;
  flex-shrink: 0;
}

/* ===== ВТОРИЧНЫЙ СТЕК СЕКЦИЙ И САЙДБАР ===== */

.section-stack {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.sidebar-small-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 11px 13px 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
  font-size: clamp(13px, 0.3vw + 12px, 15px);
}

.sidebar-small-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: none;
  opacity: 0;
  pointer-events: none;
}

.sidebar-small-card-inner {
  position: relative;
  z-index: 1;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 1.5px;
}

.sidebar-menu a {
  text-decoration: none;
  color: #374151;
  padding: 6px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s ease, color 0.15s ease;
  font-size: inherit;
}

.sidebar-menu a:hover {
  background: rgba(239, 246, 255, 0.95);
  color: #1d4ed8;
}

.sidebar-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--tag-text);
}

.sidebar-menu-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke-width: 1.7;
  stroke: currentColor;
  fill: none;
  overflow: visible;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== РАЗНОЕ ===== */

.proc-subline {
  margin-top: 4px;
}

.refnum {
  color: #3730a3;
  font-weight: 600;
}

/* ===== Список ОКВЭД на /ip (раскрывающиеся пункты A–U) ===== */

.okved-grid .okved-row {
  align-items: center;
  cursor: pointer;
}

.okved-toggle {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--tag-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  line-height: 16px;
  font-weight: 600;
  font-size: 16px;
}

.okved-toggle:hover,
.okved-toggle[aria-expanded="true"] {
  color: var(--tag-text);
}

.okved-item {
  display: block;
}

.okved-details {
  margin-left: 54px;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: #4b5563;
}

.okved-detail-line {
  margin-top: 4px;
}

.okved-search-link {
  display: block;
  color: #4b5563;
  text-decoration: none;
}

.okved-search-link:hover {
  color: var(--link-hover);
}

.okved-detail-line:first-child {
  margin-top: 0;
}

.okved-subcode {
  display: inline-block;
  width: 26px;
  font-weight: 600;
  color: #111827;
}

/* ===== АДАПТИВ ИП ===== */

@media (max-width: 1024px) {
  .content {
    grid-template-columns: minmax(0, 1fr);
    padding: 6px 12px 18px;
    gap: 6px;
  }

  .card {
    padding: 18px;
  }

  .sidebar {
    display: none;
    position: static;
    top: auto;
    margin-top: 4px;
  }

  .sections-mobile-wrapper {
    display: block;
  }
}

@media (max-width: 880px) {
  .summary-layout {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-right {
    align-items: flex-start;
    text-align: left;
    margin-left: 0;
  }

  .tags-row {
    align-items: flex-start;
  }

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

  #general .field.field-line,
  #classifiers .field.field-line,
  #taxmsp .field.field-line,
  #procurement .field.field-line {
    flex-direction: column;
    gap: 6px;
  }

  #general .field.field-line .label,
  #classifiers .field.field-line .label,
  #taxmsp .field.field-line .label,
  #procurement .field.field-line .label {
    width: 100%;
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .search-results-head,
  .search-result-card {
    flex-direction: column;
  }

  .search-result-side {
    align-items: flex-start;
    text-align: left;
  }

  .content {
    padding: 6px 8px 8px;
    gap: 6px;
  }

  .card {
    padding: 14px 12px;
  }

  .brand-search {
    margin-top: 6px;
  }
}

@media (max-width: 430px) {
  .sidebar-small-card {
    padding-inline: 10px;
  }

  .sidebar-menu a span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
