:root{
  --font-family:"Inter",Arial,sans-serif;
  --crm-white:#ffffff;
  --crm-black:#252525;
  --crm-black-deep:#111111;
  --crm-black-soft:#2f2f2f;
  --crm-bg:#f5f5f3;
  --crm-bg-soft:#f8f8f7;
  --crm-panel:#ffffff;
  --crm-panel-muted:#f1f1ef;
  --crm-line:#e5e2dc;
  --crm-line-soft:rgba(37,37,37,.08);
  --crm-text:#252525;
  --crm-muted:rgba(37,37,37,.58);
  --crm-muted-light:rgba(37,37,37,.38);
  --crm-accent:#b1976b;
  --crm-accent-hover:#9f865f;
  --crm-accent-soft:rgba(177,151,107,.14);
  --crm-accent-line:rgba(177,151,107,.34);
  --crm-green:#4f9f73;
  --crm-red:#c45b5b;
  --crm-orange:#c98745;
  --crm-blue:#5d6f9f;
  --crm-radius-sm:0px;
  --crm-radius-md:0px;
  --crm-radius-lg:0px;
  --crm-radius-xl:0px;
  --crm-shadow:0 18px 50px rgba(37,37,37,.08);
  --crm-shadow-soft:0 10px 32px rgba(37,37,37,.06);
}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{min-height:100vh;font-family:var(--font-family);color:var(--crm-text);background:var(--crm-bg);font-size:14px;font-weight:400}
a{color:inherit;text-decoration:none}
button,input,textarea,select{font:inherit}
button{cursor:pointer}
img{display:block;max-width:100%}
svg{display:block}

.crm-body{background:var(--crm-bg)}
.crm-shell{min-height:100vh;display:grid;grid-template-columns:280px minmax(0,1fr);background:linear-gradient(90deg,var(--crm-white) 0,var(--crm-white) 280px,var(--crm-bg) 280px,var(--crm-bg) 100%)}
.crm-workspace{min-width:0;display:flex;flex-direction:column;min-height:100vh}
.crm-sidebar{position:sticky;top:0;height:100vh;padding:28px 22px;display:flex;flex-direction:column;gap:26px;border-right:1px solid var(--crm-line);background:var(--crm-white);z-index:30}
.crm-brand{display:flex;align-items:center;gap:13px;min-height:52px}
.crm-brand__logo{width:52px;height:52px;border-radius:0px;display:grid;place-items:center;overflow:hidden;color:var(--crm-white);font-weight:700;letter-spacing:-.04em}
.crm-brand__logo img{max-width:100%;max-height:100%;object-fit:contain}.crm-brand__logo-icon{display:none}.crm-brand__logo-full{width:100%;height:auto}
.crm-brand__logo--text{font-size:15px}
.crm-brand__text{display:flex;flex-direction:column;gap:4px;min-width:0}
.crm-brand__text strong{font-size:16px;line-height:1;font-weight:700;letter-spacing:-.04em;color:var(--crm-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crm-brand__text span{font-size:12px;font-weight:500;color:var(--crm-muted)}
.crm-sidebar-collapse{margin-left:auto;width:34px;height:34px;border:1px solid var(--crm-line);background:var(--crm-bg-soft);color:var(--crm-muted);display:grid;place-items:center;flex:0 0 auto}.crm-sidebar-collapse:hover{color:var(--crm-accent);border-color:var(--crm-accent-line)}.crm-sidebar-collapse svg{width:17px;height:17px}
.crm-nav{display:flex;flex-direction:column;gap:7px;margin-top:6px}
.crm-nav__link{min-height:46px;padding:0 14px;border-radius:0px;display:flex;align-items:center;gap:12px;color:rgba(37,37,37,.62);font-weight:600;transition:background-color .22s ease,color .22s ease,transform .22s ease}
.crm-nav__link i,.crm-nav__link svg{width:19px;height:19px;stroke-width:1.9;flex:0 0 auto}
.crm-nav__link:hover{background:var(--crm-panel-muted);color:var(--crm-text);transform:translateY(-1px)}
.crm-nav__link.is-active{background:var(--crm-accent-soft);color:var(--crm-accent);box-shadow:inset 0 0 0 1px var(--crm-accent-line)}
.crm-sidebar-card{margin-top:auto;padding:18px;border:1px solid var(--crm-line);border-radius:0px;background:linear-gradient(180deg,var(--crm-white),var(--crm-bg-soft))}
.crm-sidebar-card__label{font-size:11px;line-height:1;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--crm-accent);margin-bottom:12px}
.crm-sidebar-card__name{font-size:15px;font-weight:700;line-height:1.15;color:var(--crm-text)}
.crm-sidebar-card__meta{margin-top:7px;font-size:12px;font-weight:500;color:var(--crm-muted)}

.crm-header{height:76px;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:0 34px;border-bottom:1px solid var(--crm-line);background:rgba(255,255,255,.78);backdrop-filter:blur(18px);position:sticky;top:0;z-index:25}
.crm-header__left,.crm-header__right{display:flex;align-items:center;gap:14px;min-width:0}
.crm-breadcrumbs{display:flex;align-items:center;gap:9px;min-width:0;color:var(--crm-muted);font-size:13px;font-weight:600}
.crm-breadcrumbs a{transition:color .18s ease}.crm-breadcrumbs a:hover{color:var(--crm-accent)}
.crm-breadcrumbs span:last-child{color:var(--crm-text)}
.crm-breadcrumbs__sep{color:var(--crm-muted-light)!important}
.crm-user-pill{min-height:38px;padding:0 14px;display:flex;align-items:center;border:1px solid var(--crm-line);border-radius:0px;background:var(--crm-white);font-size:13px;font-weight:600;color:var(--crm-muted)}
.crm-logout{min-height:40px;padding:0 14px;border-radius:0px;background:var(--crm-black);color:var(--crm-white);display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:700;transition:background-color .22s ease,transform .22s ease,box-shadow .22s ease}
.crm-logout svg{width:17px;height:17px}.crm-logout:hover{background:var(--crm-accent);transform:translateY(-1px);box-shadow:var(--crm-shadow-soft)}
.crm-mobile-toggle{display:none;width:42px;height:42px;border:1px solid var(--crm-line);border-radius:0px;background:var(--crm-white);color:var(--crm-text);align-items:center;justify-content:center}.crm-mobile-toggle svg{width:21px;height:21px}

.crm-main{flex:1;padding:38px 34px 30px;min-width:0}
.crm-page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:24px}
.crm-eyebrow{display:inline-flex;margin-bottom:10px;color:var(--crm-accent);text-transform:uppercase;letter-spacing:.08em;font-size:11px;font-weight:700}
.crm-page-head h1{margin:0;max-width:950px;font-size:clamp(28px,3vw,44px);line-height:1.04;font-weight:700;letter-spacing:-.045em;color:var(--crm-text)}
.crm-page-head p{max-width:820px;margin-top:12px;color:var(--crm-muted);font-size:15px;line-height:1.62;font-weight:500}

