:root{--bg:#faf8f5;--surface:#fff;--text:#18212b;--muted:#667085;--line:#e4e7ec;--accent:#ba8151;--danger:#8c322a;--success:#265944;--radius:12px;--rail:#20252a;--rail-muted:#a6adb3;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text);background:var(--bg);font-synthesis:none;font-size:14px}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:wait;opacity:.55}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #c6976d;outline-offset:3px}a{color:inherit}button,input,select,textarea{border:1px solid var(--line);border-radius:7px}input,select,textarea{padding:9px 11px;background:#fff;color:var(--text);max-width:100%}button{background:#fff;color:var(--text);padding:9px 14px;font-weight:550}button:hover{background:#f4efe9}h1,h2,h3,p{margin-top:0}h1{font-size:27px;line-height:1.25;letter-spacing:-.7px;font-weight:650;margin-bottom:9px}h2{font-size:18px;line-height:1.4;font-weight:600}h3{font-size:15px;line-height:1.4}p{line-height:1.6}table{border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums;text-align:left}th{font-size:12px;font-weight:550;color:var(--muted)}th,td{padding:13px 15px;border-bottom:1px solid var(--line);vertical-align:top}td{font-size:13px}table a{color:#8f5d34}small,.muted{color:var(--muted)}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.skip-link{position:fixed;left:15px;top:-100px;z-index:100;background:white;padding:12px;border-radius:8px}.skip-link:focus{top:12px}.app-shell{min-height:100vh;display:grid;grid-template-columns:266px minmax(0,1fr)}.sidebar{background:var(--rail);color:#f8f9fa;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;padding:28px 13px 18px}.brand{text-decoration:none;padding:0 12px;display:block}.brand-word{font-size:21px;letter-spacing:3px;font-weight:750;line-height:1.2}.brand-dot{color:var(--accent);letter-spacing:0}.brand-caption{display:block;color:var(--rail-muted);font-size:11.5px;margin-top:6px;letter-spacing:.2px}.sidebar nav{margin-top:24px;display:grid;gap:3px}.sidebar nav a{display:flex;align-items:center;gap:8px;text-decoration:none;font-size:12px;font-weight:520;line-height:1.28;padding:8px 10px;border-radius:8px;color:#c7ccd1;border:1px solid transparent;min-width:0}.sidebar nav a>span:not(.nav-symbol):not(.sidebar-live-dot):not(.channel-icon):not(.nav-index):not(.nav-sub-index):not(.nav-sub-branch){flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar nav a:hover{background:#2a3036;color:#fff}.sidebar nav a[aria-current=page]{background:#34312e;color:#f2d4b9;border-color:#66513e}.nav-symbol{width:18px;font-size:16px;line-height:1;font-weight:400;text-align:center;color:var(--rail-muted);flex-shrink:0}.sidebar nav a[aria-current=page] .nav-symbol{color:#dca26f}.sidebar-bottom{margin-top:auto;padding:20px 12px 0;border-top:1px solid #363c42}.workspace-label{font-size:12px;color:var(--rail-muted);line-height:1.7;display:flex;gap:8px;align-items:center}.workspace-dot{width:5px;height:5px;background:#bf8b5f;border-radius:50%;flex-shrink:0}.logout{padding:0;margin-top:17px;font-size:12px;font-weight:400;color:#d0d4d8;background:none;border:0}.logout:hover{background:none;color:#fff;text-decoration:underline}.workspace{min-width:0;display:flex;flex-direction:column;min-height:100vh}.topbar{background:var(--surface);border-bottom:1px solid var(--line);min-height:77px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 34px}.topbar-title{font-size:13px;font-weight:600;white-space:nowrap}.context-form{display:flex;gap:8px;align-items:center}.context-form label{display:flex;gap:7px;align-items:center;font-size:12px;color:var(--muted)}.context-form input,.context-form select{padding:7px 8px;font-size:12px;min-width:0}.date-separator{color:#b2b8c0}.small-button{font-size:12px;padding:8px 11px}.mode-label{margin-left:7px}.menu-toggle{display:none}.workspace main{padding:30px 34px 45px;flex:1;min-width:0;width:100%;max-width:1600px;margin:0 auto}.workspace main:focus{outline:0}.workspace-footer{display:flex;justify-content:space-between;gap:20px;color:#667085;font-size:12px;padding:17px 34px;border-top:1px solid var(--line)}.page-heading{margin-bottom:25px}.page-heading p{font-size:13px;color:var(--muted);max-width:750px;margin:0}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:17px}.section-heading h2{margin:0}.section-heading a{font-size:12px;color:#8f5d34;text-decoration:none}.section-heading a:hover{text-decoration:underline}.overview-summary{background:#fff;border:1px solid var(--line);border-radius:var(--radius);display:grid;grid-template-columns:minmax(0,1.65fr) minmax(200px,1fr);margin-bottom:29px}.summary-copy{padding:24px 25px}.summary-copy h2{margin-bottom:9px}.summary-copy p{font-size:13px;color:var(--muted);margin-bottom:17px}.summary-status{padding:23px 25px;border-left:1px solid var(--line);display:flex;flex-direction:column;gap:14px}.summary-label{font-size:12px;color:var(--muted)}.summary-value{font-size:16px;font-weight:600}.summary-link{font-size:12px;color:#8f5d34;text-decoration:none}.primary{background:var(--text);border-color:var(--text);color:white}.primary:hover{background:#303b46}.text-button{border:0;background:none;color:#8f5d34;padding:0;font-size:12px}.module-list{border-top:1px solid var(--line);margin-bottom:32px}.module-row{display:grid;grid-template-columns:minmax(140px,.7fr) minmax(180px,1.5fr) auto;align-items:center;gap:24px;padding:21px 2px;border-bottom:1px solid var(--line)}.module-row h3{margin:0 0 5px}.module-row .module-tag{font-size:12px;color:var(--muted)}.module-row p{font-size:13px;line-height:1.6;color:var(--muted);margin:0;max-width:570px}.module-open{font-size:12px;color:#8f5d34;padding:8px 12px;background:#fff;border-color:#ded4ca;white-space:nowrap}.overview-bottom{display:grid;grid-template-columns:1fr 1fr;gap:27px}.plain-panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:22px}.integration-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:12px 0;border-bottom:1px solid var(--line);font-size:13px}.integration-row:last-child{border-bottom:0}.status{font-size:12px;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;padding:2px 8px;border-radius:6px}.status::before{content:"";width:5px;height:5px;border-radius:50%;background:currentColor}.status-connected{color:#265944;background:#eef4f0}.status-error{color:#8c322a;background:#f9f1ef}.status-stale{color:#7c4d25;background:#f5efe8}.status-unconfigured{color:var(--muted);background:#f8f9fb}.event-item{padding:11px 0;border-bottom:1px solid var(--line);font-size:13px;line-height:1.5}.event-item:last-child{border:0}.event-item time{display:block;font-size:12px;color:var(--muted);margin-top:3px}.empty-inline{color:var(--muted);font-size:13px;line-height:1.7;margin:8px 0}.notice{border-left:3px solid var(--accent);background:#faf8f5;padding:13px 16px;font-size:13px;line-height:1.65;margin:15px 0}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:var(--radius);background:white}.loading-state,.error-state{padding:50px 20px;color:var(--muted);font-size:14px;line-height:1.7}.loading-state{display:flex;align-items:center;justify-content:center;gap:12px}.error-state{max-width:700px;margin:auto}.error-state h2{color:var(--text)}.error-state button{margin-top:8px}.spinner{height:16px;width:16px;border:2px solid var(--line);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.toast-region{position:fixed;right:25px;bottom:24px;display:grid;gap:8px;z-index:1000;max-width:min(420px,calc(100vw - 32px))}.toast{border-radius:9px;background:#18212b;color:white;box-shadow:0 5px 25px #10182822;padding:13px 17px;font-size:13px;line-height:1.5}.toast-error{background:#8c322a}.toast-success{background:#265944}.login-screen{min-height:100vh;display:grid;place-items:center;padding:30px;background:#faf8f5}.login-form{width:100%;max-width:400px;padding:36px;background:white;border:1px solid var(--line);border-radius:14px;box-shadow:0 20px 70px #15202b08}.login-form .brand-word{display:block;font-size:18px;margin-bottom:38px}.login-form h1{font-size:24px}.login-form p{font-size:13px;color:var(--muted)}.login-form label{display:block;font-size:12px;margin:27px 0 8px}.login-form input{width:100%;padding:12px}.login-form button{width:100%;padding:12px}.login-form .form-error{font-size:12px;color:var(--danger);min-height:1em;margin:12px 0}.login-form small{display:block;text-align:center;font-size:12px;margin-top:24px}.boot-error{max-width:550px;margin:15vh auto;padding:30px}.boot-error p{color:var(--muted)}
@media(min-width:1500px){.workspace main{padding:36px 46px}.topbar{padding-inline:46px}}@media(max-width:1100px){.app-shell{grid-template-columns:205px minmax(0,1fr)}.sidebar{padding-inline:12px}.topbar{padding:15px 22px;flex-wrap:wrap}.context-form{margin-left:auto}.workspace main{padding:25px 22px}.context-form input,.context-form select{font-size:12px}.workspace-footer{padding-inline:22px}.module-row{gap:15px}}@media(max-width:800px){.app-shell{display:block}.sidebar{position:fixed;left:0;top:0;width:230px;z-index:50;transform:translateX(-100%);transition:transform .2s}.app-shell.menu-open .sidebar{transform:translateX(0);box-shadow:0 0 0 100vmax #0005}.menu-toggle{display:inline-block;border:0;font-size:18px;padding:3px 7px;margin-right:10px}.topbar{padding:14px 18px;gap:14px;min-height:auto}.topbar-title{display:flex;align-items:center}.context-form{width:100%;flex-wrap:wrap;margin:0;gap:7px}.context-form input{font-size:12px;padding:7px}.context-form .mode-label{margin-left:auto}.workspace main{padding:24px 18px 35px}.overview-summary{grid-template-columns:1fr}.summary-copy{padding:20px}.summary-status{border-left:0;border-top:1px solid var(--line);padding:17px 20px;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:wrap}.summary-value{font-size:14px}.overview-bottom{grid-template-columns:1fr}.module-row{grid-template-columns:1fr auto;gap:10px}.module-row p{grid-column:1/-1;grid-row:2}.module-row .module-open{grid-column:2;grid-row:1}h1{font-size:24px}.workspace-footer{padding:15px 18px;font-size:12px}.workspace-footer span:last-child{display:none}.plain-panel{padding:18px}.table-wrap{max-width:100%}}@media(max-width:420px){.context-form .mode-label{margin-left:0}.context-form label{font-size:12px}.context-form input{width:127px}.date-separator{display:none}.small-button{margin-left:auto}.login-form{padding:27px}.context-form select{font-size:12px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Modules own their inner spacing; the shell keeps the mobile gutter consistent. */
@media(max-width:900px){#content .analytics-app{padding-inline:0}}
.crm-panel{margin-bottom:34px}.crm-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;padding-bottom:16px;border-bottom:1px solid var(--line)}.crm-heading h2{margin-bottom:5px}.crm-heading p{font-size:13px;color:var(--muted);margin:0}.crm-actions{display:flex;align-items:center;gap:17px}.crm-actions button{font-size:12px;white-space:nowrap}.crm-freshness{display:flex;align-items:center;justify-content:space-between;gap:15px;font-size:12px;color:var(--muted);padding:15px 0}.crm-freshness strong{font-weight:550;color:var(--text)}.crm-job{display:flex;gap:10px;align-items:center;font-size:13px;color:var(--muted);min-height:25px;margin:0 0 12px}.crm-table th{white-space:nowrap}.crm-table td:first-child{min-width:150px}.crm-table td:last-child{font-size:13px;color:var(--muted);min-width:180px;max-width:400px}.crm-count{text-align:right;font-variant-numeric:tabular-nums}.crm-footnote{font-size:12px;color:var(--muted);margin:13px 0 0;max-width:1000px}.crm-update-note{font-size:12px;color:#8f5d34;margin-top:12px;line-height:1.6}.crm-update-note:empty{display:none}@media(max-width:700px){.crm-heading{align-items:flex-start;flex-direction:column;gap:13px}.crm-actions{width:100%;justify-content:space-between}.crm-freshness{align-items:flex-start;flex-direction:column;gap:8px}.crm-table td{font-size:12px}.crm-job{align-items:flex-start;line-height:1.6}}

.preview-banner{display:flex;align-items:center;gap:12px;padding:7px 28px;background:#f5efe8;border-bottom:1px solid #e5dccf;color:#6b4423;font-size:11.5px;line-height:1.45}.preview-banner strong{font-size:11.5px;font-weight:650;white-space:nowrap;padding:2px 8px;border-radius:5px;background:#ebe0d2;color:#4a2d13}@media(max-width:800px){.preview-banner{padding:8px 16px;flex-direction:column;align-items:flex-start;gap:4px}.preview-banner strong{white-space:normal}}

/* The workspace has a fixed lead cohort; advanced reports own their mode control. */


.analysis-mode-switch{display:inline-flex;gap:0;border:1px solid #e4e7ec;border-radius:8px;overflow:hidden;flex-shrink:0}.analysis-mode-switch[hidden]{display:none}.analysis-mode-switch #context-mode{display:none}.analysis-mode-switch button{border:0;border-radius:0;padding:8px 10px;font-size:12px;background:#fff;color:#475467;white-space:nowrap}.analysis-mode-switch button[aria-pressed="true"]{background:#f8efe6;color:#7c4d25;font-weight:600;box-shadow:inset 0 0 0 1px #cfa077}.analysis-mode-switch button:focus-visible{outline:2px solid #ba8151;outline-offset:-3px}@media(max-width:800px){.context-form .analysis-mode-switch{margin-left:0;order:3}.analysis-mode-switch button{padding:7px 10px}}

/* Dates occupy their own mobile row; analysis controls use the next row. */
@media(max-width:800px){.context-form>.date-separator{display:none}.context-form>label{flex:1 1 calc(50% - 7px);max-width:calc(50% - 3.5px);min-width:0;gap:5px}.context-form>label>input{flex:1 1 auto;width:100%;min-width:0;box-sizing:border-box}.context-form .analysis-mode-switch{order:3;flex:0 0 auto}.context-form>#apply-context{order:4;flex:0 0 auto;margin-left:auto}}

@media(max-width:800px){.workspace:has(#content .analytics-workspace-surface) .topbar .context-form{flex-wrap:wrap}.workspace:has(#content .analytics-workspace-surface) .topbar .context-form>label{flex:1 1 calc(50% - 7px);max-width:calc(50% - 3.5px);min-width:0}.workspace:has(#content .analytics-workspace-surface) .topbar .context-form>label>input{flex:1 1 auto;width:100%;min-width:0}}
.sidebar nav .research-nav-parent{position:relative;min-width:0}.sidebar nav .research-nav-parent>a{padding-right:30px}.sidebar nav .research-nav-toggle{position:absolute;right:2px;top:50%;transform:translateY(-50%);width:26px;height:26px;border:0;border-radius:6px;background:transparent;color:#d8c2ae;font:15px/1 system-ui;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0}.sidebar nav .research-nav-toggle:hover{background:#4a4038;color:white}.sidebar nav .research-nav-menu{display:grid;gap:2px;padding:2px 0 4px 20px}.sidebar nav .research-nav-menu[hidden]{display:none}.sidebar nav .research-nav-menu a{font-size:12px;padding:6px 10px;min-height:28px}.sidebar nav .research-nav-menu a[aria-current=page]{background:#4a4038;color:#f2d4b9;border-color:transparent}

/* Keep the complete navigation visible on short screens, with a working overflow fallback. */
.sidebar{height:100vh;height:100dvh;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#51565b transparent;padding-top:22px;padding-bottom:12px}
.sidebar nav{margin-top:18px;gap:2px}
.sidebar nav>a,.sidebar nav .research-nav-parent>a{padding-top:7px;padding-bottom:7px}
.sidebar nav .research-nav-menu{gap:1px;padding:1px 0 4px 16px}
.sidebar nav .research-nav-menu a{min-height:28px;padding:5px 10px;gap:8px}
.channel-icon{width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 16px;color:currentColor}
.channel-icon svg{display:block;width:16px;height:16px}
.sidebar-bottom{padding-top:12px}
.sidebar::-webkit-scrollbar{width:5px}.sidebar::-webkit-scrollbar-thumb{background:#51565b;border-radius:5px}

@media (min-width: 801px) and (max-height: 850px) {
  .sidebar { padding-block: 14px 8px; }
  .sidebar nav { margin-top: 12px; gap: 1px; }
  .sidebar nav > a,
  .sidebar nav .research-nav-parent > a { padding-block: 5px; }
  .sidebar nav .research-nav-toggle { height: 24px; width: 24px; }
  #sidebar nav .research-nav-menu a { box-sizing: border-box; min-height: 25px; padding-block: 3px; }
}
.sidebar nav :is(a, button):focus-visible {
  outline: 2px solid #f2d4b9;
  outline-offset: -2px;
}

/* Keep every mailing section visible, including the active tab on narrow screens. */
nav.mailing-tabs[aria-label="Разделы рассылок"] {
  flex-wrap: wrap;
  gap: 3px 14px;
  overflow: visible;
}
nav.mailing-tabs[aria-label="Разделы рассылок"] .mailing-tab {
  padding: 6px 4px;
  white-space: normal;
  text-align: left;
}
nav.mailing-tabs[aria-label="Разделы рассылок"] .mailing-tab:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

/* Compact Overview Desktop & Bottom Reference Styling (Nov 2026) */
.overview-compact-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.overview-compact-heading h1 {
  font-size: 25px;
  margin-bottom: 5px;
}
.overview-heading-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 7px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
  background: #fff;
  color: var(--text);
}
.button-link.primary {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}
.button-link.primary:hover {
  background: #303b46;
}
.overview-block {
  padding: 18px 20px;
  margin-bottom: 16px;
}
.overview-block .section-heading {
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef0f3;
}
.section-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 3px 0 0;
}
.overview-more-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 7px;
  border: 1px solid #dfd3c7;
  background: #fcf9f6;
  color: #85542f !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
}
.overview-more-btn:hover {
  background: #f5ece3;
  border-color: #ba8151;
}
.overview-channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.overview-channel-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 15px;
  border: 1px solid #e4e7ec;
  border-radius: 9px;
  background: #fcfcfd;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.overview-channel-card:hover {
  border-color: #ba8151;
  background: #fff;
  box-shadow: 0 4px 14px rgba(24, 33, 43, .05);
}
.overview-channel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.overview-badge {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 2px 8px;
  border-radius: 5px;
  background: #f4efe9;
  color: #8f5d34;
}
.overview-badge-youtube,
.overview-badge-instagram,
.overview-badge-vk,
.overview-badge-telegram,
.overview-badge-threads {
  background: #f4efe9;
  color: #8f5d34;
}
.overview-arrow {
  font-size: 12px;
  font-weight: 600;
  color: #8f5d34;
}
.overview-channel-card strong {
  font-size: 14px;
  color: var(--text);
}
.overview-channel-card span:last-child {
  font-size: 13px;
  color: var(--muted);
}

.overview-audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 10px;
}
.overview-audit-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 15px;
  border: 1px solid #e4e7ec;
  border-radius: 9px;
  background: #fcfcfd;
}
.overview-audit-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #8f5d34;
}
.overview-audit-card h3 {
  font-size: 14px;
  margin: 0;
  line-height: 1.35;
}
.overview-audit-card p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  flex: 1;
}
.overview-audit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}
.overview-audit-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 6px;
  background: #8f5d34;
  color: #fff !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.overview-audit-btn:hover {
  background: #7c4d25;
}
.overview-audit-link {
  font-size: 12px;
  font-weight: 600;
  color: #8f5d34;
  text-decoration: underline;
}

.overview-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.overview-tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid #e4e7ec;
  border-radius: 9px;
  background: #fff;
}
.overview-tool-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #8f5d34;
}
.overview-tool-card h3 {
  font-size: 15px;
  margin: 0;
}
.overview-tool-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}
.overview-tool-card .module-open {
  align-self: flex-start;
  margin-top: 6px;
}

