/**
 * Go CSS · gochat
 * 
 * Purpose:
 *   This dashboard piece.
 * 
 * Dashboard:
 *   Go Personal · data-view="gochat"
 * 
 * This file:
 *   personal/dashboard/gochat-app/gochat-app.css
 * 
 * Depends on:
 *   - business/dashboard/shell/shell.html
 *   - scripts/assemble-dashboards.js
 * 
 * Used by:
 *   - scripts/assemble-dashboards.js → personal/dashboard/index.html
 */

/* Phone dashboard lists stack identity, details, then actions so
   buttons and copy never clip and no horizontal scrollbar is needed. */
@media (max-width: 720px) {
  body.business-account .app-tile,
  body.business-account .team-member-row:not(.org-access-member-card),
  body.business-account .team-activity-row,
  body.business-account .catalogue-collection-card,
  body.business-account .booking-board-card,
  body.business-account .api-key-row,
  body.business-account .portal-list-row,
  body.business-account .gochat-files-item,
  body.business-account .ja-network-card {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  body.business-account .app-tile-actions,
  body.business-account .team-member-actions,
  body.business-account .catalogue-collection-card-actions,
  body.business-account .api-key-row .app-tile-actions,
  body.business-account .portal-list-row .app-tile-actions,
  body.business-account .gochat-files-item-actions,
  body.business-account .ja-network-actions,
  body.business-account .org-access-member-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    align-items: stretch;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 0.15rem;
  }

  body.business-account .app-tile-actions .app-get-btn,
  body.business-account .app-tile-actions .secondary-btn,
  body.business-account .app-tile-actions .primary-btn,
  body.business-account .app-tile-actions .danger-btn,
  body.business-account .team-member-actions .app-get-btn,
  body.business-account .team-member-actions .secondary-btn,
  body.business-account .team-member-actions .primary-btn,
  body.business-account .catalogue-collection-card-actions .app-get-btn,
  body.business-account .gochat-files-open,
  body.business-account .gochat-files-delete,
  body.business-account .ja-network-actions .secondary-btn,
  body.business-account .org-access-member-actions .app-get-btn {
    width: auto;
    min-width: 0;
    flex: 0 1 auto;
  }

  body.business-account .app-tile-body,
  body.business-account .app-tile-body h4,
  body.business-account .app-tile-tagline,
  body.business-account .app-tile-status,
  body.business-account .gochat-files-item-name,
  body.business-account .gochat-files-item-sub,
  body.business-account .catalogue-item-copy h4,
  body.business-account .wallet-tx-title {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: anywhere;
  }

  body.business-account .catalogue-manage .catalogue-item-card,
  body.business-account .catalogue-manage .catalogue-item-card:has(.catalogue-item-select) {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  body.business-account .catalogue-item-top,
  body.business-account .catalogue-manage .catalogue-item-top {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  body.business-account .catalogue-item-side,
  body.business-account .catalogue-manage .catalogue-item-side {
    align-items: flex-start;
    width: 100%;
  }

  body.business-account .catalogue-item-actions,
  body.business-account .catalogue-manage .catalogue-item-actions {
    justify-content: flex-start;
    width: 100%;
  }

  body.business-account .catalogue-item-price {
    white-space: normal;
  }

  body.business-account .activity-trip-card {
    flex-wrap: wrap;
    overflow: visible;
    align-items: flex-start;
  }

  body.business-account .activity-trip-card-main {
    flex: 1 1 100%;
  }

  body.business-account .activity-trip-card-top,
  body.business-account .activity-trip-card-meta {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  body.business-account .activity-trip-card-actions {
    width: 100%;
  }

  body.business-account .activity-trip-card-when {
    white-space: normal;
  }

  body.business-account .activity-trip-card-chevron {
    position: absolute;
    top: 0.85rem;
    right: 0.75rem;
  }

  body.business-account .ja-campaign-top {
    flex-direction: column;
    align-items: stretch;
  }

  body.business-account .ja-campaign-actions,
  body.business-account .ja-campaign-publish,
  body.business-account .ja-inline-actions {
    justify-content: flex-start;
    width: 100%;
  }

  body.business-account .scanners-scan-row {
    grid-template-columns: minmax(0, 1fr);
  }

  body.business-account .scanners-scan-qty,
  body.business-account .scanners-scan-time {
    white-space: normal;
  }

  body.business-account .team-app-access-row {
    flex-direction: column;
    align-items: stretch;
  }

  body.business-account .org-access-member-top {
    flex-direction: column;
    align-items: stretch;
  }

  body.business-account .table-wrap,
  body.business-account .print-queue-card .table-wrap,
  body.business-account .catalogue-import-table-wrap,
  body.business-account .integrations-keys-card .table-wrap {
    overflow-x: hidden;
    max-width: 100%;
  }

  body.business-account .responsive-table,
  body.business-account .catalogue-import-table,
  body.business-account .print-queue-table table {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100%;
  }

  body.business-account .actions-cell,
  body.business-account .action-cell {
    white-space: normal;
  }

  body.business-account .responsive-table td[data-label="Actions"],
  body.business-account .responsive-table td.actions-cell,
  body.business-account .responsive-table td.action-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
  }

  body.business-account .responsive-table td[data-label="Actions"]::before,
  body.business-account .responsive-table td.actions-cell::before,
  body.business-account .responsive-table td.action-cell::before {
    flex: 0 0 100%;
  }

  body.business-account .responsive-table td[data-label="Actions"] .secondary-btn,
  body.business-account .responsive-table td[data-label="Actions"] .primary-btn,
  body.business-account .responsive-table td.actions-cell .secondary-btn,
  body.business-account .responsive-table td.action-cell .secondary-btn {
    width: auto;
    min-width: 0;
    white-space: normal;
  }

  body.business-account .wallet-tx-topline {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

/* Standalone GOEDI is the messenger — hide dashboard chrome from first paint.
   Views live under .business-workspace-body (not .main > .view). Deliveries is
   the default visible view, so it must be hidden here or /apps/gochat/ shows
   the delivery board, nav icons, and topbar instead of chat. */
html[data-standalone-app="gochat"] #portal-top-ribbons,
html[data-standalone-app="gochat"] #standalone-app-banner,
html[data-standalone-app="gochat"] #standalone-app-tabs,
html[data-standalone-app="gochat"] #business-portal-banner,
html[data-standalone-app="gochat"] #portal-sidebar,
html[data-standalone-app="gochat"] #business-mobile-nav,
html[data-standalone-app="gochat"] #business-tab-ask,
html[data-standalone-app="gochat"] #nav-drawer-fab,
html[data-standalone-app="gochat"] #nav-drawer-backdrop,
html[data-standalone-app="gochat"] #nav-drawer-toggle,
html[data-standalone-app="gochat"] #business-app-rail,
html[data-standalone-app="gochat"] #portal-more,
html[data-standalone-app="gochat"] #nav-more-btn,
html[data-standalone-app="gochat"] .personal-portal-banner-tabs,
html[data-standalone-app="gochat"] .banner-shop-tools,
html[data-standalone-app="gochat"] .nav-drawer-toggle,
html[data-standalone-app="gochat"] .topbar,
html[data-standalone-app="gochat"] .personal-mobile-heading,
html[data-standalone-app="gochat"] .business-mobile-heading,
html[data-standalone-app="gochat"] .admin-access-banner,
html[data-standalone-app="gochat"] .business-verification-status-banner,
html[data-standalone-app="gochat"] .test-mode-banner,
html[data-standalone-app="gochat"] .business-workspace-body > .view:not(#gochat-view),
html[data-standalone-app="gochat"] .ad-fullscreen-viewer,
html[data-standalone-app="gochat"] .ad-comments-popup {
  display: none !important;
}

html[data-standalone-app="gochat"] #app:not(.hidden) #gochat-view {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex !important;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100svh;
  height: 100dvh;
  max-height: 100svh;
  max-height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--gc-panel, #fff);
}

/* Ask feedback chrome: /shared/ask-chat.css */

/* —— GOEDI (messenger chrome) —— */
#gochat-view {
  --gc-header: #0b6b63;
  --gc-header-deep: #08554f;
  --gc-accent: #1faa61;
  --gc-mine: #d9fdd3;
  --gc-mine-ink: #111b21;
  --gc-theirs: #ffffff;
  --gc-panel: #ffffff;
  --gc-list-hover: #f0f2f5;
  --gc-list-active: #f0f2f5;
  --gc-meta: #667781;
  --gc-ink: #111b21;
  --gc-wallpaper: #efeae2;
  --gc-compose: #f0f2f5;
  --gc-border: #e9edef;
  --gc-avatar-a: #06a88a;
  --gc-avatar-b: #128c7e;
  position: relative;
  min-height: 0;
  height: 100%;
}

/* Immersive GOEDI shell — identical for business and personal portals.
   Fixed viewport layer so tablet ribbon/bottom-nav specificity wars cannot
   push the floating composer off-screen. */
body.gochat-open {
  --portal-nav-h: 0px;
  --nav-h: 0px;
  --header-h: 0px;
  --business-mobile-nav-h: 0px;
  overflow: hidden;
}

body.gochat-open .main {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

body.gochat-open .app,
body.gochat-open.personal-account .app,
body.gochat-open.business-account .app {
  padding-bottom: 0 !important;
  height: 100svh;
  height: 100dvh;
  max-height: 100svh;
  max-height: 100dvh;
  overflow: hidden;
}

/* Beat tablet personal/business chrome that uses #portal-sidebar / !important. */
body.gochat-open .topbar,
body.gochat-open #portal-top-ribbons,
body.gochat-open .portal-top-ribbons,
body.gochat-open #business-mobile-nav,
body.gochat-open .business-mobile-nav,
body.gochat-open #portal-sidebar,
body.gochat-open .sidebar,
body.gochat-open .nav-primary,
body.gochat-open.personal-account #portal-sidebar,
body.gochat-open.personal-account .sidebar,
body.gochat-open.personal-account .nav-primary,
body.gochat-open.business-account #business-mobile-nav,
body.gochat-open.business-account .business-mobile-nav,
body.gochat-open.business-account .business-mobile-heading,
body.gochat-open .business-portal-banner,
body.gochat-open #business-portal-banner {
  display: none !important;
}

body.gochat-open #gochat-view:not(.hidden) {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100svh;
  height: 100dvh;
  max-height: 100svh;
  max-height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--gc-panel, #fff);
}

body.gochat-open .business-workspace,
body.gochat-open .business-workspace-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.gochat-shell {
  display: grid;
  grid-template-columns: minmax(300px, 38%) minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  background: var(--gc-panel);
  border: 0;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px var(--gc-border);
}

body:not(.gochat-open) .gochat-shell {
  min-height: min(78vh, 820px);
}

.gochat-sidebar,
.gochat-thread-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--gc-panel);
  position: relative;
}

