/* ===== Variables (gorodrabot-style palette) ===== */
:root {
    --blue:        #2b7fff;
    --blue-dark:   #1a6aff;
    --azure:       #1aa3f0;
    --blue-light:  #eef6ff;
    --navy:        #101828;
    --slate:       #1f2937;
    --gray:        #6a7282;
    --border:      #e6eaf0;
    --bg:          #f5f7fb;
    --white:       #ffffff;
    --green:       #16a34a;
    --red:         #e5484d;
    --orange:      #ea580c;
    --radius:      12px;
    --radius-lg:   20px;
    --shadow:      0 1px 2px rgba(16,24,40,.05);
    --shadow-md:   0 4px 18px rgba(16,24,40,.07);
    --shadow-lg:   0 12px 34px rgba(16,24,40,.10);
    --transition:  .16s ease;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px; line-height: 1.6; color: var(--slate); background: var(--bg);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
input, textarea, select { font: inherit; }

/* ===== Container ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== Header (gorodrabot-style: white top + azure nav bar) ===== */
.site-header { position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.header-top { background: var(--white); border-bottom: 1px solid var(--border); }
.header-top-inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--navy); white-space: nowrap; }
.logo:hover { text-decoration: none; color: var(--blue); }
.logo svg { flex-shrink: 0; }

.header-search { flex: 1; max-width: 760px; }
.header-search form { display: flex; }
.search-input-wrap { position: relative; flex: 1; }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--gray); pointer-events: none; }
#site-search {
    width: 100%; height: 46px; padding: 0 16px 0 44px;
    border: 1.5px solid var(--border); border-right: none; border-radius: 10px 0 0 10px;
    background: var(--white); font-size: .98rem; transition: var(--transition);
}
#site-search:focus { outline: none; border-color: var(--blue); box-shadow: none; }
.search-submit { border-radius: 0 10px 10px 0; height: 46px; padding: 0 22px; box-shadow: none; }
.search-submit:hover { box-shadow: none; }

.header-nav { background: var(--azure); }
.main-nav { display: flex; gap: 2px; }
.main-nav a { padding: 13px 16px; color: #fff; font-size: .94rem; font-weight: 500; transition: background var(--transition); }
.main-nav a:hover { background: rgba(255,255,255,.16); color: #fff; text-decoration: none; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; margin-left: auto; }
.nav-toggle span { width: 24px; height: 2px; background: var(--slate); border-radius: 2px; transition: var(--transition); }

.search-suggestions {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); z-index: 200; display: none;
}
.search-suggestions.visible { display: block; }
.suggestion-item { padding: 10px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.suggestion-item:hover { background: var(--blue-light); }
.suggestion-inn { font-size: .8rem; color: var(--gray); }

@media (max-width: 860px) {
    .header-top-inner { height: auto; flex-wrap: wrap; gap: 12px; padding: 10px 0; }
    .header-search { order: 3; flex-basis: 100%; max-width: none; }
    .nav-toggle { display: flex; }
    .header-nav { display: none; }
    body.nav-open .header-nav { display: block; }
    .main-nav { flex-direction: column; gap: 0; }
    .main-nav a { padding: 12px 4px; border-bottom: 1px solid rgba(255,255,255,.15); }
}

/* ===== Main ===== */
.site-main { padding: 28px 0 60px; }

/* ===== Breadcrumbs ===== */
.breadcrumbs { margin-bottom: 20px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; font-size: .85rem; }
.breadcrumbs li { display: flex; align-items: center; gap: 4px; color: var(--gray); }
.breadcrumbs li + li::before { content: '/'; color: var(--border); }
.breadcrumbs a { color: var(--gray); }
.breadcrumbs a:hover { color: var(--blue); }

/* ===== Page header ===== */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; color: var(--navy); }
.page-hero { text-align: center; padding: 48px 24px; margin-bottom: 32px;
    background: linear-gradient(180deg, var(--blue-light) 0%, var(--white) 100%);
    border: 1px solid var(--border); border-radius: var(--radius-lg); }
.page-hero h1 { font-size: 2.3rem; font-weight: 800; color: var(--navy); margin-bottom: 12px; letter-spacing: -.02em; }
.page-hero p { color: var(--gray); font-size: 1.05rem; max-width: 640px; margin: 0 auto; }
.subtitle { color: var(--gray); margin-top: 6px; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 20px; border-radius: 10px; border: none; cursor: pointer;
    font-size: .9rem; font-weight: 600; transition: var(--transition); text-decoration: none; line-height: 1.4;
}
.btn-primary { background: var(--blue); color: var(--white); box-shadow: 0 2px 8px rgba(43,127,255,.25); }
.btn-primary:hover { background: var(--blue-dark); color: var(--white); text-decoration: none; box-shadow: 0 4px 14px rgba(43,127,255,.32); }
.btn-outline { background: transparent; color: var(--slate); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; background: var(--blue-light); }
.btn-sm { padding: 6px 14px; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: 12px 26px; font-size: 1rem; border-radius: 12px; }
.btn-danger { background: #fef2f2; color: var(--red); border: 1.5px solid #fecaca; }
.btn-danger:hover { background: var(--red); color: var(--white); text-decoration: none; }

/* ===== Cards ===== */
.card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card-title { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* ===== OKVED grid ===== */
.okved-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 40px; }
.okved-card {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; display: flex; align-items: center; gap: 12px; transition: var(--transition);
}
.okved-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); text-decoration: none; transform: translateY(-1px); }
.okved-code { font-size: 1.1rem; font-weight: 800; color: var(--blue); min-width: 28px; }
.okved-name { flex: 1; font-size: .9rem; color: var(--slate); line-height: 1.4; }
.arrow { color: var(--gray); flex-shrink: 0; }

