/* Candidate lives outside Gin's toolbar DOM and does not share its toggle state. */
.farm-candidate-return { position:fixed; right:12px; bottom:12px; z-index:10000; padding:7px 11px; border:1px solid #8fa69e; border-radius:6px; background:#fff; color:#185c47; font:12px/1.5 sans-serif; text-decoration:none; box-shadow:0 2px 8px #0002; }
body.farm-candidate-shell { --farm-candidate-width:256px; --gin-toolbar-width:256px; margin-left:0!important; padding-left:var(--farm-candidate-width)!important; }
body.farm-candidate-collapsed { --farm-candidate-width:64px; --gin-toolbar-width:64px; }
.farm-candidate-shell .toolbar-menu-administration,.farm-candidate-shell a.toolbar-menu__trigger { display:none!important; }
.farm-candidate-shell .dialog-off-canvas-main-canvas,.farm-candidate-shell .page-wrapper { margin-left:0!important; }
.farm-candidate-shell .gin-secondary-toolbar { left:var(--farm-candidate-width)!important; }
#farm-candidate-rail { box-sizing:border-box; position:fixed; inset:0 auto 0 0; width:var(--farm-candidate-width); height:100dvh; display:flex; flex-direction:column; gap:8px; padding:12px 7px; border-right:1px solid #e0e7e3; background:#fff; z-index:9999; color:#273f35; font:14px/1.5 sans-serif; }
#farm-candidate-rail * { box-sizing:border-box; }
#farm-candidate-rail .brand { display:flex; height:48px; align-items:center; justify-content:center; flex:0 0 48px; }
#farm-candidate-rail .brand img { display:block; max-width:170px; max-height:36px; object-fit:contain; }
#farm-candidate-rail > nav { flex:1; min-height:0; overflow:auto; }
#farm-candidate-rail ul { list-style:none; padding:0; margin:0; position:static; width:100%; height:auto; }
#farm-candidate-rail li { padding:0; margin:0; position:static; }
#farm-candidate-rail details { margin:0; position:static; }
#farm-candidate-rail summary { cursor:pointer; list-style:none; }
#farm-candidate-rail summary::-webkit-details-marker { display:none; }
#farm-candidate-rail .farm-navigation-group-toggle,#farm-candidate-rail .farm-navigation-link { display:flex; align-items:center; gap:12px; min-height:42px; padding:9px 11px; color:#344b40; text-decoration:none; border-radius:6px; }
#farm-candidate-rail details > ul { padding:0 0 7px 12px; margin:0; width:100%; height:auto; }
#farm-candidate-rail .farm-navigation-link:hover,#farm-candidate-rail summary:hover { background:#f0f6f2; }
#farm-candidate-rail .is-active { background:#e9f5ed; color:#07653f; }
#farm-candidate-rail :focus-visible { outline:2px solid #137c61; outline-offset:-2px; }
#farm-candidate-rail .farm-navigation-icon { flex:0 0 20px; width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
#farm-candidate-rail .sidebar-collapse { border:1px solid #dae4df; background:#fff; color:#344b40; min-height:36px; border-radius:5px; cursor:pointer; }
.farm-candidate-collapsed #farm-candidate-rail .farm-navigation-label,.farm-candidate-collapsed #farm-candidate-rail details > ul { display:none; }
.farm-candidate-collapsed #farm-candidate-rail .brand img { max-width:45px; }
.farm-candidate-collapsed #farm-candidate-rail .farm-navigation-group-toggle,.farm-candidate-collapsed #farm-candidate-rail .farm-navigation-link { justify-content:center; padding:10px 0; }
@media(max-width:720px) { body.farm-candidate-shell { padding-left:64px!important; } .farm-candidate-shell:not(.farm-candidate-collapsed) #farm-candidate-rail { box-shadow:6px 0 20px #0003; } }

/* Candidate content follows its own rail, even when the original Gin rail
   remains compact. The class attribute gives this opt-in rule precedence
   over the old expanded/compact shell selectors without changing them. */
body.farm-candidate-shell {
  --farm-candidate-content-offset: var(--farm-candidate-width);
  --base-screen-navigation-width: var(--farm-candidate-content-offset) !important;
}
body.farm-candidate-shell.gin--vertical-toolbar.narcissus-shell--compact[class] {
  padding-left: var(--farm-candidate-content-offset) !important;
}
body.path-base-screen.farm-candidate-shell .page-wrapper {
  left: var(--farm-candidate-content-offset) !important;
  right: 0 !important;
  width: auto !important;
}
@media (max-width:720px) {
  body.farm-candidate-shell { --farm-candidate-content-offset:64px; }
}

/* The narrow Gin secondary toolbar is in normal flow. Do not shift its full
   width by the rail width; keep the 64px compact rail outside page content. */
@media (max-width:720px) {
  body.farm-candidate-shell.gin--vertical-toolbar[class] {
    padding-left:64px !important;
  }
  body.farm-candidate-shell .gin-secondary-toolbar {
    left:0 !important;
    right:auto !important;
  }
}

/* The dashboard flex region must shrink to its available mobile width;
   metrics wrap inside it instead of establishing a wide min-content size. */
@media (max-width:720px) {
  body.farm-candidate-shell.path-frontpage .layout__region,
  body.farm-candidate-shell.path-dashboard .layout__region { min-width:0; }
  body.farm-candidate-shell.path-frontpage .dashboard-pane .metrics-container ul,
  body.farm-candidate-shell.path-dashboard .dashboard-pane .metrics-container ul { flex-wrap:wrap; }
}

/* Gin's secondary toolbar is relative in both layouts. Content already has
   its rail offset; a second relative left offset exceeds the page width. */
body.farm-candidate-shell .gin-secondary-toolbar {
  left:0 !important;
  right:auto !important;
}

/* Keep permitted management entries below the four business groups. */
#farm-candidate-rail > nav > ul { display:flex; flex-direction:column; min-height:100%; }
#farm-candidate-rail > nav > ul > .farm-navigation-management { margin-top:auto; padding-top:12px; border-top:1px solid #e7eeea; }