.gochat-sidebar {
  border-right: 1px solid var(--gc-border);
}

.gochat-sidebar-head,
.gochat-thread-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 60px;
  padding: 0.65rem 0.9rem;
  background: linear-gradient(180deg, var(--gc-header) 0%, var(--gc-header-deep) 100%);
  color: #fff;
}

.gochat-sidebar-head {
  justify-content: space-between;
}

.gochat-sidebar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.gochat-icon-btn.is-active {
  background: rgba(255, 255, 255, 0.28);
}

.gochat-inbox,
.gochat-settings {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.gochat-inbox.hidden,
.gochat-settings.hidden {
  display: none !important;
}

.gochat-settings {
  gap: 0;
  padding: 0.65rem 1rem 0;
  overflow: hidden;
  background: #fff;
  font-family: inherit;
}

.gochat-settings-tabs {
  display: flex;
  gap: 0.15rem;
  flex: 0 0 auto;
  margin: 0 0 0.85rem;
  border-bottom: 1px solid var(--gc-border);
}

.gochat-settings-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--gc-meta);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.55rem 0.7rem 0.65rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
}

.gochat-settings-tab:hover {
  color: var(--gc-ink);
}

.gochat-settings-tab.is-active,
.gochat-settings-tab[aria-selected='true'] {
  color: var(--gc-header);
  border-bottom-color: var(--gc-header);
  background: transparent;
  box-shadow: none;
}

