#main-navigation{position:sticky;top:0;z-index:20050;flex-shrink:0;background:#fff;color:#233b58;font:14px/1.4 Arial,sans-serif;padding:0 22px;border-bottom:1px solid #e4e8ef}
#main-navigation *{box-sizing:border-box}
#main-navigation [hidden]{display:none!important}
#main-navigation a{text-decoration:none;color:inherit;cursor:pointer}
#main-navigation a:hover{color:#075bff}
#main-navigation a:focus-visible{outline:2px solid #075bff;outline-offset:-2px;border-radius:3px}
.main-menu{display:flex;align-items:stretch;gap:26px;min-height:56px;border-bottom:1px solid #e7eaf0}
.main-menu-group{position:relative;flex-shrink:0}
.main-menu-title{display:flex;align-items:center;min-height:56px;padding:0 3px;border-bottom:2px solid transparent;white-space:nowrap}
.main-menu-title.is-active{border-bottom-color:#075bff;color:#075bff!important}
.main-menu-popup{display:none;position:absolute;top:100%;left:-14px;min-width:250px;padding:10px;background:#fff;border:1px solid #e3e8f2;border-radius:0 0 9px 9px;box-shadow:0 10px 24px #172b4d24}
.main-menu-group.is-open>.main-menu-popup{display:block}
.main-menu-popup a{display:block;white-space:nowrap;padding:10px 12px;border-radius:5px}
.main-menu-popup a:hover,.main-menu-popup a[aria-current=page]{background:#f0f5ff;color:#075bff!important}
.main-menu-item{position:relative}
.main-menu-yandex span{float:right;padding-left:40px}
.main-menu-yandex-popup{display:none;position:absolute;left:100%;top:-10px;min-width:265px;padding:10px;background:white;border:1px solid #e3e8f2;border-radius:8px;box-shadow:0 8px 24px #172b4d24}
.has-submenu:hover>.main-menu-yandex-popup,.has-submenu:focus-within>.main-menu-yandex-popup{display:block}
#main-navigation.touch-menu .has-submenu>.main-menu-yandex-popup{display:none;position:static;min-width:0;margin-left:12px;padding:4px;border:0;border-left:1px solid #dce3ed;box-shadow:none;border-radius:0}
#main-navigation.touch-menu .has-submenu.is-submenu-open>.main-menu-yandex-popup{display:block}
#main-navigation.touch-menu .main-menu-popup{max-height:70vh;overflow-y:auto;max-width:90vw}
#main-navigation.touch-menu .main-menu-popup a{white-space:normal;min-height:44px}
.main-menu-yandex-popup strong{display:block;padding:12px 12px 3px;color:#71829a;font-size:12px}
.main-breadcrumbs{display:flex;align-items:center;gap:11px;min-height:39px;font-size:13px;color:#6b809b;white-space:nowrap}
.breadcrumb-separator{color:#9caec5}
#main-navigation #logout,#main-navigation #connect-telegram{margin-left:auto;align-self:center;height:32px;min-height:32px;padding:5px 12px;font:14px Arial,sans-serif;white-space:nowrap}
#main-navigation .nav-account-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
#main-navigation .nav-account-actions>button{flex:none}
#main-navigation #connect-telegram{background:#e3f2ff;border:1px solid #c5deef;color:#173858}
#main-navigation #connect-telegram:hover{background:#d5ebff}
.unified-main-navigation #app>.tabs,.unified-main-navigation .settings-nav,.unified-main-navigation .task-kind-tabs{display:none!important}
.unified-main-navigation .legacy-yandex-navigation{display:none!important}
.unified-yandex-navigation #main-navigation{width:100%;margin:0;grid-column:1/-1}
.unified-yandex-navigation .topbar{height:auto;min-height:38px;justify-content:flex-end}
.unified-yandex-navigation .topbar .brand{display:none}
.unified-main-navigation body.help-layout #help-panel{min-height:0}
.unified-main-navigation #help-panel>.help-title,.unified-main-navigation #help-panel .help-tabs{display:none}
.unified-main-navigation #help-panel:has(>#help-updates:not([hidden]))>.help-nav{display:none}
.unified-main-navigation #help-panel>.help-section>h2:first-child{margin-top:0}
.unified-main-navigation #sales-plan-panel>.sales-submenu{display:none}
@media(max-width:700px){#main-navigation{padding:0 16px}.main-menu{gap:20px}}
/* One wide panel exposes all nested pages without a chain of flyouts. */
.main-menu-group{position:static}
.main-menu-popup{left:22px;right:22px;top:56px;min-width:0;max-width:1280px;padding:22px;gap:16px 28px;max-height:calc(100vh - 110px);overflow-y:auto}
.main-menu-group.is-open>.main-menu-popup{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));align-items:start}
.main-menu-popup>.has-submenu>a{font-weight:700;margin-bottom:8px}
.main-menu-plain-column{display:flex;flex-direction:column;gap:4px;min-width:0}
.main-menu-popup .main-menu-yandex-popup,#main-navigation.touch-menu .has-submenu>.main-menu-yandex-popup{display:block;position:static;min-width:0;padding:0;margin:0;border:0;border-radius:0;box-shadow:none;background:transparent}
.main-menu-popup a{white-space:normal}
.main-menu-popup [data-nav-depth="4"]>a{font-size:12px}
.main-menu-yandex span{display:none}
.main-menu-yandex-popup .has-submenu>a{font-weight:600;margin-top:8px;color:#64778e!important}
.main-menu-yandex-popup .main-menu-yandex-popup{padding-left:12px}
#main-navigation.touch-menu .main-menu-popup{max-width:1280px;max-height:70vh}
#main-navigation.touch-menu .has-submenu.is-collapsed>.main-menu-yandex-popup{display:none}
.main-menu-popup{right:auto;left:var(--menu-left,22px);width:max-content;max-width:calc(100% - 44px)}
.main-menu-popup>.main-menu-item,.main-menu-plain-column{max-width:280px}
.main-menu-group.is-open>.main-menu-popup:not(.compact-menu){
 --menu-column-width:160px;
 --menu-column-gap:28px;
 column-gap:var(--menu-column-gap);
 width:calc(var(--menu-columns) * (var(--menu-column-width) + var(--menu-column-gap)) - var(--menu-column-gap) + 46px);
 grid-template-columns:repeat(auto-fit,min(100%,var(--menu-column-width)));
}
.main-menu-group.is-open>.main-menu-popup.compact-menu{grid-template-columns:minmax(0,1fr)}
.main-menu-popup.compact-menu{padding:10px;gap:0;min-width:190px}
#main-navigation.touch-menu .main-menu-popup{max-width:calc(100% - 44px)}

/* The page title precedes local navigation and content on service/settings/help pages. */
.section-page-title{font-size:23px;line-height:1.3;margin:0 0 16px;flex-shrink:0}
#ai-history-panel>.section-page-title,#gaps-panel>.section-page-title,#errors-panel>.section-page-title{margin:20px 28px 16px}
.unified-main-navigation #backlog-panel>h2:not(.section-page-title),
.unified-main-navigation #ai-history-panel>h2:not(.section-page-title),
.unified-main-navigation #gaps-panel>h2:not(.section-page-title),
.unified-main-navigation #settings-panel>h2:not(.section-page-title),
.unified-main-navigation #settings-page-hidden-products>h2,
.unified-main-navigation #help-sources>h2:first-child,
.unified-main-navigation #help-updates>h2:first-child{display:none}

.task-deadline-badge{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 5px;margin-left:6px;border-radius:50%;font-size:12px;font-weight:600;line-height:1;vertical-align:middle}
.task-deadline-badge.overdue{background:#d63838;color:#fff}
.task-deadline-badge.today{background:#ffd54f;color:#553e00}
.task-deadline-badge[hidden]{display:none!important}
.errors-summary-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 20px}.errors-summary-toolbar #errors-summary{margin:0;padding:0}.errors-summary-toolbar #error-reset{flex-shrink:0}
/* Shared heading spacing: the AI keys page is the reference. */
.unified-main-navigation :is(#ai-history-panel,#gaps-panel,#errors-panel,#backlog-panel,#settings-panel,#help-panel){padding:20px}
.unified-main-navigation :is(#ai-history-panel,#gaps-panel,#errors-panel,#backlog-panel,#settings-panel,#help-panel)>.section-page-title{margin:0 0 16px;font-size:23px;line-height:1.3}
.unified-main-navigation #errors-panel>.section-page-title+div{padding:0!important}
.unified-main-navigation #errors-panel>.errors-summary-toolbar{padding-left:0;padding-right:0}

.sales-report-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0;flex-shrink:0}.sales-report-toolbar button{box-sizing:border-box;height:24px;min-height:24px;font-size:12px;line-height:18px;padding:0 10px;white-space:nowrap}.sales-report-toolbar #sales-plan-state{margin:0;padding:0}.sales-report-toolbar button span{margin-left:5px}#sales-columns-options label{font-weight:400}
/* Shared update monitor; source schedules remain owned by their services. */
.unified-updates{padding:0!important}.updates-note{color:#687b95;margin:0 0 16px}.updates-toolbar{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin-bottom:18px}.updates-toolbar label,.updates-service label{display:flex;align-items:center;gap:7px}.updates-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}.updates-service{display:flex;flex-direction:column;gap:10px;border:1px solid #dce3ed;border-radius:8px;padding:16px}.updates-service.has-error{border-color:#e4b1ac}.updates-service span,.updates-service label{font-size:13px}.updates-table-wrap{overflow:auto;border:1px solid #dce3ed;border-radius:8px}.unified-updates table{width:100%;min-width:1000px;border-collapse:collapse;table-layout:fixed}.unified-updates th,.unified-updates td{padding:14px 12px;text-align:left;vertical-align:top;border-bottom:1px solid #e5eaf2;font-size:13px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}.unified-updates th{background:#f3f6fb;position:static}.unified-updates td strong,.unified-updates td small{display:block}.unified-updates td small{color:#718198;margin-bottom:5px}.unified-updates button{font-size:12px;padding:5px 9px;min-height:28px}.updates-time{display:flex;gap:5px;flex-wrap:wrap;margin:7px 0}.updates-time input{width:100px;padding:4px;font:inherit}.updates-badge{display:inline-block;border-radius:12px;padding:3px 9px;background:#edf0f5;color:#5b6980;white-space:nowrap}.updates-badge.ready{background:#e9f5ee;color:#26754a}.updates-badge.failed{background:#fce9e7;color:#b3332c}.updates-badge.running,.updates-badge.queued{background:#fff4d6;color:#846100}.updates-error{color:#b3332c}.updates-service input,.updates-toolbar input,.unified-updates td input[type=checkbox]{width:15px;height:15px}.settings-embedded-page>[role=status]:empty{display:none}.settings-frame{display:block}
@media(max-width:750px){.updates-summary{grid-template-columns:1fr}}
.unified-yandex-navigation .topbar{display:none!important}
.unified-yandex-navigation #main-navigation #help{margin-left:auto;align-self:center}

.unified-updates table{min-width:1400px}.unified-updates th{overflow-wrap:normal;word-break:normal}.unified-updates th:nth-child(1){width:13%}.unified-updates th:nth-child(2){width:14%}.unified-updates th:nth-child(3){width:16%}.unified-updates th:nth-child(4),.unified-updates th:nth-child(5){width:12%}.unified-updates th:nth-child(6){width:17%}.unified-updates th:nth-child(7){width:16%}

/* Override the main product table nth-child nowrap rule inside updates only. */
#help-updates.unified-updates .updates-table-wrap td{white-space:normal;overflow-wrap:anywhere;word-break:normal}
#help-updates.unified-updates .updates-table-wrap td:nth-child(6)>div{max-width:100%;min-width:0;white-space:normal;overflow-wrap:anywhere}

/* Keep source import headings visible inside the updates table scroller. */
#help-updates.unified-updates .updates-table-wrap{flex:1;min-height:0;overflow:auto;isolation:isolate}
#help-updates.unified-updates>.updates-toolbar,#help-updates.unified-updates>.updates-note,#help-updates.unified-updates>[role="status"]{flex-shrink:0}
#help-updates.unified-updates .updates-table-wrap thead th{position:sticky;top:0;z-index:3;background:#f3f6fb;box-shadow:inset 0 -1px 0 #dce3ed}

/* Shared page-heading spacing, matching Settings > Users. */
:root{--page-heading-content-gap:16px}
.section-page-title,
#app>section>h2:first-child,
body.unified-plan-navigation main>section>h2:first-child,
body.unified-purchase-navigation main>.panel>h2:first-child{
 margin-bottom:var(--page-heading-content-gap)!important;
}
#app>section>h2:first-child+*,
body.unified-plan-navigation main>section>h2:first-child+*,
body.unified-purchase-navigation main>.panel>h2:first-child+*{margin-top:0!important}
body.unified-plan-navigation .plan-report-toolbar{margin-bottom:var(--page-heading-content-gap)!important}
body.unified-plan-navigation .plan-report-toolbar+section>.sku-table-toolbar{margin-top:0}
body.unified-yandex-navigation .heading,
body.unified-finance-navigation .heading{margin-bottom:var(--page-heading-content-gap)!important;padding-bottom:0!important}
body.unified-yandex-navigation .heading h1,
body.unified-finance-navigation .heading h1{margin-bottom:0!important}
body.unified-yandex-navigation .heading+*,
body.unified-finance-navigation .heading+*{margin-top:0!important}
/* Third-level source pages are reached only through the main dropdown. */
.unified-main-navigation #help-panel:has(#help-sources:not([hidden]))>.help-nav{display:none!important}
#help-panel:has(#help-sources:not([hidden])){--help-nav-height:0px!important}
#help-sources{scroll-padding-top:0}
#source-help-site-sections>section>.source-help-report-links{margin-top:0}

/* Source menu settings: compact tree, independent disclosure controls. */
#source-help-selection .source-selection-intro{margin:0 0 12px;font-size:13px}
#source-help-selection .source-selection-toolbar{display:flex;align-items:center;gap:12px;margin-bottom:12px}
#source-help-selection .source-selection-toolbar button{padding:4px 10px;min-height:0;font-size:13px}
#source-help-selection .source-selection-tree{max-width:900px;border:1px solid #dce4f1;border-radius:6px;padding:12px}
#source-help-selection .source-selection-line{display:flex;align-items:center;min-height:28px;gap:6px}
#source-help-selection .source-selection-line label{display:flex;align-items:center;gap:7px;margin:0;cursor:pointer;font-size:13px}
#source-help-selection .source-selection-line input{margin:0;width:14px;height:14px;flex:none}
#source-help-selection .source-selection-toggle,#source-help-selection .source-selection-toggle-space{width:22px;min-width:22px;height:22px;min-height:0;padding:0;border:0;background:transparent;display:inline-flex;align-items:center;justify-content:center}
#source-help-selection .source-selection-children{margin-left:24px}
#source-help-selection .source-selection-children[hidden]{display:none}
#source-help-selection .source-selection-tree>.source-selection-branch>.source-selection-line label{font-weight:600}
#main-menu-sources{max-width:calc(100vw - 44px)}
#main-menu-sources .main-menu-item[hidden]{display:none}

/* Suppress double-tap zoom while preserving scrolling and pinch zoom. */
input,textarea,select,[contenteditable]:not([contenteditable="false"]){touch-action:manipulation}