/* ===== List items ===== */
.list-container { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.list-header { display: grid; grid-template-columns: 80px 1fr; gap: 12px; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--border); font-size: .82rem; color: var(--gray); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.list-item { display: grid; grid-template-columns: 80px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); transition: var(--transition); }
.list-item:last-child { border-bottom: none; }
a.list-item:hover { background: var(--blue-light); text-decoration: none; }
.list-item--group { background: var(--bg); }
.list-item--leaf { padding-left: 32px; }
.code-badge { display: inline-block; background: var(--blue-light); color: var(--blue); border-radius: 999px; padding: 3px 11px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.code-badge--sub { background: #eaf8ef; color: var(--green); }
.item-name { color: var(--slate); font-size: .92rem; }
.section-badge { display: inline-block; background: var(--blue); color: var(--white); border-radius: 12px; padding: 4px 16px; font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }

/* ===== Cities ===== */
.cities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.city-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; transition: var(--transition); }
.city-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); text-decoration: none; }
.city-name { display: block; font-weight: 600; color: var(--slate); }
.city-region { display: block; font-size: .8rem; color: var(--gray); margin-top: 2px; }

/* ===== Companies list ===== */
.companies-list { display: flex; flex-direction: column; gap: 12px; }
.company-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; transition: var(--transition); }
.company-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); }
.company-card-header { display: flex; align-items: flex-start; gap: 16px; }
.company-rank { font-size: 1.4rem; font-weight: 800; color: var(--border); min-width: 36px; padding-top: 2px; }
.company-info { flex: 1; }
.company-name { font-size: 1.05rem; font-weight: 700; color: var(--navy); display: block; margin-bottom: 4px; }
.company-name:hover { color: var(--blue); }
.company-inn, .company-address { font-size: .82rem; color: var(--gray); display: block; margin-top: 2px; }
.company-revenue { text-align: right; }
.revenue-label { display: block; font-size: .75rem; color: var(--gray); }
.revenue-value { font-weight: 700; color: var(--green); }
.company-card-footer { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ===== Company page ===== */
.company-page { }
.company-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 28px; background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border); margin-bottom: 24px; }
.company-hero-left { display: flex; align-items: flex-start; gap: 20px; }
.company-avatar { position: relative; width: 64px; height: 64px; background: linear-gradient(135deg, var(--blue), #7c3aed); color: white; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 800; flex-shrink: 0; overflow: hidden; }
.company-avatar .avatar-initials { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.company-avatar .avatar-favico { position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 8px; background: #fff; padding: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.15); object-fit: contain; }
.company-title { font-size: 1.6rem; font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.company-meta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-chip { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; font-size: .82rem; color: var(--gray); }
.status-badge { padding: 4px 12px; border-radius: 20px; font-size: .82rem; font-weight: 600; }
.status-active { background: #f0fdf4; color: var(--green); }
.status-inactive { background: #fef2f2; color: var(--red); }
.company-hero-right { display: flex; gap: 8px; flex-shrink: 0; }
.company-body { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.company-main { }
.company-sidebar { }

.info-grid { display: grid; gap: 0; }
.info-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.info-row:last-child { border-bottom: none; }
.info-label { font-size: .85rem; color: var(--gray); }
.info-value { font-size: .92rem; color: var(--slate); }
.info-value a { color: var(--blue); }

.finance-summary { display: flex; gap: 20px; margin-bottom: 20px; }
.finance-kpi { }
.kpi-label { display: block; font-size: .8rem; color: var(--gray); }
.kpi-value { font-size: 1.4rem; font-weight: 800; }
.kpi-positive { color: var(--green); }
.kpi-negative { color: var(--red); }
.charts-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-title { font-size: .85rem; font-weight: 600; color: var(--gray); margin-bottom: 8px; }

.persons-list { display: flex; flex-direction: column; gap: 12px; }
.person-row { display: flex; align-items: center; gap: 12px; }
.person-avatar { width: 40px; height: 40px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.person-name { font-weight: 600; color: var(--slate); display: block; }
.person-role { font-size: .8rem; color: var(--gray); }
.person-tenure { display: block; font-size: .78rem; color: var(--gray); margin-top: 2px; }

/* Используемые названия компании */
.used-names { display: flex; flex-wrap: wrap; gap: 6px; }
.used-name-chip { display: inline-block; padding: 3px 9px; border-radius: 999px; background: #eef2ff;
    color: #4338ca; font-size: .82rem; font-weight: 500; line-height: 1.4; }

/* Компании по отраслям — сетка карточек */
.industry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.industry-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; transition: box-shadow .2s, transform .2s, border-color .2s; }
.industry-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); border-color: #c7d2fe; }
.industry-card-head { display: flex; align-items: center; gap: 12px; }
.industry-ico { font-size: 1.7rem; line-height: 1; flex-shrink: 0; }
.industry-name { font-weight: 700; color: var(--slate); font-size: 1.02rem; }
.industry-okved-codes { display: flex; flex-wrap: wrap; gap: 6px; }
.okved-code-badge--more { background: #f1f5f9; color: var(--gray); }
.industry-subnames { display: flex; flex-direction: column; gap: 3px; }
.industry-subname { font-size: .82rem; color: var(--gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.industry-subname::before { content: "• "; color: #a5b4fc; }
.industry-subname--more { color: var(--primary, #6366f1); font-weight: 500; }
.industry-subname--more::before { content: ""; }
.industry-meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 4px; }
.industry-sub-count { font-size: .82rem; color: var(--gray); }
.industry-card-link { font-weight: 600; color: var(--primary, #6366f1); font-size: .9rem; }
.industry-card:hover .industry-card-link { text-decoration: underline; }

/* Страница отрасли — подотрасли */
.section-heading { font-size: 1.15rem; font-weight: 700; color: var(--slate); margin: 22px 0 12px; }
.subind-block { padding: 12px 0; border-bottom: 1px solid var(--border); }
.subind-block:last-child { border-bottom: none; }
.subind-head { display: flex; align-items: center; gap: 8px; text-decoration: none; margin-bottom: 8px; }
.subind-head-name { font-weight: 700; color: var(--slate); }
.subind-head:hover .subind-head-name { color: var(--primary, #6366f1); }
.subind-list { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 4px; }
.subind-item { display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; text-decoration: none; padding: 5px 10px; border-radius: 8px; background: #f8fafc; border: 1px solid var(--border); transition: background .15s, border-color .15s; }
.subind-item:hover { background: #eef2ff; border-color: #c7d2fe; }
.subind-code { font-weight: 600; color: #4338ca; font-size: .82rem; flex-shrink: 0; }
.subind-name { font-size: .82rem; color: var(--gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }

/* Доля учредителя: число + прогресс-бар */
.share-cell { display: flex; flex-direction: column; gap: 5px; min-width: 110px; }
.share-pct { font-weight: 600; color: var(--slate); font-variant-numeric: tabular-nums; }
.share-bar { position: relative; height: 7px; width: 100%; background: var(--border); border-radius: 999px; overflow: hidden; }
.share-bar-fill { position: absolute; inset: 0 auto 0 0; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6); transition: width .4s ease; }

.okved-list { display: flex; flex-direction: column; gap: 8px; }
.okved-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.okved-row:last-child { border-bottom: none; }
.okved-row--main { background: var(--blue-light); margin: -8px -24px; padding: 10px 24px; }
.okved-hidden { display: none; }
.okved-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 8px 14px;
    background: var(--blue-light); color: var(--blue); border: 1px solid var(--border); border-radius: 8px;
    font-size: .9rem; font-weight: 600; cursor: pointer; transition: var(--transition); }
.okved-more:hover { background: #dbeafe; }
.company-updated { margin: 24px 0 8px; padding-top: 16px; border-top: 1px solid var(--border);
    text-align: center; color: var(--gray); font-size: .85rem; }
.company-updated time { color: #475569; font-weight: 600; }
.okved-code-badge { background: var(--blue-light); color: var(--blue); border-radius: 6px; padding: 3px 8px; font-size: .82rem; font-weight: 700; flex-shrink: 0; }
.okved-name-link { flex: 1; color: var(--slate); font-size: .9rem; }
.okved-name-link:hover { color: var(--blue); }
.badge-main { background: #fef3c7; color: #92400e; border-radius: 4px; padding: 2px 8px; font-size: .75rem; font-weight: 600; }

.count-badge { background: #fef2f2; color: var(--red); border-radius: 20px; padding: 2px 10px; font-size: .8rem; font-weight: 700; }
.total-badge { background: #f0fdf4; color: var(--green); border-radius: 8px; padding: 3px 10px; font-size: .85rem; font-weight: 700; }

.yandex-map { display: block; width: 100%; height: 320px; border: 0; border-radius: 8px; background: var(--bg); overflow: hidden; margin-bottom: 10px; }
.map-address { font-size: .82rem; color: var(--gray); margin-top: 8px; }

.stats-list { list-style: none; }
.stats-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.stats-list li:last-child { border-bottom: none; }
.text-green { color: var(--green); font-weight: 600; }
.text-red { color: var(--red); font-weight: 600; }
.sidebar-source p { font-size: .8rem; line-height: 1.6; }

/* ===== Data table ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th { text-align: left; padding: 10px 14px; background: var(--bg); font-weight: 600; color: var(--gray); border-bottom: 2px solid var(--border); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--slate); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--blue-light); }
.table-total td { background: var(--bg); font-weight: 700; }

/* ===== Articles ===== */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.articles-grid--small { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.article-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition); }
.article-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.article-image { width: 100%; height: 200px; object-fit: cover; }
.article-body { padding: 18px; }
.article-category { display: inline-block; background: var(--blue-light); color: var(--blue); border-radius: 4px; padding: 2px 8px; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.article-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; line-height: 1.4; }
.article-title a { color: inherit; }
.article-title a:hover { color: var(--blue); }
.article-excerpt { font-size: .88rem; color: var(--gray); line-height: 1.6; margin-bottom: 12px; }
.article-meta { display: flex; gap: 12px; align-items: center; font-size: .8rem; color: var(--gray); }
.related-articles { margin-top: 48px; }
.related-articles h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; }
.article-page { max-width: 780px; }
.article-header { margin-bottom: 28px; }
.article-header h1 { font-size: 2rem; font-weight: 800; color: var(--navy); margin: 12px 0; line-height: 1.25; }
.article-meta-full { display: flex; gap: 20px; align-items: center; font-size: .88rem; color: var(--gray); }
.meta-item { display: flex; align-items: center; gap: 6px; }
.article-hero-image { width: 100%; height: 360px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: 28px; }
.article-content { font-size: 1.02rem; line-height: 1.8; color: var(--slate); }
.article-content h2 { font-size: 1.4rem; font-weight: 700; margin: 32px 0 12px; color: var(--navy); }
.article-content h3 { font-size: 1.15rem; font-weight: 700; margin: 24px 0 8px; color: var(--navy); }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin: 16px 0 16px 24px; }
.article-content li { margin-bottom: 6px; }
.article-content blockquote { border-left: 4px solid var(--blue); padding: 12px 20px; background: var(--blue-light); border-radius: 0 8px 8px 0; margin: 20px 0; color: var(--slate); }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.tag { background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px; font-size: .82rem; color: var(--gray); }

/* ===== Calendar ===== */
.year-nav { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.calendar-legend { display: flex; gap: 16px; margin-bottom: 20px; font-size: .85rem; }
.legend-work::before, .legend-holiday::before, .legend-short::before { content:''; display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.legend-work::before    { background: var(--white); border: 1px solid var(--border); }
.legend-holiday::before { background: #fef2f2; }
.legend-short::before   { background: #fff7ed; }
.calendar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 32px; }
.cal-month { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.cal-month-name { font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: .72rem; font-weight: 600; color: var(--gray); padding: 4px 0; }
.cal-day { text-align: center; padding: 5px 0; font-size: .82rem; border-radius: 6px; cursor: default; }
.cal-workday { color: var(--slate); }
.cal-holiday { background: #fef2f2; color: var(--red); font-weight: 600; }
.cal-today { background: var(--blue); color: white; font-weight: 700; }
.cal-blank { }
.cal-stats { display: flex; gap: 12px; margin-top: 10px; font-size: .78rem; }
.cal-stats .work { color: var(--green); }
.cal-stats .rest { color: var(--red); }
.calendar-summary { }
.summary-stats { display: flex; gap: 20px; }
.stat-box { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; text-align: center; flex: 1; }
.stat-box--holiday { background: #fef2f2; border-color: #fecaca; }
.stat-n { display: block; font-size: 2rem; font-weight: 800; color: var(--navy); }
.stat-l { display: block; font-size: .85rem; color: var(--gray); margin-top: 4px; }

/* ===== Calculator ===== */
.calculator-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; }
.calc-company-info { padding: 14px; background: var(--blue-light); border-radius: 8px; margin: 12px 0; }
.company-loaded-name { font-weight: 700; color: var(--navy); }
.result-value { margin-bottom: 20px; }
.result-label { display: block; font-size: .85rem; color: var(--gray); margin-bottom: 4px; }
.result-number { font-size: 2.4rem; font-weight: 800; color: var(--blue); }
.result-methods { margin-bottom: 20px; }
.result-methods h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.result-note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 12px 16px; font-size: .85rem; color: #92400e; }
.calc-methodology .methodology-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.calc-methodology h4 { font-size: .95rem; font-weight: 700; margin-bottom: 6px; color: var(--navy); }
.calc-methodology p { font-size: .88rem; color: var(--gray); }

/* ===== Contacts ===== */
.contacts-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; }
.contact-form .form-row { margin-bottom: 16px; }
.contact-details { list-style: none; }
.contact-details li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }

/* ===== Forms ===== */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 5px; color: var(--slate); }
.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=date],
.form-row input[type=number],
.form-row input[type=search],
.form-row input[type=password],
.form-row select,
.form-row textarea {
    width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px;
    font-size: .95rem; transition: var(--transition); background: var(--white);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,127,255,.12);
}
.required { color: var(--red); }
.input-lg { font-size: 1.1rem !important; font-weight: 600; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px; flex-direction: row !important; cursor: pointer; font-weight: 500 !important; }
.checkbox-label input { width: auto !important; }

/* ===== Alerts ===== */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ===== Top 500 ===== */
.top-table-wrap { overflow-x: auto; }
.top-table .revenue-cell { font-weight: 700; color: var(--green); }

/* ===== Error page ===== */
.error-page { text-align: center; padding: 80px 20px; }
.error-code { font-size: 8rem; font-weight: 900; color: var(--border); line-height: 1; }
.error-page h1 { font-size: 1.5rem; margin: 12px 0 8px; }
.error-page p { color: var(--gray); margin-bottom: 24px; }
.error-actions { display: flex; gap: 12px; justify-content: center; }

/* ===== Info section (home) ===== */
.info-section { margin-top: 48px; }
.info-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; text-align: center; }
.info-icon { font-size: 2rem; margin-bottom: 12px; }
.info-card h3 { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.info-card p { font-size: .88rem; color: var(--gray); }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; }
.tab-btn { padding: 8px 18px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--white); cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--gray); transition: var(--transition); }
.tab-btn.active { background: var(--blue); color: var(--white); border-color: var(--blue); }

/* ===== Pagination ===== */
.pagination { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 28px; }
.page-info { font-size: .9rem; color: var(--gray); }

/* ===== Misc ===== */
.text-muted { color: var(--gray); }
.text-sm { font-size: .85rem; }
.text-center { text-align: center; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray); }
.empty-state h3 { font-size: 1.2rem; margin: 16px 0 8px; color: var(--slate); }
.search-help { max-width: 500px; }
.search-help ul { padding-left: 20px; margin-top: 8px; }
.search-help li { margin-bottom: 4px; color: var(--gray); }
.results-count { margin-bottom: 16px; color: var(--gray); font-size: .9rem; }

/* ===== Parse notice ===== */
.parse-notice { text-align: center; padding: 32px; }
.parse-notice-icon { font-size: 2.5rem; margin-bottom: 12px; }
.parse-notice h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; color: var(--navy); }
.parse-notice p { color: var(--gray); max-width: 560px; margin: 0 auto 12px; }
.parse-notice ul { text-align: left; max-width: 480px; margin: 0 auto 20px; color: var(--gray); padding-left: 20px; }
.parse-notice li { margin-bottom: 6px; }
.parse-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.debug-card { border-color: #f59e0b; background: #fffbeb; }
.debug-card h3 { color: #92400e; margin-bottom: 14px; }

/* ===== Footer ===== */
.site-footer { background: var(--navy); color: #94a3b8; padding: 48px 0 24px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand .logo { color: white; margin-bottom: 12px; }
.footer-brand p { font-size: .85rem; line-height: 1.7; }
.footer-col h4 { color: white; font-size: .9rem; font-weight: 700; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #94a3b8; font-size: .88rem; }
.footer-col a:hover { color: white; }
.footer-bottom { border-top: 1px solid #1e293b; padding-top: 20px; font-size: .82rem; text-align: center; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .company-body { grid-template-columns: 1fr; }
    .company-sidebar { order: -1; }
    .charts-wrap { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .calculator-layout { grid-template-columns: 1fr; }
    .contacts-layout { grid-template-columns: 1fr; }
    .calc-methodology .methodology-grid { grid-template-columns: 1fr; }
    .info-cards { grid-template-columns: 1fr; }
    .company-hero { flex-direction: column; }
    .company-hero-right { flex-wrap: wrap; }
}

@media (max-width: 640px) {
    .main-nav { display: none; }
    .nav-toggle { display: flex; margin-left: auto; }
    body.nav-open .main-nav { display: flex; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--border); padding: 8px; box-shadow: var(--shadow-md); z-index: 99; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .okved-grid { grid-template-columns: 1fr; }
    .calc-grid { grid-template-columns: 1fr; }
    .page-hero h1 { font-size: 1.6rem; }
    .summary-stats { flex-direction: column; }
    .search-bar form { flex-direction: column; }
    .company-hero-left { flex-direction: column; }
    .list-item { grid-template-columns: 60px 1fr auto; }
    .info-row { grid-template-columns: 120px 1fr; }
    .article-header h1 { font-size: 1.5rem; }
}

/* Summary blocks (arbitration, enforcement, goszakupki, trademarks, licenses) */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin: 14px 0;
}
.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.stat-label { font-size: .75rem; color: #6a7282; }
.stat-value { font-size: .95rem; font-weight: 600; color: #101828; }

/* AI assistant block */
.ai-ask-card { background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%); border: 1px solid #c7d2fe; }
#ai-ask-form { display: flex; gap: 10px; margin-top: 12px; align-items: flex-start; }
#ai-question {
    flex: 1; min-height: 46px; padding: 11px 14px; border: 1px solid #cbd5e1;
    border-radius: 10px; font: inherit; resize: vertical; background: #fff;
}
#ai-question:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
#ai-ask-form .btn { white-space: nowrap; height: 46px; }
.ai-answer {
    margin-top: 14px; padding: 14px 16px; background: #fff; border: 1px solid #e2e8f0;
    border-radius: 10px; white-space: pre-wrap; line-height: 1.55; color: #1e293b;
}
.map-fallback { padding: 20px; text-align: center; color: #6a7282; }
@media (max-width: 640px) {
    #ai-ask-form { flex-direction: column; }
    #ai-ask-form .btn { width: 100%; }
}

/* Company subtitle under the title */
.company-subtitle { margin: 4px 0 10px; font-size: .9rem; color: #6a7282; font-weight: 400; }

/* Extra action links + bank request button */
.company-actions-card { display: flex; flex-direction: column; gap: 14px; }
.company-links { display: flex; flex-wrap: wrap; gap: 10px; }
.company-link {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px;
    background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 10px;
    color: #2b7fff; font-weight: 500; text-decoration: none; transition: background .15s, border-color .15s;
}
.company-link:hover { background: #e0e7ff; border-color: #c7d2fe; }
.btn-block { display: block; width: 100%; text-align: center; }

/* User questions block */
.qa-card .qa-list { display: flex; flex-direction: column; gap: 14px; }
.qa-item { padding: 14px 16px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; }
.qa-question { font-weight: 600; color: #101828; margin-bottom: 8px; }
.qa-question::before { content: "❓ "; }
.qa-answer { color: #334155; line-height: 1.55; white-space: pre-wrap; }
.qa-answer::before { content: "🤖 "; }
.qa-date { margin-top: 8px; font-size: .75rem; color: #94a3b8; }

/* Similar companies */
.similar-list { display: flex; flex-direction: column; gap: 8px; }
.similar-item {
    display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
    border: 1px solid #e2e8f0; border-radius: 8px; text-decoration: none;
    transition: background .15s, border-color .15s;
}
.similar-item:hover { background: #f1f5f9; border-color: #c7d2fe; }
.similar-name { font-weight: 500; color: #2b7fff; font-size: .9rem; line-height: 1.3; }
.similar-inn { font-size: .75rem; color: #94a3b8; }

/* Finance charts */
.finance-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.chart-box { min-width: 0; }
.chart-box .chart-title { font-size: .85rem; color: #6a7282; font-weight: 600; margin-bottom: 8px; }
.chart-box canvas { max-height: 200px; }
@media (max-width: 700px) { .finance-charts { grid-template-columns: 1fr; } }

/* Top companies in industry */
.top-list { display: flex; flex-direction: column; }
.top-item {
    display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px;
    padding: 10px 8px; border-bottom: 1px solid var(--border); color: var(--slate); text-decoration: none;
}
.top-item:last-child { border-bottom: none; }
.top-item:hover { background: var(--blue-light); text-decoration: none; }
.top-rank { color: #94a3b8; font-weight: 700; font-size: .85rem; text-align: center; }
.top-name { color: var(--blue); font-weight: 500; font-size: .92rem; }
.top-revenue { color: #6a7282; font-size: .85rem; white-space: nowrap; }
.natrank-card .natrank-subtitle { font-size: .95rem; font-weight: 700; color: var(--slate); margin: 18px 0 4px; }
.natrank-card .natrank-subtitle:first-of-type { margin-top: 8px; }
.natrank-place { background: var(--blue-light); border-radius: 8px; padding: 10px 12px; font-size: .92rem; color: var(--slate); margin-bottom: 6px; }
.natrank-place strong { color: var(--blue); }
.top-item-self { background: #eff6ff; border-left: 3px solid var(--blue); border-radius: 4px; }
.top-item-self:hover { background: #dbeafe; }
.top-item-self .top-name { color: var(--blue); font-weight: 700; }
.natrank-you { color: #2b7fff; font-weight: 600; font-size: .82rem; }
.reviews-card { background: linear-gradient(135deg,#fffbeb 0%,#fff7ed 100%); border: 1px solid #fde68a; }

/* Self-employed (НПД) status check */
.selfemp-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; margin-bottom: 20px; }
@media (max-width: 760px){ .selfemp-layout { grid-template-columns: 1fr; } }
.selfemp-form .form-row { margin-bottom: 16px; }
.selfemp-form label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--slate); }
.selfemp-form input[type=text], .selfemp-form input[type=date] {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem;
}
.form-hint { display: block; margin-top: 5px; font-size: .82rem; color: #94a3b8; }
.selfemp-result { display: flex; align-items: center; min-height: 120px; }
.selfemp-yes { border: 1px solid #bbf7d0; background: #f0fdf4; }
.selfemp-no  { border: 1px solid #fecaca; background: #fef2f2; }
.se-badge { display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem; margin-bottom: 12px; }
.se-badge-yes { background: #16a34a; color: #fff; }
.se-badge-no  { background: #dc2626; color: #fff; }
.se-text { font-size: 1.02rem; line-height: 1.5; margin-bottom: 8px; }
.selfemp-about ul { margin: 8px 0 12px 18px; }
.selfemp-about li { margin-bottom: 6px; }

/* Trademarks (Роспатент) */
.tm-list { display: flex; flex-direction: column; margin-top: 10px; }
.tm-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
    padding: 9px 8px; border-bottom: 1px solid var(--border); color: var(--slate); text-decoration: none; }
.tm-item:last-child { border-bottom: none; }
.tm-item:hover { background: var(--blue-light); text-decoration: none; }
.tm-id { font-weight: 700; color: var(--blue); font-size: .9rem; }
.tm-dates { color: #6a7282; font-size: .82rem; }
.tm-arrow { color: var(--gray); }

/* Licenses */
.lic-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.lic-item { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.lic-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.lic-number { font-weight: 700; color: var(--slate); font-size: .9rem; }
.lic-dates { color: #6a7282; font-size: .82rem; }
.lic-org { color: var(--slate); font-size: .88rem; margin-top: 4px; }
.lic-acts { color: #6a7282; font-size: .82rem; margin-top: 4px; line-height: 1.4; }

/* OKVED rows as links */
a.okved-row--link { text-decoration: none; transition: var(--transition); }
a.okved-row--link:hover { background: var(--blue-light); }
a.okved-row--link:hover .okved-name-link { color: var(--blue); }

/* Linked legal entities (founded by / managed by) */
.linked-list { display: flex; flex-direction: column; }
.linked-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px;
    border-bottom: 1px solid var(--border); text-decoration: none; transition: var(--transition); }
.linked-item:last-child { border-bottom: none; }
.linked-item:hover { background: var(--blue-light); text-decoration: none; }
.linked-name { color: var(--blue); font-weight: 600; font-size: .92rem; }
.linked-meta { color: #6a7282; font-size: .82rem; }
.linked-item--liq .linked-name { color: var(--gray); }
/* Ссылки-кнопки на ликвидированные компании: боты по ним не ходят, но для людей
   выглядят и кликаются как обычная ссылка (сброс дефолтных стилей button). */
button.linkbtn { width: 100%; text-align: left; margin: 0; border: 0; border-bottom: 1px solid var(--border);
    background: none; font: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; }
button.linkbtn:last-child { border-bottom: none; }
button.linkbtn.linked-item { align-items: stretch; }
.registrar-name { font-weight: 600; font-size: .95rem; }
.registrar-name a { color: var(--blue); }
.registrar-load { font-weight: 600; }
.msp-violation { background: #fef2f2; }

/* Negative / risk factors */
.risk-card { border: 1px solid #fecaca; background: #fef2f2; }
.risk-card .card-title { color: #b91c1c; }
.risk-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.risk-item { display: flex; flex-direction: column; gap: 3px; padding-left: 12px; border-left: 3px solid var(--red); }
.risk-flag { font-weight: 700; color: #b91c1c; font-size: .92rem; }
.risk-desc { color: var(--slate); font-size: .88rem; line-height: 1.45; }

/* On-demand datasets (lazy-loaded) */
.dataset-idle a.dataset-load { font-weight: 600; }
.ds-summary { margin-bottom: 12px; color: var(--slate); }
.ds-table { font-size: .86rem; }
.ds-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--gray); }
.ds-table td { vertical-align: top; }
.ds-sub { color: var(--gray); font-size: .8rem; margin-top: 2px; }
.company-reg { color: var(--gray); font-size: .82rem; }

/* ===== OKVED section icons ===== */
.okved-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px;
    background: var(--blue-light); font-size: 18px; line-height: 1;
}
.okved-ico-sm { width: 26px; height: 26px; border-radius: 8px; font-size: 14px; }
.okved-ico-lg { width: 44px; height: 44px; border-radius: 12px; font-size: 24px; }
/* Per-section tints */
.okved-ico-A { background: #e8f7ec; } .okved-ico-B { background: #f3eee6; }
.okved-ico-C { background: #eef1f6; } .okved-ico-D { background: #fdf6e3; }
.okved-ico-E { background: #e6f6fb; } .okved-ico-F { background: #fdeee4; }
.okved-ico-G { background: #eaf3ff; } .okved-ico-H { background: #eef0f5; }
.okved-ico-I { background: #fdeef0; } .okved-ico-J { background: #eef2ff; }
.okved-ico-K { background: #e9f7ef; }
.okved-ico-L { background: #eef1f6; } .okved-ico-M { background: #f0ecfb; }
.okved-ico-N { background: #eef1f6; } .okved-ico-O { background: #eef1f6; }
.okved-ico-P { background: #eaf3ff; } .okved-ico-Q { background: #fdeef0; }
.okved-ico-R { background: #fbeef7; } .okved-ico-S { background: #eef1f6; }
.okved-ico-T { background: #f3eee6; } .okved-ico-U { background: #e6f6fb; }
.list-item--ico { display: flex; align-items: center; gap: 12px; }
.list-item--ico .item-name { flex: 1; }
.list-item--ico .arrow { margin-left: auto; }
.okved-page-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.okved-page-header h1 { flex: 1 1 200px; }
.okved-page-header .subtitle { flex-basis: 100%; margin-top: 2px; }
.okved-cell { display: inline-flex; align-items: center; gap: 8px; }

/* Nearby cities */
.nearby-list { display: flex; flex-wrap: wrap; gap: 8px; }
.nearby-item { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px;
    border: 1px solid var(--border); border-radius: 999px; background: var(--white);
    color: var(--slate); font-size: .88rem; transition: var(--transition); }
.nearby-item:hover { border-color: var(--blue); background: var(--blue-light); color: var(--blue); text-decoration: none; }
.nearby-name { font-weight: 600; }
.nearby-dist { color: var(--gray); font-size: .8rem; }
/* Distances page */
.dist-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dist-form label { font-weight: 600; }
.dist-form select { padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--white); font-size: .95rem; min-width: 220px; }
.dist-table td.num { white-space: nowrap; }

/* Contact favicons + website snippet */
.contact-line { display: inline-flex; align-items: center; gap: 7px; }
.contact-line + .contact-line { margin-top: 4px; }
.favico { border-radius: 4px; flex-shrink: 0; vertical-align: middle; }
.site-snippet { display: block; margin-top: 8px; padding: 8px 12px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 10px; }
.site-snippet-title { display: block; color: var(--blue); font-weight: 600; font-size: .9rem; line-height: 1.35; }
.site-snippet-desc { display: block; color: var(--gray); font-size: .82rem; line-height: 1.45; margin-top: 3px; }
.top-city { display: block; color: var(--gray); font-size: .78rem; font-weight: 400; margin-top: 2px; }
.card-subtitle { font-size: .95rem; font-weight: 700; color: var(--navy); margin: 16px 0 8px; }
.card-subtitle:first-child { margin-top: 0; }

/* ===== Мобильная вёрстка: убираем горизонтальное «съезжание» (overflow-x) =====
   Grid/flex-колонки по умолчанию имеют min-width:auto и не сжимаются ниже
   min-content своего содержимого — из-за этого широкий блок распирал страницу
   вбок. Разрешаем колонкам сжиматься и переносим длинные строки. */
.company-body, .company-main, .company-sidebar,
.finance-charts, .charts-wrap, .info-grid, .top-list, .okved-list { min-width: 0; }
.company-main > *, .company-sidebar > *, .card { max-width: 100%; }
.card, .okved-list, .top-item, .top-name, .info-value, .company-name,
.contact-line, .site-snippet, .dataset-body, .registrar-body, .trademarks-body {
    overflow-wrap: anywhere; word-break: break-word;
}
.card canvas, .card table, .card img { max-width: 100%; }
.data-table { max-width: 100%; }
@media (max-width: 700px) {
    html { overflow-x: clip; }   /* страховка от горизонтального скролла; sticky-шапка сохраняется */
}

/* ============================================================
   Liquid Glass — освежение дизайна (слой поверх базовых стилей)
   Матовое стекло: полупрозрачность + blur + световая грань + живой фон.
   ============================================================ */
:root {
  --glass-bg:        rgba(255,255,255,.55);
  --glass-bg-strong: rgba(255,255,255,.74);
  --glass-border:    rgba(255,255,255,.66);
  --glass-blur:      saturate(180%) blur(20px);
  --glass-shadow:    0 10px 34px rgba(16,24,40,.12), 0 2px 8px rgba(16,24,40,.06);
  --glass-hi:        inset 0 1px 0 rgba(255,255,255,.75);
  --radius-lg:       22px;
}

/* Живой фон-аврора — стеклу есть что преломлять */
body {
  background:
    radial-gradient(1200px 820px at 10% -12%, rgba(43,127,255,.20), transparent 60%),
    radial-gradient(1000px 720px at 102% -4%, rgba(124,58,237,.16), transparent 55%),
    radial-gradient(980px 760px at 50% 118%, rgba(26,163,240,.20), transparent 62%),
    #e9f0fb;
  background-attachment: fixed;
}

/* Стеклянные панели с настоящим blur (их немного — производительно) */
.card, .okved-card, .company-hero, .info-card, .ai-ask-card, .qa-card, .risk-card,
.search-suggestions, .company-sidebar > .card {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow), var(--glass-hi) !important;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease, background .25s ease;
}
.card:hover, .okved-card:hover {
  background: var(--glass-bg-strong) !important;
  transform: translateY(-3px);
  box-shadow: 0 18px 48px rgba(16,24,40,.17), var(--glass-hi) !important;
}

/* Списки компаний могут быть длинными — стекло БЕЗ blur (без джанка при скролле) */
.company-card {
  background: rgba(255,255,255,.62) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 18px;
  box-shadow: var(--glass-shadow), var(--glass-hi) !important;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.company-card:hover {
  background: var(--glass-bg-strong) !important;
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(16,24,40,.16), var(--glass-hi) !important;
}

/* Яркий «хиро» главной — стеклянный градиент */
.page-hero {
  background: linear-gradient(135deg, rgba(43,127,255,.92), rgba(124,58,237,.88)) !important;
  color: #fff !important; border-radius: var(--radius-lg);
  box-shadow: 0 16px 44px rgba(43,127,255,.30), var(--glass-hi);
  padding: 36px 28px;
}
.page-hero h1, .page-hero p { color: #fff !important; }

/* Липкий стеклянный header */
.site-header { box-shadow: 0 6px 24px rgba(16,24,40,.10); }
.header-top {
  background: rgba(255,255,255,.60) !important;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(255,255,255,.5) !important;
}
.header-nav {
  background: linear-gradient(90deg, rgba(26,163,240,.88), rgba(43,127,255,.88)) !important;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
#site-search {
  background: rgba(255,255,255,.62) !important;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-color: rgba(255,255,255,.7);
}

/* Стеклянные кнопки */
.btn-primary {
  background: linear-gradient(135deg, var(--blue), #6d6bff) !important;
  box-shadow: 0 8px 20px rgba(43,127,255,.30), inset 0 1px 0 rgba(255,255,255,.45) !important;
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-outline {
  background: rgba(255,255,255,.5) !important;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-color: rgba(255,255,255,.72) !important;
}

/* Скруглим и «мыло» побольше на аватарах/иконках */
.okved-card { border-radius: 18px; }

/* Фолбэк без backdrop-filter — уплотняем фоны, чтобы текст читался */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .okved-card, .company-hero, .info-card, .search-suggestions,
  .ai-ask-card, .qa-card, .risk-card { background: rgba(255,255,255,.96) !important; }
  .header-top { background: #fff !important; }
  .header-nav { background: var(--azure) !important; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .okved-card, .company-card { transition: none !important; }
  body { background-attachment: scroll; }
}

/* ============================================================
   Статьи — таблицы и мобильная адаптация
   Таблицы в контенте статей не имели стилей: на узких экранах
   широкие таблицы ломали вёрстку. width:100% + скролл-контейнер
   (.table-wrap) страхуют от горизонтального переполнения.
   ============================================================ */
.article-content { overflow-wrap: break-word; min-width: 0; }
.article-header h1 { overflow-wrap: break-word; }

/* Обёртка вокруг таблиц: горизонтальный скролл вместо слома страницы */
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 18px 0; }

/* Сама таблица тоже является скролл-контейнером — на случай таблиц без
   обёртки (старые статьи): display:block + max-width:100% гарантируют,
   что широкая таблица прокручивается, а не растягивает страницу. */
.article-content table {
  display: block; width: max-content; max-width: 100%;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-collapse: collapse; margin: 18px 0; font-size: .92rem;
}
.table-wrap table { margin: 0; }
.article-content th, .article-content td {
  border: 1px solid var(--border); padding: 9px 12px;
  text-align: left; vertical-align: top; line-height: 1.5;
}
.article-content thead th { background: var(--bg); font-weight: 700; color: var(--navy); }
.article-content tbody tr:nth-child(even) { background: rgba(16,24,40,.025); }

@media (max-width: 640px) {
  .article-page { max-width: 100%; }
  .article-header h1 { font-size: 1.5rem; line-height: 1.3; margin: 10px 0; }
  .article-meta-full { gap: 12px; flex-wrap: wrap; font-size: .82rem; }
  .article-content { font-size: 1rem; line-height: 1.72; }
  .article-content h2 { font-size: 1.22rem; margin: 26px 0 10px; }
  .article-content h3 { font-size: 1.06rem; margin: 20px 0 8px; }
  .article-content ul, .article-content ol { margin: 14px 0 14px 20px; }
  .article-content li { margin-bottom: 8px; }
  .article-content table { font-size: .82rem; }
  .article-content th, .article-content td { padding: 7px 9px; }
  .articles-grid { grid-template-columns: 1fr; gap: 16px; }
  .article-image { height: 180px; }
  .article-hero-image { height: 200px; margin-bottom: 20px; }
  .related-articles { margin-top: 36px; }
  .related-articles h2 { font-size: 1.2rem; }
}