.gochat-settings-panel {
  display: grid;
  gap: 0.75rem;
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding-bottom: max(1.5rem, calc(1rem + env(safe-area-inset-bottom, 0px)));
  align-content: start;
}

.gochat-settings-panel.hidden,
.gochat-settings-panel[hidden] {
  display: none !important;
}

.gochat-settings-lead,
.gochat-settings-hint,
.gochat-settings-status {
  margin: 0;
  color: var(--gc-meta);
  font-size: 0.84rem;
  line-height: 1.45;
  font-family: inherit;
}

.gochat-settings-status {
  color: var(--gc-ink);
}

.gochat-settings-card {
  display: grid;
  gap: 0.85rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--gc-border);
  border-radius: 12px;
  background: #fff;
}

.gochat-settings-field {
  display: grid;
  gap: 0.3rem;
}

.gochat-settings-label {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--gc-meta);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: inherit;
}

.gochat-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.gochat-settings-link-row,
.gochat-dashboard-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.85rem;
  align-items: center;
  margin-top: 0.15rem;
}

a.gochat-settings-action {
  display: inline-flex;
  text-decoration: none;
  align-items: center;
}

.gochat-settings-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--gc-header);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.15rem 0;
  margin: 0;
  cursor: pointer;
  white-space: nowrap;
}

.gochat-settings-action:hover,
.gochat-settings-action:focus-visible {
  color: var(--gc-header-deep);
  text-decoration: underline;
  outline: none;
}

.gochat-settings-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: none;
}

.gochat-settings-action--muted {
  color: var(--gc-meta);
}

.gochat-settings-action--muted:hover,
.gochat-settings-action--muted:focus-visible {
  color: var(--gc-ink);
}

.gochat-settings-action--danger {
  color: #b42318;
}

.gochat-settings-action--danger:hover,
.gochat-settings-action--danger:focus-visible {
  color: #912018;
}

.gochat-group-danger {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--gc-border);
}

.gochat-files-toolbar {
  display: grid;
  gap: 0.55rem;
}

.gochat-files-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.85rem;
  align-items: center;
}

.gochat-files-filter {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--gc-meta);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.1rem 0;
  border-radius: 0;
  cursor: pointer;
}

.gochat-files-filter:hover {
  color: var(--gc-ink);
}

.gochat-files-filter.is-active,
.gochat-files-filter[aria-pressed='true'] {
  color: var(--gc-header);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.gochat-files-list {
  min-height: 0;
  padding-bottom: 0.35rem;
}

.gochat-files-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  border: 1px solid var(--gc-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.gochat-files-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  background: #fff;
  border-radius: 0;
}

.gochat-files-item + .gochat-files-item {
  border-top: 1px solid var(--gc-border);
}

.gochat-files-item-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  display: inline-grid;
  place-items: center;
  background: var(--gc-compose);
  color: var(--gc-meta);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-family: inherit;
}

.gochat-files-item-body {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.gochat-files-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gc-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: inherit;
}

.gochat-files-item-sub {
  font-size: 0.76rem;
  color: var(--gc-meta);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: inherit;
}

.gochat-files-item-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.gochat-files-open,
.gochat-files-delete {
  white-space: nowrap;
}

.gochat-settings-row code {
  display: block;
  min-width: 0;
  padding: 0.45rem 0;
  border-radius: 0;
  background: transparent;
  color: var(--gc-ink);
  font-size: 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gochat-settings-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.gochat-settings-avatar-copy {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.gochat-settings-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.85rem;
  align-items: center;
  margin-top: 0.15rem;
}

.gochat-brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.gochat-close-btn {
  flex-shrink: 0;
}

.gochat-brand-mark {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
}

.gochat-brand-mark svg,
.gochat-icon-btn svg,
.gochat-send-btn svg,
.gochat-empty-icon svg,
.gochat-placeholder-mark svg {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}

.gochat-sidebar-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.gochat-icon-btn {
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

/* Author display rules override the UA [hidden] stylesheet — keep icon buttons hideable. */
.gochat-icon-btn[hidden],
.gochat-icon-btn.hidden {
  display: none !important;
}

.gochat-icon-btn:hover,
.gochat-icon-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

.gochat-search-wrap {
  padding: 0.55rem 0.75rem;
  background: var(--gc-panel);
  border-bottom: 1px solid var(--gc-border);
}

.gochat-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--gc-compose);
  color: var(--gc-meta);
}

.gochat-search svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}

.gochat-search input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0.25rem 0;
  font: inherit;
  color: var(--gc-ink);
  outline: none;
}

.gochat-directory,
.gochat-thread-list {
  display: flex;
  flex-direction: column;
  overflow: auto;
  min-height: 0;
}

.gochat-directory {
  max-height: 240px;
  border-bottom: 1px solid var(--gc-border);
  background: #fafbfc;
}

.gochat-empty {
  margin: auto 0 0;
  padding: 1.5rem 1.2rem 2rem;
  text-align: center;
  color: var(--gc-meta);
}

.gochat-empty.hidden {
  display: none;
}

.gochat-empty strong {
  display: block;
  color: var(--gc-ink);
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}

.gochat-empty p {
  margin: 0;
  line-height: 1.45;
  font-size: 0.9rem;
}

.gochat-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 0.85rem;
  row-gap: 0.15rem;
  align-items: center;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--gc-border);
  border-radius: 0;
  background: transparent;
  text-align: left;
  padding: 0.8rem 0.95rem;
  cursor: pointer;
  font: inherit;
  color: var(--gc-ink);
}

.gochat-row:hover,
.gochat-row:focus-visible {
  background: var(--gc-list-hover);
  outline: none;
}