/* Keep Keys.so reference compact at the bottom of channel pages */
.keys-research-reference {
  margin: 22px 0 8px;
  padding: 11px 16px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #faf8f5;
  font-size: 13px;
  color: #475467;
}
.keys-research-reference summary {
  cursor: pointer;
  font-weight: 600;
  color: #18212b;
}
.keys-research-reference p {
  margin: 8px 0 0;
  font-size: 12px;
}

@media (max-width: 1000px) {
  .overview-channel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .overview-channel-grid,
  .overview-tools-grid {
    grid-template-columns: 1fr;
  }
  .overview-block .section-heading {
    flex-direction: column;
    gap: 8px;
  }
}

/* Global Date Presets Bar & Architectural Topbar Layout */
.topbar {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e7e1d8;
  min-height: 54px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 28px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title {
  order: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #18212b;
  white-space: nowrap;
  flex-shrink: 0;
}

#page-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions {
  order: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.topbar-actions > button,
.topbar-access-pill,
.topbar-user-pill,
.topbar-profile-pill {
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 9px;
}

.context-form {
  order: 3;
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid #f1ece4;
  min-width: 0;
}

.date-presets-bar {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background: #f4efe8;
  border: 1px solid #e5dccf;
  border-radius: 9px;
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}
.date-presets-bar::-webkit-scrollbar {
  display: none;
}

.date-preset-btn {
  padding: 0 10px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #52483e;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.date-preset-btn:hover {
  background: rgba(255, 255, 255, 0.78);
  color: #18212b;
}

.date-preset-btn.is-active,
.date-preset-btn[aria-pressed="true"] {
  background: #f8efe6;
  border-color: #cfa077;
  color: #7c4d25;
  font-weight: 600;
  box-shadow: none;
}

.topbar-dates-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 10px;
  background: #faf8f5;
  border: 1px solid #e5dccf;
  border-radius: 9px;
  flex-wrap: nowrap;
  margin-left: auto;
}