.crm-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px}
.crm-kpi-card{min-height:142px;padding:21px;border:1px solid var(--crm-line);border-radius:0px;background:var(--crm-white);box-shadow:var(--crm-shadow-soft);position:relative;overflow:hidden;transition:transform .22s ease,box-shadow .22s ease}
.crm-kpi-card:after{content:"";position:absolute;right:-48px;top:-54px;width:132px;height:132px;border-radius:0px;background:var(--crm-accent-soft)}
.crm-kpi-card:hover{transform:translateY(-2px);box-shadow:var(--crm-shadow)}
.crm-kpi-card__label{position:relative;z-index:1;display:block;color:var(--crm-muted);font-size:12px;font-weight:700;line-height:1.35}
.crm-kpi-card strong{position:relative;z-index:1;display:block;margin-top:20px;font-size:30px;line-height:1;font-weight:700;letter-spacing:-.055em;color:var(--crm-text);font-variant-numeric:tabular-nums}
.crm-kpi-card p{position:relative;z-index:1;margin-top:9px;color:var(--crm-muted-light);font-size:12px;font-weight:600;line-height:1.35}
.crm-kpi-card--accent strong{color:var(--crm-accent)}

.crm-section-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:18px;margin-bottom:20px}
.crm-span-4{grid-column:span 4}.crm-span-5{grid-column:span 5}.crm-span-6{grid-column:span 6}.crm-span-7{grid-column:span 7}.crm-span-12{grid-column:span 12}
.crm-card{padding:23px;border:1px solid var(--crm-line);border-radius:0px;background:var(--crm-white);box-shadow:var(--crm-shadow-soft);min-height:220px}
.crm-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}.crm-card-head h2,.crm-card h2{font-size:20px;line-height:1.15;font-weight:700;letter-spacing:-.035em;color:var(--crm-text)}.crm-card-head p,.crm-card>p{margin-top:7px;color:var(--crm-muted);line-height:1.58;font-weight:500}
.crm-check-list{display:flex;flex-direction:column;gap:12px}.crm-check-list div{min-height:44px;display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:0px;background:var(--crm-bg-soft);color:var(--crm-text);font-weight:600}.crm-check-list svg{width:18px;height:18px;color:var(--crm-accent);stroke-width:2.4;flex:0 0 auto}
.crm-link-list{display:flex;flex-direction:column;gap:10px}.crm-link-list a{min-height:50px;padding:0 14px;border-radius:0px;background:var(--crm-bg-soft);display:flex;align-items:center;gap:12px;font-weight:700;color:var(--crm-text);transition:background-color .2s ease,color .2s ease,transform .2s ease}.crm-link-list a:hover{background:var(--crm-accent-soft);color:var(--crm-accent);transform:translateY(-1px)}.crm-link-list svg{width:19px;height:19px;flex:0 0 auto}
.crm-empty-module{text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:54px 24px}.crm-empty-module__icon{width:70px;height:70px;border-radius:0px;background:var(--crm-accent-soft);color:var(--crm-accent);display:grid;place-items:center;margin-bottom:18px}.crm-empty-module__icon svg{width:30px;height:30px}.crm-empty-module p{max-width:650px;margin:12px auto 0}
.crm-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:22px}.crm-btn{min-height:48px;padding:0 20px;border:none;border-radius:0px;display:inline-flex;align-items:center;justify-content:center;gap:10px;font-size:14px;font-weight:700;transition:background-color .22s ease,color .22s ease,transform .22s ease,box-shadow .22s ease}.crm-btn svg{width:18px;height:18px}.crm-btn--dark{background:var(--crm-black);color:var(--crm-white)}.crm-btn--dark:hover{background:var(--crm-accent);transform:translateY(-1px);box-shadow:var(--crm-shadow-soft)}.crm-btn:disabled{opacity:.55;cursor:not-allowed;transform:none;box-shadow:none}
.crm-alert{padding:13px 14px;border-radius:0px;font-size:13px;font-weight:700;line-height:1.45}.crm-alert--error{background:rgba(196,91,91,.12);border:1px solid rgba(196,91,91,.24);color:var(--crm-red)}
.crm-field{display:block}.crm-field>span{display:block;margin:0 0 8px 2px;color:var(--crm-muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em}.crm-field input{width:100%;height:52px;padding:0 15px;border:1px solid var(--crm-line);border-radius:0px;background:var(--crm-bg-soft);outline:none;color:var(--crm-text);font-size:14px;font-weight:600;transition:border-color .2s ease,background-color .2s ease,box-shadow .2s ease}.crm-field input:focus{border-color:var(--crm-accent-line);background:var(--crm-white);box-shadow:0 0 0 4px var(--crm-accent-soft)}
.crm-footer{height:58px;padding:0 34px;border-top:1px solid var(--crm-line);display:flex;align-items:center;justify-content:space-between;gap:16px;color:var(--crm-muted);font-size:12px;font-weight:600;background:rgba(255,255,255,.52)}

.crm-login-body{min-height:100vh;display:grid;place-items:center;padding:24px;background:var(--crm-bg)}
.crm-login-shell{width:min(1120px,100%);display:grid;grid-template-columns:minmax(0,1.1fr) 430px;gap:22px;align-items:stretch}.crm-login-visual,.crm-login-card{border:1px solid var(--crm-line);border-radius:0px;background:rgba(255,255,255,.82);backdrop-filter:blur(18px);box-shadow:var(--crm-shadow)}.crm-login-visual{min-height:560px;padding:34px;display:flex;flex-direction:column;justify-content:space-between;overflow:hidden;position:relative}.crm-login-visual:before{content:"";position:absolute;inset:auto -90px -120px auto;width:380px;height:380px;border-radius:0px;background:var(--crm-accent-soft)}.crm-login-logo{position:relative;width:76px;height:76px;border-radius:0px;display:grid;place-items:center;overflow:hidden;color:var(--crm-white);font-size:18px;font-weight:700}.crm-login-logo img{max-width:88%;max-height:88%;object-fit:contain}.crm-login-visual h1{position:relative;max-width:620px;margin:0;font-size:clamp(34px,4vw,58px);line-height:.98;font-weight:700;letter-spacing:-.055em;color:var(--crm-text)}.crm-login-visual p{position:relative;max-width:590px;margin-top:18px;color:var(--crm-muted);font-size:17px;line-height:1.55;font-weight:500}.crm-login-badges{position:relative;display:flex;flex-wrap:wrap;gap:10px}.crm-login-badges span{min-height:38px;padding:0 13px;border:1px solid var(--crm-line);border-radius:0px;background:var(--crm-white);display:inline-flex;align-items:center;gap:8px;color:var(--crm-muted);font-size:13px;font-weight:700}.crm-login-badges svg{width:17px;height:17px;color:var(--crm-accent)}.crm-login-card{padding:32px;display:flex;flex-direction:column;justify-content:center;gap:18px}.crm-login-card__head{display:flex;align-items:center;gap:14px;margin-bottom:8px}.crm-login-card__head h2{font-size:25px;line-height:1;font-weight:700;letter-spacing:-.04em}.crm-login-card__head p{margin-top:7px;color:var(--crm-muted);font-weight:500}.crm-login-icon{width:52px;height:52px;border-radius:0px;background:var(--crm-accent-soft);color:var(--crm-accent);display:grid;place-items:center;flex:0 0 auto}.crm-login-icon svg{width:23px;height:23px}.crm-login-card .crm-btn{width:100%;margin-top:4px}.crm-login-note{margin-top:4px;text-align:center;color:var(--crm-muted-light);font-size:12px;line-height:1.45;font-weight:600}
.crm-sidebar-overlay{display:none}

@media(max-width:1280px){.crm-shell{grid-template-columns:1fr;background:var(--crm-bg)}.crm-sidebar{position:fixed;left:0;top:0;bottom:0;width:286px;transform:translateX(-100%);transition:transform .28s ease;box-shadow:var(--crm-shadow);height:100vh}.crm-sidebar.is-open{transform:translateX(0)}.crm-sidebar-overlay{display:block;position:fixed;inset:0;background:rgba(0,0,0,.32);z-index:20;opacity:0;visibility:hidden;transition:.25s}.crm-sidebar-overlay.is-open{opacity:1;visibility:visible}.crm-mobile-toggle{display:inline-flex}.crm-main{padding:28px 20px 30px}.crm-header{padding:0 20px}.crm-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.crm-login-shell{grid-template-columns:1fr;max-width:680px}.crm-login-visual{min-height:420px}.crm-login-card{padding:28px}}
@media(max-width:820px){.crm-header{height:auto;min-height:68px;align-items:flex-start;padding:14px 16px;flex-direction:column}.crm-header__left,.crm-header__right{width:100%;justify-content:space-between}.crm-user-pill{display:none}.crm-main{padding:22px 14px 26px}.crm-page-head{margin-bottom:18px}.crm-kpi-grid{grid-template-columns:1fr}.crm-span-4,.crm-span-5,.crm-span-6,.crm-span-7,.crm-span-12{grid-column:span 12}.crm-card{padding:18px;border-radius:0px;padding:18px 16px;align-items:flex-start;flex-direction:column}.crm-login-body{padding:12px}.crm-login-visual{display:none}.crm-login-card{border-radius:0px;padding:24px 18px}.crm-actions>*{width:100%}.crm-logout span{display:none}.crm-logout{width:40px;padding:0;justify-content:center}}
@media(max-width:520px){.crm-main{padding:18px 10px 24px}.crm-page-head h1{font-size:28px}.crm-page-head p{font-size:14px}.crm-sidebar{width:calc(100vw - 44px)}}


/* STRICT MODE: без скруглений и декоративных кругов */
.crm-kpi-card:after,
.crm-login-visual:before{
  display:none!important;
  content:none!important;
}

*,
*::before,
*::after{
  border-radius:0px!important;
}

.crm-login-body{
  background:var(--crm-bg)!important;
}

/* Yandex Metrika Leads module — strict CRM style */
.crm-kpi-card:after,.crm-login-visual:before{display:none!important}
.ym-status-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px}.ym-status-card{min-height:124px}.ym-status-card--wide{grid-column:span 2}.ym-status-label{font-size:11px;line-height:1;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--crm-accent);margin-bottom:16px}.ym-status-card strong{display:block;font-size:24px;line-height:1;font-weight:700;letter-spacing:-.04em;color:var(--crm-text)}.ym-status-card p{margin-top:10px!important;color:var(--crm-muted);font-size:13px;line-height:1.45}.ym-connect,.ym-tabs-card,.ym-report-card{margin-bottom:20px}.ym-connect-grid{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:end}.ym-tabs{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ym-tab{min-height:44px;padding:0 14px;border:1px solid var(--crm-line);background:var(--crm-white);display:inline-flex;align-items:center;gap:8px;color:var(--crm-muted);font-size:13px;font-weight:700;transition:background-color .2s ease,color .2s ease,border-color .2s ease}.ym-tab svg{width:17px;height:17px}.ym-tab.is-active{background:var(--crm-black);border-color:var(--crm-black);color:var(--crm-white)}.ym-tab:disabled{opacity:.55;cursor:not-allowed}.ym-filters-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px}.crm-field select{width:100%;height:52px;padding:0 15px;border:1px solid var(--crm-line);border-radius:0;background:var(--crm-bg-soft);outline:none;color:var(--crm-text);font-size:14px;font-weight:600;transition:border-color .2s ease,background-color .2s ease,box-shadow .2s ease}.crm-field select:focus{border-color:var(--crm-accent);background:var(--crm-white);box-shadow:inset 3px 0 0 var(--crm-accent)}.ym-report-buttons{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:18px}.ym-progress{margin-top:18px;padding:14px;border:1px solid var(--crm-line);background:var(--crm-bg-soft)}.ym-progress__bar{height:8px;background:var(--crm-line);overflow:hidden}.ym-progress__bar i{display:block;height:100%;width:4%;background:var(--crm-accent);transition:width .25s ease}.ym-progress__text{margin-top:10px;color:var(--crm-muted);font-size:12px;font-weight:700;text-align:center}.ym-result-kpis{margin-top:4px}.ym-bar-chart{height:300px;display:flex;align-items:flex-end;gap:6px;padding:16px;border:1px solid var(--crm-line);background:var(--crm-bg-soft);overflow:hidden}.ym-bar{flex:1;min-width:18px;background:var(--crm-black);position:relative;display:flex;align-items:flex-end;justify-content:center;color:var(--crm-white);transition:background-color .2s ease}.ym-bar:hover{background:var(--crm-accent)}.ym-bar span{position:absolute;bottom:-32px;left:50%;transform:translateX(-50%) rotate(-35deg);transform-origin:center;white-space:nowrap;color:var(--crm-muted);font-size:10px;font-weight:700}.ym-bar b{position:absolute;top:-24px;color:var(--crm-text);font-size:11px;font-weight:700}.ym-table-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ym-table-wrap{overflow:auto;border:1px solid var(--crm-line);background:var(--crm-white)}.ym-table{width:100%;min-width:680px;border-collapse:collapse;font-size:13px}.ym-table th{padding:13px 14px;text-align:left;color:var(--crm-muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;background:var(--crm-bg-soft);border-bottom:1px solid var(--crm-line);white-space:nowrap;cursor:pointer}.ym-table td{padding:13px 14px;border-bottom:1px solid var(--crm-line-soft);color:var(--crm-text);vertical-align:middle}.ym-table tr:last-child td{border-bottom:none}.ym-table .num{text-align:right;font-variant-numeric:tabular-nums;font-weight:700}.ym-empty{padding:28px;border:1px dashed var(--crm-line);background:var(--crm-bg-soft);color:var(--crm-muted);font-weight:700;text-align:center}@media(max-width:1280px){.ym-status-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ym-filters-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:820px){.ym-status-grid,.ym-filters-grid,.ym-connect-grid{grid-template-columns:1fr}.ym-status-card--wide{grid-column:span 1}.ym-report-buttons .crm-btn,.ym-table-actions .crm-btn{width:100%}.ym-bar-chart{height:240px}.ym-tabs{display:grid;grid-template-columns:1fr}.ym-tab{justify-content:center}}


/* Yandex Metrika counters settings */
.ym-top-actions{display:flex;justify-content:flex-end;margin:-6px 0 16px}.ym-settings-modal[hidden]{display:none}.ym-settings-modal{position:fixed;inset:0;z-index:100;display:grid;grid-template-columns:minmax(0,1fr) min(620px,calc(100vw - 28px))}.ym-settings-backdrop{background:rgba(37,37,37,.38)}.ym-settings-panel{height:100vh;overflow:auto;background:var(--crm-white);border-left:1px solid var(--crm-line);box-shadow:var(--crm-shadow);padding:26px;display:flex;flex-direction:column;gap:18px}.ym-settings-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding-bottom:18px;border-bottom:1px solid var(--crm-line)}.ym-settings-head h2{margin:0;font-size:24px;line-height:1;font-weight:700;letter-spacing:-.04em;color:var(--crm-text)}.ym-settings-head p{max-width:430px;margin-top:10px;color:var(--crm-muted);font-size:13px;line-height:1.55;font-weight:600}.ym-settings-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.ym-settings-toolbar--form{margin-top:14px}.ym-counter-form{padding:18px;border:1px solid var(--crm-line);background:var(--crm-bg-soft)}.ym-counter-form__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.ym-settings-note{padding:13px 14px;border-left:4px solid var(--crm-accent);background:var(--crm-bg-soft);color:var(--crm-muted);font-size:13px;line-height:1.5;font-weight:600}.ym-settings-note strong{color:var(--crm-text)}.ym-counters-admin{display:flex;flex-direction:column;gap:10px}.ym-counter-admin-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:center;padding:16px;border:1px solid var(--crm-line);background:var(--crm-white)}.ym-counter-admin-card__main{min-width:0}.ym-counter-admin-card__title{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.ym-counter-admin-card__title strong{font-size:16px;line-height:1.15;font-weight:700;color:var(--crm-text)}.ym-counter-state{display:inline-flex;min-height:24px;align-items:center;padding:0 8px;border:1px solid var(--crm-line);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em}.ym-counter-state.is-active{border-color:var(--crm-accent-line);background:var(--crm-accent-soft);color:var(--crm-accent)}.ym-counter-state.is-disabled{background:var(--crm-panel-muted);color:var(--crm-muted)}.ym-counter-admin-card__meta{display:flex;flex-wrap:wrap;gap:8px 14px;margin-top:8px;color:var(--crm-muted);font-size:12px;font-weight:700}.ym-counter-admin-card__actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}body.ym-settings-open{overflow:hidden}@media(max-width:820px){.ym-settings-modal{grid-template-columns:1fr}.ym-settings-backdrop{display:none}.ym-settings-panel{width:100%;padding:18px}.ym-counter-form__grid,.ym-counter-admin-card{grid-template-columns:1fr}.ym-counter-admin-card__actions .crm-btn,.ym-settings-toolbar .crm-btn{width:100%}.ym-settings-head{flex-direction:column}.ym-top-actions .crm-btn{width:100%}}

