/* Content must be able to shrink before it wraps. Keep these corrections scoped
   to the actual surfaces so table and document scroll containers stay usable. */
/* Safari 18 can size an implicit grid row from the logo's intrinsic height,
   then center its percentage-height image far below the visible brand box. */
.product-brand > .product-brand-mark,
.scene-workspace :is(.library-nav-brand,.command-brand) > span,
.brand-settings-card .brand-preview > div,
:is(.loading-screen,.error-screen) .brand-mark {
  display:flex; align-items:center; justify-content:center; min-width:0; min-height:0;
}
.brand-logo-image { width:100%; height:100%; min-width:0; min-height:0; object-fit:contain; }
.brand-preview > section { min-width:0; overflow-wrap:anywhere; }
dialog.portal-quote-dialog,
dialog.portal-quote-dialog * { box-sizing:border-box; }
dialog.portal-quote-dialog[open] {
  display:flex;
  flex-direction:column;
  max-width:calc(100vw - 20px);
  max-height:calc(100dvh - 20px);
}
dialog.portal-quote-dialog > :is(.portal-quote-header,.rb-stepper,.portal-quote-footer) { flex:none; }
dialog.portal-quote-dialog > .portal-quote-body { flex:1 1 auto; min-height:0; overflow-y:auto; }
dialog.portal-quote-dialog .rb-confirmation-summary { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; }
dialog.portal-quote-dialog .rb-confirmation-summary > * { min-width:0; overflow-wrap:anywhere; }
dialog.portal-quote-dialog .rb-confirmation-summary :is(h3,p,strong) { white-space:normal; overflow-wrap:anywhere; }
.core-workspace :is(.core-columns > *,.project-directory,.project-directory-list,.project-directory-list > button,.manager-project-grid,.manager-project-card) { min-width:0; max-width:100%; }
.core-workspace .manager-project-grid { grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr)); }
.core-workspace :is(.manager-project-card,.project-directory-list > button) { white-space:normal; overflow-wrap:anywhere; }
.core-workspace :is(.manager-project-card strong,.project-directory-name,.project-detail-actions h2,.core-row > button) { min-width:0; overflow-wrap:anywhere; }
.scene-workspace .intake-list > article { min-width:0; max-width:100%; }
.scene-workspace .intake-list :is(h3,p,small) { min-width:0; overflow-wrap:anywhere; }
.operations-profile-card :is(.review-queue-main,.management-record-heading > *) { min-width:0; }
.operations-profile-card .management-record-heading { flex-wrap:wrap; }
.operations-profile-card :is(h3,p,label) { overflow-wrap:anywhere; }
.core-workspace .core-row > button { white-space:normal; }
:is(.ep-loading,.core-workspace) [role="alert"] { min-width:0; max-width:100%; overflow-wrap:anywhere; }

/* Saved originals, batch names and recognition notes can contain long tokens.
   Do not let their intrinsic width enlarge the grid or its controls. */
.wi-workspace { grid-template-columns:minmax(0,1fr); overflow-wrap:anywhere; }
.wi-workspace > *,
.wi-workspace :is(.wi-heading > div,.wi-batch-heading > div,button,input,select) { min-width:0; }
.wi-workspace button,
:is(.scene-workspace,.product-frame) .wi-workspace button { white-space:normal; overflow-wrap:anywhere; }
.wi-workspace :is(.wi-batches button,.wi-source button) { grid-template-columns:minmax(0,1fr); }
.wi-workspace :is(.wi-row summary > *,.wi-source nav > *) { min-width:0; max-width:100%; }
.signup-review .signup-profile-review-form > p { min-width:0; white-space:normal; overflow-wrap:anywhere; }