.topbar-dates-cluster label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #6b5e50;
  margin: 0;
}

.date-field-label {
  color: #7c6d5d;
  font-weight: 600;
}

.topbar-dates-cluster input[type="date"] {
  height: 28px;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 550;
  color: #18212b;
  background: #ffffff;
  border: 1px solid #dfd6c9;
  border-radius: 6px;
  width: 118px;
  min-width: 112px;
}

.topbar-dates-cluster input[type="date"]:hover {
  border-color: #c59b76;
}

.topbar-dates-cluster .date-separator {
  color: #a69888;
  font-weight: 600;
  padding: 0 1px;
}

.topbar-apply-btn {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  background: #20252a;
  border: 1px solid #20252a;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}

.topbar-apply-btn:hover {
  background: #ba8151;
  border-color: #ba8151;
  color: #ffffff;
}

/* On ultra-wide screens (1860px+), fit everything on a single sleek horizontal bar */
@media (min-width: 1860px) {
  .topbar {
    flex-wrap: nowrap;
    min-height: 60px;
  }
  .topbar-title {
    order: 1;
  }
  .context-form {
    order: 2;
    flex: 1 1 auto;
    justify-content: center;
    padding-top: 0;
    border-top: 0;
    flex-wrap: nowrap;
  }
  .topbar-dates-cluster {
    margin-left: 0;
  }
  .topbar-actions {
    order: 3;
    margin-left: 0;
  }
}

@media (max-width: 1100px) {
  .topbar {
    padding: 10px 20px;
  }
}

@media (max-width: 800px) {
  .topbar {
    padding: 10px 16px;
    position: static;
  }
  .context-form {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }
  .date-presets-bar {
    width: 100%;
    order: 0;
  }
  .topbar-dates-cluster {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
    padding: 6px 8px;
  }
}

@media (max-width: 520px) {
  .topbar-title {
    flex: 1 1 100%;
    flex-wrap: wrap;
    white-space: normal;
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
    gap: 8px;
  }
  #page-label {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }
  .topbar-actions {
    flex-wrap: wrap;
    max-width: 100%;
  }
}

/* Sidebar Group Headers, Live Dots & Dark User Card */
.sidebar-dept-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7c858e;
  padding: 14px 12px 4px;
  margin-top: 2px;
}
.sidebar-dept-header:first-child {
  padding-top: 2px;
}
.sidebar-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #42b883;
  margin-left: auto;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(66, 184, 131, 0.18);
}
.sidebar .sidebar-user-card {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.1);
}
.sidebar .sidebar-user-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(242, 212, 185, 0.28);
}
.sidebar .sidebar-user-name {
  color: #f3f5f7;
}
.sidebar .sidebar-user-role {
  color: #a6adb3;
}
.sidebar .sidebar-user-avatar.is-admin {
  background: #ba8151;
  color: #ffffff;
}
.sidebar .sidebar-user-b24 {
  background: rgba(186, 129, 81, 0.18);
  color: #f2d4b9;
}

