/* Shared portal icon artwork and responsive minimal mobile treatment. */
.client-portal-page,
.studio-portal-page {
  --portal-icon-stroke: 1.7;
}

.client-portal-page .portal-icon,
.studio-portal-page .portal-icon {
  display: block !important;
  width: 20px;
  height: 20px;
  flex: none;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: var(--portal-icon-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-portal-page .quick-access-icon,
.studio-portal-page .quick-access-icon {
  display: grid;
  place-items: center;
  border-color: var(--portal-ui-border);
  background: var(--portal-ui-soft);
  background-image: none !important;
  color: var(--portal-ui-text);
  filter: none !important;
  box-shadow: none;
}

.client-portal-page .quick-access-icon .portal-icon,
.studio-portal-page .quick-access-icon .portal-icon {
  width: 25px;
  height: 25px;
}

.client-portal-page .quick-access-tile,
.studio-portal-page .quick-access-tile {
  color: var(--portal-ui-text);
  border-color: var(--portal-ui-border);
  background: var(--portal-ui-surface);
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.client-portal-page .quick-access-tile:hover,
.studio-portal-page .quick-access-tile:hover,
.client-portal-page .quick-access-tile:active,
.studio-portal-page .quick-access-tile:active {
  transform: none;
  border-color: var(--portal-ui-border-strong);
  background: var(--portal-ui-soft);
}

.client-portal-page .quick-access-copy small,
.studio-portal-page .quick-access-copy small {
  color: var(--portal-ui-muted);
}

.client-portal-page .quick-access-arrow,
.studio-portal-page .quick-access-arrow {
  color: var(--portal-ui-muted);
}

@media (max-width: 760px) {
  .client-portal-page .sidebar,
  .studio-portal-page .sidebar {
    background: var(--portal-ui-surface);
    border-color: var(--portal-ui-border);
  }

  .client-portal-page .brand,
  .studio-portal-page .brand {
    min-height: 50px;
    align-items: center;
    padding: 0 8px;
    color: var(--portal-ui-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -.035em;
  }

  .client-portal-page .topbar,
  .studio-portal-page .topbar {
    min-height: 56px;
    gap: 10px;
    margin: 0;
    padding: 8px 18px 10px;
    border-color: var(--portal-ui-border);
  }

  .client-portal-page .topbar-title,
  .studio-portal-page .topbar-title {
    font-size: 15px;
    font-weight: 600;
  }

  .client-portal-page .topbar .eyebrow,
  .studio-portal-page .topbar .eyebrow {
    margin-bottom: 2px;
    font-size: 9px;
  }

  .client-portal-page .topbar-actions,
  .studio-portal-page .topbar-actions {
    gap: 8px;
  }

  .client-portal-page .user-label {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .client-portal-page .mobile-bottom-nav,
  .studio-portal-page .mobile-bottom-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
    border-color: var(--portal-ui-border);
    background: color-mix(in srgb, var(--portal-ui-surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    backdrop-filter: saturate(180%) blur(22px);
  }

  .client-portal-page .mobile-bottom-nav button,
  .studio-portal-page .mobile-bottom-nav button {
    position: relative;
    min-width: 0;
    min-height: 55px;
    gap: 4px;
    padding: 5px 2px;
    border-radius: 14px;
    background: transparent;
    color: var(--portal-ui-muted);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 10px;
    font-weight: 500;
    transition: background-color .16s ease, color .16s ease;
  }

  .client-portal-page .mobile-bottom-nav button.active,
  .studio-portal-page .mobile-bottom-nav button.active {
    background: var(--portal-ui-soft);
    color: var(--portal-ui-text);
  }

  .client-portal-page .mobile-bottom-nav .portal-icon,
  .studio-portal-page .mobile-bottom-nav .portal-icon {
    width: 21px;
    height: 21px;
  }

  .client-portal-page .quick-access,
  .studio-portal-page .quick-access {
    margin: 22px 0 23px;
  }

  .client-portal-page .quick-access-heading,
  .studio-portal-page .quick-access-heading {
    align-items: center;
    margin-bottom: 12px;
  }

  .client-portal-page .quick-access-heading h3,
  .studio-portal-page .quick-access-heading h3 {
    margin-top: 4px;
    color: var(--portal-ui-text);
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -.035em;
  }

  .client-portal-page .quick-access-heading > span,
  .studio-portal-page .quick-access-heading > span {
    display: none;
  }

  .client-portal-page .quick-access-track,
  .studio-portal-page .quick-access-track {
    display: grid;
    grid-auto-columns: 82px;
    grid-auto-flow: column;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 3px 4px 8px;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .client-portal-page .quick-access-track::-webkit-scrollbar,
  .studio-portal-page .quick-access-track::-webkit-scrollbar {
    display: none;
  }

  .client-portal-page .quick-access-tile,
  .studio-portal-page .quick-access-tile {
    min-width: 0;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    padding: 0 2px 7px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--portal-ui-text);
    text-align: center;
    scroll-snap-align: start;
  }

  .client-portal-page .quick-access-tile:hover,
  .studio-portal-page .quick-access-tile:hover,
  .client-portal-page .quick-access-tile:active,
  .studio-portal-page .quick-access-tile:active {
    border: 0;
    background: transparent;
  }

  .client-portal-page .quick-access-icon,
  .studio-portal-page .quick-access-icon {
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--portal-ui-text);
  }

  .client-portal-page .quick-access-icon .portal-icon,
  .studio-portal-page .quick-access-icon .portal-icon {
    width: 42px;
    height: 42px;
    stroke-width: 1.55;
  }

  .client-portal-page .quick-access-copy,
  .studio-portal-page .quick-access-copy {
    min-width: 0;
    max-width: 100%;
    display: grid;
    justify-items: center;
    gap: 0;
  }

  .client-portal-page .quick-access-copy b,
  .studio-portal-page .quick-access-copy b {
    max-width: 100%;
    color: var(--portal-ui-text);
    font-size: 11px;
    font-weight: 550;
    letter-spacing: -.01em;
    white-space: normal;
    line-height: 1.25;
  }

  .client-portal-page .quick-access-copy small,
  .studio-portal-page .quick-access-copy small,
  .client-portal-page .quick-access-arrow,
  .studio-portal-page .quick-access-arrow {
    display: none;
  }

  .client-portal-page .portal-section[data-panel="overview"],
  .studio-portal-page .portal-section[data-panel="overview"] {
    padding: 18px 17px 28px;
  }

  .client-portal-page .welcome-row h2,
  .studio-portal-page .welcome-row h2 {
    color: var(--portal-ui-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: -.045em;
  }

  .client-portal-page .card,
  .studio-portal-page .card {
    border-color: var(--portal-ui-border);
    background: var(--portal-ui-surface);
    box-shadow: var(--portal-ui-shadow);
  }

  .client-portal-page .progress-card,
  .client-portal-page .next-card,
  .studio-portal-page .progress-card,
  .studio-portal-page .next-card {
    border-radius: 21px;
    padding: 20px;
  }

  .client-portal-page .mobile-bottom-nav button:hover,
  .studio-portal-page .mobile-bottom-nav button:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .client-portal-page .quick-access-tile,
  .studio-portal-page .quick-access-tile,
  .client-portal-page .mobile-bottom-nav button,
  .studio-portal-page .mobile-bottom-nav button {
    transition: none;
  }
}


/* Client directory: account-switcher style, with projects grouped under each client. */
.studio-portal-page .client-database-card { overflow: hidden; }
.studio-portal-page .client-database-table-wrap { padding: 14px; }
.studio-portal-page .client-account-list { display: grid; gap: 10px; }
.studio-portal-page .client-account-card {
  overflow: hidden;
  border: 1px solid var(--portal-ui-border);
  border-radius: 16px;
  background: var(--portal-ui-surface);
  color: var(--portal-ui-text);
  box-shadow: 0 1px 3px rgba(16,24,40,.035);
}
.studio-portal-page .client-account-card.is-current { border-color: var(--portal-ui-border-strong); }
.studio-portal-page .client-account-trigger {
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) auto 20px;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 78px;
  padding: 14px 17px;
  border: 0;
  background: transparent;
  color: var(--portal-ui-text);
  text-align: left;
  cursor: pointer;
  transition: background-color .16s ease;
}
.studio-portal-page .client-account-trigger:hover { background: var(--portal-ui-soft); }
.studio-portal-page .client-account-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--portal-ui-border);
  border-radius: 50%;
  background: var(--portal-ui-soft);
  color: var(--portal-ui-text);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.04em;
}
.studio-portal-page .client-account-identity,
.studio-portal-page .client-account-count { min-width: 0; display: grid; gap: 3px; }
.studio-portal-page .client-account-identity strong {
  overflow: hidden;
  color: var(--portal-ui-text);
  font-size: 15px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-portal-page .client-account-identity small,
.studio-portal-page .client-account-count,
.studio-portal-page .client-account-count small {
  overflow: hidden;
  color: var(--portal-ui-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-portal-page .client-account-count { justify-items: end; }
.studio-portal-page .client-account-count small { color: var(--portal-ui-quiet); font-size: 10px; }
.studio-portal-page .client-account-chevron {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--portal-ui-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s ease;
}
.studio-portal-page .client-account-card.is-expanded .client-account-chevron { transform: rotate(180deg); }
.studio-portal-page .client-account-projects {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px 74px;
}
.studio-portal-page .client-account-projects[hidden] { display: none; }
.studio-portal-page .client-account-project {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--portal-ui-border);
  border-radius: 12px;
  background: var(--portal-ui-bg);
  color: var(--portal-ui-text);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}
.studio-portal-page .client-account-project:hover {
  border-color: var(--portal-ui-border-strong);
  background: var(--portal-ui-soft);
}
.studio-portal-page .client-account-project-copy { display: grid; gap: 3px; min-width: 0; }
.studio-portal-page .client-account-project-copy strong {
  overflow: hidden;
  color: var(--portal-ui-text);
  font-size: 13px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-portal-page .client-account-project-copy small,
.studio-portal-page .client-account-project-meta > small,
.studio-portal-page .client-account-conversation {
  overflow: hidden;
  color: var(--portal-ui-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-portal-page .client-account-conversation { margin-top: 4px; color: var(--portal-ui-quiet); }
.studio-portal-page .client-account-conversation span { color: var(--portal-ui-muted); }
.studio-portal-page .client-account-project-meta { display: grid; justify-items: end; gap: 6px; }
.studio-portal-page .client-account-project-meta .pill {
  border-color: var(--portal-ui-border-strong);
  color: var(--portal-ui-muted);
}
.studio-portal-page .client-account-open-label {
  color: var(--portal-ui-text);
  font-size: 11px;
  font-weight: 600;
}
.studio-portal-page .client-account-open-label span { margin-left: 4px; }
.studio-portal-page .client-database-empty { color: var(--portal-ui-text); }
.studio-portal-page .client-database-empty h3 { color: var(--portal-ui-text); }
.studio-portal-page .client-database-empty p { color: var(--portal-ui-muted); }
.studio-portal-page .client-database-search { color: var(--portal-ui-muted); }

@media (max-width: 760px) {
  .studio-portal-page .client-database-table-wrap { padding: 10px; }
  .studio-portal-page .client-account-list { gap: 8px; }
  .studio-portal-page .client-account-trigger {
    grid-template-columns: 40px minmax(0,1fr) 18px;
    min-height: 70px;
    gap: 10px;
    padding: 12px;
  }
  .studio-portal-page .client-account-avatar { width: 40px; height: 40px; }
  .studio-portal-page .client-account-count { display: none; }
  .studio-portal-page .client-account-card.is-current .client-account-identity::after {
    content: "Current client";
    color: var(--portal-ui-quiet);
    font-size: 10px;
    line-height: 1.2;
  }
  .studio-portal-page .client-account-projects { padding: 0 10px 10px; }
  .studio-portal-page .client-account-project {
    grid-template-columns: minmax(0,1fr);
    gap: 10px;
    padding: 12px;
  }
  .studio-portal-page .client-account-project-copy strong { white-space: normal; }
  .studio-portal-page .client-account-project-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
  }

  .studio-portal-page .mobile-bottom-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    grid-template-rows: 1fr;
    white-space: nowrap;
  }
  .studio-portal-page .mobile-bottom-nav button { font-size: 9px; }

  .studio-portal-page .topbar { gap: 8px; }
  .studio-portal-page .topbar-project { flex: 1 1 0; min-width: 0; }
  .studio-portal-page .topbar-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .studio-portal-page .topbar-actions {
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
    justify-self: end;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .studio-portal-page .topbar-actions .user-label { display: none; }
  .studio-portal-page .topbar-actions .button { min-height: 38px; padding-inline: 9px; font-size: 10px; }
  .studio-portal-page .topbar-actions .sp-header-voice-trigger { width: 40px; height: 40px; flex: 0 0 40px; }
}

@media (min-width: 761px) {
  .studio-portal-page .topbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:nowrap; }
  .studio-portal-page .topbar-project { flex:1 1 auto; min-width:0; }
  .studio-portal-page .topbar-actions { width:auto; margin-left:auto; justify-content:flex-end; flex-wrap:nowrap; }
}

/* Theme-aware chat surfaces. Keep the reading area and composer on the page surface. */
.client-portal-page .portal-section[data-panel="chat"],
.studio-portal-page .portal-section[data-panel="chat"],
.client-portal-page .portal-section[data-panel="chat"] .chat-workspace,
.studio-portal-page .portal-section[data-panel="chat"] .chat-workspace,
.client-portal-page .portal-section[data-panel="chat"] .composer,
.studio-portal-page .portal-section[data-panel="chat"] .composer {
  background: transparent;
}
.client-portal-page .portal-section[data-panel="chat"] .messages,
.studio-portal-page .portal-section[data-panel="chat"] .messages {
  background: transparent;
}
.client-portal-page .portal-section[data-panel="chat"] .message,
.studio-portal-page .portal-section[data-panel="chat"] .message {
  border-color: var(--portal-ui-border);
  background: var(--portal-ui-surface);
  color: var(--portal-ui-text);
}
.client-portal-page .portal-section[data-panel="chat"] .message.mine,
.studio-portal-page .portal-section[data-panel="chat"] .message.mine {
  border-color: var(--portal-ui-border-strong);
  background: var(--portal-ui-soft);
  color: var(--portal-ui-text);
}
.client-portal-page .portal-section[data-panel="chat"] .message-head,
.studio-portal-page .portal-section[data-panel="chat"] .message-head {
  color: var(--portal-ui-muted);
}
.client-portal-page .portal-section[data-panel="chat"] .message-head time,
.studio-portal-page .portal-section[data-panel="chat"] .message-head time {
  color: var(--portal-ui-quiet);
}
.client-portal-page .portal-section[data-panel="chat"] .composer { border-top-color: transparent; }
.client-portal-page .portal-section[data-panel="chat"] .composer-box,
.studio-portal-page .portal-section[data-panel="chat"] .composer-box {
  background: var(--portal-ui-surface);
  border-color: var(--portal-ui-border-strong);
  color: var(--portal-ui-text);
  box-shadow: var(--portal-ui-shadow);
}
.client-portal-page .portal-section[data-panel="chat"] .composer-box textarea,
.studio-portal-page .portal-section[data-panel="chat"] .composer-box textarea {
  background: transparent;
  color: var(--portal-ui-text);
  caret-color: var(--portal-ui-text);
}
.client-portal-page .portal-section[data-panel="chat"] .composer-icon,
.studio-portal-page .portal-section[data-panel="chat"] .composer-icon,
.client-portal-page .portal-section[data-panel="chat"] .talk-october,
.studio-portal-page .portal-section[data-panel="chat"] .talk-october {
  flex: 0 0 auto;
}
.client-portal-page .portal-section[data-panel="chat"] .send-message,
.studio-portal-page .portal-section[data-panel="chat"] .send-message {
  flex: 0 0 auto;
}

/* Uniform icon tab strip and prevent hover jumps in the portal. */
.client-portal-page .quick-access-track,
.studio-portal-page .quick-access-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(98px, 1fr);
  justify-content: start;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 5px 2px 10px;
}
.client-portal-page .quick-access-track::-webkit-scrollbar,
.studio-portal-page .quick-access-track::-webkit-scrollbar { display:none; }
.client-portal-page .quick-access-tile,
.studio-portal-page .quick-access-tile {
  display:flex;
  min-height: 94px;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  gap: 8px;
  padding: 5px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  color: var(--portal-ui-text);
  text-align:center;
  transform:none !important;
  transition: color .16s ease, background-color .16s ease;
}
.client-portal-page .quick-access-tile:hover,
.studio-portal-page .quick-access-tile:hover,
.client-portal-page .quick-access-tile:focus-visible,
.studio-portal-page .quick-access-tile:focus-visible {
  background: var(--portal-ui-soft);
  transform:none !important;
}
.client-portal-page .quick-access-icon,
.studio-portal-page .quick-access-icon {
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
  color: var(--portal-ui-text);
}
.client-portal-page .quick-access-icon .portal-icon,
.studio-portal-page .quick-access-icon .portal-icon { width:32px; height:32px; }
.client-portal-page .quick-access-copy,
.studio-portal-page .quick-access-copy {
  display:grid;
  min-width:0;
  justify-items:center;
  gap:0;
}
.client-portal-page .quick-access-copy b,
.studio-portal-page .quick-access-copy b {
  color:var(--portal-ui-text);
  font-size:12px;
  font-weight:550;
  line-height:1.25;
}
.client-portal-page .quick-access-copy small,
.studio-portal-page .quick-access-copy small { display:none; }

/* Generated five-symbol artwork for the shortcut row; alpha is tinted by theme text color. */
.client-portal-page .quick-access-glyph,
.studio-portal-page .quick-access-glyph {
  display: block;
  width: 44px;
  height: 44px;
  flex: none;
  background-color: currentColor;
  -webkit-mask-image: url("/portal/project-tool-icons.png?v=project-tool-icons-20261105a");
  mask-image: url("/portal/project-tool-icons.png?v=project-tool-icons-20261105a");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 500% auto;
  mask-size: 500% auto;
  -webkit-mask-position: var(--quick-access-mask-position, 0%) center;
  mask-position: var(--quick-access-mask-position, 0%) center;
}
.client-portal-page .quick-access-icon--chat .quick-access-glyph,
.studio-portal-page .quick-access-icon--chat .quick-access-glyph { --quick-access-mask-position: 0%; }
.client-portal-page .quick-access-icon--updates .quick-access-glyph,
.studio-portal-page .quick-access-icon--updates .quick-access-glyph { --quick-access-mask-position: 25%; }
.client-portal-page .quick-access-icon--files .quick-access-glyph,
.studio-portal-page .quick-access-icon--files .quick-access-glyph { --quick-access-mask-position: 50%; }
.client-portal-page .quick-access-icon--payments .quick-access-glyph,
.studio-portal-page .quick-access-icon--payments .quick-access-glyph { --quick-access-mask-position: 75%; }
.client-portal-page .quick-access-icon--timeline .quick-access-glyph,
.studio-portal-page .quick-access-icon--timeline .quick-access-glyph { --quick-access-mask-position: 100%; }

.studio-portal-page .studio-overview-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
}
.studio-portal-page .studio-overview-summary-row .studio-project-summary {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
.studio-portal-page .studio-overview-summary-row .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .client-portal-page .quick-access-glyph,
  .studio-portal-page .quick-access-glyph {
    width: 42px;
    height: 42px;
  }

  .studio-portal-page .studio-overview-summary-row {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
  }
  .studio-portal-page .studio-overview-summary-row .button {
    min-height: 38px;
    align-self: flex-start;
  }
}


/* Mobile layout repair: preserve swipeable shortcuts, keep chat anchored above tabs,
   and leave enough scroll room below the final client/studio cards. */
@media (max-width: 760px) {
  .client-portal-page .portal-shell,
  .studio-portal-page .portal-shell {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .client-portal-page .main-content,
  .studio-portal-page .main-content {
    padding-bottom: 0 !important;
  }

  .client-portal-page .quick-access,
  .studio-portal-page .quick-access {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
  }

  .client-portal-page .quick-access-track,
  .studio-portal-page .quick-access-track {
    display: flex !important;
    flex-flow: row nowrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 12px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 4px 4px 12px;
    scroll-padding-inline: 4px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .client-portal-page .quick-access-tile,
  .studio-portal-page .quick-access-tile {
    flex: 0 0 clamp(116px, 34vw, 148px);
    width: clamp(116px, 34vw, 148px);
    min-width: 0;
    box-sizing: border-box;
    scroll-snap-align: start;
  }

  .client-portal-page:not(.chat-view) .portal-section.active,
  .studio-portal-page:not(.chat-view) .portal-section.active,
  .studio-portal-page:not(.chat-view) .client-database-section.active {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }

  .client-portal-page.chat-view .main-content,
  .studio-portal-page.chat-view .main-content {
    min-height: 0;
    padding: 0 !important;
  }

  .client-portal-page.chat-view .chat-workspace,
  .studio-portal-page.chat-view .chat-workspace {
    flex: 1 1 0%;
    height: auto !important;
    max-height: none;
    min-height: 0;
  }

  .client-portal-page.chat-view .composer,
  .studio-portal-page.chat-view .composer {
    margin: 0;
    padding: 8px 12px 8px !important;
  }
}


/* Mobile viewport repair: overview pages scroll naturally; chat pages dock the composer
   to the tab bar instead of leaving it stranded above a large empty region. */
@media (max-width: 760px) {
  .client-portal-page:not(.chat-view) .portal-shell,
  .studio-portal-page:not(.chat-view) .portal-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    height: auto !important;
    min-height: 100dvh;
    overflow: visible !important;
    overflow-x: clip !important;
    align-content: start;
  }

  .client-portal-page:not(.chat-view) .sidebar,
  .studio-portal-page:not(.chat-view) .sidebar {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .client-portal-page:not(.chat-view) .main-content,
  .studio-portal-page:not(.chat-view) .main-content {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    height: auto !important;
    min-height: 0;
    overflow: visible !important;
    padding: 0 0 calc(96px + env(safe-area-inset-bottom)) !important;
  }

  .client-portal-page:not(.chat-view) .portal-section.active,
  .studio-portal-page:not(.chat-view) .portal-section.active,
  .studio-portal-page:not(.chat-view) .client-database-section.active {
    height: auto;
    min-height: 0;
    overflow: visible !important;
    padding-bottom: 20px;
  }

  .client-portal-page:not(.chat-view) .mobile-bottom-nav,
  .studio-portal-page:not(.chat-view) .mobile-bottom-nav {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    max-width: none;
    grid-column: auto;
    grid-row: auto;
    align-self: stretch;
    margin: 0;
  }

  /* Keep the swipe track as the only horizontal clipping boundary. */
  .client-portal-page:not(.chat-view) .quick-access-track,
  .studio-portal-page:not(.chat-view) .quick-access-track {
    max-width: 100%;
    border-radius: 0;
    scroll-padding-inline: 12px;
    padding-inline: 12px;
  }

  .client-portal-page.chat-view .portal-shell,
  .studio-portal-page.chat-view .portal-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    width: 100%;
    height: 100dvh !important;
    min-height: 100dvh;
    overflow: hidden !important;
  }

  .client-portal-page.chat-view .sidebar,
  .studio-portal-page.chat-view .sidebar {
    grid-column: 1;
    grid-row: 1;
  }

  .client-portal-page.chat-view .main-content,
  .studio-portal-page.chat-view .main-content {
    grid-column: 1;
    grid-row: 2;
    display: flex !important;
    flex-direction: column;
    width: 100%;
    height: auto !important;
    min-height: 0;
    overflow: hidden !important;
    padding: 0 !important;
  }

  .client-portal-page.chat-view .main-content > [data-project-space]:not([hidden]) {
    display: flex !important;
    flex: 1 1 0%;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .client-portal-page.chat-view .main-content > [data-project-space] > [data-panel="chat"].active,
  .studio-portal-page.chat-view .main-content > [data-panel="chat"].active {
    display: flex !important;
    flex: 1 1 0%;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden !important;
    padding: 0 !important;
  }

  .client-portal-page.chat-view .chat-workspace,
  .studio-portal-page.chat-view .chat-workspace {
    display: flex !important;
    flex: 1 1 0%;
    flex-direction: column;
    width: 100%;
    height: auto !important;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .client-portal-page.chat-view .chat-context,
  .studio-portal-page.chat-view .chat-context,
  .client-portal-page.chat-view .october-capability-note,
  .studio-portal-page.chat-view .october-capability-note,
  .client-portal-page.chat-view .support-actions-pinned {
    flex: 0 0 auto;
  }

  .client-portal-page.chat-view .messages,
  .studio-portal-page.chat-view .messages {
    flex: 1 1 0% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

  .client-portal-page.chat-view .composer,
  .studio-portal-page.chat-view .composer {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    margin: auto 0 0 !important;
    align-self: stretch;
    padding: 8px 12px 12px !important;
  }

  .client-portal-page.chat-view .mobile-bottom-nav,
  .studio-portal-page.chat-view .mobile-bottom-nav {
    grid-column: 1;
    grid-row: 3;
    position: relative;
    z-index: 40;
    margin: 0;
  }
}

@media (max-width: 380px) {
  .client-portal-page.chat-view .composer,
  .studio-portal-page.chat-view .composer {
    padding-inline: 8px !important;
  }
}
