/* Afina design system — single stylesheet for the whole application.
   Tokens first, then shell, shared components, and one section per page. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eceef2;
  --border: #e4e7ec;
  --border-strong: #d2d6de;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #8a919e;
  --accent: #3d5afe;
  --accent-hover: #2f4ae6;
  --accent-soft: #eef1ff;
  --accent-text: #2f47d6;
  --on-accent: #ffffff;
  --pos: #12a150;
  --pos-soft: #e7f6ee;
  --neu: #e0a106;
  --neu-soft: #fdf5e1;
  --neg: #e5484d;
  --neg-soft: #fdecec;
  --tg: #229ed9;
  --ig: #d6336c;
  --site: #6366f1;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .16);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-w: 248px;
  --header-h: 60px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .3, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1015;
  --surface: #151920;
  --surface-2: #1a1f27;
  --surface-3: #222833;
  --border: #252b35;
  --border-strong: #323a46;
  --text: #e9ecf1;
  --text-2: #a9b1bd;
  --text-3: #6e7785;
  --accent: #7088ff;
  --accent-hover: #8599ff;
  --accent-soft: rgba(112, 136, 255, .14);
  --accent-text: #9aabff;
  --on-accent: #0d1015;
  --pos: #3ccf83;
  --pos-soft: rgba(60, 207, 131, .13);
  --neu: #f5b83d;
  --neu-soft: rgba(245, 184, 61, .13);
  --neg: #ff6b6f;
  --neg-soft: rgba(255, 107, 111, .13);
  --tg: #3cb2ea;
  --ig: #f0679a;
  --site: #8b8ef8;
  --shadow-sm: none;
  --shadow: 0 0 0 1px rgba(0, 0, 0, .1);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.01em; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }
svg.icon, .icon { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-2); }
.text-center { text-align: center; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--accent); color: var(--on-accent); border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 12px; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

.boot { display: grid; place-items: center; min-height: 100vh; color: var(--text-3); font-weight: 500; }

/* ---------- Buttons & inputs ---------- */
.btn, .cm-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 10px; font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s; text-decoration: none !important;
}
.btn .icon { width: 17px; height: 17px; }
.btn.primary, .btn-primary, .cm-primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover, .btn-primary:hover, .cm-primary:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn.secondary.active, .btn.secondary[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.icon-btn, .header-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-2); transition: background .15s, color .15s;
}
.icon-btn:hover, .header-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.header-btn .icon { width: 19px; height: 19px; }
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; }

:where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, .form-control, .form-select) {
  height: 38px; width: 100%; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--text-3); }
:where(input, select):focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
:where(select, .form-select) {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat;
}
input[type=date] { min-width: 0; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field, .cm-fields label, .legacy-options label { display: grid; gap: 6px; }

/* Search line used on feed, comments and sources */
.search-line, .sp-search-wrap, .feed-source-search {
  position: relative; display: flex; align-items: center; gap: 8px;
}
.search-line > .icon, .sp-search-wrap > .icon, .feed-source-search > .icon {
  position: absolute; left: 13px; color: var(--text-3); pointer-events: none; width: 17px; height: 17px;
}
.search-line input, .sp-search-wrap input, .feed-source-search input { padding-left: 40px; }
.search-line input { height: 44px; border-radius: 12px; font-size: 15px; box-shadow: var(--shadow-sm); }
.search-line .btn { height: 44px; padding: 0 20px; border-radius: 12px; }

/* ---------- Login ---------- */
.login-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); min-height: 100vh; }
.login-intro {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px 56px; overflow: hidden;
  background: radial-gradient(120% 90% at 0% 0%, #2a3fd4 0%, #1a237e 45%, #0b1030 100%); color: #fff;
}
.login-intro .sidebar-logo { color: #fff; }
.login-intro .logo-icon { background: rgba(255, 255, 255, .16); color: #fff; }
.intro-copy { max-width: 520px; }
.intro-copy .eyebrow { color: rgba(255, 255, 255, .7); }
.intro-copy h1 { margin: 14px 0 16px; font-size: clamp(34px, 4vw, 52px); line-height: 1.08; letter-spacing: -.03em; }
.intro-copy p { color: rgba(255, 255, 255, .78); font-size: 17px; }
.intro-lines { display: grid; gap: 10px; margin-top: 44px; max-width: 360px; }
.intro-lines span { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .14); }
.intro-lines span:nth-child(2n) { width: 72%; }
.intro-lines span:nth-child(3n) { width: 48%; background: rgba(255, 255, 255, .24); }
.login-intro > .muted { color: rgba(255, 255, 255, .6); }
.login-side { position: relative; display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.theme-login { position: absolute; top: 20px; right: 20px; width: 40px; padding: 0; }
.login-card { display: grid; gap: 8px; width: min(400px, 100%); padding: 36px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.login-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 8px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 20px; }
.login-card h2 { font-size: 24px; }
.login-card > .muted { margin-bottom: 14px; }
.login-card label { margin-top: 6px; }
.login-card input { height: 44px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px; }
.password-wrap button { position: absolute; right: 4px; top: 4px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); }
.password-wrap button:hover { background: var(--surface-3); color: var(--text); }
.form-error { padding: 10px 12px; border-radius: 10px; background: var(--neg-soft); color: var(--neg); font-size: 13px; font-weight: 500; }
.login-submit { height: 46px; margin-top: 12px; font-size: 15px; }
.login-foot { margin-top: 8px; text-align: center; color: var(--text-3); font-size: 12px; }
@media (max-width: 860px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { padding: 28px 24px; min-height: auto; }
  .intro-copy h1 { font-size: 30px; }
  .intro-lines, .login-intro > .muted { display: none; }
}

/* ---------- App shell ---------- */
#app-view { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
}
.sidebar-header { display: flex; align-items: center; height: var(--header-h); padding: 0 18px; flex: none; }
.sidebar-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.logo-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 16px; }
.logo-text { display: grid; font-weight: 800; font-size: 16px; letter-spacing: -.01em; line-height: 1.15; }
.logo-text small { font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; }
.nav-label { padding: 12px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.silica-menu-item {
  position: relative; display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; margin: 1px 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-2); font-weight: 500; text-decoration: none !important; width: 100%; text-align: left; transition: background .12s, color .12s;
}
.silica-menu-item .icon { width: 19px; height: 19px; }
.silica-menu-item:hover { background: var(--surface-3); color: var(--text); }
.silica-menu-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.silica-menu-item.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.silica-menu-item.is-pending { color: var(--text-3); height: 34px; font-size: 13px; }
.silica-menu-item.is-pending .icon { width: 17px; height: 17px; opacity: .8; }
.nav-soon { margin-top: 14px; }
.nav-soon summary {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; list-style: none; cursor: pointer;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
}
.nav-soon summary::-webkit-details-marker { display: none; }
.nav-soon summary:hover { color: var(--text-2); }
.nav-soon summary .icon { margin-left: auto; transition: transform .2s; width: 14px; height: 14px; }
.nav-soon[open] summary .icon { transform: rotate(180deg); }
.nav-count { padding: 1px 7px; border-radius: 99px; background: var(--surface-3); font-size: 10px; letter-spacing: 0; }
.sidebar-footer { flex: none; padding: 12px; border-top: 1px solid var(--border); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; }
.user-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #8b5cf6); color: #fff; font-weight: 700; }
.user-meta { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.user-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 12px; color: var(--text-3); }

.main-content { margin-left: var(--sidebar-w); min-height: 100vh; outline: none; }
.main-header {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border);
}
.breadcrumb-nav { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.breadcrumb-nav a { color: var(--text-3); }
.breadcrumb-nav a:hover { color: var(--text); }
#breadcrumb { color: var(--text); font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 4px; }
.page-content { max-width: 1480px; margin: 0 auto; padding: 28px 32px 56px; }
#mobile-bar { display: none; }
#menu-backdrop { display: none; }
#ui-notice {
  position: fixed; right: 24px; bottom: 24px; z-index: 80; max-width: 380px; padding: 12px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 500; animation: toast-in .25s var(--ease);
}
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

@media (max-width: 1024px) {
  #mobile-bar {
    position: sticky; top: 0; z-index: 35; display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 16px;
    background: var(--surface); border-bottom: 1px solid var(--border);
  }
  #mobile-bar .btn { width: 40px; padding: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.show { transform: none; }
  #menu-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 39; border: 0; background: rgba(5, 8, 15, .45); }
  .main-content { margin-left: 0; }
  .main-header { top: 56px; height: 48px; padding: 0 16px; }
  .page-content { padding: 20px 16px 48px; }
}