.gochat-row.is-active {
  background: var(--gc-list-active);
}

.gochat-avatar {
  grid-row: 1 / span 2;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, var(--gc-avatar-a), var(--gc-avatar-b));
  flex: 0 0 auto;
  user-select: none;
  overflow: hidden;
}

.gochat-avatar--business {
  background: linear-gradient(145deg, #2a9d8f, #1b6f66);
}

.gochat-avatar--individual {
  background: linear-gradient(145deg, #3d8bfd, #2563c9);
}

.gochat-avatar--group {
  background: linear-gradient(145deg, #0f766e, #115e59);
}

.gochat-avatar--photo {
  background: #dfe5e8;
  color: transparent;
}

.gochat-settings-panel .gochat-group-composer {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0.95rem 1rem;
}

.gochat-group-composer input[type='text'],
.gochat-group-composer input[type='search'],
.gochat-group-composer select,
.gochat-group-panel select {
  width: 100%;
  border: 1px solid var(--gc-border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--gc-ink);
  background: #fff;
}

.gochat-group-composer-members {
  display: grid;
  gap: 0.45rem;
}

.gochat-group-contact-search {
  margin: 0;
}

.gochat-group-contact-list {
  display: grid;
  gap: 0.35rem;
  max-height: 14rem;
  overflow: auto;
  padding: 0.15rem 0;
}

.gochat-group-contact-list .gochat-row {
  width: 100%;
  text-align: left;
}

.gochat-group-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 1.6rem;
}

.gochat-group-chip {
  appearance: none;
  border: 1px solid var(--gc-border);
  background: var(--gc-compose);
  color: var(--gc-ink);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.gochat-group-panel {
  flex: 0 0 auto;
  max-height: 42%;
  overflow: auto;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gc-border);
  background: #fff;
  display: grid;
  gap: 0.75rem;
}

.gochat-group-panel.hidden,
.gochat-group-panel[hidden] {
  display: none !important;
}

.gochat-group-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.gochat-group-member-list {
  display: grid;
  gap: 0.55rem;
}

.gochat-group-member-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.gochat-group-member-copy {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.gochat-group-member-copy strong {
  font-size: 0.9rem;
  color: var(--gc-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gochat-group-member-copy small {
  color: var(--gc-meta);
  font-size: 0.74rem;
}

.gochat-group-member-row .gochat-avatar {
  width: 2.2rem;
  height: 2.2rem;
  font-size: 0.78rem;
}

.gochat-readonly-banner {
  margin: 0;
  padding: 0.65rem 1rem;
  text-align: center;
  color: var(--gc-meta);
  font-size: 0.84rem;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid var(--gc-border);
}

.gochat-readonly-banner.hidden,
.gochat-readonly-banner[hidden] {
  display: none !important;
}

.gochat-storage-card {
  gap: 0.75rem;
}

.gochat-storage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.gochat-storage-head strong {
  font-size: 0.95rem;
  color: var(--gc-ink);
}

.gochat-storage-meter {
  height: 0.55rem;
  border-radius: 999px;
  background: var(--gc-compose);
  overflow: hidden;
}

.gochat-storage-meter-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gc-header), var(--gc-accent, #25d366));
  transition: width 0.25s ease;
}

.gochat-storage-meter.is-high .gochat-storage-meter-fill {
  background: linear-gradient(90deg, #c2410c, #ea580c);
}

.gochat-storage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.gochat-encryption-banner {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(194, 65, 12, 0.25);
  background: rgba(254, 243, 199, 0.7);
  color: #9a3412;
  font-size: 0.84rem;
  line-height: 1.45;
}

.gochat-encryption-banner.hidden,
.gochat-encryption-banner[hidden] {
  display: none !important;
}

.gochat-decrypt-banner {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  text-align: center;
  color: #9a3412;
  font-size: 0.84rem;
  line-height: 1.4;
  background: rgba(254, 243, 199, 0.92);
  border-bottom: 1px solid rgba(194, 65, 12, 0.2);
}

.gochat-decrypt-banner.hidden,
.gochat-decrypt-banner[hidden] {
  display: none !important;
}

.gochat-unlock-copy {
  margin: 0 0 0.65rem;
}

.gochat-unlock-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  align-items: center;
}

.gochat-unlock-password {
  min-width: min(100%, 14rem);
  flex: 1 1 12rem;
  max-width: 18rem;
  border: 1px solid rgba(194, 65, 12, 0.35);
  border-radius: 0.55rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: #431407;
  background: #fffbeb;
}

.gochat-unlock-btn {
  border: 0;
  border-radius: 0.55rem;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-weight: 600;
  color: #fff7ed;
  background: #c2410c;
  cursor: pointer;
}

.gochat-unlock-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.gochat-unlock-btn--muted {
  color: #9a3412;
  background: rgba(255, 247, 237, 0.9);
  border: 1px solid rgba(194, 65, 12, 0.28);
}

.gochat-unlock-status {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: #7c2d12;
}

.gochat-unlock-status.is-error {
  color: #b91c1c;
}

.gochat-unlock-status.hidden,
.gochat-unlock-status[hidden] {
  display: none !important;
}

.gochat-row.is-group .gochat-row-title,
.gochat-row.is-self .gochat-row-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
}

.gochat-row-group-tag {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.12);
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
}

.gochat-row-self-tag {
  color: #1d4ed8;
  background: rgba(29, 78, 216, 0.12);
}

.gochat-row-kind {
  display: block;
  color: var(--gc-header);
  font-size: 0.72rem;
  font-weight: 650;
  margin-bottom: 0.08rem;
}

.gochat-bubble-sender {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gc-header);
  margin: 0 0 0.15rem;
}

.gochat-avatar--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.gochat-row-title {
  grid-column: 2;
  font-weight: 600;
  font-size: 1.02rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gochat-row-time {
  grid-column: 3;
  grid-row: 1;
  color: var(--gc-meta);
  font-size: 0.75rem;
  white-space: nowrap;
}

.gochat-row.is-unread .gochat-row-time {
  color: var(--gc-accent);
  font-weight: 650;
}

.gochat-row-preview {
  grid-column: 2;
  color: var(--gc-meta);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gochat-row.is-unread .gochat-row-preview {
  color: var(--gc-ink);
  font-weight: 550;
}

.gochat-row-badge {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--gc-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.35rem;
}

.gochat-thread-head .gochat-avatar {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 0.9rem;
}

.gochat-thread-peer {
  min-width: 0;
  flex: 1;
}

.gochat-thread-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
  flex-shrink: 0;
}

.gochat-delete-thread-btn {
  color: #b42318;
}

.gochat-thread-peer strong,
.gochat-thread-peer small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gochat-thread-peer strong {
  font-size: 1.02rem;
  font-weight: 650;
}

.gochat-thread-peer small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
}

.gochat-messages {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  padding: 1rem 1.15rem 6.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background-color: var(--gc-wallpaper);
  background-image:
    radial-gradient(rgba(17, 27, 33, 0.045) 0.7px, transparent 0.7px),
    linear-gradient(180deg, rgba(239, 234, 226, 0.95), rgba(233, 225, 212, 0.98));
  background-size: 18px 18px, auto;
}

.gochat-day-chip {
  align-self: center;
  margin: 0.55rem 0;
  padding: 0.28rem 0.7rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--gc-meta);
  font-size: 0.74rem;
  font-weight: 600;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.06);
}

