/* SEDTRACKER Online — Client Project Portal shell */

.client-portal-shell {
  /* Sidebar width is content-driven (Recent Projects toolbar), not a fixed guess.
     Display Panel fills the remaining space and shrinks first. */
  --cp-column-gap: 14px;
  --cp-sidebar-max: min(520px, 48vw);
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* fallback for browsers without dvh */
  min-height: 100dvh;
  min-width: 0;
  overflow-x: hidden;
  background: linear-gradient(to bottom, #34383d, #232629);
  color: #f2f5f8;
  font-family: inherit;
  box-sizing: border-box;
}

.client-portal-shell *,
.client-portal-shell *::before,
.client-portal-shell *::after {
  box-sizing: border-box;
}

.client-portal-restriction-banner {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 18px;
  background: #5a3a12;
  border-bottom: 1px solid rgba(255, 210, 140, 0.35);
  color: #fff4e4;
  white-space: nowrap;
  overflow: hidden;
}

.client-portal-restriction-banner strong {
  display: inline;
  flex: 0 0 auto;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.client-portal-restriction-banner p {
  margin: 0;
  flex: 1 1 auto;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-portal-shell.is-company-restricted #client-portal-new-project-btn {
  opacity: 0.55;
  cursor: not-allowed;
}

.client-portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 18px;
  background: linear-gradient(to bottom, #111315, #050607);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  min-height: 64px;
}

.client-portal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.client-portal-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
  background: transparent;
}

.client-portal-brand-name {
  display: grid;
  line-height: 1.1;
}

.client-portal-brand-line1 {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
}

.client-portal-brand-line2 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #59b7de;
}

.client-portal-header-title-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.client-portal-header-title {
  flex: 0 1 auto;
  min-width: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  padding-left: 18px;
}

.client-portal-header-title h1 {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.6px;
}

.client-portal-header-title p {
  font-size: 11px;
  font-weight: 600;
  color: rgba(242, 245, 248, 0.66);
}

.client-portal-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-portal-user-copy {
  display: grid;
  text-align: right;
  line-height: 1.2;
}

.client-portal-user-copy span {
  font-size: 13px;
  font-weight: 800;
}

.client-portal-user-copy small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(242, 245, 248, 0.6);
}

.client-portal-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #ffffff;
  background: linear-gradient(to bottom, #45a8d6, #2a7cab);
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.client-portal-settings-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f2f5f8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.client-portal-settings-btn svg {
  width: 20px;
  height: 20px;
}

.client-portal-settings-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.client-portal-logout-btn {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #f2f5f8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  cursor: pointer;
}

.client-portal-logout-btn:hover {
  background: rgba(217, 83, 79, 0.32);
  border-color: rgba(217, 83, 79, 0.6);
}

.client-portal-body {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: grid;
  /* Sidebar = intrinsic width of left content (toolbar-led). Display = rest. */
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: var(--cp-column-gap);
  row-gap: var(--cp-column-gap);
  gap: var(--cp-column-gap);
  padding: 14px 18px 18px;
  align-items: stretch;
  overflow-x: hidden;
}

.client-portal-side {
  /* Column flex: Recent Projects (toolbar) sets intrinsic width;
     REQUEST stretches to match without expanding the column.
     Recent grows into the height SUMMARY used to occupy. */
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  min-width: 0;
  width: max-content;
  max-width: var(--cp-sidebar-max);
}

.client-portal-panel {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.18));
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  width: auto;
  box-sizing: border-box;
}

