:root{
  --product-bg:#f4f6f8;
  --product-surface:#fff;
  --product-text:#172033;
  --product-muted:#667085;
  --product-line:#e2e6ec;
  --product-accent:#3157d5;
  --product-accent-soft:#eef3ff;
  --product-danger:#b42318;
  --product-sidebar:196px;
}

body.product-editor-mode{background:var(--product-bg);color:var(--product-text)}
body.product-editor-mode .sidebar{width:var(--product-sidebar);padding:16px 12px;background:#111c35}
body.product-editor-mode .content{margin-left:var(--product-sidebar);padding:20px;max-width:none}
body.product-editor-mode .sidebar-top{min-height:40px}
body.product-editor-mode .brand.small{font-size:16px;letter-spacing:-.02em}
body.product-editor-mode .sidebar nav{margin-top:20px;gap:6px}
body.product-editor-mode .sidebar-bottom{padding-top:12px}
body.product-editor-mode .page-title{margin-bottom:16px}
body.product-editor-mode .page-title h1{font-size:22px;letter-spacing:-.025em}
body.product-editor-mode .card{border-color:var(--product-line);border-radius:12px;box-shadow:0 1px 2px rgba(16,24,40,.05)}

.product-main-nav{position:relative}
.product-main-nav .product-nav-button,
.product-main-nav .product-nav-mode,
.product-tools-menu>summary{
  min-height:42px;
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  align-items:center;
  gap:9px;
  border:0;
  border-radius:10px;
  padding:9px 10px;
  color:#cbd5e8;
  background:transparent;
  text-align:left;
  font-weight:650;
  line-height:1.2;
  transition:background-color .12s ease,color .12s ease,transform .12s ease;
}
.product-main-nav .product-nav-button:hover,
.product-main-nav .product-nav-button.active,
.product-main-nav .product-nav-mode:hover,
.product-tools-menu>summary:hover,
.product-tools-menu:has(.nav-btn.active)>summary{
  color:#fff;
  background:rgba(255,255,255,.1);
}
.product-main-nav .product-nav-button.active{box-shadow:inset 3px 0 0 #8fa8ff;background:rgba(255,255,255,.12)}
.product-main-nav button:focus-visible,
.product-tools-menu>summary:focus-visible{
  outline:2px solid #9cb0ff;
  outline-offset:2px;
}
.product-nav-icon{width:24px;display:grid;place-items:center;font-size:15px;font-weight:800;color:inherit}
.product-nav-divider,.product-tools-heading{
  margin:14px 10px 4px;
  color:#8390ac;
  font-size:10px;
  font-weight:800;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.product-nav-mode{margin-top:10px!important;border-top:1px solid rgba(255,255,255,.1)!important;border-radius:0 0 10px 10px!important;color:#aeb9d0!important;font-size:12px!important}

.product-tools-menu{position:relative}
.product-tools-menu>summary{grid-template-columns:24px minmax(0,1fr) 18px;list-style:none;cursor:pointer}
.product-tools-menu>summary::-webkit-details-marker{display:none}
.product-tools-chevron{justify-self:end;transition:transform .18s ease-out}
.product-tools-menu[open] .product-tools-chevron{transform:rotate(180deg)}
.product-tools-popover{
  position:static;
  z-index:30;
  width:100%;
  max-height:min(56vh,520px);
  overflow:auto;
  margin-top:5px;
  padding:8px;
  border:1px solid var(--product-line);
  border-radius:12px;
  background:var(--product-surface);
  box-shadow:0 10px 28px rgba(5,12,28,.2);
  transform-origin:top;
  animation:product-menu-in .16s ease-out;
}
.product-tools-popover .product-nav-button,
.product-tools-popover .product-nav-mode{
  width:100%;
  color:var(--product-text)!important;
  border-radius:8px!important;
  margin:0!important;
}
.product-tools-popover .product-nav-button:hover,
.product-tools-popover .product-nav-button.active,
.product-tools-popover .product-nav-mode:hover{
  color:var(--product-text)!important;
  background:#f2f4f7!important;
  box-shadow:none;
}
.product-tools-popover .product-nav-button.active{background:var(--product-accent-soft)!important;color:var(--product-accent)!important}
.product-tools-popover .product-nav-mode{margin-top:7px!important;border-top:1px solid var(--product-line)!important}
.product-tools-popover .product-tools-heading{margin:8px 10px 4px;color:var(--product-muted)}

.product-editor-mode #projectOpenConstructor.product-professional-shortcut,
.product-editor-mode #startTourBtn.product-professional-shortcut{display:none!important}
.product-collapsed{display:none!important}
.product-new-project-button{min-height:40px}
.product-close-project-form{margin-left:8px}

.product-project-tools{position:relative}
.product-project-tools>summary{
  list-style:none;
  min-height:38px;
  display:flex;
  align-items:center;
  padding:8px 12px;
  border:1px solid var(--product-line);
  border-radius:8px;
  background:#fff;
  cursor:pointer;
  font-weight:650;
}
.product-project-tools>summary::-webkit-details-marker{display:none}
.product-project-tools-popover{
  position:absolute;
  z-index:25;
  right:0;
  top:calc(100% + 7px);
  width:min(310px,calc(100vw - 40px));
  display:grid;
  gap:4px;
  padding:8px;
  border:1px solid var(--product-line);
  border-radius:12px;
  background:#fff;
  box-shadow:0 16px 36px rgba(16,24,40,.16);
  animation:product-menu-in .16s ease-out;
}
.product-project-tools-popover button{width:100%;text-align:left;background:#fff;border:0}
.product-project-tools-popover button:hover{background:#f2f4f7}
.product-editor-mode #projectWorkspace>.card-head>.action-wrap{
  align-items:center;
}
.product-editor-mode #projectWorkspace>.card-head>.action-wrap>#projectAddArticleBtn,
.product-editor-mode #projectWorkspace>.card-head>.action-wrap>#projectAssistantBtn,
.product-editor-mode #projectWorkspace>.card-head>.action-wrap>#projectBundleBtn{
  min-height:40px;
}
.product-editor-mode #projectWorkspace>.card-head>.action-wrap>#projectAssistantBtn:not(.primary),
.product-editor-mode #projectWorkspace>.card-head>.action-wrap>#projectBundleBtn:not(.primary){background:#fff}
.product-editor-mode #projectWorkspace>.card-head>.action-wrap>#projectAssistantBtn{background:#fff;color:var(--product-accent);border-color:#b9c7f6}
.product-editor-mode #projectWorkspace>.card-head>.action-wrap>#projectBundleBtn{background:var(--product-accent);color:#fff;border-color:var(--product-accent)}

.product-editor-mode #panel-annotation>.page-title{align-items:center}
.product-editor-mode #panel-annotation>.page-title p{max-width:760px}
.product-editor-mode .workflow-preset-card{max-width:1040px}
.product-editor-mode .workflow-preset-card>.grid.two{grid-template-columns:minmax(0,680px)}
.product-annotation-grid{max-width:1040px;grid-template-columns:minmax(0,1fr)!important}
.product-document-setup-card{max-width:1040px}
.product-document-setup-card .drop{min-height:92px;background:#fbfcfe;border-color:#98a2b3}
.product-document-setup-card textarea{min-height:120px}

.product-processing-settings{max-width:1040px;padding:0!important;overflow:visible}
.product-processing-settings>summary{
  min-height:58px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 24px;
  align-items:center;
  gap:12px;
  padding:13px 16px;
  list-style:none;
  cursor:pointer;
  border-radius:12px;
}
.product-processing-settings>summary::-webkit-details-marker{display:none}
.product-processing-settings>summary:hover{background:#f8fafc}
.product-processing-settings>summary span:first-child{display:flex;flex-direction:column;gap:2px}
.product-processing-settings>summary small{color:var(--product-muted);font-weight:400}
.product-details-chevron{justify-self:end;transition:transform .18s ease-out}
.product-processing-settings[open] .product-details-chevron{transform:rotate(180deg)}
.product-processing-layout{
  display:grid;
  grid-template-columns:minmax(300px,.8fr) minmax(420px,1.2fr);
  gap:12px;
  padding:0 14px 14px;
  border-top:1px solid var(--product-line);
}
.product-processing-general,.product-processing-entities{min-width:0;padding-top:12px}
.product-processing-general>.product-profile-field{margin-top:0}
.product-processing-general>.card.inset{box-shadow:none}
.product-processing-entities>.product-entity-settings-card{margin:0;box-shadow:none}
.product-processing-entities .entity-selector{max-height:420px}
.product-processing-entities #startBtn{display:none}

.product-annotation-start-footer{
  position:sticky;
  z-index:18;
  bottom:12px;
  max-width:1040px;
  min-height:68px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:14px 0;
  padding:12px 14px;
  border:1px solid #cfd8f4;
  border-radius:12px;
  background:rgba(255,255,255,.96);
  box-shadow:0 12px 28px rgba(16,24,40,.13);
  backdrop-filter:blur(8px);
}
.product-annotation-start-footer>div:first-child{display:flex;flex-direction:column;gap:2px}
.product-annotation-start-footer span{color:var(--product-muted);font-size:12px}
.product-annotation-start-footer #startBtn{min-width:230px;min-height:42px;margin:0}

.product-editor-mode .notice.good{background:#fff;border-color:#cfe6da;color:var(--product-text);box-shadow:inset 3px 0 0 #167a50}
.product-editor-mode .notice.warn{background:#fffaf3;border-color:#f1d9b8;box-shadow:inset 3px 0 0 #b86a00}
.product-editor-mode .notice.error{background:#fff7f6;border-color:#f2ccc8;box-shadow:inset 3px 0 0 var(--product-danger)}
.product-editor-mode .review-row:not(.missing){background:#fff}
.product-editor-mode .missing{background:#fff8f7;border-left-color:var(--product-danger)}
.product-editor-mode .article-paper-line:hover{background:#f7f9fc}
.product-editor-mode .article-paper-line.selected,
.product-editor-mode .article-paper-line.is-selected{
  background:var(--product-accent-soft)!important;
  outline:2px solid var(--product-accent);
  outline-offset:-2px;
  box-shadow:inset 3px 0 0 var(--product-accent);
}
.product-editor-mode button:focus-visible,
.product-editor-mode input:focus-visible,
.product-editor-mode select:focus-visible,
.product-editor-mode textarea:focus-visible,
.product-processing-settings>summary:focus-visible,
.product-project-tools>summary:focus-visible{
  outline:2px solid var(--product-accent);
  outline-offset:2px;
}

@keyframes product-menu-in{from{opacity:0;transform:scale(.98) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}

@media(max-width:1180px){
  .product-processing-layout{grid-template-columns:1fr}
  .product-processing-entities .entity-selector{max-height:340px}
}

@media(max-width:1000px){
  body.product-editor-mode .sidebar{position:static;width:100%;padding:12px}
  body.product-editor-mode .content{margin:0;padding:16px}
  body.product-editor-mode .sidebar nav{display:grid;grid-template-columns:repeat(4,minmax(132px,1fr));margin-top:10px;overflow:visible}
  .product-main-nav .product-nav-button,.product-tools-menu>summary{min-height:44px}
}

@media(max-width:720px){
  body.product-editor-mode .sidebar nav{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.product-editor-mode .page-title{align-items:stretch;flex-direction:column}
  body.product-editor-mode .page-title .action-wrap{width:100%}
  .product-new-project-button{flex:1}
  .product-tools-menu{position:static}
  .product-processing-layout{padding:0 10px 10px}
  .product-annotation-start-footer{bottom:8px;flex-direction:column;align-items:stretch}
  .product-annotation-start-footer #startBtn{width:100%;min-width:0;min-height:46px}
  .product-editor-mode #projectWorkspace>.card-head{align-items:flex-start;flex-direction:column}
  .product-editor-mode #projectWorkspace>.card-head>.action-wrap{width:100%}
  .product-editor-mode #projectWorkspace>.card-head>.action-wrap>button,
  .product-project-tools{flex:1}
  .product-project-tools>summary{justify-content:center}
}

@media(prefers-reduced-motion:reduce){
  .product-main-nav *,
  .product-tools-popover,
  .product-project-tools-popover,
  .product-details-chevron{animation:none!important;transition:none!important}
}

.product-editor-mode .workflow-preset-card #presetSummary,
.product-editor-mode .workflow-preset-card #bodyPolicySummary{display:none!important}
.product-processing-general .product-preset-technical-summary{display:block!important;margin-top:10px}
body.product-editor-mode:has(#productAnnotationStartFooter:not(.hidden)) .context-help-btn{bottom:96px}
.product-document-setup-card textarea{width:100%}
@media(max-width:720px){
  body.product-editor-mode .sidebar-bottom #userName,
  body.product-editor-mode .sidebar-bottom #userRole,
  body.product-editor-mode .sidebar-bottom #limitMini{display:none}
}

/* 2.19.135 top navigation pass.
   In ordinary editor mode the main navigation behaves like a familiar mail/chat
   header: primary destinations stay visible, while system/admin actions remain
   under "Ещё". This also gives the work area back the full screen width. */
body.product-editor-mode .app-shell {
  min-height: 100dvh;
}

body.product-editor-mode .sidebar {
  position: fixed !important;
  z-index: 80;
  inset: 0 0 auto 0 !important;
  width: 100% !important;
  height: 64px;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px !important;
  border-right: 0;
  border-bottom: 1px solid #283754;
  background: #111c35;
  box-shadow: 0 5px 20px rgba(10, 22, 45, .12);
}

body.product-editor-mode .sidebar-top {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  align-items: center;
}

body.product-editor-mode .sidebar-top .brand.small {
  min-width: max-content;
  font-size: 15px;
}

body.product-editor-mode #collapseMainSidebar,
body.product-editor-mode #expandMainSidebar {
  display: none !important;
}

body.product-editor-mode .sidebar nav.product-main-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0 !important;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
}

body.product-editor-mode .sidebar nav.product-main-nav::-webkit-scrollbar {
  display: none;
}

body.product-editor-mode .product-main-nav > .product-nav-button,
body.product-editor-mode .product-tools-menu > summary {
  flex: 0 0 auto;
  min-height: 42px;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  white-space: nowrap;
}

body.product-editor-mode .product-main-nav > .product-nav-button.active {
  border-color: #6d84bc;
  box-shadow: none;
  background: #263a62;
}

body.product-editor-mode .product-nav-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  font-size: 0;
}

body.product-editor-mode .product-nav-icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

body.product-editor-mode .product-tools-menu {
  flex: 0 0 auto;
}

body.product-editor-mode .product-tools-menu > summary {
  grid-template-columns: none;
}

body.product-editor-mode .product-tools-popover {
  position: fixed;
  z-index: 110;
  top: 58px;
  right: 14px;
  width: min(330px, calc(100vw - 28px));
  max-height: min(72vh, 620px);
}

body.product-editor-mode .sidebar-bottom {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 0;
}

body.product-editor-mode .sidebar-bottom #userName,
body.product-editor-mode .sidebar-bottom #userRole,
body.product-editor-mode .sidebar-bottom #limitMini {
  display: none;
}

body.product-editor-mode .sidebar-bottom .active-gpt-works-button,
body.product-editor-mode .sidebar-bottom #logoutBtn {
  min-height: 38px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid #405174;
  border-radius: 9px;
  color: #dce4f5;
  background: #1a2948;
  white-space: nowrap;
}

body.product-editor-mode .sidebar-bottom #attentionGptWorksBtn:not(:has(.badge:empty)) {
  border-color: #946b28;
}

body.product-editor-mode .content {
  margin-left: 0 !important;
  padding: 84px 20px 24px !important;
  max-width: none;
}

/* Preset selection is a primary setup decision. Never hide it in simple mode. */
body.product-editor-mode .workflow-preset-card .grid.two,
body.product-editor-mode .workflow-preset-card.product-preset-open .grid.two {
  display: grid !important;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, .55fr) !important;
  gap: 12px;
}

body.product-editor-mode .product-preset-choice {
  display: none !important;
}

body.product-editor-mode .workflow-preset-card #presetSummary,
body.product-editor-mode .workflow-preset-card #bodyPolicySummary {
  display: block !important;
}

body.product-editor-mode .workflow-preset-card #presetSelect {
  min-height: 44px;
  font-size: 14px;
  font-weight: 720;
  border-color: #9eafe6;
  background: #fff;
}

body.product-editor-mode .workflow-preset-card #noPresetBtn {
  min-height: 40px;
  border-color: #aebdec;
  color: #294aa8;
  background: #f2f5ff;
  font-weight: 750;
}

/* One article / several articles stays visible outside the secondary settings
   drawer because it changes the whole processing contour. */
body.product-editor-mode .product-document-setup-card .product-visible-mode-choice {
  display: flex !important;
}

@media (max-width: 1180px) {
  body.product-editor-mode .sidebar-top .brand.small {
    display: none;
  }
  body.product-editor-mode .sidebar-bottom #activeGptWorksBtn,
  body.product-editor-mode .sidebar-bottom #attentionGptWorksBtn {
    font-size: 0;
  }
  body.product-editor-mode .sidebar-bottom .badge { font-size: 10px; }
}

@media (max-width: 760px) {
  body.product-editor-mode .sidebar {
    height: 58px;
    min-height: 58px;
    padding: 6px 8px !important;
    gap: 5px;
  }
  body.product-editor-mode .sidebar-bottom {
    display: none;
  }
  body.product-editor-mode .product-main-nav > .product-nav-button,
  body.product-editor-mode .product-tools-menu > summary {
    min-height: 40px;
    padding: 7px 9px;
    font-size: 11px;
  }
  body.product-editor-mode .product-main-nav > .product-nav-button span:last-child,
  body.product-editor-mode .product-tools-menu > summary span:nth-child(2) {
    display: none;
  }
  body.product-editor-mode .product-nav-icon,
  body.product-editor-mode .product-nav-icon svg {
    width: 20px;
    height: 20px;
  }
  body.product-editor-mode .content {
    padding: 72px 12px 18px !important;
  }
  body.product-editor-mode .workflow-preset-card .grid.two {
    grid-template-columns: 1fr !important;
  }
}

/* 2.19.135 editor-facing clarity: project membership is primary in Documents;
   technical diagnostics stay available in Professional mode without crowding
   the normal list. */
body.product-editor-mode #panel-documents table th:nth-child(4),
body.product-editor-mode #panel-documents table td:nth-child(4),
body.product-editor-mode #panel-documents table th:nth-child(6),
body.product-editor-mode #panel-documents table td:nth-child(6),
body.product-editor-mode #panel-documents table th:nth-child(7),
body.product-editor-mode #panel-documents table td:nth-child(7),
body.product-editor-mode #panel-documents table th:nth-child(8),
body.product-editor-mode #panel-documents table td:nth-child(8) { display: none; }
body.product-editor-mode #panel-documents .document-project-badge {
  display: inline-flex; align-items: center; max-width: 260px; margin: 2px 3px 2px 0;
  padding: 4px 8px; border-radius: 999px; background: #eef2ff; color: #3049ad;
  font-size: 11px; font-weight: 780; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.product-editor-mode .refinement-turn-details-button,
body.product-editor-mode .refinement-detail-expand {
  min-height: 36px; padding: 7px 12px; border-width: 1.5px; border-color: #718ae0;
  background: #eef3ff; color: #213f9c; font-size: 12px; font-weight: 850;
  box-shadow: 0 2px 7px rgba(36,65,154,.10);
}
body.product-editor-mode .refinement-turn-details-button:hover,
body.product-editor-mode .refinement-detail-expand:hover { background: #dfe8ff; border-color: #4664cb; }
body.product-editor-mode .project-handoff-banner,
body.product-editor-mode .project-handoff-summary {
  display: grid; gap: 5px; margin: 10px 0; padding: 12px 14px; border: 1px solid #9db0ec;
  border-radius: 11px; background: #f4f7ff; color: #263b72; line-height: 1.5;
}
body.product-editor-mode .project-handoff-banner.hidden { display: none; }

/* 2.19.139: restore the main editor navigation to a persistent side menu.
   The 2.19.135 top-bar experiment left collapse/reopen controls unreachable in
   annotation markup.  Keep navigation on the left on every editor screen. */
body.product-editor-mode .app-shell {
  min-height: 100dvh;
}
body.product-editor-mode .sidebar {
  position: fixed !important;
  z-index: 80;
  inset: 0 auto 0 0 !important;
  width: var(--product-sidebar) !important;
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0 !important;
  padding: 16px 12px !important;
  border-right: 1px solid #283754 !important;
  border-bottom: 0 !important;
  background: #111c35 !important;
  box-shadow: none !important;
}
body.product-editor-mode .sidebar-top {
  flex: 0 0 auto;
  min-height: 40px;
  display: flex;
  align-items: center;
}
body.product-editor-mode .sidebar-top .brand.small { display: block; min-width: 0; overflow-wrap: anywhere; font-size: 16px; }
body.product-editor-mode #collapseMainSidebar { display: grid !important; }
body.product-editor-mode #expandMainSidebar.hidden { display: none !important; }
body.product-editor-mode #expandMainSidebar:not(.hidden) { display: grid !important; }
body.product-editor-mode .sidebar nav.product-main-nav {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-top: 20px !important;
  overflow: visible;
}
body.product-editor-mode .product-main-nav > .product-nav-button,
body.product-editor-mode .product-tools-menu > summary {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 22px minmax(0,1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  white-space: normal;
  text-align: left;
}
body.product-editor-mode .product-main-nav > .product-nav-button:hover,
body.product-editor-mode .product-tools-menu > summary:hover,
body.product-editor-mode .sidebar-bottom button:hover {
  background: rgba(111,181,255,.22) !important;
  border-color: rgba(145,200,255,.42) !important;
  color: #fff !important;
}
body.product-editor-mode .product-main-nav > .product-nav-button.active {
  border-color: #6d84bc;
  background: #263a62;
}
body.product-editor-mode .product-tools-menu { width: 100%; }
body.product-editor-mode .product-tools-popover {
  position: fixed;
  z-index: 110;
  top: auto;
  right: auto;
  left: calc(var(--product-sidebar) - 4px);
  bottom: 18px;
  width: min(330px, calc(100vw - var(--product-sidebar) - 28px));
  max-height: min(72vh,620px);
}
body.product-editor-mode .sidebar-bottom {
  margin-top: auto;
  display: grid;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
  padding-top: 12px;
}
body.product-editor-mode .sidebar-bottom .active-gpt-works-button,
body.product-editor-mode .sidebar-bottom #logoutBtn {
  width: 100%;
}
body.product-editor-mode .content {
  margin-left: var(--product-sidebar) !important;
  padding: 20px !important;
  max-width: none;
}
body.product-editor-mode .app-shell.main-sidebar-collapsed > .content {
  margin-left: 0 !important;
}
body.product-editor-mode .app-shell.main-sidebar-collapsed #expandMainSidebar:not(.hidden) {
  position: fixed;
  z-index: 120;
  top: 12px;
  left: 12px;
}
@media (max-width:760px) {
  body.product-editor-mode .sidebar {
    width: 68px !important;
    padding: 10px 7px !important;
  }
  body.product-editor-mode .sidebar-top .brand.small,
  body.product-editor-mode .product-main-nav > .product-nav-button span:last-child,
  body.product-editor-mode .product-tools-menu > summary span:nth-child(2),
  body.product-editor-mode .sidebar-bottom #userName,
  body.product-editor-mode .sidebar-bottom #userRole,
  body.product-editor-mode .sidebar-bottom #limitMini { display:none !important; }
  body.product-editor-mode .product-main-nav > .product-nav-button,
  body.product-editor-mode .product-tools-menu > summary {
    grid-template-columns:1fr;
    place-items:center;
    padding:8px 4px;
  }
  body.product-editor-mode .content { margin-left:68px !important; padding:12px !important; }
  body.product-editor-mode .product-tools-popover { left:68px; width:min(330px,calc(100vw - 82px)); }
}

/* 2.19.215 VIS01: collapsed desktop navigation is a compact, discoverable rail.
   Keep the same buttons/state; only labels collapse.  Mobile is handled by the
   final <=859px drawer block below. */
body:is(.product-editor-mode,.product-professional-mode) #collapseMainSidebar{display:grid!important}
body:is(.product-editor-mode,.product-professional-mode) #expandMainSidebar.hidden{display:none!important}
body:is(.product-editor-mode,.product-professional-mode) #expandMainSidebar:not(.hidden){display:grid!important}
@media(min-width:860px){
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed>.sidebar{
    display:flex!important;visibility:visible!important;transform:none!important;pointer-events:auto!important;
    width:var(--main-sidebar-rail,56px)!important;padding:8px!important;overflow-x:hidden!important;overflow-y:auto!important
  }
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed>.sidebar .sidebar-top{display:none!important}
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed>.sidebar nav.product-main-nav{
    visibility:visible!important;pointer-events:auto!important;display:flex!important;flex-direction:column!important;
    gap:6px!important;margin-top:52px!important;overflow:visible!important
  }
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed .product-main-nav>.product-nav-button,
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed .product-main-nav>.product-nav-mode,
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed .product-tools-menu>summary{
    width:44px!important;min-width:44px!important;min-height:44px!important;
    grid-template-columns:1fr!important;place-items:center!important;gap:0!important;padding:8px 4px!important;margin:0 auto!important
  }
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed .product-main-nav>.product-nav-button>span:last-child,
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed .product-main-nav>.product-nav-mode>span:last-child,
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed .product-tools-menu>summary span:nth-child(2),
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed .product-tools-chevron{display:none!important}
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed .product-nav-icon,
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed .product-nav-icon svg{width:21px!important;height:21px!important}
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed .product-tools-menu{width:44px!important;margin:0 auto!important}
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed .product-tools-popover{
    left:calc(var(--main-sidebar-rail,56px) + 6px)!important;right:auto!important;top:8px!important;bottom:auto!important;
    width:min(330px,calc(100vw - var(--main-sidebar-rail,56px) - 22px))!important;max-height:calc(100dvh - 16px)!important
  }
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed>.sidebar .sidebar-bottom{
    visibility:visible!important;pointer-events:auto!important;margin-top:auto!important;display:grid!important;
    gap:6px!important;padding-top:10px!important;border-top:1px solid rgba(255,255,255,.12)!important
  }
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed>.sidebar .sidebar-bottom #userName,
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed>.sidebar .sidebar-bottom #userRole,
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed>.sidebar .sidebar-bottom #limitMini{display:none!important}
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed>.sidebar .sidebar-bottom .active-gpt-works-button,
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed>.sidebar .sidebar-bottom #logoutBtn{
    position:relative!important;width:44px!important;min-width:44px!important;min-height:44px!important;margin:0 auto!important;padding:6px 3px!important;
    justify-content:center!important;overflow:visible!important;font-size:0!important;border-color:rgba(255,255,255,.18)!important;
    color:#fff!important;background:rgba(255,255,255,.07)!important
  }
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed>.sidebar .sidebar-bottom .product-sidebar-action-label{display:none!important}
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed>.sidebar .sidebar-bottom .badge{
    position:absolute!important;top:-3px;right:-3px;display:inline-grid!important;min-width:18px;height:18px;
    place-items:center;margin:0!important;padding:0 4px!important;font-size:9px!important;line-height:18px!important
  }
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed>.content{margin-left:var(--main-sidebar-rail,56px)!important}
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed>#expandMainSidebar{
    position:fixed!important;z-index:120!important;left:6px!important;top:8px!important;width:44px!important;min-width:44px!important;
    height:44px!important;min-height:44px!important;padding:0!important;border-radius:10px!important;display:grid!important;place-items:center!important
  }
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed>#expandMainSidebar span{display:none!important}
}

/* 2.19.155 UI contract: contextual icon contrast and clickable project cards. */
body.product-editor-mode .sidebar .product-nav-icon, body.product-editor-mode .sidebar svg { color:#fff !important; }
body.product-editor-mode .content button svg, body.product-editor-mode .content .icon-button svg { color:var(--product-accent) !important; }
body.product-editor-mode .project-article { cursor:pointer; }
body.product-editor-mode .project-article button, body.product-editor-mode .project-article input, body.product-editor-mode .project-article select, body.product-editor-mode .project-article label, body.product-editor-mode .project-article details { cursor:auto; }

/* 2.19.189: professional-mode responsive navigation polish.
   Keep the professional navigation as a compact left rail when the viewport
   narrows instead of falling back to the old crowded top-row layout. */
body.product-professional-mode .sidebar .product-nav-icon {
  color:#fff !important;
}
body.product-professional-mode .sidebar .product-nav-icon svg {
  width:19px;
  height:19px;
  fill:currentColor !important;
  color:inherit !important;
}

@media(max-width:1000px){
  body.product-professional-mode .app-shell{min-height:100dvh}
  body.product-professional-mode .sidebar{
    position:fixed !important;
    z-index:80;
    inset:0 auto 0 0 !important;
    width:72px !important;
    height:100dvh !important;
    min-height:100dvh !important;
    padding:10px 7px !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:0 !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    border-right:1px solid #283754 !important;
    border-bottom:0 !important;
    background:#15234a !important;
    box-shadow:4px 0 18px rgba(10,22,45,.10);
  }
  body.product-professional-mode .sidebar-top{
    min-height:42px;
    justify-content:center;
  }
  body.product-professional-mode .sidebar-top .brand.small{
    display:none !important;
  }
  body.product-professional-mode .sidebar nav.product-main-nav{
    display:flex !important;
    flex:0 1 auto;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:6px !important;
    margin-top:8px !important;
    overflow:visible !important;
  }
  body.product-professional-mode .product-main-nav > .product-nav-button,
  body.product-professional-mode .product-main-nav > .product-nav-mode{
    width:100% !important;
    min-height:46px;
    display:grid !important;
    grid-template-columns:1fr !important;
    place-items:center;
    gap:0 !important;
    padding:8px 4px !important;
    border-radius:10px;
    text-align:center !important;
  }
  body.product-professional-mode .product-main-nav > .product-nav-button > span:last-child,
  body.product-professional-mode .product-main-nav > .product-nav-mode > span:last-child,
  body.product-professional-mode .product-nav-divider{
    display:none !important;
  }
  body.product-professional-mode .product-nav-icon,
  body.product-professional-mode .product-nav-icon svg{
    width:21px !important;
    height:21px !important;
  }
  body.product-professional-mode .sidebar-bottom{
    margin-top:auto !important;
    display:grid !important;
    gap:6px !important;
    padding-top:10px !important;
    border-top:1px solid rgba(255,255,255,.12);
  }
  body.product-professional-mode .sidebar-bottom #userName,
  body.product-professional-mode .sidebar-bottom #userRole,
  body.product-professional-mode .sidebar-bottom #limitMini{
    display:none !important;
  }
  body.product-professional-mode .sidebar-bottom .active-gpt-works-button,
  body.product-professional-mode .sidebar-bottom #logoutBtn{
    width:100%;
    min-width:0;
    min-height:38px;
    padding:6px 3px;
    overflow:hidden;
    border-color:rgba(255,255,255,.18);
    color:#fff;
    background:rgba(255,255,255,.07);
    font-size:0;
  }
  body.product-professional-mode .sidebar-bottom .badge{
    display:inline-grid;
    min-width:18px;
    height:18px;
    place-items:center;
    margin-left:2px;
    padding:0 4px;
    font-size:9px;
    vertical-align:middle;
  }
  body.product-professional-mode .content{
    margin-left:72px !important;
    padding:16px !important;
    max-width:none;
  }
}

@media(max-width:640px){
  body.product-professional-mode .sidebar{width:62px !important;padding:8px 6px !important}
  body.product-professional-mode .content{margin-left:62px !important;padding:10px !important}
  body.product-professional-mode .product-main-nav > .product-nav-button,
  body.product-professional-mode .product-main-nav > .product-nav-mode{min-height:44px;padding:7px 3px !important}
  body.product-professional-mode .product-nav-icon,
  body.product-professional-mode .product-nav-icon svg{width:20px !important;height:20px !important}
}


/* RD07 final mobile shell integration after RD10.
   Phone/tablet navigation is an overlay drawer, never a permanent 54/62/68/72px rail. */
body.product-editor-mode #profileOverviewCard .metric strong,
body.product-professional-mode #profileOverviewCard .metric strong,
body.product-editor-mode .sidebar-bottom .user-name,
body.product-professional-mode .sidebar-bottom .user-name{
  min-width:0;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.main-sidebar-backdrop{display:none}
@media(max-width:859px){
  body.product-editor-mode .app-shell,
  body.product-professional-mode .app-shell{position:relative;min-height:100dvh}
  body.product-editor-mode .main-sidebar-backdrop:not(.hidden),
  body.product-professional-mode .main-sidebar-backdrop:not(.hidden){display:block;position:fixed;inset:0;z-index:145;border:0;padding:0;background:rgba(15,23,42,.46)}
  body.product-editor-mode .sidebar,
  body.product-professional-mode .sidebar{
    position:fixed!important;z-index:160!important;inset:0 auto 0 0!important;
    width:min(320px,calc(100vw - 40px))!important;max-width:calc(100vw - 40px)!important;
    height:100dvh!important;min-height:0!important;max-height:100dvh!important;padding:calc(12px + env(safe-area-inset-top)) 10px calc(12px + env(safe-area-inset-bottom))!important;
    display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:0!important;
    overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;
    border-right:1px solid #283754!important;border-bottom:0!important;background:#111c35!important;
    box-shadow:10px 0 30px rgba(10,22,45,.24)!important;
  }
  body.product-editor-mode .app-shell.main-sidebar-collapsed>.sidebar,
  body.product-professional-mode .app-shell.main-sidebar-collapsed>.sidebar{display:none!important}
  body.product-editor-mode .content,
  body.product-professional-mode .content,
  body.product-editor-mode .app-shell.main-sidebar-collapsed>.content,
  body.product-professional-mode .app-shell.main-sidebar-collapsed>.content{margin-left:0!important;padding:12px!important;max-width:none}
  body.product-editor-mode .sidebar > *,
  body.product-professional-mode .sidebar > *{flex-shrink:0;min-width:0;max-width:100%}
  body.product-editor-mode .sidebar-top,
  body.product-professional-mode .sidebar-top{position:sticky;top:0;z-index:2;min-height:44px!important;background:#111c35!important}
  body.product-editor-mode .sidebar-top .brand.small,
  body.product-professional-mode .sidebar-top .brand.small{display:block!important;font-size:17px!important}
  body.product-editor-mode #collapseMainSidebar,
  body.product-professional-mode #collapseMainSidebar{display:grid!important;margin-left:auto;min-width:44px!important;min-height:44px!important}
  body.product-editor-mode .app-shell.main-sidebar-collapsed>#expandMainSidebar,
  body.product-professional-mode .app-shell.main-sidebar-collapsed>#expandMainSidebar{position:fixed!important;z-index:170!important;left:10px!important;top:10px!important;width:auto!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:0 12px!important;display:grid!important;grid-auto-flow:column;gap:7px;place-items:center;border-radius:11px!important}
  body.product-editor-mode .app-shell.main-sidebar-collapsed>#expandMainSidebar span,
  body.product-professional-mode .app-shell.main-sidebar-collapsed>#expandMainSidebar span{display:inline!important}
  body.product-editor-mode .sidebar nav.product-main-nav,
  body.product-professional-mode .sidebar nav.product-main-nav{flex-shrink:0!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:6px!important;margin-top:8px!important;overflow:visible!important}
  body.product-editor-mode .product-main-nav>.product-nav-button,
  body.product-editor-mode .product-main-nav>.product-nav-mode,
  body.product-editor-mode .product-tools-menu>summary,
  body.product-professional-mode .product-main-nav>.product-nav-button,
  body.product-professional-mode .product-main-nav>.product-nav-mode,
  body.product-professional-mode .product-tools-menu>summary{width:100%!important;min-height:44px!important;display:grid!important;grid-template-columns:24px minmax(0,1fr)!important;place-items:initial!important;align-items:center!important;gap:9px!important;padding:9px 10px!important;text-align:left!important;white-space:normal!important;overflow-wrap:anywhere}
  body.product-editor-mode .product-main-nav>.product-nav-button span:last-child,
  body.product-editor-mode .product-main-nav>.product-nav-mode span:last-child,
  body.product-editor-mode .product-tools-menu>summary span:nth-child(2),
  body.product-professional-mode .product-main-nav>.product-nav-button>span:last-child,
  body.product-professional-mode .product-main-nav>.product-nav-mode>span:last-child,
  body.product-professional-mode .product-tools-menu>summary span:nth-child(2){display:inline!important}
  body.product-professional-mode .product-nav-divider{display:block!important}
  body.product-editor-mode .product-tools-menu,
  body.product-professional-mode .product-tools-menu{width:100%!important;position:static!important}
  body.product-editor-mode .product-tools-popover,
  body.product-professional-mode .product-tools-popover{position:static!important;width:100%!important;max-height:min(58dvh,520px)!important;margin-top:6px!important;overflow:auto!important}
  body.product-editor-mode .sidebar-bottom,
  body.product-professional-mode .sidebar-bottom{margin-top:auto!important;display:grid!important;gap:6px!important;padding-top:10px!important;border-top:1px solid rgba(255,255,255,.12)!important}
  body.product-editor-mode .sidebar-bottom #userName,
  body.product-editor-mode .sidebar-bottom #userRole,
  body.product-editor-mode .sidebar-bottom #limitMini,
  body.product-professional-mode .sidebar-bottom #userName,
  body.product-professional-mode .sidebar-bottom #userRole,
  body.product-professional-mode .sidebar-bottom #limitMini{display:block!important}
  body.product-editor-mode .sidebar-bottom .active-gpt-works-button,
  body.product-editor-mode .sidebar-bottom #logoutBtn,
  body.product-professional-mode .sidebar-bottom .active-gpt-works-button,
  body.product-professional-mode .sidebar-bottom #logoutBtn{width:100%!important;min-width:0!important;min-height:44px!important;padding:8px 9px!important;font-size:12px!important;text-align:left!important;overflow-wrap:anywhere!important}

  /* Final finite mobile residuals: keep the open drawer modal and every More action >=44px even during scale(.98). */
  body:is(.product-editor-mode,.product-professional-mode) #appShell:not(.main-sidebar-collapsed) ~ #contextHelpBtn{visibility:hidden!important;pointer-events:none!important}
  body:is(.product-editor-mode,.product-professional-mode) .product-tools-popover :is(.product-nav-button,.product-nav-mode){min-height:45px!important}

  /* One compact trigger owns mobile navigation; text stays accessible via aria/title instead of occupying the header. */
  body.product-editor-mode .app-shell.main-sidebar-collapsed>#expandMainSidebar,
  body.product-professional-mode .app-shell.main-sidebar-collapsed>#expandMainSidebar{width:44px!important;min-width:44px!important;padding:0!important;grid-auto-flow:row!important;gap:0!important}
  body.product-editor-mode .app-shell.main-sidebar-collapsed>#expandMainSidebar span,
  body.product-professional-mode .app-shell.main-sidebar-collapsed>#expandMainSidebar span{display:none!important}
  body:is(.product-editor-mode,.product-professional-mode) .app-shell.main-sidebar-collapsed .content>.panel.active>.page-title{padding-inline-start:54px!important}

  /* Constructor keeps one meaningful landing action; stage navigation remains touch-sized. */
  body:is(.product-editor-mode,.product-professional-mode) #toggleAdvancedBtn,
  body:is(.product-editor-mode,.product-professional-mode) #constructorWizardBackToModesBtn{min-height:44px!important}
}

/* Completed results are document-first: setup moves out of the way and the existing article workspace becomes the first work surface. */
body.product-editor-mode.product-result-open #panel-annotation>.workflow-preset-card,
body.product-editor-mode.product-result-open #panel-annotation>.product-annotation-grid,
body.product-editor-mode.product-result-open #panel-annotation>.page-title{display:none!important}
body.product-editor-mode.product-result-open #resultArea{display:flex;flex-direction:column;min-width:0}
body.product-editor-mode.product-result-open #resultArea>.result-actions{order:-30;margin-bottom:10px;padding:12px 14px;align-items:flex-start}
body.product-editor-mode.product-result-open #resultArea>#articleReviewPager{order:-20}
body.product-editor-mode.product-result-open #resultArea>#documentReviewTargets{order:-19}
body.product-editor-mode.product-result-open #resultArea>#originalArticleCard{order:-18}
body.product-editor-mode.product-result-open #resultArea>#articleWorkspace{order:-10}
.product-result-actions-details{margin:0;min-width:min(620px,100%)}
.product-result-actions-details>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:700;color:var(--product-accent)}
.product-result-actions-popover{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding-top:8px}
.product-result-actions-popover>.export-preset-control{min-width:min(360px,100%);flex:1}