.gochat-call-event {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.45rem 0;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--gc-ink);
  font-size: 0.8rem;
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(11, 20, 26, 0.08);
  max-width: min(92%, 26rem);
}

.gochat-call-event time {
  color: var(--gc-meta);
  font-size: 0.72rem;
  font-weight: 600;
}

.gochat-msg-delete {
  margin-left: 0.25rem;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.55;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.05rem 0.2rem;
}

.gochat-msg-delete:hover,
.gochat-msg-delete:focus-visible {
  opacity: 1;
  outline: none;
  text-decoration: underline;
}

.gochat-call-event-icon {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: rgba(11, 107, 99, 0.14);
  position: relative;
  flex: 0 0 auto;
}

.gochat-call-event-icon::before {
  content: '';
  position: absolute;
  inset: 0.22rem;
  border-radius: 2px;
  background: var(--gc-header);
}

.gochat-call-event--video .gochat-call-event-icon::before {
  border-radius: 2px;
  clip-path: polygon(0 20%, 62% 20%, 62% 0, 100% 50%, 62% 100%, 62% 80%, 0 80%);
}

.gochat-call-event--audio .gochat-call-event-icon::before {
  clip-path: polygon(25% 10%, 75% 10%, 75% 55%, 100% 75%, 0 75%, 25% 55%);
  border-radius: 0;
}

.gochat-call-event--missed,
.gochat-call-event--rejected,
.gochat-call-event--cancelled {
  color: #b42318;
}

.gochat-call-event--missed .gochat-call-event-icon,
.gochat-call-event--rejected .gochat-call-event-icon,
.gochat-call-event--cancelled .gochat-call-event-icon {
  background: rgba(180, 35, 24, 0.12);
}

.gochat-call-event--missed .gochat-call-event-icon::before,
.gochat-call-event--rejected .gochat-call-event-icon::before,
.gochat-call-event--cancelled .gochat-call-event-icon::before {
  background: #b42318;
}

.gochat-call-event-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gochat-bubble {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: fit-content;
  max-width: min(85%, 34rem);
  padding: 0.38rem 0.55rem 0.32rem 0.65rem;
  border-radius: 8px;
  /* Fixed px so rem/root changes during layout swaps do not resize mid-chat. */
  font-size: 15px;
  line-height: 1.35;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.08);
  margin-top: 0.2rem;
  contain: layout paint;
}

.gochat-bubble-body {
  white-space: pre-wrap;
  /* Never split ordinary words across lines; only break if one token is wider than the bubble. */
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
}

.gochat-bubble-body--error {
  color: #9f1239;
  font-style: italic;
}

.gochat-bubble-body--pending {
  color: #64748b;
  font-style: italic;
}

.gochat-bubble-meta {
  align-self: flex-end;
  margin: 0.2rem 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 11px;
  color: var(--gc-meta);
  line-height: 1;
  position: static;
  float: none;
}

.gochat-ticks {
  display: inline-flex;
  align-items: center;
  margin-left: 0.1rem;
  color: inherit;
  opacity: 0.85;
}

.gochat-ticks svg {
  width: 15px;
  height: 11px;
  display: block;
}

.gochat-ticks--delivered {
  opacity: 1;
}

.gochat-bubble--mine {
  align-self: flex-end;
  background: var(--gc-mine);
  color: var(--gc-mine-ink);
  border-top-right-radius: 2px;
}

.gochat-bubble--theirs {
  align-self: flex-start;
  background: var(--gc-theirs);
  color: var(--gc-ink);
  border-top-left-radius: 2px;
}

.gochat-compose {
  position: absolute;
  left: max(0.7rem, env(safe-area-inset-left, 0px));
  /* Keep the send control clear of the thread scrollbar gutter. */
  right: max(1.35rem, calc(0.7rem + 14px), env(safe-area-inset-right, 0px));
  bottom: max(0.7rem, env(safe-area-inset-bottom, 0px));
  z-index: 4;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  /* Keep the floating composer inside the thread pane on short landscape viewports. */
  max-width: calc(100% - 1.4rem);
  box-sizing: border-box;
}

.gochat-pending-files {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 1px 2px rgba(11, 20, 26, 0.12),
    0 8px 18px rgba(11, 20, 26, 0.08);
  color: var(--gc-ink);
}

.gochat-pending-files[hidden],
.gochat-pending-files.hidden {
  display: none !important;
}

.gochat-pending-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.gochat-pending-clear,
.gochat-pending-remove {
  border: 0;
  background: transparent;
  color: var(--gc-header);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.1rem 0.2rem;
}