/* Recent Projects defines the sidebar intrinsic width via its toolbar row. */
.client-portal-panel-recent {
  position: relative;
  width: max-content;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

.client-portal-panel-request {
  /* Stretch to Recent's width; width:0/min-width:100% keeps it from driving max-content. */
  flex: 0 0 auto;
  width: 0;
  min-width: 100%;
  max-width: 100%;
}

.client-portal-panel h2 {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 10px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.client-portal-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.client-portal-panel-head h2 {
  margin-bottom: 0;
}

.client-portal-request-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.client-portal-request-btn {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f2f5f8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.client-portal-request-icon {
  width: 62px;
  height: 62px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, #4fb0dc, #2f83b1);
  color: #ffffff;
}

.client-portal-request-icon svg {
  width: 34px;
  height: 34px;
}

.client-portal-request-btn:hover {
  background: rgba(255, 255, 255, 0.09);
}

.client-portal-request-btn.active {
  border-color: #59b7de;
  box-shadow: 0 0 0 1px #59b7de, 0 10px 26px rgba(0, 0, 0, 0.35);
  background: rgba(89, 183, 222, 0.12);
}

.client-portal-panel-head-recent {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: max-content;
  max-width: 100%;
}

.client-portal-panel-head-recent .client-portal-filter-hint {
  width: 0;
  min-width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.client-portal-panel-head-recent h2 {
  margin: 0;
}

.client-portal-filter-hint {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: rgba(159, 215, 239, 0.85);
}

.client-portal-filter-hint[hidden] {
  display: none !important;
}

.client-portal-whos-warning,
.client-portal-members-warning .client-portal-sync-message {
  font-size: 10px;
  color: rgba(255, 212, 120, 0.9);
  margin: 0;
}

.client-portal-members-warning {
  margin-bottom: 6px;
}

.client-portal-panel-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: max-content;
  max-width: 100%;
  min-width: 0;
}

.client-portal-panel-head-recent .client-portal-view-more-btn {
  white-space: nowrap;
  flex: 0 0 auto;
}

.client-portal-view-more-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(89, 183, 222, 0.7);
  background: rgba(89, 183, 222, 0.10);
  color: #9fd7ef;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  cursor: pointer;
}

.client-portal-view-more-btn:hover,
.client-portal-view-more-btn.active {
  background: rgba(89, 183, 222, 0.28);
  color: #ffffff;
}

.client-portal-view-more-btn.is-filtered {
  border-color: #59b7de;
  background: rgba(89, 183, 222, 0.22);
  color: #ffffff;
}

.client-portal-view-more-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.client-portal-refresh-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(89, 183, 222, 0.7);
  background: rgba(89, 183, 222, 0.12);
  color: #9fd7ef;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
}

.client-portal-refresh-btn svg {
  width: 15px;
  height: 15px;
}

.client-portal-refresh-btn:hover {
  background: rgba(89, 183, 222, 0.3);
  color: #ffffff;
}

.client-portal-refresh-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.client-portal-whos-panel {
  position: absolute;
  top: 52px;
  right: 12px;
  left: 12px;
  z-index: 20;
  max-width: calc(100% - 24px);
  width: auto;
  max-height: min(70vh, 420px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#client-portal-switch-view-panel {
  z-index: 21;
}

.client-portal-whos-panel.hidden {
  display: none;
}

.client-portal-recent-list.is-busy {
  opacity: 0.72;
  pointer-events: none;
}

.client-portal-whos-option input:focus-visible {
  outline: 2px solid #59b7de;
  outline-offset: 2px;
}

.client-portal-view-more-btn:focus-visible,
.client-portal-refresh-btn:focus-visible {
  outline: 2px solid #7ee3a4;
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .client-portal-panel-head-recent .client-portal-view-more-btn {
    font-size: 9px;
    padding: 5px 9px;
    letter-spacing: 0.4px;
  }
}

.client-portal-whos-card {
  border: 1px solid rgba(89, 183, 222, 0.45);
  border-radius: 12px;
  background: linear-gradient(to bottom, #2a3036, #1c2025);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  padding: 12px;
  display: grid;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
}

.client-portal-whos-head h3 {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #9fd7ef;
}

.client-portal-whos-head p {
  margin-top: 4px;
  font-size: 10px;
  color: rgba(242, 245, 248, 0.6);
}

.client-portal-whos-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
}

.client-portal-whos-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.client-portal-whos-option:hover {
  border-color: rgba(89, 183, 222, 0.45);
}

.client-portal-whos-option-me {
  border-color: rgba(89, 183, 222, 0.35);
  background: rgba(89, 183, 222, 0.08);
}

.client-portal-whos-option input {
  margin-top: 2px;
  accent-color: #59b7de;
}

.client-portal-whos-option-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.client-portal-whos-option-copy strong {
  font-size: 11px;
  font-weight: 800;
}

.client-portal-whos-option-copy small {
  font-size: 10px;
  color: rgba(242, 245, 248, 0.55);
}

.client-portal-whos-empty {
  font-size: 11px;
  color: rgba(242, 245, 248, 0.55);
  padding: 8px 4px;
}

.client-portal-whos-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.client-portal-recent-list {
  /* width:0 + min-width:100% = list does not inflate max-content sidebar;
     once Recent is sized by the toolbar, list stretches to that width. */
  flex: 1;
  min-height: 0;
  width: 0;
  min-width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.client-portal-recent-list::-webkit-scrollbar {
  width: 8px;
}

.client-portal-recent-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.client-portal-recent-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: rgba(242, 245, 248, 0.55);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  min-height: 120px;
}

.client-portal-sync-wrap {
  flex: 1;
  min-height: 160px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.client-portal-sync-wrap p {
  font-size: 11px;
  color: rgba(242, 245, 248, 0.6);
}

.client-portal-sync-btn {
  padding: 14px 26px;
  border-radius: 12px;
  border: 1px solid rgba(89, 183, 222, 0.8);
  background: linear-gradient(to bottom, #4fb0dc, #2f83b1);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.client-portal-sync-btn:hover {
  filter: brightness(1.08);
}

.client-portal-sync-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.client-portal-sync-message {
  min-height: 14px;
  font-size: 11px;
  color: #ffb4b4;
}

.client-portal-project-card {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(to bottom, #3d4248, #2a2e33);
  padding: 10px 12px;
  display: grid;
  gap: 5px;
  align-content: start;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
  min-width: 0;
  max-width: 100%;
  /* Keep natural card height; list scrolls — do not flex-shrink/clip content. */
  flex: 0 0 auto;
  overflow-x: hidden;
  overflow-y: visible;
}

.client-portal-project-card:hover {
  border-color: rgba(89, 183, 222, 0.7);
}

.client-portal-project-card.active {
  border-color: #59b7de;
  box-shadow: 0 0 0 1px #59b7de;
  background: linear-gradient(to bottom, #40484f, #2c3138);
}

.client-portal-project-card header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: #9fd7ef;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-drawing-line,
.project-card-tracking-line {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: #9fd7ef;
  text-transform: uppercase;
}

.client-portal-project-card h3 {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-portal-project-card-details p {
  font-size: 10px;
  color: rgba(242, 245, 248, 0.62);
}

.cp-draft-in-progress {
  margin: 4px 0 0;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #f0c14b;
}

.cp-all-projects-card .cp-draft-in-progress {
  color: #e09b4a;
}

.client-portal-project-card footer {
  font-size: 10px;
  font-weight: 800;
  color: rgba(242, 245, 248, 0.7);
  display: flex;
  align-items: center;
  gap: 6px;
}

.client-portal-project-card footer span {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #22262a;
}

.client-portal-project-card footer span[data-status="new"] {
  background: #ffd76b;
  color: #4a3a05;
}

.client-portal-project-card footer span[data-status="unassigned"] {
  background: #ffb4b4;
  color: #571414;
}

.client-portal-project-card footer span[data-status="working-on"] {
  background: #9fd7ef;
  color: #0d3548;
}

.client-portal-project-card footer span[data-status="sent"] {
  background: #9fe0ab;
  color: #124a1e;
}

.client-portal-display {
  border: 1px solid rgba(120, 200, 120, 0.35);
  border-radius: 10px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.2));
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.client-portal-display-head {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.client-portal-display-head h2 {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.6px;
  min-width: 0;
  flex: 1;
}

.client-portal-display-head h2 span {
  font-weight: 600;
  color: rgba(242, 245, 248, 0.66);
}

#client-portal-shell .cp-display-head-primary {
  display: contents;
}

.cp-display-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
}

.client-portal-display-head h2 .cp-display-kicker {
  flex: 0 0 auto;
  color: inherit;
  font-weight: 900;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.cp-display-surface-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.client-portal-display-head h2 .cp-display-request-summary {
  flex: 0 0 auto;
  white-space: nowrap;
  word-break: keep-all;
}

.cp-display-head-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  min-width: max-content;
}

.cp-display-request-summary {
  margin-left: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: rgba(242, 245, 248, 0.88);
}

.client-portal-display-close {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f2f5f8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.client-portal-display-close:hover {
  background: rgba(217, 83, 79, 0.4);
}

.client-portal-display-close[hidden] {
  display: none !important;
}

.client-portal-display-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.cp-completed-pref-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(100%, 360px);
  min-width: 0;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #f2f5f8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
}

.cp-completed-pref-toggle[aria-pressed="true"] {
  border-color: rgba(110, 198, 140, 0.55);
  background: rgba(110, 198, 140, 0.16);
}

.cp-completed-pref-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cp-completed-pref-state {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
}

.cp-completed-pref-toggle[aria-pressed="true"] .cp-completed-pref-state {
  background: rgba(110, 198, 140, 0.28);
}

@media (max-width: 820px) {
  .cp-completed-pref-label {
    white-space: normal;
  }
}

.client-portal-display-body {
  --cp-card-max: 440px;
  --cp-card-gap: 16px;
  --cp-rail-pad: 16px;
  --cp-template-min: 280px;
  --cp-template-preferred: 720px;
  --cp-rail-1col: calc(var(--cp-card-max) + 2 * var(--cp-rail-pad));
  --cp-rail-2col: calc(2 * var(--cp-card-max) + var(--cp-card-gap) + 2 * var(--cp-rail-pad));
  flex: 1;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.client-portal-display-body:has([data-cp-completed-inbox]):not(:has(.cp-global-template)),
.client-portal-display-body:has([data-cp-note-inbox]):not(:has(.cp-global-template)),
.client-portal-display-body:has([data-cp-ccr-resolved-inbox]):not(:has(.cp-global-template)),
.client-portal-display-body:has([data-cp-display-rail]):not(:has(.cp-global-template)) {
  align-items: stretch;
  justify-content: flex-start;
}

.client-portal-display-body:has(.cp-global-template):has([data-cp-completed-inbox]),
.client-portal-display-body:has(.cp-global-template):has([data-cp-note-inbox]),
.client-portal-display-body:has(.cp-global-template):has([data-cp-ccr-resolved-inbox]),
.client-portal-display-body:has(.cp-global-template):has([data-cp-display-rail]) {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  align-content: stretch;
  justify-content: start;
  overflow: hidden;
  padding: 0;
  min-height: 0;
}

.client-portal-display-body:has(.cp-global-template):has([data-cp-display-rail]) > .cp-global-template,
.client-portal-display-body:has(.cp-global-template):has([data-cp-completed-inbox]) > .cp-global-template,
.client-portal-display-body:has(.cp-global-template):has([data-cp-note-inbox]) > .cp-global-template,
.client-portal-display-body:has(.cp-global-template):has([data-cp-ccr-resolved-inbox]) > .cp-global-template {
  align-self: stretch;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.client-portal-display-body:has(.cp-global-template):has([data-cp-display-rail]) .cp-global-template-pane,
.client-portal-display-body:has(.cp-global-template):has([data-cp-completed-inbox]) .cp-global-template-pane,
.client-portal-display-body:has(.cp-global-template):has([data-cp-note-inbox]) .cp-global-template-pane,
.client-portal-display-body:has(.cp-global-template):has([data-cp-ccr-resolved-inbox]) .cp-global-template-pane {
  width: 100% !important;
  max-width: none;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.cp-completed-inbox,
.cp-note-inbox,
.cp-ccr-resolved-inbox {
  display: grid;
  grid-template-columns: minmax(min(100%, var(--cp-card-max)), var(--cp-card-max));
  justify-content: start;
  justify-items: start;
  align-content: start;
  align-items: start;
  gap: var(--cp-card-gap);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: var(--cp-rail-pad);
  box-sizing: border-box;
}

.cp-completed-inbox .eds-note-card,
.cp-note-inbox .eds-note-card,
.cp-ccr-resolved-inbox .eds-note-card {
  width: min(440px, 100%);
  max-width: 440px;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.cp-completed-inbox .eds-note-card {
  padding-right: 16px;
}

.cp-completed-inbox .eds-note-meta span {
  min-width: 92px;
  max-width: 100%;
  white-space: nowrap;
}

.cp-completed-inbox .eds-note-title,
.cp-completed-inbox .eds-note-snippet,
.cp-completed-inbox .eds-note-meta,
.cp-note-inbox .eds-note-title,
.cp-note-inbox .eds-note-snippet,
.cp-note-inbox .eds-note-meta,
.cp-note-inbox .eds-note-previews,
.cp-ccr-resolved-inbox .eds-note-title,
.cp-ccr-resolved-inbox .eds-note-snippet,
.cp-ccr-resolved-inbox .eds-note-meta {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
  max-width: 100%;
}

.cp-completed-inbox-more {
  grid-column: 1 / -1;
  margin: 0;
  min-width: 0;
  font-size: 12px;
  color: rgba(242, 245, 248, 0.72);
}

.client-portal-display-body:has(.cp-global-template) > [data-cp-completed-inbox],
.client-portal-display-body:has(.cp-global-template) > [data-cp-note-inbox],
.client-portal-display-body:has(.cp-global-template) > [data-cp-ccr-resolved-inbox],
.client-portal-display-body:has(.cp-global-template) > [data-cp-display-rail] {
  position: static;
  flex: 1 1 auto;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  align-self: stretch;
  overflow-x: hidden;
  overflow-y: auto;
}

.cp-display-rail {
  container-type: inline-size;
  container-name: cp-rail;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: var(--cp-rail-pad);
  box-sizing: border-box;
}

[data-cp-display-rail] > .cp-invoice-inbox {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: none;
  min-width: 0;
  padding-bottom: 10px;
}

.cp-invoice-pending,
.cp-invoice-paid {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #2a3038;
  color: #f2f5f8;
}

.cp-invoice-pending {
  display: grid;
  grid-template-columns: 78px minmax(0, 0.86fr) 1px minmax(0, 1fr);
  align-items: start;
  column-gap: 10px;
  row-gap: 0;
  padding: 6px 10px;
  box-sizing: border-box;
  overflow: visible;
  border: 1px solid rgba(205, 205, 195, 0.58);
  box-shadow:
    0 7px 10px rgba(0, 0, 0, 0.72),
    0 2px 3px rgba(0, 0, 0, 0.55);
}

.cp-invoice-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  width: 78px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.cp-invoice-file-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 64px;
  overflow: visible;
  flex: 0 0 auto;
}

.cp-invoice-file-name,
.invoice-notice__filename {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 78px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-align: center;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  color: #f4f1e8;
}

.cp-invoice-pending-facts,
.cp-invoice-pending-copy {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.cp-invoice-pending-facts { gap: 0; }
.cp-invoice-pending-copy { gap: 2px; }

.cp-invoice-title,
.cp-invoice-detail,
.cp-invoice-message,
.invoice-notice__filename {
  margin: 0;
  padding: 0;
}

.cp-invoice-title {
  font-size: clamp(16px, 1.55cqw, 22px);
  font-weight: 700;
  line-height: 1.15;
  color: #f7f8fa;
  white-space: nowrap;
}

.cp-invoice-detail {
  font-size: 12px;
  line-height: 1.15;
  font-weight: 400;
  color: rgba(242, 245, 248, 0.78);
}

.cp-invoice-message {
  font-size: clamp(12px, 1.05cqw, 13.5px);
  line-height: 1.25;
  font-weight: 400;
  color: rgba(242, 245, 248, 0.92);
}

.cp-invoice-paid p {
  margin: 0;
  font-size: clamp(13px, 1.15cqw, 15px);
  line-height: 1.3;
  font-weight: 400;
  color: rgba(242, 245, 248, 0.92);
}

.cp-invoice-pending-rule {
  width: 1px;
  height: auto;
  min-height: 0;
  align-self: stretch;
  justify-self: center;
  background: rgba(255, 255, 255, 0.28);
}

.cp-invoice-paid {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 14px 36px 14px 16px;
}

.cp-invoice-paid p { flex: 1 1 auto; }
.cp-invoice-paid .rd-text-btn { flex: 0 0 auto; }

.cp-invoice-dismiss {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #f2f5f8;
  cursor: pointer;
}

@container cp-rail (max-width: 1100px) {
  .cp-invoice-pending {
    grid-template-columns: 72px minmax(0, 0.9fr) 1px minmax(0, 1fr);
    column-gap: 8px;
    padding: 6px 8px;
  }

  .cp-invoice-title {
    font-size: clamp(16px, 1.55cqw, 18px);
  }
}

@container cp-rail (max-width: 860px) {
  .cp-invoice-title {
    white-space: normal;
    overflow-wrap: break-word;
  }
}

@container cp-rail (max-width: 560px) {
  .cp-invoice-pending {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 6px;
    padding: 8px;
  }

  .cp-invoice-file {
    width: 78px;
  }

  .cp-invoice-title {
    white-space: normal;
    overflow-wrap: break-word;
    font-size: clamp(16px, 4.5cqw, 18px);
  }

  .cp-invoice-pending-rule {
    width: 100%;
    height: 1px;
    align-self: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-icon--invoice-notice {
    transition: none;
  }
}

.cp-display-rail-grid,
[data-cp-display-rail-grid] {
  display: grid;
  grid-template-columns: minmax(min(100%, var(--cp-card-max)), var(--cp-card-max));
  justify-content: start;
  justify-items: start;
  align-content: start;
  align-items: start;
  gap: var(--cp-card-gap);
  width: 100%;
  max-width: 100%;
}

@container cp-rail (min-width: 896px) {
  .cp-display-rail-grid,
  [data-cp-display-rail-grid] {
    grid-template-columns: repeat(2, minmax(0, var(--cp-card-max)));
  }
}

@container cp-rail (min-width: 1352px) {
  .cp-display-rail-grid,
  [data-cp-display-rail-grid] {
    grid-template-columns: repeat(3, minmax(0, var(--cp-card-max)));
  }
}

[data-cp-display-rail] .cp-completed-inbox,
[data-cp-display-rail] .cp-note-inbox,
[data-cp-display-rail] .cp-ccr-resolved-inbox {
  display: contents;
  position: static;
  left: auto;
  width: auto;
  max-width: none;
  padding: 0;
  overflow: visible;
}

.cp-display-rail .eds-note-error,
.cp-display-rail .cp-completed-inbox-more {
  grid-column: 1 / -1;
}

.cp-note-inbox .eds-note-previews {
  flex-wrap: wrap;
}

/* Client notification order uses the full rail width. The template and the
   blocked-company image keep their own columns. */
[data-cp-display-rail-grid]:has([data-cp-note-board]) {
  display: block;
  width: 100%;
  max-width: 100%;
}

[data-cp-display-rail] [data-eds-note-inbox] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  gap: 0;
}

[data-eds-note-inbox][data-cp-note-span="1"][data-eds-note-layout="columns"] .eds-note-board {
  grid-template-columns: minmax(0, min(100%, 440px));
  max-width: 440px;
  row-gap: 8px;
}

/* All Projects owns its own scroll region so cards never paint under the filters. */
.client-portal-display-body:has(.cp-all-projects) {
  overflow: hidden;
}

.cp-view-more-host,
.cp-overview-host {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  align-self: stretch;
}

/* One vertical scroll owner: .cp-all-projects-scroll. The host only bounds height. */
.cp-view-more-host {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.cp-overview-host {
  min-height: 0;
  overflow: auto;
}

.cp-view-more-host[hidden],
.cp-overview-host[hidden] {
  display: none !important;
}

.client-portal-display-placeholder {
  height: 100%;
  min-height: 220px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  color: rgba(242, 245, 248, 0.6);
}

.client-portal-display-placeholder h3 {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #9fd7ef;
}

.client-portal-display-placeholder p {
  font-size: 12px;
}

@media (max-width: 1100px) {
  .client-portal-shell {
    --cp-sidebar-max: min(480px, 52vw);
  }
}

@media (max-width: 860px) {
  .client-portal-shell {
    --cp-sidebar-max: 100%;
  }

  .client-portal-body {
    grid-template-columns: minmax(0, 1fr);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .client-portal-side {
    width: 100%;
    max-width: 100%;
  }

  .client-portal-panel-recent {
    width: 100%;
    flex: 0 0 auto;
  }

  .client-portal-panel-request {
    width: 100%;
    min-width: 0;
  }

  .client-portal-panel-head-actions {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .client-portal-recent-list {
    max-height: 280px;
  }

  .client-portal-display {
    min-height: 480px;
    max-width: 100%;
  }

  .client-portal-header {
    flex-wrap: wrap;
  }

  .client-portal-header-title-group {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
  }

  .client-portal-header-title {
    border-left: none;
    padding-left: 0;
    width: auto;
  }

  .client-portal-whos-panel {
    max-height: min(60vh, 360px);
  }

  .client-portal-body:has(.cp-all-projects) {
    overflow: hidden;
  }
}

/* --- All Projects (Display Panel) --- */
.cp-all-projects {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.cp-all-projects-toolbar {
  display: grid;
  gap: 10px;
  flex: 0 0 auto;
  z-index: 2;
  margin: 2px 2px 0;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1c2024;
}

.cp-all-projects-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cp-all-projects-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  position: relative;
}

.cp-all-projects-search-input {
  flex: 1 1 12rem;
  min-width: 9rem;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.25);
  color: #f2f5f8;
  padding: 0 12px;
  font-size: 12px;
}

.cp-all-projects-search-input:focus {
  outline: none;
  border-color: #59b7de;
}

.cp-all-projects-search-btn,
.cp-all-projects-search-clear,
.cp-all-projects-clear-filters {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f2f5f8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
}

.cp-all-projects-search-btn:hover,
.cp-all-projects-search-clear:hover,
.cp-all-projects-clear-filters:hover {
  border-color: rgba(89, 183, 222, 0.7);
}

.cp-all-projects-search-clear[hidden] {
  display: none !important;
}

.cp-all-projects-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  align-items: end;
}

.cp-reports-view-mode-options {
  display: flex;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  overflow: hidden;
  background: #2a2e33;
}

.cp-reports-view-mode-options button {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #f2f5f8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
}

.cp-reports-view-mode-options button[aria-checked="true"] {
  background: #24566c;
  color: #ffffff;
}

.cp-reports-view-mode-options button:focus-visible {
  outline: 2px solid #59b7de;
  outline-offset: -2px;
}

/* Vertical and horizontal scrolling both belong to .cp-all-projects-scroll.
   overflow-x: auto here would also compute overflow-y to auto and become the
   sticky containing block, so the real thead would scroll away. */
.cp-reports-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.cp-reports-table-wrap .cp-revisions-table {
  min-width: 1180px;
  /* Revisions keeps border-spacing: 0 6px. That gap sits above the header and
     makes sticky top: 0 jump as soon as the list moves. */
  border-spacing: 0;
}

.cp-all-projects-scroll .cp-reports-table-wrap .cp-revisions-table thead,
.cp-all-projects-scroll .cp-reports-table-wrap .cp-revisions-table thead tr {
  background: #12151a;
}

.cp-all-projects-scroll .cp-reports-table-wrap .cp-revisions-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  border-radius: 0;
  box-shadow: none;
  background: #12151a;
}

.cp-all-projects-scroll .cp-reports-table-wrap .cp-revisions-table thead th:first-child,
.cp-all-projects-scroll .cp-reports-table-wrap .cp-revisions-table thead th:last-child {
  border-radius: 0;
  box-shadow: none;
  background: #12151a;
}

.cp-reports-table-wrap .cp-revisions-table tbody tr + tr td {
  border-top: 6px solid transparent;
  background-clip: padding-box;
}

.cp-reports-table-draft-unknown {
  color: rgba(242, 245, 248, 0.55);
}

.cp-reports-table-kind-unknown,
.cp-reports-table-kind-pending {
  color: #f3e2b3;
}

.cp-reports-table-wrap .cp-revisions-table-row:focus-visible {
  outline: 2px solid #f2f5f8;
  outline-offset: -2px;
}

.cp-all-projects-filter {
  display: grid;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: rgba(242, 245, 248, 0.7);
  text-transform: uppercase;
}

.cp-all-projects-filter select {
  width: 100%;
  min-width: 0;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #2a2e33;
  color: #f2f5f8;
  padding: 0 8px;
  font-size: 12px;
  color-scheme: dark;
}

.cp-all-projects-filter select option {
  background-color: #2a2e33;
  color: #f2f5f8;
}

.cp-reports-date-range {
  display: contents;
}

.cp-reports-date-range .cp-all-projects-filter {
  flex: 0 0 auto;
  width: max-content;
  min-width: max-content;
  max-width: none;
}

.cp-reports-date-range select[data-reports-completed-month] {
  width: 9.5rem;
  min-width: 9.5rem;
  height: 34px;
}

.cp-reports-date-range input[type="date"] {
  width: 11.5rem;
  min-width: 11.5rem;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #2a2e33;
  color: #f2f5f8;
  padding: 0 8px;
  font-size: 12px;
  color-scheme: dark;
}

.cp-reports-date-range .cp-all-projects-filter:focus-within input[type="date"],
.cp-reports-date-range button:focus,
.cp-reports-date-range button:focus-visible {
  outline: 2px solid #59b7de;
  outline-offset: 2px;
  border-color: #59b7de;
}

.cp-reports-export {
  position: fixed;
  inset: 0;
  /* The Client shell is position:fixed at z-index 900. The dialog is mounted
     inside the active portal shell, above that shell and the Employee surface. */
  z-index: 1200;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 16px;
}

.cp-reports-export-card {
  width: min(440px, 100%);
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: #1c2024;
  color: #f2f5f8;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.cp-reports-export-card h3 {
  margin: 0;
  font-size: 16px;
}

.cp-reports-export-card fieldset {
  display: grid;
  gap: 6px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
}

.cp-reports-export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cp-reports-export-status {
  margin: 0;
  white-space: pre-line;
  min-height: 1.2em;
}

.cp-reports-date-range-error {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: #ffb4b4;
}

.cp-all-projects-count {
  margin: 0;
  font-size: 11px;
  color: rgba(242, 245, 248, 0.66);
}

.cp-all-projects-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.cp-all-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.cp-all-projects-card {
  position: relative;
  min-height: 210px;
}

.cp-all-projects-card:focus {
  outline: none;
  border-color: #59b7de;
  box-shadow: 0 0 0 1px #59b7de;
}

.cp-all-projects-card:focus-visible {
  outline: 2px solid #59b7de;
  outline-offset: 2px;
}

.cp-all-projects-tip-btn {
  margin-left: auto;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #9fd7ef;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.cp-all-projects-tooltip {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  border-radius: 8px;
  border: 1px solid rgba(89, 183, 222, 0.45);
  background: rgba(18, 22, 26, 0.96);
  padding: 8px 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.cp-all-projects-tooltip[hidden] {
  display: none !important;
}

.cp-all-projects-tooltip p {
  margin: 0 0 4px;
  font-size: 10px;
  color: rgba(242, 245, 248, 0.88);
  line-height: 1.35;
}

.cp-all-projects-tooltip-note {
  color: rgba(242, 245, 248, 0.5) !important;
  font-style: italic;
}

.cp-all-projects-empty {
  min-height: 180px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: rgba(242, 245, 248, 0.62);
  font-size: 12px;
}

@media (max-width: 700px) {
  .cp-all-projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .cp-all-projects-filters {
    grid-template-columns: 1fr 1fr;
  }

  .cp-reports-date-range .cp-all-projects-filter {
    width: max-content;
    min-width: max-content;
    max-width: none;
  }
}

/* View in Small Screen: focused desktop Client Portal only. */
#client-portal-shell.is-small-screen-focus .client-portal-body {
  grid-template-columns: minmax(0, 1fr);
}

#client-portal-shell.is-small-screen-focus .client-portal-side {
  display: none;
}

#client-portal-shell.is-small-screen-focus .client-portal-display {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#client-portal-shell.is-client-compact-labels .client-portal-display-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  overflow: visible;
}

#client-portal-shell.is-client-compact-labels .cp-display-head-primary {
  display: contents;
}

#client-portal-shell.is-client-compact-labels .cp-display-head-title {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
  flex-wrap: nowrap;
  white-space: nowrap;
}

#client-portal-shell.is-client-compact-labels .cp-display-head-title:has(.eds-note-order) {
  overflow: visible;
}

#client-portal-shell.is-client-compact-labels .cp-display-head-tools {
  grid-column: 2;
  grid-row: 1;
  flex-shrink: 0;
}

#client-portal-shell.is-client-compact-labels .client-portal-display-close {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

#client-portal-shell.is-client-compact-labels .client-portal-display-head-actions {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow: visible;
}

#client-portal-shell.is-client-compact-labels .client-portal-display-head-actions:not(:has(> :not([hidden]))) {
  display: none;
}

#client-portal-shell.is-client-compact-labels .sed-go-incoming-access,
#client-portal-shell.is-client-compact-labels .cp-completed-pref-toggle,
#client-portal-shell.is-client-compact-labels .client-portal-display-close,
#client-portal-shell.is-client-compact-labels .client-portal-list-pager,
#client-portal-shell.is-client-compact-labels .client-portal-revisions-layout-toggle {
  flex: 0 0 auto;
  flex-shrink: 0;
  max-width: none;
  overflow: visible;
}

#client-portal-shell.is-client-compact-labels .cp-completed-pref-toggle {
  max-width: none;
}

#client-portal-shell.is-client-compact-labels .cp-completed-pref-label,
#client-portal-shell.is-client-compact-labels .cp-completed-pref-state,
#client-portal-shell.is-client-compact-labels .sed-go-incoming-access-label,
#client-portal-shell.is-client-compact-labels .cp-display-kicker,
#client-portal-shell.is-client-compact-labels .cp-display-surface-title,
#client-portal-shell.is-client-compact-labels .cp-display-request-summary {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  word-break: keep-all;
}

#client-portal-shell.is-client-compact-labels .cp-display-surface-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

#client-portal-shell.is-small-screen-focus .cp-ds-split.is-maximized,
#client-portal-shell.is-small-screen-focus .cp-ds-split.is-maximized > [data-cp-ds-panel] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
