/* AMCU Legal Search — main stylesheet */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #1a4f8a;
  --blue-dark: #0e3060;
  --blue-light: #e8f0fb;
  --gold: #c8a02a;
  --text: #1a1a2e;
  --text-muted: #5a6070;
  --border: #d0d7e0;
  --bg: #f5f7fa;
  --white: #ffffff;
  --red: #c0392b;
  --green: #27ae60;
  --radius: 6px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 2px 12px rgba(0,0,0,.12);
}

body { font-family: 'Georgia', serif; font-size: 16px; line-height: 1.65;
  color: var(--text); background: var(--bg); }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { background: var(--blue-dark); color: white; padding: 12px 0; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.site-logo { display: flex; flex-direction: column; color: white; }
.logo-title { font-size: 1.25rem; font-weight: bold; letter-spacing: .02em; }
.logo-sub { font-size: .75rem; opacity: .75; }
.site-nav a { color: rgba(255,255,255,.85); margin-left: 20px; font-size: .9rem; font-family: sans-serif; }
.site-nav a:hover { color: white; }
.nav-logout { opacity: .7; font-size: .8rem !important; }
.nav-tab { padding: 4px 12px; border-radius: 6px; transition: background .15s; }
.nav-tab-active { background: rgba(255,255,255,.18); color: white !important; font-weight: 600; }

/* Main */
.site-main { min-height: calc(100vh - 120px); padding: 30px 0; }

/* Footer */
.site-footer { background: var(--blue-dark); color: rgba(255,255,255,.6);
  font-size: .8rem; text-align: center; padding: 14px 0; font-family: sans-serif; }

/* Search hero */
.search-hero { text-align: center; padding: 40px 20px 30px; }
.search-hero h1 { font-size: 2rem; color: var(--blue-dark); margin-bottom: 8px; }
.hero-subtitle { color: var(--text-muted); font-size: .95rem; margin-bottom: 8px; font-family: sans-serif; }
.db-status { font-size: .8rem; color: var(--text-muted); margin-bottom: 24px; display: flex; gap: 20px; flex-wrap: wrap; font-family: sans-serif; }

/* Search form */
.search-form { max-width: 780px; margin: 0 auto; }
.search-form.compact { max-width: 100%; }
.search-bar { display: flex; gap: 8px; }
.search-bar input[type=text] {
  flex: 1; padding: 12px 16px; font-size: 1rem;
  border: 2px solid var(--border); border-radius: var(--radius);
  font-family: sans-serif; outline: none; transition: border .15s;
}
.search-bar input:focus { border-color: var(--blue); }
.search-bar button {
  padding: 12px 28px; background: var(--blue); color: white;
  border: none; border-radius: var(--radius); font-size: 1rem;
  cursor: pointer; font-family: sans-serif; white-space: nowrap;
}
.search-bar button:hover { background: var(--blue-dark); }

/* Filters panel */
.filters-panel { margin-top: 16px; text-align: left; }
.filters-panel summary { cursor: pointer; color: var(--blue); font-family: sans-serif;
  font-size: .9rem; user-select: none; }
.filters-grid { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.filters-grid label { display: flex; flex-direction: column; font-family: sans-serif;
  font-size: .85rem; color: var(--text-muted); gap: 4px; }
.filters-grid select { padding: 6px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .9rem; }
.filter-type-column { display: flex; flex-direction: column; gap: 14px; }
.filter-group { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--text-muted); font-family: sans-serif; }
.filter-group-label { font-weight: 600; }
.filter-checkboxes { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; background: var(--bg); }
.filter-check-label { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: .88rem;
  color: var(--text); cursor: pointer; white-space: nowrap; }
.filters-grid .filter-check-label { flex-direction: row; }
.filter-check-label input[type=checkbox] { flex-shrink: 0; accent-color: var(--blue); cursor: pointer; }

/* Results layout */
.results-header { margin-bottom: 20px; }
.results-meta { font-family: sans-serif; font-size: .9rem; color: var(--text-muted); margin-top: 12px; }
.results-meta strong { color: var(--text); }
.btn-export { display: inline-block; padding: 2px 10px; font-size: .8rem; border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted); text-decoration: none; vertical-align: middle; }
.btn-export:hover { background: var(--blue-light); color: var(--blue); border-color: var(--blue); }
.results-layout { display: flex; gap: 28px; align-items: flex-start; }