/* Yandex Metrika OAuth settings inside counters modal */
.ym-settings-block{padding:18px;border:1px solid var(--crm-line);background:var(--crm-bg-soft)}
.ym-settings-block__head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:16px;padding-bottom:16px;border-bottom:1px solid var(--crm-line)}
.ym-settings-block__head h3{margin:0;font-size:18px;line-height:1.1;font-weight:700;letter-spacing:-.035em;color:var(--crm-text)}
.ym-settings-block__head p{max-width:440px;margin-top:8px;color:var(--crm-muted);font-size:13px;line-height:1.55;font-weight:600}
.ym-oauth-status{min-height:30px;padding:7px 10px;border:1px solid var(--crm-line);background:var(--crm-white);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--crm-muted);white-space:nowrap}
.ym-oauth-status.is-connected{border-color:var(--crm-accent-line);background:var(--crm-accent-soft);color:var(--crm-accent)}
.ym-oauth-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.ym-oauth-grid .crm-field:nth-child(3){grid-column:span 2}.ym-oauth-grid .crm-field:nth-child(4){grid-column:span 2}
.ym-connect-grid--settings{margin-top:14px;display:grid;grid-template-columns:minmax(220px,1fr) auto auto auto;gap:10px;align-items:end}.ym-connect-grid--settings .crm-btn{white-space:nowrap}.crm-btn.is-disabled{opacity:.5;pointer-events:none}
.ym-settings-note code{padding:1px 4px;border:1px solid var(--crm-line);background:var(--crm-white);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;color:var(--crm-text)}
@media(max-width:820px){.ym-settings-block__head{flex-direction:column}.ym-oauth-grid{grid-template-columns:1fr}.ym-oauth-grid .crm-field:nth-child(3),.ym-oauth-grid .crm-field:nth-child(4){grid-column:auto}.ym-connect-grid--settings{grid-template-columns:1fr}.ym-connect-grid--settings .crm-btn{width:100%}}