/* Visible Route Loading Progress Slider ("Ползунок загрузки") */
.route-progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(186, 129, 81, 0.16);
  z-index: 9999;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.route-progress-track.is-active {
  opacity: 1;
}
.route-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ba8151 0%, #e0a976 50%, #8f5d34 100%);
  box-shadow: 0 0 10px rgba(186, 129, 81, 0.65);
  transition: width 0.22s ease-out;
}
.loading-slider-card {
  max-width: 520px;
  margin: 48px auto;
  padding: 24px 28px;
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(24, 33, 43, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.loading-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.loading-slider-pct {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: #8f5d34;
  background: #f8efe6;
  padding: 2px 9px;
  border-radius: 999px;
}
.loading-slider-bar {
  width: 100%;
  height: 10px;
  background: #eef1f5;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.loading-slider-bar-fill {
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, #ba8151 0%, #d89e6c 50%, #996139 100%);
  border-radius: 999px;
  transition: width 0.25s ease-out;
  position: relative;
}
.loading-slider-bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: sliderShimmer 1.1s infinite;
}
@keyframes sliderShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.loading-slider-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* Чёткое разделение главного действия (.primary / .btn-primary) и активных вкладок/фильтров */
.sp-tab.active,
.sp-tab.is-active,
.sp-tab[aria-selected="true"] {
  background: #f8efe6;
  border-color: #cfa077;
  color: #7c4d25;
  font-weight: 600;
  box-shadow: none;
}

/* ==========================================================================
   Единые CSS-компоненты стандарта эталонов («Контент-план» и «Библиотека»)
   ========================================================================== */

/* 1. Сегментированный переключатель (.k-segmented) */
.k-segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #f3efe9;
  border: 1px solid #e4ddd3;
  border-radius: 9px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.k-segmented::-webkit-scrollbar {
  display: none;
}
.k-segmented > button,
.k-segmented > a,
.k-segmented .k-segmented-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #525b65;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.k-segmented > button:hover,
.k-segmented > a:hover,
.k-segmented .k-segmented-btn:hover {
  background: rgba(255, 255, 255, 0.72);
  color: #18212b;
}
.k-segmented > button.is-active,
.k-segmented > button.active,
.k-segmented > button[aria-pressed="true"],
.k-segmented > button[aria-selected="true"],
.k-segmented > a.is-active,
.k-segmented > a[aria-current="page"],
.k-segmented .k-segmented-btn.is-active {
  background: #ffffff;
  color: #18212b;
  border-color: #dfd6c9;
  box-shadow: 0 1px 2px rgba(24, 33, 43, 0.06);
}

/* 2. Компактное меню действий в строках таблиц (<details class="k-actions-menu">) */
.k-actions-menu {
  position: relative;
  display: inline-block;
}
.k-actions-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #475467;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.k-actions-menu > summary::-webkit-details-marker {
  display: none;
}
.k-actions-menu > summary:hover,
.k-actions-menu[open] > summary {
  background: #f6f1ea;
  border-color: #d2c4b2;
  color: #18212b;
}
.k-actions-menu > .k-actions-menu-list,
.k-actions-menu > .k-actions-menu-pop,
.k-actions-menu > div,
.k-actions-menu > ul {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 60;
  min-width: 172px;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: #ffffff;
  border: 1px solid #dfd8ce;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(24, 33, 43, 0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.k-actions-menu button,
.k-actions-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.k-actions-menu button:hover,
.k-actions-menu a:hover {
  background: #f6f1ea;
}
.k-actions-menu .is-danger,
.k-actions-menu button.is-danger {
  color: var(--danger);
}
.k-actions-menu .is-danger:hover {
  background: #fdf2f0;
}

/* 3. Аккуратный сворачиваемый блок (<details class="k-accordion">) */
.k-accordion {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}
.k-accordion > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 15px;
  background: #fcfaf7;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.k-accordion > summary::-webkit-details-marker {
  display: none;
}
.k-accordion > summary:hover {
  background: #f5efe7;
}
.k-accordion > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.75px solid #667085;
  border-bottom: 1.75px solid #667085;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  flex-shrink: 0;
  margin-right: 2px;
}
.k-accordion[open] > summary {
  border-bottom: 1px solid #eef0f3;
}
.k-accordion[open] > summary::after {
  transform: rotate(-135deg);
}
.k-accordion > .k-accordion-body {
  padding: 14px 15px;
  background: #ffffff;
}