/* Sidebar */
.filters-sidebar { width: 280px; flex-shrink: 0; background: white;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; font-family: sans-serif; font-size: .85rem; }
.filters-sidebar h3 { font-size: .95rem; margin-bottom: 14px; color: var(--blue-dark); }
.filters-sidebar fieldset { border: none; margin-bottom: 16px; }
.filters-sidebar legend { font-weight: bold; font-size: .8rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.filters-sidebar label { display: flex; align-items: center; gap: 6px;
  cursor: pointer; margin-bottom: 6px; }
.btn-filter { width: 100%; padding: 8px; background: var(--blue); color: white;
  border: none; border-radius: var(--radius); cursor: pointer; font-size: .9rem;
  margin-bottom: 6px; }
.btn-reset { display: block; text-align: center; font-size: .85rem;
  color: var(--text-muted); }

/* Results list */
.results-list { flex: 1; min-width: 0; }

/* Result card */
.result-card { background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  box-shadow: var(--shadow); transition: box-shadow .15s; }
.result-card:hover { box-shadow: var(--shadow-md); }
.result-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
  align-items: center; }
.badge { padding: 3px 8px; border-radius: 4px; font-size: .75rem;
  font-family: sans-serif; font-weight: 600; }
.badge-number { background: var(--blue-light); color: var(--blue-dark); }
.badge-type { background: #e8f5e9; color: #1b5e20; }
.badge-fine { background: #fff3e0; color: #e65100; }
/* Fine imposed by an earlier decision (instalments, reviews) — not by this one. */
.badge-fine-deferred { background: #e3f2fd; color: #0d47a1; }
.fines-table { border-collapse: collapse; font-size: .85rem; margin-top: 4px; }
.fines-table tr + tr td { border-top: 1px solid #f0e0d0; }
.fines-company { padding: 3px 12px 3px 0; color: #333; }
.fines-amount { padding: 3px 0; color: #e65100; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
/* Term a concerted-practices permission was granted for — the fact a merger
   lawyer reads first on this series, since it is mostly ancillary non-competes. */
.badge-ud { background: #fdf2f8; color: #9d174d; }
/* Permission with no term stated in the operative part. */
.badge-ud.ud-open { background: #f3f4f6; color: #4b5563; font-weight: 500; }
/* The act's own letterhead contradicts the date it must have — АМКУ's slip,
   not ours; the tooltip says what the document prints. */
.badge-drafting-error { background: #fef3c7; color: #92400e; cursor: help; }
/* Link between a decision and the «додаткове рішення» that amends it. */
.badge-amend { background: #fff7ed; color: #9a3412; text-decoration: none; cursor: pointer; }
.badge-court { background: #ede7f6; color: #4527a0; text-decoration: none; cursor: pointer; font-size: .85rem; }
/* outcome of the court challenge — green survived, red struck down */
.badge-court.court-upheld   { background: #e8f5e9; color: #1b5e20; }
.badge-court.court-annulled { background: #ffebee; color: #b71c1c; }
.badge-court.court-partial  { background: #fff3e0; color: #e65100; }
.badge-court.court-remanded { background: #e3f2fd; color: #0d47a1; }
.result-date { font-size: .85rem; color: var(--text-muted); font-family: sans-serif; }
.result-title { font-size: 1.1rem; line-height: 1.4; margin-bottom: 8px; }
.result-title a { color: var(--blue-dark); }
.result-title a:hover { color: var(--blue); }
.result-parties { font-size: .85rem; color: var(--text-muted);
  font-family: sans-serif; margin-bottom: 8px; }
.result-snippet { font-size: .9rem; line-height: 1.6; color: #333;
  border-left: 3px solid var(--border); padding-left: 12px; margin-bottom: 10px; }
.result-snippet mark { background: #fff9c4; padding: 0 2px; border-radius: 2px; }
.result-footer { display: flex; justify-content: space-between; align-items: center;
  font-family: sans-serif; font-size: .8rem; }
.text-size { color: var(--text-muted); }
.read-more { color: var(--blue); font-weight: 600; }

/* Pagination */
.pagination { display: flex; gap: 16px; align-items: center; justify-content: center;
  margin-top: 28px; font-family: sans-serif; }
.btn-page { padding: 8px 18px; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--blue); background: white; }
.btn-page:hover { background: var(--blue-light); }
.page-info { color: var(--text-muted); font-size: .9rem; }

/* No results */
.no-results { text-align: center; padding: 60px 20px; color: var(--text-muted);
  font-family: sans-serif; }
.no-results p { margin-bottom: 10px; }

/* Breadcrumb */
.breadcrumb { font-family: sans-serif; font-size: .85rem; color: var(--text-muted);
  margin-bottom: 20px; }

/* Decision detail */
.decision-detail { background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.decision-header { margin-bottom: 28px; }
.decision-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.decision-detail h1 { font-size: 1.5rem; line-height: 1.4; color: var(--blue-dark); margin-bottom: 20px; }
.decision-meta-list { display: grid; grid-template-columns: max-content 1fr;
  gap: 8px 16px; font-family: sans-serif; font-size: .9rem; }
.decision-meta-list dt { font-weight: bold; color: var(--text-muted); }
.decision-meta-list dd { color: var(--text); }
.decision-text h2 { font-size: 1.15rem; margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 2px solid var(--blue-light); color: var(--blue-dark); }
.text-body { max-height: 70vh; overflow-y: auto; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; font-size: .92rem; line-height: 1.8; }
.text-chunk { white-space: pre-wrap; word-break: break-word; }
.chunk-sep { border: none; border-top: 1px dashed var(--border); margin: 16px 0; }
.no-text-notice { padding: 24px; background: var(--blue-light);
  border-radius: var(--radius); text-align: center; font-family: sans-serif; }
.btn-external { display: inline-block; margin-top: 12px; padding: 10px 20px;
  background: var(--blue); color: white; border-radius: var(--radius); }
.decision-footer { margin-top: 24px; font-family: sans-serif; font-size: .8rem;
  color: var(--text-muted); }

/* About page */
.about-page h1 { font-size: 1.8rem; margin-bottom: 20px; color: var(--blue-dark); }
.about-page h2 { font-size: 1.2rem; margin: 24px 0 10px; color: var(--blue); }
.about-page ul { margin-left: 24px; }
.about-page li { margin-bottom: 6px; font-size: .95rem; }

/* Home page mode radio */
.home-mode { margin-top: 12px; }
.mode-radio { display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  font-family: sans-serif; font-size: .85rem; padding: 3px 10px;
  border-radius: 20px; border: 1.5px solid var(--blue); color: var(--blue); }
.mode-radio input { margin: 0; accent-color: var(--blue); }
.mode-radio.mode-btn-partial { border-style: dashed; opacity: .75; }

/* Similar decisions */
.similar-decisions { margin-top: 32px; }
.similar-decisions h2 { font-size: 1.1rem; color: var(--blue-dark);
  margin-bottom: 12px; font-family: sans-serif; }
.similar-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.similar-card { display: block; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; color: var(--text);
  transition: border-color .15s, background .15s; }
.similar-card:hover { border-color: var(--blue); background: var(--blue-light); }
.similar-meta { margin-bottom: 6px; }
.similar-title { font-size: .85rem; line-height: 1.4; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Mode switcher */
.mode-switcher { display: flex; align-items: center; gap: 8px; margin-top: 10px;
  font-family: sans-serif; font-size: .85rem; flex-wrap: wrap; }
.mode-label { color: var(--text-muted); font-weight: 600; }
.mode-btn { padding: 4px 12px; border-radius: 20px; border: 1.5px solid var(--blue);
  color: var(--blue); text-decoration: none; transition: all .15s; }
.mode-btn:hover { background: var(--blue-light); }
.mode-btn.active { background: var(--blue); color: white; }
.mode-btn-partial { border-style: dashed; opacity: .75; }

/* Popular queries */
.popular-queries { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-family: sans-serif; font-size: .83rem; }
.popular-label { color: var(--text-muted); font-weight: 600; }
.popular-tag { padding: 3px 10px; background: var(--blue-light); color: var(--blue-dark);
  border-radius: 20px; text-decoration: none; border: 1px solid var(--border); transition: background .15s; }
.popular-tag:hover { background: #d0e4f7; }

/* 404 page */
.not-found { text-align: center; padding: 80px 20px; font-family: sans-serif; }
.not-found h1 { font-size: 6rem; color: var(--blue-light); margin-bottom: 12px; }
.not-found p { color: var(--text-muted); margin-bottom: 24px; }
.btn-home { display: inline-block; padding: 10px 24px; background: var(--blue);
  color: white; border-radius: var(--radius); text-decoration: none; }

/* Breadcrumb */
.breadcrumb { font-family: sans-serif; font-size: .85rem; color: var(--text-muted);
  margin-bottom: 16px; }
.breadcrumb a { color: var(--blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Stats page */
.stats-summary { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 32px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 28px; text-align: center; min-width: 130px; }
.stat-value { display: block; font-size: 2rem; font-weight: 700; color: var(--blue); }
.stat-label { display: block; font-size: .85rem; color: var(--text-muted); margin-top: 4px; }
.daily-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 12px 28px; margin-bottom: 32px; overflow-x: auto; }
.day-bar-wrap { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 28px; height: 100%; justify-content: flex-end; }
.day-bar { width: 100%; background: var(--blue); border-radius: 3px 3px 0 0; min-height: 4px; transition: height .2s; }
.day-bar-wrap:hover .day-bar { background: var(--blue-dark, #1a56db); }
.day-label { font-size: .65rem; color: var(--text-muted); margin-top: 4px; white-space: nowrap; }
.stats-table { width: 100%; border-collapse: collapse; font-family: sans-serif; font-size: .9rem; margin-bottom: 32px; }
.stats-table th { text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--border); color: var(--text-muted); font-weight: 600; }
.stats-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.stats-table tr:hover td { background: var(--bg-card); }
.stats-table a { color: var(--blue); text-decoration: none; }
.stats-table a:hover { text-decoration: underline; }

/* RAG chat panel */
.rag-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; }
.rag-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0; }
.rag-panel-header h3 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.rag-panel-header h3 .rag-notice-count { font-size: .78rem; color: var(--text-muted); font-weight: normal; }
.rag-clear-btn { background: none; border: none; font-size: .8rem; color: var(--text-muted); cursor: pointer; padding: 2px 6px; }
.rag-clear-btn:hover { color: var(--text); }
.rag-messages { display: flex; flex-direction: column; gap: 10px; max-height: 240px; overflow-y: auto; margin-bottom: 12px; padding-right: 4px; }
.rag-messages:empty { display: none; }

/* Horizontal AI panel */
.ai-panel-h { margin: 16px 0 4px; }
.ai-panel-h-actions { display: flex; align-items: center; gap: 4px; }
.ai-panel-toggle { background: none; border: none; font-size: .8rem; color: var(--text-muted); cursor: pointer; padding: 2px 6px; line-height: 1; }
.ai-panel-toggle:hover { color: var(--text); }
.ai-panel-h-body { margin-top: 14px; }
.ai-panel-h-input { display: flex; gap: 8px; align-items: center; }
.ai-panel-h-input .rag-input { flex: 1; }
.ai-panel-h-input .rag-btn { padding: 8px 20px; }
.rag-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; line-height: 1.6; font-size: .93rem; white-space: pre-wrap; word-break: break-word; }
.rag-msg-user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 3px; }
.rag-msg-ai { align-self: flex-start; background: #f0f7ff; border: 1px solid #cde; border-bottom-left-radius: 3px; }
.rag-msg-thinking { align-self: flex-start; background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); font-style: italic; border-bottom-left-radius: 3px; }
.rag-form { display: flex; gap: 8px; }
.rag-input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: .95rem; font-family: inherit; }
.rag-btn { padding: 8px 18px; background: var(--blue); color: white; border: none; border-radius: var(--radius); cursor: pointer; font-size: .95rem; white-space: nowrap; }
.rag-btn:disabled { opacity: .5; cursor: not-allowed; }
.rag-notice { margin-top: 12px; font-size: .85rem; color: var(--text-muted); display: none; }
.rag-notice.visible { display: block; }

/* Context mode toggle (AI panel) */
.context-toggle-wrap { display: flex; align-items: center; gap: 8px; font-family: sans-serif; font-size: .82rem; }
.toggle-lbl { color: var(--text-muted); transition: color .15s, font-weight .15s; cursor: default; }
.toggle-lbl.active { color: var(--blue-dark); font-weight: 700; }
.toggle-switch { position: relative; display: inline-block; cursor: pointer; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track { display: block; width: 40px; height: 22px; background: var(--text-muted); border-radius: 11px; transition: background .2s; position: relative; }
.toggle-switch input:checked + .toggle-track { background: var(--blue); }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: white; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.toggle-switch input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }
.toggle-hint { font-size: .72rem; color: var(--text-muted); font-style: italic; white-space: nowrap; }

/* Charts sidebar layout */
.page-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
.charts-sidebar {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chart-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.chart-card h4 {
  margin: 0 0 10px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Mobile */
@media (max-width: 768px) {
  .results-layout { flex-direction: column; }
  .filters-sidebar { width: 100%; }
  .search-hero h1 { font-size: 1.4rem; }
  .decision-detail { padding: 18px; }
  .decision-meta-list { grid-template-columns: 1fr; }
  .page-with-sidebar { grid-template-columns: 1fr; }
  .charts-sidebar { position: static; }
}

/* Sub-tab navigation (within Практика АМКУ) */
.subtab-nav { display: flex; gap: 6px; border-bottom: 2px solid var(--border);
  margin-bottom: 18px; font-family: sans-serif; }
.subtab { padding: 8px 18px; font-size: .92rem; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px; }
.subtab:hover { color: var(--blue); text-decoration: none; }
.subtab-active { color: var(--blue-dark); font-weight: 600; border-bottom-color: var(--blue); }

/* Phase 2 page */
.phase2-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px; font-family: sans-serif; }
.pf-label { color: var(--text-muted); font-size: .9rem; }
.pf-btn { padding: 5px 14px; font-size: .85rem; font-family: sans-serif; cursor: pointer;
  border: 1px solid var(--border); background: white; color: var(--text-muted);
  border-radius: 20px; }
.pf-btn:hover { border-color: var(--blue); color: var(--blue); }
.pf-active { background: var(--blue); border-color: var(--blue); color: white; }
.pf-active:hover { color: white; }

.phase2-wrap { overflow-x: auto; }
.phase2-table { width: 100%; border-collapse: collapse; font-family: sans-serif;
  font-size: .88rem; background: white; }
.phase2-table th { text-align: left; padding: 9px 10px; border-bottom: 2px solid var(--border);
  color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.phase2-table td { padding: 9px 10px; border-bottom: 1px solid var(--border);
  vertical-align: top; }
.phase2-table .p2-row:hover td { background: var(--bg); }
.p2-ord { color: var(--text-muted); }
.p2-num a { font-weight: 600; }
.p2-count { color: var(--text-muted); font-size: .8rem; margin-left: 3px; }
.p2-date, .p2-dur { white-space: nowrap; }
.p2-parties { max-width: 240px; }
.p2-market { max-width: 160px; }
.badge-obl { padding: 2px 9px; border-radius: 4px; font-size: .78rem; font-weight: 600; }
.badge-obl-yes { background: #e8f5e9; color: #1b5e20; }
.badge-obl-no { background: #f0f0f0; color: #777; }
.badge-auto { background: #fff3e0; color: #e65100; padding: 1px 6px; border-radius: 4px;
  font-size: .7rem; font-weight: 600; margin-left: 4px; vertical-align: middle; }
.badge-ud { background: #ede7f6; color: #4527a0; padding: 1px 6px; border-radius: 4px;
  font-size: .7rem; font-weight: 600; margin-left: 4px; vertical-align: middle; }
.p2-expand { padding: 4px 10px; font-size: .8rem; font-family: sans-serif; cursor: pointer;
  border: 1px solid var(--border); background: white; color: var(--blue); border-radius: 4px;
  white-space: nowrap; }
.p2-expand:hover { border-color: var(--blue); }
.p2-detail td { background: var(--blue-light); }
.p2-dl { margin: 0; }
.p2-dl dt { font-weight: 600; color: var(--blue-dark); margin-top: 8px; font-size: .85rem; }
.p2-dl dt:first-child { margin-top: 0; }
.p2-dl dd { margin: 2px 0 0; color: var(--text); font-size: .88rem; }
.p2-quote { white-space: pre-wrap; }
.p2-note { font-family: sans-serif; font-size: .78rem; color: var(--text-muted);
  margin-top: 14px; }

/* Ринки */
.mk-kindbar { margin-bottom: 6px; }
.mk-kindbar .pf-btn { text-decoration: none; }
.mk-kindnote { font-family: sans-serif; font-size: .82rem; color: var(--text-muted);
  margin: 0 0 14px; max-width: 62rem; }
.mk-count { font-family: sans-serif; font-size: .85rem; color: var(--text-muted);
  margin: 10px 0 8px; }
.mk-table .mk-name { max-width: 30rem; }
.mk-table .mk-name a { font-weight: 500; }
.mk-rubric, .mk-geo, .mk-pattern { font-size: .82rem; color: var(--text-muted); white-space: nowrap; }
.mk-sentence { font-size: .82rem; color: var(--text-muted); max-width: 34rem; }
.mk-parties { font-size: .82rem; max-width: 18rem; }
.mk-parties .dash { color: var(--text-muted); }
.mk-empty { color: var(--text-muted); text-align: center; padding: 18px; }
.mk-detail-title { font-size: 1.4rem; line-height: 1.3; max-width: 52rem; }

/* analytical columns added 14.08.2026 */
.p2-stats { font-size: .82rem; margin-top: 4px; }
.pf-label-2 { margin-left: 10px; }
.p2-overlap { font-size: .82rem; max-width: 130px; }
.p2-obl-list { margin: 2px 0 0; padding-left: 18px; list-style: none; }
.p2-obl-list li { margin: 0 0 7px; line-height: 1.5; }
.p2-obl-list li:last-child { margin-bottom: 0; }
.p2-obl-list .oi-bullet { position: relative; }
.p2-obl-list .oi-bullet::before { content: "•"; position: absolute; left: -13px;
  color: var(--text-muted); }
/* lead-in paragraph: sits flush left, introduces the list under it */
.p2-obl-list .oi-intro { margin-left: -18px; margin-top: 12px; }
.p2-obl-list .oi-intro:first-child { margin-top: 0; }
.p2-obl-list .oi-plain { margin-left: -18px; }
.p2-obl-list .oi-num.oi-intro, .p2-obl-list .oi-num.oi-plain { text-indent: 0; }
.p2-obl-list .oi-sub { margin-left: 0; padding-left: 14px; }
.p2-num-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; padding: 1px 6px; margin-left: 4px; border-radius: 3px;
  font-size: .72rem; font-weight: 600; white-space: nowrap; }
.chip-behav { background: #e8f0fb; color: #1a4f8a; }
.chip-hybrid { background: #fff3e0; color: #e65100; }
.chip-struct { background: #fde8e8; color: #a02020; }
.chip-hidden { background: #f0f0f0; color: #777; font-style: italic; }
.chip-hhi { background: #eef2f7; color: #5a6070; }
.chip-ban { background: #7f1d1d; color: #fff; }
.chip-verbatim { background: #e8f5e9; color: #1b5e20; }
.chip-paraphrase { background: #fff3e0; color: #e65100; }
.p2-toh-quote { color: var(--text-muted); font-style: italic; }

/* ── Сторони концентрацій ─────────────────────────────────────────────── */
.cp-form { padding: 0 20px; }
.cp-results { padding: 0 20px; }
.cp-actions { flex-direction: row !important; align-items: flex-end; gap: 10px !important; }
.cp-input { padding: 5px 8px; font-size: .85rem; font-family: sans-serif;
  border: 1px solid var(--border); border-radius: 4px; background: var(--card); }
.cp-year { width: 100%; min-width: 0; }
.cp-check { font-size: .85rem; color: var(--text-muted); display: flex; gap: 5px; align-items: center; }
.cp-count { padding: 0 0 10px; font-size: .85rem; color: var(--text-muted); font-family: sans-serif; }
.cp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-years { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cp-code { margin-left: 6px; font-size: .75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cp-tag { margin-left: 5px; padding: 1px 6px; border-radius: 3px; font-size: .72rem;
  background: #eef2f7; color: #3d5a80; white-space: nowrap; }
.cp-tag-warn { background: #fdecea; color: #a02c2c; }
.badge-origin-ua { background: #e8f5e9; color: #1b5e20; }
.badge-origin-fr { background: #e3f2fd; color: #0d47a1; }
.badge-origin-lg { background: #fff8e1; color: #8d6e00; }
.badge-origin-un { background: #f0f0f0; color: #555; }

.cl-list { margin: 0; padding-left: 18px; }
.cl-list li { margin-bottom: 3px; }
.cl-prov { display: flex; flex-wrap: wrap; gap: 4px; }

.cp-viewbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 20px 10px; }
.cp-num a { color: var(--blue); }
.cp-num a.cp-tag { text-decoration: none; }

.phase2-table th.cp-group { text-align: center; border-bottom: 1px solid var(--border);
  background: var(--bg); letter-spacing: .04em; }
.phase2-table thead tr:first-child th { vertical-align: bottom; }

/* ── Сторони концентрацій: readability of a 15-column table ──────────────── */
.phase2-table thead th { position: sticky; top: 0; z-index: 2; background: var(--white); }
.phase2-table thead tr:nth-child(2) th { top: 34px; }
.phase2-table th.cp-group { text-align: center; background: var(--blue-light);
  color: var(--blue-dark); border-bottom: 1px solid var(--border);
  letter-spacing: .06em; text-transform: uppercase; font-size: .72rem; }
.phase2-table thead tr:first-child th { vertical-align: bottom; }
/* the role block reads as one unit */
.phase2-table td.cp-role-first, .phase2-table th.cp-role-first { border-left: 1px solid var(--border); }
.phase2-table td.cp-role-last, .phase2-table th.cp-role-last { border-right: 1px solid var(--border); }
.phase2-table tbody tr:nth-child(even) td { background: #fafbfd; }
.phase2-table .p2-row:hover td { background: var(--blue-light); }
.cp-dash { color: #c3cad6; }
.cp-count { padding: 0 0 10px; font-size: .85rem; color: var(--text-muted); font-family: sans-serif; }
.cp-count strong { color: var(--text); }

/* ── Сторони концентрацій: дашборд і картка особи ────────────────────────── */
.cp-dash { padding: 0 20px 18px; font-family: sans-serif; }
.cp-tiles { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.cp-tile { flex: 1 1 160px; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; }
.cp-tile-n { font-size: 1.5rem; font-weight: 700; color: var(--blue-dark); }
.cp-tile-l { font-size: .8rem; color: var(--text-muted); }
.cp-tile-warn .cp-tile-n { color: #c0392b; }
.cp-discipline { display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline;
  background: var(--blue-light); border-radius: var(--radius); padding: 10px 16px;
  font-size: .85rem; margin-bottom: 14px; }
.cp-disc-label { color: var(--blue-dark); font-weight: 600; }
.cp-disc-item strong { color: #c0392b; font-size: 1rem; }
.cp-dash-muted { color: var(--text-muted); }
/* the catalogue table is wide — let it scroll inside the main column */
.page-main .phase2-wrap { max-width: 100%; }
.cp-share { font-variant-numeric: tabular-nums; }
.cp-share-hi { color: #e67e22; font-weight: 600; }
.cp-share-max { color: #c0392b; font-weight: 700; }
.cp-side { display: flex; flex-wrap: wrap; gap: 12px; padding: 0 20px 14px; font-family: sans-serif; }
.cp-side-card { flex: 1 1 320px; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; min-width: 0; }
.cp-side-card h4 { font-size: .85rem; color: var(--text-muted); margin-bottom: 10px; font-weight: 600; }
.cp-tl-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: .82rem; }
.cp-tl-year { width: 40px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cp-tl-bar { height: 10px; background: var(--blue); border-radius: 2px; min-width: 3px; }
.cp-tl-n { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cp-cparties { margin: 0; padding-left: 18px; font-size: .85rem; }
.cp-cparties li { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 3px; }
.cp-cp-n { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.cp-searchbar { display: flex; gap: 8px; padding: 0 0 6px; }
.cp-search-hint { font-size: .78rem; color: var(--text-muted); padding: 0 2px 10px; line-height: 1.5; }
.cp-search-hint code { background: var(--blue-light); border-radius: 3px; padding: 1px 4px; font-size: .95em; }
.cp-search-input { flex: 1; padding: 9px 14px; font-size: .95rem; font-family: sans-serif;
  border: 2px solid var(--border); border-radius: var(--radius); outline: none; }
.cp-search-input:focus { border-color: var(--blue); }
.cp-search-btn { padding: 9px 22px; background: var(--blue); color: #fff; border: none;
  border-radius: var(--radius); font-size: .95rem; font-family: sans-serif; cursor: pointer; }
.cp-search-btn:hover { background: var(--blue-dark); }
/* the summary strip now lives in the narrow column */
.charts-sidebar .cp-dash { padding: 0; }
.charts-sidebar .cp-tiles { flex-direction: column; gap: 8px; margin-bottom: 12px; }
.charts-sidebar .cp-tile { flex: none; padding: 9px 12px; flex-direction: row;
  align-items: baseline; justify-content: space-between; gap: 8px; }
.charts-sidebar .cp-tile-n { font-size: 1.15rem; }
.charts-sidebar .cp-tile-l { font-size: .75rem; text-align: right; }
.charts-sidebar .cp-discipline { flex-direction: column; gap: 4px; font-size: .8rem;
  padding: 10px 12px; margin-bottom: 12px; }
.charts-sidebar .cp-disc-item { display: flex; justify-content: space-between; gap: 8px; width: 100%; }
.p2-mt { white-space: nowrap; font-size: .82rem; }
.p2-mt .mt-link { font-variant-numeric: tabular-nums; }
.p2-mt .mt-weak { color: var(--text-muted); border-bottom: 1px dotted var(--text-muted); text-decoration: none; }
.p2-mt .dash { color: var(--text-muted); }
/* Market-test */
.mt-table .mt-parties { font-size: .85rem; max-width: 16rem; }
.mt-table .mt-body { font-size: .84rem; line-height: 1.55; color: var(--text-muted); min-width: 34rem; }
.mt-table .mt-title { font-family: sans-serif; font-size: .82rem; font-weight: 600;
  color: var(--text); margin-bottom: 6px; }
.mt-table .dash { color: var(--text-muted); }
.mt-table .mt-para { margin: 0 0 7px; }
.mt-table .mt-para:last-child { margin-bottom: 0; }
.mt-inner { border-collapse: collapse; margin: 8px 0; font-size: .78rem; width: 100%; }
.mt-inner td { border: 1px solid var(--border); padding: 4px 7px; vertical-align: top; }
.mt-inner tr:first-child td { background: var(--bg); font-weight: 600; }
.p2-case { font-size: .8rem; white-space: nowrap; }
.p2-case a { font-variant-numeric: tabular-nums; display: block; }
.p2-case .p2-case-date { display: block; color: var(--text-muted); font-size: .74rem; }
.p2-case .p2-case-len { display: inline-block; margin-top: 3px; padding: 1px 5px; border-radius: 3px;
  background: var(--blue-light); color: var(--blue-dark); font-size: .72rem; font-weight: 600; }
.p2-case .dash { color: var(--text-muted); }
.p2-dur-case { font-variant-numeric: tabular-nums; }

/* Річні звіти */
.ar-search { display: flex; gap: 8px; align-items: center; margin: 0 0 14px; font-family: sans-serif; }
.ar-search input { flex: 1; max-width: 34rem; padding: 7px 10px; font-size: .88rem;
  border: 1px solid var(--border); border-radius: 4px; }
.ar-search button { padding: 7px 14px; font-size: .85rem; }
.ar-search .ar-clear { font-size: .8rem; color: var(--text-muted); }
.ar-table .ar-year { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ar-table .ar-num { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.ar-table .ar-pub { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.ar-table .ar-title { font-family: sans-serif; font-size: .85rem; font-weight: 600; margin-bottom: 3px; }
.ar-table .ar-src { font-size: .78rem; color: var(--text-muted); }
.ar-table .dash { color: var(--text-muted); }
.ar-hits-row td { background: var(--bg); font-size: .82rem; line-height: 1.55; }
.ar-hits-head { font-family: sans-serif; font-size: .78rem; font-weight: 600; margin-bottom: 6px; }
.ar-hit { margin: 0 0 6px; color: var(--text-muted); }
.ar-hit:last-child { margin-bottom: 0; }
.ar-year-select { padding: 7px 9px; font-size: .85rem; border: 1px solid var(--border);
  border-radius: 4px; font-family: sans-serif; }
.ar-ai-hint { font-family: sans-serif; font-size: .76rem; color: var(--text-muted); margin: 8px 0 0; }
.ar-mode-select { padding: 7px 9px; font-size: .85rem; border: 1px solid var(--border);
  border-radius: 4px; font-family: sans-serif; }
.ar-mode-hint { font-family: sans-serif; font-size: .78rem; color: var(--text-muted); margin: -6px 0 12px; }
.ar-sem-head { margin-top: 10px; }
.ar-score { display: inline-block; min-width: 2.6rem; font-variant-numeric: tabular-nums;
  font-size: .72rem; color: var(--blue-dark); background: var(--blue-light);
  border-radius: 3px; padding: 0 4px; margin-right: 5px; }

/* Тендери: ознаки змов */
.tender-codes { margin-top: 10px; font-size: .84rem; }
.tender-codes-title { color: var(--text-muted); margin-bottom: 4px; }
.tender-codes-group { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 3px 0; }
.tender-codes-grp { font-weight: 600; color: var(--text-muted); min-width: 190px; }
.tender-code { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); background: #fff; cursor: pointer; white-space: nowrap; }
.tender-code.vis-pub { border-color: #86efac; }
.tender-code.vis-amcu { border-color: #d1d5db; color: #4b5563; }
.tender-code-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.tender-chip { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: .74rem; font-weight: 600; letter-spacing: .02em; }
.tender-chip.vis-pub { background: #dcfce7; color: #15803d; }
.tender-chip.vis-amcu { background: #f3f4f6; color: #4b5563; }
.tender-chip.vis-none { background: #fff; color: #9ca3af; border: 1px dashed #d1d5db; font-weight: 400; }
.tender-dash { background: var(--bg-card, #f8fafc); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin: 14px 0 22px; }
.tender-dash > summary { cursor: pointer; font-weight: 600; color: var(--blue-dark); margin-bottom: 10px; }
.tender-charts { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 14px; align-items: start; }
.tender-charts-col { display: flex; flex-direction: column; gap: 14px; }
.tender-chart-tall { height: 720px; display: flex; flex-direction: column; }
.tender-chart-tall canvas { flex: 1; }
.tender-grp { font-size: .95rem; margin: 18px 0 6px; color: var(--blue-dark); }
.tender-ind { margin: 6px 0 12px; }
.tender-ind-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tender-ind-link { font-size: .78rem; color: var(--text-muted); margin-left: auto; }
.tender-quote { margin: 6px 0 0 8px; padding: 6px 12px; border-left: 3px solid #c7d2fe; color: #374151; font-size: .92rem; background: #fff; }
@media (max-width: 1000px) { .tender-charts { grid-template-columns: 1fr; } .tender-chart-tall { height: 640px; } .tender-codes-grp { min-width: 100%; } }