.gochat-pending-files-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  max-height: 8.5rem;
  overflow: auto;
}

.gochat-pending-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.35rem 0.45rem;
  border-radius: 0.65rem;
  background: rgba(17, 27, 33, 0.04);
}

.gochat-pending-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}

.gochat-pending-file-meta {
  font-size: 0.72rem;
  color: var(--gc-meta);
  white-space: nowrap;
}

.gochat-pending-remove {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--gc-meta);
}

.gochat-pending-remove:hover,
.gochat-pending-remove:focus-visible {
  background: rgba(17, 27, 33, 0.08);
  color: var(--gc-ink);
  outline: none;
}

.gochat-compose.has-pending-files {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.gochat-compose.has-pending-files .gochat-mic-btn[hidden],
.gochat-compose.has-pending-files .gochat-cam-btn[hidden] {
  display: none !important;
}

.gochat-compose.is-recording {
  grid-template-columns: minmax(0, 1fr);
}

.gochat-compose-field {
  min-width: 0;
}

.gochat-compose input[type='text'] {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.78rem 1rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.94);
  color: var(--gc-ink);
  outline: none;
  box-shadow:
    0 1px 2px rgba(11, 20, 26, 0.12),
    0 8px 18px rgba(11, 20, 26, 0.08);
}

.gochat-compose-btn,
.gochat-send-btn {
  width: 2.85rem;
  height: 2.85rem;
  border: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.gochat-compose-btn {
  background: rgba(255, 255, 255, 0.94);
  color: var(--gc-header);
  box-shadow:
    0 1px 2px rgba(11, 20, 26, 0.12),
    0 8px 18px rgba(11, 20, 26, 0.08);
}

.gochat-compose-btn:hover,
.gochat-compose-btn:focus-visible {
  background: #fff;
  outline: none;
}

.gochat-compose-btn svg,
.gochat-send-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.gochat-mic-btn.is-recording,
.gochat-mic-btn[aria-pressed='true'],
.gochat-cam-btn.is-recording,
.gochat-cam-btn[aria-pressed='true'] {
  background: #dc2626;
  color: #fff;
}

.gochat-send-btn {
  background: var(--gc-header);
  color: #fff;
  box-shadow:
    0 1px 2px rgba(11, 20, 26, 0.16),
    0 8px 18px rgba(11, 20, 26, 0.12);
}

.gochat-send-btn:hover,
.gochat-send-btn:focus-visible {
  background: var(--gc-header-deep);
  outline: none;
}

.gochat-send-btn svg {
  margin-left: 0.1rem;
}

.gochat-compose.is-recording > .gochat-compose-btn,
.gochat-compose.is-recording > .gochat-compose-field,
.gochat-compose.is-recording > .gochat-send-btn,
.gochat-compose.is-recording > #gochat-file-input {
  display: none !important;
}

.gochat-video-record-stage {
  position: absolute;
  /* Sit under the thread header so the peer name / back control stay usable. */
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: #0b141a;
  /* Leave room for the floating recording controls at the bottom. */
  padding:
    0.75rem
    max(0.75rem, env(safe-area-inset-right, 0px))
    calc(5.8rem + env(safe-area-inset-bottom, 0px))
    max(0.75rem, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

.gochat-video-record-stage.hidden,
.gochat-video-record-stage[hidden] {
  display: none !important;
}

.gochat-thread-pane.is-video-recording .gochat-thread-head {
  position: relative;
  z-index: 4;
}

.gochat-thread-pane.is-video-recording .gochat-messages,
.gochat-thread-pane.is-video-recording .gochat-readonly-banner,
.gochat-thread-pane.is-video-recording .gochat-decrypt-banner,
.gochat-thread-pane.is-video-recording .gochat-group-panel {
  visibility: hidden;
  pointer-events: none;
}

.gochat-recording-preview {
  width: 100%;
  height: 100%;
  max-width: min(100%, 42rem);
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 1.1rem;
  background: #000;
  transform: scaleX(-1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.gochat-compose.is-video-recording {
  z-index: 5;
}

.gochat-compose.is-video-recording .gochat-recording-bar {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  background: rgba(17, 27, 33, 0.88);
  color: #fff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.28);
}

.gochat-compose.is-video-recording .gochat-recording-state {
  color: rgba(255, 255, 255, 0.72);
}

.gochat-compose.is-video-recording .gochat-recording-bar.is-paused .gochat-recording-state {
  color: #fdba74;
}

.gochat-compose.is-video-recording .gochat-recording-cancel {
  color: #fda4af;
}

.gochat-compose.is-video-recording .gochat-recording-pause {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.gochat-compose.is-video-recording .gochat-recording-pause.is-paused,
.gochat-compose.is-video-recording .gochat-recording-pause[aria-pressed='true'] {
  background: rgba(253, 186, 116, 0.22);
  color: #fdba74;
}

.gochat-recording-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 0.45rem;
  min-width: 0;
  min-height: 2.85rem;
  padding: 0.2rem 0.25rem 0.2rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--gc-ink);
  box-shadow:
    0 1px 2px rgba(11, 20, 26, 0.12),
    0 8px 18px rgba(11, 20, 26, 0.08);
}

.gochat-recording-bar.hidden {
  display: none !important;
}

.gochat-recording-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  justify-self: center;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}

.gochat-recording-state {
  color: var(--gc-meta);
  font-size: 0.82rem;
  font-weight: 600;
}

.gochat-recording-bar.is-paused .gochat-recording-state {
  color: #c2410c;
}

.gochat-recording-time {
  min-width: 3.2rem;
  font-size: 0.95rem;
}

.gochat-recording-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #dc2626;
  animation: gochat-rec-pulse 1s ease-in-out infinite;
  flex-shrink: 0;
}

.gochat-recording-bar.is-paused .gochat-recording-dot {
  animation: none;
  background: #c2410c;
  opacity: 0.7;
}

.gochat-recording-cancel {
  border: 0;
  background: transparent;
  color: #dc2626;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.15rem;
  flex-shrink: 0;
}

.gochat-recording-bar .gochat-recording-pause,
.gochat-recording-bar .gochat-recording-send {
  width: 2.55rem;
  height: 2.55rem;
  flex-shrink: 0;
}

.gochat-recording-pause-icons {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
}

.gochat-recording-pause-icons svg {
  grid-area: 1 / 1;
  width: 1.25rem;
  height: 1.25rem;
}

/* Recording: show pause bars. Paused: swap to play/resume triangle. */
.gochat-recording-pause .gochat-recording-pause-icon {
  display: block;
  opacity: 1;
}

.gochat-recording-pause .gochat-recording-resume-icon {
  display: none;
  opacity: 0;
}

.gochat-recording-pause.is-paused .gochat-recording-pause-icon,
.gochat-recording-pause[aria-pressed='true'] .gochat-recording-pause-icon {
  display: none;
  opacity: 0;
}

.gochat-recording-pause.is-paused .gochat-recording-resume-icon,
.gochat-recording-pause[aria-pressed='true'] .gochat-recording-resume-icon {
  display: block;
  opacity: 1;
}

.gochat-recording-pause.is-paused,
.gochat-recording-pause[aria-pressed='true'] {
  background: #fff7ed;
  color: #c2410c;
}

.gochat-voice-note {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: min(72vw, 16rem);
  max-width: 100%;
  padding: 0.35rem 0.45rem 0.3rem 0.4rem;
}

.gochat-voice-glyph {
  width: 2.2rem;
  height: 2.2rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(11, 107, 99, 0.12);
  color: var(--gc-header);
  position: relative;
}

.gochat-bubble--mine .gochat-voice-glyph {
  background: rgba(17, 27, 33, 0.1);
  color: var(--gc-mine-ink);
}

.gochat-voice-glyph::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.7rem;
  height: 1.05rem;
  border: 2px solid currentColor;
  border-bottom-left-radius: 0.55rem;
  border-bottom-right-radius: 0.55rem;
  border-top-left-radius: 0.35rem;
  border-top-right-radius: 0.35rem;
  box-sizing: border-box;
}