/* 4. Компактная панель пагинации (.k-pagination) */
.k-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #fcfaf7;
  font-size: 12.5px;
  color: var(--muted);
}
.k-pagination-info {
  font-variant-numeric: tabular-nums;
}
.k-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.k-pagination button,
.k-pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.k-pagination button:hover:not(:disabled),
.k-pagination a:hover {
  background: #f4efe8;
  border-color: #d2c4b2;
}
.k-pagination button.is-active,
.k-pagination button[aria-current="page"],
.k-pagination a.is-active,
.k-pagination a[aria-current="page"] {
  background: #20252a;
  border-color: #20252a;
  color: #ffffff;
}
.k-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 5. Skeleton-лоадер (.k-skeleton и макет .k-skeleton-screen) */
.k-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(90deg, #ede9e2 25%, #f7f4ef 50%, #ede9e2 75%);
  background-size: 200% 100%;
  animation: kSkeletonShimmer 1.35s ease-in-out infinite;
}
@keyframes kSkeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.k-skeleton-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 6px 0 24px;
}
.k-skeleton-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.k-skeleton-head-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 280px;
}
.k-skeleton-title {
  width: min(320px, 70%);
  height: 26px;
  border-radius: 8px;
}
.k-skeleton-subtitle {
  width: min(480px, 90%);
  height: 14px;
  border-radius: 6px;
}
.k-skeleton-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.k-skeleton-btn {
  width: 96px;
  height: 34px;
  border-radius: 8px;
}
.k-skeleton-btn-wide {
  width: 136px;
}
.k-skeleton-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.k-skeleton-pill {
  width: 112px;
  height: 32px;
  border-radius: 8px;
}
.k-skeleton-pill-sm {
  width: 78px;
}
.k-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.k-skeleton-card {
  padding: 16px;
  border: 1px solid #ece8e1;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.k-skeleton-line {
  height: 12px;
  border-radius: 6px;
}
.k-skeleton-line-sm {
  width: 44%;
}
.k-skeleton-line-lg {
  width: 72%;
  height: 24px;
  border-radius: 7px;
}
.k-skeleton-line-md {
  width: 86%;
}
.k-skeleton-table {
  border: 1px solid #ece8e1;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}
.k-skeleton-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr;
  gap: 16px;
  align-items: center;
  padding: 15px 16px;
  border-bottom: 1px solid #f0ece6;
}
.k-skeleton-row:last-child {
  border-bottom: 0;
}
.k-skeleton-cell-lg {
  height: 14px;
  width: 78%;
}
.k-skeleton-cell-sm {
  height: 14px;
  width: 55%;
}
.k-skeleton-cell-md {
  height: 14px;
  width: 68%;
}
@media (max-width: 1050px) {
  .k-skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .k-skeleton-grid {
    grid-template-columns: 1fr;
  }
  .k-skeleton-row {
    grid-template-columns: 1fr 1fr;
  }
  .k-skeleton-cell-md {
    display: none;
  }
}