@media(max-width:850px) {
  .scene-workspace .intake-list { grid-template-columns:minmax(0,1fr); }
  .core-workspace .project-directory-list .project-directory-name { width:100%; max-width:100%; white-space:normal; -webkit-line-clamp:unset; }
  .core-workspace .workspace-project-actions { flex-wrap:wrap; gap:8px; }
  .core-workspace .workspace-project-actions > :is(a,button) { min-width:0; max-width:100%; white-space:normal; }
}
@media(max-width:600px) {
  .visitor-header.visitor-corner-controls { gap:12px; }
  .visitor-corner-controls .visitor-brand-link { min-width:0; flex:1 1 auto; }
  .visitor-corner-controls .visitor-login { flex:0 0 auto; width:80px; max-width:100%; }
  /* The decorative canvas extends 20px beyond its button; contain only these
     effects so they do not add a horizontal scroll strip to the page. */
  .visitor-corner-controls .visitor-login,
  .visitor-home .visitor-search { overflow:clip; }
  dialog.portal-quote-dialog .rb-confirmation-summary { grid-template-columns:minmax(0,1fr); }
  dialog.portal-quote-dialog > .portal-quote-footer { display:flex; flex-direction:column; align-items:stretch; gap:8px; }
  dialog.portal-quote-dialog .portal-quote-footer > :is(span,small) { min-width:0; white-space:normal; overflow-wrap:anywhere; }
  dialog.portal-quote-dialog .portal-quote-footer > div:last-child { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; width:100%; min-width:0; margin:0; }
  dialog.portal-quote-dialog .portal-quote-footer button { min-width:0; min-height:44px; max-width:100%; height:auto; white-space:normal; overflow-wrap:anywhere; line-height:1.5; }
  dialog.portal-quote-dialog .portal-quote-footer > div:last-child > button { width:100%; flex:none; padding:10px 12px; }
}
@media(max-height:360px) {
  dialog.portal-quote-dialog[open] { display:block; overflow-y:auto; }
  dialog.portal-quote-dialog > .portal-quote-body { overflow:visible; }
}

/* Navigation-only sizing: keep the five-character label on one line. */
body .scene-workspace .workspace-dock > a.workspace-evaluation-link:is([href^="/evaluation"], .workspace-account-view-link) {
  display:flex;flex:0 0 auto;flex-direction:row;align-items:center;justify-content:flex-start;
  box-sizing:border-box;gap:12px;width:100%;min-height:42px;padding:9px 12px;
  border:0;border-radius:10px;background:transparent;color:var(--muted);
  font-family:inherit;font-size:13px;font-weight:400;line-height:20px;
  text-align:left;text-decoration:none;white-space:nowrap;
}
body .scene-workspace .workspace-dock > a.workspace-evaluation-link:is([href^="/evaluation"], .workspace-account-view-link):hover {
  color:var(--ink);background:var(--surface-soft);
}
body .scene-workspace .workspace-dock > a.workspace-evaluation-link:is([href^="/evaluation"], .workspace-account-view-link):focus-visible {
  outline:2px solid var(--signal);outline-offset:2px;
}
.ep-app .ep-rail nav a[href^="/evaluation"] {
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  box-sizing:border-box;gap:4px;width:64px;min-height:64px;padding:6px 0;
  border:0;border-radius:9px;background:transparent;color:#69738b;
  font-family:inherit;font-size:11px;font-weight:400;line-height:16px;
  letter-spacing:0;text-decoration:none;white-space:nowrap;
}
.ep-app .ep-rail nav a[href^="/evaluation"] > span {
  font:inherit;white-space:nowrap;overflow-wrap:normal;word-break:keep-all;
}
.ep-app .ep-rail nav a[href^="/evaluation"] > svg {
  display:block;width:22px;height:22px;flex:0 0 22px;
}
.scene-workspace .workspace-dock a[href^="/evaluation"] > span:not(.dock-symbol),
.product-sidebar .product-nav a[data-nav-id="evaluation"] .product-nav-text {
  white-space:nowrap;overflow-wrap:normal;word-break:keep-all;
}
.scene-workspace .workspace-dock a[href^="/evaluation"] .product-nav-icon,
.product-sidebar .product-nav a[data-nav-id="evaluation"] .product-nav-icon {
  display:block;width:20px;height:20px;flex:0 0 20px;
}
.workspace-dock .workspace-account-view-link {font-family:inherit;line-height:20px;}
.workspace-dock .workspace-account-view-link .product-nav-icon {
  display:block;width:20px;height:20px;flex:0 0 20px;
}
@media(max-width:850px) {
  body .scene-workspace .workspace-dock > a.workspace-evaluation-link:is([href^="/evaluation"], .workspace-account-view-link) {
    flex-direction:column;justify-content:center;gap:4px;width:auto;min-height:56px;padding:6px 4px;text-align:center;
  }
  body .scene-workspace .workspace-dock > a.workspace-evaluation-link[href^="/evaluation"] {
    flex:0 0 72px;min-width:72px;font-size:11px;line-height:16px;
  }
  body .scene-workspace .workspace-dock > a.workspace-evaluation-link.workspace-account-view-link {
    flex:0 0 88px;min-width:88px;font-size:11px;line-height:16px;
  }
}
@media(min-width:851px) {
  body .scene-workspace .workspace-dock[data-collapsed=true] > a.workspace-evaluation-link:is([href^="/evaluation"], .workspace-account-view-link) {
    justify-content:center;gap:0;padding:10px 4px;
  }
}
@media(min-width:851px) and (max-width:1000px) {
  body .scene-workspace .workspace-dock > a.workspace-evaluation-link:is([href^="/evaluation"], .workspace-account-view-link) {
    justify-content:center;gap:0;padding:10px 4px;
  }
}
@media(max-width:700px) {
  .ep-app .ep-rail nav a[href^="/evaluation"] {
    width:52px;min-height:58px;font-size:10px;line-height:14px;
  }
  .ep-app .ep-rail nav a[href^="/evaluation"] > svg {
    width:20px;height:20px;flex-basis:20px;
  }
}
@media(max-height:620px) {
  .ep-app .ep-rail nav a[href^="/evaluation"] {min-height:44px;}
  .ep-app .ep-rail nav a[href^="/evaluation"] > svg {width:18px;height:18px;flex-basis:18px;}
}