.gochat-voice-glyph::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0.38rem;
  width: 0.7rem;
  height: 0.35rem;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 0.45rem 0.45rem;
  transform: translateX(-50%);
  box-sizing: border-box;
}

.gochat-voice-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1 auto;
}

.gochat-voice-label {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--gc-meta);
  letter-spacing: 0.01em;
}

.gochat-media-audio {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 2rem;
  margin: 0;
}

.gochat-bubble--media {
  /* Wider than text bubbles so attachments are not cropped by the bubble box. */
  max-width: min(92%, 22rem);
  min-width: 0;
  padding: 0.3rem;
  overflow: visible;
}

.gochat-bubble--media .gochat-bubble-meta {
  margin: 0.15rem 0.35rem 0.15rem auto;
}

.gochat-media-link {
  display: block;
  max-width: 100%;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.gochat-media-frame {
  position: relative;
  display: block;
  min-width: 10rem;
  min-height: 8rem;
  max-width: 100%;
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(17, 27, 33, 0.05) 20%, rgba(17, 27, 33, 0.1) 40%, rgba(17, 27, 33, 0.05) 60%);
  background-size: 200% 100%;
  animation: gochat-media-shimmer 1.1s linear infinite;
}

.gochat-media-frame.is-loaded {
  min-height: 0;
  animation: none;
  background: rgba(0, 0, 0, 0.04);
}

.gochat-media-frame.is-error {
  animation: none;
  background: rgba(220, 38, 38, 0.08);
}

.gochat-media-image,
.gochat-media-video {
  display: block;
  /* Bound to the bubble, not the viewport — viewport units were wider than the
     conversation pane and overflow:hidden clipped the sides of uploads. */
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(50vh, 22rem);
  object-fit: contain;
  object-position: center;
  border-radius: 6px;
  background: transparent;
}

.gochat-media-image {
  opacity: 0;
  transition: opacity 140ms ease;
}

.gochat-media-image.is-loaded {
  opacity: 1;
}

.gochat-media-video {
  background: #0b141a;
}

.gochat-file-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  box-sizing: border-box;
  width: 100%;
  min-width: min(72vw, 15rem);
  max-width: 100%;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  background: rgba(17, 27, 33, 0.04);
  color: inherit;
  text-decoration: none;
}

.gochat-bubble--mine .gochat-file-card {
  background: rgba(17, 27, 33, 0.07);
}

.gochat-file-card:hover,
.gochat-file-card:focus-visible {
  background: rgba(17, 27, 33, 0.08);
  outline: none;
}