/* Yandex Metrika strict grid refresh */
.ym-table-actions{display:grid;grid-auto-flow:column;grid-auto-columns:max-content;justify-content:end;align-items:center;gap:10px}.ym-table-actions .crm-btn{min-height:42px;padding:0 14px;font-weight:700;white-space:nowrap}.ym-table-actions .crm-btn svg{width:17px;height:17px}.ym-report-card>.crm-card-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start}.ym-report-buttons{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.ym-report-buttons .crm-btn{width:100%;min-height:46px;padding:0 12px;font-weight:700}.ym-result-card{grid-column:1/-1;min-height:0}.ym-result-card--chart .ym-bar-chart{width:100%;height:360px}.ym-result-card--table .ym-table-wrap{width:100%}.ym-result-card--table .ym-table{min-width:100%}.ym-settings-modal{grid-template-columns:minmax(0,1fr) min(920px,calc(100vw - 32px))}.ym-settings-panel{gap:20px;padding:28px}.ym-settings-head h2{font-weight:700}.ym-settings-block{background:var(--crm-white)}.ym-settings-block__head h3,.ym-counter-admin-card__title strong{font-weight:700}.ym-settings-toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:stretch}.ym-settings-toolbar .crm-btn{width:100%;min-height:44px;padding:0 14px;font-weight:700;white-space:nowrap}.ym-settings-toolbar--form{grid-template-columns:repeat(2,minmax(0,1fr))}.ym-settings-toolbar--counter-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.ym-connect-grid--settings{margin-top:14px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:end}.ym-connect-grid--settings .crm-field{grid-column:1/-1}.ym-connect-grid--settings .crm-btn{width:100%;min-height:44px;padding:0 12px;font-weight:700;white-space:normal;text-align:center}.ym-connect-grid--settings .crm-btn span{line-height:1.2}.ym-oauth-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.ym-oauth-grid .crm-field:nth-child(3),.ym-oauth-grid .crm-field:nth-child(4){grid-column:auto}.ym-counter-form__grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.ym-settings-progress{padding:14px;border:1px solid var(--crm-line);background:var(--crm-bg-soft)}.ym-settings-progress__bar{height:8px;background:var(--crm-line);overflow:hidden}.ym-settings-progress__bar i{display:block;height:100%;width:4%;background:var(--crm-accent);transition:width .25s ease}.ym-settings-progress__text{margin-top:10px;color:var(--crm-muted);font-size:12px;font-weight:700;text-align:center}.ym-progress__text,.ym-bar span,.ym-bar b,.ym-table .num,.ym-status-label,.ym-status-card strong,.ym-tab,.crm-field>span,.crm-btn{font-weight:700}.ym-table th{font-weight:700}.ym-oauth-status,.ym-counter-state{font-weight:700}.ym-counter-admin-card{grid-template-columns:minmax(0,1fr) minmax(220px,auto)}.ym-counter-admin-card__actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.ym-counter-admin-card__actions .crm-btn{min-height:40px;padding:0 12px;font-weight:700}@media(max-width:1180px){.ym-report-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}.ym-table-actions{grid-auto-flow:row;grid-template-columns:1fr}.ym-table-actions .crm-btn{width:100%}.ym-report-card>.crm-card-head{grid-template-columns:1fr}.ym-settings-modal{grid-template-columns:minmax(0,1fr) min(820px,calc(100vw - 28px))}}@media(max-width:820px){.ym-settings-modal{grid-template-columns:1fr}.ym-settings-toolbar,.ym-settings-toolbar--form,.ym-settings-toolbar--counter-actions,.ym-connect-grid--settings,.ym-oauth-grid,.ym-counter-form__grid,.ym-counter-admin-card,.ym-counter-admin-card__actions,.ym-report-buttons{grid-template-columns:1fr}.ym-settings-panel{padding:18px}.ym-result-card--chart .ym-bar-chart{height:260px}}