/* Sidebar utilities are menu rows, with the same type and alignment as navigation. */
body .scene-workspace .workspace-dock .workspace-session-footer {
  display:grid;flex:0 0 auto;gap:4px;margin-top:auto;padding-top:12px;
  border-top:1px solid var(--line);
}
body .scene-workspace .workspace-dock .workspace-session-footer > a,
body .scene-workspace .workspace-dock .workspace-session-footer .product-session > .session-logout-trigger {
  display:flex;align-items:center;justify-content:flex-start;gap:12px;
  box-sizing:border-box;width:100%;min-height:44px;margin:0;padding:10px 12px;
  border:0;border-radius:10px;background:transparent;box-shadow:none;color:var(--muted);
  font-family:inherit;font-size:13px;font-weight:400;line-height:20px;
  text-align:left;text-decoration:none;white-space:nowrap;
}
body .scene-workspace .workspace-dock .workspace-session-footer > a::before {
  content:"";display:block;flex:0 0 20px;width:20px;height:20px;background:currentColor;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 10 9-7 9 7v10a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
body .scene-workspace .workspace-dock .workspace-session-footer .product-session {display:block;width:100%;margin:0;padding:0;}
body .scene-workspace .workspace-dock .workspace-session-footer .session-logout-trigger > svg {display:block;flex:0 0 20px;width:20px;height:20px;}
body .scene-workspace .workspace-dock .workspace-session-footer :is(a,.session-logout-trigger):hover {color:var(--ink);background:var(--surface-soft);}
body .scene-workspace .workspace-dock .workspace-session-footer :is(a,.session-logout-trigger):focus-visible {outline:2px solid var(--signal);outline-offset:2px;}
/* A dialog inside the rail must not inherit full-width navigation buttons. */
body .scene-workspace .workspace-dock .session-logout-dialog .session-logout-actions {
  display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:12px;
}
body .scene-workspace .workspace-dock .session-logout-dialog .session-logout-actions > button {
  position:static;display:inline-flex;flex:0 1 auto;align-items:center;justify-content:center;
  width:auto;min-width:76px;max-width:100%;min-height:44px;margin:0;padding:10px 16px;
  border:1px solid var(--line);border-radius:8px;box-shadow:none;
  background:var(--surface,#fff);color:var(--ink);font-size:13px;line-height:20px;
}
body .scene-workspace .workspace-dock .session-logout-dialog .session-logout-actions > .session-logout-confirm {
  border-color:var(--ink);background:var(--ink);color:var(--surface,#fff);
}
body .scene-workspace .workspace-dock[data-collapsed=true] .workspace-session-footer > a,
body .scene-workspace .workspace-dock[data-collapsed=true] .workspace-session-footer .session-logout-trigger {justify-content:center;gap:0;padding:10px 4px;font-size:0;}
body .scene-workspace .workspace-dock[data-collapsed=true] .workspace-session-footer .session-logout-trigger > span {display:none;}
@media(min-width:851px) and (max-width:1000px) {
  body .scene-workspace .workspace-dock .workspace-session-footer > a,
  body .scene-workspace .workspace-dock .workspace-session-footer .session-logout-trigger {justify-content:center;gap:0;padding:10px 4px;font-size:0;}
  body .scene-workspace .workspace-dock .workspace-session-footer .session-logout-trigger > span {display:none;}
}
@media(max-width:850px) {
  body .scene-workspace .workspace-dock .workspace-session-footer {display:none;}
}

/* Feedback belongs to the page header, outside the content and modal layers. */
body :is(.command-header,.product-header-actions,.ep-hero) > .fb-launchers {
  position:static;inset:auto;display:flex;flex:0 0 auto;flex-direction:row;
  align-items:center;justify-content:flex-end;gap:8px;z-index:auto;
  max-width:100%;margin:0;pointer-events:auto;
}
body :is(.command-header,.product-header-actions,.ep-hero) > .fb-launchers .fb-launcher {
  display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;
  gap:6px;box-sizing:border-box;min-height:36px;margin:0;padding:6px 11px;
  border:1px solid var(--line,#dfe3ec);border-radius:10px;
  background:var(--surface,#fff);color:var(--muted,#69738b);box-shadow:none;
  font-family:inherit;font-size:12px;font-weight:500;line-height:22px;
  letter-spacing:0;white-space:nowrap;
}
body :is(.command-header,.product-header-actions,.ep-hero) > .fb-launchers .fb-launcher b {
  position:static;flex:0 0 auto;margin:0;padding:0 5px;min-width:16px;
  border-radius:9px;font-size:10px;line-height:16px;
}
body :is(.command-header,.product-header-actions,.ep-hero) > .fb-launchers .fb-launcher svg {
  flex:0 0 17px;width:17px;height:17px;
}
body .scene-workspace .command-header > .fb-launchers {order:1;}
body .scene-workspace .command-header > .command-utilities {order:2;margin-left:0;}
body .scene-workspace .command-header:has(> .fb-launchers) {column-gap:12px;}
body .product-header-actions:has(> .fb-launchers) {display:flex;flex-wrap:wrap;align-items:center;gap:8px;}
body .ep-hero:has(> .fb-launchers) {gap:12px;flex-wrap:wrap;}
body .ep-hero > .fb-launchers {margin-left:auto;}
@media(max-width:1100px) {
  body .scene-workspace .command-header:has(> .fb-launchers) .command-status {display:none;}
}
@media(max-width:850px) {
  body .scene-workspace.scene-workspace:has(.command-header > .fb-launchers) {
    --workspace-mobile-header-height:calc(60px + env(safe-area-inset-top,0px));
  }
  body .scene-workspace.scene-workspace .command-header:has(> .fb-launchers) {
    flex-wrap:nowrap;align-items:center;column-gap:4px;row-gap:0;
  }
  body .scene-workspace .command-header > .command-brand {order:0;}
  body .scene-workspace .command-header > .command-utilities {order:2;}
  body .scene-workspace .command-header > .fb-launchers {
    order:1;flex:0 0 auto;width:auto;gap:4px;justify-content:flex-end;
  }
  body :is(.command-header,.product-header-actions,.ep-hero) > .fb-launchers .fb-launcher {
    position:relative;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;gap:0;font-size:0;
  }
  body :is(.command-header,.product-header-actions,.ep-hero) > .fb-launchers .fb-launcher:not(.fb-help-launcher)::before {
    content:"";display:block;flex:0 0 19px;width:19px;height:19px;background:currentColor;
    mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='3' width='14' height='18' rx='2'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h4'/%3E%3C/svg%3E") center/contain no-repeat;
  }
  body :is(.command-header,.product-header-actions,.ep-hero) > .fb-launchers .fb-launcher > span {
    position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;
  }
  body :is(.command-header,.product-header-actions,.ep-hero) > .fb-launchers .fb-launcher svg {
    flex:0 0 19px;width:19px;height:19px;
  }
  body :is(.command-header,.product-header-actions,.ep-hero) > .fb-launchers .fb-launcher b {
    position:absolute;top:-3px;right:-3px;
  }
  body .scene-workspace.scene-workspace .command-header .command-utilities button:is(.workspace-header-action,.notification-trigger,.session-logout-trigger) {
    border:1px solid var(--line,#dfe3ec);border-radius:10px;background:var(--surface,#fff);
    color:var(--muted,#69738b);box-shadow:none;
  }
}
@media(max-width:379px) {
  body .scene-workspace .command-header:has(> .fb-launchers) .command-brand > div {display:none;}
}
/* Public recruitment and authentication pages still have no feedback buttons. */
body:has(.visitor-home,.auth-frame,.public-recruit) :is(.command-header,.product-header-actions,.ep-hero) > .fb-launchers {display:none;}

/* Keep every mobile destination in an equal-width cell at the screen bottom. */
.workspace-dock-progress {display:none;}
@media(max-width:850px) {
  body:has(.scene-workspace .workspace-dock) {
    --workspace-mobile-dock-height:calc(72px + env(safe-area-inset-bottom,0px));
    padding-bottom:var(--workspace-mobile-dock-height);
  }
  html:has(.scene-workspace .workspace-dock) {
    scroll-padding-bottom:calc(88px + env(safe-area-inset-bottom,0px));
  }
  body .scene-workspace.scene-workspace .workspace-dock.workspace-dock {
    position:fixed;inset:auto 0 0;z-index:80;transform:none;
    display:grid;grid-auto-flow:column;grid-auto-columns:minmax(80px,1fr);
    grid-template-rows:56px;align-items:stretch;justify-content:stretch;
    gap:0;width:100%;max-width:100%;height:var(--workspace-mobile-dock-height);
    min-height:var(--workspace-mobile-dock-height);box-sizing:border-box;
    padding:4px max(8px,env(safe-area-inset-right,0px)) calc(11px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px));
    margin:0;border:0;border-top:1px solid var(--line);border-radius:0;
    background:var(--surface,#fff);box-shadow:0 -4px 16px #18202e08;
    overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;
    scrollbar-width:none;scroll-padding-inline:8px;
  }
  body .scene-workspace.scene-workspace .workspace-dock.workspace-dock::-webkit-scrollbar {display:none;}
  body .scene-workspace.scene-workspace .workspace-dock.workspace-dock > :is(button,a.workspace-evaluation-link) {
    position:relative;display:flex;flex:none;flex-direction:column;
    align-items:center;justify-content:center;gap:4px;
    box-sizing:border-box;width:100%;min-width:0;max-width:100%;height:56px;min-height:56px;
    margin:0;padding:6px 4px;border:0;border-radius:8px;
    font-size:11px;font-weight:400;line-height:16px;letter-spacing:0;
    text-align:center;text-decoration:none;white-space:nowrap;
    scroll-margin-inline:8px;
  }
  body .scene-workspace.scene-workspace .workspace-dock.workspace-dock > :is(button,a.workspace-evaluation-link) > span:not(.dock-symbol) {
    display:block;max-width:100%;font:inherit;line-height:16px;
    white-space:nowrap;word-break:keep-all;overflow-wrap:normal;
  }
  body .scene-workspace.scene-workspace .workspace-dock.workspace-dock .dock-symbol {
    display:grid;place-items:center;flex:0 0 20px;width:20px;height:20px;margin:0;line-height:1;
  }
  body .scene-workspace.scene-workspace .workspace-dock.workspace-dock .product-nav-icon {display:block;width:20px;height:20px;margin:0;}
  body .scene-workspace.scene-workspace .workspace-dock.workspace-dock > :is(button,a.workspace-evaluation-link) > b {
    position:absolute;top:2px;right:calc(50% - 25px);margin:0;
  }
  .scene-workspace .workspace-dock-progress {
    display:block;position:fixed;z-index:81;
    left:50%;bottom:calc(4px + env(safe-area-inset-bottom,0px));
    width:88px;height:3px;transform:translateX(-50%);
    border-radius:999px;background:var(--line,#dfe2e8);pointer-events:none;
  }
  .scene-workspace .workspace-dock-progress > span {
    position:absolute;top:0;height:100%;border-radius:inherit;
    background:var(--muted,#697386);opacity:.65;
  }
  body .scene-workspace.scene-workspace .task-panel.collapsed:is(.mascot-launcher,.assistant-launcher) {
    bottom:calc(var(--workspace-mobile-dock-height) + 12px)!important;
  }
}