.gochat-file-card-icon {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.7rem;
  background: linear-gradient(160deg, #0b6b63 0%, #08554f 100%);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.gochat-file-card-icon[data-ext='PDF'] {
  background: linear-gradient(160deg, #dc2626 0%, #b91c1c 100%);
}

.gochat-file-card-icon[data-ext='DOC'],
.gochat-file-card-icon[data-ext='DOCX'] {
  background: linear-gradient(160deg, #2563eb 0%, #1d4ed8 100%);
}

.gochat-file-card-icon[data-ext='XLS'],
.gochat-file-card-icon[data-ext='XLSX'] {
  background: linear-gradient(160deg, #059669 0%, #047857 100%);
}

.gochat-file-card-icon[data-ext='PPT'],
.gochat-file-card-icon[data-ext='PPTX'] {
  background: linear-gradient(160deg, #ea580c 0%, #c2410c 100%);
}

.gochat-file-card-ext {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.gochat-file-card-meta {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.gochat-file-card-name {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gochat-file-card-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gc-meta);
}

.gochat-file-card-action {
  flex-shrink: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(11, 107, 99, 0.12);
  color: var(--gc-header);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.gochat-bubble--mine .gochat-file-card-action {
  background: rgba(17, 27, 33, 0.1);
  color: var(--gc-mine-ink);
}

.gochat-caption {
  margin: 0.35rem 0.35rem 0;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: break-word;
}

.gochat-thread-pane:not(:has(.gochat-thread-head:not([hidden]))) .gochat-messages {
  background:
    radial-gradient(circle at 20% 20%, rgba(31, 170, 97, 0.05), transparent 42%),
    radial-gradient(circle at 80% 70%, rgba(11, 107, 99, 0.06), transparent 45%),
    var(--gc-wallpaper);
}

.gochat-thread-head[hidden],
.gochat-compose[hidden] {
  display: none !important;
}

.gochat-call-overlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  /* Leave the floating composer clickable for in-call text/files. */
  padding: 1rem 1rem calc(5.8rem + env(safe-area-inset-bottom, 0px));
  background: rgba(7, 18, 22, 0.72);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.gochat-call-overlay.hidden,
.gochat-call-overlay[hidden] {
  display: none !important;
}

.gochat-call-overlay.is-open .gochat-call-stage {
  pointer-events: auto;
}

/* Keep compose above the dimmed call backdrop while a call is open. */
body.gochat-call-active .gochat-compose:not([hidden]) {
  z-index: 95;
}

.gochat-call-stage {
  position: relative;
  width: min(100%, 420px);
  min-height: 320px;
  max-height: min(70vh, 560px);
  border-radius: 22px;
  overflow: hidden;
  background: #0b141a;
  color: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-rows: 1fr auto auto;
}

.gochat-call-remote,
.gochat-call-local {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111b21;
}

.gochat-call-remote {
  grid-row: 1;
  min-height: 240px;
}

/* Hide video tiles for voice calls without display:none — Chrome can mute
   MediaStreams attached to display:none media elements. */
.gochat-call-overlay.is-audio .gochat-call-remote,
.gochat-call-overlay.is-audio .gochat-call-local {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  min-height: 0;
}

/* Keep remote audio audible off-screen. Avoid clip-path/opacity:0 tricks that
   can interfere with playout used as the AEC reference on some mobile browsers. */
.gochat-call-remote-audio {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 8px;
  height: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 1;
  pointer-events: none;
}

.gochat-call-local {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 28%;
  min-width: 88px;
  height: auto;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  z-index: 2;
  transform: scaleX(-1);
  background: #111b21;
}

/* Full-bleed self-view until the remote party publishes a camera track. */
.gochat-call-overlay.is-local-preview .gochat-call-local {
  inset: 0;
  top: 0;
  right: 0;
  width: 100%;
  min-width: 0;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  z-index: 1;
}

.gochat-call-overlay.is-local-preview .gochat-call-remote {
  opacity: 0;
}

.gochat-call-copy {
  position: relative;
  z-index: 4;
  grid-row: 2;
  padding: 1rem 1.1rem 0.35rem;
  text-align: center;
  background: linear-gradient(to top, rgba(7, 18, 22, 0.72), rgba(7, 18, 22, 0.08));
}

.gochat-call-copy strong,
.gochat-call-copy small {
  display: block;
}

.gochat-call-copy strong {
  font-size: 1.15rem;
  font-weight: 700;
}

.gochat-call-copy small {
  margin-top: 0.25rem;
  color: rgba(255, 255, 255, 0.75);
}

.gochat-call-actions {
  position: relative;
  z-index: 4;
  grid-row: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem 1.15rem;
  background: rgba(7, 18, 22, 0.78);
}

.gochat-call-btn {
  min-width: 4.8rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.gochat-call-btn.is-active {
  background: rgba(255, 255, 255, 0.28);
}

.gochat-call-btn#gochat-call-speaker-btn.is-active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.gochat-call-btn--accept {
  background: #1faa61;
}

.gochat-call-btn--reject,
.gochat-call-btn--hangup {
  background: #dc2626;
}

.gochat-call-btn[hidden],
.gochat-call-btn.hidden {
  display: none !important;
}

.gochat-icon-btn.hidden,
.gochat-icon-btn[hidden] {
  display: none !important;
}

.gochat-back-btn {
  display: none;
}

/* Phones + tablets: single-pane messenger (inbox OR conversation). */
@media (max-width: 1024px) {
  .gochat-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    height: 100%;
  }

  body.gochat-thread-open .gochat-sidebar {
    display: none;
  }

  body:not(.gochat-thread-open) .gochat-thread-pane {
    display: none;
  }

  .gochat-back-btn {
    display: inline-grid;
  }

  body.gochat-open #gochat-view:not(.hidden) {
    height: 100svh;
    height: 100dvh;
    max-height: 100svh;
    max-height: 100dvh;
  }

  body.gochat-open .gochat-shell,
  body.gochat-thread-open .gochat-shell {
    min-height: 0;
    height: 100%;
    max-height: 100%;
  }

  body.gochat-open .gochat-thread-pane {
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  body.gochat-open .gochat-compose {
    left: max(0.55rem, env(safe-area-inset-left, 0px));
    right: max(1.2rem, calc(0.55rem + 14px), env(safe-area-inset-right, 0px));
    bottom: max(0.55rem, env(safe-area-inset-bottom, 0px));
  }
}

/* Short landscape tablets: keep composer clearly in the visual viewport. */
@media (max-width: 1024px) and (orientation: landscape) and (max-height: 560px) {
  body.gochat-open .gochat-messages {
    padding-bottom: 5.75rem;
  }

  body.gochat-open .gochat-compose {
    left: max(0.45rem, env(safe-area-inset-left, 0px));
    right: max(1.1rem, calc(0.45rem + 14px), env(safe-area-inset-right, 0px));
    bottom: max(0.35rem, env(safe-area-inset-bottom, 0px));
  }

  body.gochat-open .gochat-compose-btn,
  body.gochat-open .gochat-send-btn {
    width: 2.55rem;
    height: 2.55rem;
  }

  body.gochat-open .gochat-compose input[type='text'] {
    padding: 0.65rem 0.9rem;
  }
}

body.gochat-open .business-tab-ask,
body.portal-app.standalone-app[data-standalone-app="gochat"] #business-tab-ask {
  display: none !important;
}