/* Metrika filters update: rows, checkboxes, compact charts */
.ym-filters{display:flex;flex-direction:column;gap:16px}
.ym-filters-row{display:grid;gap:14px;align-items:start}
.ym-filters-row--main{grid-template-columns:180px 180px minmax(0,1fr)}
.ym-filters-row--secondary{grid-template-columns:minmax(180px,.8fr) minmax(280px,1.4fr) minmax(180px,.8fr)}
.ym-counter-picker-field{min-width:0}
.ym-counter-picker-head{min-height:34px;padding:8px 12px;border:1px solid var(--crm-line);border-bottom:0;background:var(--crm-white);color:var(--crm-muted);font-size:12px;font-weight:700}
.ym-counter-picker{display:grid;gap:0;border:1px solid var(--crm-line);background:var(--crm-white);max-height:148px;overflow:auto}
.ym-counter-check{min-height:42px;display:flex;align-items:center;gap:9px;padding:9px 11px;border-right:1px solid var(--crm-line-soft);border-bottom:1px solid var(--crm-line-soft);font-size:13px;font-weight:700;color:var(--crm-text);cursor:pointer}
.ym-counter-check input{width:16px;height:16px;accent-color:var(--crm-accent);flex:0 0 auto}
.ym-counter-check span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ym-empty--compact{padding:12px;border:0;text-align:left}
.ym-chart-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,320px);gap:18px;align-items:stretch;width:100%;height:100%}
.ym-chart-bars{min-height:260px;display:flex;align-items:flex-end;justify-content:center;gap:4px;padding:28px 12px 38px;border:1px solid var(--crm-line);background:var(--crm-white);overflow:hidden}
.ym-chart-bars .ym-bar{flex:0 1 28px;max-width:34px;min-width:8px;background:var(--crm-black);position:relative;display:flex;align-items:flex-end;justify-content:center;color:var(--crm-white);transition:background-color .2s ease}
.ym-chart-bars .ym-bar:hover{background:var(--crm-accent)}
.ym-chart-bars .ym-bar b{position:absolute;top:-22px;color:var(--crm-text);font-size:10px;font-weight:700;white-space:nowrap}
.ym-chart-bars .ym-bar span{position:absolute;bottom:-26px;left:50%;transform:translateX(-50%) rotate(-35deg);transform-origin:center;white-space:nowrap;color:var(--crm-muted);font-size:10px;font-weight:700;max-width:80px;overflow:hidden;text-overflow:ellipsis}
.ym-chart-legend{border:1px solid var(--crm-line);background:var(--crm-white);padding:12px;display:grid;grid-template-columns:1fr;gap:7px;overflow:auto;max-height:300px}
.ym-chart-legend__item{display:grid;grid-template-columns:10px minmax(0,1fr) auto;gap:9px;align-items:center;padding:6px 0;border-bottom:1px solid var(--crm-line-soft);font-size:12px;font-weight:700;color:var(--crm-text)}
.ym-chart-legend__item:last-child{border-bottom:0}
.ym-chart-legend__item i{width:10px;height:10px;background:var(--crm-black);display:block}
.ym-chart-legend__item span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--crm-muted)}
.ym-chart-legend__item b{font-variant-numeric:tabular-nums;color:var(--crm-text)}
.ym-table td:first-child{font-weight:700}
@media(max-width:1280px){.ym-filters-row--main{grid-template-columns:repeat(2,minmax(0,1fr))}.ym-counter-picker-field{grid-column:1/-1}.ym-counter-picker{grid-template-columns:repeat(2,minmax(0,1fr))}.ym-filters-row--secondary{grid-template-columns:1fr}.ym-chart-layout{grid-template-columns:1fr}.ym-chart-legend{max-height:220px}}
@media(max-width:820px){.ym-filters-row--main,.ym-filters-row--secondary{grid-template-columns:1fr}.ym-counter-picker{grid-template-columns:1fr}.ym-chart-bars{min-height:220px}.ym-chart-bars .ym-bar{flex-basis:18px;max-width:24px}}