@media (max-width: 800px) {
  .app-shell:not(.menu-open) .sidebar { visibility: hidden; }
}

/* Unified Omnichannel workspace: fit viewport cleanly so bottom composer & AI sufler bar never fall below fold */
@media (min-width: 801px) {
  .workspace:has(#content .wz-omni-root) {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }
  .workspace:has(#content .wz-omni-root) > main#content {
    flex: 1 1 0;
    min-height: 0;
    padding: 10px 16px 12px;
    max-width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .workspace:has(#content .wz-omni-root) > main#content > :not(:has(.wz-omni-root)) {
    flex: 0 0 auto;
  }
  .workspace:has(#content .wz-omni-root) > main#content > :has(.wz-omni-root) {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .workspace:has(#content .wz-omni-root) .topbar {
    min-height: 58px;
    padding: 10px 24px;
    flex: 0 0 auto;
  }
  .workspace:has(#content .wz-omni-root) .workspace-footer {
    display: none;
  }
}

/* ==========================================================================
   Sidebar Navigation Redesign: Hierarchy, Numbering, Tree Branch & Dividers
   ========================================================================== */

.app-shell {
  grid-template-columns: 296px minmax(0, 1fr);
}

@media (min-width: 1101px) {
  #app.app-shell:has(.yt-app) {
    grid-template-columns: 296px minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 232px minmax(0, 1fr);
  }
}

@media (max-width: 800px) {
  .sidebar {
    width: min(296px, 86vw);
  }
}

/* Group headers (4 main contours) */
.sidebar-dept-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 18px;
  padding: 14px 10px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-transform: none;
  letter-spacing: normal;
}

