/* Menu links never gain an underline on hover. */
:is(.trade-sidebar, .trade-settings-mobile-menu, [data-drawer-extension]) a:hover {
  text-decoration: none !important;
}
:root { --app-drawer-background: #f8fafc; }
/* One drawer control beside the logo, shared by desktop and mobile. */
/* Reserve the header control and remove its old drawer row before deferred JS
   runs. Otherwise each navigation paints a 50px legacy row, then removes it. */
body:has([data-trade-sidebar] [data-trade-sidebar-toggle]) .app-header:has([data-header-drawer-toggle]) {
  padding-left: 4px !important;
}
body:has([data-trade-sidebar] [data-trade-sidebar-toggle]) .app-header .app-drawer-toggle[hidden] {
  display: inline-flex !important;
  visibility: visible;
}
body:has(.app-header [data-header-drawer-toggle]) .page [data-trade-sidebar] [data-trade-sidebar-toggle] {
  display: none !important;
}
body:has(.app-header [data-header-drawer-toggle]) .page [data-trade-sidebar]:has([data-trade-sidebar-toggle]) {
  --common-drawer-collapsed-width: 0px !important;
  --trade-sidebar-collapsed-width: 0px !important;
  --drawer-mobile-top: calc(var(--app-header-height) + 1px);
}
.app-header:has([data-header-drawer-toggle]:not([hidden])) { padding-left: 4px !important; }
.app-header-brand-group { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; min-width: 0; }
.app-header .app-drawer-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  margin: 0; padding: 10px; border: 0; border-radius: 4px;
  background: transparent; color: #667085; box-shadow: none; cursor: pointer;
}
.app-header .app-drawer-toggle[hidden] { display: none !important; }
.app-header .app-drawer-toggle:hover { background: #f2f4f7; color: #344054; }
.app-header .app-drawer-toggle:focus-visible { outline: 2px solid #667085; outline-offset: 2px; }
.app-drawer-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.app-drawer-line {
  transform-box: view-box;
}
.app-drawer-toggle.is-drawer-interactive .app-drawer-line {
  transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}
.app-drawer-line-top { transform-origin: 4px 5px; }
.app-drawer-line-bottom { transform-origin: 4px 19px; }
/* Keep the existing hamburger and X footprints; animate the same three strokes. */
.app-drawer-toggle[aria-expanded="true"] .app-drawer-line-top {
  transform: translateX(1px) rotate(45deg) scaleX(1.237437);
}
.app-drawer-toggle[aria-expanded="true"] .app-drawer-line-middle {
  transform: translateX(3px);
  opacity: 0;
}
.app-drawer-toggle[aria-expanded="true"] .app-drawer-line-bottom {
  transform: translateX(1px) rotate(-45deg) scaleX(1.237437);
}
@media (prefers-reduced-motion: reduce) {
  .app-drawer-toggle.is-drawer-interactive .app-drawer-line { transition: none; }
}
.page [data-trade-sidebar].has-header-drawer-control .trade-sidebar > [data-trade-sidebar-toggle].common-drawer-toggle,
.page [data-trade-sidebar].has-header-drawer-control [data-trade-sidebar-toggle] { display: none !important; }
.has-header-drawer-control {
  --common-drawer-collapsed-width: 0px !important;
  --trade-sidebar-collapsed-width: 0px !important;
}
.has-header-drawer-control.is-sidebar-collapsed .trade-sidebar { visibility: hidden; }
@media (max-width: 760px) {
  .app-header-brand-group { gap: 6px; }
  /* Mobile list pages are closed by default. Match that state during the
     first paint, before deferred JavaScript updates ARIA. Entry pages that
     explicitly open the drawer carry data-mobile-sidebar-default="open". */
  body:has([data-trade-sidebar]:not([data-mobile-sidebar-default="open"]))
    .app-drawer-toggle[aria-expanded="true"]:not(.is-drawer-interactive) .app-drawer-line {
    opacity: 1;
    transform: none;
  }
}

/* Expanding navigation reserves the whole area below the shared app header.
   The existing drawer stays on the left; the empty workspace covers the page. */
.app-drawer-workspace { display: none; }
.trade-drawer-extension{display:none}
.page [data-trade-sidebar].has-header-drawer-control.is-drawer-fullscreen > .trade-drawer-extension{display:block;position:fixed;z-index:501;top:calc(var(--app-header-height) + 24px);left:calc(min(var(--common-drawer-width, 200px), 100vw - 24px) + 24px);right:24px;color:#667085}
.trade-drawer-extension h2{display:flex;align-items:center;gap:10px;margin:0 0 4px;font-size:14px;font-weight:400;color:#176ee8}
.trade-drawer-extension h2::after{content:"";height:1px;flex:1;background:#d8dee8}

.trade-drawer-extension a{font-size:13px;font-weight:400;color:#667085;text-decoration:none}
.trade-drawer-extension a[data-processing-import]{color:#1f2937}
.trade-drawer-extension a:hover,.trade-drawer-extension a:focus-visible{color:#1764c0;text-decoration:none}
.page [data-trade-sidebar].has-header-drawer-control :is(.trade-sidebar-item,.common-drawer-item).is-active{background:transparent!important;color:#176ee8!important;position:relative}
.page [data-trade-sidebar].has-header-drawer-control :is(.trade-sidebar-item,.common-drawer-item).is-active::after{content:"";position:fixed;left:calc(min(var(--common-drawer-width, 200px), 100vw - 24px) - 3px);width:3px;height:30px;background:#176ee8}
.drawer-active-expander{display:none}
@media(max-width:760px){
  .page [data-trade-sidebar].has-header-drawer-control.is-mobile-previewing :is(.trade-sidebar-item,.common-drawer-item).is-active{color:#1f2937!important}
  .page [data-trade-sidebar].has-header-drawer-control.is-mobile-previewing :is(.trade-sidebar-item,.common-drawer-item).is-active::after{display:none}
  .page [data-trade-sidebar].has-header-drawer-control .is-mobile-preview-selected{background:transparent!important;color:#176ee8!important;font-weight:700}
  .page [data-trade-sidebar].has-header-drawer-control .is-mobile-preview-selected::after{content:"";position:fixed;left:calc(min(var(--common-drawer-width, 200px), 100vw - 24px) - 3px);width:3px;height:30px;background:#176ee8}
}
@media(min-width:761px){
  .trade-drawer-extension a[data-processing-import]:not([hidden]){display:inline-block;margin:-7px -12px;padding:7px 12px;border-radius:6px}
  .trade-drawer-extension a[data-processing-import]:hover,.trade-drawer-extension a[data-processing-import]:focus-visible{background:#f2f4f7;color:#101828;text-decoration:none}
  .trade-drawer-extension a[data-processing-import]:focus-visible{outline:2px solid #176ee8;outline-offset:1px}
  .drawer-has-active-expander{position:relative}
  .page [data-trade-sidebar].has-header-drawer-control .drawer-active-expander{display:flex;position:absolute;right:3px;width:28px;height:34px;min-height:34px;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:#176ee8;font-size:0;cursor:pointer;z-index:2}
  .drawer-active-expander::before{content:"";width:8px;height:8px;border-top:2px solid currentColor;border-right:2px solid currentColor;transform:rotate(45deg)}
  .page [data-trade-sidebar].has-header-drawer-control.is-drawer-fullscreen .drawer-active-expander::before{transform:rotate(225deg)}
  .page [data-trade-sidebar].has-header-drawer-control .drawer-active-expander:focus-visible{outline:2px solid #176ee8;outline-offset:-2px}
  .page [data-trade-sidebar].has-header-drawer-control .drawer-has-active-expander :is(.trade-sidebar-item,.common-drawer-item).is-active{padding-right:29px}
}
@media(max-width:480px){.page [data-trade-sidebar].has-header-drawer-control.is-drawer-fullscreen > .trade-drawer-extension{top:calc(var(--app-header-height) + 12px);left:calc(min(var(--common-drawer-width, 200px), 100vw - 24px) + 8px);right:8px}}
body.has-fullscreen-drawer { overflow: hidden !important; }
body.has-fullscreen-drawer .app-header { z-index: 502 !important; }
.page [data-trade-sidebar].has-header-drawer-control.is-drawer-fullscreen > .app-drawer-workspace {
  display: block;
  position: fixed;
  inset: var(--app-header-height) 0 0;
  background: var(--app-drawer-background);
  z-index: 500;
}
.page [data-trade-sidebar].has-header-drawer-control.is-drawer-fullscreen :is(.trade-sidebar, .common-drawer) {
  position: fixed !important;
  inset: var(--app-header-height) auto 0 0 !important;
  width: min(var(--common-drawer-width, 200px), calc(100vw - 24px)) !important;
  max-width: min(var(--common-drawer-width, 200px), calc(100vw - 24px)) !important;
  height: calc(100dvh - var(--app-header-height)) !important;
  max-height: none !important;
  margin: 0 !important;
  transform: none !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border-right: 1px solid var(--line, #d9dee7) !important;
  z-index: 501 !important;
}
.page [data-trade-sidebar].has-header-drawer-control.is-drawer-fullscreen [data-trade-sidebar-backdrop] {
  display: none !important;
}

/* Normal navigation and the expanded workspace share one background. */
.page [data-trade-sidebar].has-header-drawer-control :is(.trade-sidebar, .common-drawer) {
  background: var(--app-drawer-background) !important;
}

/* Dropdowns must escape the mobile navigation strip instead of being clipped. */
@media (max-width: 840px) {
  .app-header { gap: 6px; }
  .app-header .header-context-chips { margin-inline: 0; flex: 1 1 0; }
  .app-header .top-nav {
    flex: 0 0 auto;
    max-width: none;
    overflow: visible;
  }
  .app-header .top-nav > :is(.task-menu, .account-menu) { flex: 0 0 auto; }
  .app-header .top-nav :is(.task-menu-panel, .account-menu-panel) {
    box-sizing: border-box;
    position: fixed;
    top: calc(var(--app-header-height) + 8px);
    right: 12px;
    min-width: 0;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - var(--app-header-height) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .app-header .top-nav .task-menu-panel { width: min(640px, calc(100vw - 24px)); }
  .app-header .top-nav .task-menu-list { max-height: none; overflow: visible; }
  .app-header .top-nav .account-menu-panel { width: min(240px, calc(100vw - 24px)); }
  .app-header .top-nav .account-menu-language-panel {
    position: static;
    min-width: 0;
    width: auto;
    margin-top: 4px;
    box-shadow: none;
  }
}

@media (max-width: 540px) {
  .task-report-card.is-scope-calendar .task-report-card-header { grid-template-columns: minmax(0, 1fr) auto; }
  .task-report-card.is-scope-calendar .task-report-actions { grid-column: 1 / -1; grid-row: 4; flex-wrap: wrap; }
}

/* Context links occupy their own row only when they are present. */
@media (max-width: 840px) {
  html:has(.app-header .header-context-chips),
  body:has(.app-header .header-context-chips) {
    --app-header-height: 100px;
  }
  .app-header:has(.header-context-chips) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 50px 28px;
    gap: 4px 6px;
    height: var(--app-header-height);
    align-content: center;
  }
  .app-header:has(.header-context-chips) .app-header-brand-group { grid-area: 1 / 1; }
  .app-header:has(.header-context-chips) .top-nav { grid-area: 1 / 2; }
  .app-header:has(.header-context-chips) .header-context-chips {
    grid-area: 2 / 1 / 3 / 3;
    width: 100%;
    margin: 0;
  }
  .app-header .header-context-chips .header-context-chip { max-width: none; }
}

/* Task calendar is a normal page; the document owns vertical scrolling. */
body.task-calendar-page .page { max-width: none; padding: 0; }
.task-view-tabs.operation-index-tabs { display: flex; width: 100%; box-sizing: border-box; margin: 0; padding: 0; border-radius: 0; background: #fff; }
.task-view-tabs.operation-index-tabs > :is(a, strong) { flex: 0 0 140px; }
.task-view-tabs .operation-index-tab-count[hidden], [data-task-list-item][hidden], [data-task-today-empty][hidden] { display: none !important; }
.task-page { padding: 16px; }
.task-card-list { display: grid; gap: 10px; }
.task-report-fallback { display: grid; box-sizing: border-box; min-height: 60px; gap: 6px; padding-right: 60px; }
.task-report-fallback > span { color: #667085; font-size: 13px; }
.task-report-fallback .task-report-actions { position: absolute; top: 12px; right: 12px; grid-area: auto; }
.task-favorite-form { margin: 0; }
.task-favorite-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid #d4deeb; border-radius: 6px; background: #fff; color: #6b7688; font-size: 24px; line-height: 1; cursor: pointer; }
.task-favorite-button.is-favorite { color: #e4a000; }
.task-favorite-button:hover, .task-favorite-button:focus-visible { border-color: #2f80ed; outline-color: #2f80ed; }
.task-page .task-menu-heading { font-size: 18px; font-weight: 700; padding: 8px 0 12px; }
.task-page .task-menu-list { display: grid; }
.task-page .task-menu-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.task-page .task-menu-row > .header-context-chip { max-width: 100%; min-width: 0; min-height: 24px; white-space: normal; overflow-wrap: anywhere; }
.task-page .task-menu-row-title { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.task-page .task-menu-empty { margin: 0; padding: 12px 0; }
.task-calendar { margin-top: 0; padding-top: 0; }
.task-calendar-heading { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 8px; }
.task-calendar-navigation { display: flex; align-items: center; gap: 8px; }
.task-calendar-navigation button { background: #f4f7fa; border: 1px solid var(--line); border-radius: 5px; color: var(--text); cursor: pointer; font-size: 20px; line-height: 1; min-width: 40px; min-height: 40px; }
.task-calendar-navigation span { min-width: 110px; text-align: center; }
.task-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto; grid-auto-rows: minmax(110px, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.task-calendar-weekday { padding: 4px 0; text-align: center; font-size: 11px; font-weight: 700; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.task-calendar-day { min-width: 0; min-height: 64px; padding: 3px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11px; }
.task-calendar-day-card { display: block; box-sizing: border-box; color: inherit; text-decoration: none; cursor: pointer; }
.task-calendar-day-card:hover, .task-calendar-day-card:focus-visible { background: #edf6ff; color: inherit; text-decoration: none; outline: 2px solid #2f80ed; outline-offset: -2px; }
.task-calendar-day-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.task-calendar-day-heading h1 { margin: 0; font-size: 18px; }
.calendar-day-dialog.operation-compact-dialog { width: min(1360px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; overflow: hidden; }
.calendar-day-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.calendar-day-dialog-header h2 { margin: 0; font-size: 18px; }
.calendar-day-dialog-header .floating-contract-close { position: static; flex: none; }
.calendar-day-dialog-content { max-height: calc(100dvh - 110px); overflow: auto; padding: 16px; }
.calendar-day-dialog-content .task-menu-empty { margin: 0; padding: 12px 0; }
@media (max-width: 540px) { .calendar-day-dialog-content { padding: 12px; } }
.task-calendar-day.is-outside { background: #f7f9fb; color: var(--muted); }
.task-calendar-day.is-today > time { background: #078fca; border-radius: 50%; color: white; display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; }
.task-calendar-day .task-calendar-event { display: block; box-sizing: border-box; width: 100%; background: #e6f4fc; border: 0; border-radius: 3px; color: #000; cursor: pointer; font-size: 11px; font-weight: 400; line-height: 1.3; margin-top: 2px; padding: 4px; overflow-wrap: anywhere; text-align: left; text-decoration: none; }
.task-calendar-event .trade-product-picture-report-badge { display: inline-block; box-sizing: border-box; vertical-align: baseline; }
.task-calendar-day .task-calendar-event:hover, .task-calendar-day .task-calendar-event:focus-visible { background: #c8e8f9; text-decoration: none; }
.task-calendar-day .task-calendar-event.is-complete { background: #e5e7eb; color: #667085; }
.task-calendar-day .task-calendar-event.is-complete .trade-product-picture-report-badge { background: #98a2b3; border-color: #98a2b3; color: #fff; }
.task-calendar-detail .operation-compact-dialog-body { max-height: calc(100dvh - 100px); overflow-y: auto; }
.task-calendar-detail-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.task-calendar-detail-badges [hidden] { display: none !important; }
.task-calendar-detail-name { overflow-wrap: anywhere; }
.task-calendar-detail-period { display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
.task-calendar-detail-actions { display: flex; justify-content: flex-end; }
.task-calendar-detail-actions [data-task-dialog-close],
.task-calendar-detail-actions [data-task-dialog-close]:is(:hover, :focus-visible, :active) { background: #fff !important; border: 1px solid #2f80ed !important; color: #2f80ed !important; }
@media (max-width: 840px) { body.task-calendar-page .app-header { height: var(--app-header-height); } body.task-calendar-page .page { padding-top: var(--app-header-height); } }
@media (max-width: 540px) { .task-page { padding: 12px; } .task-view-tabs.operation-index-tabs > :is(a, strong) { flex: 1 1 0; } .task-calendar-grid { grid-auto-rows: minmax(70px, 1fr); } .task-calendar-day .task-calendar-event { font-size: 9px; padding: 2px; } .task-calendar-event .trade-product-picture-report-badge { font-size: 8px; padding: 1px 2px; } }

/* Use the same report-card information as the project report list. */
.task-calendar-detail.operation-compact-dialog { width: min(1360px, calc(100vw - 32px)); max-width: none; }
.task-calendar-detail .operation-compact-dialog-body { gap: 12px; }
.task-calendar-detail-fallback { display: grid; gap: 10px; color: inherit; text-decoration: none; }
.task-calendar-detail-fallback[hidden] { display: none !important; }
.task-report-card { position: relative; border: 1px solid #d4deeb; border-radius: 7px; background: #fff; padding: 12px; }
.task-report-card.is-complete { background: #f2f4f7; filter: grayscale(1); }
.task-report-card-open { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.task-report-card-open:focus-visible { outline: 2px solid #1673e6; outline-offset: 2px; }
.task-report-card-header { display: grid; grid-template-columns: minmax(180px, 1fr) 130px minmax(200px, 2fr) minmax(180px, 1fr) auto; align-items: center; gap: 8px; min-width: 0; }
.task-report-identity { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.task-report-trade { color: #28579a; font-size: 12px; overflow-wrap: anywhere; min-width: 0; }
.task-report-id { justify-self: start; background: #0ea5e9; border-radius: 6px; color: #fff; font-size: 13px; padding: 5px 8px; }
.task-report-date { color: #28579a; font-size: 11px; }
.task-report-title-group { min-width: 0; overflow-wrap: anywhere; }
.task-report-title { color: #28579a; font-size: 14px; overflow-wrap: anywhere; }
.task-report-title-group .task-report-title { color: #101828; }
.task-report-title-group.is-editing .task-report-title { color: #0066e6; }
.task-report-title-group .task-report-publication-form { display: inline-flex; position: relative; z-index: 2; margin-left: 8px; vertical-align: middle; }
.task-report-card.is-scope-calendar.is-complete { filter: none; }
.task-report-card.is-scope-calendar.is-complete :is(.task-report-identity, .task-report-date, .task-report-manufacturer, .task-report-actions, .task-report-cells) { filter: grayscale(1); }
.task-report-title-group .trade-project-progress-badge { background: #fff; border: 1px solid #d92d20; border-radius: 999px; color: #d92d20; display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.3; margin-left: 8px; padding: 4px 10px; vertical-align: middle; white-space: nowrap; }
.task-report-manufacturer { color: #667085; font-size: 13px; overflow-wrap: anywhere; }
.task-report-actions { display: flex; position: relative; z-index: 2; gap: 8px; justify-content: flex-end; }
.task-report-actions > a, .task-report-actions > button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 6px; box-sizing: border-box; }
.task-report-actions svg { width: 20px; height: 20px; }
.task-report-download svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.task-report-cells { display: grid; grid-template-columns: minmax(220px, 1.8fr) repeat(4, minmax(96px, 126px)); gap: 12px; margin-top: 10px; }
.task-report-cell { position: relative; z-index: 2; display: flex; flex-direction: column; min-width: 0; min-height: 94px; box-sizing: border-box; gap: 4px; border: 1px solid #dfe4ed; border-radius: 6px; background: #f6f8fa; color: inherit; padding: 9px 10px 24px; font-size: 12px; text-decoration: none; }
.task-report-cell:hover, .task-report-cell:focus-visible { color: inherit; text-decoration: none; background: #eef6ff; }
.task-report-cell small { color: #98a2b3; font-size: 11px; font-weight: 700; line-height: 1.25; }
.task-report-cell strong { overflow-wrap: anywhere; }
.task-report-cell b { position: absolute; right: 2px; bottom: 2px; min-width: 24px; text-align: center; background: #101828; border-radius: 4px; color: white; padding: 3px 4px; }
.task-report-cell em { position: absolute; top: 2px; right: 2px; min-width: 24px; text-align: center; background: #d92d20; border-radius: 4px; color: #fff; font-style: normal; font-weight: 700; padding: 3px 4px; }
.task-report-quantity > span { display: flex; justify-content: space-between; gap: 5px; }
@media (max-width: 840px) {
  .task-report-card-header { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
  .task-report-identity { grid-column: 1; grid-row: 1; }
  .task-report-date { grid-column: 2; grid-row: 1; }
  .task-report-actions { grid-column: 3; grid-row: 1; }
  .task-report-title-group, .workplace-plan-card .task-report-title { grid-column: 1 / -1; grid-row: 2; }
  .task-report-manufacturer { grid-column: 1 / -1; grid-row: 3; }
  .task-report-cells { grid-template-columns: minmax(0, 1fr); }
  .task-report-quantity, .task-report-check, .task-report-defective, .task-report-product-photos { display: none; }
  .task-report-products { min-height: 76px; }
}

/* Navigation scope badges: linked scopes use their own palette; static text is neutral. */
.header-context-chip:not(a[href]) { background: #fff; border-color: #000; color: #000; }
a.header-context-chip--database, a.header-context-chip--database.is-current { background: #edf0f2; border-color: #475569; color: #475569; }
a.header-context-chip--workplace, a.header-context-chip--workplace.is-current { background: #e7f1f0; border-color: #0f766e; color: #0f766e; }
a.header-context-chip--trade, a.header-context-chip--trade.is-current { background: #f2eeed; border-color: #795548; color: #795548; }
a.header-context-chip[class*="header-context-chip--"]:hover { filter: brightness(.94); }

/* Each trade category owns its detail panel; the current page remains highlighted. */
.page [data-trade-sidebar].has-header-drawer-control .trade-group-detail {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  width: 100%;
  min-height: 36px;
  padding: 4px 12px;
  border: 0;
  background: transparent;
  color: #667085;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}
.page [data-trade-sidebar].has-header-drawer-control .trade-group-detail[aria-expanded="true"] { color: #176ee8; }
.page [data-trade-sidebar].has-header-drawer-control [data-current-detail] .trade-group-detail { color: #176ee8; }
.trade-group-detail::after {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.trade-group-detail[aria-expanded="true"]::after { transform: rotate(225deg); }
.trade-group-detail:hover { color: #344054; }
.trade-group-detail:focus-visible { outline: 2px solid #667085; outline-offset: -2px; }

/* Menu entries without an implemented page are visually quieter. */
.page [data-trade-sidebar] .trade-sidebar-item.is-disabled.is-unimplemented { color: #c2c9d3; }

.trade-detail-favorite { position: relative; display: inline-flex; align-items: center; max-width: 100%; gap: 8px; }
.trade-detail-favorite a[data-processing-import]:not([hidden]) { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; margin: 0; padding: 0; }
.trade-favorite-toggle { display: inline-flex; flex: 0 0 36px; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; background: transparent; color: #98a2b3; cursor: pointer; }
.trade-favorite-toggle svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.trade-favorite-toggle[aria-pressed="true"] { color: #7b9fcf; }
.trade-favorite-toggle[aria-pressed="true"] svg { fill: currentColor; }
.trade-favorite-toggle:focus-visible { outline: 2px solid #176ee8; outline-offset: 2px; }
.trade-favorite-toggle[hidden] { display: none; }
.trade-favorite-error { position: absolute; top: 100%; left: 0; color: #b42318; font-size: 12px; }

/* Match the active navigation color and indent the detail item by one character. */
.page [data-trade-sidebar].has-header-drawer-control .trade-drawer-extension h2 { color: #176ee8; }
.trade-drawer-extension .trade-detail-favorite { font-size: 13px; margin-inline-start: 1em; max-width: calc(100% - 1em); }

/* Warehouse functions are not available yet. */
.trade-warehouse-detail { margin-top: 10px; }
.trade-warehouse-detail[hidden] { display: none; }

.trade-warehouse-detail-items .trade-detail-unavailable > button:first-child { align-items: center; justify-self: start; min-height: 30px; padding: 0; border: 0; background: none; color: #c2c9d3; font-size: 13px; font-weight: 500; letter-spacing: normal; line-height: 1.55; text-align: start; }

.trade-parts-detail { margin-top: 10px; }
.trade-parts-detail[hidden] { display: none; }
.trade-drawer-extension .trade-detail-items:not([hidden]) { display: flex; flex-wrap: wrap; column-gap: 12px; row-gap: 2px; margin-top: 10px; }
.trade-drawer-extension :is([data-quality-detail], .trade-processing-detail) { margin-bottom: 24px; }
.trade-drawer-extension .trade-processing-detail:has(> .trade-detail-favorite > a[hidden]) { display: none; }
.trade-parts-detail a { display: inline-block; color: #1f2937; }
.trade-drawer-extension a[data-trade-detail-link][aria-current="page"] { color: #176ee8; font-weight: 600; }
.trade-drawer-extension .trade-parts-detail a:hover,
.trade-drawer-extension .trade-parts-detail a:focus-visible { color: #101828; }


.trade-detail-unavailable .trade-favorite-toggle { color: #c2c9d3; cursor: default; }

/* Use the same 30px rows and 2px row gap as the main navigation. */
.trade-drawer-extension .trade-detail-favorite { min-height: 30px; gap: 4px; line-height: 1.55; letter-spacing: normal; }
.trade-drawer-extension .trade-favorite-toggle { flex-basis: 30px; width: 30px; height: 30px; min-height: 30px; }
.trade-drawer-extension .trade-detail-favorite:has(> a[data-processing-import][hidden]) { display: none; }