/* =========================================================
   ЯНДЕКС.МЕТРИКА — УНИВЕРСАЛЬНЫЕ ОТЧЁТЫ
   ========================================================= */
.crm-kpi-card::after{display:none!important;content:none!important}
.ym-sync-strip{display:flex;align-items:center;justify-content:space-between;gap:22px;padding:15px 18px;margin-bottom:14px;border:1px solid var(--crm-line);background:var(--crm-white);box-shadow:var(--crm-shadow-soft)}
.ym-sync-strip__main{min-width:0;display:grid;grid-template-columns:auto auto minmax(240px,1fr);align-items:center;gap:10px 18px}
.ym-sync-strip__main>span{color:var(--crm-muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em}
.ym-sync-strip__main>strong{font-size:14px;font-weight:700;white-space:nowrap}
.ym-sync-strip__main>p{margin:0;color:var(--crm-muted);font-size:12px;line-height:1.45}
.ym-tabs-card{padding:0;min-height:0;margin-bottom:14px;overflow:hidden}
.ym-tabs{display:flex;align-items:stretch;overflow-x:auto;border-bottom:1px solid var(--crm-line);background:var(--crm-white)}
.ym-tab{min-height:54px;padding:0 17px;border:0;border-right:1px solid var(--crm-line);background:var(--crm-white);color:var(--crm-muted);display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap;font-weight:700;transition:background-color .18s ease,color .18s ease,box-shadow .18s ease}
.ym-tab svg{width:17px;height:17px}
.ym-tab:hover{background:var(--crm-bg-soft);color:var(--crm-text)}
.ym-tab.is-active{background:var(--crm-accent-soft);color:var(--crm-accent);box-shadow:inset 0 -3px 0 var(--crm-accent)}
.ym-last-report{display:flex;align-items:center;gap:18px;min-height:70px;padding:12px 18px;background:var(--crm-bg-soft)}
.ym-last-report__label{flex:0 0 auto;color:var(--crm-accent);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.07em}
.ym-last-report__empty{color:var(--crm-muted);font-size:13px}
.ym-last-report__grid{width:100%;display:grid;grid-template-columns:1fr .65fr 1.25fr 1.25fr;gap:12px}
.ym-last-report__grid>div{min-width:0;padding-left:12px;border-left:2px solid var(--crm-line)}
.ym-last-report__grid span{display:block;margin-bottom:4px;color:var(--crm-muted);font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.05em}
.ym-last-report__grid strong{display:block;overflow:hidden;text-overflow:ellipsis;color:var(--crm-text);font-size:12px;line-height:1.35;white-space:nowrap}
.ym-report-card{margin-bottom:18px}
.ym-report-head{margin-bottom:16px}
.ym-filters{display:flex;flex-direction:column;gap:14px}
.ym-filters-row{display:grid;gap:14px}
.ym-filters-row--main{grid-template-columns:minmax(170px,.55fr) minmax(170px,.55fr) minmax(360px,2fr);align-items:start}
.ym-filters-row--secondary{grid-template-columns:repeat(3,minmax(0,1fr));padding-top:14px;border-top:1px solid var(--crm-line)}
.crm-field select{width:100%;height:52px;padding:0 15px;border:1px solid var(--crm-line);border-radius:0;background:var(--crm-bg-soft);outline:none;color:var(--crm-text);font-size:14px;font-weight:600}
.crm-field select:focus{border-color:var(--crm-accent);box-shadow:inset 3px 0 0 var(--crm-accent);background:var(--crm-white)}
.crm-field.is-hidden{display:none}
.ym-counter-picker-field{min-width:0}
.ym-counter-picker-head{min-height:42px;padding:10px 12px;border:1px solid var(--crm-line);border-bottom:0;background:var(--crm-black);color:var(--crm-white);display:flex;align-items:center;font-size:12px;font-weight:700}
.ym-counter-picker{border:1px solid var(--crm-line);background:var(--crm-white);max-height:182px;overflow:auto}
.ym-counter-picker-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.ym-counter-picker-list--excluded{border-top:1px solid var(--crm-line);background:var(--crm-bg-soft)}
.ym-counter-picker-subtitle{grid-column:1/-1;padding:8px 11px;border-bottom:1px solid var(--crm-line);color:var(--crm-muted);font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.06em}
.ym-counter-check{min-height:40px;padding:8px 10px;border-right:1px solid var(--crm-line);border-bottom:1px solid var(--crm-line);display:flex;align-items:flex-start;gap:9px;color:var(--crm-text);font-size:12px;font-weight:600;line-height:1.35;cursor:pointer}
.ym-counter-check:nth-child(2n){border-right:0}
.ym-counter-check input{width:16px;height:16px;margin-top:1px;accent-color:var(--crm-accent);flex:0 0 auto}
.ym-counter-check.is-excluded{color:var(--crm-muted)}
.ym-counter-picker-toggle{width:100%;min-height:34px;border:1px solid var(--crm-line);border-top:0;background:var(--crm-bg-soft);color:var(--crm-muted);font-size:11px;font-weight:700;text-align:left;padding:0 11px}
.ym-counter-picker-toggle:hover{color:var(--crm-accent);background:var(--crm-accent-soft)}
.ym-report-buttons{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:18px;padding-top:16px;border-top:1px solid var(--crm-line)}
.ym-report-buttons .crm-btn{min-height:42px;padding:0 14px;background:var(--crm-panel-muted);color:var(--crm-text);border:1px solid var(--crm-line);font-size:12px}
.ym-report-buttons .crm-btn:hover,.ym-report-buttons .crm-btn.is-current{background:var(--crm-black);border-color:var(--crm-black);color:var(--crm-white);box-shadow:none;transform:none}
.ym-progress{margin-top:15px;padding:12px;border:1px solid var(--crm-line);background:var(--crm-bg-soft)}
.ym-progress__bar,.ym-settings-progress__bar{height:7px;background:var(--crm-line);overflow:hidden}
.ym-progress__bar i,.ym-settings-progress__bar i{display:block;height:100%;width:0;background:var(--crm-accent);transition:width .25s ease}
.ym-progress__text,.ym-settings-progress__text{margin-top:8px;color:var(--crm-muted);font-size:11px;font-weight:700;text-align:center}
.ym-result-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}
.ym-result-kpis .crm-kpi-card{min-height:116px;padding:17px}
.ym-result-kpis .crm-kpi-card strong{margin-top:15px;font-size:26px}
.ym-result-card{min-height:0}
.ym-bar-chart{min-height:300px}
.ym-chart-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(260px,.75fr);gap:22px;min-height:270px}
.ym-chart-bars{height:270px;padding:22px 10px 0;border-left:1px solid var(--crm-line);border-bottom:1px solid var(--crm-line);background:linear-gradient(to top,rgba(37,37,37,.035) 1px,transparent 1px);background-size:100% 25%;display:flex;align-items:flex-end;justify-content:center;gap:7px;overflow-x:auto}
.ym-bar{position:relative;flex:0 1 28px;min-width:14px;max-width:28px;border:0;background:var(--crm-accent);color:var(--crm-white);display:flex;align-items:flex-start;justify-content:center;transition:background-color .15s ease,opacity .15s ease;padding:0}
.ym-bar:hover{background:var(--crm-black)}
.ym-bar>b{position:absolute;left:50%;bottom:calc(100% + 5px);transform:translateX(-50%);color:var(--crm-text);font-size:10px;font-weight:700;white-space:nowrap}
.ym-bar>span{position:absolute;left:0;right:0;bottom:-19px;color:var(--crm-muted);font-size:10px;font-weight:700;text-align:center}
.ym-chart-legend{max-height:270px;overflow:auto;border:1px solid var(--crm-line);background:var(--crm-white)}
.ym-chart-legend__item{width:100%;min-height:38px;padding:7px 9px;border:0;border-bottom:1px solid var(--crm-line);background:var(--crm-white);display:grid;grid-template-columns:24px minmax(0,1fr) auto;align-items:center;gap:8px;text-align:left;color:var(--crm-text)}
.ym-chart-legend__item:hover{background:var(--crm-accent-soft)}
.ym-chart-legend__item i{width:24px;height:24px;background:var(--crm-black);color:var(--crm-white);display:grid;place-items:center;font-style:normal;font-size:10px;font-weight:700}
.ym-chart-legend__item span{font-size:11px;font-weight:600;line-height:1.35;overflow-wrap:anywhere}
.ym-chart-legend__item b{color:var(--crm-accent);font-size:11px;font-weight:700;white-space:nowrap}
.ym-table-wrap{overflow:auto;border:1px solid var(--crm-line)}
.ym-table{width:100%;min-width:880px;border-collapse:collapse;font-size:12px}
.ym-table th{padding:11px 12px;border-right:1px solid var(--crm-line);border-bottom:1px solid var(--crm-line);background:var(--crm-bg-soft);color:var(--crm-muted);font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;cursor:pointer}
.ym-table td{padding:11px 12px;border-right:1px solid var(--crm-line-soft);border-bottom:1px solid var(--crm-line-soft);vertical-align:top;line-height:1.4}
.ym-table td.num,.ym-table th.num{text-align:right;font-variant-numeric:tabular-nums}
.ym-table tr:hover td{background:rgba(177,151,107,.06)}
.ym-empty{padding:24px;border:1px dashed var(--crm-line);background:var(--crm-bg-soft);color:var(--crm-muted);text-align:center;font-size:12px}
.ym-empty--compact{padding:12px;grid-column:1/-1}