.sidebar-dept-header:first-child,
.sidebar-dept-header.is-first-visible {
  margin-top: 0;
  padding-top: 2px;
  border-top: 0;
}

.sidebar-dept-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8c96a1;
  line-height: 1.25;
  min-width: 0;
}

.sidebar-dept-range {
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #6e7883;
  background: rgba(255, 255, 255, 0.045);
  padding: 1px 6px;
  border-radius: 999px;
  flex-shrink: 0;
  line-height: 1.35;
}

/* Level-1 navigation items */
.sidebar nav > a,
.sidebar nav .research-nav-parent > a {
  font-size: 12.5px;
  font-weight: 560;
  line-height: 1.3;
  color: #dce1e6;
  padding: 8px 10px;
  gap: 8px;
  border-radius: 8px;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.sidebar nav .research-nav-parent > a {
  padding-right: 34px;
}

.sidebar nav .research-nav-parent.is-expanded > a:not([aria-current=page]) {
  background: rgba(255, 255, 255, 0.048);
  color: #f3f5f7;
  border-color: rgba(255, 255, 255, 0.07);
}

.sidebar nav > a:hover,
.sidebar nav .research-nav-parent > a:hover,
.sidebar nav .research-nav-parent.is-expanded > a:not([aria-current=page]):hover {
  background: #2a3036;
  color: #ffffff;
}

.sidebar nav > a[aria-current=page],
.sidebar nav .research-nav-parent > a[aria-current=page] {
  background: #34312e;
  color: #f2d4b9;
  border-color: #66513e;
  box-shadow: inset 2.5px 0 0 #ba8151;
}

/* Level-1 numeric badge */
.sidebar nav .nav-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 4px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.055);
  color: #959fa9;
  font-size: 10.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  flex-shrink: 0;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.sidebar nav > a:hover .nav-index,
.sidebar nav .research-nav-parent > a:hover .nav-index {
  background: rgba(255, 255, 255, 0.1);
  color: #e6eaee;
}

.sidebar nav > a[aria-current=page] .nav-index,
.sidebar nav .research-nav-parent > a[aria-current=page] .nav-index,
.sidebar nav .research-nav-parent.is-expanded > a .nav-index {
  background: rgba(186, 129, 81, 0.22);
  color: #f2d4b9;
}

/* Level-1 symbol / inline SVG icon */
.sidebar nav .nav-symbol {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
  color: var(--rail-muted);
}

.sidebar nav .nav-symbol svg {
  width: 15px;
  height: 15px;
  display: block;
}