/* ---------- Page header & shared blocks ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; }
.page-subtitle { margin-top: 4px; color: var(--text-2); }
.page-head__actions { display: flex; gap: 8px; align-items: center; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.lv-card, .section-block, .widget-card, .an-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.integration-error, .post-page-error, #post-comments-error { padding: 12px 14px; margin: 12px 0; border-radius: 12px; background: var(--neg-soft); color: var(--neg); font-weight: 500; }
.empty-state, .cm-empty, .error-state, .feed-source-empty, .post-comments-empty {
  display: grid; justify-items: center; gap: 8px; padding: 48px 24px; text-align: center; color: var(--text-2);
}
.empty-state .icon, .cm-empty .icon, .post-comments-empty .icon { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--surface-3); color: var(--text-3); box-sizing: content-box; }
.empty-state h3, .cm-empty h3 { color: var(--text); font-size: 16px; margin-top: 6px; }
.not-connected h1 { margin-bottom: 20px; font-size: 26px; }
.not-connected .lv-card { display: grid; justify-items: center; gap: 10px; padding: 56px 24px; text-align: center; }
.not-connected .lv-card > .icon { width: 44px; height: 44px; padding: 10px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); box-sizing: content-box; }
.not-connected .lv-card p { max-width: 460px; }
.not-connected .btn { margin-top: 8px; }

/* Active filter chips */
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.filter-chip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 4px 0 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 600; max-width: 100%; }
.filter-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; }
.filter-chip button:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.filter-chip .icon { width: 13px; height: 13px; }
.filter-chips-clear { border: 0; background: none; color: var(--text-2); font-size: 13px; font-weight: 600; padding: 4px 6px; }
.filter-chips-clear:hover { color: var(--text); text-decoration: underline; }