/* Детализация графика */
.ym-detail-modal[hidden]{display:none!important}
.ym-detail-modal{position:fixed;inset:0;z-index:120}
.ym-detail-backdrop{position:absolute;inset:0;background:rgba(17,17,17,.55)}
.ym-detail-panel{position:absolute;right:0;top:0;width:min(760px,100%);height:100%;overflow:auto;padding:26px;background:var(--crm-white);border-left:1px solid var(--crm-line);box-shadow:-20px 0 55px rgba(0,0,0,.14)}
.ym-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding-bottom:18px;border-bottom:1px solid var(--crm-line)}
.ym-detail-head h2{margin-top:7px;font-size:25px;line-height:1.1}
.ym-detail-head p{margin-top:8px;color:var(--crm-muted);font-size:12px}
.ym-detail-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin-top:18px;border:1px solid var(--crm-line)}
.ym-detail-kpis>div{min-height:92px;padding:15px;border-right:1px solid var(--crm-line);background:var(--crm-bg-soft)}
.ym-detail-kpis>div:last-child{border-right:0}
.ym-detail-kpis span{display:block;color:var(--crm-muted);font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.05em}
.ym-detail-kpis strong{display:block;margin-top:14px;font-size:21px;font-weight:700}
.ym-detail-comparison{margin-top:16px}
.ym-comparison-card{padding:14px 16px;border:1px solid var(--crm-line);border-left:4px solid var(--crm-accent);background:var(--crm-white)}
.ym-comparison-card.down{border-left-color:var(--crm-red)}
.ym-comparison-card.up{border-left-color:var(--crm-green)}
.ym-comparison-card>span{display:block;color:var(--crm-muted);font-size:11px}
.ym-comparison-card>strong{display:block;margin-top:8px;font-size:18px}
.ym-comparison-card>p{margin-top:5px;color:var(--crm-muted);font-size:12px}
.ym-detail-chart{margin-top:18px;padding:16px;border:1px solid var(--crm-line);background:var(--crm-bg-soft)}
.ym-detail-chart-legend{display:flex;gap:18px;margin-bottom:12px;color:var(--crm-muted);font-size:11px;font-weight:700}
.ym-detail-chart-legend span{display:flex;align-items:center;gap:7px}.ym-detail-chart-legend i{width:14px;height:8px;background:var(--crm-accent)}.ym-detail-chart-legend i.previous{background:var(--crm-black)}
.ym-detail-bars{height:220px;display:flex;align-items:flex-end;gap:4px;border-left:1px solid var(--crm-line);border-bottom:1px solid var(--crm-line);overflow-x:auto;padding:0 8px 20px}
.ym-detail-day{height:100%;min-width:22px;flex:1;display:flex;flex-direction:column;justify-content:flex-end;position:relative}
.ym-detail-day__bars{height:100%;display:flex;align-items:flex-end;justify-content:center;gap:2px}
.ym-detail-day__bars i{display:block;width:8px;background:var(--crm-accent)}.ym-detail-day__bars i.previous{background:var(--crm-black);opacity:.7}
.ym-detail-day>span{position:absolute;bottom:-18px;left:50%;transform:translateX(-50%);font-size:9px;color:var(--crm-muted);white-space:nowrap}
body.ym-detail-open{overflow:hidden}