.sidebar nav .research-nav-parent.is-expanded > a .nav-symbol {
  color: #d8b594;
}

.sidebar nav > a[aria-current=page] .nav-symbol,
.sidebar nav .research-nav-parent > a[aria-current=page] .nav-symbol {
  color: #dca26f;
}

/* Submenu expand/collapse button and SVG chevron */
.sidebar nav .research-nav-toggle {
  right: 4px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: #9da6b0;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.sidebar nav .research-nav-toggle:hover {
  background: rgba(186, 129, 81, 0.2);
  color: #f5dcc4;
}

.sidebar nav .research-nav-toggle .nav-chevron {
  width: 14px;
  height: 14px;
  display: block;
  transition: transform 0.18s ease;
}

.sidebar nav .research-nav-toggle[aria-expanded="true"] {
  color: #e2b489;
}

.sidebar nav .research-nav-toggle[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
}

/* Submenu container with copper vertical tree branch */
.sidebar nav .research-nav-menu {
  margin: 4px 0 14px 15px;
  padding: 6px 4px 6px 10px;
  border-left: 1.5px solid rgba(186, 129, 81, 0.34);
  background: rgba(255, 255, 255, 0.022);
  border-radius: 0 8px 8px 0;
  display: grid;
  gap: 2px;
}

.sidebar nav .research-nav-menu[hidden] {
  display: none;
}

/* Block legacy ::before icons from research module stylesheet */
#sidebar nav .research-nav-menu a::before,
#sidebar nav .research-nav-menu a[data-research-channel]::before {
  content: none;
  display: none;
}

/* Submenu micro-dividers */
.sidebar nav .research-nav-menu .nav-sub-divider {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7e8a96;
  padding: 9px 8px 4px;
  margin-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.2;
}

.sidebar nav .research-nav-menu .nav-sub-divider.is-first-visible {
  margin-top: 0;
  padding-top: 3px;
  border-top: 0;
}

/* Submenu items */
#sidebar nav .research-nav-menu a {
  font-size: 12px;
  font-weight: 460;
  line-height: 1.3;
  color: #b4bcc4;
  padding: 5.5px 8px;
  min-height: 29px;
  gap: 7px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

#sidebar nav .research-nav-menu a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f4f6f8;
}

#sidebar nav .research-nav-menu a[aria-current="page"] {
  background: rgba(186, 129, 81, 0.18);
  color: #f6dec7;
  font-weight: 560;
  border-color: rgba(186, 129, 81, 0.28);
  box-shadow: inset 2px 0 0 #ba8151;
}

/* Submenu index, label, nested branch and channel icons */
#sidebar nav .research-nav-menu .nav-sub-index {
  min-width: 28px;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #78838f;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.14s ease;
}

#sidebar nav .research-nav-menu a:hover .nav-sub-index {
  color: #b8c2cc;
}

#sidebar nav .research-nav-menu a[aria-current="page"] .nav-sub-index {
  color: #e4b181;
}

#sidebar nav .research-nav-menu .nav-sub-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sidebar nav .research-nav-menu a[data-sub-nested="true"] {
  padding-left: 16px;
}

#sidebar nav .research-nav-menu .nav-sub-branch {
  color: #7e8a96;
  font-size: 11px;
  flex-shrink: 0;
  line-height: 1;
}

#sidebar nav .research-nav-menu a:hover .nav-sub-branch {
  color: #aeb8c2;
}

#sidebar nav .research-nav-menu a[aria-current="page"] .nav-sub-branch {
  color: #e4b181;
}

.sidebar nav .research-nav-menu .channel-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  opacity: 0.85;
}

.sidebar nav .research-nav-menu .channel-icon svg {
  width: 14px;
  height: 14px;
}

#sidebar nav .research-nav-menu a:hover .channel-icon,
#sidebar nav .research-nav-menu a[aria-current="page"] .channel-icon {
  opacity: 1;
}

/* Short viewport screens: compact vertical rhythm while preserving dividers */
@media (min-width: 801px) and (max-height: 850px) {
  .sidebar {
    padding-block: 16px 10px;
  }
  .sidebar nav {
    margin-top: 14px;
    gap: 2px;
  }
  .sidebar-dept-header {
    margin-top: 12px;
    padding: 10px 10px 4px;
  }
  .sidebar-dept-header:first-child,
  .sidebar-dept-header.is-first-visible {
    margin-top: 0;
    padding-top: 2px;
  }
  .sidebar nav > a,
  .sidebar nav .research-nav-parent > a {
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .sidebar nav .research-nav-toggle {
    width: 24px;
    height: 24px;
  }
  .sidebar nav .research-nav-menu {
    margin: 3px 0 10px 14px;
    padding: 4px 3px 5px 9px;
  }
  .sidebar nav .research-nav-menu .nav-sub-divider {
    padding: 7px 8px 3px;
    margin-top: 4px;
  }
  .sidebar nav .research-nav-menu .nav-sub-divider.is-first-visible {
    margin-top: 0;
    padding-top: 2px;
  }
  #sidebar nav .research-nav-menu a {
    box-sizing: border-box;
    min-height: 26px;
    padding: 4px 8px;
  }
  #sidebar nav .research-nav-menu a[data-sub-nested="true"] {
    padding-left: 16px;
  }
}