/* Skeleton loading */
.skeleton-list { display: grid; gap: 12px; }
.skeleton-item { display: grid; gap: 10px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.skeleton-sources { gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.skeleton-sources .skeleton-item { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 16px 20px; }
.skeleton-item span { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
.skeleton-item span:nth-child(1) { width: 30%; }
.skeleton-item span:nth-child(2) { width: 85%; height: 16px; }
.skeleton-item span:nth-child(3) { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 24px 0 8px; }
.pagination:not([hidden]) { display: flex; }
.pager-pages { display: flex; align-items: center; gap: 4px; }
.pager-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 38px; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; transition: background .15s, border-color .15s, color .15s; }
button.pager-btn:not(:disabled):hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.pager-btn.is-current { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.pager-btn:disabled { opacity: .4; }
.pager-btn .icon { width: 16px; height: 16px; }
.pager-flip { display: inline-grid; transform: rotate(180deg); }
.pager-step { padding: 0 14px; }
.pager-gap { min-width: 20px; text-align: center; color: var(--text-3); }
@media (max-width: 560px) { .pager-step span:not(.pager-flip) { display: none; } .pager-step { padding: 0; } }
.record-summary { margin-top: 12px; color: var(--text-3); font-size: 13px; }

/* Platform colours */
.platform-telegram { --pf: var(--tg); }
.platform-instagram { --pf: var(--ig); }
.platform-site, .platform-vk, .platform-ok, .platform-max { --pf: var(--site); }
.platform-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.platform-tag .icon { width: 15px; height: 15px; }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.active { background: var(--pos-soft); color: var(--pos); }
.badge.paused { background: var(--neu-soft); color: var(--neu); }
.badge.disabled { background: var(--surface-3); color: var(--text-3); }

/* ---------- Sources ---------- */
.sp-toolbar { margin-bottom: 16px; }
.sp-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.sp-search-wrap { flex: 1 1 280px; }
.sp-controls select { width: auto; min-width: 170px; }
.sp-controls .btn { width: 38px; padding: 0; }
.sp-tabs { margin-bottom: 16px; }
.nav-tabs { display: inline-flex; gap: 2px; padding: 3px; margin: 0; list-style: none; border-radius: 12px; background: var(--surface-3); }
.nav-link, .segmented button {
  height: 32px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; transition: background .15s, color .15s;
}
.nav-link:hover, .segmented button:hover { color: var(--text); }
.nav-link, .segmented button, .cm-platforms button { white-space: nowrap; }
.nav-link.active, .segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.sp-list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.sp-list-header, .sp-row { display: grid; grid-template-columns: minmax(240px, 2.4fr) 1fr 1fr 1fr 120px; align-items: center; gap: 16px; padding: 0 20px; }
.sp-list-header { height: 42px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.sp-list-card #results > .skeleton-sources { border: 0; border-radius: 0; }
.sp-row { min-height: 64px; border-bottom: 1px solid var(--border); transition: background .12s; }
.sp-row:last-child { border-bottom: 0; }
.sp-row:hover { background: var(--surface-2); }
.sp-row-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sp-row-type { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: color-mix(in srgb, var(--pf, var(--site)) 14%, transparent); color: var(--pf, var(--site)); }
.sp-row-info { min-width: 0; }
.sp-row-name { display: block; max-width: 100%; padding: 0; border: 0; background: none; color: var(--text); font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-row-name:hover { color: var(--accent-text); }
.sp-row-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-col { color: var(--text-2); font-size: 13px; }
.sp-col-right { text-align: right; }
.sp-row-date { color: var(--text-3); font-variant-numeric: tabular-nums; }
.sp-list-card .empty-state { border: 0; }
@media (max-width: 860px) {
  .sp-list-header { display: none; }
  .sp-row { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 16px; }
  .sp-row-main { grid-column: 1 / -1; }
  .sp-col[data-label] { display: none; }
  .sp-row-date { text-align: right; }
}

/* ---------- Feed ---------- */
.news-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.news-main { min-width: 0; }
.search-toolbar { margin-bottom: 16px; }
.view-toggle { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-3); }
.view-toggle .btn { width: 34px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; box-shadow: none; color: var(--text-3); }
.view-toggle .btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.filters-toggle { display: none; }
.news-container { display: grid; gap: 12px; }
.news-container.grid-view { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.news-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.news-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.news-card__overlay { position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.news-card a:not(.news-card__overlay) { position: relative; z-index: 1; }
.news-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.news-card__source { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; color: var(--text); }
.news-card__source-icon { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 8px; background: color-mix(in srgb, var(--pf, var(--site)) 14%, transparent); color: var(--pf, var(--site)); }
.news-card__source-icon .icon { width: 15px; height: 15px; }
.news-card__source-handle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-card__date { flex: none; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.news-card__title { font-size: 17px; line-height: 1.35; font-weight: 700; }
.news-card__title a { color: var(--text); }
.news-card__title a:hover { color: var(--accent-text); text-decoration: none; }
.news-card__text { color: var(--text-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.news-card__text--lead { color: var(--text); font-size: 15px; -webkit-line-clamp: 4; }
.news-card__text--lead a { color: inherit; text-decoration: none; }
.news-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.news-card__link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--accent-text); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.news-card__link .icon { width: 15px; height: 15px; }
.news-card:hover .news-card__link, .news-card:focus-within .news-card__link { opacity: 1; transform: none; }
.grid-view .news-card__text { -webkit-line-clamp: 5; }

/* Feed filter rail */
.feed-sidebar {
  position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 0; max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.feed-filter-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.feed-filter-header h2 { font-size: 15px; }
.feed-filter-reset { margin-left: auto; border: 0; background: none; color: var(--accent-text); font-size: 13px; font-weight: 600; }
.feed-filter-close { display: none; }
.feed-sidebar > details, .feed-platform-section { border-bottom: 1px solid var(--border); }
.feed-sidebar > details:last-child { border-bottom: 0; }
.feed-sidebar summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 600; cursor: pointer; list-style: none; }
.feed-sidebar summary::-webkit-details-marker { display: none; }
.feed-sidebar summary::after { content: ""; width: 7px; height: 7px; margin: -3px 4px 0 auto; border: solid var(--text-3); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); transition: transform .2s; }
.feed-sidebar details[open] > summary::after { transform: translateY(3px) rotate(225deg); }
.feed-sidebar summary .icon { color: var(--text-3); width: 17px; height: 17px; }
.feed-filter-applied { padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 700; }
.sidebar-section, #feed-rubrics, .feed-source-tools, #feed-sources, .feed-source-count { padding: 0 16px; }
.sidebar-section { display: grid; gap: 10px; padding-bottom: 16px; }
.period-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.period-options button, .feed-platform-options button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; transition: all .12s;
}
.period-options button:hover, .feed-platform-options button:hover { border-color: var(--border-strong); color: var(--text); }
.feed-platform-options button.active { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.feed-platform-options .icon { width: 15px; height: 15px; }
.feed-range-trigger { display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 500; }
.feed-range-trigger .icon { width: 16px; height: 16px; color: var(--text-3); }
.feed-range-trigger > .icon:last-child { margin-left: auto; width: 15px; height: 15px; }
.feed-platform-section { padding: 14px 16px 16px; }
.feed-platform-section h3 { margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.feed-platform-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#feed-rubrics { display: grid; gap: 2px; padding-bottom: 12px; }
.feed-rubric-option, .feed-source-option {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); font-size: 13px; font-weight: 500; text-align: left;
}
.feed-rubric-option:hover, .feed-source-option:hover { background: var(--surface-3); color: var(--text); }
.feed-rubric-option.active, .feed-source-option.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.feed-rubric-option .icon { width: 16px; height: 16px; color: var(--text-3); }
.feed-rubric-option.active .icon { color: inherit; }
.feed-rubric-option > .icon:last-child:not(:first-child), .feed-source-option > .icon:last-child { margin-left: auto; width: 15px; height: 15px; color: var(--accent-text); }
.feed-source-tools { display: grid; gap: 8px; }
.feed-source-search input { height: 36px; }
.feed-source-all { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; }
.feed-source-all.active { background: var(--accent-soft); color: var(--accent-text); }
.feed-source-all .icon { width: 15px; height: 15px; }
#feed-sources { display: grid; gap: 1px; max-height: 340px; overflow-y: auto; margin-top: 4px; }
.feed-source-logo { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 6px; background: var(--surface-3); color: var(--text-3); }
.feed-source-logo .icon { width: 13px; height: 13px; }
.feed-source-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-source-count { padding-top: 8px; padding-bottom: 14px; color: var(--text-3); font-size: 12px; }
.feed-source-empty { padding: 20px 8px; }
.feed-source-empty button { border: 0; background: none; color: var(--accent-text); font-weight: 600; }
.sidebar-note { padding: 4px 0 14px; color: var(--text-3); font-size: 13px; }

@media (max-width: 1180px) {
  .news-layout { grid-template-columns: minmax(0, 1fr); }
  .filters-toggle { display: inline-flex; }
  .feed-sidebar { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(360px, 92vw); max-height: none; border-radius: 0; border-width: 0 0 0 1px; transform: translateX(105%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
  .filters-open .feed-sidebar { transform: none; }
  .filters-open::after { content: ""; position: fixed; inset: 0; z-index: 55; background: rgba(5, 8, 15, .4); }
  .feed-filter-close { display: inline-grid; }
}

/* Calendar dialog */
dialog { padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(5, 8, 15, .5); }
dialog[open] { animation: dialog-in .2s var(--ease); }
@keyframes dialog-in { from { transform: translateY(8px) scale(.98); opacity: 0; } }
#feed-range-dialog { width: 360px; }
.feed-calendar-header { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 8px; }
.feed-calendar-header h2 { font-size: 17px; }
.feed-calendar-header p { margin-top: 2px; color: var(--text-3); font-size: 13px; }
.feed-calendar-header button, .feed-calendar-month button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); }
.feed-calendar-header button:hover, .feed-calendar-month button:hover { background: var(--surface-3); }
#feed-calendar { padding: 4px 16px 0; }
.feed-calendar-month { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.feed-calendar-month strong { text-transform: capitalize; }
.feed-calendar-week, .feed-calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.feed-calendar-week span { padding: 6px 0; font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; }
.feed-calendar-days button { height: 38px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.feed-calendar-days button:hover { background: var(--surface-3); }
.feed-calendar-days .range-today { box-shadow: inset 0 0 0 1px var(--border-strong); }
.feed-calendar-days .range-inside { background: var(--accent-soft); color: var(--accent-text); border-radius: 0; }
.feed-calendar-days .range-edge { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.feed-calendar-selection { padding: 12px 4px 4px; text-align: center; color: var(--text-2); font-size: 13px; }
.feed-calendar-footer { display: flex; justify-content: space-between; gap: 8px; padding: 14px 16px 16px; }
.feed-calendar-footer button { height: 38px; padding: 0 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-weight: 600; }
.feed-calendar-footer .feed-calendar-apply { background: var(--accent); border-color: transparent; color: var(--on-accent); }

/* ---------- Comments ---------- */
.cm-search { display: grid; gap: 12px; margin-bottom: 16px; }
.cm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cm-platforms { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-3); flex-wrap: wrap; }
.cm-platforms button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; }
.cm-platforms button .icon { width: 15px; height: 15px; }
.cm-platforms button.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.cm-reset { border: 0; background: none; color: var(--text-2); font-size: 13px; font-weight: 600; }
.cm-reset:hover { color: var(--text); }
.cm-advanced { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.cm-advanced summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 600; font-size: 13px; color: var(--text-2); cursor: pointer; list-style: none; }
.cm-advanced summary::-webkit-details-marker { display: none; }
.cm-advanced summary .icon { width: 16px; height: 16px; }
.cm-advanced summary > .icon:last-child { margin-left: auto; width: 15px; height: 15px; transition: transform .2s; }
.cm-advanced[open] summary > .icon:last-child { transform: rotate(180deg); }
.cm-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 4px 14px 14px; align-items: end; }
.cm-apply { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-3); font-size: 12px; }
.cm-results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 12px; }
.cm-results-head h2 { font-size: 16px; }
.cm-results-head h2 span { margin-left: 6px; color: var(--text-3); font-weight: 500; font-size: 13px; }
.cm-results-head > span { color: var(--text-3); font-size: 13px; }
.cm-feed { display: grid; gap: 10px; }
.cm-comment { display: flex; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.cm-avatar, .post-comment-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--surface-3); color: var(--text-3); }
.cm-avatar .icon, .post-comment-avatar .icon { width: 17px; height: 17px; }
.cm-comment-body { display: grid; gap: 6px; min-width: 0; flex: 1; }
.cm-comment-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cm-author { padding: 0; border: 0; background: none; color: var(--text); font-weight: 600; font-size: 13px; }
.cm-author:hover { color: var(--accent-text); }
.cm-comment-head time { color: var(--text-3); font-size: 12px; }
.cm-text { color: var(--text); line-height: 1.6; cursor: pointer; white-space: pre-line; overflow-wrap: anywhere; }
.cm-context { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; margin-top: 4px; border-top: 1px dashed var(--border); font-size: 12px; }
.cm-source { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; min-width: 0; }
.cm-source-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: color-mix(in srgb, var(--pf, var(--site)) 14%, transparent); color: var(--pf, var(--site)); }
.cm-source-icon .icon { width: 13px; height: 13px; }
.cm-post-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--accent-text); font-weight: 600; font-size: 12px; white-space: nowrap; }
.cm-post-link .icon { width: 14px; height: 14px; }
.cm-page .empty-state, .cm-empty { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
@media (max-width: 760px) { .cm-fields { grid-template-columns: 1fr; } }

/* ---------- Post page ---------- */
.post-page { max-width: 1200px; margin: 0 auto; }
.post-page-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.post-page-back .icon { width: 16px; height: 16px; transform: rotate(180deg); }
.post-page-back:hover { color: var(--text); text-decoration: none; }
.post-page-header { margin-bottom: 24px; }
.post-page-eyebrow { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--text-3); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.post-page-eyebrow .icon { width: 15px; height: 15px; }
.post-page-header h1 { max-width: 900px; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.25; letter-spacing: -.02em; outline: none; }
.post-page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; color: var(--text-2); font-size: 13px; }
.post-page-source, .post-page-meta time { display: inline-flex; align-items: center; gap: 6px; }
.post-page-meta .icon { width: 15px; height: 15px; color: var(--text-3); }
.post-page-source a { color: var(--text); font-weight: 600; }
.post-meta-separator { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }
.post-page-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.post-page-main { display: grid; gap: 20px; min-width: 0; }
.post-reading { padding: 28px 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.post-reading-label, .post-source-panel-label { margin-bottom: 14px; color: var(--text-3); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.post-page-text { max-width: 72ch; font-size: 16px; line-height: 1.75; white-space: pre-line; overflow-wrap: anywhere; }
.post-page-loading { padding: 32px; color: var(--text-3); }
.post-source-panel { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.post-source-panel-label { margin-bottom: 0; }
.post-source-identity { display: flex; align-items: center; gap: 12px; }
.post-source-logo { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }
.post-source-identity > div { display: grid; min-width: 0; }
.post-source-identity a { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.post-source-identity span { color: var(--text-3); font-size: 12px; }
.post-source-facts { display: grid; gap: 10px; margin: 0; padding: 14px 0; border-block: 1px solid var(--border); }
.post-source-facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.post-source-facts dt { color: var(--text-3); }
.post-source-facts dd { margin: 0; font-weight: 600; text-align: right; }
.post-action-primary { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.post-action-primary:hover { background: var(--accent-hover); text-decoration: none; }
.post-action-secondary { display: block; padding: 10px; border-radius: 10px; background: var(--surface-2); color: var(--text-3); text-align: center; font-size: 13px; }
.post-comments { padding: 24px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.post-comments-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.post-comments-title { display: flex; align-items: center; gap: 12px; }
.post-comments-symbol { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.post-comments-title h2 { font-size: 17px; }
.post-comments-title p { color: var(--text-3); font-size: 12px; }
.post-comments-tools { display: flex; align-items: center; gap: 14px; color: var(--text-3); font-size: 13px; }
.post-comments-all { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; }
.post-comments-all .icon { width: 15px; height: 15px; }
.post-comment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.post-comment:last-child { border-bottom: 0; }
.post-comment-content { display: grid; gap: 4px; min-width: 0; }
.post-comment-content header { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.post-comment-content time { color: var(--text-3); font-size: 12px; }
.post-comment-text { line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.post-comments-more { width: 100%; margin-top: 12px; }
@media (max-width: 960px) {
  .post-page-layout { grid-template-columns: 1fr; }
  .post-source-panel { position: static; order: -1; }
  .post-reading, .post-comments { padding: 20px; }
}

/* ---------- Detail dialog ---------- */
#detail { width: min(640px, calc(100vw - 32px)); max-height: min(86vh, 900px); }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.dialog-head h2 { margin-top: 4px; font-size: 19px; line-height: 1.3; }
.dialog-head .btn { width: 36px; height: 36px; padding: 0; flex: none; }
#detail-body { display: grid; gap: 16px; padding: 20px 24px 24px; }
.detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.detail-meta > div { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.detail-meta dt { margin-bottom: 4px; color: var(--text-3); font-size: 12px; }
.detail-meta dd { margin: 0; font-weight: 600; }
.detail-meta dd small { margin-left: 6px; color: var(--text-3); font-weight: 500; }
.detail-heading-inline { font-size: 17px; }
.detail-text, .legacy-report-text { line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.detail-note, .dialog-loading { color: var(--text-3); font-size: 12px; }

/* ---------- Analytics dashboard ---------- */
.legacy-dashboard { display: grid; gap: 20px; }
.dashboard-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.greeting-title { font-size: 26px; letter-spacing: -.02em; }
.greeting-subtitle { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--text-2); }
.live-time { padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; }
.greeting-divider { color: var(--text-3); }
.dashboard-filters { display: flex; align-items: center; gap: 10px; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-3); }
.legacy-dashboard > .filter-chips { margin: -8px 0 0; }
#legacy-results { display: grid; gap: 20px; }
.legacy-loading { padding: 48px; text-align: center; color: var(--text-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.legacy-loading h2 { color: var(--text); font-size: 17px; margin-bottom: 6px; }
.legacy-loading .btn { margin-top: 14px; }
.legacy-empty-period { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-radius: var(--radius-lg); background: var(--neu-soft); }
.legacy-empty-period p { margin-top: 4px; color: var(--text-2); font-size: 13px; }

.greeting-chips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.gchip {
  display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: var(--text); text-decoration: none !important; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.gchip:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.gchip__ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 11px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); font-size: 18px; }
.gchip__ic .icon { width: 19px; height: 19px; }
.gchip--violet { --c: var(--accent); }
.gchip--cyan { --c: #0ea5b7; }
.gchip--amber { --c: var(--neu); }
.gchip--tg { --c: var(--tg); }
.gchip--ig { --c: var(--ig); }
.gchip--site { --c: var(--site); }
.gchip__body { display: grid; min-width: 0; }
.gchip__value { font-size: 21px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.gchip__sub { font-size: 13px; font-weight: 600; color: var(--text-3); }
.gchip__label { color: var(--text-3); font-size: 12px; font-weight: 600; }
.legacy-period-note { margin-top: -8px; color: var(--text-3); font-size: 12px; }

.chart-sources-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr); gap: 20px; }
.comparison-chart-card { display: grid; gap: 16px; height: 100%; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.combined-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.combined-metric { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text); text-decoration: none !important; transition: background .15s; }
.combined-metric:hover { background: var(--surface-3); }
.combined-metric-label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.combined-metric-dot { width: 10px; height: 10px; border-radius: 3px; }
.legacy-tone-positive { background: var(--pos); }
.legacy-tone-neutral { background: var(--neu); }
.legacy-tone-negative { background: var(--neg); }
.combined-metric-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.combined-metric-value { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.comparison-badge { display: inline-flex; align-items: center; gap: 2px; padding: 2px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge-success { background: var(--pos-soft); color: var(--pos); }
.badge-danger { background: var(--neg-soft); color: var(--neg); }
.legacy-neutral-badge { background: var(--surface-3); color: var(--text-2); }
.comparison-chart-container { position: relative; height: 300px; }
.legacy-chart-note, .legacy-snapshot-note { color: var(--text-3); font-size: 12px; }

.section-block { padding: 20px; min-width: 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.section-title .section-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); }
.section-title .section-icon .icon, .widget-icon .icon { width: 17px; height: 17px; }
.section-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--accent-text); font-size: 13px; font-weight: 600; white-space: nowrap; }
.section-link .icon { width: 14px; height: 14px; }
.table-container { overflow-x: auto; }
.analytics-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.analytics-table th { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; text-align: left; }
.analytics-table td { padding: 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.analytics-table tr:last-child td { border-bottom: 0; }
.analytics-table .text-center { text-align: center; }
.analytics-table td .icon { width: 16px; height: 16px; color: var(--text-3); vertical-align: middle; }
.analytics-table td:last-child { font-weight: 700; }
.org-name { color: var(--text); font-weight: 600; }

.dynamic-widgets-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.widget-card { display: flex; flex-direction: column; min-width: 0; padding: 20px; }
.widget-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.widget-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; }
.widget-icon-pulse { background: var(--pos-soft); color: var(--pos); }
.widget-icon-warning { background: var(--neu-soft); color: var(--neu); }
.widget-icon-info { background: var(--accent-soft); color: var(--accent-text); }
.widget-title { font-size: 16px; }
.widget-badge, .monitoring-source-count { margin-left: auto; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; }
.activity-live-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 0 4px var(--pos-soft); }
.widget-body { display: flex; flex-direction: column; flex: 1; }
.activity-feed, .deadline-list { display: grid; gap: 2px; }
.monitoring-row, .deadline-item, .activity-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: transparent;
  color: var(--text); text-align: left; text-decoration: none !important; transition: background .12s;
}
.monitoring-row:hover, .deadline-item:hover, .activity-item:hover { background: var(--surface-2); }
.monitoring-source-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--surface-3); color: var(--text-2); }
.monitoring-telegram { background: color-mix(in srgb, var(--tg) 14%, transparent); color: var(--tg); }
.monitoring-instagram { background: color-mix(in srgb, var(--ig) 14%, transparent); color: var(--ig); }
.monitoring-site { background: color-mix(in srgb, var(--site) 14%, transparent); color: var(--site); }
.monitoring-source-icon .icon { width: 15px; height: 15px; }
.activity-content { display: grid; min-width: 0; flex: 1; }
.activity-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; font-size: 13px; }
.activity-meta { display: flex; gap: 8px; color: var(--text-3); font-size: 12px; }
.monitoring-post-count { display: grid; justify-items: end; line-height: 1.15; }
.monitoring-post-count strong { font-variant-numeric: tabular-nums; }
.monitoring-post-count span { color: var(--text-3); font-size: 11px; }
.monitoring-arrow { display: grid; color: var(--text-3); }
.monitoring-arrow .icon { width: 15px; height: 15px; }
.monitoring-all .icon, .section-link .icon, .news-card__link .icon { width: 15px; height: 15px; }
.comparison-badge .icon { width: 12px; height: 12px; }
.activity-icon .icon { width: 14px; height: 14px; }
.news-panel-header__icon .icon { width: 16px; height: 16px; }
.monitoring-all { display: inline-flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 12px; font-size: 13px; font-weight: 600; }
.deadline-info { display: grid; min-width: 0; }
.deadline-title { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deadline-project { color: var(--text-3); font-size: 12px; }
.activity-icon { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--pos-soft); color: var(--pos); font-size: 13px; }

.projects-analytics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.project-analytics-card { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); text-decoration: none !important; transition: border-color .15s, background .15s; }
.project-analytics-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.project-header { display: flex; align-items: center; gap: 10px; min-width: 0; }
.project-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; font-size: 12px; font-weight: 800; background: color-mix(in srgb, var(--c, var(--accent)) 15%, transparent); color: var(--c, var(--accent)); }
.legacy-palette-0 { --c: #4f6bed; } .legacy-palette-1 { --c: #0ea5b7; } .legacy-palette-2 { --c: #8b5cf6; } .legacy-palette-3 { --c: #e0a106; }
.legacy-palette-4 { --c: #e5484d; } .legacy-palette-5 { --c: #12a150; } .legacy-palette-6 { --c: #d6336c; } .legacy-palette-7 { --c: #64748b; }
.project-info { display: grid; min-width: 0; }
.project-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-code { color: var(--text-3); font-size: 12px; }
.project-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.project-stat { display: grid; gap: 2px; }
.project-stat-value { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.project-stat-label { color: var(--text-3); font-size: 11px; }
.legacy-text-positive { color: var(--pos); } .legacy-text-neutral { color: var(--neu); } .legacy-text-negative { color: var(--neg); }

/* District map */
.regional-map-embed { min-width: 0; }
.map-page { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 20px; }
.map-body { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; min-height: 420px; }
.region-list { max-height: 460px; overflow-y: auto; padding-right: 4px; }
.region-list__group { position: sticky; top: 0; padding: 8px 8px 6px; background: var(--surface); color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.region-list__item { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 13px; text-align: left; }
.region-list__item:hover { background: var(--surface-2); color: var(--text); }
.region-list__item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.region-list__dot { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.region-list__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legacy-region-pct { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.map-right { display: grid; grid-template-rows: 1fr auto; gap: 12px; min-width: 0; }
.map-svg-wrapper { display: grid; place-items: center; min-height: 0; }
#active-map { width: 100%; max-height: 440px; }
#active-map path, #active-map circle { stroke: var(--surface); stroke-width: .6; cursor: pointer; transition: opacity .15s, stroke-width .15s; outline: none; }
#active-map path:hover, #active-map path:focus-visible, #active-map path.selected { stroke: var(--text); stroke-width: 1.1; }
#active-map .city_svg { stroke: var(--surface); stroke-width: 1.2; }
#active-map .city_svg:hover, #active-map .city_svg.selected { stroke: var(--text); }
.heat-scale { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12px; }
.heat-scale__bar { flex: 1; height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--h0), var(--h5), var(--h10)); }
.news-panel { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.news-panel-header { display: grid; gap: 10px; padding: 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.panel-top-row h2 { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.news-panel-header__icon { color: var(--accent-text); }
.news-panel-header__cat-filters { display: flex; gap: 6px; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--text-3); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cat-chip .icon { width: 14px; height: 14px; }
.cat-chip.is-active { color: var(--text); border-color: var(--border-strong); }
.cat-chip--tg.is-active .cat-chip__ic { color: var(--tg); }
.cat-chip--insta.is-active .cat-chip__ic { color: var(--ig); }
.cat-chip--site.is-active .cat-chip__ic { color: var(--site); }
.cat-chip__ic { display: inline-grid; }
.news-list { display: grid; gap: 8px; align-content: start; max-height: 420px; overflow-y: auto; padding: 12px; }
.news-list .news-card { gap: 6px; padding: 12px 14px; border-radius: 12px; box-shadow: none; }
.news-list .news-card__title { font-size: 14px; }
.news-list .news-card__text { font-size: 13px; -webkit-line-clamp: 2; }
.news-list .news-card__link { opacity: 1; transform: none; }
.legacy-map-all { display: inline-flex; align-items: center; gap: 4px; padding: 4px 2px; font-size: 13px; font-weight: 600; }
.legacy-map-all .icon { width: 14px; height: 14px; }
#legacy-map-dialog { width: min(1280px, calc(100vw - 32px)); }
#legacy-full-map-body { padding: 20px; }
.legacy-filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.legacy-filter-heading h2 { font-size: 18px; }
.legacy-filter-heading .btn { width: 36px; padding: 0; }
#legacy-filter-dialog { width: min(480px, calc(100vw - 32px)); }
.legacy-options { padding: 20px; }
#legacy-options-form { display: grid; gap: 14px; }
#legacy-options-form > .btn { width: 100%; }

/* Heat palette: share of negative publications, 0–100% in 10% steps */
:root { --h0: #2fbf71; --h1: #52c46a; --h2: #76c862; --h3: #9acb5a; --h4: #bfcc52; --h5: #e0c34a; --h6: #eaa944; --h7: #ef8f43; --h8: #ef7444; --h9: #ea5b47; --h10: #e2434b; --h-empty: var(--surface-3); }
#active-map [data-heat="0"] { fill: var(--h0); } #active-map [data-heat="1"] { fill: var(--h1); } #active-map [data-heat="2"] { fill: var(--h2); }
#active-map [data-heat="3"] { fill: var(--h3); } #active-map [data-heat="4"] { fill: var(--h4); } #active-map [data-heat="5"] { fill: var(--h5); }
#active-map [data-heat="6"] { fill: var(--h6); } #active-map [data-heat="7"] { fill: var(--h7); } #active-map [data-heat="8"] { fill: var(--h8); }
#active-map [data-heat="9"] { fill: var(--h9); } #active-map [data-heat="10"] { fill: var(--h10); } #active-map [data-heat="empty"] { fill: var(--h-empty); }
.heat-0 { background: var(--h0); } .heat-1 { background: var(--h1); } .heat-2 { background: var(--h2); } .heat-3 { background: var(--h3); }
.heat-4 { background: var(--h4); } .heat-5 { background: var(--h5); } .heat-6 { background: var(--h6); } .heat-7 { background: var(--h7); }
.heat-8 { background: var(--h8); } .heat-9 { background: var(--h9); } .heat-10 { background: var(--h10); } .heat-empty { background: var(--h-empty); }
.heat-text-0, .heat-text-1, .heat-text-2, .heat-text-3 { color: var(--pos); }
.heat-text-4, .heat-text-5, .heat-text-6 { color: var(--neu); }
.heat-text-7, .heat-text-8, .heat-text-9, .heat-text-10 { color: var(--neg); }
.heat-text-empty { color: var(--text-3); }

/* Leaderboards */
.legacy-leaderboards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.legacy-leaderboards .section-header { margin-bottom: 4px; }
.legacy-leaderboards .legacy-snapshot-note { margin-bottom: 10px; }
.users-leaderboard { display: grid; gap: 2px; }
.legacy-person-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; }
.legacy-person-row:hover { background: var(--surface-2); }
.leaderboard-rank { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--surface-3); color: var(--text-2); font-weight: 800; font-size: 13px; }
.rank-1 { background: #fdf0c8; color: #a16207; } .rank-2 { background: #eceff3; color: #475569; } .rank-3 { background: #fbe4d5; color: #b45309; }
:root[data-theme="dark"] .rank-1 { background: rgba(250, 204, 21, .16); color: #facc15; }
:root[data-theme="dark"] .rank-2 { background: rgba(203, 213, 225, .14); color: #cbd5e1; }
:root[data-theme="dark"] .rank-3 { background: rgba(251, 146, 60, .16); color: #fb923c; }
.legacy-person-body { display: grid; gap: 6px; min-width: 0; flex: 1; }
.legacy-person-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legacy-person-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.legacy-person-stat { display: grid; line-height: 1.2; }
.legacy-person-stat strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.legacy-person-stat small { color: var(--text-3); font-size: 11px; }

details.legacy-data { padding: 0; }
details.legacy-data > summary { padding: 16px 20px; font-weight: 600; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.legacy-data > summary::-webkit-details-marker { display: none; }
details.legacy-data > summary::after { content: ""; width: 7px; height: 7px; margin: -3px 4px 0 auto; border: solid var(--text-3); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); transition: transform .2s; }
details.legacy-data[open] > summary::after { transform: translateY(3px) rotate(225deg); }
details.legacy-data > :not(summary) { margin: 0 20px 16px; }
details.legacy-data .table-container { max-height: 360px; overflow: auto; }

@media (max-width: 1400px) { .greeting-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } .projects-analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1180px) {
  .chart-sources-grid, .map-page, .legacy-leaderboards { grid-template-columns: 1fr; }
  .dynamic-widgets-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .greeting-chips { grid-template-columns: 1fr 1fr; gap: 8px; }
  .gchip { padding: 12px; gap: 10px; }
  .gchip__ic { width: 34px; height: 34px; }
  .gchip__value { font-size: 18px; }
  .combined-metrics { grid-template-columns: 1fr; }
  .dynamic-widgets-grid, .projects-analytics-grid { grid-template-columns: 1fr; }
  .map-body { grid-template-columns: 1fr; }
  .region-list { max-height: 220px; order: 2; }
  .legacy-person-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .comparison-chart-container { height: 240px; }
  .dashboard-header { align-items: stretch; }
  .dashboard-filters { width: 100%; justify-content: space-between; }
  .segmented { flex: 1; }
  .segmented button { flex: 1; padding: 0 8px; }
  .greeting-title, .page-title { font-size: 22px; }
}

/* ---------- Workspace sections ---------- */
.nav-create { display: flex; width: 100%; margin: 4px 0 6px; height: 38px; }
.nav-create .icon { width: 16px; height: 16px; }
.nav-create.active { box-shadow: 0 0 0 3px var(--accent-soft); }
.section-toolbar { display: grid; gap: 12px; margin-bottom: 16px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; }
.chip small { color: var(--text-3); font-weight: 600; font-size: 11px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.chip.is-active small { color: inherit; opacity: .75; }
.list-count { margin: 0 0 10px; color: var(--text-3); font-size: 13px; }
.list-count:empty { display: none; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; width: fit-content; }
.pill-muted { background: var(--surface-3); color: var(--text-2); }
.pill-neu { background: var(--neu-soft); color: var(--neu); }
.pill-pos { background: var(--pos-soft); color: var(--pos); }
.pill-neg { background: var(--neg-soft); color: var(--neg); }
.pill-accent { background: var(--accent-soft); color: var(--accent-text); }
.info-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--accent-soft); color: var(--text); font-size: 13px; }
.info-banner .icon { color: var(--accent-text); margin-top: 1px; }

/* Dossier */
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.person-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); text-align: left; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.person-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.person-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.person-avatar, .appeal-avatar { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); color: var(--c, var(--accent)); font-weight: 800; font-size: 16px; letter-spacing: .02em; }
.person-avatar .icon { width: 22px; height: 22px; }
.appeal-avatar { width: 38px; height: 38px; border-radius: 50%; font-size: 13px; }
.person-avatar--lg { width: 64px; height: 64px; border-radius: 18px; font-size: 21px; }
.person-avatar--lg .icon { width: 28px; height: 28px; }
.person-type { padding: 3px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.person-name { font-size: 15px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.person-role { color: var(--text-2); font-size: 13px; line-height: 1.4; min-height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.person-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.person-stats > span { display: grid; gap: 2px; }
.person-stats small { color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.person-stats strong { font-size: 18px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.person-head { display: flex; align-items: center; gap: 16px; }
.person-head > div { display: grid; gap: 4px; }
.link-list { display: flex; flex-wrap: wrap; gap: 8px; }
.link-list a { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 13px; font-weight: 600; }
.link-list a:hover { background: var(--surface-2); text-decoration: none; }
.link-list .icon { width: 15px; height: 15px; }
.link-list .icon:last-child { color: var(--text-3); width: 13px; height: 13px; }

/* Appeals */
.appeal-list { display: grid; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.appeal-row { display: flex; gap: 14px; align-items: flex-start; width: 100%; padding: 16px 20px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); text-align: left; }
.appeal-row:last-child { border-bottom: 0; }
.appeal-avatar { width: 38px; height: 38px; font-size: 13px; }
.appeal-main { display: grid; gap: 4px; min-width: 0; flex: 1; }
.appeal-head { display: flex; align-items: center; gap: 8px; }
.appeal-topic { padding: 1px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 600; }
.appeal-text { color: var(--text); line-height: 1.55; overflow-wrap: anywhere; white-space: pre-line; }
.appeal-side { display: grid; justify-items: end; gap: 6px; flex: none; color: var(--text-3); font-size: 12px; }
.appeal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.thread { display: grid; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--border); }
.bubble p { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.55; }
.bubble time { display: block; margin-top: 4px; color: var(--text-3); font-size: 11px; }
.bubble--out { justify-self: end; border-radius: 14px 14px 4px 14px; background: var(--accent-soft); border-color: transparent; }
@media (max-width: 640px) { .appeal-row { flex-wrap: wrap; } .appeal-side { grid-auto-flow: column; justify-items: start; width: 100%; padding-left: 52px; } }

/* Reports */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.report-card { display: grid; gap: 8px; align-content: start; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); text-align: left; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.report-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.report-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--neu-soft); color: var(--neu); }
.report-title { font-weight: 700; font-size: 15px; line-height: 1.35; }
.report-meta { color: var(--text-2); font-size: 13px; }
.report-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; color: var(--text-3); font-size: 12px; }
.report-open { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-weight: 600; }
.report-open .icon { width: 14px; height: 14px; }

/* Authors */
.author-head, .author-row { display: grid; grid-template-columns: minmax(240px, 2.6fr) repeat(3, minmax(80px, .7fr)) 120px; gap: 16px; align-items: center; padding: 0 20px; }
.author-head { height: 42px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.author-row { width: 100%; min-height: 64px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); text-align: left; font-variant-numeric: tabular-nums; }
.author-row:last-child { border-bottom: 0; }
.author-row:hover { background: var(--surface-2); }
@media (max-width: 860px) { .author-head { display: none; } .author-row { grid-template-columns: 1fr 1fr 1fr; padding: 14px 16px; } .author-row .sp-row-main { grid-column: 1 / -1; } .author-row .sp-row-date { display: none; } }

/* Rubric rules */
.rule-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.rule-card { display: grid; gap: 12px; align-content: start; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.rule-card header { display: flex; align-items: center; gap: 12px; }
.rule-card h2 { flex: 1; font-size: 15px; }
.rule-query { display: block; max-height: 140px; overflow: auto; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font: 12px/1.6 ui-monospace, 'SFMono-Regular', Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Maps & stories */
.greeting-chips--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.greeting-chips--3 .gchip__value { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-section { display: grid; gap: 20px; }
.map-section > .legacy-period-note { margin-top: -10px; }
.district-rank { display: grid; gap: 2px; }
.district-row { display: grid; grid-template-columns: 28px minmax(140px, 220px) 1fr 70px; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; text-decoration: none !important; }
.district-row:hover { background: var(--surface-2); }
.district-pos { color: var(--text-3); font-weight: 700; font-size: 12px; text-align: center; }
.district-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.district-bar { display: grid; gap: 4px; }
.district-volume { display: block; height: 3px; border-radius: 3px; background: var(--border-strong); }
.district-count { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.tone-bar { display: flex; height: 8px; overflow: hidden; border-radius: 8px; background: var(--surface-3); }
.tone-bar i { display: block; height: 100%; }
.tone-pos { background: var(--pos); } .tone-neu { background: var(--neu); } .tone-neg { background: var(--neg); }
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.story-card { display: grid; gap: 10px; align-content: start; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); text-decoration: none !important; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.story-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }

.story-rank { display: inline-grid; place-items: center; width: fit-content; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 800; }
.story-card--lead .story-rank { background: var(--accent); color: var(--on-accent); }
.story-card--lead .story-rank .icon { width: 16px; height: 16px; }
.story-card h2 { font-size: 17px; line-height: 1.25; }
.story-card--lead { grid-column: span 2; background: linear-gradient(160deg, var(--accent-soft), var(--surface) 65%); }
.story-card--lead h2 { font-size: 24px; }
.story-card--lead .story-count strong { font-size: 20px; }
.story-count { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.story-count strong { color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; }
.story-open { display: inline-flex; align-items: center; gap: 4px; margin-top: auto; color: var(--accent-text); font-size: 13px; font-weight: 600; }
.story-open .icon { width: 14px; height: 14px; }
.story-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.story-columns .district-row { grid-template-columns: 28px minmax(120px, 1fr) 1fr 60px; }
#results > .legacy-period-note { margin: 0 0 12px; }
@media (max-width: 1100px) { .story-grid { grid-template-columns: 1fr 1fr; } .story-columns { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .story-grid, .greeting-chips--3 { grid-template-columns: 1fr; } .story-card--lead { grid-column: auto; } .district-row { grid-template-columns: 24px 1fr 60px; } .district-bar { grid-column: 2 / -1; grid-row: 2; } }

/* Report builder */
.report-form { display: grid; grid-template-columns: 2fr repeat(4, minmax(0, 1fr)) auto; gap: 12px; align-items: end; padding: 18px; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.report-form .btn .icon { width: 16px; height: 16px; }
@media (max-width: 1180px) { .report-form { grid-template-columns: 1fr 1fr; } .report-form .field:first-child { grid-column: 1 / -1; } }
@media (max-width: 560px) { .report-form { grid-template-columns: 1fr; } }
.report-actions { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 12px; }
.report-doc { display: grid; gap: 14px; max-width: 980px; margin: 0 auto; padding: 40px 48px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.report-doc__head { display: grid; gap: 6px; padding-bottom: 16px; border-bottom: 2px solid var(--text); }
.report-doc__head h2 { font-size: 28px; letter-spacing: -.02em; }
.report-doc h3 { margin-top: 12px; font-size: 16px; }
.report-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.report-kpis > div { display: grid; gap: 2px; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.report-kpis span { color: var(--text-3); font-size: 12px; }
.report-kpis strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.report-two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .report-doc { padding: 20px; } .report-kpis, .report-two { grid-template-columns: 1fr 1fr; } }

/* Info pages */
.info-page { display: grid; justify-items: center; gap: 10px; padding: 56px 24px; text-align: center; }
.info-page p { max-width: 520px; }
.info-page__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); }
.info-page__icon .icon { width: 26px; height: 26px; }

@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f4f5f7; --text: #000; --text-2: #333; --text-3: #666; --border: #ddd; }
  .sidebar, .main-header, #mobile-bar, .page-head, .report-form, .report-actions, .skip-link, #ui-notice { display: none !important; }
  .main-content { margin: 0; } .page-content { padding: 0; max-width: none; }
  .report-doc { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .analytics-table tr { break-inside: avoid; }
}
.report-doc .analytics-table td:last-child { font-weight: 400; }
.widget-card .monitoring-row, .widget-card .deadline-item, .widget-card .activity-item { min-height: 54px; }

/* Leaderboards (persons / departments) */
.leaderboard .legacy-snapshot-note { margin: -8px 0 12px; }
.lb-table { display: grid; }
.lb-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 52px 84px 66px 50px 70px; gap: 8px; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 10px; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--text); text-align: left; font-variant-numeric: tabular-nums; transition: background .12s; }
.lb-row:not(.lb-head):hover { background: var(--surface-2); }
button.lb-row { border-radius: 0; }
.lb-head { min-height: 32px; font-size: 10px !important; border-top: 0; color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.lb-name { display: grid; min-width: 0; line-height: 1.3; }
.lb-name strong { font-weight: 600; overflow-wrap: anywhere; }
.lb-name small { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-rating { font-weight: 700; font-size: 15px; }
.lb-num { text-align: right; color: var(--text-2); }
.lb-head .lb-num { color: var(--text-3); }
@media (max-width: 1500px) and (min-width: 1181px) { .lb-row { grid-template-columns: 26px minmax(0, 1fr) 44px 72px 56px 46px 60px; gap: 6px; padding: 8px 6px; } .lb-head { letter-spacing: 0; } }
@media (max-width: 640px) { .lb-row { grid-template-columns: 30px minmax(0, 1fr) 56px 72px; } .lb-row > :nth-child(n+5) { display: none; } }

/* Telegram user profile */
a.author-row { text-decoration: none !important; }
.profile-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-card { position: sticky; top: calc(var(--header-h) + 20px); display: grid; justify-items: center; gap: 10px; padding: 28px 22px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); text-align: center; }
.profile-avatar { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: color-mix(in srgb, var(--c, var(--accent)) 18%, transparent); color: var(--c, var(--accent)); font-size: 34px; font-weight: 800; box-shadow: 0 0 0 6px color-mix(in srgb, var(--c, var(--accent)) 8%, transparent); margin-bottom: 6px; }
.profile-card h1 { font-size: 21px; line-height: 1.25; }
.profile-username { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.profile-username .icon { width: 13px; height: 13px; }
.profile-flags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.profile-bio { width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text); line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; text-align: left; }
.profile-facts { display: grid; gap: 8px; width: 100%; margin: 6px 0 0; padding-top: 14px; border-top: 1px solid var(--border); text-align: left; }
.profile-facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.profile-facts dt { color: var(--text-3); }
.profile-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }
.profile-main { display: grid; gap: 16px; min-width: 0; }
.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.profile-stats > div { display: grid; gap: 2px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.profile-stats strong { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.profile-stats span { color: var(--text-3); font-size: 12px; font-weight: 600; }
.profile-section { padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.profile-section > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.profile-section h2 { font-size: 16px; }
.profile-section .muted { font-size: 13px; }
.profile-history { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.profile-history li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }
.profile-history li:first-child { border-top: 0; }
.profile-history time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.profile-history s { color: var(--text-3); }
.profile-comment { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--border); }
.profile-comment:first-child { border-top: 0; padding-top: 0; }
.profile-comment header { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.profile-comment header time { color: var(--text-3); }
.profile-comment p { line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.profile-comment .cm-post-link { justify-self: start; }
.profile-more { width: 100%; margin-top: 12px; }
@media (max-width: 960px) { .profile-layout { grid-template-columns: 1fr; } .profile-card { position: static; } }
@media (max-width: 560px) { .profile-stats strong { font-size: 19px; } .profile-history li { grid-template-columns: 1fr; gap: 2px; } }
.profile-section > header .btn .icon { width: 16px; height: 16px; }
.report-status { margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 500; }
.report-status.is-info { background: var(--neu-soft); color: var(--text); }
.report-status.is-ok { background: var(--pos-soft); color: var(--pos); }
.report-status.is-error { background: var(--neg-soft); color: var(--neg); }

/* ---------- Legacy-parity sections ---------- */
.link-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--accent-text); font-size: 13px; font-weight: 600; }
.link-btn .icon { width: 14px; height: 14px; }
.btn.danger { color: var(--neg); }
.btn.danger:hover { background: var(--neg-soft); border-color: transparent; }
.spacer { flex: 1; }
.compact-select { width: auto; min-width: 200px; }
.is-disabled { pointer-events: none; opacity: .35; }
.sub-head { margin: 18px 0 8px; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid > header { margin-bottom: 0; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.form-grid textarea, .reply-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); resize: vertical; line-height: 1.5; outline: none; }
.form-grid textarea:focus, .reply-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.code-input { font: 13px/1.55 ui-monospace, 'SFMono-Regular', Menlo, monospace !important; }
.form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.check-field { display: flex; align-items: center; gap: 8px; min-height: 38px; font-weight: 500; color: var(--text); }
.check-field input { width: 16px; height: 16px; accent-color: var(--accent); }
.inline-controls { display: flex; gap: 8px; }
.inline-controls select { width: auto; }
@media (max-width: 760px) { .form-grid, .form-grid--3 { grid-template-columns: 1fr; } .span-2, .span-3 { grid-column: auto; } }

.tabs { display: flex; gap: 4px; margin: 20px 0 16px; border-bottom: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-2); font-weight: 600; }
.tab:hover { color: var(--text); }
.tab.is-active { border-bottom-color: var(--accent); color: var(--text); }
.topic-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

/* Markdown documents */
.md { line-height: 1.7; overflow-wrap: anywhere; }
.md > * + * { margin-top: 12px; }
.md h2 { font-size: 20px; margin-top: 24px; } .md h3 { font-size: 17px; margin-top: 20px; } .md h4, .md h5, .md h6 { font-size: 15px; margin-top: 16px; }
.md ul, .md ol { padding-left: 22px; } .md li + li { margin-top: 4px; }
.md blockquote { padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; color: var(--text-2); }
.md code { padding: 1px 6px; border-radius: 6px; background: var(--surface-3); font-size: .9em; }
.md pre { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); overflow-x: auto; }
.md pre code { padding: 0; background: none; }
.md hr { border: 0; border-top: 1px solid var(--border); }
.md-note { color: var(--text-3); font-size: 13px; font-style: italic; }
.report-doc--inline { padding: 0; border: 0; box-shadow: none; max-width: none; background: none; }

/* Mini posts (materials, stories, labels) */
.mini-post-list { display: grid; gap: 0; }
.mini-post { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--border); }
.mini-post:first-child { border-top: 0; padding-top: 0; }
.mini-post header { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--text-3); }
.mini-post h3 { font-size: 15px; line-height: 1.35; }
.mini-post h3 a { color: var(--text); }
.mini-post p { color: var(--text-2); line-height: 1.55; white-space: pre-line; }
.mini-post footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-page .mini-post-list, .story-posts .mini-post-list, #label-tab > .mini-post-list { padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }

/* Dossier page */
.person-card { text-decoration: none !important; }
.dossier-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.dossier-title h1 { font-size: 24px; letter-spacing: -.02em; }
.dossier-title p { margin-top: 4px; color: var(--text-2); }
.dossier-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dossier-meta .icon { width: 12px; height: 12px; margin-left: 4px; }
.dossier-meta a.pill { text-decoration: none; }
.dossier-kpi { display: grid; grid-template-columns: repeat(4, auto); gap: 6px 22px; text-align: right; }
.dossier-kpi div { display: grid; }
.dossier-kpi strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dossier-kpi span { color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.fact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin: 0; }
.fact-list div { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.fact-list dt { color: var(--text-3); font-size: 12px; }
.fact-list dd { margin: 0; font-weight: 600; }
@media (max-width: 960px) { .dossier-head { grid-template-columns: auto 1fr; } .dossier-kpi { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); text-align: left; } .fact-list { grid-template-columns: 1fr; } }

/* Appeals */
a.appeal-row { text-decoration: none !important; }
a.appeal-row:hover { background: var(--surface-2); }
.appeal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.appeal-who { display: flex; align-items: center; gap: 12px; }
.appeal-who h1 { font-size: 18px; }
.appeal-chat .thread { margin-bottom: 14px; }
.appeal-side-panel { display: grid; gap: 14px; position: sticky; top: calc(var(--header-h) + 20px); }
.appeal-side-panel h2 { font-size: 16px; }
.reply-form { display: grid; gap: 8px; }
.reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.thread { display: grid; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--border); }
.bubble p { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.55; }
.bubble time { display: block; margin-top: 4px; color: var(--text-3); font-size: 11px; }
.bubble--out { justify-self: end; border-radius: 14px 14px 4px 14px; background: var(--accent-soft); border-color: transparent; }
@media (max-width: 960px) { .appeal-layout { grid-template-columns: 1fr; } .appeal-side-panel { position: static; order: -1; } }

/* Telegram users */
.tg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.tg-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); text-decoration: none !important; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.tg-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.tg-avatar, .tg-photo { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; object-fit: cover; background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); color: var(--c, var(--accent)); font-weight: 800; font-size: 17px; }
.tg-photo.profile-avatar, .tg-avatar.profile-avatar { width: 112px; height: 112px; font-size: 38px; margin-bottom: 6px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--c, var(--accent)) 8%, transparent); }
.tg-card-body { display: grid; gap: 3px; min-width: 0; }
.tg-card-name { display: flex; align-items: center; gap: 4px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-star { display: inline-grid; color: #f59e0b; }
.tg-star .icon { width: 15px; height: 15px; fill: currentColor; }
.tg-card-user { color: var(--accent-text); font-size: 13px; font-weight: 600; }
.tg-card-bio { color: var(--text-2); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tg-card-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tg-card-stats { display: grid; gap: 6px; justify-items: end; text-align: right; }
.tg-card-stats > span:not(.tg-card-last) { display: grid; line-height: 1.1; }
.tg-card-stats strong { font-variant-numeric: tabular-nums; }
.tg-card-stats small { color: var(--text-3); font-size: 11px; }
.tg-card-last { color: var(--text-3); font-size: 11px; white-space: nowrap; }
.photo-strip { width: 100%; padding-top: 14px; border-top: 1px solid var(--border); text-align: left; }
.photo-strip h3 { margin-bottom: 10px; font-size: 13px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-grid figure { display: grid; gap: 4px; margin: 0; }
.photo-grid img, .photo-grid .photo-missing, .photo-grid .tg-avatar { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; object-fit: cover; }
.photo-missing { display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); }
.photo-grid figure.is-current img { box-shadow: 0 0 0 2px var(--accent); }
.photo-grid figcaption { color: var(--text-3); font-size: 10px; line-height: 1.3; }
.channel-list { display: grid; gap: 2px; }
.channel-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 56px; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; color: var(--text); text-decoration: none !important; font-size: 13px; }
.channel-row:hover { background: var(--surface-2); }
.channel-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.story-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.story-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.story-list time { color: var(--text-3); font-size: 12px; }
.comment-group { padding: 14px 0; border-top: 1px solid var(--border); }
.comment-group:first-child { border-top: 0; padding-top: 0; }
.comment-group-post { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 12px; }
.comment-group-post a { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-group-post time { color: var(--text-3); }
.comment-group-items { display: grid; gap: 10px; padding: 10px 0 0 14px; margin-left: 10px; border-left: 2px solid var(--border); }
.comment-item time { color: var(--text-3); font-size: 11px; }
.comment-item p { line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.comment-author { color: var(--text); font-weight: 700; font-size: 13px; }
a.comment-author:hover { color: var(--accent-text); }
.cm-author-line { display: inline-flex; align-items: center; gap: 6px; }

/* Rubrics editor */
.rule-levels { display: flex; flex-wrap: wrap; gap: 6px; }
.rule-levels:empty { display: none; }
.rule-card footer { margin-top: auto; }
#rubric-editor:not(:empty), #label-editor:not(:empty) { margin-bottom: 16px; }

/* Stories */
.date-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.date-nav input { width: auto; }
.date-nav-label { margin-left: 6px; color: var(--text-2); font-weight: 600; }
.story-feed { display: grid; gap: 12px; }
.story-item { display: grid; gap: 10px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.story-item.crit-neg { border-left-color: var(--neg); }
.story-item.crit-neu { border-left-color: var(--neu); }
.story-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.story-item-head h2 { flex: 1; min-width: 240px; font-size: 17px; line-height: 1.3; }
.story-summary { color: var(--text-2); line-height: 1.55; }
.story-facts { display: grid; grid-template-columns: auto auto minmax(120px, 1fr); gap: 16px; align-items: center; font-size: 13px; color: var(--text-2); }
.story-facts strong { color: var(--text); }
.story-sources { display: flex; flex-wrap: wrap; gap: 6px; }
.story-item footer { display: flex; align-items: center; gap: 14px; }
.story-item footer .btn .icon { width: 16px; height: 16px; }
.story-posts .mini-post-list { margin-top: 4px; background: var(--surface-2); }
@media (max-width: 640px) { .story-facts { grid-template-columns: 1fr 1fr; } .story-facts .tone-bar { grid-column: 1 / -1; } }

/* Reaction labels */
.label-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.label-card { display: grid; gap: 10px; align-content: start; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); text-decoration: none !important; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.label-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.label-card header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.label-card h2 { font-size: 16px; }
.label-card footer { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--text-3); font-size: 12px; }
.label-card footer span { display: inline-flex; align-items: center; gap: 4px; }
.label-card footer .icon { width: 14px; height: 14px; }
.label-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.label-head h1 { font-size: 24px; letter-spacing: -.02em; }
.greeting-chips--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.label-tone { display: grid; grid-template-columns: minmax(160px, 320px) auto; gap: 14px; align-items: center; margin-bottom: 12px; color: var(--text-2); font-size: 13px; }
@media (max-width: 760px) { .greeting-chips--4 { grid-template-columns: 1fr 1fr; } .label-tone { grid-template-columns: 1fr; } }

/* Reports */
a.report-card { text-decoration: none !important; }
.report-card-top { display: flex; justify-content: space-between; align-items: center; }

/* Access: users and roles */
.access-head, .access-row { display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(160px, 1fr) 110px 140px minmax(220px, 1.2fr); gap: 14px; align-items: center; padding: 0 20px; }
.access-head { height: 42px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.access-row { min-height: 64px; border-bottom: 1px solid var(--border); }
.access-row:last-child { border-bottom: 0; }
.access-row .user-avatar { width: 34px; height: 34px; font-size: 13px; background: color-mix(in srgb, var(--c, var(--accent)) 18%, transparent); color: var(--c, var(--accent)); }
.access-row select { height: 34px; }
.access-row .sp-row-name { display: flex; align-items: center; gap: 6px; }
.is-disabled-row .sp-row-main { opacity: .55; }
.access-activity { display: grid; color: var(--text-2); font-size: 13px; }
.access-activity small { color: var(--text-3); font-size: 11px; }
.access-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 14px; }
.danger-text { color: var(--neg) !important; }
.password-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.password-box code { flex: 1; font: 600 18px/1.3 ui-monospace, 'SFMono-Regular', Menlo, monospace; letter-spacing: .04em; overflow-wrap: anywhere; user-select: all; }
.role-list { display: grid; gap: 14px; }
.role-card > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.role-title { display: grid; gap: 4px; min-width: 240px; }
.role-title input { font-weight: 700; font-size: 15px; }
.perm-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.perm-groups fieldset { margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 12px; }
.perm-groups legend { padding: 0 6px; color: var(--text-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.perm-groups .check-field { min-height: 32px; font-size: 13px; }
@media (max-width: 1100px) { .perm-groups { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .access-head { display: none; } .access-row { grid-template-columns: 1fr 1fr; padding: 14px 16px; } .access-row .sp-row-main, .access-actions { grid-column: 1 / -1; } .access-actions { justify-content: flex-start; } }

/* Stories — legacy layout (stories.blade.php) */
.stories-head { align-items: center; }
.page-title .title-icon { display: inline-grid; vertical-align: -4px; margin-right: 8px; color: var(--accent-text); }
.page-title .title-icon .icon { width: 24px; height: 24px; }
.stories-head .page-head__actions { flex-wrap: wrap; gap: 10px; }
.stories-head .date-nav { margin: 0; }
.stories-count { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-2); }
.stories-count strong { color: var(--text); font-size: 16px; }
.stories-count span { margin-left: auto; color: var(--text-3); font-size: 13px; }
.story-card { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.story-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.story-card.crit-high { border-left: 4px solid var(--neg); }
.story-card.crit-medium { border-left: 4px solid var(--neu); }
.story-card__body { padding: 20px 24px; }
.story-card__title { font-size: 17px; line-height: 1.35; margin-bottom: 10px; }
.story-card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.s-badge { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.s-badge .icon { width: 14px; height: 14px; }
.s-badge--count { background: var(--accent-soft); color: var(--accent-text); }
.s-badge--views { background: color-mix(in srgb, #0ea5e9 15%, transparent); color: #0ea5e9; }
.s-badge--positive { background: var(--pos-soft); color: var(--pos); }
.s-badge--negative, .s-badge--crit-high { background: var(--neg-soft); color: var(--neg); }
.s-badge--crit-medium { background: var(--neu-soft); color: var(--neu); }
.story-card__summary { margin-bottom: 14px; color: var(--text); line-height: 1.6; }
.story-card__sources-label { margin-bottom: 6px; color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.story-card__sources-list { display: flex; flex-wrap: wrap; gap: 5px; }
.source-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.source-tag--tg { background: color-mix(in srgb, var(--tg) 12%, transparent); color: var(--tg); }
.source-tag--insta { background: color-mix(in srgb, var(--ig) 12%, transparent); color: var(--ig); }
.source-tag--site { background: var(--surface-3); color: var(--text-2); }
.story-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 24px; background: var(--surface-2); border-top: 1px solid var(--border); }
.expand-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--accent-text); font-size: 13px; font-weight: 600; }
.expand-btn .icon { width: 15px; height: 15px; }
.expand-btn:hover { color: var(--accent); }
.posts-list { border-top: 1px solid var(--border); }
.posts-list .skeleton-list { padding: 12px 24px; }
.post-row { display: flex; align-items: center; gap: 14px; padding: 10px 24px 10px 21px; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.post-row:last-child { border-bottom: 0; }
.post-row--positive { border-left-color: var(--pos); }
.post-row--negative { border-left-color: var(--neg); }
.post-row--neutral { border-left-color: var(--text-3); }
.post-row__source { display: flex; align-items: center; gap: 8px; width: 200px; flex: none; min-width: 0; }
.post-type { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 6px; }
.post-type .icon { width: 13px; height: 13px; }
.post-type--tg { background: color-mix(in srgb, var(--tg) 12%, transparent); color: var(--tg); }
.post-type--insta { background: color-mix(in srgb, var(--ig) 12%, transparent); color: var(--ig); }
.post-type--site { background: var(--surface-3); color: var(--text-2); }
.post-row__source-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 12px; font-weight: 600; }
.post-row__text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; }
.post-row__text a { color: var(--text); }
.post-row__meta { display: flex; align-items: center; gap: 10px; flex: none; }
.post-row__views { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, #0ea5e9 12%, transparent); color: #0ea5e9; font-size: 12px; font-weight: 600; }
.post-row__views .icon { width: 13px; height: 13px; }
.post-row__date { color: var(--text-3); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.posts-empty { padding: 14px 24px; }
.no-stories { display: grid; justify-items: center; gap: 8px; padding: 56px 24px; text-align: center; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.no-stories .icon { width: 36px; height: 36px; color: var(--text-3); }
.no-stories strong { color: var(--text); font-size: 16px; }
.no-stories .btn { margin-top: 8px; }
@media (max-width: 640px) { .story-card__body { padding: 16px; } .story-card__footer { padding: 10px 16px; } .post-row { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 16px 10px 13px; } .post-row__source { width: auto; } .stories-count span { margin-left: 0; width: 100%; } }
.story-feed .story-card { display: block; padding: 0; gap: 0; color: var(--text); transform: none; }
.story-feed .story-card:hover { transform: none; }

/* Access → Журнал */
.audit-filters { margin-bottom: 14px; }
.audit-filters .chip { text-decoration: none !important; }
.audit-head, .audit-row { display: grid; grid-template-columns: 150px minmax(120px, 1fr) 160px minmax(160px, 1.2fr) minmax(200px, 1.6fr); gap: 14px; align-items: center; padding: 0 20px; }
.audit-head { height: 40px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.audit-row { min-height: 48px; padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
.audit-row:last-child { border-bottom: 0; }
.audit-row small { display: block; color: var(--text-3); font-size: 11px; font-family: ui-monospace, monospace; }
.audit-row.is-failed { background: color-mix(in srgb, var(--neg) 6%, transparent); }
.audit-time { color: var(--text-2); font-variant-numeric: tabular-nums; }
.audit-details { color: var(--text-3); font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .audit-head { display: none; } .audit-row { grid-template-columns: 1fr 1fr; padding: 12px 16px; } .audit-details { grid-column: 1 / -1; } }