@media(max-width:1100px){
  .ym-sync-strip__main{grid-template-columns:auto auto;}.ym-sync-strip__main>p{grid-column:1/-1}
  .ym-last-report__grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ym-filters-row--main{grid-template-columns:repeat(2,minmax(0,1fr))}.ym-counter-picker-field{grid-column:1/-1}
  .ym-chart-layout{grid-template-columns:1fr}.ym-chart-legend{max-height:220px}
}
@media(max-width:760px){
  .ym-sync-strip{align-items:flex-start;flex-direction:column}.ym-sync-strip .crm-btn{width:100%}
  .ym-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible}.ym-tab{border-bottom:1px solid var(--crm-line)}
  .ym-last-report{align-items:flex-start;flex-direction:column}.ym-last-report__grid{grid-template-columns:1fr;width:100%}
  .ym-filters-row--main,.ym-filters-row--secondary{grid-template-columns:1fr}.ym-counter-picker-list{grid-template-columns:1fr}.ym-counter-check{border-right:0}
  .ym-result-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ym-detail-panel{padding:18px}.ym-detail-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.ym-detail-kpis>div:nth-child(2){border-right:0}.ym-detail-kpis>div{border-bottom:1px solid var(--crm-line)}
}
@media(max-width:480px){.ym-tabs{grid-template-columns:1fr}.ym-result-kpis{grid-template-columns:1fr}.ym-chart-bars{gap:4px}.ym-bar{max-width:20px}.ym-detail-kpis{grid-template-columns:1fr}.ym-detail-kpis>div{border-right:0}}
.crm-page-head p:empty{display:none}


/* Metrika counter picker and report buttons — compact grid update */
.ym-counter-picker-head{
  min-height:46px;
  padding:7px 8px 7px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:var(--crm-black);
  color:var(--crm-white);
}
.ym-counter-picker-summary{
  min-width:0;
  font-size:12px;
  line-height:1.3;
  font-weight:700;
}
.ym-counter-picker-actions{
  display:flex;
  align-items:center;
  gap:6px;
  flex:0 0 auto;
}
.ym-counter-picker-actions button{
  min-height:30px;
  padding:0 10px;
  border:1px solid rgba(255,255,255,.28);
  background:transparent;
  color:var(--crm-white);
  font-size:11px;
  line-height:1;
  font-weight:600;
  white-space:nowrap;
}
.ym-counter-picker-actions button:hover{
  border-color:var(--crm-accent);
  background:var(--crm-accent);
}
.ym-counter-picker{
  max-height:236px;
}
.ym-counter-picker-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0;
}
.ym-counter-check{
  min-height:66px;
  padding:11px 12px;
  display:grid;
  grid-template-columns:18px minmax(0,1fr);
  align-items:center;
  gap:10px;
  border-right:1px solid var(--crm-line);
  border-bottom:1px solid var(--crm-line);
  background:var(--crm-white);
  overflow:hidden;
}
.ym-counter-check:nth-of-type(2n){border-right:0}
.ym-counter-check input{
  width:17px;
  height:17px;
  margin:0;
}
.ym-counter-check__content{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:5px;
}
.ym-counter-check__content strong{
  display:block;
  overflow:hidden;
  color:var(--crm-text);
  font-size:13px;
  line-height:1.25;
  font-weight:700;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.ym-counter-check__content small{
  color:var(--crm-muted);
  font-size:11px;
  line-height:1;
  font-weight:600;
  font-variant-numeric:tabular-nums;
}
.ym-counter-check.is-excluded{
  background:var(--crm-bg-soft);
}
.ym-counter-check.is-excluded .ym-counter-check__content strong{
  color:var(--crm-muted);
}
.ym-empty--compact{
  grid-column:1/-1;
  min-height:66px;
  padding:20px 14px;
}
.ym-report-buttons{
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:minmax(155px,1fr);
  align-items:stretch;
  gap:8px;
  overflow-x:auto;
  padding-bottom:2px;
}
.ym-report-buttons .crm-btn{
  width:100%;
  min-width:155px;
  white-space:nowrap;
}
@media(max-width:760px){
  .ym-counter-picker-head{
    align-items:stretch;
    flex-direction:column;
  }
  .ym-counter-picker-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
  }
  .ym-counter-picker-actions button{width:100%}
  .ym-counter-picker-list{grid-template-columns:1fr}
  .ym-counter-check{border-right:0}
  .ym-report-buttons{
    grid-auto-columns:minmax(145px,1fr);
  }
}


/* Компактная боковая панель */
@media(min-width:1281px){
  .crm-shell,.crm-sidebar,.crm-brand__text,.crm-nav__link span,.crm-sidebar-card{transition:all .22s ease}
  body.crm-sidebar-collapsed .crm-shell{grid-template-columns:76px minmax(0,1fr);background:linear-gradient(90deg,var(--crm-white) 0,var(--crm-white) 76px,var(--crm-bg) 76px,var(--crm-bg) 100%)}
  body.crm-sidebar-collapsed .crm-sidebar{padding:22px 11px;gap:20px}
  body.crm-sidebar-collapsed .crm-brand{justify-content:center;position:relative}
  body.crm-sidebar-collapsed .crm-brand__logo{width:42px;height:42px}
  body.crm-sidebar-collapsed .crm-brand__logo-full{display:none}
  body.crm-sidebar-collapsed .crm-brand__logo-icon{display:block;width:36px;height:36px}
  body.crm-sidebar-collapsed .crm-brand__text,body.crm-sidebar-collapsed .crm-sidebar-card{display:none}
  body.crm-sidebar-collapsed .crm-sidebar-collapse{position:absolute;left:50%;top:58px;transform:translateX(-50%);width:42px;height:30px}
  body.crm-sidebar-collapsed .crm-nav{margin-top:42px;align-items:center}
  body.crm-sidebar-collapsed .crm-nav__link{width:52px;height:48px;padding:0;justify-content:center;gap:0}
  body.crm-sidebar-collapsed .crm-nav__link span{display:none}
  body.crm-sidebar-collapsed .crm-nav__link svg{width:21px;height:21px}
}
