:root {
  --bg: #062318;
  --bg-soft: #0f3828;
  --panel: #ffffff;
  --panel-soft: #f5faf7;
  --ink: #142026;
  --muted: #6a7a83;
  --line: rgba(20, 32, 38, 0.1);
  --brand: #00a850;
  --brand-dark: #06743c;
  --brand-deep: #064f2c;
  --brand-light: #e9fff4;
  --gold: #ffc12d;
  --gold-soft: #fff4cc;
  --visitor: #ffffff;
  --admin: #dcf8c6;
  --danger: #e5484d;
  --nav-ink: #f8fff9;
  --nav-muted: rgba(248, 255, 249, 0.62);
  --nav-line: rgba(255, 255, 255, 0.12);
  --nav-glass: rgba(255, 255, 255, 0.075);
  --nav-glass-strong: rgba(255, 255, 255, 0.12);
  --nav-active: linear-gradient(135deg, rgba(0, 168, 80, 0.28), rgba(255, 193, 45, 0.14));
  --nav-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  --surface: #ffffff;
  --surface-soft: #f8fcfa;
  --surface-green: #f0fff7;
  --surface-gold: #fff8df;
  --shadow-soft: 0 10px 24px rgba(20, 32, 38, 0.06);
  --shadow-card: 0 16px 38px rgba(20, 32, 38, 0.09);
  --shadow-hover: 0 18px 42px rgba(0, 168, 80, 0.13);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --focus-ring: 0 0 0 4px rgba(0, 168, 80, 0.16);
  --motion-fast: 160ms ease;
  --motion-base: 220ms ease;
  --wallpaper: url("assets/whachat-admin-wallpaper.jfif");
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Restored Admin R3: authentication and onboarding gateway */
html.admin-auth-route-boot .shell-loader {
  display: grid;
}

body:has(.auth-screen:not(.hidden)) {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--wc-page-bg);
}

.app-shell:has(.auth-screen:not(.hidden)) {
  display: grid;
  min-width: 0;
  min-height: 100dvh;
  padding: 0;
  overflow-x: hidden;
  background: var(--wc-page-bg);
}

.auth-screen {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  max-width: 100vw;
  min-height: 100dvh;
  padding: 16px;
  overflow-x: hidden;
  background: var(--wc-page-bg);
  color: var(--wc-text);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(500px, 0.92fr);
  align-self: center;
  width: min(1220px, 100%);
  height: min(760px, calc(100dvh - 62px));
  min-height: 620px;
  margin: 0 auto;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius-lg);
  overflow: hidden;
  background: var(--wc-surface);
  box-shadow: var(--wc-shadow-lg);
}

.auth-story {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 28px;
  min-width: 0;
  min-height: 0;
  padding: 32px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: #0b1713;
  color: #f6faf8;
  box-shadow: none;
}

.auth-story::before {
  display: none;
}

.auth-story-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.auth-story-logo {
  display: block;
  width: 154px;
  height: 48px;
  max-height: none;
  object-fit: contain;
  object-position: left center;
}

.auth-link-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
}

.auth-link-row a {
  min-height: 32px;
  padding: 6px 2px;
  color: #bdc9c4;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-link-row a:hover,
.auth-link-row a:focus-visible {
  color: #ffd76e;
}

.auth-story-main {
  display: grid;
  align-content: center;
  gap: 14px;
  min-width: 0;
}

.auth-version-pill {
  width: max-content;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(255, 215, 110, 0.32);
  border-radius: var(--wc-radius-sm);
  background: rgba(255, 215, 110, 0.1);
  color: #ffd76e;
  font-size: 0.7rem;
  font-weight: 800;
}

.auth-story h1 {
  max-width: 610px;
  margin: 0;
  color: #fff;
  font-size: 2.45rem;
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: 0;
}

.auth-story-main > p {
  max-width: 590px;
  margin: 0;
  color: #bdc9c4;
  font-size: 0.94rem;
  line-height: 1.65;
}

.auth-security-board {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--wc-radius-md);
  background: #12251e;
}

.auth-security-status {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-security-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--wc-radius-sm);
  background: #00a850;
  color: #fff;
  font-size: 1.2rem;
}

.auth-security-status > span:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.auth-security-status strong {
  color: #fff;
  font-size: 0.82rem;
}

.auth-security-status small {
  color: #a9b8b1;
  font-size: 0.7rem;
  line-height: 1.4;
}

.auth-security-status b {
  padding: 6px 8px;
  border-radius: var(--wc-radius-sm);
  background: rgba(0, 168, 80, 0.18);
  color: #86efac;
  font-size: 0.66rem;
}

.auth-access-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.auth-access-grid article {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  min-height: 106px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--wc-radius-sm);
  background: #172e25;
}

.auth-access-grid i {
  color: #ffd76e;
  font-size: 1.05rem;
}

.auth-access-grid strong {
  color: #fff;
  font-size: 0.75rem;
}

.auth-access-grid span {
  color: #a9b8b1;
  font-size: 0.67rem;
  line-height: 1.45;
}

.auth-story-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-story-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #bdc9c4;
  font-size: 0.68rem;
  font-weight: 700;
}

.auth-story-foot i {
  color: #00c563;
  font-size: 0.9rem;
}

.auth-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-content: start;
  min-width: 0;
  min-height: 0;
  padding: 24px 30px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: var(--wc-surface);
  color: var(--wc-text);
  box-shadow: none;
  scrollbar-width: thin;
  scrollbar-color: var(--wc-border-strong) transparent;
}

.auth-panel-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 40px;
  margin-bottom: 8px;
}

.auth-mobile-brand,
.auth-mobile-summary {
  display: none;
}

.auth-theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius-sm);
  background: var(--wc-surface-muted);
  color: var(--wc-text);
  font-size: 1.08rem;
}

.auth-theme-toggle:hover,
.auth-theme-toggle:focus-visible {
  border-color: var(--wc-color-brand);
  color: var(--wc-color-brand);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius-md);
  background: var(--wc-surface-muted);
}

.auth-tabs button {
  min-height: 36px;
  border-radius: var(--wc-radius-sm);
  background: transparent;
  color: var(--wc-text-muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.auth-tabs button.active {
  background: var(--wc-surface);
  color: var(--wc-color-brand-strong);
  box-shadow: var(--wc-shadow-sm);
}

.auth-panel:is([data-auth-view="reset"], [data-auth-view="action-state"]) .auth-tabs {
  display: none;
}

.auth-inline-alert {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(217, 45, 32, 0.28);
  border-radius: var(--wc-radius-sm);
  background: rgba(217, 45, 32, 0.08);
  color: var(--wc-text);
}

.auth-inline-alert[data-tone="warning"] {
  border-color: rgba(217, 119, 6, 0.34);
  background: rgba(217, 119, 6, 0.1);
}

.auth-inline-alert[data-tone="success"] {
  border-color: rgba(0, 168, 80, 0.32);
  background: rgba(0, 168, 80, 0.09);
}

.auth-inline-alert-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--wc-radius-sm);
  background: var(--wc-color-danger);
  color: #fff;
}

.auth-inline-alert[data-tone="warning"] .auth-inline-alert-icon {
  background: var(--wc-color-warning);
  color: #2d2100;
}

.auth-inline-alert[data-tone="success"] .auth-inline-alert-icon {
  background: var(--wc-color-brand);
}

.auth-inline-alert > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.auth-inline-alert strong {
  font-size: 0.76rem;
}

.auth-inline-alert #authStatusMessage {
  color: var(--wc-text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.auth-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  padding: 20px 0 4px;
  overflow: visible;
  color: var(--wc-text);
  text-align: left;
}

.auth-heading {
  display: grid;
  gap: 5px;
}

.auth-kicker {
  width: max-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: var(--wc-radius-sm);
  background: rgba(0, 168, 80, 0.1);
  color: var(--wc-color-brand-strong);
  font-size: 0.67rem;
  font-weight: 800;
}

.auth-heading h2 {
  margin: 0;
  color: var(--wc-text);
  font-size: 1.62rem;
  font-weight: 750;
  line-height: 1.18;
  letter-spacing: 0;
}

.auth-heading p {
  margin: 0;
  color: var(--wc-text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.auth-card form {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.auth-signup-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 10px;
}

.auth-signup-wide {
  grid-column: 1 / -1;
}

.field-label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--wc-text);
  font-size: 0.74rem;
  font-weight: 750;
}

.input-wrap {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 46px;
  padding: 0 10px;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius-sm);
  background: var(--wc-surface);
  color: var(--wc-text);
  box-shadow: none;
  transition: border-color var(--wc-motion-fast), box-shadow var(--wc-motion-fast), background var(--wc-motion-fast);
}

.input-wrap:focus-within {
  border-color: var(--wc-color-brand);
  box-shadow: 0 0 0 3px rgba(0, 168, 80, 0.13);
}

.input-wrap.invalid {
  border-color: var(--wc-color-danger);
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.11);
}

.input-wrap .wc-icon {
  width: 18px;
  height: 18px;
  color: var(--wc-color-brand);
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--wc-text);
  font: inherit;
  font-size: 0.9rem;
  box-shadow: none;
}

.input-wrap input::placeholder {
  color: var(--wc-text-muted);
  opacity: 0.78;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.password-row .field-label {
  margin: 0;
}

.password-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--wc-radius-sm);
  background: var(--wc-surface-muted);
  color: var(--wc-color-brand-strong);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(0, 168, 80, 0.12);
}

.remember-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
  color: var(--wc-text-muted);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.45;
}

.remember-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--wc-color-brand);
}

.remember-row a,
.auth-legal-note a {
  color: var(--wc-color-brand-strong);
}

.link-button {
  min-height: 36px;
  padding: 4px 2px;
  background: transparent;
  color: var(--wc-color-brand-strong);
  font-size: 0.76rem;
  font-weight: 750;
}

.link-button.centered {
  justify-self: center;
}

.primary-button {
  position: relative;
  min-height: 46px;
  border-radius: var(--wc-radius-sm);
  background: var(--wc-color-brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(0, 168, 80, 0.2);
  transition: transform var(--wc-motion-fast), background var(--wc-motion-fast), opacity var(--wc-motion-fast);
}

.primary-button:not(:disabled):hover {
  background: var(--wc-color-brand-strong);
  transform: translateY(-1px);
}

.primary-button.is-busy {
  padding-left: 38px;
  opacity: 0.78;
}

.primary-button.is-busy::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 16px;
  width: 15px;
  height: 15px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wc-shell-spin 700ms linear infinite;
}

.auth-helper,
.auth-legal-note,
.auth-password-requirements {
  margin: 0;
  padding: 9px 10px;
  border-radius: var(--wc-radius-sm);
  background: var(--wc-surface-muted);
  color: var(--wc-text-muted);
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.45;
}

.auth-legal-note {
  padding: 0;
  background: transparent;
  text-align: center;
}

.verification-target,
.auth-action-context {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(0, 168, 80, 0.24);
  border-radius: var(--wc-radius-sm);
  background: rgba(0, 168, 80, 0.07);
  color: var(--wc-text-muted);
  font-size: 0.74rem;
}

.verification-trial-context {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(0, 168, 80, 0.28);
  border-radius: var(--wc-radius-sm);
  background: rgba(0, 168, 80, 0.08);
}

.verification-trial-context img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.verification-trial-context span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.verification-trial-context strong {
  color: var(--wc-text);
  font-size: 0.74rem;
}

.verification-trial-context small {
  color: var(--wc-text-muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.verification-target .wc-icon,
.auth-action-context-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--wc-color-brand);
}

.auth-action-context > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.auth-action-context strong,
.verification-target strong {
  color: var(--wc-text);
  overflow-wrap: anywhere;
}

.auth-action-context small {
  color: var(--wc-text-muted);
  font-size: 0.68rem;
  overflow-wrap: anywhere;
}

.verification-code-wrap input.verification-code-input {
  text-align: center;
  color: var(--wc-text);
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.verification-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
}

.auth-password-requirements[data-length-ready="true"][data-match-ready="true"] {
  background: rgba(0, 168, 80, 0.09);
  color: var(--wc-color-brand-strong);
}

.auth-submitted-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 20px 12px;
  text-align: center;
}

.auth-submitted-icon,
.auth-action-state-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(0, 168, 80, 0.12);
  color: var(--wc-color-brand);
  font-size: 1.7rem;
}

.auth-submitted-state strong {
  color: var(--wc-text);
  font-size: 1rem;
}

.auth-submitted-state p {
  max-width: 360px;
  margin: 0;
  color: var(--wc-text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.auth-submitted-state .primary-button {
  width: min(260px, 100%);
}

#authActionStateView {
  justify-items: center;
  text-align: center;
}

#authActionStateView .auth-heading {
  justify-items: center;
  text-align: center;
}

#authActionStateView .primary-button {
  width: min(300px, 100%);
}

.auth-footer {
  align-self: end;
  color: var(--wc-text-muted);
  font-size: 0.7rem;
  text-align: center;
}

html[data-theme="dark"] .auth-tabs button.active,
html[data-theme="dark"] .input-wrap {
  background: var(--wc-surface-subtle);
}

html[data-theme="dark"] .auth-kicker,
html[data-theme="dark"] .auth-password-requirements[data-length-ready="true"][data-match-ready="true"] {
  color: #86efac;
}

html[data-theme="dark"] .remember-row a,
html[data-theme="dark"] .auth-legal-note a,
html[data-theme="dark"] .link-button,
html[data-theme="dark"] .auth-action-context-icon,
html[data-theme="dark"] .verification-target .wc-icon {
  color: #86efac;
}

@media (min-width: 1041px) and (max-height: 720px) {
  .auth-screen {
    padding: 10px;
  }

  .auth-shell {
    height: calc(100dvh - 44px);
    min-height: 560px;
  }

  .auth-story {
    gap: 18px;
    padding: 24px;
  }

  .auth-story h1 {
    font-size: 2rem;
  }

  .auth-security-board {
    margin-top: 2px;
  }

  .auth-access-grid article {
    min-height: 92px;
  }

  .auth-panel {
    padding: 16px 24px;
  }

  .auth-card {
    gap: 10px;
    padding-top: 12px;
  }
}

@media (max-width: 1040px) {
  .auth-screen {
    display: grid;
    align-content: start;
    min-height: 100dvh;
    padding: max(14px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .auth-shell {
    display: block;
    width: min(520px, 100%);
    height: auto;
    min-height: 0;
    margin: auto;
    overflow: visible;
    border-radius: var(--wc-radius-md);
  }

  .auth-story {
    display: none;
  }

  .auth-panel {
    width: 100%;
    min-height: 0;
    max-height: none;
    padding: 16px;
    overflow: visible;
    border-radius: var(--wc-radius-md);
  }

  .auth-panel-top {
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .auth-mobile-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
  }

  .auth-mobile-brand .auth-logo {
    width: 120px;
    height: 38px;
    object-fit: contain;
    object-position: left center;
  }

  .auth-mobile-brand span {
    display: none;
  }

  .auth-mobile-summary {
    display: grid;
    gap: 2px;
    margin-bottom: 10px;
    color: var(--wc-text);
  }

  .auth-mobile-summary strong {
    font-size: 0.82rem;
  }

  .auth-mobile-summary span {
    color: var(--wc-text-muted);
    font-size: 0.7rem;
  }

  .auth-card {
    padding-top: 16px;
  }

  .auth-signup-form {
    grid-template-columns: 1fr;
  }

  .auth-signup-wide {
    grid-column: auto;
  }
}

@media (max-width: 430px) {
  .auth-screen {
    padding-inline: 8px;
  }

  .auth-panel {
    padding: 13px;
  }

  .auth-heading h2 {
    font-size: 1.42rem;
  }

  .auth-heading p {
    font-size: 0.78rem;
  }

  .auth-tabs button,
  .primary-button {
    min-height: 46px;
  }

  .input-wrap input {
    font-size: 16px;
  }

  .password-row {
    align-items: end;
  }

  .verification-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .verification-actions .link-button {
    width: 100%;
  }
}

.profile-avatar-upload {
  align-items: end;
}

#account-page .profile-avatar-upload[hidden],
#account-page .avatar-crop-workbench[hidden],
#account-page .account-avatar-uploads[hidden],
#account-page .avatar-upload-empty-state[hidden],
#account-page .avatar-crop-stage img[hidden],
#account-page .avatar-crop-preview img[hidden] {
  display: none !important;
}

.account-avatar-uploads {
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid var(--wc-border, rgba(20, 32, 38, 0.14));
  border-radius: 10px;
  background: var(--wc-surface-soft, #f8fcfa);
}

.account-avatar-upload-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.account-avatar-upload-heading strong,
.account-avatar-library-label {
  display: block;
  color: var(--wc-text, #17211c);
  font-size: 0.85rem;
  font-weight: 700;
}

.account-avatar-upload-heading span,
.account-avatar-upload-heading small {
  color: var(--wc-text-muted, #64748b);
  font-size: 0.76rem;
}

.account-avatar-library-label { margin-bottom: 8px; }

.account-avatar-upload-grid { margin: 0; }

.account-avatar-upload-card {
  position: relative;
  min-width: 0;
}

.account-avatar-upload-card > button:first-child {
  width: 100%;
}

.account-avatar-delete {
  position: absolute;
  top: -5px;
  right: -5px;
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid var(--wc-surface, #fff);
  border-radius: 50%;
  background: #b42318;
  color: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
}

.account-avatar-delete:hover,
.account-avatar-delete:focus-visible { background: #8d1b13; }

.account-avatar-delete:focus-visible { outline: 3px solid var(--wc-color-brand, #00a850); outline-offset: 2px; }

.avatar-upload-empty-state {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px;
  border: 1px dashed var(--wc-border, rgba(20, 32, 38, 0.22));
  border-radius: 10px;
  background: var(--wc-surface-soft, #f8fcfa);
}

.avatar-upload-empty-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--wc-color-brand, #00a850) 12%, transparent);
  color: var(--wc-color-brand, #00a850);
  font-size: 1.25rem;
}

.avatar-upload-empty-state > div { min-width: 0; }
.avatar-upload-empty-state strong,
.avatar-upload-empty-state span { display: block; }
.avatar-upload-empty-state strong { color: var(--wc-text, #17211c); font-size: 0.86rem; }
.avatar-upload-empty-state span { margin-top: 3px; color: var(--wc-text-muted, #64748b); font-size: 0.76rem; }
.avatar-upload-picker { margin-left: auto; white-space: nowrap; }
.avatar-upload-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.avatar-crop-workbench {
  display: grid;
  grid-template-columns: 172px 84px minmax(180px, 1fr);
  align-items: center;
  gap: 16px;
  width: min(100%, 560px);
  padding: 14px;
  border: 1px solid var(--wc-border, rgba(20, 32, 38, 0.14));
  border-radius: 12px;
  background: var(--wc-surface-soft, #f8fcfa);
}

.avatar-crop-stage {
  position: relative;
  width: 172px;
  height: 172px;
  flex: 0 0 172px;
  overflow: hidden;
  border: 2px solid var(--wc-color-brand, #00a850);
  border-radius: 12px;
  background: #e9fff4;
  cursor: grab;
  touch-action: none;
}

.avatar-crop-stage:active { cursor: grabbing; }
.avatar-crop-stage:focus-visible { outline: 3px solid var(--wc-color-brand, #00a850); outline-offset: 3px; }

.avatar-crop-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  pointer-events: none;
  transition: transform 120ms ease-out;
}

.avatar-crop-preview {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  overflow: hidden;
  border: 3px solid var(--wc-color-brand, #00a850);
  border-radius: 50%;
  background: #e9fff4;
}

.avatar-crop-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  transition: transform 120ms ease-out;
}

.avatar-crop-controls {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.avatar-crop-controls label {
  display: grid;
  gap: 4px;
  color: var(--wc-text, #17211c);
  font-size: 0.76rem;
  font-weight: 650;
}

.avatar-crop-controls input[type="range"] { width: 100%; }

.avatar-upload-note {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-upload-note small { color: var(--wc-text-muted, #64748b); font-size: 0.76rem; }

.profile-avatar-upload .status-actions {
  align-items: center;
}

.profile-avatar-upload .status-actions small {
  display: block;
  max-width: 52rem;
  color: var(--wc-text-muted, #64748b);
}

@media (max-width: 560px) {
  .avatar-upload-empty-state { align-items: flex-start; flex-wrap: wrap; }
  .avatar-upload-picker { margin-left: 50px; }
  .avatar-crop-workbench { grid-template-columns: minmax(0, 1fr) 72px; gap: 12px; width: 100%; }
  .avatar-crop-controls { grid-column: 1 / -1; }
  .avatar-crop-stage { width: 148px; height: 148px; flex-basis: 148px; }
  .avatar-crop-preview { width: 72px; height: 72px; flex-basis: 72px; }
  .profile-avatar-upload .status-actions { align-items: stretch; flex-wrap: wrap; }
  .profile-avatar-upload .status-actions button { min-height: 44px; }
  .avatar-upload-note { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-screen *,
  .shell-loader-spinner {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Stage R5: authoritative inbox navigation and recoverable send states. */
#chats-page .sidebar {
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  align-content: start;
}

#chats-page .team-tabs,
#chats-page .team-tabs button {
  align-self: start;
}

.inbox-search {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 7px;
  margin: 10px 12px 4px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.inbox-search:focus-within {
  border-color: rgba(0, 168, 80, 0.48);
  box-shadow: 0 0 0 3px rgba(0, 168, 80, 0.1);
}

.inbox-search .wc-icon {
  --wc-icon-size: 18px;
}

.inbox-search input {
  min-width: 0;
  height: 30px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.8rem;
}

.inbox-search button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
  background: var(--brand-light);
  color: var(--brand-dark);
}

#chats-page .admin-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-top: 6px;
}

.chat-list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 6px 12px 10px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.chat-list-footer:has(#chatLoadMore.hidden) {
  justify-content: center;
}

#chatListState {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#chatLoadMore {
  flex: 0 0 auto;
  min-height: 32px;
}

.admin-send-recovery {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(185, 28, 28, 0.2);
  border-radius: 8px;
  background: #fff4f4;
  color: #8d1616;
  font-size: 0.76rem;
  font-weight: 800;
}

.admin-send-recovery button {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 6px;
  background: #fff;
  color: #8d1616;
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.18);
}

.admin-send-recovery button:first-of-type {
  background: var(--brand);
  color: #fff;
  box-shadow: none;
}

.conversation-load-state {
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  gap: 7px;
  width: min(330px, calc(100% - 28px));
  padding: 18px;
  border: 1px solid rgba(0, 168, 80, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  text-align: center;
}

.conversation-load-state .wc-icon {
  --wc-icon-size: 24px;
  color: var(--brand);
}

.conversation-load-state strong {
  color: var(--ink);
}

.conversation-load-state span:not(.wc-icon) {
  font-size: 0.8rem;
}

.conversation-load-state button {
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
}

.conversation-load-state.error .wc-icon {
  color: var(--danger);
}

.composer.has-send-recovery {
  pointer-events: auto;
  opacity: 1;
}

@media (max-width: 430px) {
  .inbox-search {
    margin-inline: 10px;
  }

  #chats-page .admin-tabs,
  #chats-page .team-tabs {
    overflow-x: auto;
    grid-auto-flow: column;
    grid-auto-columns: minmax(82px, 1fr);
    grid-template-columns: none;
    scrollbar-width: none;
  }

  .admin-send-recovery {
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding-inline: 8px;
  }
}

/* Stage R4: operational dashboard, analytics, and durable notifications. */
.dashboard.admina-shell .dashboard-operations-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 0;
  padding: 20px 22px;
  overflow: hidden;
}

.dashboard.admina-shell .dashboard-operations-hero .dashboard-hero-copy {
  max-width: 760px;
}

.dashboard.admina-shell .dashboard-operations-hero h2 {
  margin-top: 5px;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.dashboard.admina-shell .dashboard-operations-hero p:not(.eyebrow) {
  max-width: 680px;
  margin-top: 5px;
  font-size: 0.79rem;
  line-height: 1.55;
}

.dashboard.admina-shell .dashboard-operations-hero .dashboard-hero-actions {
  align-self: center;
  margin: 0;
}

.dashboard.admina-shell .stats-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dashboard.admina-shell .stat-card {
  min-width: 0;
  min-height: 94px;
  padding: 13px;
}

.dashboard.admina-shell .stat-card > div,
.dashboard.admina-shell .stat-card > div > * {
  min-width: 0;
}

.dashboard.admina-shell .stat-card span[id] {
  overflow-wrap: anywhere;
  font-size: 1.35rem;
}

.dashboard.admina-shell .stat-card strong {
  color: var(--wc-text);
  font-size: 0.7rem;
  line-height: 1.3;
}

.dashboard.admina-shell .stat-card small {
  color: var(--wc-text-muted);
  font-size: 0.61rem;
}

.dashboard.admina-shell .stat-card.accent {
  border-color: rgba(0, 168, 80, 0.38);
  background: color-mix(in srgb, var(--wc-color-brand) 8%, var(--wc-surface));
  color: var(--wc-text);
}

.dashboard.admina-shell .stat-card.accent :is(strong, span[id]) {
  color: var(--wc-text);
}

.dashboard-activity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.dashboard-activity-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius-md);
  background: var(--wc-surface);
  box-shadow: var(--wc-shadow-sm);
}

.dashboard-activity-card .client-card-heading {
  padding: 13px 14px 11px;
}

.dashboard-activity-card .client-card-heading h2 {
  font-size: 0.92rem;
}

.dashboard-activity-card .ghost-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.64rem;
}

.dashboard-activity-list {
  display: grid;
  min-height: 178px;
}

.dashboard-activity-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 44px;
  padding: 9px 14px;
  border: 0;
  border-top: 1px solid var(--wc-border);
  border-radius: 0;
  background: transparent;
  color: var(--wc-text);
  text-align: left;
  box-shadow: none;
}

.dashboard-activity-item:hover,
.dashboard-activity-item:focus-visible {
  background: color-mix(in srgb, var(--wc-color-brand) 6%, var(--wc-surface));
  color: var(--wc-text);
  transform: none;
}

.dashboard-activity-item.unread {
  box-shadow: inset 3px 0 0 var(--wc-color-brand);
}

.dashboard-activity-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--wc-surface-muted);
  color: var(--wc-color-brand-strong);
  font-size: 0.68rem;
  font-weight: 800;
}

.dashboard-activity-avatar.icon .wc-icon {
  width: 17px;
  height: 17px;
}

.dashboard-activity-item > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.dashboard-activity-item > span:nth-child(2) strong,
.dashboard-activity-item > span:nth-child(2) small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-activity-item > span:nth-child(2) strong {
  font-size: 0.7rem;
}

.dashboard-activity-item > span:nth-child(2) small {
  color: var(--wc-text-muted);
  font-size: 0.62rem;
}

.dashboard-activity-meta {
  display: grid;
  justify-items: end;
  gap: 3px;
  color: var(--wc-text-muted);
  font-size: 0.57rem;
  white-space: nowrap;
}

.dashboard-activity-meta :is(b, em) {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 9px;
  background: var(--wc-surface-muted);
  color: var(--wc-text-muted);
  font-size: 0.55rem;
  font-style: normal;
  text-align: center;
}

.dashboard-activity-meta b {
  background: var(--wc-color-brand);
  color: #fff;
}

.dashboard-activity-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 130px;
  padding: 18px;
  color: var(--wc-text-muted);
}

.dashboard-activity-empty .wc-icon {
  width: 22px;
  height: 22px;
  color: var(--wc-color-brand);
}

.dashboard-activity-empty div {
  display: grid;
  gap: 3px;
}

.dashboard-activity-empty strong {
  color: var(--wc-text);
  font-size: 0.74rem;
}

.dashboard-activity-empty small {
  font-size: 0.64rem;
}

.dashboard-plan-usage {
  display: grid;
  gap: 9px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--wc-border);
}

.dashboard-plan-usage-head,
.dashboard-plan-usage-row > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-plan-usage-head strong,
.dashboard-plan-usage-row strong {
  color: var(--wc-text);
  font-size: 0.66rem;
}

.dashboard-plan-usage-head span,
.dashboard-plan-usage-row small {
  color: var(--wc-text-muted);
  font-size: 0.59rem;
}

.dashboard-plan-usage-row {
  display: grid;
  gap: 4px;
}

.dashboard-plan-usage-row > i {
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--wc-surface-muted);
}

.dashboard-plan-usage-row > i > b {
  display: block;
  width: var(--usage-width);
  height: 100%;
  border-radius: inherit;
  background: var(--wc-color-brand);
}

.dashboard.admina-shell .plan-badge[data-plan="trial"][data-plan-status="trialing"] {
  border-color: rgba(0, 168, 80, 0.4);
  background: rgba(0, 168, 80, 0.11);
  color: var(--wc-color-brand-strong);
}

.dashboard.admina-shell .plan-badge.trial-ending {
  border-color: rgba(255, 193, 45, 0.58);
  background: rgba(255, 193, 45, 0.14);
  color: #765000;
}

html[data-theme="dark"] .dashboard.admina-shell .plan-badge.trial-ending {
  color: #ffd76e;
}

.dashboard.admina-shell .plan-badge[data-plan-status="expired"] {
  border-color: rgba(217, 45, 32, 0.35);
  background: rgba(217, 45, 32, 0.08);
  color: var(--wc-color-danger);
}

.dashboard.admina-shell .plan-badge[data-plan="free"] {
  border-color: var(--wc-border);
  background: var(--wc-surface-muted);
  color: var(--wc-text-muted);
}

.workspace-notification-center {
  display: grid;
  gap: 12px;
  width: min(100%, 1180px);
  margin: 0 auto;
}

.workspace-notification-hero,
.workspace-notification-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius-md);
  background: var(--wc-surface);
  color: var(--wc-text);
  box-shadow: var(--wc-shadow-sm);
}

.workspace-notification-hero > div:first-child {
  min-width: 0;
}

.workspace-notification-hero h2 {
  margin-top: 3px;
  font-size: 1.1rem;
}

.workspace-notification-hero p:not(.eyebrow) {
  max-width: 720px;
  margin-top: 4px;
  color: var(--wc-text-muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.workspace-notification-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(80px, 1fr));
  flex: 0 0 auto;
  gap: 8px;
}

.workspace-notification-summary span {
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border-radius: var(--wc-radius-sm);
  background: var(--wc-surface-muted);
  color: var(--wc-text-muted);
  font-size: 0.61rem;
}

.workspace-notification-summary strong {
  color: var(--wc-text);
  font-size: 1rem;
}

.workspace-notification-toolbar {
  padding-block: 10px;
}

.workspace-notification-filters,
.workspace-notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workspace-notification-filters button {
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius-sm);
  background: var(--wc-surface);
  color: var(--wc-text-muted);
  font-size: 0.64rem;
  font-weight: 750;
}

.workspace-notification-filters button.active {
  border-color: var(--wc-color-brand);
  background: rgba(0, 168, 80, 0.1);
  color: var(--wc-color-brand-strong);
}

.workspace-notification-list {
  display: grid;
  gap: 8px;
}

.workspace-notification-list .notification-item {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius-md);
  background: var(--wc-surface);
  box-shadow: var(--wc-shadow-sm);
}

.workspace-notification-list .notification-item.unread {
  border-color: rgba(0, 168, 80, 0.4);
  box-shadow: inset 3px 0 0 var(--wc-color-brand), var(--wc-shadow-sm);
}

.workspace-notification-state.hidden {
  display: none;
}

.workspace-notification-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 86px;
  padding: 15px;
  border: 1px dashed var(--wc-border);
  border-radius: var(--wc-radius-md);
  background: var(--wc-surface);
  color: var(--wc-text-muted);
}

.workspace-notification-empty .wc-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--wc-color-brand);
}

.workspace-notification-empty.loading .wc-icon {
  animation: whachat-spin 900ms linear infinite;
}

.workspace-notification-empty.error {
  border-color: rgba(217, 45, 32, 0.35);
}

.workspace-notification-empty.error .wc-icon {
  color: var(--wc-color-danger);
}

.workspace-notification-empty div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.workspace-notification-empty strong {
  color: var(--wc-text);
  font-size: 0.72rem;
}

.workspace-notification-empty span:not(.wc-icon) {
  font-size: 0.64rem;
  line-height: 1.45;
}

.workspace-notification-empty button {
  margin-left: auto;
}

.dashboard.admina-shell .notification-panel .notification-list > .workspace-notification-empty {
  margin: 8px;
}

.dashboard.admina-shell .analytics-kpi-grid article,
.dashboard.admina-shell .analytics-panel,
.dashboard.admina-shell .analytics-hero {
  border-color: var(--wc-border);
  background: var(--wc-surface);
  color: var(--wc-text);
  box-shadow: var(--wc-shadow-sm);
}

.dashboard.admina-shell .analytics-kpi-grid :is(strong, small),
.dashboard.admina-shell .analytics-panel :is(h2, strong) {
  color: var(--wc-text);
}

.dashboard.admina-shell .analytics-kpi-grid :is(em, small),
.dashboard.admina-shell .analytics-panel :is(span, small) {
  color: var(--wc-text-muted);
}

.dashboard.admina-shell .analytics-empty button {
  margin-top: 8px;
}

@media (max-width: 1024px) {
  .dashboard.admina-shell .stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard.admina-shell .dashboard-operations-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard.admina-shell .dashboard-operations-hero .dashboard-hero-actions {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .dashboard.admina-shell .stats-row,
  .dashboard-activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-activity-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-notification-hero,
  .workspace-notification-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-notification-summary {
    width: 100%;
  }

  .workspace-notification-actions > button {
    flex: 1 1 140px;
  }

  .workspace-notification-list .notification-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .workspace-notification-list .notification-item-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .dashboard.admina-shell .dashboard-operations-hero {
    padding: 15px;
  }

  .dashboard.admina-shell .dashboard-command-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard.admina-shell .stats-row {
    gap: 7px;
  }

  .dashboard.admina-shell .stat-card {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 84px;
    padding: 10px;
  }

  .dashboard.admina-shell .stat-card-icon {
    width: 30px;
    height: 30px;
  }

  .dashboard.admina-shell .stat-card span[id] {
    font-size: 1.12rem;
  }

  .dashboard.admina-shell .stat-card strong {
    font-size: 0.63rem;
  }

  .dashboard.admina-shell .stat-card small {
    grid-column: 1 / -1;
    font-size: 0.56rem;
  }

  .dashboard-activity-item {
    grid-template-columns: 30px minmax(0, 1fr);
    padding-inline: 11px;
  }

  .dashboard-activity-avatar {
    width: 30px;
    height: 30px;
  }

  .dashboard-activity-meta {
    grid-column: 2;
    grid-template-columns: auto auto;
    justify-content: start;
    justify-items: start;
  }

  .workspace-notification-hero,
  .workspace-notification-toolbar {
    padding: 13px;
  }

  .workspace-notification-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-notification-filters button {
    width: 100%;
  }

  .workspace-notification-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-notification-actions > button {
    min-width: 0;
    padding-inline: 7px;
  }

  .workspace-notification-list .notification-item-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .workspace-notification-list :is(.notification-item-action, .notification-more) {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-notification-empty.loading .wc-icon {
    animation: none;
  }
}

@keyframes whachat-page-enter {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* WhaChat v0.38b Agent Home, assignment prompt, and media preview polish */
.agent-home-panel {
  display: grid;
  gap: 16px;
  min-height: 0;
}

.agent-home-panel.hidden {
  display: none;
}

.agent-home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(0, 168, 80, 0.14);
  border-radius: 26px;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 193, 45, 0.22), transparent 28%),
    linear-gradient(135deg, rgba(0, 168, 80, 0.16), rgba(255, 255, 255, 0.96)),
    #fff;
  box-shadow: 0 22px 58px rgba(8, 58, 39, 0.11);
}

.agent-home-hero h2 {
  margin: 8px 0;
  color: var(--brand-dark);
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.agent-home-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.agent-home-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(76px, 10vw, 112px);
  height: clamp(76px, 10vw, 112px);
  border-radius: 50%;
  background:
    conic-gradient(from 120deg, var(--brand), var(--gold), var(--brand), var(--brand-dark), var(--brand));
  box-shadow: 0 18px 42px rgba(0, 168, 80, 0.22);
}

.agent-home-avatar > img:first-child {
  width: calc(100% - 9px);
  height: calc(100% - 9px);
  border: 3px solid #fff;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
}

.agent-home-avatar > img:last-child {
  position: absolute;
  right: 2px;
  bottom: 4px;
  width: 30%;
  height: 30%;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
}

.agent-home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.agent-home-grid article {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(0, 168, 80, 0.12);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(8, 58, 39, 0.08);
}

.agent-home-grid .wc-icon {
  --wc-icon-size: 22px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 15px;
  background: rgba(0, 168, 80, 0.1);
  color: var(--brand);
}

.agent-home-grid strong {
  color: var(--brand-dark);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 1000;
  line-height: 1;
}

.agent-home-grid small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.agent-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.agent-home-actions button {
  min-height: 44px;
}

.dashboard[data-role="agent"] #chats-page .agent-assignment-panel:not(.hidden):not([data-status="accepted"]) {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 150;
  width: min(420px, calc(100vw - 28px));
  transform: translate(-50%, -50%);
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(0, 168, 80, 0.2);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 193, 45, 0.22), transparent 32%),
    linear-gradient(135deg, #ffffff, #f4fff8);
  box-shadow: 0 28px 80px rgba(5, 31, 22, 0.28);
}

.dashboard[data-role="agent"] #chats-page .agent-assignment-panel:not(.hidden):not([data-status="accepted"]) strong {
  font-size: 1.1rem;
}

.dashboard[data-role="agent"] #chats-page .agent-assignment-panel:not(.hidden):not([data-status="accepted"]) .agent-assignment-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
}

.dashboard[data-role="agent"] #chats-page .agent-assignment-panel:not(.hidden):not([data-status="accepted"]) .agent-assignment-actions button {
  min-height: 44px;
}

.dashboard[data-role="agent"] #chats-page .agent-assignment-panel[data-status="accepted"] {
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.11), rgba(255, 193, 45, 0.08)),
    #fbfffd;
}

.dashboard[data-role="agent"] #status-page [data-status-view="composer"],
.dashboard[data-role="agent"] #status-page [data-status-focus="composer"],
.dashboard[data-role="agent"] #status-page [data-status-view-panel="composer"],
.dashboard[data-role="agent"] #status-page .status-delete-button {
  display: none !important;
}

.dashboard[data-role="agent"] #status-page .status-list-card {
  box-shadow: 0 14px 34px rgba(5, 31, 22, 0.08);
}

.dashboard[data-role="agent"] #status-page .status-view-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 820px) {
  .agent-home-panel {
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .agent-home-hero {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
  }

  .agent-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .agent-home-grid article {
    padding: 13px;
    border-radius: 18px;
  }

  .agent-home-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .agent-home-actions button {
    width: 100%;
  }

  .dashboard[data-role="agent"] #chats-page .agent-assignment-panel:not(.hidden):not([data-status="accepted"]) .agent-assignment-actions {
    grid-template-columns: 1fr;
  }

  .admin-media-modal {
    padding: 14px;
  }

  .admin-media-modal > button {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }

  #adminMediaModalBody {
    width: min(430px, calc(100vw - 24px));
    max-height: calc(100dvh - 74px);
  }

  .admin-media-card {
    max-height: calc(100dvh - 84px);
    padding: 10px;
    border-radius: 20px;
  }

  .admin-media-actions {
    align-items: stretch;
  }

  .admin-media-actions strong {
    align-self: center;
  }

  #adminMediaModalBody img,
  #adminMediaModalBody video {
    max-height: min(58dvh, 520px);
  }
}

/* Restoration candidate: persistent request, session, and reconnect recovery. */
.dashboard-recovery {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 12px 16px 0;
  padding: 12px 14px;
  border: 1px solid #d8e4dc;
  border-radius: 8px;
  background: #f7fbf8;
  color: #173b27;
  box-shadow: 0 5px 16px rgba(31, 41, 55, 0.06);
}

.dashboard-recovery.hidden {
  display: none;
}

.dashboard-recovery[data-tone="warning"] {
  border-color: #ead68f;
  background: #fffbed;
  color: #5f4b00;
}

.dashboard-recovery[data-tone="error"] {
  border-color: #efb7b7;
  background: #fff5f5;
  color: #7a2020;
}

.dashboard-recovery-icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: currentColor;
}

.dashboard-recovery-icon i {
  color: #fff;
  font-size: 18px;
}

.dashboard-recovery-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.dashboard-recovery-copy strong {
  font-size: 0.9rem;
  line-height: 1.3;
}

.dashboard-recovery-copy > span {
  color: inherit;
  font-size: 0.8rem;
  line-height: 1.45;
  opacity: 0.84;
}

.dashboard-recovery-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-recovery-actions button {
  min-width: 88px;
  min-height: 44px;
  border-radius: 7px;
}

@media (max-width: 640px) {
  .dashboard-recovery {
    grid-template-columns: auto minmax(0, 1fr);
    margin: 8px 10px 0;
    padding: 11px 12px;
  }

  .dashboard-recovery-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-recovery,
  .dashboard-recovery * {
    scroll-behavior: auto;
    transition: none !important;
  }
}

/* R2 dark-mode compatibility for legacy light-only dashboard surfaces. */
html[data-theme="dark"] .dashboard.admina-shell :is(
  .owner-hero,
  .owner-panel,
  .owner-detail-panel,
  .owner-detail-card,
  .owner-detail-grid article,
  .owner-metrics article,
  .client-daily-card,
  .client-quick-actions,
  .client-section-hero,
  .ticket-summary-grid article,
  .ticket-empty-state,
  .ticket-flow-card,
  .support-ticket-empty,
  .support-ticket-card,
  .plan-card,
  .plan-limits-card,
  #account-page .plan-upgrade-banner,
  #account-page .plan-tier-card,
  #account-page .plan-feature-card,
  .billing-history-item,
  .billing-history-empty
) {
  border-color: var(--wc-border);
  background: var(--wc-surface);
  color: var(--wc-text);
  box-shadow: var(--wc-shadow-sm);
}

html[data-theme="dark"] .dashboard.admina-shell :is(
  .owner-hero h2,
  .owner-metrics strong,
  .owner-detail-card strong,
  .owner-detail-grid strong,
  .client-section-hero h2,
  .ticket-summary-grid strong,
  .ticket-empty-state strong,
  .support-ticket-empty strong,
  .support-ticket-card strong,
  .plan-card strong,
  .plan-limits-card p strong,
  #account-page .plan-upgrade-banner strong,
  #account-page .plan-tier-card h3,
  #account-page .plan-tier-card li,
  #account-page .plan-tier-foot strong,
  .billing-history-item strong,
  .billing-history-empty strong
) {
  color: var(--wc-text);
}

html[data-theme="dark"] .dashboard.admina-shell :is(
  .owner-hero p:not(.eyebrow),
  .owner-metrics span,
  .owner-detail-muted,
  .client-section-hero p,
  .ticket-summary-grid span,
  .ticket-empty-state p,
  .support-ticket-empty span,
  .support-ticket-card p,
  .support-ticket-card small,
  .support-ticket-card em,
  .plan-card p,
  .plan-limits-card p,
  #account-page .plan-upgrade-banner p,
  #account-page .plan-tier-card p,
  #account-page .plan-tier-foot,
  .billing-history-item span,
  .billing-history-empty span
) {
  color: var(--wc-text-muted);
}

html[data-theme="dark"] .dashboard.admina-shell #account-page .plan-upgrade-banner > div > span {
  background: rgba(0, 168, 80, 0.2);
  color: #86efac;
}

@media (max-width: 820px) {
  .dashboard.admina-shell .plan-badge {
    justify-content: center;
    overflow: hidden;
    color: transparent !important;
    font-size: 0;
    line-height: 0;
  }

  .dashboard.admina-shell .plan-badge::before {
    flex: 0 0 9px;
    background: #ffd76e;
    box-shadow: 0 0 0 3px rgba(255, 215, 110, 0.18);
  }
}

/* Auth gateway mobile containment: the public /admin/ screen must never inherit desktop-width tracks. */
@media (max-width: 640px) {
  body:has(.auth-screen:not(.hidden)),
  .app-shell:has(.auth-screen:not(.hidden)) {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  .auth-screen,
  .auth-shell,
  .auth-panel,
  .auth-card,
  .auth-card form,
  .auth-mobile-brand,
  .auth-mobile-summary,
  .auth-tabs,
  .input-wrap,
  .password-row,
  .remember-row,
  .auth-footer {
    box-sizing: border-box;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .auth-screen {
    width: 100%;
    padding: max(14px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom));
  }

  .auth-shell,
  .auth-panel {
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .auth-panel {
    padding: 14px !important;
  }

  .auth-mobile-brand {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
  }

  .auth-mobile-brand span {
    min-width: 0;
    max-width: calc(100% - 142px) !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .auth-tabs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .auth-tabs button,
  .password-row .link-button {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .password-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  }

  .input-wrap,
  .input-wrap input,
  .primary-button {
    width: 100%;
  }

  .auth-footer {
    width: 100%;
    padding-inline: 8px;
    overflow-wrap: anywhere;
    text-align: center;
  }
}

@media (max-width: 440px) {
  .agent-home-grid {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    linear-gradient(135deg, rgba(255, 193, 45, 0.16), transparent 34%),
    linear-gradient(135deg, #062318 0%, #0b3924 48%, #061a16 100%);
  color: var(--ink);
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.wc-icon {
  --wc-icon-size: 20px;
  --wc-icon-url: url("../icons/info-circle.svg");
  display: inline-block;
  width: var(--wc-icon-size);
  height: var(--wc-icon-size);
  flex: 0 0 var(--wc-icon-size);
  background: currentColor;
  color: currentColor;
  -webkit-mask: var(--wc-icon-url) center / contain no-repeat;
  mask: var(--wc-icon-url) center / contain no-repeat;
}

.wc-icon-sm { --wc-icon-size: 16px; }
.wc-icon-lg { --wc-icon-size: 24px; }
.wc-icon-dots { --wc-icon-url: url("../icons/dots-vertical-rounded-circle.svg"); }
.wc-icon-user-circle { --wc-icon-url: url("../icons/user-circle.svg"); }
.wc-icon-user-check { --wc-icon-url: url("../icons/check-shield.svg"); }
.wc-icon-user-plus { --wc-icon-url: url("../icons/user.svg"); }
.wc-icon-check-shield { --wc-icon-url: url("../icons/check-shield.svg"); }
.wc-icon-bookmark-x { --wc-icon-url: url("../icons/bookmark-x.svg"); }
.wc-icon-alert-triangle { --wc-icon-url: url("../icons/alert-triangle.svg"); }
.wc-icon-broom { --wc-icon-url: url("../icons/broom.svg"); }
.wc-icon-trash { --wc-icon-url: url("../icons/trash.svg"); }
.wc-icon-cog { --wc-icon-url: url("../icons/cog.svg"); }
.wc-icon-x { --wc-icon-url: url("../icons/search-big-x.svg"); }
.wc-icon-paperclip { --wc-icon-url: url("../icons/paperclip.svg"); }
.wc-icon-smile { --wc-icon-url: url("../icons/smile.svg"); }
.wc-icon-send { --wc-icon-url: url("../icons/send-alt.svg"); }
.wc-icon-search { --wc-icon-url: url("../icons/search-big.svg"); }
.wc-icon-reply { --wc-icon-url: url("../icons/reply-big.svg"); }
.wc-icon-download { --wc-icon-url: url("../icons/arrow-to-bottom.svg"); }
.wc-icon-arrow-left { --wc-icon-url: url("../icons/arrow-left.svg"); }
.wc-icon-bell-slash { --wc-icon-url: url("../icons/bell-slash.svg"); }
.wc-icon-chevron-down { --wc-icon-url: url("../icons/chevron-down.svg"); }
.wc-icon-clock { --wc-icon-url: url("../icons/clock.svg"); }
.wc-icon-check { --wc-icon-url: url("../icons/check.svg"); }
.wc-icon-folder-check { --wc-icon-url: url("../icons/folder-check.svg"); }
.wc-icon-refresh { --wc-icon-url: url("../icons/refresh-cw-alt.svg"); }
.wc-icon-headset { --wc-icon-url: url("../icons/headphone-mic.svg"); }
.wc-icon-discussion { --wc-icon-url: url("../icons/discussion.svg"); }
.wc-icon-info { --wc-icon-url: url("../icons/info-circle.svg"); }
.wc-icon-power { --wc-icon-url: url("../icons/power.svg"); }
.wc-icon-menu { --wc-icon-url: url("../icons/menu.svg"); }
.wc-icon-bell { --wc-icon-url: url("../icons/bell.svg"); }
.wc-icon-copy { --wc-icon-url: url("../icons/copy.svg"); }
.wc-icon-key { --wc-icon-url: url("../icons/key-alt.svg"); }
.wc-icon-image { --wc-icon-url: url("../icons/images.svg"); }
.wc-icon-link { --wc-icon-url: url("../icons/link.svg"); }
.wc-icon-align-center { --wc-icon-url: url("../icons/align-horizontal-justify-center.svg"); }
.wc-icon-align-right { --wc-icon-url: url("../icons/align-horizontal-justify-end.svg"); }
.wc-icon-credit { --wc-icon-url: url("../icons/credit-card.svg"); }
.wc-icon-headphone { --wc-icon-url: url("../icons/headphone.svg"); }
.wc-icon-widget { --wc-icon-url: url("../icons/widget.svg"); }
.wc-icon-code { --wc-icon-url: url("../icons/code-alt.svg"); }
.wc-icon-network { --wc-icon-url: url("../icons/network-device.svg"); }
.wc-icon-envelope { --wc-icon-url: url("../icons/envelope-alt.svg"); }
.wc-icon-lock { --wc-icon-url: url("../icons/lock-keyhole.svg"); }
.wc-icon-eye { --wc-icon-url: url("../icons/eye-alt.svg"); }
.wc-icon-dashboard { --wc-icon-url: url("../icons/grid-circle-diagonal-right.svg"); }
.wc-icon-crown { --wc-icon-url: url("../icons/crown.svg"); }
.wc-icon-status { --wc-icon-url: url("../icons/circle-outer-dashed-circle.svg"); }
.wc-icon-visitors { --wc-icon-url: url("../icons/group.svg"); }
.wc-icon-analytics { --wc-icon-url: url("../icons/chart-network.svg"); }
.wc-icon-team { --wc-icon-url: url("../icons/community.svg"); }
.wc-icon-routing { --wc-icon-url: url("../icons/swap-horizontal.svg"); }
.wc-icon-ticket { --wc-icon-url: url("../icons/ticket.svg"); }

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 168, 80, 0.16);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.field-hint {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
}

.login-panel {
  display: grid;
  gap: 22px;
  width: min(430px, calc(100vw - 32px));
  margin: 10vh auto 0;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.login-brand,
.operator {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  padding: 7px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 1.45rem;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(0, 168, 80, 0.24);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
}

.brand-mark.small {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 1.08rem;
}

.helper {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.login-panel h1,
.sidebar h1,
.conversation h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1.15;
}

.login-panel form {
  display: grid;
  gap: 14px;
}

.login-panel button[type="submit"] {
  min-height: 46px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(15, 143, 127, 0.24);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 16px;
  width: min(1320px, 100%);
  height: calc(100vh - 36px);
  margin: 0 auto;
}

.mobile-tabbar {
  display: none;
}

.sidebar,
.conversation {
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.sidebar {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
}

.app-header {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(135deg, #ffffff, #eef8f6);
  border-bottom: 1px solid var(--line);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#socketStatus {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  max-width: min(360px, 40vw);
  padding: 0 11px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#socketStatus::before {
  flex: 0 0 auto;
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

#socketStatus.online {
  background: var(--brand-light);
  color: var(--brand-dark);
}

#socketStatus.offline {
  background: #fff0f0;
  color: var(--danger);
}

.ghost-button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px var(--line);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  padding: 12px 14px 8px;
}

.stat-card {
  display: grid;
  gap: 2px;
  padding: 12px 10px;
  border-radius: 8px;
  background: #f6f8f9;
  box-shadow: inset 0 0 0 1px var(--line);
}

.stat-card.accent {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff;
}

.stat-card span {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.stat-card strong {
  color: inherit;
  font-size: 0.72rem;
  opacity: 0.75;
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 7px 14px 12px;
}

.admin-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  gap: 7px;
  min-height: 34px;
  border-radius: 999px;
  background: #f0f4f5;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-tabs button.active {
  background: var(--brand-light);
  color: var(--brand-dark);
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.1);
}

.chat-list {
  align-content: start;
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 14px;
}

.chat-list:empty::before {
  content: "No chats yet";
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  font-weight: 800;
}

.chat-empty-state {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 180px;
  padding: 18px;
  border: 1px dashed rgba(0, 168, 80, 0.22);
  border-radius: 8px;
  background: rgba(233, 255, 244, 0.48);
  color: var(--muted);
  text-align: center;
}

.chat-empty-state strong {
  color: var(--ink);
}

.chat-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  padding: 11px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 0 0 1px var(--line), 0 8px 18px rgba(20, 32, 38, 0.04);
}

.chat-item.unread {
  background:
    linear-gradient(90deg, rgba(0, 168, 80, 0.13), rgba(255, 255, 255, 0.96) 42%),
    #fff;
  box-shadow: inset 4px 0 0 var(--brand), inset 0 0 0 1px rgba(0, 168, 80, 0.22), 0 14px 30px rgba(0, 168, 80, 0.12);
}

.chat-item:hover,
.chat-item.active {
  background: #f6fffc;
  box-shadow: inset 0 0 0 2px rgba(0, 168, 80, 0.28), 0 12px 26px rgba(0, 168, 80, 0.1);
}

.chat-avatar,
.visitor-avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  font-weight: 900;
}

.chat-avatar.flag-avatar,
.visitor-avatar.flag-avatar,
.visitor-item-avatar.flag-avatar,
.visitor-detail-avatar.flag-avatar {
  background: #fff;
  color: inherit;
  font-size: 1.45rem;
  line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9), 0 8px 18px rgba(20, 32, 38, 0.12);
}

.chat-avatar {
  width: 44px;
  height: 44px;
}

.chat-copy {
  min-width: 0;
}

.chat-copy strong,
.chat-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-stage-pill .wc-icon {
  width: 15px;
  height: 15px;
}

.chat-copy strong {
  display: flex;
  align-items: center;
  gap: 7px;
}

.chat-copy strong i {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #7a5200;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.chat-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.83rem;
}

.chat-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.status-pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf3f2;
  color: var(--brand-dark);
}

.conversation {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
}

.conversation-header {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 13px 15px;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-dark));
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.conversation-header h1,
.conversation-header .eyebrow {
  color: #fff;
}

.conversation-header .eyebrow {
  opacity: 0.72;
}

.back-button,
.header-menu-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.back-button svg,
.back-button .wc-icon,
.header-menu-button svg,
.header-menu-button .wc-icon,
.tool-button svg,
.tool-button .wc-icon,
.send-button svg,
.send-button .wc-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.back-button {
  display: none;
}

.visitor-avatar {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.18);
}

.conversation-title {
  min-width: 0;
}

.conversation-title h1,
.conversation-title p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-menu {
  position: absolute;
  top: 58px;
  right: 14px;
  z-index: 20;
  min-width: 220px;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.admin-menu button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.admin-menu button svg,
.admin-menu button .wc-icon {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.admin-menu button span:not(.wc-icon) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-menu button:hover {
  background: #f0f4f5;
}

.admin-menu button:active {
  transform: scale(0.98);
}

#adminDeleteChat {
  color: var(--danger);
}

.messages {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  background:
    linear-gradient(rgba(236, 255, 244, 0.8), rgba(236, 255, 244, 0.8)),
    var(--wallpaper) center / 260px auto repeat;
}

.date-separator {
  justify-self: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.dashboard-typing {
  padding: 0 18px 10px;
  background: rgba(236, 255, 244, 0.8);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.message {
  position: relative;
  display: grid;
  gap: 5px;
  max-width: min(78%, 620px);
  padding: 9px 11px 7px;
  border-radius: 8px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  touch-action: pan-y;
}

/* Final auth layout override: fixes screenshot overlap and mobile horizontal drift */
.auth-screen {
  width: 100%;
  max-width: 100%;
  justify-items: center;
  align-content: center;
  padding: 18px;
  overflow-x: hidden;
}

.auth-shell {
  width: min(1740px, 100%);
  max-width: 100%;
  height: auto;
  min-height: min(820px, calc(100dvh - 56px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 660px);
  gap: 30px;
  align-items: stretch;
  margin-inline: auto;
}

.auth-story {
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 22px;
  min-height: 0;
  padding: 36px;
  overflow: visible;
}

.auth-story-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.auth-story-logo {
  width: 150px;
  max-height: 56px;
}

.auth-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 26px;
  align-items: stretch;
  min-height: 0;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.075);
}

.auth-spotlight > div {
  align-content: center;
}

.auth-story h1 {
  max-width: 640px;
  font-size: clamp(2rem, 2.75vw, 3.42rem);
  line-height: 1.08;
}

.auth-story p {
  max-width: 670px;
  font-size: 1rem;
  line-height: 1.62;
}

.auth-visual-card {
  grid-template-rows: 1fr auto;
  min-height: 0;
  max-height: none;
}

.auth-visual-card img {
  width: 100%;
  height: 310px;
  min-height: 0;
  object-fit: cover;
  object-position: center top;
}

.auth-visual-card figcaption {
  padding: 14px;
  background: rgba(3, 19, 15, 0.42);
}

.auth-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-content: start;
}

.auth-product-grid article {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 4px;
  min-height: 122px;
  padding: 20px;
  align-content: center;
  overflow: hidden;
}

.auth-product-grid img {
  grid-row: 1 / 3;
  width: 46px;
  height: 46px;
  align-self: start;
}

.auth-product-grid strong {
  font-size: 1rem;
}

.auth-product-grid span {
  font-size: 0.86rem;
  line-height: 1.45;
}

.auth-news-panel {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  min-height: 140px;
  padding: 18px;
}

.auth-news-panel img {
  width: 100%;
  height: 112px;
  object-fit: contain;
}

.auth-news-panel strong {
  font-size: 1.02rem;
}

.auth-news-panel p {
  font-size: 0.88rem;
  line-height: 1.48;
}

.auth-panel {
  width: 100%;
  min-height: 0;
  align-self: stretch;
  padding: 28px;
  overflow: visible;
}

.auth-card {
  overflow-y: visible;
}

@media (max-width: 1180px) {
  .auth-screen {
    align-content: start;
    padding: 14px;
  }

  .auth-shell {
    width: min(620px, 100%);
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .auth-story {
    display: none;
  }

  .auth-panel {
    width: 100%;
    max-width: 620px;
    margin-inline: auto;
    padding: 18px;
  }

  .auth-mobile-brand,
  .auth-mobile-summary {
    display: flex;
  }

  .auth-mobile-summary {
    display: grid;
  }
}

@media (max-width: 820px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    overflow-y: auto;
  }

  .app-shell {
    width: 100%;
    min-height: 100dvh;
    padding: 0;
    justify-items: center;
    overflow-x: hidden;
  }

  .auth-screen {
    width: 100%;
    min-height: 100dvh;
    max-width: 100vw;
    align-content: center;
    justify-items: center;
    padding: max(12px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
  }

  .auth-shell {
    width: 100%;
    max-width: 440px;
    margin-inline: auto;
  }

  .auth-panel {
    width: 100%;
    max-width: 440px;
    padding: 16px;
    margin-inline: auto;
    border-radius: 8px;
  }

  .auth-shell,
  .auth-panel,
  .auth-card,
  .auth-card form,
  .auth-mobile-brand,
  .auth-mobile-summary,
  .auth-tabs,
  .input-wrap,
  .remember-row {
    min-width: 0;
    max-width: 100%;
  }

  .auth-mobile-brand {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .auth-logo {
    width: min(124px, 44vw);
    max-height: 44px;
  }

  .auth-mobile-brand span {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .auth-mobile-summary {
    width: 100%;
    margin-bottom: 10px;
  }

  .auth-tabs {
    width: 100%;
  }

  .auth-card {
    gap: 12px;
    padding-top: 14px;
  }

  .auth-heading h2 {
    font-size: 1.38rem;
  }

  .auth-heading p {
    font-size: 0.86rem;
  }

  .auth-card form {
    gap: 10px;
  }

  .input-wrap {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    min-height: 44px;
    padding-inline: 11px;
  }

  .input-wrap input {
    min-width: 0;
    min-height: 40px;
    font-size: 16px;
  }

  .password-row {
    grid-template-columns: minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .password-row .link-button {
    max-width: 152px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .remember-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    width: 100%;
    align-items: start;
  }

  .remember-row span,
  .auth-helper,
  .auth-legal-note {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 430px) {
  .auth-screen {
    align-content: start;
  }

  .auth-panel {
    padding: 14px;
  }
}

.message.visitor {
  justify-self: start;
  background: var(--visitor);
  border-top-left-radius: 2px;
}

.message.admin {
  justify-self: end;
  background: var(--admin);
  border-top-right-radius: 2px;
}

.message.deleted {
  background: #f1f2f3;
  color: #8a969f;
  font-style: italic;
}

.message-menu {
  position: absolute;
  top: 2px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-height: 20px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  color: #6d7a84;
  opacity: 0;
  transition: opacity 160ms ease, background 160ms ease, color 160ms ease;
}

.message-menu svg,
.message-menu .wc-icon,
.message-reply-hint svg,
.message-reply-hint .wc-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.message-reply-hint {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--brand-dark);
  opacity: 0.58;
  transform: translateY(-50%) scale(0.96);
  box-shadow: 0 8px 18px rgba(20, 32, 38, 0.12);
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease, color 160ms ease;
}

.message.visitor .message-reply-hint {
  right: -34px;
}

.message.admin .message-reply-hint {
  left: -34px;
}

.message:hover .message-menu,
.message:focus-within .message-menu,
.message:hover .message-reply-hint,
.message:focus-within .message-reply-hint {
  opacity: 1;
}

.message:hover .message-reply-hint,
.message:focus-within .message-reply-hint {
  transform: translateY(-50%) scale(1);
}

.message-menu:hover,
.message-reply-hint:hover {
  background: var(--brand-light);
  color: var(--brand-deep);
}

.reply-snippet,
.reply-preview {
  overflow: hidden;
  border-left: 3px solid var(--brand);
  color: #5f6b75;
  font-size: 0.78rem;
  line-height: 1.3;
}

.reply-snippet {
  padding: 5px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.55);
}

.message p {
  margin: 0;
  line-height: 1.44;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message p a {
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: underline;
  word-break: break-word;
}

.poll-card {
  display: grid;
  gap: 8px;
  min-width: min(260px, 100%);
  padding: 10px;
  border: 1px solid rgba(6, 116, 60, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.poll-card strong {
  color: var(--ink);
  line-height: 1.35;
}

.poll-card > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.poll-option {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid rgba(6, 116, 60, 0.14);
  border-radius: 8px;
  background: #fff;
}

.poll-option span,
.poll-option strong {
  position: relative;
  z-index: 1;
}

.poll-option span {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.poll-option strong {
  color: var(--brand-dark);
  font-size: 0.78rem;
}

.poll-option i {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 0;
  display: block;
  border-radius: inherit;
  background: rgba(0, 168, 80, 0.12);
}

.message-meta {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.edited-label {
  color: #7f8a90;
  font-style: normal;
}

.message-status {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: #87929a;
}

.message-status.read {
  color: #1685ff;
}

.message-status-dot {
  display: block;
  width: 5px;
  height: 9px;
  margin-left: -1px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.reaction-stack {
  justify-self: end;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 1px rgba(23, 32, 38, 0.12);
  font-size: 0.82rem;
}

.composer {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px 44px;
  gap: 8px;
  align-items: end;
  padding: 11px;
  border-top: 1px solid var(--line);
  background: rgba(246, 248, 249, 0.98);
}

.composer.locked {
  opacity: 0.62;
  pointer-events: none;
}

.reply-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  background: #fff;
}

.reply-preview button,
.attachment-preview button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e9edef;
  color: var(--ink);
}

.composer textarea[name="text"] {
  width: 100%;
  min-width: 0;
  max-height: 132px;
  min-height: 42px;
  padding: 11px 14px;
  border: 0;
  border-radius: 21px;
  background: #fff;
  color: var(--ink);
  line-height: 1.4;
  resize: none;
  outline: none;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.composer textarea[name="text"]::placeholder {
  color: #7d8a92;
}

.tool-button,
.send-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
}

.tool-button {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px var(--line);
}

.send-button {
  background: var(--brand);
  color: #fff;
}

.file-input {
  display: none;
}

.emoji-picker,
.attachment-preview {
  position: absolute;
  z-index: 30;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(23, 32, 38, 0.16);
}

.emoji-picker {
  right: 64px;
  bottom: 68px;
  display: grid;
  grid-template-columns: repeat(6, 34px);
  gap: 5px;
  padding: 10px;
}

.emoji-picker button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #f7f9fb;
  color: var(--ink);
  font-size: 1.05rem;
}

.attachment-preview {
  left: 12px;
  right: 12px;
  bottom: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.attachment-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment {
  display: grid;
  gap: 6px;
}

.message-attachment img,
.message-attachment video {
  display: block;
  max-width: 100%;
  max-height: 220px;
  border-radius: 6px;
  object-fit: cover;
}

.attachment-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.attachment-actions a,
.attachment-actions button,
.file-link {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-dark);
  font-weight: 900;
  text-decoration: none;
}

.attachment-actions a,
.attachment-actions button {
  padding: 7px;
  font-size: 0.78rem;
  text-align: center;
}

.file-link {
  padding: 9px;
}

.agent-assignment-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid rgba(0, 168, 80, 0.16);
  border-bottom: 1px solid rgba(0, 168, 80, 0.16);
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.12), rgba(255, 193, 45, 0.1)),
    #f7fffb;
  color: var(--ink);
}

.agent-assignment-panel.hidden {
  display: none;
}

.agent-assignment-panel strong,
.agent-assignment-panel span {
  display: block;
}

.agent-assignment-panel strong {
  margin-bottom: 3px;
  color: var(--brand-dark);
  font-size: 1rem;
}

.agent-assignment-panel span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.agent-assignment-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.danger-light {
  background: #fff0f0;
  color: #b42318;
}

.admin-media-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vw, 32px);
  background: rgba(0, 12, 8, 0.56);
  backdrop-filter: blur(8px);
}

.admin-media-modal.hidden {
  display: none;
}

.admin-media-modal > button {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  color: var(--brand-dark);
  font-size: 1.2rem;
  font-weight: 950;
}

#adminMediaModalBody {
  display: grid;
  place-items: center;
  width: min(760px, calc(100vw - 36px));
  max-height: calc(100dvh - 78px);
}

.admin-media-card {
  display: grid;
  gap: 12px;
  width: 100%;
  max-height: calc(100dvh - 86px);
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(0, 168, 80, 0.16);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.admin-media-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.admin-media-actions strong {
  min-width: 0;
  overflow: hidden;
  color: var(--brand-dark);
  font-size: 0.9rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-media-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
}

.admin-media-actions button .wc-icon {
  --wc-icon-size: 16px;
}

#adminMediaModalBody img,
#adminMediaModalBody video {
  max-width: 100%;
  max-height: min(66dvh, 560px);
  border-radius: 16px;
  background: #071712;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  cursor: zoom-in;
}

.admin-media-modal[data-zoom="zoomed"] #adminMediaModalBody {
  width: min(1100px, calc(100vw - 28px));
}

.admin-media-modal[data-zoom="zoomed"] #adminMediaModalBody img,
.admin-media-modal[data-zoom="zoomed"] #adminMediaModalBody video {
  max-height: calc(100dvh - 150px);
  cursor: zoom-out;
}

.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 31, 36, 0.5);
}

.confirm-dialog > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(310px, calc(100vw - 40px));
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.24);
}

.confirm-dialog p {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  font-weight: 800;
}

.confirm-dialog button {
  min-height: 40px;
  border-radius: 8px;
  background: #e9edef;
  color: var(--ink);
  font-weight: 900;
}

.confirm-dialog button[data-answer="yes"] {
  background: var(--brand);
  color: #fff;
}

@media (min-width: 821px) {
  .conversation {
    display: grid !important;
  }
}

@media (max-width: 820px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    padding: 0;
  }

  .dashboard {
    display: block;
    width: 100%;
    height: 100vh;
    height: 100dvh;
  }

  .sidebar,
  .conversation {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .conversation {
    display: none;
  }

  .dashboard.chat-open .sidebar {
    display: none;
  }

  .dashboard.chat-open .conversation {
    display: grid;
  }

  .back-button {
    display: grid;
  }

  .app-header {
    padding: max(14px, env(safe-area-inset-top)) 14px 12px;
  }

  .header-actions {
    overflow-x: auto;
  }

  .stats-row {
    padding-inline: 12px;
  }

  .chat-list {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .conversation-header {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .message {
    max-width: 86%;
  }

  .composer {
    padding-bottom: max(11px, env(safe-area-inset-bottom));
  }

  .widget-settings-grid,
  .quick-message-editor,
  .widget-settings-preview {
    grid-template-columns: 1fr;
  }

  .settings-stack {
    width: 100%;
  }

  .settings-panel {
    padding: 14px;
  }

  .asset-choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .status-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .status-actions button {
    width: 100%;
  }
}

/* Premium SaaS account gateway */
.auth-screen {
  min-height: calc(100vh - 36px);
  min-height: calc(100dvh - 36px);
  display: grid;
  align-content: center;
  gap: 14px;
  overflow-y: auto;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  gap: 18px;
  width: min(1160px, 100%);
  margin: 0 auto;
  min-height: min(720px, calc(100vh - 86px));
  min-height: min(720px, calc(100dvh - 86px));
}

.auth-story,
.auth-panel {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.auth-story {
  position: relative;
  display: grid;
  align-content: end;
  gap: 18px;
  min-height: 0;
  padding: 34px;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(255, 193, 45, 0.18), transparent 38%),
    linear-gradient(145deg, rgba(0, 168, 80, 0.26), rgba(4, 22, 18, 0.96) 54%, rgba(5, 13, 16, 0.98));
  color: #fff;
}

.auth-story::before {
  content: "";
  position: absolute;
  inset: 18px 18px auto auto;
  width: 220px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 193, 45, 0.16), transparent 62%);
  pointer-events: none;
}

.auth-story-logo {
  position: relative;
  width: min(210px, 56%);
  max-height: 86px;
  object-fit: contain;
}

.auth-version-pill {
  position: relative;
  width: max-content;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 900;
}

.auth-story h1 {
  position: relative;
  max-width: 660px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  line-height: 0.98;
  font-weight: 950;
}

.auth-story p {
  position: relative;
  max-width: 610px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1rem;
  line-height: 1.65;
}

.auth-proof-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auth-proof-grid article {
  display: grid;
  gap: 5px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-proof-grid strong {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 950;
}

.auth-proof-grid span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 800;
}

.auth-checklist {
  position: relative;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-checklist li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  font-weight: 850;
}

.auth-checklist svg {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(0, 168, 80, 0.22);
  fill: var(--gold);
}

.auth-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  min-height: 0;
  padding: 24px;
  background: rgba(255, 255, 255, 0.98);
}

.auth-mobile-brand {
  display: none;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-height: 48px;
  padding: 5px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 999px;
  background: #f2f8f5;
}

.auth-tabs button {
  min-height: 38px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 950;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.auth-tabs button.active {
  background: #fff;
  color: var(--brand-deep);
  box-shadow: 0 9px 22px rgba(20, 32, 38, 0.09);
}

.auth-card {
  display: grid;
  align-content: start;
  gap: 22px;
  min-height: 0;
  padding: 26px 6px 0;
  text-align: left;
}

.auth-logo {
  display: block;
  width: 154px;
  max-height: 58px;
  object-fit: contain;
}

.auth-heading {
  display: grid;
  gap: 7px;
  margin: 0;
}

.auth-kicker {
  width: max-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-deep);
  font-size: 0.74rem;
  font-weight: 950;
}

.auth-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  line-height: 1.08;
  font-weight: 950;
}

.auth-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.auth-card form {
  display: grid;
  gap: 12px;
  text-align: left;
}

.field-label {
  color: var(--ink);
}

.input-wrap {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(20, 32, 38, 0.045);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input-wrap:focus-within {
  border-color: rgba(0, 168, 80, 0.64);
  box-shadow: 0 0 0 4px rgba(0, 168, 80, 0.12);
}

.input-wrap svg,
.input-wrap .wc-icon {
  width: 20px;
  height: 20px;
  fill: var(--brand);
  color: var(--brand);
}

.input-wrap input {
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 1rem;
}

.password-row,
.remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.password-row .field-label {
  margin: 0;
}

.link-button {
  min-height: 36px;
  padding: 0 2px;
  background: transparent;
  color: var(--brand-dark);
  font-weight: 900;
}

.link-button.centered {
  justify-self: center;
}

.password-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #eef8f6;
  color: var(--brand-dark);
}

.remember-row {
  justify-content: flex-start;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.remember-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}

.primary-button {
  min-height: 50px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff;
  font-weight: 950;
  box-shadow: 0 16px 34px rgba(0, 168, 80, 0.24);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.primary-button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 38px rgba(0, 168, 80, 0.28);
}

.primary-button.is-busy {
  opacity: 0.72;
}

.verification-target {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(0, 168, 80, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, #f4fff8, #fffdf4);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  font-weight: 800;
  overflow: hidden;
}

.verification-target .wc-icon {
  width: 24px;
  height: 24px;
  color: var(--brand);
  fill: var(--brand);
}

.verification-target strong {
  color: var(--brand-deep);
  overflow-wrap: anywhere;
}

.verification-code-wrap input.verification-code-input {
  text-align: center;
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  font-weight: 950;
  letter-spacing: 0.18em;
  color: var(--ink);
}

.verification-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
}

.auth-helper {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7fbf8;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  font-weight: 750;
}

.auth-footer {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 1040px) {
  .auth-shell {
    grid-template-columns: 1fr;
    width: min(620px, 100%);
    min-height: auto;
  }

  .auth-story {
    min-height: auto;
    padding: 24px;
  }

  .auth-story h1 {
    font-size: clamp(1.85rem, 7vw, 3rem);
  }

  .auth-proof-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body:has(.auth-screen:not(.hidden)) {
    overflow: auto;
  }

  .app-shell:has(.auth-screen:not(.hidden)) {
    min-height: 100dvh;
    padding: 0;
  }

  .auth-screen {
    min-height: 100dvh;
    align-content: start;
    gap: 10px;
    padding: max(14px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-shell {
    width: 100%;
  }

  .auth-story {
    display: none;
  }

  .auth-panel {
    width: 100%;
    min-height: auto;
    padding: 14px;
    border-radius: 8px;
  }

  .auth-mobile-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }

  .auth-mobile-brand span {
    min-height: 30px;
    padding: 6px 9px;
    border-radius: 999px;
    background: var(--brand-light);
    color: var(--brand-deep);
    font-size: 0.72rem;
    font-weight: 950;
    white-space: nowrap;
  }

  .auth-logo {
    width: min(146px, 54vw);
    max-height: 50px;
  }

  .auth-tabs {
    min-height: 46px;
    margin-bottom: 2px;
  }

  .auth-tabs button {
    min-height: 36px;
    font-size: 0.78rem;
  }

  .auth-card {
    gap: 16px;
    padding-top: 18px;
  }

  .auth-heading h2 {
    font-size: 1.52rem;
  }

  .auth-heading p {
    font-size: 0.88rem;
  }

  .auth-card form {
    gap: 11px;
  }

  .input-wrap {
    min-height: 48px;
    border-radius: 8px;
  }

  .input-wrap input {
    min-height: 44px;
    font-size: 16px;
  }

  .password-row {
    align-items: end;
  }

  .remember-row {
    align-items: start;
    font-size: 0.82rem;
  }

  .primary-button {
    min-height: 50px;
  }

  .auth-footer {
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.78rem;
  }
}

/* Auth gateway polish pass */
.auth-screen {
  align-content: stretch;
  padding: 18px;
}

.auth-shell {
  grid-template-columns: minmax(560px, 1fr) minmax(390px, 440px);
  min-height: 0;
  height: min(760px, calc(100vh - 72px));
  height: min(760px, calc(100dvh - 72px));
}

.auth-story,
.auth-panel {
  min-height: 0;
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.22);
}

.auth-story {
  align-content: stretch;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.2), transparent 42%),
    linear-gradient(145deg, #071511 0%, #0b291f 56%, #07110f 100%);
}

.auth-story::before {
  display: none;
}

.auth-story-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-story-logo {
  width: 148px;
  max-height: 54px;
}

.auth-link-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.auth-link-row a,
.auth-legal-note a,
.legal-check a {
  color: inherit;
  font-weight: 950;
  text-decoration: none;
}

.auth-link-row a {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.74rem;
}

.auth-spotlight {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 230px);
  align-items: stretch;
  gap: 16px;
  min-height: 0;
}

.auth-spotlight > div {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
}

.auth-version-pill {
  padding: 7px 10px;
  font-size: 0.72rem;
}

.auth-story h1 {
  max-width: 540px;
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  line-height: 1.04;
}

.auth-story p {
  max-width: 540px;
  font-size: 0.92rem;
  line-height: 1.58;
}

.auth-visual-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-visual-card img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
}

.auth-visual-card figcaption {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.auth-visual-card strong,
.auth-news-panel strong {
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.32;
}

.auth-visual-card span,
.auth-news-panel p,
.auth-news-panel span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  line-height: 1.42;
}

.auth-product-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.auth-product-grid article {
  display: grid;
  gap: 7px;
  min-height: 132px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-product-grid img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.auth-product-grid strong {
  color: #fff;
  font-size: 0.86rem;
  line-height: 1.25;
}

.auth-product-grid span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.74rem;
  line-height: 1.38;
}

.auth-news-panel {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-news-panel img {
  width: 100%;
  aspect-ratio: 1.2;
  object-fit: contain;
}

.auth-news-panel div {
  display: grid;
  gap: 4px;
}

.auth-news-panel p {
  margin: 0;
}

.auth-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 18px;
  overflow: hidden;
}

.auth-mobile-summary {
  display: none;
}

.auth-card {
  gap: 15px;
  padding: 18px 4px 2px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.auth-heading {
  gap: 5px;
}

.auth-heading h2 {
  font-size: clamp(1.34rem, 3vw, 1.82rem);
  line-height: 1.14;
}

.auth-heading p {
  font-size: 0.86rem;
  line-height: 1.42;
}

.auth-card form {
  gap: 10px;
}

.input-wrap {
  min-height: 46px;
  border-radius: 8px;
}

.input-wrap input {
  min-height: 42px;
}

.primary-button {
  min-height: 46px;
}

.auth-helper,
.auth-legal-note {
  font-size: 0.76rem;
  line-height: 1.42;
}

.auth-legal-note {
  margin: -2px 0 0;
  color: var(--muted);
  text-align: center;
}

.legal-check {
  align-items: start;
  line-height: 1.42;
}

.legal-check a,
.auth-legal-note a {
  color: var(--brand-dark);
}

@media (max-width: 1040px) {
  .auth-screen {
    align-content: start;
    padding: 14px;
  }

  .auth-shell {
    width: min(760px, 100%);
    height: auto;
  }

  .auth-story {
    grid-template-rows: auto auto auto;
  }

  .auth-spotlight {
    grid-template-columns: minmax(0, 1fr) 190px;
  }

  .auth-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-product-grid article {
    min-height: 108px;
  }

  .auth-news-panel {
    display: none;
  }

  .auth-panel {
    max-height: none;
    overflow: visible;
  }

  .auth-card {
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .auth-screen {
    padding: max(10px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
  }

  .auth-panel {
    padding: 12px;
  }

  .auth-mobile-summary {
    display: grid;
    gap: 3px;
    margin-bottom: 10px;
    padding: 10px 11px;
    border: 1px solid rgba(0, 168, 80, 0.12);
    border-radius: 8px;
    background: #f7fbf8;
  }

  .auth-mobile-summary strong {
    color: var(--ink);
    font-size: 0.85rem;
  }

  .auth-mobile-summary span {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.38;
  }

  .auth-mobile-brand {
    margin-bottom: 8px;
  }

  .auth-logo {
    width: min(128px, 46vw);
    max-height: 42px;
  }

  .auth-tabs {
    min-height: 42px;
    padding: 4px;
  }

  .auth-tabs button {
    min-height: 34px;
  }

  .auth-card {
    gap: 13px;
    padding-top: 14px;
  }

  .auth-heading h2 {
    font-size: 1.34rem;
  }

  .auth-heading p {
    font-size: 0.82rem;
  }

  .auth-card form {
    gap: 9px;
  }

  .input-wrap {
    min-height: 44px;
    padding-inline: 11px;
  }

  .input-wrap input {
    min-height: 40px;
  }

  .password-toggle {
    width: 34px;
    height: 34px;
  }

  .primary-button {
    min-height: 44px;
  }

  .auth-footer {
    padding-inline: 12px;
  }
}

/* Auth layout stability and desktop composition fix */
@media (min-width: 1041px) {
  .auth-shell {
    grid-template-columns: minmax(660px, 760px) minmax(400px, 440px);
    gap: 20px;
    height: min(810px, calc(100dvh - 56px));
  }

  .auth-story {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 16px;
    padding: 24px;
  }

  .auth-story-top {
    min-height: 48px;
  }

  .auth-spotlight {
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 18px;
    min-height: 260px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
  }

  .auth-story h1 {
    max-width: 500px;
    font-size: clamp(1.68rem, 2.45vw, 2.32rem);
    line-height: 1.08;
  }

  .auth-story p {
    max-width: 500px;
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .auth-visual-card {
    min-height: 0;
  }

  .auth-visual-card img {
    height: 230px;
    min-height: 0;
    object-fit: cover;
    object-position: center 12%;
  }

  .auth-visual-card figcaption {
    padding: 10px 11px;
  }

  .auth-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-content: start;
  }

  .auth-product-grid article {
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    column-gap: 11px;
    row-gap: 4px;
    min-height: 92px;
    padding: 13px;
  }

  .auth-product-grid img {
    grid-row: 1 / 3;
    width: 38px;
    height: 38px;
    align-self: center;
  }

  .auth-product-grid strong,
  .auth-product-grid span {
    min-width: 0;
  }

  .auth-news-panel {
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 112px;
    padding: 13px;
  }
}

@media (max-width: 640px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    justify-items: center;
    overflow-x: hidden;
  }

  .auth-screen {
    width: 100%;
    max-width: 100vw;
    justify-items: center;
    overflow-x: hidden;
  }

  .auth-shell {
    width: 100%;
    max-width: 430px;
    margin-inline: auto;
    justify-self: center;
  }

  .auth-panel {
    width: 100%;
    max-width: 430px;
    margin-inline: auto;
    overflow: visible;
  }

  .auth-shell,
  .auth-panel,
  .auth-card,
  .auth-card form,
  .auth-mobile-brand,
  .auth-mobile-summary,
  .input-wrap,
  .remember-row {
    min-width: 0;
  }

  .auth-mobile-brand {
    width: 100%;
    flex-wrap: wrap;
  }

  .auth-tabs {
    width: 100%;
  }

  .input-wrap {
    grid-template-columns: 20px minmax(0, 1fr) auto;
  }

  .remember-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    width: 100%;
    align-items: start;
  }

  .remember-row span,
  .auth-helper,
  .auth-legal-note {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

.dashboard {
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 0;
  width: min(1680px, calc(100vw - 36px));
  max-width: 100%;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.app-nav {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  padding: 16px 12px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 193, 45, 0.18), transparent 34%),
    radial-gradient(circle at 100% 24%, rgba(0, 168, 80, 0.22), transparent 32%),
    linear-gradient(180deg, #06120f 0%, #09281e 54%, #061611 100%);
  color: var(--nav-ink);
  border-right: 1px solid var(--nav-line);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--nav-line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)),
    rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-brand img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 14px;
  object-fit: contain;
  background: #fff;
  padding: 5px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.nav-brand strong,
.nav-brand span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-brand strong {
  color: #fff;
  font-size: 0.96rem;
  letter-spacing: 0;
}

.nav-brand span {
  color: var(--nav-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.nav-menu {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 3px 10px 0;
  scroll-behavior: smooth;
  scrollbar-color: rgba(255, 255, 255, 0.26) transparent;
  scrollbar-width: thin;
}

.nav-menu::-webkit-scrollbar {
  width: 6px;
}

.nav-menu::-webkit-scrollbar-track {
  background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.nav-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 8px 3px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.nav-section-label::after {
  content: "";
  min-width: 18px;
  height: 1px;
  flex: 1 1 auto;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent);
}

.nav-menu button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.1;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.nav-menu button::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--gold));
  opacity: 0;
  transform: scaleY(0.45);
  transition: opacity 180ms ease, transform 180ms ease;
}

.nav-count-badge {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--danger), #ff7a83);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 10px 20px rgba(229, 72, 77, 0.24);
}

.nav-menu button.active,
.nav-menu button:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--nav-glass-strong);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-menu button:focus-visible,
.mobile-tabbar button:focus-visible,
.nav-logout:focus-visible {
  outline: 3px solid rgba(255, 193, 45, 0.7);
  outline-offset: 2px;
}

.nav-menu button.active {
  background:
    var(--nav-active),
    rgba(255, 255, 255, 0.09);
  transform: translateX(2px);
  box-shadow: var(--nav-shadow);
}

.nav-menu button.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.nav-menu svg,
.nav-menu .wc-icon {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.nav-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 6px;
  border-radius: 12px;
  background: var(--nav-glass);
  box-shadow: inset 0 0 0 1px var(--nav-line);
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.nav-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-icon .wc-icon {
  width: 20px;
  height: 20px;
  color: rgba(255, 255, 255, 0.86);
}

.nav-menu button:hover .nav-icon {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.nav-menu button.active .nav-icon {
  background:
    linear-gradient(135deg, #fff, #f2fff8);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.nav-menu button.active .nav-icon .wc-icon {
  color: var(--brand-dark);
}

.asset-choice-grid button .asset-custom-flag {
  position: absolute;
  inset: auto 3px 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 16px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #087a3f;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.dashboard[data-role="agent"] .app-nav {
  background:
    linear-gradient(180deg, rgba(0, 168, 80, 0.18), transparent 38%),
    linear-gradient(180deg, #062318 0%, #071c15 100%);
}

.dashboard[data-role="agent"] .nav-brand span {
  color: rgba(255, 255, 255, 0.72);
}

.dashboard[data-role="admin"] .app-nav {
  background:
    linear-gradient(180deg, rgba(0, 168, 80, 0.12), rgba(255, 193, 45, 0.06) 44%, transparent),
    linear-gradient(180deg, #071c15 0%, #0a2f20 58%, #071611 100%);
}

.nav-account {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--nav-line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    rgba(0, 0, 0, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-version {
  display: none;
  gap: 2px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.nav-version strong {
  color: #fff;
  font-size: 0.78rem;
}

.nav-version span {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.68rem;
  font-weight: 800;
}

.nav-account-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: #dff5ff;
  box-shadow:
    0 10px 28px rgba(0, 168, 80, 0.22),
    0 0 0 3px rgba(255, 193, 45, 0.12);
}

.nav-account-copy strong {
  font-size: 0.78rem;
}

.nav-account-copy span {
  font-size: 0.68rem;
}

.nav-logout {
  min-height: 32px;
  padding: 0 9px;
  font-size: 0.72rem;
}

.nav-account-avatar img,
.user-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-account-copy {
  display: grid;
  min-width: 0;
}

.nav-account-copy strong,
.nav-account-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-account-copy strong {
  color: #fff;
  font-size: 0.92rem;
}

.nav-account-copy span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.76rem;
  font-weight: 800;
}

.nav-logout {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px var(--nav-line);
  transition: background 180ms ease, transform 180ms ease;
}

.nav-logout:hover {
  background: rgba(229, 72, 77, 0.18);
  transform: translateY(-1px);
}

.nav-logout svg,
.nav-logout .wc-icon {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.app-main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f2f8f4;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(0, 168, 80, 0.055), rgba(255, 193, 45, 0.05)),
    rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.topbar h1 {
  margin: 0;
  font-size: 1.35rem;
}

.topbar > div:not(.topbar-actions) {
  min-width: 0;
}

.topbar > div:not(.topbar-actions) h1,
.topbar > div:not(.topbar-actions) .eyebrow {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.topbar-activity {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: min(340px, 34vw);
  min-height: 44px;
  padding: 6px 12px 6px 7px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.12), rgba(255, 193, 45, 0.12)),
    #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.2), 0 16px 34px rgba(20, 32, 38, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.topbar-activity:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.28), 0 18px 40px rgba(0, 168, 80, 0.16);
}

.topbar-activity.pulse {
  animation: activityPulse 620ms ease-out 1;
}

.topbar-activity-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 5px rgba(0, 168, 80, 0.12);
}

.topbar-activity-icon::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: #fff;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.topbar-activity-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.topbar-activity-copy strong,
.topbar-activity-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-activity-copy strong {
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 950;
}

.topbar-activity-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.plan-badge,
.nav-plan-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #ffe89a);
  color: #493100;
  font-size: 0.78rem;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(255, 193, 45, 0.22);
  white-space: nowrap;
}

.plan-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(6, 116, 60, 0.12);
}

.mobile-menu,
.icon-button,
.user-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px var(--line);
}

.mobile-menu {
  display: none;
}

.icon-button svg,
.icon-button .wc-icon,
.mobile-menu svg,
.mobile-menu .wc-icon {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.user-menu {
  position: relative;
}

.notification-center {
  position: relative;
}

.notification-button {
  position: relative;
}

.notification-badge,
.mobile-tab-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(229, 72, 77, 0.24);
}

.notification-badge {
  top: -4px;
  right: -4px;
}

.notification-panel {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 46;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(20, 32, 38, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(20, 32, 38, 0.22);
}

.notification-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notification-panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.notification-panel-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
}

.notification-empty {
  display: grid;
  gap: 3px;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.84rem;
}

.notification-empty strong {
  color: var(--ink);
}

.notification-list {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
  padding-right: 2px;
}

.notification-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 96px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.notification-item:hover,
.notification-item.unread {
  border-color: rgba(0, 168, 80, 0.36);
  box-shadow: 0 12px 26px rgba(0, 168, 80, 0.12);
}

.notification-item:active {
  transform: scale(0.98);
}

.notification-item-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-dark);
}

.notification-item.unread .notification-item-icon {
  background: var(--gold-soft);
  color: #7a5200;
}

.notification-item.priority-critical,
.notification-item.priority-urgent {
  border-color: rgba(220, 38, 38, 0.24);
}

.notification-item.priority-critical .notification-item-icon,
.notification-item.priority-urgent .notification-item-icon {
  background: #fee2e2;
  color: #991b1b;
}

.notification-item.priority-opportunity .notification-item-icon,
.notification-item.priority-awareness .notification-item-icon {
  background: rgba(255, 193, 45, 0.2);
  color: #7a5200;
}

.notification-item.priority-success .notification-item-icon {
  background: rgba(0, 168, 80, 0.12);
  color: var(--brand-dark);
}

.notification-item-icon svg,
.notification-item-icon .wc-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.notification-item-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  align-content: center;
}

.notification-item-copy strong,
.notification-item-copy span,
.notification-item-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-item-copy strong {
  color: var(--ink);
  font-size: 0.88rem;
  white-space: nowrap;
}

.notification-item-copy span {
  display: -webkit-box;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-item-copy small {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 900;
  overflow: hidden;
  white-space: nowrap;
}

.notification-item-copy small i,
.notification-item-copy small b {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-style: normal;
  line-height: 1;
}

.notification-item-copy small b {
  background: rgba(0, 168, 80, 0.1);
  color: var(--brand-dark);
}

.notification-item-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 72px;
}

.notification-item-action,
.notification-more {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 9px;
  border: 0;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 950;
  white-space: nowrap;
}

.notification-more {
  min-height: 24px;
  padding: 4px 8px;
  background: transparent;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px rgba(20, 32, 38, 0.1);
}

.notification-item.unread .notification-item-action {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
}

.notification-item.no-action .notification-item-action {
  background: var(--panel-soft);
  color: var(--muted);
}

.notification-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 88;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 35, 24, 0.5);
}

.notification-detail-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  width: min(520px, calc(100vw - 30px));
  max-height: min(620px, calc(100dvh - 40px));
  overflow-y: auto;
  padding: 20px;
  border: 1px solid rgba(20, 32, 38, 0.1);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(6, 35, 24, 0.28);
}

.notification-detail-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-dark);
}

.notification-detail-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.28rem;
  line-height: 1.2;
}

.notification-detail-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.notification-detail-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--brand-dark);
  font-weight: 950;
}

.notification-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.user-button {
  overflow: hidden;
  padding: 0;
  border: 2px solid #fff;
  background: #dff5ff;
  color: var(--brand-dark);
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(0, 168, 80, 0.16);
}

.user-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  min-width: 180px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.user-dropdown span {
  color: var(--muted);
  font-size: 0.8rem;
}

.user-dropdown button {
  min-height: 36px;
  border-radius: 8px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 900;
}

.page {
  display: none;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.page.active {
  display: block;
}

.dashboard[data-role="agent"] #teamInboxBar,
.dashboard[data-role="agent"] #teamToolsPanel,
.dashboard[data-role="agent"] #adminAssignMe,
.dashboard[data-role="agent"] #adminUnassignChat,
.dashboard[data-role="agent"] #adminMarkUrgent,
.dashboard[data-role="agent"] #adminClearChat,
.dashboard[data-role="agent"] #adminDeleteChat {
  display: none !important;
}

.toast-region {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 120;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(20, 32, 38, 0.18);
  color: var(--ink);
  pointer-events: auto;
  animation: toastIn 180ms ease-out;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-dark);
}

.toast-icon svg,
.toast-icon .wc-icon,
.toast-close svg,
.toast-close .wc-icon {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.toast-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.toast-copy strong {
  font-size: 0.92rem;
}

.toast-copy span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.toast-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f0f4f5;
  color: var(--muted);
}

.toast.error .toast-icon {
  background: #fff0f0;
  color: var(--danger);
}

.toast.info .toast-icon {
  background: var(--gold-soft);
  color: #7a5200;
}

.toast.warning .toast-icon {
  background: #fff7e2;
  color: #996800;
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 193, 45, 0.16), transparent 54%),
    linear-gradient(135deg, #ffffff, #eafff3);
  box-shadow: 0 14px 34px rgba(20, 32, 38, 0.08);
}

.hero-illustration {
  flex: 0 0 auto;
  width: min(180px, 28vw);
  max-height: 150px;
  object-fit: contain;
}

.hero-panel h2,
.placeholder-page h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.hero-panel p,
.placeholder-page p,
.feature-card p {
  color: var(--muted);
  line-height: 1.5;
}

.primary-action {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  font-weight: 950;
}

.primary-action[data-busy="true"] {
  cursor: progress;
  opacity: 0.82;
  box-shadow: 0 8px 22px rgba(0, 168, 80, 0.16);
}

.secondary-action {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: #e9f3ed;
  color: var(--brand-dark);
  font-weight: 950;
}

.settings-stack {
  display: grid;
  gap: 18px;
  width: min(920px, 100%);
}

.account-layout {
  display: grid;
  gap: 18px;
  width: min(1040px, 100%);
}

.status-center {
  display: grid;
  gap: 16px;
  width: min(1180px, 100%);
}

.status-stage-meta,
.status-library-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-stage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(0, 168, 80, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 950;
  box-shadow: 0 8px 20px rgba(0, 168, 80, 0.08);
}

.status-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 16px;
  align-items: stretch;
  padding: 20px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 193, 45, 0.16), transparent 52%),
    linear-gradient(135deg, #ffffff, #eafff3);
  box-shadow: 0 14px 34px rgba(20, 32, 38, 0.08);
}

.status-hero-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.55rem, 4vw, 2.25rem);
}

.status-hero-panel p:not(.eyebrow),
.status-ring-card span,
.status-pro-card p {
  color: var(--muted);
  line-height: 1.5;
}

.status-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.status-ring-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 9px;
  padding: 18px;
  border: 1px solid rgba(0, 168, 80, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.status-ring-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  padding: 4px;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, #f8d665, #f35369, #a935ff, #1b8dff, #00d084, #f8d665);
  box-shadow: 0 16px 38px rgba(0, 168, 80, 0.2);
}

.status-ring-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: url("../brand-assets/whachat-status-ring.png") center / 100% 100% no-repeat;
  animation: statusRingSpin 3.2s linear infinite;
}

.status-ring-preview img {
  position: relative;
  z-index: 1;
  width: 84px;
  height: 84px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #dff5ff;
  object-fit: cover;
}

.status-ring-card strong {
  color: var(--ink);
  font-size: 1rem;
}

.status-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.status-metric-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 94px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.08);
}

.status-metric-card.active {
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.1), transparent 62%),
    #fff;
}

.status-metric-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-dark);
}

.status-metric-icon svg,
.status-metric-icon .wc-icon,
.status-pro-card svg,
.status-pro-card .wc-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.status-metric-icon img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.status-metric-card strong,
.status-metric-card span {
  display: block;
}

.status-metric-card strong {
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
}

.status-metric-card div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.status-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
  gap: 16px;
  align-items: start;
}

.status-stage-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(0, 168, 80, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.08), transparent 60%),
    #fff;
  box-shadow: 0 10px 24px rgba(20, 32, 38, 0.06);
}

.status-stage-nav button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f3f7f5;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.status-stage-nav button:hover:not(:disabled),
.status-stage-nav button.active {
  background: var(--brand-light);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.18);
}

.status-stage-nav button:active:not(:disabled) {
  transform: scale(0.98);
}

.status-stage-nav button.is-disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.status-view-panel {
  display: none;
}

.status-view-panel.active {
  display: block;
}

.status-compose-panel,
.status-preview-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.08);
}

.status-side-stack,
.status-pro-stack {
  display: grid;
  gap: 12px;
}

.status-preview-panel .status-preview {
  margin: 0;
}

.status-pro-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 193, 45, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 193, 45, 0.12), transparent 60%),
    #fff;
  box-shadow: 0 10px 24px rgba(20, 32, 38, 0.06);
}

.status-pro-card > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: #7a5200;
}

.status-pro-card > span img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.status-pro-card strong {
  display: block;
  color: var(--ink);
}

.status-pro-card p {
  margin: 4px 0 0;
  font-size: 0.82rem;
}

.status-composer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: -8px;
}

.status-composer-meta small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

#statusCharCounter.near-limit {
  color: #8a5d00;
}

#statusCharCounter.at-limit,
.status-validation.error {
  color: var(--danger);
}

.status-validation.success {
  color: var(--brand-dark);
}

.status-validation.warning {
  color: #8a5d00;
}

.status-format-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(0, 168, 80, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.06), transparent 62%),
    #f8fbf9;
}

.status-format-toolbar button {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.status-format-toolbar button:hover {
  border-color: rgba(0, 168, 80, 0.28);
  background: var(--brand-light);
}

.status-format-toolbar button:active {
  transform: scale(0.97);
}

.status-format-toolbar svg,
.status-format-toolbar .wc-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.status-swatch {
  width: 40px;
  padding: 0;
  border: 3px solid #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 32, 38, 0.12), 0 5px 12px rgba(20, 32, 38, 0.08);
}

.status-swatch.green {
  background: #00a850;
}

.status-swatch.gold {
  background: #ffc12d;
}

.status-swatch.blue {
  background: #1b8dff;
}

.compact-action {
  width: max-content;
  min-height: 36px;
  margin-top: 10px;
  padding-inline: 12px;
  font-size: 0.78rem;
}

.status-library-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.08);
}

.status-list {
  display: grid;
  gap: 10px;
}

.status-list.loading {
  pointer-events: none;
}

.status-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-filter-row button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f3f6f5;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 950;
}

.status-filter-row button.active {
  background: var(--brand-light);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.18);
}

.status-empty-card,
.status-list-card,
.status-skeleton-card {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.06), transparent 58%),
    #fff;
}

.status-empty-card {
  grid-template-columns: 48px minmax(0, 1fr);
}

.status-empty-card.compact {
  margin-top: 12px;
}

.status-empty-card img {
  width: 48px;
  height: 48px;
  padding: 10px;
  border-radius: 14px;
  background: var(--brand-light);
  object-fit: contain;
}

.status-empty-card strong,
.status-empty-card span {
  display: block;
}

.status-empty-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.status-list-card {
  grid-template-columns: 60px minmax(0, 1fr) auto;
}

.status-skeleton-card {
  grid-template-columns: 60px minmax(0, 1fr);
}

.status-skeleton-card span,
.status-skeleton-card i {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef4f0 0%, #f8fbf9 45%, #eef4f0 100%);
  background-size: 220% 100%;
  animation: statusSkeleton 1.2s ease-in-out infinite;
}

.status-skeleton-card span {
  width: 60px;
  height: 60px;
  border-radius: 8px;
}

.status-skeleton-card i {
  height: 12px;
  margin: 8px 0;
}

.status-skeleton-card i:nth-child(1) {
  width: 42%;
}

.status-skeleton-card i:nth-child(2) {
  width: 78%;
}

.status-skeleton-card i:nth-child(3) {
  width: 54%;
}

.status-list-thumb {
  display: block;
  width: 60px;
  height: 60px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--brand-light);
}

.status-list-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-list-copy {
  min-width: 0;
}

.status-list-title-row,
.status-list-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.status-list-title-row strong {
  color: var(--ink);
}

.status-state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-state.scheduled {
  background: var(--gold-soft);
  color: #7a5200;
}

.status-state.expired {
  background: #eef1f3;
  color: var(--muted);
}

.status-list-copy p {
  max-height: 44px;
  margin: 4px 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.status-list-copy a {
  color: var(--brand-dark);
  font-weight: 800;
}

.status-list-date,
.status-list-stats span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.status-list-actions {
  display: grid;
  gap: 7px;
}

.status-preview-button,
.status-delete-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-preview-button {
  background: var(--brand-light);
  color: var(--brand-dark);
}

.status-delete-button {
  background: #fff0f0;
  color: var(--danger);
}

.status-admin-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 18, 15, 0.58);
}

.status-admin-preview-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 420px);
  width: min(820px, calc(100vw - 36px));
  max-height: calc(100dvh - 36px);
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.status-admin-close {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-weight: 900;
}

.status-admin-preview-card > img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 36px);
  align-self: center;
  object-fit: contain;
  object-position: center;
  background: var(--brand-light);
}

.status-admin-preview-copy {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  padding: 28px;
}

.status-admin-preview-copy h2,
.status-admin-preview-copy p {
  margin: 0;
}

.status-admin-preview-copy h2 {
  color: var(--ink);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  line-height: 1.1;
}

.status-admin-preview-copy p {
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.status-text-color.green {
  color: var(--brand-dark);
  font-weight: 850;
}

.status-text-color.gold {
  color: #9a6900;
  font-weight: 850;
}

.status-text-color.blue {
  color: #1167c9;
  font-weight: 850;
}

.status-text-font.serif {
  font-family: Georgia, "Times New Roman", serif;
}

.status-text-font.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.status-text-align {
  display: block;
}

.status-text-align.center {
  text-align: center;
}

.status-text-align.right {
  text-align: right;
}

.status-admin-preview-copy a {
  color: var(--brand-dark);
  font-weight: 900;
}

.status-admin-preview-copy small {
  color: var(--muted);
  font-weight: 800;
}

.status-admin-preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-admin-preview-stats strong {
  min-height: 34px;
  padding: 8px 11px;
  border-radius: 999px;
  background: #f4f7f6;
  color: var(--ink);
  font-size: 0.82rem;
}

.owner-console {
  display: grid;
  gap: 16px;
  width: min(1180px, 100%);
}

.owner-hero,
.owner-panel,
.owner-detail-panel {
  border: 1px solid rgba(0, 168, 80, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.08);
}

.owner-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.1), transparent 58%),
    linear-gradient(135deg, rgba(255, 193, 45, 0.12), transparent 72%),
    #fff;
}

.owner-hero h2,
.owner-hero p {
  margin: 0;
}

.owner-hero h2 {
  color: var(--ink);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.owner-hero p:not(.eyebrow) {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.owner-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.owner-hero-actions button {
  min-height: 42px;
  white-space: nowrap;
}

.owner-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.owner-metrics article {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.07), transparent 62%),
    #fff;
}

.owner-metrics span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.owner-metrics strong {
  color: var(--ink);
  font-size: 1.65rem;
  line-height: 1;
}

.owner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 380px);
  gap: 16px;
  align-items: start;
}

.owner-main-stack,
.owner-detail-panel,
.owner-detail-stack {
  display: grid;
  gap: 14px;
}

.owner-panel,
.owner-detail-panel {
  padding: 18px;
}

.owner-client-form {
  display: grid;
  gap: 14px;
}

.owner-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.owner-form-grid label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.owner-form-grid input,
.owner-form-grid select,
.owner-plan-controls select,
.owner-plan-controls input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  color: var(--ink);
  font: inherit;
  padding: 0 12px;
  outline: none;
}

.owner-form-grid input:focus,
.owner-form-grid select:focus,
.owner-plan-controls select:focus,
.owner-plan-controls input:focus {
  border-color: rgba(0, 168, 80, 0.42);
  box-shadow: 0 0 0 3px rgba(0, 168, 80, 0.12);
}

.owner-actions,
.owner-list-heading,
.owner-client-row,
.owner-detail-header,
.owner-copy-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.owner-actions {
  flex-wrap: wrap;
}

.owner-actions span,
.owner-detail-empty span,
.owner-client-meta,
.owner-detail-muted {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.45;
}

.owner-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.owner-filter-row button {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 999px;
  background: #f0f7f3;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
}

.owner-filter-row button.active,
.owner-filter-row button:hover {
  background: var(--brand-light);
  color: var(--brand-dark);
}

.owner-client-list {
  display: grid;
  gap: 10px;
}

.owner-client-row {
  width: 100%;
  min-height: 78px;
  padding: 12px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 8px;
  background: #fbfdfc;
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.owner-client-row:hover,
.owner-client-row.active {
  border-color: rgba(0, 168, 80, 0.28);
  background: #f4fbf7;
}

.owner-client-row:active {
  transform: scale(0.995);
}

.owner-client-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.owner-client-copy strong,
.owner-detail-header strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.owner-client-meta {
  overflow-wrap: anywhere;
}

.owner-client-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.owner-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef4f2;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: capitalize;
}

.owner-pill.active,
.owner-pill.connected,
.owner-pill.pro {
  background: var(--brand-light);
  color: var(--brand-dark);
}

.owner-pill.billing.paid,
.owner-pill.billing.waived {
  background: rgba(0, 168, 80, 0.12);
  color: var(--brand-dark);
}

.owner-pill.trial,
.owner-pill.waiting,
.owner-pill.billing.trialing,
.owner-pill.billing.manual_pending {
  background: var(--gold-soft);
  color: #8a5d00;
}

.owner-pill.suspended,
.owner-pill.blocked,
.owner-pill.expired,
.owner-pill.billing.overdue {
  background: rgba(229, 72, 77, 0.1);
  color: var(--danger);
}

.owner-empty,
.owner-detail-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  padding: 20px;
  border: 1px dashed rgba(0, 168, 80, 0.24);
  border-radius: 8px;
  background: #f8fbf9;
  text-align: center;
}

.owner-detail-empty img {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.08);
}

.owner-detail-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 8px;
  background: #fbfdfc;
}

.owner-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.owner-detail-grid article {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
}

.owner-detail-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.owner-detail-grid strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.owner-copy-field {
  align-items: stretch;
}

.owner-copy-field input,
.owner-copy-field textarea {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 10px;
  resize: vertical;
}

.owner-copy-field button,
.owner-mini-action {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e9f3ed;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 950;
}

.owner-plan-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
}

.owner-billing-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.45;
}

.owner-billing-card {
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.08), transparent 58%),
    #fbfdfc;
}

.owner-billing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.owner-billing-grid label,
.owner-billing-note {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 950;
}

.owner-billing-grid input,
.owner-billing-grid select,
.owner-billing-note textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0 11px;
  outline: none;
}

.owner-billing-note textarea {
  min-height: 86px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.45;
}

.owner-billing-grid input:focus,
.owner-billing-grid select:focus,
.owner-billing-note textarea:focus {
  border-color: rgba(0, 168, 80, 0.42);
  box-shadow: 0 0 0 3px rgba(0, 168, 80, 0.12);
}

.owner-billing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}

.owner-billing-footer span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.owner-plan-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.owner-plan-actions button {
  min-height: 40px;
  border-radius: 999px;
  background: #f0f7f3;
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 950;
}

.owner-onboarding-card {
  overflow: hidden;
}

.owner-onboarding-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.owner-progress-line {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding-bottom: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.owner-progress-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7px;
  border-radius: 999px;
  background: #e7f1eb;
}

.owner-progress-line i {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--gold));
}

.owner-onboarding-steps {
  display: grid;
  gap: 7px;
}

.owner-onboarding-steps p {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.owner-onboarding-steps p span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #dce7e2;
}

.owner-onboarding-steps p.complete span {
  background: var(--brand);
}

.owner-onboarding-steps p.blocked span {
  background: var(--danger);
}

.owner-onboarding-steps p strong {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.status-analytics-panel {
  display: none;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.08);
}

.status-analytics-panel.active {
  display: grid;
}

.status-analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.status-analytics-grid article {
  display: grid;
  gap: 7px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid rgba(0, 168, 80, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.08), transparent 64%),
    #f8fbf9;
}

.status-analytics-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.status-analytics-grid strong {
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1;
}

.status-center > .status-view-panel:not(.active) {
  display: none;
}

.system-info-panel {
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.08), transparent 58%),
    #fff;
}

.system-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.system-info-grid article {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.system-info-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.system-info-grid strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.account-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 16px;
  align-items: stretch;
}

.account-identity,
.trial-card {
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 193, 45, 0.16), transparent 58%),
    #fff;
  box-shadow: 0 14px 34px rgba(20, 32, 38, 0.08);
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
}

.account-avatar-xl {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 86px;
  height: 86px;
  padding: 4px;
  border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) padding-box,
    conic-gradient(var(--brand), var(--gold), var(--brand), var(--gold), var(--brand)) border-box;
  box-shadow: 0 16px 34px rgba(0, 168, 80, 0.2);
}

.account-avatar-xl img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #dff5ff;
  object-fit: cover;
}

.account-identity h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.55rem, 4vw, 2.15rem);
}

.account-business-name {
  display: inline-flex;
  width: fit-content;
  margin: 4px 0 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 950;
}

.account-identity p:not(.eyebrow),
.trial-card p,
.plan-card p,
.security-option span {
  color: var(--muted);
  line-height: 1.5;
}

.trial-card {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.9), rgba(6, 79, 44, 0.92)),
    #064f2c;
  color: #fff;
}

.trial-card span {
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.75rem;
  font-weight: 950;
}

.trial-card strong {
  font-size: 1.55rem;
  line-height: 1;
}

.trial-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.trial-card small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  font-weight: 800;
}

.account-avatar-grid img {
  object-fit: cover;
}

.account-avatar-grid button[data-account-avatar="assets/whachat-icon.png"] img {
  padding: 6px;
  object-fit: contain;
}

.security-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(0, 168, 80, 0.16);
  border-radius: 8px;
  background: #f8fbf9;
}

.security-option strong,
.security-option span {
  display: block;
}

.security-option strong {
  color: var(--ink);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.plan-card {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 190px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.06);
}

.plan-card.active {
  border-color: rgba(0, 168, 80, 0.26);
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.1), transparent 62%),
    #fff;
}

.plan-card.locked {
  background:
    linear-gradient(135deg, rgba(255, 193, 45, 0.14), transparent 64%),
    #fff;
}

.plan-card.unlocked,
.status-pro-card.unlocked,
.security-option.unlocked {
  border-color: rgba(0, 168, 80, 0.26);
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.09), transparent 64%),
    #fff;
}

.plan-card span {
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 950;
}

.plan-card.locked span {
  background: var(--gold-soft);
  color: #7a5200;
}

.plan-card strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.plan-tier-checkmark {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  object-fit: contain;
}

.pro-lock-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-self: start;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff5cf;
  color: #6d4900;
  font-size: 0.8rem;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(255, 193, 45, 0.42);
}

.pro-lock-button::before {
  content: "";
  width: 17px;
  height: 17px;
  background: url("../brand-assets/pro icon.png") center / contain no-repeat;
}

.pro-lock-button[data-plan-control="billing"] {
  background: var(--brand-light);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.24);
}

.pro-lock-button[data-plan-control="billing"]::before {
  background-image: url("../icons/credit-card.svg");
  filter: invert(43%) sepia(91%) saturate(780%) hue-rotate(91deg) brightness(84%) contrast(103%);
}

.plan-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.plan-action-row button {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
  cursor: pointer;
}

.plan-action-row button:hover,
.plan-action-row button.selected {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand-dark);
}

.saas-core-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.plan-limits-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 160px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.06);
}

.plan-limits-card > span {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 950;
}

.plan-limits-card p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(20, 32, 38, 0.08);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.plan-limits-card p:last-child {
  border-bottom: 0;
}

.plan-limits-card p strong {
  color: var(--ink);
  text-align: right;
}

.billing-card {
  background:
    linear-gradient(135deg, rgba(255, 193, 45, 0.14), transparent 62%),
    #fff;
}

.billing-card strong {
  color: var(--ink);
}

.billing-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.billing-card-heading > strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.billing-card-heading > em {
  flex: 0 0 auto;
  min-height: 25px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(112, 124, 132, 0.11);
  color: var(--muted);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  text-transform: capitalize;
}

.billing-card-heading > em[data-state="active"],
.billing-card-heading > em[data-state="trialing"],
.billing-card-heading > em[data-state="ready"] {
  background: rgba(0, 168, 80, 0.12);
  color: var(--brand-dark);
}

.billing-card-heading > em[data-state="past_due"],
.billing-card-heading > em[data-state="unpaid"],
.billing-card-heading > em[data-state="expired"] {
  background: rgba(229, 72, 77, 0.11);
  color: var(--danger);
}

.billing-subscription-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.billing-subscription-summary:empty {
  display: none;
}

.billing-subscription-summary p {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.billing-subscription-summary p span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.billing-subscription-summary p strong {
  color: var(--ink);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.billing-checkout-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.billing-checkout-actions.hidden {
  display: none;
}

.billing-checkout-actions button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 58px;
  padding: 9px;
  border: 1px solid rgba(0, 168, 80, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.billing-checkout-actions button:hover,
.billing-checkout-actions button:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 10px 22px rgba(0, 168, 80, 0.12);
  transform: translateY(-1px);
}

.billing-checkout-actions button[data-selected="true"] {
  border-color: var(--brand);
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.12), rgba(255, 255, 255, 0.98));
  box-shadow: 0 0 0 3px rgba(0, 168, 80, 0.12), 0 12px 26px rgba(0, 168, 80, 0.12);
}

.billing-checkout-actions button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.billing-checkout-actions button > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.billing-checkout-actions button strong {
  font-size: 0.76rem;
  line-height: 1.2;
}

.billing-checkout-actions button small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.25;
}

.billing-action-icon {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  background: var(--brand-light);
}

.billing-action-icon img {
  width: 17px;
  height: 17px;
  filter: invert(43%) sepia(91%) saturate(780%) hue-rotate(91deg) brightness(84%) contrast(103%);
}

.billing-manage-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
  cursor: pointer;
}

.billing-manage-button.hidden {
  display: none;
}

.billing-manage-button img {
  width: 17px;
  height: 17px;
  filter: brightness(0) invert(1);
}

.billing-secure-note {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.45;
}

@media (max-width: 520px) {
  .billing-checkout-actions,
  .billing-subscription-summary {
    grid-template-columns: 1fr;
  }

  .billing-checkout-actions button {
    min-height: 52px;
  }
}

.settings-panel {
  display: grid;
  gap: 16px;
  width: 100%;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.08);
}

.settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.settings-heading .eyebrow {
  margin: 0 0 4px;
}

.settings-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.settings-stage-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
}

.notification-settings-form {
  display: grid;
  gap: 14px;
}

.notification-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.notification-toggle-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  min-height: 82px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  color: var(--ink);
}

.notification-toggle-card input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--brand);
}

.notification-toggle-card span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.notification-toggle-card strong {
  color: var(--ink);
  font-size: 0.93rem;
}

.notification-toggle-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.notification-toggle-card em {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(0, 168, 80, 0.1);
  color: #02783d;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  overflow-wrap: anywhere;
}

.notification-toggle-card em[data-push-state="ready"] {
  background: rgba(0, 168, 80, 0.14);
  color: #006f39;
}

.notification-toggle-card em[data-push-state="waiting"],
.notification-toggle-card em[data-push-state="syncing"] {
  background: rgba(245, 181, 38, 0.16);
  color: #9a6400;
}

.notification-toggle-card em[data-push-state="blocked"] {
  background: rgba(219, 39, 39, 0.1);
  color: #b42318;
}

.notification-permission-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 168, 80, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.1), transparent 62%),
    #fff;
}

.notification-permission-card > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.notification-permission-card span,
.notification-actions span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.notification-permission-card strong {
  color: var(--brand-dark);
  font-size: 1.02rem;
}

.notification-permission-card strong[data-permission="denied"],
.notification-permission-card strong[data-permission="unsupported"] {
  color: var(--danger);
}

.notification-permission-card small {
  color: var(--muted);
  line-height: 1.35;
}

.push-bridge-health-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 168, 80, 0.14);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(0, 168, 80, 0.1), rgba(245, 181, 38, 0.08) 58%, rgba(255, 255, 255, 0.98)),
    #fff;
  box-shadow: 0 14px 36px rgba(10, 70, 43, 0.07);
}

.push-health-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.push-health-heading > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.push-health-heading span,
.push-bridge-metrics span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.push-health-heading strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.push-bridge-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.push-bridge-metrics article {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 12px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.push-bridge-metrics strong {
  color: var(--brand-dark);
  font-size: 1.18rem;
  font-weight: 950;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.push-bridge-metrics small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.3;
}

.push-bridge-metrics article[data-push-metric-state="warning"] strong {
  color: var(--danger);
}

.push-bridge-metrics article[data-push-metric-state="ok"] strong,
.push-bridge-metrics article[data-push-metric-state="sent"] strong {
  color: #02783d;
}

.push-permission-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.push-permission-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  min-width: 0;
}

.push-permission-steps li span {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  background: #d7dee0;
  box-shadow: 0 0 0 4px rgba(215, 222, 224, 0.24);
}

.push-permission-steps li b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.push-permission-steps li[data-step-state="ready"] {
  color: #02783d;
}

.push-permission-steps li[data-step-state="ready"] span {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 168, 80, 0.14);
}

.push-permission-steps li[data-step-state="blocked"] {
  color: var(--danger);
}

.push-permission-steps li[data-step-state="blocked"] span {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(219, 39, 39, 0.12);
}

.push-recovery-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.push-recovery-guide > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.push-recovery-guide span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.push-recovery-guide strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 950;
}

.push-recovery-guide p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.45;
}

.push-recovery-guide[data-recovery-state="ready"] {
  border-color: rgba(0, 168, 80, 0.18);
  background: rgba(235, 255, 244, 0.78);
}

.push-recovery-guide[data-recovery-state="ready"] strong {
  color: #02783d;
}

.push-recovery-guide[data-recovery-state="warning"] {
  border-color: rgba(245, 181, 38, 0.24);
  background: rgba(255, 249, 230, 0.82);
}

.push-recovery-guide[data-recovery-state="warning"] strong {
  color: #9a6400;
}

.push-recovery-guide[data-recovery-state="blocked"] {
  border-color: rgba(219, 39, 39, 0.16);
  background: rgba(255, 241, 241, 0.82);
}

.push-recovery-guide[data-recovery-state="blocked"] strong {
  color: var(--danger);
}

.push-recovery-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.notification-actions {
  align-items: center;
}

.status-form {
  display: grid;
  gap: 14px;
}

.widget-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wide-field {
  grid-column: 1 / -1;
}

.color-field {
  align-content: start;
}

.color-field input[type="color"] {
  min-height: 44px;
  padding: 4px;
  border-radius: 8px;
}

.widget-studio-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.studio-choice-group {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.studio-choice-group > span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.studio-choice-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.studio-choice-row button {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.studio-choice-row .studio-mascot-choice {
  position: relative;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 5px 34px 5px 8px;
  text-align: left;
}

.studio-mascot-choice img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.studio-mascot-choice span {
  color: inherit;
  font-size: 0.78rem;
  line-height: 1.15;
}

.studio-mascot-choice small {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 3px 5px;
  border-radius: 999px;
  background: #08251a;
  color: #fff;
  font-size: 0.55rem;
  line-height: 1;
}

.studio-choice-row button:hover,
.studio-choice-row button.selected {
  border-color: var(--brand);
  color: var(--brand-dark);
  box-shadow: 0 10px 22px rgba(0, 168, 80, 0.13);
}

.asset-select-section {
  display: grid;
  gap: 14px;
}

.asset-select-section > div {
  display: grid;
  gap: 9px;
}

.asset-select-section > div > span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.asset-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 10px;
}

.avatar-choice-grid {
  max-height: min(360px, 48vh);
  overflow-y: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

.asset-choice-grid button {
  position: relative;
  contain: layout paint;
  display: grid;
  place-items: center;
  min-height: 74px;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #f8fbf9;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.asset-pro-flag {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(6, 18, 15, 0.88);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 950;
  line-height: 1;
}

.asset-pro-flag img {
  width: 11px !important;
  height: 11px !important;
  border-radius: 0 !important;
  background: transparent !important;
  object-fit: contain;
}

.premium-asset-choice {
  border-color: rgba(255, 193, 45, 0.32) !important;
  background:
    linear-gradient(135deg, rgba(255, 193, 45, 0.16), transparent 62%),
    #fff !important;
}

.asset-choice-grid button:hover,
.asset-choice-grid button.selected {
  border-color: var(--brand);
  box-shadow: 0 12px 28px rgba(0, 168, 80, 0.16);
  transform: translateY(-1px);
}

.asset-choice-grid button.selected::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 7px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--brand);
}

.avatar-choice-grid img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #dff5ff;
  object-fit: cover;
}

.badge-choice-grid button {
  gap: 5px;
  min-height: 68px;
}

.badge-choice-grid img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.badge-choice-grid strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.status-form textarea,
.status-form select {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.status-form textarea:focus,
.status-form select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 168, 80, 0.16);
}

.status-form textarea {
  resize: vertical;
}

.quick-message-editor {
  display: grid;
  grid-template-columns: minmax(110px, 0.6fr) minmax(0, 1.4fr);
  gap: 10px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.quick-message-editor > span {
  grid-column: 1 / -1;
  color: var(--brand-dark);
  font-weight: 950;
}

.widget-settings-preview {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(0, 168, 80, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 193, 45, 0.14), transparent 58%),
    var(--brand-light);
}

.widget-settings-preview[data-position="bottom-left"] {
  direction: rtl;
}

.widget-settings-preview[data-position="bottom-left"] > * {
  direction: ltr;
}

.widget-settings-preview[data-launcher-style="bubble"] .preview-launcher {
  width: 86px;
  border-radius: 999px;
}

.widget-settings-preview[data-launcher-style="icon"] .preview-launcher {
  background: transparent;
  box-shadow: 0 10px 24px rgba(0, 168, 80, 0.18);
}

.widget-settings-preview[data-launcher-style="mascot"] {
  grid-template-columns: 104px minmax(0, 1fr);
}

.widget-settings-preview[data-launcher-style="mascot"] .preview-launcher {
  width: 96px;
  height: 88px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.widget-settings-preview[data-launcher-style="mascot"] .preview-launcher img:not(.preview-badge) {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
}

.widget-settings-preview[data-launcher-style="mascot"] .preview-badge {
  display: none;
}

.widget-settings-preview[data-launcher-style="mascot"][data-launcher-fallback="true"] .preview-launcher {
  width: 60px;
  height: 60px;
  padding: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0, 168, 80, 0.2);
}

.widget-settings-preview[data-launcher-style="mascot"][data-launcher-fallback="true"] .preview-launcher img:not(.preview-badge) {
  border-radius: 50%;
  object-fit: cover;
}

.widget-settings-preview[data-ring-style="pulse"] .preview-launcher {
  animation: studioPulse 1.8s ease-out infinite;
}

.widget-settings-preview[data-ring-style="solid"] .preview-launcher {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, var(--gold), var(--brand)) border-box;
}

.preview-launcher {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  padding: 3px;
  border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) padding-box,
    conic-gradient(var(--brand), var(--gold), var(--brand), var(--gold), var(--brand)) border-box;
  box-shadow: 0 12px 28px rgba(0, 168, 80, 0.2);
}

.preview-launcher img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #dff5ff;
  object-fit: cover;
}

.preview-launcher .preview-badge {
  position: absolute;
  right: -2px;
  bottom: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  object-fit: contain;
}

.widget-settings-preview strong,
.widget-settings-preview span {
  display: block;
}

.widget-settings-preview strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.widget-settings-preview span {
  color: var(--muted);
  font-weight: 800;
}

#widgetPreviewWelcome {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.4;
}

#widgetPreviewMeta {
  display: block;
  margin-top: 6px;
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 950;
}

.install-dashboard-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: stretch;
  padding: 18px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.12), transparent 52%),
    #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.08);
}

.install-dashboard-copy {
  display: grid;
  align-content: center;
  gap: 10px;
}

.install-dashboard-copy h2,
.install-dashboard-copy p {
  margin: 0;
}

.install-dashboard-copy h2 {
  color: var(--ink);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.install-dashboard-copy p:not(.eyebrow),
.install-dashboard-preview p,
.install-hint {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.install-dashboard-next,
.install-dashboard-last {
  margin: 0;
  font-size: 0.9rem;
}

.install-dashboard-next {
  color: var(--ink) !important;
}

.install-dashboard-last {
  color: var(--brand-dark) !important;
}

.install-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.install-dashboard-preview {
  display: grid;
  gap: 12px;
  align-content: center;
  padding: 14px;
  border: 1px solid rgba(0, 168, 80, 0.16);
  border-radius: 8px;
  background: #f8fbf9;
}

.install-kit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 16px;
  align-items: stretch;
}

.install-version-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7dc, #e8f8ef);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.18);
}

.install-code-column,
.install-preview-column {
  display: grid;
  gap: 12px;
  align-content: start;
}

.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 8px;
  align-items: center;
}

.copy-field button {
  display: grid;
  place-items: center;
  width: 46px;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-dark);
  color: #fff;
  cursor: pointer;
}

.copy-field svg,
.copy-field .wc-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

#installEmbedCode {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  word-break: break-all;
}

.mini-widget-preview {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 94px;
  padding: 14px;
  border: 1px solid rgba(0, 168, 80, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 193, 45, 0.14), transparent 58%),
    #fff;
}

.mini-widget-preview.large {
  min-height: 118px;
}

.mini-widget-preview strong,
.mini-widget-preview span {
  display: block;
}

.mini-widget-preview strong {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 950;
}

.mini-widget-preview span:not(.preview-launcher) {
  color: var(--muted);
  font-weight: 850;
}

.install-readiness-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(0, 168, 80, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.1), transparent 56%),
    #fff;
}

.install-readiness-card strong,
.install-readiness-card span,
.install-readiness-card small {
  display: block;
}

.install-readiness-card strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.install-readiness-card span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.45;
}

.install-readiness-card small {
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.35;
}

.install-domain-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.install-status-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.install-status-summary article {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.install-status-summary strong {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 950;
}

.install-status-summary small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
}

.install-policy-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.install-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8f8ef;
  color: #08743c;
  font-size: 0.75rem;
  font-weight: 950;
  line-height: 1;
}

.install-status-pill.connected {
  background: #e8f8ef;
  color: #08743c;
}

.install-status-pill.waiting {
  background: #fff7dc;
  color: #8a6100;
}

.install-status-pill.not_detected {
  background: #eef2f7;
  color: #526171;
}

.install-status-pill.blocked {
  background: #ffe9e6;
  color: #b42318;
}

.install-domain-list {
  display: grid;
  gap: 10px;
}

.install-domain-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.install-domain-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.install-domain-row strong,
.install-domain-row span,
.install-domain-row small {
  display: block;
}

.install-domain-row strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.install-domain-row span:not(.install-status-pill) {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.install-domain-row small {
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
}

.install-domain-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.install-domain-actions button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.install-domain-actions button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.install-empty {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px dashed rgba(0, 168, 80, 0.28);
  border-radius: 8px;
  background: var(--brand-light);
}

.install-empty strong {
  color: var(--ink);
}

.install-empty span {
  color: var(--muted);
  font-weight: 800;
}

.install-guide-shell {
  display: grid;
  gap: 10px;
}

.install-guide-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(0, 168, 80, 0.16);
  border-radius: 8px;
  background: #f8fbf9;
}

.install-guide-tabs button {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 950;
  cursor: pointer;
}

.install-guide-tabs button.active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 10px 22px rgba(20, 32, 38, 0.08), inset 0 0 0 1px rgba(0, 168, 80, 0.12);
}

.install-guide-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(0, 168, 80, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 193, 45, 0.12), transparent 58%),
    #fff;
}

.install-guide-card strong {
  color: var(--brand-dark);
  font-size: 1rem;
  font-weight: 950;
}

.install-guide-card p,
.install-guide-card li,
.install-guide-card small {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.45;
}

.install-guide-card p,
.install-guide-card ol {
  margin: 0;
}

.install-guide-card ol {
  display: grid;
  gap: 6px;
  padding-left: 20px;
}

.install-guide-card small {
  color: var(--brand-dark);
}

.install-instructions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.install-instructions article {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(0, 168, 80, 0.16);
  border-radius: 8px;
  background: #fff;
}

.install-instructions strong {
  color: var(--brand-dark);
  font-weight: 950;
}

.install-instructions p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.45;
}

#widgetPreviewQuickMessages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

#widgetPreviewQuickMessages button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.16);
}

.status-preview {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(0, 168, 80, 0.16);
  border-radius: 8px;
  background: var(--brand-light);
}

.status-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  border-radius: 8px;
  object-fit: contain;
  object-position: center;
  background: #eef8f3;
}

.status-preview strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.status-preview span,
.status-preview small {
  color: var(--muted);
  line-height: 1.45;
}

#statusPreviewText {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.status-preview a {
  color: var(--brand-dark);
  font-weight: 900;
  text-decoration: underline;
  word-break: break-word;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-actions button {
  flex: 0 1 auto;
}

.onboarding-panel {
  display: grid;
  gap: 16px;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(0, 168, 80, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.08), transparent 58%),
    linear-gradient(135deg, rgba(255, 193, 45, 0.12), transparent 78%),
    #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.08);
}

.onboarding-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
  gap: 16px;
  align-items: center;
}

.onboarding-heading h2,
.onboarding-heading p {
  margin: 0;
}

.onboarding-heading h2 {
  color: var(--ink);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.onboarding-heading p:not(.eyebrow) {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
}

.onboarding-progress-card {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.onboarding-progress-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.onboarding-progress-card strong {
  color: var(--brand-dark);
  font-size: 1.35rem;
  line-height: 1;
}

.onboarding-progress-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7f1eb;
}

.onboarding-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  transition: width 220ms ease;
}

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.onboarding-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 136px;
  padding: 14px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 8px;
  background: #fbfdfc;
}

.onboarding-step-mark {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: #dce7e2;
  box-shadow: inset 0 0 0 5px #f7fbf9;
}

.onboarding-step.complete .onboarding-step-mark {
  background: var(--brand);
}

.onboarding-step.blocked .onboarding-step-mark {
  background: var(--danger);
}

.onboarding-step strong {
  display: block;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.3;
}

.onboarding-step p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.42;
}

.onboarding-step button {
  grid-column: 1 / -1;
  min-height: 36px;
  margin-top: 4px;
  border-radius: 999px;
  background: #e9f3ed;
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 950;
}

.client-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 14px;
  margin: 14px 0;
}

.client-daily-card,
.client-quick-actions,
.client-section-hero,
.visitor-list-panel,
.visitor-detail-panel {
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.08);
}

.client-card-heading,
.visitor-panel-heading,
.visitor-detail-header,
.client-section-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.client-card-heading h2,
.client-section-hero h2,
.visitor-panel-heading h3,
.visitor-detail-header h3 {
  margin: 0;
  color: var(--ink);
}

.client-daily-card p,
.client-section-hero p,
.visitor-latest-message p,
.visitor-detail-empty span {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.client-plan-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e8f8ef, #fff7dc);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.14);
}

.client-health-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.client-health-list span {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(0, 168, 80, 0.14);
  border-radius: 8px;
  background: #f8fbf9;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.client-health-list strong {
  color: var(--ink);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.client-action-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.client-action-grid button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 96px;
  padding: 12px 8px;
  border: 1px solid rgba(0, 168, 80, 0.14);
  border-radius: 8px;
  background: #f8fbf9;
  color: var(--ink);
  font-weight: 950;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.client-action-grid button:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 168, 80, 0.32);
  box-shadow: 0 12px 24px rgba(20, 32, 38, 0.08);
}

.client-action-grid img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.client-action-grid span {
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: center;
}

.client-section-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.visitor-workspace {
  display: grid;
  gap: 14px;
}

.client-section-hero {
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.1), transparent 58%),
    #fff;
}

.visitor-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.visitor-summary-grid article {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.08);
}

.visitor-summary-grid span {
  color: var(--brand-dark);
  font-size: 1.45rem;
  font-weight: 950;
  line-height: 1;
}

.visitor-summary-grid strong,
.visitor-panel-heading span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.visitor-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
  gap: 14px;
  align-items: start;
}

.visitor-list-panel,
.visitor-detail-panel {
  display: grid;
  gap: 12px;
}

.visitor-list {
  display: grid;
  gap: 8px;
}

.visitor-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.visitor-item.active {
  border-color: rgba(0, 168, 80, 0.34);
  background: #fff;
  box-shadow: 0 10px 22px rgba(20, 32, 38, 0.08);
}

.visitor-item-avatar,
.visitor-detail-avatar {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--gold));
  color: #fff;
  font-weight: 950;
}

.visitor-item-avatar {
  width: 44px;
  height: 44px;
}

.visitor-detail-avatar {
  width: 58px;
  height: 58px;
  font-size: 1.15rem;
}

.visitor-item-avatar.online::after,
.visitor-detail-avatar.online::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 168, 80, 0.14);
}

.visitor-live-pill {
  justify-self: end;
  align-self: start;
  padding: 8px 10px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 999px;
  background: #f4f7f5;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
}

.visitor-live-pill.online {
  border-color: rgba(0, 168, 80, 0.18);
  background: rgba(0, 168, 80, 0.1);
  color: var(--brand-dark);
}

.visitor-item-copy,
.visitor-item-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.visitor-item-copy strong,
.visitor-item-meta strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.visitor-item-copy small,
.visitor-item-meta small,
.visitor-detail-header span,
.visitor-latest-message span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.visitor-item-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visitor-item-meta {
  justify-items: end;
  text-align: right;
}

.visitor-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.visitor-intel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.visitor-detail-grid article,
.visitor-latest-message,
.visitor-page-card,
.visitor-timeline-panel {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(0, 168, 80, 0.14);
  border-radius: 8px;
  background: #f8fbf9;
}

.visitor-detail-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.visitor-detail-grid strong,
.visitor-page-card strong,
.visitor-page-card a {
  color: var(--ink);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.visitor-page-card a {
  text-decoration: none;
}

.visitor-page-card a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.visitor-page-card span,
.visitor-timeline-panel .visitor-panel-heading span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.visitor-latest-message p {
  margin: 0;
  overflow-wrap: anywhere;
}

.visitor-timeline {
  display: grid;
  gap: 10px;
}

.visitor-timeline-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(20, 32, 38, 0.07);
  border-radius: 8px;
  background: #fff;
}

.visitor-timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(255, 193, 45, 0.18);
}

.visitor-timeline-item div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.visitor-timeline-item strong {
  color: var(--brand-dark);
}

.visitor-timeline-item a {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 850;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.visitor-timeline-item a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.visitor-timeline-item small,
.visitor-timeline-empty span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.visitor-timeline-empty {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px dashed rgba(0, 168, 80, 0.22);
  border-radius: 8px;
  background: #fff;
}

.visitor-timeline-empty strong {
  color: var(--brand-dark);
}

.visitor-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.visitor-detail-empty,
.visitor-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px;
  border: 1px dashed rgba(0, 168, 80, 0.24);
  border-radius: 8px;
  background: #f8fbf9;
  text-align: center;
}

.visitor-detail-empty img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.visitor-empty {
  justify-items: start;
  text-align: left;
}

.premium-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.feature-card,
.placeholder-page {
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.08);
}

.feature-card strong {
  color: var(--brand-dark);
}

.chat-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
}

.chat-workspace .sidebar,
.chat-workspace .conversation {
  min-width: 0;
  min-height: 0;
  height: auto;
  border-color: rgba(20, 32, 38, 0.08);
  box-shadow: 0 14px 34px rgba(20, 32, 38, 0.08);
}

#chats-page.page.active {
  display: grid;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 14px;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes activityPulse {
  0% {
    transform: scale(0.98);
  }

  55% {
    transform: scale(1.025);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes statusRingSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes statusSkeleton {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

@keyframes studioPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 193, 45, 0.34), 0 12px 28px rgba(0, 168, 80, 0.2);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(255, 193, 45, 0), 0 12px 28px rgba(0, 168, 80, 0.2);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 193, 45, 0), 0 12px 28px rgba(0, 168, 80, 0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-ring-preview::before,
  .status-skeleton-card span,
  .status-skeleton-card i,
  .topbar-activity.pulse,
  .widget-settings-preview[data-ring-style="pulse"] .preview-launcher {
    animation: none;
  }
}

@media (max-width: 980px) {
  .dashboard {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .nav-brand div,
  .nav-menu button,
  .nav-account-copy,
  .nav-version,
  .nav-logout {
    font-size: 0;
  }

  .nav-menu button {
    justify-content: center;
  }

  .nav-section-label {
    height: 1px;
    margin: 12px 14px 6px;
    font-size: 0;
  }

  .nav-section-label::after {
    min-width: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.14);
  }

  .nav-count-badge {
    position: absolute;
    top: 3px;
    right: 5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border: 2px solid rgba(6, 18, 15, 0.96);
    font-size: 0.58rem;
  }

  .nav-menu svg,
  .nav-menu .wc-icon {
    width: 23px;
    height: 23px;
  }

  .nav-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .nav-account {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 10px 8px;
  }

  .nav-version {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .nav-logout {
    width: 42px;
    min-height: 42px;
    padding: 0;
  }

  .premium-grid {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .client-dashboard-grid,
  .visitor-layout {
    grid-template-columns: 1fr;
  }

  .client-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .client-health-list,
  .visitor-summary-grid,
  .visitor-intel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .onboarding-heading {
    grid-template-columns: 1fr;
  }

  .onboarding-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .owner-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .owner-layout {
    grid-template-columns: 1fr;
  }

  .owner-detail-panel {
    order: -1;
  }

  .install-dashboard-panel,
  .install-kit-grid,
  .widget-studio-options {
    grid-template-columns: 1fr;
  }

  .plan-grid,
  .saas-core-grid,
  .account-hero,
  .status-hero-panel,
  .status-workspace {
    grid-template-columns: 1fr;
  }

  .status-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .dashboard {
    display: block;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }

  .app-nav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: 270px;
    padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.24);
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .dashboard.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(6, 35, 24, 0.48);
  }

  .dashboard.nav-open .app-nav {
    transform: translateX(0);
  }

  .mobile-menu {
    display: grid;
  }

  .nav-brand div,
  .nav-menu button,
  .nav-account-copy,
  .nav-version,
  .nav-logout {
    font-size: inherit;
  }

  .nav-menu button {
    justify-content: flex-start;
  }

  .nav-section-label {
    height: auto;
    margin: 12px 8px 3px;
    font-size: 0.62rem;
  }

  .nav-section-label::after {
    min-width: 18px;
    width: auto;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent);
  }

  .nav-count-badge {
    position: static;
    margin-left: auto;
    min-width: 24px;
    height: 22px;
    border: 0;
    font-size: 0.68rem;
  }

  .nav-account {
    grid-template-columns: 42px minmax(0, 1fr);
    justify-items: stretch;
  }

  .nav-version {
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
  }

  .nav-logout {
    width: 100%;
    padding: 0 12px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    padding-inline: 12px;
  }

  .topbar h1 {
    font-size: 1.12rem;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-activity {
    position: fixed;
    top: calc(78px + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    z-index: 58;
    width: auto;
    min-height: 48px;
    border-radius: 16px;
  }

  .topbar-actions #socketStatus {
    display: none;
  }

  .plan-badge {
    min-width: 34px;
    max-width: 72px;
    min-height: 32px;
    padding-inline: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.68rem;
  }

  .plan-badge::before {
    width: 7px;
    height: 7px;
    box-shadow: none;
  }

  .notification-panel {
    position: fixed;
    top: 72px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100vh - 168px);
    max-height: calc(100dvh - 168px);
    overflow: hidden;
  }

  .notification-list {
    max-height: calc(100vh - 290px);
    max-height: calc(100dvh - 290px);
  }

  .app-main {
    height: 100vh;
    height: 100dvh;
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .page.active {
    height: auto;
    min-height: 0;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .page {
    padding: 12px;
  }

  .toast-region {
    top: auto;
    right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
  }

  .mobile-tabbar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 52;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    grid-template-columns: none;
    justify-content: center;
    justify-items: stretch;
    gap: 5px;
    min-height: 70px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    background:
      radial-gradient(circle at 18% 0%, rgba(255, 193, 45, 0.2), transparent 34%),
      linear-gradient(135deg, rgba(0, 168, 80, 0.2), rgba(255, 193, 45, 0.08)),
      rgba(6, 18, 15, 0.97);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
  }

  .mobile-tabbar button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 54px;
    padding: 5px 4px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.64rem;
    font-weight: 900;
    line-height: 1.05;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
  }

  .mobile-tabbar button.active {
    border-color: rgba(255, 255, 255, 0.14);
    background:
      linear-gradient(135deg, rgba(0, 168, 80, 0.2), rgba(255, 193, 45, 0.12)),
      rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }

  .mobile-tabbar img,
  .mobile-tabbar .wc-icon {
    display: block;
    width: 19px;
    height: 19px;
    object-fit: contain;
    color: currentColor;
  }

  .mobile-tabbar span:not(.wc-icon) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-tabbar .mobile-brand-icon {
    display: none;
  }

  .dashboard:not([data-role="agent"]) .mobile-tabbar {
    min-height: 68px;
    padding: 7px 8px;
  }

  .dashboard:not([data-role="agent"]) .mobile-tabbar button {
    flex-direction: column;
    gap: 3px;
    min-height: 54px;
    padding: 5px 3px;
  }

  .dashboard:not([data-role="agent"]) .mobile-tabbar .mobile-brand-icon {
    display: block;
    width: 24px;
    height: 24px;
    padding: 2px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.22));
  }

  .dashboard:not([data-role="agent"]) .mobile-tabbar button.active .mobile-brand-icon {
    background: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
  }

  .dashboard:not([data-role="agent"]) .mobile-tabbar .wc-icon {
    display: none;
  }

  .dashboard:not([data-role="agent"]) .mobile-tabbar span:not(.wc-icon) {
    font-size: 0.58rem;
    letter-spacing: 0;
    text-align: center;
  }

  .dashboard[data-role="agent"] .mobile-tabbar {
    grid-template-columns: none;
    max-width: min(330px, calc(100vw - 20px));
    margin-inline: auto;
  }

  .mobile-tab-badge {
    top: 4px;
    right: 7px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-color: rgba(6, 18, 15, 0.96);
    font-size: 0.58rem;
  }

  .hero-panel {
    display: grid;
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline: 0;
  }

  .client-dashboard-grid {
    margin-block: 12px;
  }

  .client-daily-card,
  .client-quick-actions,
  .client-section-hero,
  .visitor-list-panel,
  .visitor-detail-panel {
    padding: 14px;
  }

  .notification-toggle-grid,
  .notification-permission-card,
  .push-health-heading {
    grid-template-columns: 1fr;
  }

  .push-recovery-guide {
    grid-template-columns: 1fr;
  }

  .push-recovery-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .push-recovery-actions .ghost-button {
    width: 100%;
  }

  .push-bridge-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .push-permission-steps {
    grid-template-columns: 1fr;
  }

  .push-permission-steps li {
    border-radius: 14px;
  }

  .push-bridge-metrics article {
    min-height: 76px;
    padding: 10px;
  }

  .notification-toggle-card {
    min-height: 74px;
  }

  .notification-actions {
    gap: 8px;
    align-items: stretch;
  }

  .client-card-heading,
  .visitor-panel-heading,
  .visitor-detail-header,
  .client-section-hero {
    display: grid;
    justify-content: stretch;
  }

  .client-action-grid,
  .client-health-list,
  .visitor-summary-grid,
  .visitor-detail-grid,
  .visitor-intel-grid {
    grid-template-columns: 1fr;
  }

  .client-action-grid button {
    grid-template-columns: 34px minmax(0, 1fr);
    justify-items: start;
    min-height: 62px;
    text-align: left;
  }

  .client-action-grid span {
    text-align: left;
  }

  .visitor-detail-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .visitor-detail-actions button {
    width: 100%;
  }

  .onboarding-panel {
    padding: 14px;
  }

  .onboarding-steps {
    grid-template-columns: 1fr;
  }

  .onboarding-step {
    min-height: 0;
  }

  .account-identity {
    display: grid;
    justify-items: start;
  }

  .status-hero-panel,
  .status-compose-panel,
  .status-preview-panel {
    padding: 14px;
  }

  .owner-hero,
  .owner-panel,
  .owner-detail-panel {
    padding: 14px;
  }

  .owner-hero,
  .owner-form-grid,
  .owner-list-heading,
  .owner-client-row,
  .owner-detail-header,
  .owner-copy-field,
  .owner-plan-controls,
  .owner-plan-actions,
  .owner-billing-grid,
  .owner-billing-footer,
  .owner-billing-summary {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .owner-filter-row {
    justify-content: flex-start;
  }

  .owner-client-badges {
    justify-content: flex-start;
  }

  .owner-copy-field button,
  .owner-plan-actions button,
  .owner-billing-footer .owner-mini-action,
  .owner-hero .primary-action {
    width: 100%;
  }

  .status-stage-nav {
    flex-wrap: nowrap;
    margin-inline: -2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .status-stage-nav::-webkit-scrollbar {
    display: none;
  }

  .status-stage-nav button {
    flex: 0 0 auto;
  }

  .status-hero-actions,
  .status-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .status-hero-actions button,
  .status-actions button {
    width: 100%;
  }

  .status-pro-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .status-pro-card .pro-lock-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .status-list-card {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .status-list-thumb {
    width: 54px;
    height: 54px;
  }

  .status-delete-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .status-list-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .status-list-actions button {
    width: 100%;
  }

  .status-library-heading {
    display: grid;
    justify-items: stretch;
  }

  .status-library-heading .compact-action {
    width: 100%;
  }

  .status-analytics-grid {
    grid-template-columns: 1fr;
  }

  .status-admin-modal {
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    align-items: start;
  }

  .status-admin-preview-card {
    grid-template-columns: 1fr;
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .status-admin-preview-card > img {
    min-height: 0;
    max-height: min(52dvh, 420px);
  }

  .status-admin-preview-copy {
    max-height: none;
    padding: 18px;
  }

  .system-info-grid {
    grid-template-columns: 1fr;
  }

  .install-domain-form,
  .install-domain-row,
  .install-guide-tabs,
  .install-instructions {
    grid-template-columns: 1fr;
  }

  .settings-heading {
    display: grid;
    justify-content: stretch;
  }

  .install-version-pill {
    width: max-content;
  }

  .install-status-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .install-domain-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }

  .install-domain-actions button {
    width: 100%;
  }

  .install-guide-tabs {
    display: grid;
  }

  .install-guide-tabs button {
    width: 100%;
  }

  .widget-settings-grid,
  .quick-message-editor {
    grid-template-columns: 1fr;
  }

  .account-avatar-xl {
    width: 78px;
    height: 78px;
  }

  .security-option {
    grid-template-columns: 1fr;
  }

  .hero-illustration {
    width: min(148px, 44vw);
  }

  .chat-workspace {
    display: block;
    height: 100%;
    min-height: 0;
  }

  .chat-workspace .sidebar,
  .chat-workspace .conversation {
    height: 100%;
    min-height: 0;
  }

  .chat-workspace .conversation {
    display: none;
  }

  .dashboard.chat-open .chat-workspace .sidebar {
    display: none;
  }

  .dashboard.chat-open .chat-workspace .conversation {
    display: grid;
  }

  #chats-page.page.active {
    height: calc(100vh - 150px);
    height: calc(100dvh - 150px);
    padding: 10px;
    padding-bottom: 10px;
  }
}

@media (max-width: 460px) {
  .notification-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .notification-item-action {
    grid-column: 2;
    justify-self: start;
  }

  .visitor-item {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .visitor-item-meta {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }

  .owner-metrics,
  .owner-detail-grid {
    grid-template-columns: 1fr;
  }

  .status-metric-grid {
    grid-template-columns: 1fr;
  }

  .status-metric-card {
    min-height: 82px;
  }

  .status-ring-card {
    padding: 14px;
  }
}

/* Auth v0.23.3 final stability pass: desktop composition + tablet/mobile centering */
body:has(.auth-screen:not(.hidden)) {
  overflow-x: hidden;
  overflow-y: auto;
}

.app-shell:has(.auth-screen:not(.hidden)) {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  place-items: center;
  overflow-x: hidden;
}

.auth-screen {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 18px;
  justify-items: center;
  align-content: center;
  overflow-x: hidden;
}

.auth-shell {
  width: min(1740px, calc(100vw - 36px));
  max-width: 100%;
  min-height: 0;
  height: auto;
  margin-inline: auto;
}

@media (min-width: 1181px) {
  .auth-shell {
    grid-template-columns: minmax(700px, 1.08fr) minmax(420px, 660px);
    gap: 30px;
    align-items: start;
  }

  .auth-story {
    grid-template-rows: auto auto auto auto;
    gap: 22px;
    min-height: 0;
    padding: 36px;
    align-content: start;
    overflow: visible;
  }

  .auth-story-top {
    min-height: 56px;
  }

  .auth-spotlight {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 312px);
    gap: 26px;
    min-height: 0;
    padding: 24px;
  }

  .auth-spotlight > div {
    min-width: 0;
    align-content: center;
  }

  .auth-story h1 {
    max-width: 660px;
    font-size: clamp(2rem, 2.65vw, 3.2rem);
    line-height: 1.08;
  }

  .auth-story p {
    max-width: 680px;
    font-size: 1rem;
    line-height: 1.62;
  }

  .auth-visual-card {
    grid-template-rows: auto auto;
    min-height: 0;
    max-height: none;
  }

  .auth-visual-card img {
    width: 100%;
    height: clamp(260px, 26vw, 340px);
    min-height: 0;
    object-fit: cover;
    object-position: center top;
  }

  .auth-visual-card figcaption {
    padding: 14px;
  }

  .auth-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-content: start;
  }

  .auth-product-grid article {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: auto auto;
    min-height: 118px;
    padding: 18px;
    column-gap: 14px;
    row-gap: 4px;
    align-content: center;
    overflow: hidden;
  }

  .auth-product-grid img {
    grid-row: 1 / 3;
    width: 48px;
    height: 48px;
    align-self: center;
  }

  .auth-product-grid strong,
  .auth-product-grid span,
  .auth-news-panel strong,
  .auth-news-panel p {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .auth-product-grid strong {
    font-size: 1rem;
  }

  .auth-product-grid span {
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .auth-news-panel {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
    min-height: 140px;
    padding: 18px;
    align-items: center;
  }

  .auth-news-panel img {
    width: 100%;
    height: 112px;
    object-fit: contain;
  }

  .auth-news-panel strong {
    font-size: 1.02rem;
    line-height: 1.36;
  }

  .auth-news-panel p {
    font-size: 0.88rem;
    line-height: 1.48;
  }

  .auth-panel {
    width: 100%;
    min-height: 0;
    align-self: start;
    padding: 28px;
    overflow: visible;
  }

  .auth-card {
    overflow: visible;
  }
}

@media (max-width: 1180px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body:has(.auth-screen:not(.hidden)) {
    overflow-y: auto;
  }

  .app-shell:has(.auth-screen:not(.hidden)) {
    width: 100%;
    justify-items: center;
  }

  .auth-screen {
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(12px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
    align-content: center;
    justify-items: center;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .auth-shell {
    width: 100%;
    max-width: 460px;
    margin-inline: auto;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .auth-story {
    display: none;
  }

  .auth-panel {
    width: 100%;
    max-width: 460px;
    min-height: 0;
    margin-inline: auto;
    padding: 16px;
    border-radius: 8px;
    overflow: visible;
  }

  .auth-mobile-brand {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .auth-mobile-summary {
    display: grid;
    width: 100%;
  }

  .auth-shell,
  .auth-panel,
  .auth-card,
  .auth-card form,
  .auth-mobile-brand,
  .auth-mobile-summary,
  .auth-tabs,
  .input-wrap,
  .remember-row,
  .password-row {
    min-width: 0;
    max-width: 100%;
  }

  .auth-logo {
    width: min(122px, 42vw);
    max-height: 42px;
    object-fit: contain;
  }

  .auth-mobile-brand span {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .auth-card {
    gap: 12px;
    overflow: visible;
  }

  .auth-card form {
    gap: 10px;
  }

  .auth-heading h2 {
    font-size: clamp(1.36rem, 7vw, 1.9rem);
    line-height: 1.14;
  }

  .auth-heading p {
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .auth-tabs {
    width: 100%;
    min-height: 46px;
    padding: 4px;
  }

  .auth-tabs button,
  .primary-button {
    min-height: 44px;
  }

  .field-label {
    gap: 7px;
  }

  .input-wrap {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    min-height: 46px;
    padding-inline: 11px;
  }

  .input-wrap input {
    min-width: 0;
    min-height: 42px;
    font-size: 16px;
  }

  .password-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    overflow: hidden;
  }

  .password-row .link-button {
    max-width: 154px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .remember-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    width: 100%;
    align-items: start;
  }

  .remember-row span,
  .auth-helper,
  .auth-legal-note {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 430px) {
  .auth-screen {
    align-content: start;
  }

  .auth-panel {
    padding: 14px;
  }

  .auth-mobile-summary {
    padding: 10px;
  }

  .password-row .link-button {
    max-width: 132px;
  }
}

/* Final Premium Polish v0.31.6 */
textarea,
select {
  font: inherit;
}

.team-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 0 14px 12px;
}

.team-tabs button {
  min-height: 32px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f8fbf9;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(20, 32, 38, 0.08);
}

.team-tabs button.active {
  background: linear-gradient(135deg, rgba(0, 168, 80, 0.13), rgba(255, 193, 45, 0.13));
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.2), 0 8px 18px rgba(0, 168, 80, 0.1);
}

.chat-team-line {
  display: block;
  margin-top: 3px;
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-tag-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.chat-tag-line b,
.chat-tag-chip,
.chat-tag-picker button {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color, var(--brand)) 12%, #fff);
  color: color-mix(in srgb, var(--tag-color, var(--brand)) 78%, #142026);
  font-size: 0.68rem;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tag-color, var(--brand)) 28%, transparent);
}

.status-pill.important,
.chat-item.priority-important .status-pill {
  background: var(--gold-soft);
  color: #7a5200;
}

.status-pill.urgent,
.chat-item.priority-urgent .status-pill {
  background: #ffe8e8;
  color: #bc1f2d;
}

.chat-item.priority-urgent {
  box-shadow: inset 4px 0 0 #e5484d, inset 0 0 0 1px rgba(229, 72, 77, 0.2), 0 14px 28px rgba(229, 72, 77, 0.09);
}

.conversation {
  position: relative;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  overflow: hidden;
}

.team-inbox-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(20, 32, 38, 0.08);
  background: linear-gradient(135deg, #ffffff, rgba(245, 250, 247, 0.92));
}

.team-routing-section label {
  gap: 5px;
  color: var(--brand-dark);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.team-routing-section select,
.team-form select,
.team-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid rgba(20, 32, 38, 0.1);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.team-routing-section select:focus,
.team-form select:focus,
.team-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 168, 80, 0.14);
}

.team-save-state {
  align-self: center;
  min-width: 88px;
  padding: 9px 10px;
  border-radius: 999px;
  background: #eef5f2;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-align: center;
  white-space: nowrap;
}

.team-tools-toggle {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 12px 6px 6px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(20, 32, 38, 0.08), 0 8px 22px rgba(20, 32, 38, 0.06);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.team-tools-toggle > svg,
.team-tools-toggle > .wc-icon {
  display: grid;
  place-self: center;
  width: 28px;
  height: 28px;
  padding: 7px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  box-sizing: content-box;
}

.team-tools-toggle span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.team-tools-toggle strong,
.team-tools-toggle small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-tools-toggle strong {
  color: var(--brand-deep);
  font-size: 0.82rem;
  font-weight: 950;
}

.team-tools-toggle small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.team-tools-panel-header button svg,
.team-tools-panel-header button .wc-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.team-tools-toggle svg,
.team-tools-toggle .wc-icon {
  fill: currentColor;
}

.team-tools-toggle:hover,
.team-tools-toggle.active {
  background: linear-gradient(135deg, #ffffff, var(--brand-light));
  color: var(--brand-deep);
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.18), 0 12px 28px rgba(0, 168, 80, 0.12);
}

.team-tools-toggle:active {
  transform: translateY(1px) scale(0.99);
}

.team-save-state[data-state="saved"] {
  background: var(--brand-light);
  color: var(--brand-dark);
}

.team-save-state[data-state="saving"] {
  background: var(--gold-soft);
  color: #7a5200;
}

.team-save-state[data-state="error"] {
  background: #ffe8e8;
  color: #bc1f2d;
}

.team-save-state[data-state="locked"] {
  background: #eef5f2;
  color: #477464;
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.12);
}

.team-tools-panel {
  position: absolute;
  right: 14px;
  bottom: 76px;
  z-index: 18;
  display: grid;
  width: min(760px, calc(100% - 28px));
  max-height: min(360px, calc(100% - 150px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(20, 32, 38, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(6, 35, 24, 0.22);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  animation: teamToolsIn 180ms ease both;
}

.team-tools-panel-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 10px;
  border-bottom: 1px solid rgba(20, 32, 38, 0.08);
}

.team-tools-panel-header div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.team-tools-panel-header strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 950;
}

.team-tools-panel-header span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.35;
}

.team-tools-panel-header button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #eef5f2;
  color: var(--brand-dark);
  transition: background 180ms ease, color 180ms ease;
}

.team-tools-panel-header button:hover {
  background: var(--brand-light);
  color: var(--brand-deep);
}

.team-tools-panel section {
  display: grid;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  padding: 11px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbf9);
}

.team-tools-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 950;
}

.team-tools-heading span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.68rem;
}

.canned-reply-list,
.internal-note-list,
.chat-tag-picker,
.reply-manager-list,
.tag-manager-list {
  display: grid;
  gap: 7px;
  max-height: clamp(118px, 18vh, 170px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.canned-reply-list button,
.chat-tag-picker button,
.internal-note-card,
.team-empty-card {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 8px;
  background: #f8fbf9;
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(20, 32, 38, 0.08);
}

.canned-reply-list button:hover {
  background: var(--brand-light);
  color: var(--brand-dark);
}

.chat-tag-picker {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chat-tag-picker button {
  justify-content: center;
  min-height: 38px;
  background: #fff;
  color: var(--muted);
}

.chat-tag-picker button.selected {
  background: color-mix(in srgb, var(--tag-color, var(--brand)) 16%, #fff);
  color: color-mix(in srgb, var(--tag-color, var(--brand)) 80%, #142026);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tag-color, var(--brand)) 44%, transparent);
}

.canned-reply-list strong em {
  display: inline-flex;
  margin-left: 5px;
  color: var(--muted);
  font-size: 0.62rem;
  font-style: normal;
  text-transform: uppercase;
}

.canned-reply-list span,
.internal-note-card p,
.team-empty-card span {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.internal-note-card small {
  color: var(--brand-dark);
  font-size: 0.68rem;
  font-weight: 900;
}

.internal-note-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.internal-note-form input {
  min-height: 40px;
  border-radius: 8px;
}

.internal-note-form button,
.team-form button,
.department-card button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff;
  font-weight: 950;
}

@keyframes teamToolsIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.team-workspace {
  display: grid;
  gap: 16px;
}

.team-summary-grid,
.team-layout {
  display: grid;
  gap: 14px;
}

.team-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.team-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: start;
}

.team-member-list,
.department-list {
  display: grid;
  gap: 10px;
}

.team-member-card,
.department-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 32, 38, 0.08), 0 12px 26px rgba(20, 32, 38, 0.06);
}

.agent-management-card {
  grid-template-columns: 44px minmax(220px, 0.7fr) minmax(280px, 1fr);
  align-items: start;
}

.agent-management-card.inactive {
  opacity: 0.72;
}

.agent-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.agent-edit-grid label {
  gap: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.agent-edit-grid input,
.agent-edit-grid select,
.ticket-manager-grid select,
.ticket-manager-grid textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(20, 32, 38, 0.1);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.agent-active-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--brand-dark);
}

.agent-active-toggle input {
  width: 18px;
  min-height: 18px;
}

.agent-edit-grid .secondary-action {
  min-height: 36px;
  align-self: end;
}

.support-ticket-panel,
.agent-ticket-panel {
  overflow: hidden;
}

.dashboard[data-role="agent"] #account-page .agent-ticket-panel {
  order: -1;
  border-color: rgba(0, 168, 80, 0.22);
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.08), rgba(255, 193, 45, 0.08)),
    #fff;
  box-shadow: 0 18px 42px rgba(0, 64, 46, 0.12);
}

.dashboard[data-role="agent"] #account-page .agent-ticket-panel .settings-heading {
  align-items: center;
}

.support-ticket-list {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 2px;
  scroll-behavior: smooth;
}

.support-ticket-list.compact {
  max-height: 310px;
  margin-top: 12px;
}

.support-ticket-empty,
.support-ticket-card {
  display: grid;
  gap: 8px;
  padding: 13px;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 32, 38, 0.08), 0 12px 26px rgba(20, 32, 38, 0.06);
}

.support-ticket-card {
  border-left: 4px solid var(--brand);
}

.support-ticket-card.status-in_progress {
  border-left-color: #1685ff;
}

.support-ticket-card.status-resolved {
  border-left-color: var(--gold);
}

.support-ticket-card.status-closed {
  border-left-color: var(--muted);
}

.support-ticket-card.manager {
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 1fr);
  gap: 14px;
  align-items: start;
}

.support-ticket-card span,
.support-ticket-empty span {
  color: var(--brand-dark);
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.support-ticket-card strong,
.support-ticket-empty strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.support-ticket-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.support-ticket-card small,
.support-ticket-card em {
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 850;
}

.support-ticket-card em {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--brand-light);
  color: var(--brand-dark);
}

.ticket-manager-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ticket-response-field {
  grid-column: 1 / -1;
}

.ticket-manager-grid textarea {
  min-height: 72px;
  resize: vertical;
}

.ticket-center {
  display: grid;
  gap: 14px;
  min-width: 0;
}

#tickets-page .ticket-hero {
  align-items: center;
}

#tickets-page .ticket-hero h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

#tickets-page .ticket-hero p {
  max-width: 760px;
  font-size: 0.9rem;
  line-height: 1.55;
}

.ticket-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ticket-summary-grid article {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 253, 250, 0.95));
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.06);
}

.ticket-summary-grid span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ticket-summary-grid strong {
  color: var(--brand-deep);
  font-size: 1.65rem;
  line-height: 1;
}

.ticket-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.ticket-create-form {
  display: grid;
  gap: 10px;
}

.ticket-create-form textarea {
  min-height: 104px;
  resize: vertical;
}

.ticket-board-heading {
  align-items: start;
  gap: 12px;
}

.ticket-filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.ticket-filter-row button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(0, 168, 80, 0.14);
  border-radius: 999px;
  background: var(--surface-green);
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 950;
}

.ticket-filter-row button.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px rgba(0, 168, 80, 0.18);
}

.ticket-priority {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-green);
  color: var(--brand-dark);
  font-size: 0.62rem;
  font-weight: 850;
  line-height: 1;
  vertical-align: middle;
}

.ticket-priority.priority-important {
  background: rgba(245, 158, 11, 0.14);
  color: #9a5b00;
}

.ticket-priority.priority-urgent {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

[data-theme="dark"] .ticket-priority.priority-important {
  color: #ffd36a;
}

[data-theme="dark"] .ticket-priority.priority-urgent {
  color: #ff9b9b;
}

.ticket-board {
  display: grid;
  gap: 12px;
  max-height: min(680px, calc(100dvh - 330px));
  overflow-y: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
}

.ticket-empty-state,
.ticket-flow-card {
  min-width: 0;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 14px 32px rgba(20, 32, 38, 0.06);
}

.ticket-empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 230px;
  padding: 22px;
  text-align: center;
}

.ticket-empty-state .wc-icon {
  --wc-icon-size: 32px;
  color: var(--brand);
}

.ticket-empty-state strong {
  color: var(--ink);
  font-size: 1rem;
}

.ticket-empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.ticket-flow-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-left: 4px solid var(--brand);
}

.ticket-flow-card.status-in_progress {
  border-left-color: #1685ff;
}

.ticket-flow-card.status-resolved {
  border-left-color: var(--gold);
}

.ticket-flow-card.status-closed {
  border-left-color: #6b7280;
}

.ticket-flow-head,
.ticket-meta-row,
.ticket-quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ticket-flow-head {
  justify-content: space-between;
}

.ticket-flow-head > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ticket-category,
.ticket-meta-row span {
  color: var(--brand-dark);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.ticket-flow-head strong {
  color: var(--ink);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.ticket-flow-head small {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 850;
}

.ticket-status-pill {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface-green);
  color: var(--brand-deep);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.ticket-status-pill.status-closed {
  background: #eef2f7;
  color: #475569;
}

.ticket-status-pill.status-resolved {
  background: var(--surface-gold);
  color: #7a5200;
}

.ticket-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ticket-meta-row {
  flex-wrap: wrap;
}

.ticket-meta-row span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(0, 168, 80, 0.08);
  text-transform: none;
}

.ticket-attachment-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  min-width: 0;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid rgba(0, 168, 80, 0.14);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-deep);
  font-size: 0.72rem;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-attachment-button .wc-icon {
  --wc-icon-size: 15px;
  flex: 0 0 auto;
}

.ticket-attachment-button:hover,
.ticket-attachment-button:focus-visible {
  border-color: rgba(0, 168, 80, 0.28);
  background: var(--brand-light);
}

.ticket-timeline {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(20, 32, 38, 0.07);
  border-radius: var(--radius-md);
  background: rgba(247, 253, 250, 0.72);
}

.ticket-timeline-reply {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 32, 38, 0.06);
}

.ticket-timeline-reply.initial {
  background: linear-gradient(135deg, rgba(0, 168, 80, 0.08), rgba(255, 193, 45, 0.08)), #fff;
}

.ticket-timeline-reply.internal {
  background: #fff8df;
}

.ticket-timeline-reply.empty {
  color: var(--muted);
  text-align: center;
}

.ticket-timeline-reply div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
}

.ticket-timeline-reply strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.ticket-timeline-reply span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.ticket-timeline-reply p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ticket-action-zone {
  min-width: 0;
}

.ticket-agent-reply {
  display: grid;
  gap: 8px;
}

.ticket-agent-reply textarea,
.ticket-manager-grid textarea {
  width: 100%;
  border-radius: 12px;
  font-size: 0.84rem;
}

.ticket-quick-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ticket-quick-actions button,
.ticket-manager-grid > button,
#ticketRefreshButton,
#tickets-page .primary-action,
#tickets-page .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.team-avatar,
.department-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  font-weight: 950;
}

.department-icon {
  background: color-mix(in srgb, var(--department-color, var(--brand)) 14%, #fff);
  color: var(--department-color, var(--brand));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--department-color, var(--brand)) 28%, transparent);
}

.department-icon svg,
.department-icon .wc-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.team-member-copy,
.department-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.team-member-copy strong,
.department-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member-copy small,
.department-copy small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.team-member-copy em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
  line-height: 1.35;
}

.team-role-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef5f2;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.team-role-select {
  gap: 5px;
  min-width: 112px;
}

.team-role-select span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
}

.team-role-select select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(20, 32, 38, 0.1);
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 950;
}

.team-role-pill.owner,
.team-role-pill.admin {
  background: var(--brand-light);
  color: var(--brand-dark);
}

.team-role-pill.agent {
  background: var(--gold-soft);
  color: #7a5200;
}

.department-card.inactive {
  opacity: 0.62;
}

.team-form {
  display: grid;
  gap: 12px;
}

.team-form textarea {
  min-height: 110px;
  resize: vertical;
}

.reply-manager-list,
.tag-manager-list {
  max-height: 220px;
  margin-top: 10px;
}

.reply-manager-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 32, 38, 0.08);
}

.reply-manager-card div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.reply-manager-card strong,
.reply-manager-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-manager-card small {
  color: var(--brand-dark);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.reply-manager-card span {
  color: var(--muted);
  font-size: 0.76rem;
}

.manager-action-row {
  display: inline-flex;
  gap: 6px;
}

.manager-action-row button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef5f2;
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 950;
}

.manager-action-row .danger-action {
  background: #ffe8e8;
  color: #bc1f2d;
}

.tag-manager-list {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
}

.tag-form {
  grid-template-columns: minmax(0, 1fr) 90px;
}

.tag-form button {
  grid-column: 1 / -1;
}

.team-empty-card.compact {
  padding: 9px;
}

@media (max-width: 980px) {
  .team-summary-grid,
  .team-layout {
    grid-template-columns: 1fr;
  }

  .team-tools-panel {
    left: 12px;
    right: 12px;
    bottom: 74px;
    width: auto;
    grid-template-columns: 1fr;
    max-height: min(460px, calc(100% - 146px));
    overflow-y: auto;
  }

  .team-save-state {
    grid-column: auto;
    justify-self: start;
  }
}

@media (max-width: 820px) {
  .team-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline: 12px;
  }

  .team-inbox-bar,
  .team-tools-panel {
    grid-template-columns: 1fr;
  }

  .team-inbox-bar {
    gap: 8px;
    padding: 7px 10px;
  }

  .team-tools-toggle,
  .team-save-state {
    width: 100%;
  }

  .team-tools-toggle {
    min-height: 42px;
  }

  .team-save-state {
    justify-self: stretch;
  }

  .team-tools-panel {
    left: 10px;
    right: 10px;
    bottom: 76px;
    max-height: min(46vh, 360px);
    padding: 12px;
    overflow-y: auto;
    border-radius: 12px 12px 8px 8px;
    box-shadow: 0 18px 52px rgba(6, 35, 24, 0.28);
  }

  .team-tools-panel-header {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -12px -12px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.98);
  }

  .team-member-card,
  .department-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .agent-management-card,
  .support-ticket-card.manager {
    grid-template-columns: 1fr;
  }

  .agent-edit-grid,
  .ticket-manager-grid {
    grid-template-columns: 1fr;
  }

  .team-role-pill,
  .team-role-select,
  .department-card button {
    grid-column: 2;
    justify-self: start;
  }

  .reply-manager-card {
    grid-template-columns: 1fr;
  }

  .manager-action-row {
    justify-content: flex-start;
  }

  .internal-note-form {
    grid-template-columns: 1fr;
  }
}

/* WhaChat PWA dashboard balance pass */
:where(.dashboard, .dashboard *, .notification-panel, .notification-panel *, .toast, .toast *) {
  box-sizing: border-box;
}

:where(
  .page,
  .topbar,
  .topbar-title,
  .topbar-actions,
  .topbar-activity,
  .notification-center,
  .notification-panel,
  .notification-panel-head,
  .notification-list,
  .notification-item-copy,
  .toast,
  .toast-copy,
  .team-workspace,
  .team-summary-grid,
  .team-layout,
  .team-inbox-bar,
  .team-tools-panel,
  .team-tools-panel section,
  .team-tools-panel-header,
  .department-card,
  .team-member-card,
  .agent-management-card,
  .support-ticket-card,
  .settings-panel,
  .client-dashboard-grid,
  .client-action-grid,
  .visitor-summary-grid,
  .visitor-detail-grid
) {
  min-width: 0;
}

.page,
.page.active {
  overflow-x: hidden;
}

.dashboard :where(input, select, textarea, button) {
  max-width: 100%;
}

.dashboard :where(
  .notification-item,
  .notification-empty,
  .toast,
  .team-tools-panel section,
  .department-card,
  .team-member-card,
  .agent-management-card,
  .support-ticket-card,
  .settings-panel,
  .client-dashboard-card,
  .client-stat-card,
  .visitor-profile-card,
  .visitor-detail-card
) {
  overflow-wrap: anywhere;
}

.topbar-activity {
  width: min(310px, 31vw);
  min-height: 42px;
  padding: 7px 10px;
  border-radius: 14px;
}

.topbar-activity-icon {
  width: 30px;
  height: 30px;
}

.topbar-activity-copy strong {
  font-size: 0.76rem;
  line-height: 1.18;
}

.topbar-activity-copy small {
  font-size: 0.68rem;
  line-height: 1.2;
}

.notification-panel {
  width: min(390px, calc(100vw - 24px));
  padding: 12px;
  border-radius: 16px;
  overflow: hidden;
}

.notification-panel-head {
  gap: 10px;
  min-width: 0;
}

.notification-panel-head h2 {
  font-size: 0.98rem;
  line-height: 1.2;
}

.notification-panel-actions {
  gap: 6px;
}

.notification-panel-actions button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.72rem;
  line-height: 1.15;
  white-space: nowrap;
}

.notification-list {
  gap: 8px;
  max-height: min(360px, calc(100dvh - 210px));
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.notification-item {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  height: auto;
  min-height: 82px;
  padding: 10px;
  border-radius: 14px;
}

.notification-item-icon {
  width: 36px;
  height: 36px;
}

.notification-item-icon svg,
.notification-item-icon .wc-icon {
  width: 18px;
  height: 18px;
}

.notification-item-copy {
  align-content: start;
  gap: 3px;
  padding-top: 1px;
}

.notification-item-copy strong {
  display: -webkit-box;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.22;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-item-copy span {
  font-size: 0.75rem;
  line-height: 1.3;
}

.notification-item-copy small {
  gap: 4px;
  font-size: 0.66rem;
  line-height: 1.15;
  white-space: normal;
}

.notification-item-copy small i,
.notification-item-copy small b {
  max-width: 100%;
  min-height: 18px;
  padding: 2px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-item-actions {
  align-self: stretch;
  align-content: center;
  gap: 5px;
  min-width: 54px;
}

.notification-item-action,
.notification-more {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 0.66rem;
  line-height: 1.1;
}

.toast-region {
  max-width: min(390px, calc(100vw - 24px));
}

.toast {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  max-width: 100%;
  padding: 10px;
  border-radius: 14px;
}

.toast-copy {
  min-width: 0;
}

.toast-copy strong {
  font-size: 0.82rem;
  line-height: 1.22;
}

.toast-copy span {
  display: -webkit-box;
  font-size: 0.74rem;
  line-height: 1.32;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.team-tools-panel {
  width: min(820px, calc(100% - 28px));
  max-height: min(420px, calc(100% - 132px));
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
}

.team-tools-panel-header {
  gap: 10px;
}

.team-tools-panel-header strong {
  font-size: 0.86rem;
  line-height: 1.2;
}

.team-tools-panel-header span {
  display: -webkit-box;
  font-size: 0.7rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.team-tools-panel section {
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  overflow: hidden;
}

.team-tools-heading {
  align-items: flex-start;
  font-size: 0.76rem;
  line-height: 1.2;
}

.team-tools-heading span {
  flex: 0 0 auto;
  font-size: 0.62rem;
}

.canned-reply-list,
.internal-note-list,
.chat-tag-picker,
.reply-manager-list,
.tag-manager-list {
  max-height: clamp(96px, 16vh, 158px);
}

.canned-reply-list button,
.chat-tag-picker button,
.internal-note-card,
.team-empty-card {
  padding: 9px;
  border-radius: 12px;
}

.canned-reply-list span,
.internal-note-card p,
.team-empty-card span {
  font-size: 0.72rem;
  line-height: 1.36;
}

.team-form,
.team-form label,
.internal-note-form,
.manager-action-row,
.department-card,
.team-member-card {
  min-width: 0;
}

.team-form input,
.team-form select,
.team-form textarea,
.internal-note-form input {
  min-width: 0;
  width: 100%;
}

.department-card {
  align-items: start;
}

.department-card button,
.manager-action-row button,
.team-form button {
  white-space: nowrap;
}

@media (max-width: 980px) {
  .topbar-activity {
    width: min(280px, 30vw);
  }

  .team-tools-panel {
    left: 12px;
    right: 12px;
    width: auto;
    max-height: min(50vh, 430px);
  }
}

@media (max-width: 820px) {
  .topbar {
    min-height: 62px;
    padding: 8px 10px;
  }

  .topbar h1 {
    font-size: clamp(1rem, 4vw, 1.12rem);
    line-height: 1.15;
  }

  .topbar-actions {
    gap: 5px;
  }

  .topbar-activity {
    top: calc(66px + env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    min-height: 42px;
    width: auto;
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 7px 9px;
    border-radius: 14px;
  }

  .notification-panel {
    top: calc(62px + env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100dvh - 142px);
    padding: 10px;
    border-radius: 18px;
  }

  .notification-panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .notification-panel-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .notification-panel-actions button {
    width: 100%;
    min-height: 34px;
    padding-inline: 8px;
  }

  .notification-list {
    max-height: calc(100dvh - 260px);
    padding-right: 2px;
  }

  .notification-item {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    padding: 9px;
  }

  .notification-item-icon {
    width: 32px;
    height: 32px;
  }

  .notification-item-actions {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    align-self: auto;
    justify-content: flex-start;
    justify-items: start;
    min-width: 0;
  }

  .toast-region {
    right: 10px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
  }

  .toast {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    padding: 9px;
  }

  .team-tabs {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0 10px 10px;
    scrollbar-width: none;
  }

  .team-tabs::-webkit-scrollbar {
    display: none;
  }

  .team-tabs button {
    flex: 0 0 auto;
    max-width: 56vw;
    min-height: 38px;
    padding-inline: 12px;
    white-space: nowrap;
  }

  .team-inbox-bar {
    gap: 8px;
    padding: 8px 10px;
  }

  .team-tools-panel {
    left: 8px;
    right: 8px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(52dvh, 420px);
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    padding: 10px;
    border-radius: 18px;
  }

  .team-tools-panel-header {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -10px -10px 0;
    padding: 10px;
    border-radius: 18px 18px 0 0;
    background: rgba(255, 255, 255, 0.98);
  }

  .team-tools-panel section {
    padding: 10px;
  }

  .chat-tag-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .dashboard :where(.page h2, .page h3) {
    line-height: 1.18;
  }

  .dashboard :where(.page p, .page label, .page input, .page select, .page textarea, .page button) {
    font-size: 0.86rem;
  }

  .notification-item-copy strong {
    font-size: 0.78rem;
  }

  .notification-item-copy span {
    font-size: 0.71rem;
  }

  .department-card,
  .team-member-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
  }

  .department-card button,
  .team-role-pill,
  .team-role-select {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }

  .internal-note-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .internal-note-form button {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .notification-panel {
    left: 8px;
    right: 8px;
    padding: 9px;
  }

  .notification-panel-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .notification-item {
    padding: 8px;
  }

  .notification-item-copy small i,
  .notification-item-copy small b {
    width: 100%;
    justify-content: center;
  }

  .team-tools-panel {
    left: 6px;
    right: 6px;
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

/* WhaChat v0.34b agent identity, participants, and PWA alert polish */
.notification-panel {
  max-height: min(560px, calc(100dvh - 96px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.notification-panel:not(.hidden) {
  display: flex;
  flex-direction: column;
}

.notification-list {
  min-height: 0;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.message-agent-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: var(--brand-dark);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1.15;
}

.message-agent-meta strong,
.message-agent-meta em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-agent-meta strong {
  max-width: 64%;
}

.message-agent-meta em {
  max-width: 36%;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 168, 80, 0.11);
  color: var(--brand-deep);
  font-size: 0.62rem;
  font-style: normal;
}

.dashboard-typing {
  min-height: 34px;
  padding: 8px 18px 10px;
  color: var(--brand-dark);
  font-weight: 850;
}

.composer.agent-typing-locked {
  opacity: 0.72;
}

.team-member-list {
  display: grid;
  gap: 12px;
}

.agent-management-card {
  width: 100%;
  grid-template-columns: 54px minmax(190px, 0.42fr) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
}

.agent-self-profile-card {
  grid-template-columns: 62px minmax(220px, 0.42fr) minmax(0, 1fr);
  border-color: rgba(0, 168, 80, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(242, 255, 247, 0.96)),
    #fff;
  box-shadow: 0 18px 42px rgba(0, 64, 46, 0.1);
}

.agent-public-profile-panel .settings-heading > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.agent-public-profile-panel .settings-heading span:not(.wc-icon) {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.team-avatar.agent-public-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  padding: 0;
  overflow: visible;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 12px 26px rgba(0, 64, 46, 0.14);
}

.agent-public-avatar > img:first-child {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.agent-public-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(20, 32, 38, 0.18);
}

.agent-edit-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.agent-edit-grid label,
.agent-edit-grid .team-role-select {
  display: grid;
  min-width: 0;
}

.agent-edit-grid input,
.agent-edit-grid select {
  min-height: 40px;
  font-size: 0.82rem;
}

.agent-asset-field {
  grid-column: span 2;
}

.agent-asset-control {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.agent-asset-control img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 32, 38, 0.08);
}

.agent-save-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff;
  box-shadow: 0 12px 26px rgba(0, 168, 80, 0.18);
}

.agent-save-button .wc-icon {
  width: 18px;
  height: 18px;
}

.agent-self-note {
  align-self: end;
  justify-self: stretch;
  min-height: 40px;
  justify-content: center;
  border-radius: 12px;
}

.team-participant-invite {
  grid-column: 1 / -1;
}

.team-participant-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.team-participant-action .compact-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  border-radius: 13px;
  white-space: nowrap;
}

.team-participant-action .wc-icon {
  --wc-icon-size: 17px;
}

.team-participant-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.team-participant-empty {
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed rgba(0, 168, 80, 0.24);
  border-radius: 14px;
  background: rgba(0, 168, 80, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.team-participant-pill {
  display: inline-grid;
  grid-template-columns: 28px minmax(0, auto) auto auto;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 36px;
  padding: 4px 8px 4px 4px;
  border: 1px solid rgba(0, 168, 80, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(0, 64, 46, 0.08);
}

.team-participant-pill img,
.team-participant-pill i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-light), #fff);
  object-fit: cover;
}

.team-participant-pill strong,
.team-participant-pill em,
.team-participant-pill b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
}

.team-participant-pill strong {
  max-width: 140px;
  font-weight: 950;
}

.team-participant-pill em {
  max-width: 95px;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.team-participant-pill b {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 168, 80, 0.1);
  color: var(--brand-deep);
  font-weight: 950;
}

.team-participant-pill.invited b {
  background: rgba(255, 193, 45, 0.18);
  color: #8a5a00;
}

.team-participant-pill.lead {
  border-color: rgba(0, 168, 80, 0.34);
  background: linear-gradient(135deg, #fff, rgba(233, 255, 244, 0.92));
}

@media (max-width: 820px) {
  .notification-panel {
    max-height: calc(100dvh - 132px);
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .notification-list {
    max-height: none;
    overflow: visible;
  }

  .agent-management-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .agent-self-profile-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .team-avatar.agent-public-avatar {
    width: 58px;
    height: 58px;
  }

  .agent-public-badge {
    width: 19px;
    height: 19px;
  }

  .agent-edit-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .agent-asset-field {
    grid-column: auto;
  }

  .agent-edit-grid label,
  .agent-edit-grid .team-role-select,
  .agent-active-toggle,
  .agent-save-button,
  .agent-self-note {
    width: 100%;
    justify-self: stretch;
  }

  .agent-edit-grid input,
  .agent-edit-grid select,
  .agent-save-button {
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
    font-size: 0.9rem;
  }

  .agent-asset-control {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .agent-asset-control img {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .team-participant-action {
    grid-template-columns: minmax(0, 1fr);
  }

  .team-participant-action .compact-action {
    width: 100%;
    min-height: 44px;
  }

  .team-participant-pill {
    width: 100%;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    border-radius: 16px;
  }

  .team-participant-pill em {
    grid-column: 2;
    max-width: 100%;
  }

  .team-participant-pill b {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .message-agent-meta {
    font-size: 0.64rem;
  }
}

/* WhaChat v0.35 shared component polish */
.dashboard :where(input, select, textarea) {
  border-color: rgba(20, 32, 38, 0.11);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 250, 0.98));
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast);
}

.dashboard :where(input, select, textarea):focus {
  border-color: rgba(0, 168, 80, 0.56);
  box-shadow: var(--focus-ring), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.dashboard :where(textarea) {
  min-height: 96px;
  padding-block: 12px;
  line-height: 1.45;
  resize: vertical;
}

.dashboard :where(select) {
  min-height: 44px;
  padding-inline: 12px;
}

.dashboard :where(
  .hero-panel,
  .stat-card,
  .settings-panel,
  .status-compose-panel,
  .status-preview-panel,
  .status-pro-card,
  .status-stage-nav,
  .install-dashboard-panel,
  .install-code-column,
  .install-preview-column,
  .install-readiness-card,
  .install-guide-card,
  .client-daily-card,
  .client-quick-actions,
  .client-section-hero,
  .visitor-list-panel,
  .visitor-detail-panel,
  .visitor-summary-grid article,
  .visitor-detail-grid article,
  .visitor-latest-message,
  .visitor-page-card,
  .visitor-timeline-panel,
  .notification-panel,
  .notification-item,
  .notification-toggle-card,
  .notification-permission-card,
  .team-tools-panel,
  .team-tools-panel section,
  .department-card,
  .team-member-card,
  .agent-management-card,
  .support-ticket-card,
  .plan-limits-card,
  .billing-card
) {
  border-color: rgba(20, 32, 38, 0.09);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 250, 0.96));
  box-shadow: var(--shadow-card);
}

.dashboard :where(
  .stat-card,
  .client-action-grid button,
  .visitor-item,
  .notification-item,
  .premium-asset-choice,
  .copy-field button,
  .install-domain-actions button,
  .install-guide-tabs button,
  .status-stage-nav button,
  .admin-tabs button,
  .ghost-button,
  .primary-button,
  .primary-action
) {
  transition:
    background var(--motion-fast),
    border-color var(--motion-fast),
    color var(--motion-fast),
    box-shadow var(--motion-fast),
    transform var(--motion-fast);
}

.dashboard :where(
  .stat-card,
  .client-action-grid button,
  .visitor-item,
  .notification-item,
  .premium-asset-choice,
  .install-domain-row
):hover {
  border-color: rgba(0, 168, 80, 0.24);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.dashboard :where(.primary-button, .primary-action, .agent-save-button) {
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff;
  box-shadow: 0 14px 30px rgba(0, 168, 80, 0.2);
}

.dashboard :where(.primary-button, .primary-action, .agent-save-button):hover:not(:disabled) {
  box-shadow: 0 18px 36px rgba(0, 168, 80, 0.26);
  transform: translateY(-1px);
}

.dashboard :where(.ghost-button, .link-button, .install-domain-actions button, .copy-field button) {
  border: 1px solid rgba(0, 168, 80, 0.14);
  border-radius: var(--radius-md);
  background: var(--surface-green);
  color: var(--brand-dark);
  font-weight: 900;
}

.dashboard :where(.ghost-button, .link-button, .install-domain-actions button, .copy-field button):hover:not(:disabled) {
  border-color: rgba(0, 168, 80, 0.28);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.dashboard :where(
  .admin-tabs,
  .status-stage-nav,
  .install-guide-tabs
) {
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.07), rgba(255, 193, 45, 0.055)),
    #fff;
}

.dashboard :where(
  .admin-tabs button,
  .status-stage-nav button,
  .install-guide-tabs button
) {
  border: 1px solid transparent;
  min-height: 40px;
}

.dashboard :where(
  .admin-tabs button.active,
  .status-stage-nav button.active,
  .install-guide-tabs button.active
) {
  border-color: rgba(0, 168, 80, 0.2);
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.13), rgba(255, 193, 45, 0.1)),
    #fff;
  color: var(--brand-deep);
  box-shadow: 0 10px 24px rgba(0, 168, 80, 0.12);
}

.dashboard :where(
  .status-pill,
  .filter-count,
  .settings-stage-pill,
  .install-version-pill,
  .install-status-pill,
  .client-plan-pill,
  .visitor-live-pill,
  .nav-count-badge,
  .notification-badge,
  .mobile-tab-badge
) {
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34), 0 8px 18px rgba(20, 32, 38, 0.08);
}

.dashboard :where(
  .chat-empty-state,
  .install-empty,
  .visitor-empty,
  .visitor-detail-empty,
  .visitor-timeline-empty,
  .team-empty-card,
  .team-participant-empty,
  .notification-empty
) {
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.075), rgba(255, 193, 45, 0.07)),
    var(--surface-soft);
  border-color: rgba(0, 168, 80, 0.18);
}

.dashboard :where(
  .chat-empty-state strong,
  .install-empty strong,
  .visitor-empty strong,
  .visitor-detail-empty strong,
  .visitor-timeline-empty strong,
  .notification-empty strong
) {
  color: var(--brand-deep);
}

.dashboard :where(
  .notification-list,
  .chat-list,
  .messages,
  .visitor-list,
  .status-list,
  .install-domain-list,
  .team-tools-panel,
  .canned-reply-list,
  .internal-note-list,
  .chat-tag-picker,
  .reply-manager-list,
  .tag-manager-list
) {
  scroll-behavior: smooth;
  scrollbar-color: rgba(0, 168, 80, 0.28) transparent;
  scrollbar-width: thin;
}

.dashboard :where(
  .notification-list,
  .chat-list,
  .messages,
  .visitor-list,
  .status-list,
  .install-domain-list,
  .team-tools-panel,
  .canned-reply-list,
  .internal-note-list,
  .chat-tag-picker,
  .reply-manager-list,
  .tag-manager-list
)::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.dashboard :where(
  .notification-list,
  .chat-list,
  .messages,
  .visitor-list,
  .status-list,
  .install-domain-list,
  .team-tools-panel,
  .canned-reply-list,
  .internal-note-list,
  .chat-tag-picker,
  .reply-manager-list,
  .tag-manager-list
)::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 168, 80, 0.24);
}

.dashboard :where(
  .primary-button,
  .primary-action,
  .ghost-button,
  .link-button,
  .icon-button,
  .mobile-menu,
  .user-button,
  .admin-tabs button,
  .status-stage-nav button,
  .install-guide-tabs button,
  .copy-field button,
  .install-domain-actions button,
  .client-action-grid button,
  .visitor-item,
  .premium-asset-choice
):focus-visible {
  outline: 3px solid rgba(255, 193, 45, 0.72);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .dashboard :where(
    .settings-panel,
    .status-compose-panel,
    .status-preview-panel,
    .install-code-column,
    .install-preview-column,
    .client-daily-card,
    .client-quick-actions,
    .client-section-hero,
    .visitor-list-panel,
    .visitor-detail-panel,
    .notification-panel,
    .team-tools-panel,
    .department-card,
    .team-member-card,
    .agent-management-card,
    .support-ticket-card
  ) {
    border-radius: var(--radius-md);
    box-shadow: 0 10px 24px rgba(20, 32, 38, 0.075);
  }

  .dashboard :where(.primary-button, .primary-action, .ghost-button, .link-button) {
    min-height: 44px;
  }

  .dashboard :where(input, select, textarea) {
    min-height: 46px;
    font-size: 0.95rem;
  }
}

/* WhaChat v0.35 Dashboard Command Center */
#dashboard-page {
  gap: 14px;
}

.dashboard-hero-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.dashboard-hero-headline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.dashboard-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 950;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.16), 0 10px 22px rgba(0, 168, 80, 0.1);
}

.dashboard-state-pill .wc-icon {
  --wc-icon-size: 16px;
}

.dashboard-state-pill[data-state="attention"],
.dashboard-state-pill[data-state="setup"] {
  background: var(--surface-gold);
  color: #7a5200;
  box-shadow: inset 0 0 0 1px rgba(255, 193, 45, 0.28), 0 10px 22px rgba(255, 193, 45, 0.12);
}

.dashboard-state-pill[data-state="danger"] {
  background: #fff0f0;
  color: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(229, 72, 77, 0.2), 0 10px 22px rgba(229, 72, 77, 0.12);
}

.dashboard-command-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.dashboard-command-strip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(0, 168, 80, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-deep);
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(20, 32, 38, 0.06);
}

.dashboard-command-strip .wc-icon {
  --wc-icon-size: 16px;
}

.dashboard-hero-actions {
  display: grid;
  gap: 9px;
  min-width: 170px;
}

.dashboard-hero-actions .primary-action,
.dashboard-hero-actions .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  white-space: nowrap;
}

.dashboard-hero-actions .wc-icon {
  --wc-icon-size: 18px;
}

.stats-row {
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 10px;
  padding: 14px 0 2px;
}

.stat-card {
  position: relative;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 112px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(20, 32, 38, 0.08);
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -22px -30px auto;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: rgba(0, 168, 80, 0.08);
  pointer-events: none;
}

.stat-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: var(--brand-light);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.12);
}

.stat-card-icon .wc-icon {
  --wc-icon-size: 21px;
}

.stat-card > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.stat-card span[id] {
  font-size: clamp(1.55rem, 3vw, 2.05rem);
}

.stat-card strong {
  font-size: 0.76rem;
  line-height: 1.2;
  opacity: 0.82;
}

.stat-card small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1.2;
}

.stat-card.accent {
  background:
    radial-gradient(circle at 100% 100%, rgba(255, 193, 45, 0.2), transparent 38%),
    linear-gradient(135deg, var(--brand-deep), var(--brand));
}

.stat-card.accent .stat-card-icon {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.stat-card.accent small {
  color: rgba(255, 255, 255, 0.74);
}

.stat-card.is-hot:not(.accent) .stat-card-icon {
  background: var(--surface-gold);
  color: #7a5200;
}

.stat-card.is-danger:not(.accent) {
  border-color: rgba(229, 72, 77, 0.18);
  background:
    linear-gradient(135deg, rgba(229, 72, 77, 0.08), rgba(255, 255, 255, 0.96));
}

.stat-card.is-danger:not(.accent) .stat-card-icon {
  background: #fff0f0;
  color: var(--danger);
}

.dashboard-priority-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0 0;
}

.dashboard-priority-list article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(0, 168, 80, 0.13);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.dashboard-priority-list > article > .wc-icon {
  --wc-icon-size: 18px;
  display: grid;
  place-self: start;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--brand-light);
  color: var(--brand-dark);
}

.dashboard-priority-list strong,
.dashboard-priority-list small {
  display: block;
  min-width: 0;
}

.dashboard-priority-list strong {
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.2;
}

.dashboard-priority-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.32;
}

.dashboard-priority-list article[data-state="attention"] {
  border-color: rgba(255, 193, 45, 0.26);
  background: linear-gradient(135deg, rgba(255, 193, 45, 0.12), #fff);
}

.dashboard-priority-list article[data-state="attention"] > .wc-icon {
  background: var(--surface-gold);
  color: #7a5200;
}

.dashboard-priority-list article[data-state="danger"] {
  border-color: rgba(229, 72, 77, 0.2);
  background: linear-gradient(135deg, rgba(229, 72, 77, 0.08), #fff);
}

.dashboard-priority-list article[data-state="danger"] > .wc-icon {
  background: #fff0f0;
  color: var(--danger);
}

.client-health-list span {
  border-radius: var(--radius-md);
}

.client-action-grid button {
  align-content: stretch;
  justify-items: start;
  min-height: 116px;
  text-align: left;
}

.client-action-grid img {
  width: 38px;
  height: 38px;
}

.client-action-grid strong {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.15;
}

.client-action-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: left;
}

.install-dashboard-panel {
  margin-top: 2px;
}

@media (max-width: 1180px) {
  .stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .client-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .hero-panel {
    align-items: stretch;
  }

  .dashboard-hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .dashboard-command-strip span {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 10px;
  }

  .dashboard-priority-list,
  .client-health-list,
  .client-action-grid {
    grid-template-columns: 1fr;
  }

  .client-action-grid button {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    min-height: 72px;
  }

  .client-action-grid img {
    grid-row: 1 / span 2;
  }
}

@media (max-width: 520px) {
  .dashboard-hero-headline,
  .dashboard-command-strip {
    display: grid;
  }

  .dashboard-state-pill,
  .dashboard-command-strip span {
    justify-content: center;
    width: 100%;
  }

  .dashboard-hero-actions {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 96px;
  }
}

@media (max-width: 520px) {
  .notification-panel {
    max-height: calc(100dvh - 118px - env(safe-area-inset-bottom));
  }

  .agent-public-profile-panel,
  .agent-public-profile-panel .team-member-list,
  .agent-public-profile-panel .agent-management-card,
  .agent-edit-grid {
    min-width: 0;
  }

  .agent-public-profile-panel .settings-heading {
    align-items: start;
  }

  .agent-public-profile-panel .settings-stage-pill {
    justify-self: start;
    width: auto;
  }
}

/* WhaChat v0.35 Live Chats layout polish */
#chats-page.page.active {
  --chat-shell-radius: 22px;
  --chat-toolbar-height: 56px;
  min-height: 0;
  padding: 12px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 193, 45, 0.13), transparent 30%),
    linear-gradient(135deg, rgba(0, 168, 80, 0.07), rgba(255, 193, 45, 0.04)),
    var(--surface-soft);
}

#chats-page.page.active .chat-workspace {
  grid-template-columns: minmax(292px, 368px) minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: var(--chat-shell-radius);
  background: #fff;
  box-shadow: 0 24px 70px rgba(6, 35, 24, 0.12);
}

#chats-page .chat-workspace .sidebar,
#chats-page .chat-workspace .conversation {
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#chats-page .chat-workspace .sidebar {
  grid-template-rows: auto auto auto minmax(0, 1fr);
  border-right: 1px solid rgba(20, 32, 38, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 253, 249, 0.96)),
    #fff;
}

#chats-page .app-header {
  gap: 12px;
  padding: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 168, 80, 0.12), transparent 38%),
    linear-gradient(135deg, #ffffff, #f2fff7);
}

#chats-page .app-header .header-actions {
  min-width: 0;
}

#chats-page .app-header h1,
#chats-page .conversation-title h1 {
  overflow: hidden;
  color: var(--brand-deep);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#chats-page .admin-tabs,
#chats-page .team-tabs {
  gap: 7px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(20, 32, 38, 0.06);
  background: rgba(255, 255, 255, 0.74);
}

#chats-page .admin-tabs button,
#chats-page .team-tabs button {
  min-width: 0;
  min-height: 38px;
  padding-inline: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#chats-page .chat-list {
  gap: 9px;
  padding: 12px 12px 16px;
  background:
    linear-gradient(180deg, rgba(246, 253, 249, 0.8), rgba(255, 255, 255, 0.96)),
    #fff;
}

#chats-page .chat-item {
  min-height: 74px;
  padding: 11px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 250, 0.96)),
    #fff;
  box-shadow: 0 10px 24px rgba(20, 32, 38, 0.055);
}

#chats-page .chat-item:hover,
#chats-page .chat-item.active {
  border-color: rgba(0, 168, 80, 0.24);
  background:
    linear-gradient(135deg, rgba(235, 255, 245, 0.96), rgba(255, 250, 232, 0.72)),
    #fff;
  box-shadow: 0 16px 34px rgba(0, 64, 46, 0.1);
}

#chats-page .chat-item.active {
  box-shadow:
    inset 4px 0 0 var(--brand),
    0 16px 34px rgba(0, 64, 46, 0.12);
}

#chats-page .chat-item.priority-urgent {
  box-shadow:
    inset 4px 0 0 #e5484d,
    0 14px 30px rgba(229, 72, 77, 0.11);
}

#chats-page .conversation {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 193, 45, 0.11), transparent 34%),
    linear-gradient(180deg, #f8fcfa, #eef8f3);
}

#chats-page .conversation-header {
  min-height: 74px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(20, 32, 38, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(244, 255, 249, 0.96)),
    #fff;
  box-shadow: 0 10px 26px rgba(20, 32, 38, 0.045);
}

#chats-page .visitor-avatar {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(0, 64, 46, 0.14);
}

#chats-page .conversation-title {
  min-width: 0;
}

#chats-page .conversation-title .eyebrow {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#chats-page .header-menu-button,
#chats-page .back-button,
#chats-page .tool-button,
#chats-page .send-button {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  border-radius: 14px;
}

#chats-page .admin-menu {
  right: 14px;
  top: calc(100% - 6px);
  min-width: min(260px, calc(100vw - 28px));
  padding: 8px;
  border: 1px solid rgba(20, 32, 38, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(6, 35, 24, 0.18);
  backdrop-filter: blur(16px);
}

#chats-page .admin-menu button {
  min-height: 42px;
  border-radius: 12px;
}

#chats-page .team-inbox-bar {
  padding: 8px 12px;
  border-bottom-color: rgba(20, 32, 38, 0.06);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(240, 255, 247, 0.86)),
    #fff;
}

#chats-page .team-tools-toggle {
  min-height: var(--chat-toolbar-height);
  border-radius: 16px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 168, 80, 0.12),
    0 10px 24px rgba(0, 64, 46, 0.07);
}

#chats-page .team-tools-toggle > .wc-icon,
#chats-page .team-tools-toggle > svg {
  width: 30px;
  height: 30px;
  padding: 7px;
}

#chats-page .messages {
  min-height: 0;
  padding: 18px clamp(14px, 2.4vw, 26px) 20px;
  overflow-y: auto;
  background:
    linear-gradient(rgba(248, 252, 250, 0.88), rgba(248, 252, 250, 0.88)),
    radial-gradient(circle at 12% 12%, rgba(0, 168, 80, 0.07), transparent 28%),
    radial-gradient(circle at 88% 28%, rgba(255, 193, 45, 0.1), transparent 26%);
  scroll-padding: 120px;
}

#chats-page .dashboard-typing {
  padding: 8px 18px;
  border-top: 1px solid rgba(20, 32, 38, 0.06);
  background: rgba(255, 255, 255, 0.86);
}

#chats-page .message {
  max-width: min(76%, 680px);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(20, 32, 38, 0.06);
}

#chats-page .message.visitor {
  border-top-left-radius: 7px;
}

#chats-page .message.admin {
  border-top-right-radius: 7px;
}

#chats-page .message-agent-meta {
  gap: 8px;
}

#chats-page .team-tools-panel {
  right: 18px;
  bottom: 104px;
  width: min(880px, calc(100% - 36px));
  max-height: min(520px, calc(100% - 210px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  box-shadow: 0 28px 76px rgba(6, 35, 24, 0.22);
}

#chats-page .team-tools-panel-header {
  position: sticky;
  top: -14px;
  z-index: 2;
  margin: -14px -14px 0;
  padding: 14px;
  border-radius: 22px 22px 0 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
}

#chats-page .team-tools-panel section {
  border-radius: 18px;
}

#chats-page .team-routing-section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#chats-page .team-routing-section label,
#chats-page .team-form label,
#chats-page .internal-note-form {
  min-width: 0;
}

#chats-page .team-routing-section select,
#chats-page .team-form select,
#chats-page .team-form textarea,
#chats-page .internal-note-form input {
  min-height: 44px;
  border-radius: 14px;
}

#chats-page .chat-tag-picker,
#chats-page .canned-reply-list,
#chats-page .internal-note-list {
  max-height: clamp(132px, 20vh, 210px);
}

#chats-page .agent-assignment-panel {
  margin: 0;
  padding: 13px 16px;
  border-top-color: rgba(0, 168, 80, 0.14);
  border-bottom-color: rgba(0, 168, 80, 0.14);
}

#chats-page .composer {
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px 48px;
  gap: 8px;
  align-items: end;
  padding: 12px 14px;
  border-top: 1px solid rgba(20, 32, 38, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), #fff),
    #fff;
  box-shadow: 0 -14px 34px rgba(20, 32, 38, 0.055);
}

#chats-page .composer .reply-preview,
#chats-page .composer .emoji-picker,
#chats-page .composer .attachment-preview {
  grid-column: 1 / -1;
  min-width: 0;
}

#chats-page .composer textarea[name="text"] {
  min-height: 46px;
  max-height: 136px;
  padding: 12px 14px;
  border-radius: 18px;
  resize: none;
}

#chats-page .composer .send-button {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff;
  box-shadow: 0 12px 24px rgba(0, 168, 80, 0.22);
}

#chats-page .composer.locked {
  background: rgba(248, 252, 250, 0.96);
}

@media (max-width: 1180px) {
  #chats-page.page.active .chat-workspace {
    grid-template-columns: minmax(268px, 332px) minmax(0, 1fr);
  }

  #chats-page .team-tools-panel {
    width: min(760px, calc(100% - 32px));
    max-height: min(500px, calc(100% - 190px));
  }
}

@media (max-width: 980px) {
  #chats-page .team-tools-panel {
    grid-template-columns: 1fr;
  }

  #chats-page .team-routing-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  #chats-page.page.active {
    height: calc(100dvh - 72px);
    padding: 0;
    background: #fff;
  }

  #chats-page.page.active .chat-workspace {
    display: block;
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #chats-page .chat-workspace .sidebar,
  #chats-page .chat-workspace .conversation {
    height: 100%;
  }

  #chats-page .chat-workspace .conversation {
    display: none;
  }

  .dashboard.chat-open #chats-page .chat-workspace .sidebar {
    display: none;
  }

  .dashboard.chat-open #chats-page .chat-workspace .conversation {
    display: grid;
  }

  #chats-page .app-header {
    padding: max(14px, env(safe-area-inset-top)) 12px 10px;
  }

  #chats-page .admin-tabs,
  #chats-page .team-tabs {
    padding-inline: 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  #chats-page .admin-tabs::-webkit-scrollbar,
  #chats-page .team-tabs::-webkit-scrollbar {
    display: none;
  }

  #chats-page .team-tabs {
    grid-template-columns: repeat(5, minmax(112px, 1fr));
  }

  #chats-page .conversation-header {
    min-height: 66px;
    padding: max(10px, env(safe-area-inset-top)) 11px 10px;
  }

  #chats-page .visitor-avatar {
    width: 42px;
    height: 42px;
  }

  #chats-page .conversation-title h1 {
    font-size: 1.02rem;
  }

  #chats-page .admin-menu {
    left: 10px;
    right: 10px;
    top: calc(100% - 4px);
    min-width: 0;
  }

  #chats-page .team-inbox-bar {
    padding: 7px 10px;
  }

  #chats-page .team-tools-toggle {
    min-height: 50px;
  }

  #chats-page .messages {
    padding: 14px 11px 16px;
    scroll-padding: 142px;
  }

  #chats-page .message {
    max-width: 90%;
  }

  #chats-page .team-tools-panel {
    left: 10px;
    right: 10px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(58dvh, calc(100% - 168px));
    padding: 12px;
    border-radius: 22px 22px 16px 16px;
  }

  #chats-page .team-tools-panel-header {
    top: -12px;
    margin: -12px -12px 0;
    padding: 12px;
  }

  #chats-page .agent-assignment-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  #chats-page .agent-assignment-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  #chats-page .composer {
    grid-template-columns: 42px minmax(0, 1fr) 42px 46px;
    gap: 7px;
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
  }

  #chats-page .composer textarea[name="text"] {
    min-height: 44px;
    max-height: 124px;
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  #chats-page .admin-tabs {
    grid-template-columns: repeat(3, minmax(76px, 1fr));
  }

  #chats-page .team-tabs {
    grid-template-columns: repeat(5, minmax(104px, 1fr));
  }

  #chats-page .chat-list {
    padding-inline: 10px;
  }

  #chats-page .chat-item {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 9px;
    min-height: 70px;
    padding: 10px;
  }

  #chats-page .message {
    max-width: 94%;
  }

  #chats-page .team-tools-toggle {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    padding-right: 10px;
  }

  #chats-page .team-tools-toggle > .wc-icon,
  #chats-page .team-tools-toggle > svg {
    width: 26px;
    height: 26px;
    padding: 6px;
  }

  #chats-page .team-tools-panel {
    bottom: calc(88px + env(safe-area-inset-bottom));
    max-height: min(54dvh, calc(100% - 154px));
  }

  #chats-page .agent-assignment-actions {
    grid-template-columns: 1fr;
  }

  #chats-page .composer {
    grid-template-columns: 40px minmax(0, 1fr) 40px 44px;
    gap: 6px;
  }

  #chats-page .header-menu-button,
  #chats-page .back-button,
  #chats-page .tool-button,
  #chats-page .send-button {
    min-width: 40px;
    min-height: 40px;
    border-radius: 13px;
  }
}

/* WhaChat v0.35 Visitor Intelligence polish */
#visitors-page.page.active {
  display: grid;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 193, 45, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(0, 168, 80, 0.06), rgba(255, 255, 255, 0.8)),
    var(--surface-soft);
}

#visitors-page .visitor-workspace {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  gap: 14px;
  min-width: 0;
}

#visitors-page .client-section-hero {
  position: relative;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 193, 45, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 255, 247, 0.94)),
    #fff;
  box-shadow: 0 18px 48px rgba(6, 35, 24, 0.1);
}

#visitors-page .client-section-hero::after {
  content: "";
  position: absolute;
  right: 26px;
  bottom: -34px;
  width: 148px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 168, 80, 0.12), transparent 68%);
  pointer-events: none;
}

#visitors-page .client-section-hero > * {
  position: relative;
  z-index: 1;
}

#visitors-page .visitor-summary-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

#visitors-page .visitor-summary-grid article {
  position: relative;
  min-height: 96px;
  overflow: hidden;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 250, 0.96)),
    #fff;
}

#visitors-page .visitor-summary-grid article::after {
  content: "";
  position: absolute;
  inset: auto -26px -34px auto;
  width: 92px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(0, 168, 80, 0.08);
}

#visitors-page .visitor-summary-grid article:nth-child(2)::after,
#visitors-page .visitor-summary-grid article:nth-child(4)::after {
  background: rgba(255, 193, 45, 0.16);
}

#visitors-page .visitor-summary-grid span,
#visitors-page .visitor-summary-grid strong {
  position: relative;
  z-index: 1;
}

#visitors-page .visitor-layout {
  grid-template-columns: minmax(320px, 392px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

#visitors-page .visitor-list-panel,
#visitors-page .visitor-detail-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 250, 0.96)),
    #fff;
  box-shadow: 0 20px 52px rgba(6, 35, 24, 0.09);
}

#visitors-page .visitor-list-panel {
  position: sticky;
  top: 12px;
}

#visitors-page .visitor-search {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 10px 0 12px;
  padding: 3px 5px 3px 12px;
  border: 1px solid rgba(20, 32, 38, 0.12);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}

#visitors-page .visitor-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 168, 80, 0.12);
}

#visitors-page .visitor-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
}

#visitors-page .visitor-search button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}

#visitors-page .visitor-search button.hidden {
  visibility: hidden;
  pointer-events: none;
}

#visitors-page .visitor-search .wc-icon {
  --wc-icon-size: 18px;
}

#visitors-page .visitor-timeline-empty.is-error {
  display: grid;
  justify-items: start;
  gap: 8px;
  border-color: rgba(217, 45, 32, 0.24);
  background: rgba(217, 45, 32, 0.06);
}

#visitors-page .visitor-timeline-empty.is-error button {
  min-height: 40px;
}

#visitors-page .visitor-panel-heading,
#visitors-page .visitor-detail-header {
  min-width: 0;
}

#visitors-page .visitor-panel-heading {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(20, 32, 38, 0.07);
}

#visitors-page .visitor-panel-heading h3,
#visitors-page .visitor-detail-header h3 {
  color: var(--brand-deep);
}

#visitors-page .visitor-list {
  max-height: min(690px, calc(100dvh - 342px));
  min-height: 220px;
  overflow-y: auto;
  padding: 2px 2px 4px;
}

#visitors-page .visitor-item {
  grid-template-columns: 48px minmax(0, 1fr) minmax(76px, auto);
  min-height: 84px;
  padding: 12px;
  border-color: rgba(20, 32, 38, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(135deg, #fff, rgba(248, 252, 250, 0.96));
  box-shadow: 0 10px 24px rgba(20, 32, 38, 0.055);
}

#visitors-page .visitor-item.online {
  border-color: rgba(0, 168, 80, 0.16);
}

#visitors-page .visitor-item.needs-reply {
  border-color: rgba(255, 193, 45, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 232, 0.76)),
    #fff;
}

#visitors-page .visitor-item.active {
  border-color: rgba(0, 168, 80, 0.32);
  box-shadow:
    inset 4px 0 0 var(--brand),
    0 16px 34px rgba(0, 64, 46, 0.11);
}

#visitors-page .visitor-item-avatar {
  width: 48px;
  height: 48px;
  border: 3px solid #fff;
  box-shadow: 0 10px 22px rgba(0, 64, 46, 0.14);
}

#visitors-page .visitor-detail-avatar {
  width: 66px;
  height: 66px;
  border: 4px solid #fff;
  box-shadow: 0 16px 34px rgba(0, 64, 46, 0.16);
}

#visitors-page .visitor-item-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

#visitors-page .visitor-item-name-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#visitors-page .visitor-item-name-row em {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef5f2;
  color: var(--muted);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 950;
}

#visitors-page .visitor-item.online .visitor-item-name-row em {
  background: var(--brand-light);
  color: var(--brand-dark);
}

#visitors-page .visitor-item-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

#visitors-page .visitor-item-subline i,
#visitors-page .visitor-item-meta b,
#visitors-page .visitor-profile-tags span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(0, 168, 80, 0.08);
  color: var(--brand-deep);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#visitors-page .visitor-item-subline i + i {
  background: rgba(255, 193, 45, 0.14);
  color: #7a5200;
}

#visitors-page .visitor-item-meta {
  gap: 5px;
}

#visitors-page .visitor-item-meta b {
  background: var(--surface-gold);
  color: #7a5200;
}

#visitors-page .visitor-detail-header {
  grid-template-columns: 66px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(0, 168, 80, 0.13);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 193, 45, 0.13), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 255, 247, 0.92)),
    #fff;
}

#visitors-page .visitor-detail-identity {
  display: grid;
  gap: 4px;
  min-width: 0;
}

#visitors-page .visitor-detail-identity h3 {
  overflow-wrap: anywhere;
}

#visitors-page .visitor-profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
  min-width: 0;
}

#visitors-page .visitor-live-pill {
  min-height: 32px;
  white-space: nowrap;
}

#visitors-page .visitor-detail-grid,
#visitors-page .visitor-intel-grid {
  gap: 10px;
}

#visitors-page .visitor-detail-grid article,
#visitors-page .visitor-page-card,
#visitors-page .visitor-latest-message,
#visitors-page .visitor-timeline-panel {
  border-color: rgba(20, 32, 38, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 250, 0.96)),
    #fff;
  box-shadow: 0 10px 24px rgba(20, 32, 38, 0.055);
}

#visitors-page .visitor-detail-grid article {
  min-height: 82px;
}

#visitors-page .visitor-detail-grid strong,
#visitors-page .visitor-page-card strong,
#visitors-page .visitor-page-card a {
  line-height: 1.35;
}

#visitors-page .visitor-latest-message span,
#visitors-page .visitor-timeline-panel .visitor-panel-heading span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

#visitors-page .visitor-latest-message .wc-icon {
  --wc-icon-size: 17px;
  color: var(--brand-dark);
}

#visitors-page .visitor-latest-message p {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.5;
}

#visitors-page .visitor-timeline {
  max-height: min(430px, 40dvh);
  overflow-y: auto;
  padding-right: 2px;
}

#visitors-page .visitor-timeline-item {
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 250, 0.94)),
    #fff;
}

#visitors-page .visitor-timeline-empty.is-loading {
  position: relative;
  overflow: hidden;
}

#visitors-page .visitor-timeline-empty.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.66), transparent);
  animation: statusSkeleton 1.2s ease infinite;
}

#visitors-page .visitor-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#visitors-page .visitor-detail-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

#visitors-page .visitor-detail-actions .wc-icon {
  --wc-icon-size: 18px;
}

#visitors-page .visitor-empty,
#visitors-page .visitor-detail-empty,
#visitors-page .visitor-timeline-empty {
  border-radius: 18px;
}

@media (max-width: 1180px) {
  #visitors-page .visitor-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #visitors-page .visitor-layout {
    grid-template-columns: minmax(292px, 360px) minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  #visitors-page .visitor-layout {
    grid-template-columns: 1fr;
  }

  #visitors-page .visitor-list-panel {
    position: static;
  }

  #visitors-page .visitor-list {
    max-height: 370px;
  }
}

@media (max-width: 820px) {
  #visitors-page.page.active {
    padding: 10px;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  #visitors-page .client-section-hero {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
  }

  #visitors-page .client-section-hero .secondary-action {
    width: 100%;
  }

  #visitors-page .visitor-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #visitors-page .visitor-summary-grid article {
    min-height: 84px;
    padding: 12px;
    border-radius: 16px;
  }

  #visitors-page .visitor-summary-grid span {
    font-size: 1.22rem;
  }

  #visitors-page .visitor-list-panel,
  #visitors-page .visitor-detail-panel {
    padding: 12px;
    border-radius: 18px;
  }

  #visitors-page .visitor-list {
    max-height: 340px;
  }

  #visitors-page .visitor-detail-header {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
  }

  #visitors-page .visitor-detail-avatar {
    width: 58px;
    height: 58px;
  }

  #visitors-page .visitor-live-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  #visitors-page .visitor-detail-grid,
  #visitors-page .visitor-intel-grid,
  #visitors-page .visitor-detail-actions {
    grid-template-columns: 1fr;
  }

  #visitors-page .visitor-detail-actions button {
    width: 100%;
  }

  #visitors-page .visitor-timeline {
    max-height: 360px;
  }
}

@media (max-width: 520px) {
  #visitors-page .visitor-summary-grid {
    gap: 8px;
  }

  #visitors-page .visitor-summary-grid strong {
    font-size: 0.7rem;
  }

  #visitors-page .visitor-item {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    min-height: 86px;
  }

  #visitors-page .visitor-item-meta {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    text-align: left;
  }

  #visitors-page .visitor-item-subline i {
    max-width: 100%;
  }

  #visitors-page .visitor-profile-tags span {
    width: 100%;
    justify-content: center;
  }
}

/* WhaChat v0.35 Status Center final polish */
#status-page.page.active {
  display: grid;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 193, 45, 0.12), transparent 32%),
    radial-gradient(circle at 100% 8%, rgba(0, 168, 80, 0.1), transparent 30%),
    var(--surface-soft);
}

#status-page .status-center {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  gap: 14px;
  min-width: 0;
}

#status-page .status-hero-panel {
  position: relative;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  padding: 22px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 193, 45, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 255, 247, 0.95)),
    #fff;
  box-shadow: 0 22px 58px rgba(6, 35, 24, 0.11);
}

#status-page .status-hero-panel::before {
  content: "";
  position: absolute;
  inset: auto 42% -82px auto;
  width: 220px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 168, 80, 0.09), transparent 68%);
  pointer-events: none;
}

#status-page .status-hero-panel > * {
  position: relative;
  z-index: 1;
}

#status-page .status-hero-panel h2 {
  color: var(--brand-deep);
  letter-spacing: 0;
}

#status-page .status-stage-pill {
  min-height: 32px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(232, 255, 242, 0.9));
}

#status-page .status-hero-actions button,
#status-page .status-actions button,
#status-page .status-filter-row button,
#status-page .status-stage-nav button,
#status-page .status-preview-button,
#status-page .status-delete-button {
  min-height: 44px;
  touch-action: manipulation;
}

#status-page .status-ring-card {
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(247, 255, 250, 0.76)),
    rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 18px 42px rgba(0, 64, 46, 0.09);
}

#status-page .status-ring-preview {
  width: 96px;
  height: 96px;
  padding: 3px;
}

#status-page .status-ring-preview img {
  width: 90px;
  height: 90px;
}

#status-page .status-metric-grid,
#status-page .status-analytics-grid {
  gap: 10px;
}

#status-page .status-metric-card,
#status-page .status-analytics-grid article {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 250, 0.96)),
    #fff;
  box-shadow: 0 16px 38px rgba(6, 35, 24, 0.075);
}

#status-page .status-metric-card::after,
#status-page .status-analytics-grid article::after {
  content: "";
  position: absolute;
  inset: auto -30px -36px auto;
  width: 102px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(0, 168, 80, 0.08);
}

#status-page .status-metric-card:nth-child(2)::after,
#status-page .status-metric-card:nth-child(4)::after,
#status-page .status-analytics-grid article:nth-child(2)::after,
#status-page .status-analytics-grid article:nth-child(4)::after {
  background: rgba(255, 193, 45, 0.15);
}

#status-page .status-metric-card > *,
#status-page .status-analytics-grid article > * {
  position: relative;
  z-index: 1;
}

#status-page .status-metric-icon {
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.14), 0 10px 22px rgba(0, 168, 80, 0.09);
}

#status-page .status-stage-nav {
  position: sticky;
  top: 0;
  z-index: 15;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.08), rgba(255, 193, 45, 0.07)),
    rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

#status-page .status-stage-nav button {
  border: 1px solid transparent;
  border-radius: 14px;
}

#status-page .status-stage-nav button.active {
  border-color: rgba(0, 168, 80, 0.2);
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.13), rgba(255, 193, 45, 0.1)),
    #fff;
  color: var(--brand-deep);
  box-shadow: 0 10px 24px rgba(0, 168, 80, 0.12);
}

#status-page .status-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: 14px;
  min-width: 0;
}

#status-page .status-side-stack {
  position: sticky;
  top: 78px;
}

#status-page .status-compose-panel,
#status-page .status-preview-panel,
#status-page .status-library-panel,
#status-page .status-analytics-panel {
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 250, 0.96)),
    #fff;
  box-shadow: 0 20px 52px rgba(6, 35, 24, 0.09);
}

#status-page .status-form {
  gap: 13px;
}

#status-page .status-form label {
  min-width: 0;
  color: var(--brand-deep);
  font-size: 0.78rem;
  text-transform: uppercase;
}

#status-page .status-form input,
#status-page .status-form select,
#status-page .status-form textarea {
  min-width: 0;
  border-radius: 16px;
}

#status-page .status-form textarea {
  min-height: 148px;
  max-height: 300px;
  line-height: 1.55;
}

#status-page .status-form input[type="file"] {
  min-height: 50px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.06), rgba(255, 193, 45, 0.06)),
    #fff;
}

#status-page .status-composer-meta {
  min-height: 28px;
  padding: 0 2px;
}

#status-page .status-format-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, auto));
  justify-content: start;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.06), rgba(255, 193, 45, 0.05)),
    #f8fbf9;
}

#status-page .status-format-toolbar button {
  border-radius: 13px;
}

#status-page .status-swatch {
  width: 44px;
}

#status-page .status-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 0.85fr));
  gap: 9px;
}

#status-page .status-actions button {
  width: 100%;
  min-width: 0;
}

#status-page .status-preview-panel {
  overflow: hidden;
}

#status-page .status-preview {
  position: relative;
  gap: 10px;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 193, 45, 0.16), transparent 34%),
    linear-gradient(180deg, #f7fffb, #e9fff3);
}

#status-page .status-preview::before {
  content: "";
  position: absolute;
  inset: 12px 12px auto 12px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--gold), #1b8dff);
}

#status-page .status-preview img {
  aspect-ratio: auto;
  max-height: min(52dvh, 520px);
  margin-top: 10px;
  border-radius: 16px;
  box-shadow: 0 16px 34px rgba(6, 35, 24, 0.12);
}

#status-page #statusPreviewText {
  max-height: 176px;
  overflow-y: auto;
  padding-right: 2px;
}

#status-page .status-pro-card {
  grid-template-columns: 46px minmax(0, 1fr) auto;
  min-width: 0;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 193, 45, 0.13), rgba(255, 255, 255, 0.98)),
    #fff;
}

#status-page .status-pro-card > span {
  width: 46px;
  height: 46px;
}

#status-page .status-pro-card .pro-lock-button {
  white-space: nowrap;
}

#status-page .status-library-heading {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(20, 32, 38, 0.07);
}

#status-page .status-filter-row {
  gap: 7px;
}

#status-page .status-filter-row button {
  border: 1px solid transparent;
  border-radius: 13px;
}

#status-page .status-filter-row button.active {
  border-color: rgba(0, 168, 80, 0.2);
  background: #fff;
}

#status-page .status-list {
  gap: 11px;
}

#status-page .status-list-card,
#status-page .status-empty-card,
#status-page .status-skeleton-card {
  border-color: rgba(20, 32, 38, 0.08);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.06);
}

#status-page .status-list-card {
  position: relative;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  min-height: 108px;
  overflow: hidden;
}

#status-page .status-list-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
}

#status-page .status-list-card[data-status-state="scheduled"]::before {
  background: var(--gold);
}

#status-page .status-list-card[data-status-state="expired"]::before {
  background: #9aa5a9;
}

#status-page .status-list-thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(6, 35, 24, 0.1);
}

#status-page .status-list-title-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

#status-page .status-list-copy p {
  max-height: 52px;
  color: #54656b;
}

#status-page .status-list-stats {
  margin-top: 6px;
}

#status-page .status-list-stats span {
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 168, 80, 0.08);
  color: var(--brand-deep);
}

#status-page .status-list-stats span:nth-child(2) {
  background: rgba(255, 193, 45, 0.14);
  color: #7a5200;
}

#status-page .status-list-progress {
  position: relative;
  display: block;
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3f0;
}

#status-page .status-list-progress::before {
  content: "";
  display: block;
  width: var(--status-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--gold));
}

#status-page .status-list-actions {
  align-self: stretch;
  align-content: center;
}

#status-page .status-preview-button,
#status-page .status-delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 112px;
  border-radius: 13px;
}

#status-page .status-preview-button .wc-icon,
#status-page .status-delete-button .wc-icon {
  --wc-icon-size: 17px;
}

#status-page .status-analytics-panel {
  gap: 14px;
}

#status-page .status-analytics-grid article {
  border-radius: 18px;
}

#status-page .status-admin-modal {
  background: rgba(6, 18, 15, 0.68);
  backdrop-filter: blur(10px);
}

#status-page .status-admin-preview-card,
.status-admin-preview-card {
  border-radius: 24px;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.34);
}

.status-admin-close {
  min-width: 44px;
  min-height: 44px;
  color: var(--brand-deep);
  box-shadow: 0 12px 28px rgba(6, 35, 24, 0.16);
}

.status-admin-preview-copy {
  gap: 14px;
}

.status-admin-preview-stats strong {
  background: var(--brand-light);
  color: var(--brand-dark);
}

@media (max-width: 1180px) {
  #status-page .status-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  }

  #status-page .status-list-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  #status-page .status-list-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #status-page .status-preview-button,
  #status-page .status-delete-button {
    width: 100%;
  }
}

@media (max-width: 980px) {
  #status-page .status-hero-panel,
  #status-page .status-workspace {
    grid-template-columns: 1fr;
  }

  #status-page .status-side-stack {
    position: static;
  }

  #status-page .status-metric-grid,
  #status-page .status-analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  #status-page.page.active {
    padding: 10px;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  #status-page .status-hero-panel,
  #status-page .status-compose-panel,
  #status-page .status-preview-panel,
  #status-page .status-library-panel,
  #status-page .status-analytics-panel {
    padding: 14px;
    border-radius: 18px;
  }

  #status-page .status-hero-actions,
  #status-page .status-actions {
    grid-template-columns: 1fr;
  }

  #status-page .status-stage-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  #status-page .status-stage-nav::-webkit-scrollbar {
    display: none;
  }

  #status-page .status-stage-nav button {
    flex: 0 0 auto;
  }

  #status-page .status-form textarea {
    min-height: 132px;
  }

  #status-page .status-format-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #status-page .status-format-toolbar button {
    min-width: 0;
    padding-inline: 8px;
  }

  #status-page .status-pro-card {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  #status-page .status-pro-card .pro-lock-button {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  #status-page .status-library-heading,
  #status-page .status-filter-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  #status-page .status-filter-row button,
  #status-page .status-library-heading .compact-action {
    width: 100%;
  }

  #status-page .status-list-card {
    grid-template-columns: 60px minmax(0, 1fr);
    padding: 11px;
  }

  #status-page .status-list-thumb {
    width: 60px;
    height: 60px;
  }

  .status-admin-preview-card {
    grid-template-columns: 1fr;
    width: min(440px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .status-admin-preview-card > img {
    min-height: 0;
    max-height: min(52dvh, 420px);
  }

  .status-admin-preview-copy {
    max-height: none;
    padding: 18px;
  }
}

@media (max-width: 520px) {
  #status-page .status-metric-grid,
  #status-page .status-analytics-grid {
    grid-template-columns: 1fr;
  }

  #status-page .status-metric-card {
    min-height: 82px;
  }

  #status-page .status-ring-card {
    padding: 14px;
  }

  #status-page .status-format-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #status-page .status-list-card {
    grid-template-columns: 1fr;
  }

  #status-page .status-list-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  #status-page .status-list-actions {
    grid-template-columns: 1fr;
  }
}

/* WhaChat v0.35 Widget Studio and Install Kit polish */
#settings-page.page.active {
  align-content: start;
  overflow-y: auto;
  scroll-behavior: smooth;
}

#settings-page .settings-stack {
  gap: 16px;
}

#settings-page .settings-panel {
  position: relative;
  overflow: hidden;
}

#settings-page .settings-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 193, 45, 0.12), transparent 28%),
    radial-gradient(circle at 0% 16%, rgba(0, 168, 80, 0.09), transparent 26%);
  opacity: 0.78;
}

#settings-page .settings-panel > * {
  position: relative;
  z-index: 1;
}

#settings-page .settings-heading {
  align-items: start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(20, 32, 38, 0.07);
}

#settings-page .settings-heading h2 {
  letter-spacing: 0;
}

#settings-page .install-version-pill,
#settings-page .settings-stage-pill {
  gap: 7px;
  min-height: 34px;
  padding-inline: 12px;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.12), rgba(255, 193, 45, 0.16)),
    #fff;
  color: var(--brand-deep);
}

#settings-page .install-kit-grid {
  grid-template-columns: minmax(0, 1.18fr) minmax(286px, 0.82fr);
  gap: 18px;
}

#settings-page .install-code-column,
#settings-page .install-preview-column,
#settings-page .studio-choice-group,
#settings-page .quick-message-editor,
#settings-page .widget-settings-preview,
#settings-page .install-domain-form,
#settings-page .install-readiness-card,
#settings-page .install-guide-card,
#settings-page .install-instructions article,
#settings-page .mini-widget-preview {
  border-color: rgba(0, 168, 80, 0.15);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 253, 250, 0.96));
  box-shadow: 0 14px 34px rgba(20, 32, 38, 0.065);
}

#settings-page .install-code-column,
#settings-page .install-preview-column {
  padding: 14px;
}

#settings-page .install-code-column label,
#settings-page .widget-settings-form label,
#settings-page .notification-settings-form label {
  min-width: 0;
}

#settings-page .copy-field {
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

#settings-page .copy-field input {
  border: 0;
  background: transparent;
  box-shadow: none;
}

#settings-page .copy-field button {
  margin: 4px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff;
}

#settings-page #installEmbedCode {
  min-height: 118px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #123126;
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.05), rgba(255, 255, 255, 0.96));
}

#settings-page .mini-widget-preview,
#settings-page .widget-settings-preview {
  isolation: isolate;
  border-color: rgba(0, 168, 80, 0.18);
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 193, 45, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(232, 248, 239, 0.94), rgba(255, 255, 255, 0.98));
}

#settings-page .preview-launcher {
  flex: 0 0 auto;
  border: 3px solid transparent;
  box-shadow:
    0 14px 32px rgba(0, 168, 80, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.88);
}

#settings-page .widget-settings-preview[data-launcher-style="mascot"] .preview-launcher {
  border: 0;
  box-shadow: none;
}

#settings-page .preview-launcher img:not(.preview-badge) {
  box-shadow: inset 0 0 0 1px rgba(20, 32, 38, 0.05);
}

#settings-page .install-readiness-card {
  gap: 8px;
  border-left: 4px solid var(--brand);
}

#settings-page .install-status-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#settings-page .install-status-summary article {
  min-height: 104px;
  border-color: rgba(0, 168, 80, 0.13);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 253, 250, 0.96));
  box-shadow: 0 10px 24px rgba(20, 32, 38, 0.055);
}

#settings-page .install-status-summary article.connected {
  border-color: rgba(0, 168, 80, 0.24);
}

#settings-page .install-status-summary article.blocked {
  border-color: rgba(180, 35, 24, 0.22);
}

#settings-page .install-domain-row {
  grid-template-columns: minmax(0, 1fr) auto minmax(230px, auto);
  border-color: rgba(20, 32, 38, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.055);
}

#settings-page .install-domain-actions button[data-install-action="delete"] {
  border-color: rgba(180, 35, 24, 0.18);
  background: #fff4f2;
  color: #b42318;
}

#settings-page .install-domain-actions button[data-install-action="delete"]:hover {
  border-color: rgba(180, 35, 24, 0.32);
  color: #8f1d14;
}

#settings-page .install-guide-tabs {
  align-items: center;
  padding: 7px;
}

#settings-page .install-guide-tabs button {
  min-height: 44px;
}

#settings-page .install-guide-card ol {
  counter-reset: installStep;
  padding-left: 0;
  list-style: none;
}

#settings-page .install-guide-card li {
  position: relative;
  min-height: 34px;
  padding: 7px 10px 7px 42px;
  border: 1px solid rgba(0, 168, 80, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

#settings-page .install-guide-card li::before {
  counter-increment: installStep;
  content: counter(installStep);
  position: absolute;
  left: 10px;
  top: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 950;
}

#settings-page .install-instructions article {
  min-height: 118px;
}

#settings-page .widget-settings-grid,
#settings-page .widget-studio-options {
  gap: 14px;
}

#settings-page .studio-choice-group {
  padding: 14px;
}

#settings-page .studio-choice-group > span,
#settings-page .asset-select-section > div > span,
#settings-page .quick-message-editor > span {
  color: var(--brand-deep);
  letter-spacing: 0;
}

#settings-page .studio-choice-row button {
  min-height: 46px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, #fff, rgba(248, 252, 250, 0.96));
  color: #17352a;
}

#settings-page .studio-choice-row button.selected {
  border-color: rgba(0, 168, 80, 0.34);
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.13), rgba(255, 193, 45, 0.1)),
    #fff;
}

#settings-page .asset-choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
}

#settings-page .asset-choice-grid button {
  min-height: 82px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, #fff, rgba(248, 252, 250, 0.96));
}

#settings-page .asset-choice-grid button.selected {
  border-color: rgba(0, 168, 80, 0.54);
  box-shadow:
    0 16px 34px rgba(0, 168, 80, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.84);
}

#settings-page .avatar-choice-grid {
  max-height: min(372px, 44vh);
  padding: 4px 5px 4px 0;
}

#settings-page .avatar-choice-grid img {
  width: 56px;
  height: 56px;
}

#settings-page .badge-choice-grid strong {
  color: #17352a;
}

#settings-page .quick-message-editor {
  grid-template-columns: minmax(126px, 0.58fr) minmax(0, 1.42fr);
  padding: 14px;
}

#settings-page .quick-message-editor input {
  min-height: 44px;
}

#settings-page #widgetPreviewQuickMessages button {
  min-height: 36px;
  border: 1px solid rgba(0, 168, 80, 0.13);
  color: var(--brand-deep);
  transition: transform var(--motion-fast), box-shadow var(--motion-fast);
}

#settings-page #widgetPreviewQuickMessages button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 168, 80, 0.13);
}

#settings-page .notification-settings-panel .notification-toggle-card {
  border-radius: var(--radius-md);
}

#settings-page :where(.wc-icon) {
  color: var(--brand-deep);
}

#settings-page :where(.primary-action, .primary-button, .copy-field button) .wc-icon {
  color: #fff;
}

#settings-page :where(.secondary-action, .ghost-button, .install-guide-tabs button, .studio-choice-row button) .wc-icon {
  color: currentColor;
}

#settings-page :where(.install-domain-actions button[data-install-action="delete"]) .wc-icon {
  color: #b42318;
}

#chats-page .composer {
  flex-shrink: 0;
  min-height: 68px;
  visibility: visible;
}

#chats-page .composer textarea[name="text"] {
  width: 100%;
  min-width: 0;
  color: var(--ink);
}

#chats-page .composer .tool-button .wc-icon,
#chats-page .composer .send-button .wc-icon {
  color: currentColor;
}

#chats-page .composer .send-button {
  color: #fff;
}

@media (max-width: 1180px) {
  #settings-page .install-kit-grid {
    grid-template-columns: 1fr;
  }

  #settings-page .install-preview-column {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr);
    align-items: stretch;
  }

  #settings-page .install-preview-column > .install-status-pill,
  #settings-page .install-preview-column > .install-hint {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  #settings-page.page.active {
    padding: 10px;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  #settings-page .settings-stack {
    gap: 12px;
  }

  #settings-page .settings-heading {
    display: grid;
    grid-template-columns: 1fr;
  }

  #settings-page .install-version-pill,
  #settings-page .settings-stage-pill {
    width: max-content;
    max-width: 100%;
  }

  #settings-page .install-code-column,
  #settings-page .install-preview-column {
    padding: 12px;
  }

  #settings-page .install-preview-column,
  #settings-page .install-status-summary,
  #settings-page .install-domain-row,
  #settings-page .install-domain-form,
  #settings-page .install-instructions,
  #settings-page .widget-studio-options,
  #settings-page .widget-settings-preview,
  #settings-page .quick-message-editor {
    grid-template-columns: 1fr;
  }

  #settings-page .copy-field {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  #settings-page .install-domain-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  #settings-page .install-domain-actions button,
  #settings-page .install-guide-tabs button,
  #settings-page .status-actions button {
    width: 100%;
  }

  #settings-page .install-guide-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #settings-page .asset-choice-grid {
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 8px;
  }

  #settings-page .asset-choice-grid button {
    min-height: 76px;
    padding: 7px;
  }

  #settings-page .avatar-choice-grid {
    max-height: min(310px, 42vh);
  }

  #settings-page .avatar-choice-grid img {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 520px) {
  #settings-page .install-guide-tabs,
  #settings-page .install-domain-actions,
  #settings-page .status-actions {
    grid-template-columns: 1fr;
  }

  #settings-page .install-status-summary article {
    min-height: 92px;
  }

  #settings-page .mini-widget-preview,
  #settings-page .widget-settings-preview {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 11px;
    padding: 12px;
  }

  #settings-page .preview-launcher {
    width: 56px;
    height: 56px;
  }

  #settings-page .widget-settings-preview[data-launcher-style="bubble"] .preview-launcher {
    width: 76px;
  }

  #settings-page .copy-field {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  #settings-page .copy-field button {
    width: 40px;
    min-height: 40px;
  }
}

/* WhaChat v0.35 Account, Team, Departments, and Settings polish */
:where(#account-page, #admins-page, #departments-page).page.active {
  align-content: start;
  overflow-y: auto;
  scroll-behavior: smooth;
}

:where(#account-page, #admins-page, #departments-page) :where(.settings-panel, .client-section-hero, .team-summary-grid article) {
  position: relative;
  overflow: hidden;
}

:where(#account-page, #admins-page, #departments-page) :where(.settings-panel, .client-section-hero, .team-summary-grid article)::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 193, 45, 0.12), transparent 28%),
    radial-gradient(circle at 0% 12%, rgba(0, 168, 80, 0.08), transparent 30%);
  opacity: 0.74;
}

:where(#account-page, #admins-page, #departments-page) :where(.settings-panel, .client-section-hero, .team-summary-grid article) > * {
  position: relative;
  z-index: 1;
}

#account-page .account-layout,
#admins-page .team-workspace,
#departments-page .team-workspace {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  gap: 16px;
}

#account-page .account-layout {
  display: grid;
}

#account-page .account-hero {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 16px;
}

#account-page .account-identity,
#account-page .trial-card {
  min-width: 0;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

#account-page .account-identity {
  background:
    radial-gradient(circle at 7% 20%, rgba(255, 193, 45, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 253, 250, 0.96));
}

#account-page .account-avatar-xl {
  width: 94px;
  height: 94px;
  padding: 3px;
  border: 3px solid transparent;
}

#account-page .account-identity h2 {
  letter-spacing: 0;
  line-height: 1.05;
}

#account-page .account-business-name {
  min-height: 30px;
  align-items: center;
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.12);
}

#account-page .trial-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 193, 45, 0.22), transparent 38%),
    linear-gradient(135deg, #064f2c, #008848);
}

#account-page .trial-card span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

#account-page .trial-card span::before {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("../icons/crown.svg") center / contain no-repeat;
  mask: url("../icons/crown.svg") center / contain no-repeat;
}

#account-page .settings-heading,
#admins-page .settings-heading,
#departments-page .settings-heading {
  align-items: start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(20, 32, 38, 0.07);
}

#account-page .settings-heading h2,
#admins-page .settings-heading h2,
#departments-page .settings-heading h2 {
  letter-spacing: 0;
}

#account-page .status-form,
#account-page .team-form,
#admins-page .team-form,
#departments-page .team-form {
  gap: 14px;
}

#account-page :where(.status-form, .team-form, .widget-settings-grid) label,
#admins-page .team-form label,
#departments-page .team-form label {
  min-width: 0;
}

#account-page .account-avatar-grid {
  max-height: min(360px, 42vh);
}

#account-page .security-option {
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 253, 250, 0.96));
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.055);
}

#account-page .security-option::before {
  content: "";
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--brand-light);
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.14);
}

#account-page .security-option::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 27px;
  width: 18px;
  height: 18px;
  background: var(--brand-deep);
  -webkit-mask: url("../icons/lock-keyhole.svg") center / contain no-repeat;
  mask: url("../icons/lock-keyhole.svg") center / contain no-repeat;
}

#account-page .security-option {
  position: relative;
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

#account-page .security-option > div {
  min-width: 0;
}

#account-page .plan-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#account-page .plan-card,
#account-page .plan-limits-card {
  border-radius: var(--radius-lg);
  border-color: rgba(20, 32, 38, 0.08);
  box-shadow: 0 14px 32px rgba(20, 32, 38, 0.065);
}

#account-page .plan-card {
  min-height: 176px;
}

#account-page .plan-card.active {
  border-color: rgba(0, 168, 80, 0.24);
}

#account-page .plan-card span,
#account-page .plan-limits-card > span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}

#account-page .plan-action-row button {
  border-radius: 12px;
}

#account-page .plan-upgrade-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(0, 168, 80, 0.18);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.1), rgba(255, 193, 45, 0.1)),
    #ffffff;
  box-shadow: 0 16px 38px rgba(20, 32, 38, 0.08);
}

#account-page .plan-upgrade-banner[data-tone="success"] {
  border-color: rgba(0, 168, 80, 0.24);
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.12), rgba(236, 255, 245, 0.86)),
    #ffffff;
}

#account-page .plan-upgrade-banner[data-tone="danger"] {
  border-color: rgba(180, 35, 24, 0.2);
  background:
    linear-gradient(135deg, rgba(180, 35, 24, 0.09), rgba(255, 245, 235, 0.88)),
    #ffffff;
}

#account-page .plan-upgrade-banner span {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-bottom: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 168, 80, 0.1);
  color: var(--brand-deep);
  font-size: 0.72rem;
  font-weight: 950;
}

#account-page .plan-upgrade-banner strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
}

#account-page .plan-upgrade-banner p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

#account-page .plan-comparison-grid,
#account-page .plan-feature-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

#account-page .plan-comparison-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#account-page .plan-feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#account-page .plan-tier-card,
#account-page .plan-feature-card {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 253, 250, 0.96));
  box-shadow: 0 12px 30px rgba(20, 32, 38, 0.06);
}

#account-page .plan-tier-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
}

#account-page .plan-tier-card.active {
  border-color: rgba(0, 168, 80, 0.3);
  box-shadow:
    0 18px 42px rgba(0, 104, 55, 0.13),
    inset 0 0 0 1px rgba(0, 168, 80, 0.08);
}

#account-page .plan-tier-topline,
#account-page .plan-tier-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#account-page .plan-tier-topline span,
#account-page .plan-tier-topline strong {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 950;
}

#account-page .plan-tier-topline span {
  background: var(--brand-light);
  color: var(--brand-dark);
}

#account-page .plan-tier-topline strong {
  background: #fff5cf;
  color: #7a5200;
}

#account-page .plan-tier-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.22rem;
  line-height: 1.15;
}

#account-page .plan-tier-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

#account-page .plan-tier-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#account-page .plan-tier-card li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.35;
}

#account-page .plan-tier-card li .wc-icon {
  width: 18px;
  height: 18px;
  color: var(--brand-deep);
}

#account-page .plan-tier-foot {
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 32, 38, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
}

#account-page .plan-tier-foot strong {
  color: var(--brand-deep);
}

#account-page .plan-feature-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-content: start;
  padding: 14px;
}

#account-page .plan-feature-card.unlocked {
  border-color: rgba(0, 168, 80, 0.18);
}

#account-page .plan-feature-card.locked {
  border-color: rgba(255, 193, 45, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 193, 45, 0.11), rgba(255, 255, 255, 0.96));
}

#account-page .plan-feature-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  color: var(--brand-deep);
  background: rgba(0, 168, 80, 0.1);
}

#account-page .plan-feature-card.locked .plan-feature-icon {
  color: #7a5200;
  background: #fff5cf;
}

#account-page .plan-feature-card strong {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.25;
}

#account-page .plan-feature-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

#account-page .plan-feature-status {
  grid-column: 1 / -1;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 168, 80, 0.1);
  color: var(--brand-deep);
  font-size: 0.72rem;
  font-weight: 950;
}

#account-page .plan-feature-card.locked .plan-feature-status {
  background: #fff5cf;
  color: #7a5200;
}

#account-page .pro-lock-button.compact {
  grid-column: 1 / -1;
  min-height: 34px;
  padding-inline: 11px;
}

#account-page .saas-core-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#account-page .plan-limits-card p {
  align-items: start;
  line-height: 1.35;
}

#account-page .agent-ticket-panel,
#account-page .agent-public-profile-panel {
  border-color: rgba(0, 168, 80, 0.15);
}

#admins-page .client-section-hero,
#departments-page .client-section-hero {
  border-radius: var(--radius-xl);
}

#admins-page .team-summary-grid article {
  min-height: 104px;
  padding: 16px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 253, 250, 0.96));
  box-shadow: 0 14px 32px rgba(20, 32, 38, 0.065);
}

#admins-page .team-summary-grid article span {
  color: var(--brand-deep);
}

#admins-page .team-summary-grid article strong {
  color: var(--muted);
}

#admins-page .team-layout,
#departments-page .team-layout {
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 16px;
}

#admins-page .team-member-list,
#departments-page .department-list,
#admins-page .support-ticket-list,
#departments-page .reply-manager-list,
#departments-page .tag-manager-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 168, 80, 0.28) transparent;
}

#admins-page .team-member-card,
#departments-page .department-card,
#admins-page .support-ticket-card,
#account-page .support-ticket-card,
#departments-page .reply-manager-card,
#departments-page .team-empty-card,
#admins-page .team-empty-card {
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 253, 250, 0.96));
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.055);
}

#admins-page .agent-management-card,
#account-page .agent-management-card {
  grid-template-columns: 58px minmax(210px, 0.38fr) minmax(0, 1fr);
  align-items: start;
}

#admins-page .team-avatar,
#account-page .team-avatar,
#departments-page .department-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 12px 26px rgba(0, 64, 46, 0.12);
}

#admins-page .team-avatar,
#account-page .team-avatar {
  color: #fff;
}

#admins-page .team-member-copy strong,
#departments-page .department-copy strong {
  color: var(--ink);
}

#admins-page .agent-edit-grid,
#account-page .agent-edit-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(0, 168, 80, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
}

#admins-page .agent-edit-grid label,
#account-page .agent-edit-grid label,
#admins-page .agent-edit-grid .team-role-select,
#account-page .agent-edit-grid .team-role-select {
  min-width: 0;
}

#admins-page .agent-edit-grid input,
#admins-page .agent-edit-grid select,
#account-page .agent-edit-grid input,
#account-page .agent-edit-grid select,
#departments-page .team-form input,
#departments-page .team-form select,
#departments-page .team-form textarea,
#admins-page .team-form input,
#admins-page .team-form select {
  min-height: 44px;
  border-radius: 14px;
  font-size: 0.9rem;
}

#admins-page .agent-active-toggle,
#account-page .agent-active-toggle {
  min-height: 44px;
  padding-inline: 10px;
  border: 1px solid rgba(0, 168, 80, 0.11);
  border-radius: 14px;
  background: var(--surface-green);
}

#admins-page .agent-save-button,
#account-page .agent-save-button,
#admins-page #teamAdminForm .primary-action,
#departments-page .team-form :where(.primary-action, .secondary-action) {
  min-height: 44px;
  border-radius: 14px;
}

#admins-page .agent-save-button::before,
#account-page .agent-save-button::before,
#admins-page #teamAdminForm .primary-action::before,
#departments-page .team-form :where(.primary-action, .secondary-action)::before,
#account-page :where(#accountProfileForm, #accountSecurityForm, #agentTicketForm) .primary-action::before {
  content: "";
  width: 17px;
  height: 17px;
  background: currentColor;
  -webkit-mask: url("../icons/check.svg") center / contain no-repeat;
  mask: url("../icons/check.svg") center / contain no-repeat;
}

#admins-page #teamAdminForm .primary-action,
#departments-page .team-form :where(.primary-action, .secondary-action),
#account-page :where(#accountProfileForm, #accountSecurityForm, #agentTicketForm) .primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#departments-page .department-card {
  min-height: 86px;
}

#departments-page .department-card button {
  min-height: 40px;
  border-radius: 12px;
  background: var(--brand-light);
  color: var(--brand-deep);
  box-shadow: inset 0 0 0 1px rgba(0, 168, 80, 0.12);
}

#departments-page .department-card.inactive button {
  background: var(--surface-gold);
  color: #7a5200;
}

#departments-page .compact-heading {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(20, 32, 38, 0.07);
}

#departments-page .reply-manager-list,
#departments-page .tag-manager-list {
  overflow-y: auto;
}

#departments-page .reply-manager-card {
  align-items: start;
}

#departments-page .manager-action-row button {
  min-height: 36px;
}

#departments-page .manager-action-row .danger-action {
  color: #b42318;
}

#departments-page .tag-manager-list {
  gap: 8px;
  min-height: 48px;
}

#departments-page .tag-form {
  grid-template-columns: minmax(0, 1fr) minmax(86px, 0.36fr);
}

#admins-page .support-ticket-panel,
#account-page .agent-ticket-panel {
  border-color: rgba(0, 168, 80, 0.16);
}

#admins-page .support-ticket-list,
#account-page .support-ticket-list {
  padding-right: 5px;
}

#admins-page .support-ticket-card.manager {
  border-radius: var(--radius-lg);
}

#admins-page .ticket-manager-grid select,
#admins-page .ticket-manager-grid textarea {
  border-radius: 14px;
}

#settings-page .notification-settings-panel,
#settings-page .system-info-panel {
  border-color: rgba(0, 168, 80, 0.13);
}

#settings-page .notification-toggle-grid {
  gap: 12px;
}

#settings-page .notification-toggle-card,
#settings-page .notification-permission-card,
#settings-page .system-info-grid article {
  border-color: rgba(20, 32, 38, 0.08);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 253, 250, 0.96));
  box-shadow: 0 12px 28px rgba(20, 32, 38, 0.055);
}

#settings-page .notification-toggle-card input {
  accent-color: var(--brand);
}

#settings-page .notification-toggle-card strong,
#settings-page .notification-permission-card strong,
#settings-page .system-info-grid strong {
  color: var(--ink);
}

#settings-page .system-info-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#settings-page .system-info-grid article {
  min-height: 92px;
}

:where(#account-page, #admins-page, #departments-page, #settings-page) :where(.primary-action, .primary-button, .agent-save-button) {
  color: #fff;
}

:where(#account-page, #admins-page, #departments-page, #settings-page) :where(.wc-icon) {
  color: currentColor;
}

:where(#account-page, #admins-page, #departments-page, #settings-page) :where(.settings-stage-pill, .install-version-pill, .team-role-pill, .pro-lock-button) .wc-icon {
  color: currentColor;
}

:where(#account-page, #admins-page, #departments-page, #settings-page) :where(.danger-action, [data-canned-action="delete"], [data-department-toggle].danger) .wc-icon {
  color: #b42318;
}

@media (max-width: 1180px) {
  #account-page .plan-grid,
  #account-page .plan-feature-grid,
  #settings-page .system-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #admins-page .team-layout,
  #departments-page .team-layout {
    grid-template-columns: 1fr;
  }

  #admins-page .agent-management-card,
  #account-page .agent-management-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  #admins-page .agent-edit-grid,
  #account-page .agent-edit-grid {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  :where(#account-page, #admins-page, #departments-page).page.active {
    padding: 10px;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  #account-page .account-hero,
  #account-page .plan-grid,
  #account-page .plan-comparison-grid,
  #account-page .plan-feature-grid,
  #account-page .saas-core-grid,
  #admins-page .team-summary-grid,
  #settings-page .system-info-grid {
    grid-template-columns: 1fr;
  }

  #account-page .account-identity {
    align-items: start;
    padding: 14px;
  }

  #account-page .account-avatar-xl {
    width: 78px;
    height: 78px;
  }

  #account-page .trial-card,
  #account-page .plan-card,
  #account-page .plan-tier-card,
  #account-page .plan-feature-card,
  #account-page .plan-limits-card,
  #admins-page .team-summary-grid article {
    min-height: 0;
  }

  #account-page .plan-upgrade-banner {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  #account-page .plan-upgrade-banner .pro-lock-button {
    width: 100%;
    justify-content: center;
  }

  #account-page .security-option {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  #account-page .security-option .pro-lock-button {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  #admins-page .agent-management-card,
  #account-page .agent-management-card,
  #admins-page .team-member-card,
  #departments-page .department-card,
  #admins-page .support-ticket-card.manager {
    grid-template-columns: 1fr;
  }

  #admins-page .team-avatar,
  #account-page .team-avatar,
  #departments-page .department-icon {
    width: 56px;
    height: 56px;
  }

  #admins-page .agent-edit-grid,
  #account-page .agent-edit-grid,
  #admins-page #teamAdminForm,
  #departments-page .team-form,
  #departments-page .tag-form,
  #admins-page .ticket-manager-grid {
    grid-template-columns: 1fr;
  }

  #admins-page .agent-edit-grid label,
  #account-page .agent-edit-grid label,
  #admins-page .agent-edit-grid .team-role-select,
  #account-page .agent-edit-grid .team-role-select,
  #admins-page .agent-active-toggle,
  #account-page .agent-active-toggle,
  #admins-page .agent-save-button,
  #account-page .agent-save-button,
  #admins-page #teamAdminForm .primary-action,
  #departments-page .team-form :where(.primary-action, .secondary-action),
  #departments-page .department-card button,
  #account-page :where(#accountProfileForm, #accountSecurityForm, #agentTicketForm) .primary-action {
    width: 100%;
    justify-self: stretch;
  }

  #admins-page .agent-edit-grid input,
  #admins-page .agent-edit-grid select,
  #account-page .agent-edit-grid input,
  #account-page .agent-edit-grid select,
  #departments-page .team-form input,
  #departments-page .team-form select,
  #departments-page .team-form textarea,
  #admins-page .team-form input,
  #admins-page .team-form select,
  #account-page .status-form input,
  #account-page .status-form select,
  #account-page .status-form textarea {
    width: 100%;
    min-height: 46px;
    font-size: 0.95rem;
  }

  #departments-page .reply-manager-card {
    grid-template-columns: 1fr;
  }

  #departments-page .manager-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  #departments-page .manager-action-row button {
    width: 100%;
  }

  #admins-page .support-ticket-list,
  #account-page .support-ticket-list {
    max-height: min(420px, 52dvh);
  }
}

@media (max-width: 520px) {
  #account-page .account-identity {
    display: grid;
    justify-items: start;
  }

  #account-page .account-avatar-grid {
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  }

  #account-page .plan-action-row,
  #departments-page .manager-action-row {
    grid-template-columns: 1fr;
  }

  #admins-page .team-summary-grid article,
  #account-page .plan-card,
  #account-page .plan-tier-card,
  #account-page .plan-feature-card,
  #account-page .plan-upgrade-banner,
  #account-page .plan-limits-card,
  #departments-page .department-card,
  #admins-page .team-member-card,
  #admins-page .support-ticket-card,
  #account-page .support-ticket-card {
    padding: 12px;
    border-radius: var(--radius-md);
  }

  #settings-page .notification-toggle-card,
  #settings-page .notification-permission-card,
  #settings-page .system-info-grid article {
    border-radius: var(--radius-md);
  }
}

/* WhaChat v0.35 full dashboard QA: chatbox and notification safety */
#chats-page.page.active {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

#chats-page.page.active .chat-workspace,
#chats-page .conversation,
#chats-page .sidebar {
  min-width: 0;
  min-height: 0;
}

#chats-page .conversation {
  overflow: hidden;
}

#chats-page .conversation-header,
#chats-page .team-inbox-bar,
#chats-page .dashboard-typing,
#chats-page .agent-assignment-panel,
#chats-page .composer {
  flex-shrink: 0;
}

#chats-page .conversation-header {
  position: relative;
  z-index: 18;
}

#chats-page .team-inbox-bar {
  position: relative;
  z-index: 14;
  min-width: 0;
}

#chats-page .team-tools-toggle {
  grid-template-columns: 36px minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  align-items: center;
  text-align: left;
}

#chats-page .team-tools-toggle span {
  min-width: 0;
}

#chats-page .team-tools-toggle strong,
#chats-page .team-tools-toggle small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#chats-page .messages {
  min-height: 0;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#chats-page .team-tools-panel {
  z-index: 15;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 168, 80, 0.28) transparent;
}

#chats-page .team-tools-panel:not(.hidden) {
  display: grid;
}

#chats-page .team-tools-panel section {
  min-width: 0;
  min-height: 0;
}

#chats-page .team-tools-heading {
  display: flex;
  gap: 8px;
  min-width: 0;
}

#chats-page .team-tools-heading strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#chats-page .team-tools-heading span {
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#chats-page .team-routing-section {
  align-content: start;
}

#chats-page .team-routing-section label,
#chats-page .team-participant-invite,
#chats-page .team-participant-action,
#chats-page .team-participant-list,
#chats-page .chat-tag-picker,
#chats-page .canned-reply-list,
#chats-page .internal-note-list,
#chats-page .internal-note-form {
  min-width: 0;
}

#chats-page .team-routing-section select,
#chats-page .team-participant-action select,
#chats-page .internal-note-form input {
  width: 100%;
}

#chats-page .chat-tag-picker,
#chats-page .canned-reply-list,
#chats-page .internal-note-list {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

#chats-page .chat-tag-picker button,
#chats-page .canned-reply-list button,
#chats-page .internal-note-card,
#chats-page .team-participant-pill {
  max-width: 100%;
}

#chats-page .composer {
  z-index: 24;
  min-height: 70px;
  overflow: visible;
}

#chats-page .composer textarea[name="text"] {
  overflow-y: auto;
  overscroll-behavior: contain;
  line-height: 1.42;
}

#chats-page .composer .emoji-picker,
#chats-page .composer .attachment-preview,
#chats-page .composer .reply-preview {
  max-width: 100%;
  overflow-x: hidden;
}

.notification-center {
  position: relative;
}

.topbar-activity {
  z-index: 68;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 168, 80, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 255, 247, 0.96));
  box-shadow: 0 18px 42px rgba(6, 35, 24, 0.14);
}

.topbar-activity-copy {
  min-width: 0;
}

.topbar-activity-copy strong,
.topbar-activity-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-panel {
  z-index: 76;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid rgba(20, 32, 38, 0.1);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(247, 253, 250, 0.98));
  box-shadow: 0 28px 78px rgba(6, 35, 24, 0.2);
}

.notification-panel.hidden {
  display: none;
}

.notification-panel-head {
  flex: 0 0 auto;
  min-width: 0;
}

.notification-panel-actions {
  min-width: 0;
}

.notification-panel-actions button {
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 168, 80, 0.28) transparent;
}

.notification-item {
  height: auto;
  min-width: 0;
  min-height: 78px;
  align-items: start;
  border-radius: 16px;
}

.notification-item-icon {
  flex: 0 0 auto;
}

.notification-item-copy {
  min-width: 0;
}

.notification-item-copy strong {
  display: -webkit-box;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-item-copy span {
  overflow-wrap: anywhere;
}

.notification-item-copy small {
  min-width: 0;
  white-space: normal;
}

.notification-item-copy small i,
.notification-item-copy small b {
  max-width: 100%;
}

.notification-item-actions {
  min-width: 0;
}

.notification-item-action,
.notification-more {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-region {
  z-index: 130;
  max-height: calc(100dvh - 24px);
  overflow: visible;
}

.toast {
  min-width: 0;
  border-radius: 16px;
}

.toast-copy {
  min-width: 0;
}

.toast-copy strong,
.toast-copy span {
  overflow-wrap: anywhere;
}

.toast-close {
  flex: 0 0 auto;
}

.notification-detail-card {
  border-radius: 18px;
  overscroll-behavior: contain;
}

@media (min-width: 821px) {
  #chats-page.page.active {
    height: 100%;
  }

  #chats-page .team-tools-panel {
    bottom: 96px;
    max-height: min(440px, calc(100% - 190px));
  }

  #chats-page .team-tools-panel section {
    max-height: min(292px, 38vh);
  }
}

@media (max-width: 820px) {
  #chats-page.page.active {
    height: calc(100dvh - 72px);
    overflow: hidden;
  }

  #chats-page .conversation {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  }

  #chats-page .team-tools-panel {
    bottom: calc(82px + env(safe-area-inset-bottom));
    max-height: min(46dvh, calc(100% - 178px));
    border-radius: 20px 20px 16px 16px;
  }

  #chats-page .team-tools-panel section {
    max-height: none;
  }

  #chats-page .team-tools-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  #chats-page .team-tools-heading span {
    max-width: min(46vw, 160px);
  }

  #chats-page .team-participant-action {
    grid-template-columns: minmax(0, 1fr);
  }

  #chats-page .team-participant-action .compact-action,
  #chats-page .internal-note-form button {
    width: 100%;
  }

  #chats-page .chat-tag-picker,
  #chats-page .canned-reply-list,
  #chats-page .internal-note-list {
    max-height: min(148px, 22dvh);
  }

  #chats-page .composer {
    min-height: 64px;
  }

  .topbar-activity {
    max-height: 72px;
  }

  .notification-panel {
    max-height: calc(100dvh - 132px - env(safe-area-inset-bottom));
  }

  .notification-item {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 0;
  }

  .notification-item-actions {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, auto));
    justify-content: start;
    gap: 6px;
  }

  .toast-region {
    top: auto;
    bottom: calc(84px + env(safe-area-inset-bottom));
    max-height: min(45dvh, 340px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}

@media (max-width: 520px) {
  #chats-page .team-tools-toggle {
    grid-template-columns: 32px minmax(0, 1fr);
    min-height: 46px;
  }

  #chats-page .team-tools-toggle strong {
    font-size: 0.82rem;
  }

  #chats-page .team-tools-toggle small {
    font-size: 0.68rem;
  }

  #chats-page .team-tools-panel {
    left: 6px;
    right: 6px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    max-height: min(43dvh, calc(100% - 166px));
    padding: 9px;
  }

  #chats-page .team-tools-panel-header {
    margin: -9px -9px 0;
    padding: 9px;
  }

  #chats-page .team-tools-panel section {
    padding: 9px;
  }

  #chats-page .composer {
    grid-template-columns: 38px minmax(0, 1fr) 38px 42px;
    min-height: 60px;
  }

  .notification-panel {
    left: 8px;
    right: 8px;
    max-height: calc(100dvh - 124px - env(safe-area-inset-bottom));
    padding: 9px;
  }

  .notification-panel-actions {
    grid-template-columns: 1fr 1fr;
  }

  .notification-item-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .notification-item-action,
  .notification-more {
    width: 100%;
  }

  .toast-region {
    right: 8px;
    left: 8px;
    width: auto;
  }
}

/* WhaChat v0.36 emergency UI reliability: alerts, chat controls, mobile chatbox */
.topbar,
.notification-center {
  position: relative;
}

.topbar {
  z-index: 1200;
}

.notification-center {
  z-index: 2200;
}

.topbar-activity {
  z-index: 2300 !important;
}

.notification-panel {
  z-index: 2400 !important;
  isolation: isolate;
}

.notification-panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
}

.notification-detail-modal {
  z-index: 2600 !important;
}

.toast-region {
  z-index: 2500 !important;
}

.mobile-tabbar {
  z-index: 1150;
}

#chats-page .conversation-header {
  z-index: 80;
}

#chats-page .header-menu-button,
#chats-page .team-tools-toggle {
  border: 1px solid rgba(0, 168, 80, 0.28);
  background:
    linear-gradient(135deg, rgba(233, 255, 244, 0.98), rgba(255, 250, 232, 0.84)),
    #fff;
  color: var(--brand-deep);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.62),
    0 12px 28px rgba(0, 64, 46, 0.13);
}

#chats-page .header-menu-button:hover,
#chats-page .header-menu-button:focus-visible,
#chats-page .team-tools-toggle:hover,
#chats-page .team-tools-toggle:focus-visible,
#chats-page .team-tools-toggle.active {
  border-color: rgba(0, 168, 80, 0.42);
  background:
    linear-gradient(135deg, rgba(220, 255, 238, 1), rgba(255, 248, 219, 0.94)),
    #fff;
  color: #059809;
}

#chats-page .header-menu-button .wc-icon,
#chats-page .team-tools-toggle > .wc-icon,
#chats-page .team-tools-panel-header button .wc-icon,
#chats-page .admin-menu button .wc-icon {
  background: #059809 !important;
  color: #059809 !important;
  filter:
    drop-shadow(0 0 0 currentColor)
    drop-shadow(0 0 0 currentColor);
}

#chats-page .header-menu-button .wc-icon {
  width: 25px;
  height: 25px;
}

#chats-page .team-tools-toggle > .wc-icon {
  width: 32px;
  height: 32px;
  color: #059809 !important;
}

#chats-page .admin-menu {
  z-index: 100;
  border: 1px solid rgba(0, 168, 80, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(241, 255, 248, 0.97)),
    #fff;
  box-shadow: 0 28px 76px rgba(6, 35, 24, 0.2);
}

#chats-page .admin-menu::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, #059809, var(--brand), var(--gold));
}

#chats-page .admin-menu button {
  color: var(--brand-deep);
}

#chats-page .admin-menu button:hover,
#chats-page .admin-menu button:focus-visible {
  background: rgba(0, 168, 80, 0.09);
  color: #059809;
}

#chats-page #adminDeleteChat {
  color: #b42318;
}

#chats-page #adminDeleteChat:hover,
#chats-page #adminDeleteChat:focus-visible {
  background: rgba(180, 35, 24, 0.08);
  color: #b42318;
}

#chats-page #adminDeleteChat .wc-icon {
  background: #b42318 !important;
  color: #b42318 !important;
}

#chats-page .team-inbox-bar {
  z-index: 46;
}

#chats-page .team-tools-panel {
  z-index: 70;
  align-content: start;
  grid-auto-rows: max-content;
  border: 1px solid rgba(0, 168, 80, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(244, 255, 249, 0.98)),
    #fff;
  box-shadow: 0 30px 82px rgba(6, 35, 24, 0.22);
}

#chats-page .team-tools-panel:not(.hidden) {
  display: grid;
}

#chats-page .team-tools-panel section {
  align-content: start;
  overflow: hidden;
}

#chats-page .team-routing-section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#chats-page .team-routing-section .team-tools-heading,
#chats-page .team-routing-section .team-participant-invite,
#chats-page .team-routing-section .team-participant-list {
  grid-column: 1 / -1;
}

#chats-page .team-routing-section label,
#chats-page .team-participant-invite,
#chats-page .internal-note-form {
  gap: 6px;
  font-size: 0.72rem;
  line-height: 1.25;
}

#chats-page .team-routing-section select,
#chats-page .team-participant-action select,
#chats-page .internal-note-form input {
  min-height: 42px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#chats-page .team-participant-action {
  grid-template-columns: minmax(0, 1fr) auto;
}

#chats-page .team-participant-list,
#chats-page .chat-tag-picker,
#chats-page .canned-reply-list,
#chats-page .internal-note-list {
  max-height: min(178px, 22dvh);
}

#chats-page .composer {
  z-index: 90;
}

#chats-page .composer .tool-button {
  color: var(--brand-deep);
}

#chats-page .composer .tool-button:hover,
#chats-page .composer .tool-button:focus-visible {
  color: #059809;
}

@media (max-width: 820px) {
  .dashboard:not(.mobile-nav-ready) .mobile-tabbar {
    display: none;
    opacity: 0;
    pointer-events: none;
  }

  .dashboard.chat-open .mobile-tabbar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 18px));
  }

  .dashboard.chat-open .app-main {
    padding-bottom: 0;
  }

  .dashboard.chat-open #chats-page.page.active {
    height: calc(100dvh - 62px);
    padding-bottom: 0;
  }

  .dashboard.chat-open #chats-page .chat-workspace,
  .dashboard.chat-open #chats-page .conversation {
    min-height: 0;
  }

  .dashboard.chat-open #chats-page .conversation {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    height: 100%;
  }

  #chats-page .conversation-header {
    min-height: 60px;
    padding-block: max(8px, env(safe-area-inset-top)) 8px;
  }

  #chats-page .team-inbox-bar {
    padding: 6px 8px;
  }

  #chats-page .team-tools-toggle {
    min-height: 46px;
    border-radius: 14px;
  }

  #chats-page .team-tools-toggle strong {
    font-size: 0.8rem;
  }

  #chats-page .team-tools-toggle small {
    font-size: 0.66rem;
  }

  #chats-page .messages {
    padding-bottom: 12px;
  }

  #chats-page .team-tools-panel {
    left: 8px;
    right: 8px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    max-height: min(42dvh, calc(100% - 150px));
    padding: 10px;
    border-radius: 20px 20px 16px 16px;
  }

  #chats-page .team-tools-panel-header {
    top: -10px;
    margin: -10px -10px 0;
    padding: 10px;
  }

  #chats-page .team-tools-panel section {
    padding: 10px;
    border-radius: 16px;
  }

  #chats-page .team-routing-section {
    grid-template-columns: 1fr;
  }

  #chats-page .team-participant-action,
  #chats-page .internal-note-form {
    grid-template-columns: 1fr;
  }

  #chats-page .team-participant-action .compact-action,
  #chats-page .internal-note-form button {
    width: 100%;
  }

  #chats-page .team-participant-list,
  #chats-page .chat-tag-picker,
  #chats-page .canned-reply-list,
  #chats-page .internal-note-list {
    max-height: min(132px, 18dvh);
  }

  #chats-page .composer {
    min-height: 58px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .topbar-activity {
    z-index: 2300 !important;
  }

  .notification-panel {
    top: calc(66px + env(safe-area-inset-top));
    max-height: calc(100dvh - 92px - env(safe-area-inset-bottom));
  }

  .notification-list {
    max-height: calc(100dvh - 228px - env(safe-area-inset-bottom));
  }

  .toast-region {
    bottom: calc(16px + env(safe-area-inset-bottom));
    max-height: min(46dvh, 360px);
  }
}

@media (max-width: 520px) {
  .dashboard.chat-open #chats-page.page.active {
    height: calc(100dvh - 58px);
  }

  #chats-page .conversation-header {
    grid-template-columns: 40px 42px minmax(0, 1fr) 40px;
    gap: 8px;
  }

  #chats-page .admin-menu {
    left: 8px;
    right: 8px;
  }

  #chats-page .team-tools-panel {
    max-height: min(39dvh, calc(100% - 138px));
  }

  #chats-page .team-tools-heading {
    gap: 6px;
  }

  #chats-page .team-tools-heading strong {
    font-size: 0.76rem;
  }

  #chats-page .team-tools-heading span {
    max-width: 46vw;
    font-size: 0.62rem;
  }

  #chats-page .composer {
    grid-template-columns: 38px minmax(0, 1fr) 38px 42px;
  }

  .notification-panel {
    top: calc(60px + env(safe-area-inset-top));
    max-height: calc(100dvh - 82px - env(safe-area-inset-bottom));
  }

  .notification-list {
    max-height: calc(100dvh - 218px - env(safe-area-inset-bottom));
  }
}

/* WhaChat v0.36b dashboard balance: mobile drawer, chat identity, footer, visitor cards, update popup */
.update-popup-card {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2550;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: min(430px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid rgba(0, 168, 80, 0.22);
  border-radius: 22px;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 193, 45, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(241, 255, 248, 0.98)),
    #fff;
  color: var(--ink);
  box-shadow: 0 30px 84px rgba(6, 35, 24, 0.24);
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 180ms ease, transform 180ms ease;
}

.update-popup-card.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.update-popup-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff;
  box-shadow: 0 14px 28px rgba(0, 168, 80, 0.22);
}

.update-popup-icon .wc-icon,
.update-popup-open .wc-icon,
.update-popup-close .wc-icon {
  background: currentColor;
  color: currentColor;
}

.update-popup-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.update-popup-copy small {
  color: var(--brand-dark);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.update-popup-copy strong {
  color: var(--brand-deep);
  font-size: 0.95rem;
  font-weight: 950;
}

.update-popup-copy span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.35;
}

.update-popup-actions {
  display: grid;
  gap: 7px;
  justify-items: end;
}

.update-popup-open,
.update-popup-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border-radius: 999px;
  font-weight: 950;
}

.update-popup-open {
  padding: 0 11px;
  background: var(--brand-light);
  color: var(--brand-deep);
}

.update-popup-close {
  width: 36px;
  background: #fff;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px rgba(20, 32, 38, 0.1);
}

.dashboard.nav-open::before {
  z-index: 2690;
}

.dashboard.nav-open .app-nav {
  z-index: 2700;
}

#chats-page .conversation {
  position: relative;
}

#chats-page .visitor-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--brand-deep);
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

#chats-page .visitor-avatar.flag-avatar {
  background: #fff;
  font-size: 1.34rem;
}

#chats-page .back-button {
  color: var(--brand-deep);
}

#chats-page .back-button .wc-icon {
  background: #059809 !important;
  color: #059809 !important;
}

#chats-page .team-tools-panel {
  top: calc(74px + var(--chat-toolbar-height) + 8px);
  bottom: 96px;
  max-height: none;
}

#visitors-page .visitor-item {
  align-items: start;
  overflow: hidden;
}

#visitors-page .visitor-item-copy,
#visitors-page .visitor-item-meta {
  min-width: 0;
  max-width: 100%;
}

#visitors-page .visitor-item-copy small {
  display: -webkit-box;
  max-width: 100%;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#visitors-page .visitor-item-subline,
#visitors-page .visitor-item-meta {
  overflow: hidden;
}

#visitors-page .visitor-item-subline i,
#visitors-page .visitor-item-meta b,
#visitors-page .visitor-item-meta small {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 820px) {
  .app-nav {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(292px, 86vw);
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .nav-brand {
    min-height: 62px;
    margin-bottom: 9px;
    padding: 9px;
    align-items: center;
  }

  .nav-brand img {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 13px;
  }

  .nav-brand div {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .nav-brand strong {
    font-size: 0.9rem;
  }

  .nav-brand span {
    font-size: 0.68rem;
  }

  .nav-menu {
    min-height: 0;
    padding: 2px 3px 12px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-menu button {
    min-height: 42px;
    padding: 5px 9px;
    font-size: 0.82rem;
  }

  .nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 11px;
  }

  .nav-account {
    align-self: end;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
    margin-top: 8px;
    padding: 9px;
    border-radius: 16px;
  }

  .nav-account-avatar {
    width: 40px;
    height: 40px;
  }

  .nav-account-copy strong {
    font-size: 0.8rem;
  }

  .nav-account-copy span {
    font-size: 0.67rem;
  }

  .nav-logout {
    min-height: 40px;
    padding: 0 10px;
    border-radius: 14px;
    font-size: 0.74rem;
  }

  .dashboard.mobile-nav-ready:not(.chat-open) .mobile-tabbar {
    display: grid;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  #tickets-page .ticket-hero {
    align-items: start;
  }

  #tickets-page .ticket-hero h2 {
    font-size: 1.35rem;
  }

  #tickets-page .ticket-hero p {
    font-size: 0.82rem;
  }

  .ticket-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ticket-summary-grid article {
    min-height: 74px;
    padding: 12px;
  }

  .ticket-summary-grid strong {
    font-size: 1.35rem;
  }

  .ticket-workspace {
    grid-template-columns: 1fr;
  }

  .ticket-board-heading {
    align-items: stretch;
  }

  .ticket-filter-row {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .ticket-filter-row button {
    flex: 0 0 auto;
  }

  .ticket-board {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .ticket-flow-head {
    align-items: start;
  }

  .ticket-flow-head strong {
    font-size: 0.95rem;
  }

  .ticket-status-pill {
    min-height: 28px;
    padding: 6px 8px;
    font-size: 0.62rem;
  }

  .ticket-manager-grid {
    grid-template-columns: 1fr;
  }

  .ticket-quick-actions {
    justify-content: stretch;
  }

  .ticket-quick-actions button,
  .ticket-manager-grid > button,
  #tickets-page .primary-action,
  #tickets-page .secondary-action {
    width: 100%;
  }

  .dashboard.chat-open #chats-page .back-button {
    display: grid !important;
  }

  .dashboard.chat-open #chats-page .visitor-avatar {
    display: grid;
  }

  #chats-page .team-tools-panel {
    top: calc(60px + 46px + 8px);
    bottom: calc(68px + env(safe-area-inset-bottom));
    max-height: none;
  }

  .update-popup-card {
    left: 12px;
    right: 12px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: auto;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 12px;
    border-radius: 18px;
  }

  .dashboard.chat-open ~ .update-popup-card {
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 520px) {
  .app-nav {
    width: min(286px, 88vw);
  }

  .nav-section-label {
    margin: 8px 7px 2px;
    font-size: 0.58rem;
  }

  .nav-menu {
    gap: 5px;
  }

  .nav-menu button {
    min-height: 39px;
    border-radius: 11px;
    font-size: 0.78rem;
  }

  .nav-icon {
    width: 29px;
    height: 29px;
    padding: 5px;
  }

  .nav-account {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .nav-account-avatar {
    width: 36px;
    height: 36px;
  }

  #chats-page .visitor-avatar {
    width: 40px;
    height: 40px;
  }

  #chats-page .visitor-avatar.flag-avatar {
    font-size: 1.18rem;
  }

  #chats-page .team-tools-panel {
    top: calc(58px + 46px + 7px);
    bottom: calc(64px + env(safe-area-inset-bottom));
  }

  #visitors-page .visitor-item {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 0;
    padding: 10px;
  }

  #visitors-page .visitor-item-meta {
    gap: 4px;
  }

  .update-popup-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .update-popup-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }

  .update-popup-actions {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) 40px;
    width: 100%;
  }

  .update-popup-open,
  .update-popup-close {
    width: 100%;
  }
}

/* WhaChat v0.48b brand asset polish */
.auth-story-logo,
.auth-logo {
  aspect-ratio: auto;
  object-fit: contain;
}

.auth-story-logo {
  width: min(240px, 58%);
  max-height: 92px;
}

.auth-logo {
  width: min(180px, 56vw);
  max-height: 62px;
}

@media (max-width: 820px) {
  .auth-story-logo {
    width: min(178px, 60vw);
    max-height: 64px;
  }

  .auth-logo {
    width: min(154px, 52vw);
    max-height: 52px;
  }
}

/* WhaChat v0.50 gateway renewals */
.owner-payment-card {
  background:
    linear-gradient(135deg, rgba(0, 168, 80, 0.09), transparent 58%),
    linear-gradient(135deg, rgba(255, 193, 45, 0.12), transparent 78%),
    #fbfdfc;
}

.owner-receipt-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.owner-receipt-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid rgba(0, 168, 80, 0.13);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
}

.owner-payment-list,
.billing-history-list {
  display: grid;
  gap: 8px;
}

.owner-payment-row,
.billing-history-item,
.owner-payment-empty,
.billing-history-empty {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(20, 32, 38, 0.08);
  border-radius: 8px;
  background: #fff;
}

.owner-payment-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr) auto;
  align-items: center;
}

.billing-history-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.owner-payment-row div,
.billing-history-item div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.owner-payment-row strong,
.billing-history-item strong,
.owner-payment-empty strong,
.billing-history-empty strong {
  color: var(--ink);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.owner-payment-row span,
.billing-history-item span,
.owner-payment-empty span,
.billing-history-empty span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.owner-payment-row em,
.billing-history-item em {
  justify-self: start;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4f2;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 950;
  text-transform: capitalize;
}

.owner-payment-row em.paid,
.billing-history-item em.paid,
.owner-payment-row em.waived,
.billing-history-item em.waived {
  background: rgba(0, 168, 80, 0.12);
  color: var(--brand-dark);
}

.owner-payment-row em.pending,
.billing-history-item em.pending,
.owner-payment-row em.refunded,
.billing-history-item em.refunded {
  background: var(--gold-soft);
  color: #8a5d00;
}

.owner-payment-row em.failed,
.billing-history-item em.failed {
  background: rgba(229, 72, 77, 0.1);
  color: var(--danger);
}

.owner-payment-row button {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 950;
}

@media (max-width: 820px) {
  .owner-hero-actions {
    justify-content: stretch;
  }

  .owner-hero-actions button {
    width: 100%;
  }

  .owner-receipt-options,
  .owner-payment-row,
  .billing-history-item {
    grid-template-columns: 1fr;
  }

  .owner-payment-row button {
    width: 100%;
  }
}

/* Keep authenticated refreshes from flashing the login panel. */
html.admin-token-boot #loginPanel {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* WhaChat v0.52 - Admin Users desktop layout repair */
#admins-page .team-layout {
  grid-template-columns: minmax(560px, 1.42fr) minmax(360px, 0.86fr);
  gap: 24px;
  align-items: start;
}

#admins-page .team-member-list {
  gap: 16px;
  min-width: 0;
}

#admins-page .team-member-card.agent-management-card {
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 18px;
  overflow: visible;
  border-radius: 20px;
}

#admins-page .team-member-card.agent-management-card > .agent-edit-grid {
  grid-column: 1 / -1;
}

#admins-page .team-avatar.agent-public-avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
}

#admins-page .agent-public-avatar > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#admins-page .agent-public-badge {
  right: -4px;
  bottom: -4px;
  width: 19px;
  height: 19px;
  padding: 2px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(0, 64, 46, 0.16);
}

#admins-page .team-member-copy {
  min-width: 0;
  align-self: center;
}

#admins-page .team-member-copy strong {
  display: block;
  max-width: 100%;
  font-size: 1.04rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

#admins-page .team-member-copy small,
#admins-page .team-member-copy em {
  display: block;
  max-width: 100%;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#admins-page .team-member-copy small {
  margin-top: 5px;
  color: var(--brand-deep);
  font-size: 0.82rem;
  font-weight: 900;
}

#admins-page .team-member-copy em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 750;
}

#admins-page .agent-edit-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 253, 250, 0.92));
}

#admins-page .agent-edit-grid label,
#admins-page .agent-edit-grid .team-role-select,
#admins-page .agent-edit-grid .team-role-pill,
#admins-page .agent-active-toggle,
#admins-page .agent-action-row {
  min-width: 0;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}

#admins-page .agent-edit-grid label,
#admins-page .agent-edit-grid .team-role-select {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: none;
}

#admins-page .agent-edit-grid input,
#admins-page .agent-edit-grid select {
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.2;
}

#admins-page .agent-email-field,
#admins-page .agent-action-row {
  grid-column: 1 / -1;
}

#admins-page .agent-asset-field {
  min-height: 78px;
}

#admins-page .agent-asset-control {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(0, 168, 80, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

#admins-page .agent-asset-control img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
}

#admins-page .agent-active-toggle {
  min-height: 46px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: var(--brand-deep);
  font-size: 0.86rem;
  font-weight: 900;
}

#admins-page .agent-active-toggle input {
  width: 42px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 auto;
  accent-color: var(--brand);
}

#admins-page .team-role-select,
#admins-page .agent-active-field,
#admins-page .team-role-pill.agent-self-note {
  align-self: stretch;
}

#admins-page .agent-edit-grid > .team-role-pill {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  padding-inline: 12px;
  border-radius: 14px;
}

#admins-page .agent-action-row,
#account-page .agent-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

#admins-page .agent-reset-field {
  flex: 1 1 260px;
}

#admins-page .agent-save-button {
  flex: 0 0 auto;
  min-width: 190px;
  min-height: 46px;
  padding-inline: 18px;
  white-space: nowrap;
}

#admins-page .team-form {
  gap: 14px;
}

#admins-page #teamAdminForm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#admins-page #teamAdminForm label {
  min-width: 0;
  word-break: normal;
  overflow-wrap: normal;
}

#admins-page #teamAdminForm label:has(input[name="email"]),
#admins-page #teamAdminForm label:has(input[name="password"]),
#admins-page #teamAdminForm .primary-action {
  grid-column: 1 / -1;
}

#admins-page #teamAdminForm .primary-action {
  width: 100%;
  min-height: 48px;
}

@media (max-width: 1320px) and (min-width: 1181px) {
  #admins-page .team-layout {
    grid-template-columns: minmax(500px, 1.28fr) minmax(340px, 0.9fr);
    gap: 20px;
  }

  #admins-page .agent-edit-grid {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
  }
}

@media (max-width: 1180px) {
  #admins-page .team-layout {
    grid-template-columns: 1fr;
  }

  #admins-page .team-member-card.agent-management-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  #admins-page .agent-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #admins-page #teamAdminForm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  #admins-page .team-member-card.agent-management-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  #admins-page .agent-edit-grid,
  #admins-page #teamAdminForm {
    grid-template-columns: 1fr;
  }

  #admins-page .agent-email-field,
  #admins-page .agent-action-row,
  #admins-page #teamAdminForm label:has(input[name="email"]),
  #admins-page #teamAdminForm label:has(input[name="password"]),
  #admins-page #teamAdminForm .primary-action {
    grid-column: auto;
  }

  #admins-page .agent-action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  #admins-page .agent-save-button {
    width: 100%;
    min-width: 0;
  }
}

/* WhaChat v0.53 - Analytics Core */
#analytics-page {
  overflow-x: hidden;
}

.analytics-center {
  display: grid;
  gap: 18px;
  width: min(1220px, 100%);
}

.analytics-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border: 1px solid rgba(0, 168, 80, 0.16);
  border-radius: 14px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 193, 45, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(235, 255, 244, 0.94));
  box-shadow: 0 18px 46px rgba(4, 80, 48, 0.1);
}

.analytics-hero h2 {
  margin: 4px 0 8px;
  color: var(--ink);
  font-size: clamp(1.38rem, 2.6vw, 2.1rem);
  line-height: 1.12;
}

.analytics-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.analytics-hero-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
  min-width: min(360px, 100%);
}

.analytics-range-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(0, 168, 80, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.54);
}

.analytics-range-tabs button,
.analytics-refresh-button {
  min-width: 52px;
  min-height: 42px;
  border-radius: 999px;
  color: var(--brand-dark);
  font-weight: 950;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.analytics-range-tabs button:hover,
.analytics-range-tabs button:focus-visible,
.analytics-refresh-button:hover,
.analytics-refresh-button:focus-visible {
  transform: translateY(-1px);
}

.analytics-range-tabs button.active {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  box-shadow: 0 10px 22px rgba(0, 168, 80, 0.22);
}

.analytics-refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.analytics-kpi-grid article,
.analytics-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 168, 80, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 255, 251, 0.95));
  box-shadow: 0 14px 34px rgba(20, 32, 38, 0.08);
}

.analytics-kpi-grid article {
  display: grid;
  gap: 6px;
  min-height: 150px;
  padding: 18px;
}

.analytics-kpi-grid article::after,
.analytics-panel::after {
  content: "";
  position: absolute;
  inset: auto -18px -24px auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(255, 193, 45, 0.18);
  pointer-events: none;
}

.analytics-kpi-grid .wc-icon {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 12px;
  background: rgba(0, 168, 80, 0.1);
  color: var(--brand-dark);
}

.analytics-kpi-grid small,
.analytics-panel span,
.analytics-panel small {
  color: var(--muted);
  font-weight: 850;
}

.analytics-kpi-grid strong {
  color: var(--ink);
  font-size: clamp(1.45rem, 2.6vw, 2.2rem);
  line-height: 1;
}

.analytics-kpi-grid em {
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 900;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.analytics-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 300px;
  padding: 18px;
}

.analytics-panel > * {
  position: relative;
  z-index: 1;
}

.analytics-panel .settings-heading {
  gap: 12px;
  margin: 0;
}

.analytics-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(0, 168, 80, 0.1);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
}

.analytics-pill.pro {
  background: rgba(255, 193, 45, 0.22);
  color: #6e4b00;
}

.analytics-pill.locked {
  background: rgba(229, 72, 77, 0.1);
  color: var(--danger);
}

.analytics-response-grid,
.analytics-status-grid,
.analytics-ticket-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.analytics-response-grid div,
.analytics-status-grid div,
.analytics-ticket-grid div {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 12px;
  border: 1px solid rgba(0, 168, 80, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.analytics-response-grid strong,
.analytics-status-grid strong,
.analytics-ticket-grid strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.analytics-mini-chart {
  display: flex;
  align-items: end;
  gap: 8px;
  min-height: 150px;
  padding: 14px 10px 8px;
  border: 1px solid rgba(0, 168, 80, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(to top, rgba(0, 168, 80, 0.06) 1px, transparent 1px) 0 0 / 100% 25%,
    rgba(255, 255, 255, 0.62);
  overflow-x: auto;
}

.analytics-bar {
  display: grid;
  align-items: end;
  justify-items: center;
  gap: 8px;
  flex: 1 0 38px;
  min-width: 38px;
  height: 126px;
}

.analytics-bar i {
  display: block;
  width: 100%;
  height: var(--bar-height);
  min-height: 8px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, var(--gold), var(--brand));
  box-shadow: 0 10px 18px rgba(0, 168, 80, 0.18);
}

.analytics-bar small {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.analytics-list,
.analytics-agent-list,
.analytics-funnel {
  display: grid;
  gap: 10px;
}

.analytics-row,
.analytics-funnel article,
.analytics-agent-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(0, 168, 80, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.analytics-row span,
.analytics-funnel span,
.analytics-agent-card span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.analytics-row strong,
.analytics-funnel strong,
.analytics-agent-card strong {
  color: var(--ink);
  line-height: 1.2;
}

.analytics-row em,
.analytics-funnel em {
  color: var(--brand-dark);
  font-style: normal;
  font-weight: 950;
}

.analytics-row i,
.analytics-funnel i {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 168, 80, 0.1);
}

.analytics-row i::after,
.analytics-funnel i::after {
  content: "";
  display: block;
  width: var(--metric-width);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--metric-color, var(--brand)), var(--gold));
}

.analytics-row.compact {
  min-height: 62px;
}

.analytics-priority-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analytics-mini-pill,
.analytics-mini-empty {
  display: inline-grid;
  gap: 2px;
  min-width: 118px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 168, 80, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.analytics-mini-pill.urgent,
.analytics-mini-pill.bug {
  border-color: rgba(229, 72, 77, 0.2);
  background: rgba(255, 240, 240, 0.74);
}

.analytics-mini-pill.important,
.analytics-mini-pill.billing {
  border-color: rgba(255, 193, 45, 0.28);
  background: rgba(255, 248, 226, 0.78);
}

.analytics-mini-pill strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.analytics-mini-pill em,
.analytics-mini-empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 850;
}

.analytics-agent-card {
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(70px, auto));
}

.analytics-agent-card div {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.analytics-agent-card b {
  color: var(--brand-dark);
  font-size: 1.05rem;
}

.analytics-agent-card div small {
  font-size: 0.72rem;
}

.analytics-empty {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px dashed rgba(0, 168, 80, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
}

.analytics-empty.inline {
  width: 100%;
}

.analytics-empty.error {
  border-color: rgba(229, 72, 77, 0.28);
  background: rgba(255, 240, 240, 0.72);
}

.analytics-empty.pro {
  border-color: rgba(255, 193, 45, 0.36);
  background:
    linear-gradient(135deg, rgba(255, 193, 45, 0.16), rgba(255, 255, 255, 0.82));
}

.analytics-empty strong {
  color: var(--ink);
}

.analytics-empty span {
  line-height: 1.45;
}

.analytics-chart-loading {
  flex: 1 0 54px;
  height: 80px;
  border-radius: 999px 999px 10px 10px;
  background: linear-gradient(90deg, rgba(0, 168, 80, 0.08), rgba(255, 193, 45, 0.18), rgba(0, 168, 80, 0.08));
  background-size: 200% 100%;
  animation: analyticsShimmer 1.2s ease-in-out infinite;
}

@keyframes analyticsShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: -200% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .analytics-chart-loading {
    animation: none;
  }
}

@media (max-width: 1180px) {
  .analytics-hero,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-hero-actions {
    justify-items: start;
    min-width: 0;
  }

  .analytics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .analytics-center {
    gap: 14px;
  }

  .analytics-hero,
  .analytics-panel,
  .analytics-kpi-grid article {
    border-radius: 12px;
    padding: 15px;
  }

  .analytics-hero h2 {
    font-size: 1.34rem;
  }

  .analytics-hero p {
    font-size: 0.9rem;
  }

  .analytics-range-tabs {
    width: 100%;
    justify-content: space-between;
    border-radius: 14px;
  }

  .analytics-range-tabs button {
    flex: 1 1 58px;
  }

  .analytics-refresh-button {
    width: 100%;
  }

  .analytics-kpi-grid,
  .analytics-response-grid,
  .analytics-status-grid,
  .analytics-ticket-grid {
    grid-template-columns: 1fr;
  }

  .analytics-kpi-grid article {
    min-height: 124px;
  }

  .analytics-kpi-grid strong {
    font-size: 1.55rem;
  }

  .analytics-panel .settings-heading {
    align-items: start;
  }

  .analytics-mini-chart {
    min-height: 132px;
  }

  .analytics-bar {
    height: 108px;
    flex-basis: 34px;
    min-width: 34px;
  }

  .analytics-agent-card {
    grid-template-columns: 1fr;
  }

  .analytics-agent-card div {
    grid-template-columns: auto 1fr;
    justify-items: start;
    align-items: baseline;
  }

  .analytics-mini-pill,
  .analytics-mini-empty {
    flex: 1 1 128px;
  }
}

/* WhaChat v0.54 - one-time pricing advertisement */
body.admin-promo-open {
  overflow: hidden;
}

.admin-promo-layer {
  position: fixed;
  inset: 0;
  z-index: 2800;
  display: grid;
  place-items: center;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  overflow: auto;
  overscroll-behavior: contain;
  background: rgba(2, 24, 16, 0.48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.admin-promo-layer.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.admin-promo-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  width: min(460px, calc(100vw - 48px), calc(100dvh - 48px));
  height: auto;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 38px 110px rgba(0, 12, 8, 0.46);
  transform: translateY(18px) scale(0.985);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.admin-promo-layer.is-visible .admin-promo-card {
  transform: translateY(0) scale(1);
}

.admin-promo-ad-label {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 28px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 6px;
  background: rgba(2, 45, 29, 0.9);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 24, 16, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1;
  pointer-events: none;
}

.admin-promo-visual {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #f6faf7;
  cursor: pointer;
}

.admin-promo-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
  transition: transform 240ms ease;
}

.admin-promo-visual:hover img {
  transform: scale(1.012);
}

.admin-promo-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 64px 30px 30px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 203, 50, 0.72) rgba(255, 255, 255, 0.1);
  background: #063b29;
  color: #ffffff;
}

.admin-promo-kicker {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 203, 50, 0.48);
  border-radius: 8px;
  background: rgba(255, 203, 50, 0.12);
  color: #ffcf3e;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-promo-kicker .wc-icon {
  --wc-icon-size: 17px;
}

.admin-promo-copy h2 {
  margin: 20px 0 0;
  color: #ffffff;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
}

.admin-promo-copy > p {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.55;
}

.admin-promo-benefits {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.admin-promo-benefits li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: #eefbf5;
  font-size: 0.79rem;
  font-weight: 750;
  line-height: 1.4;
}

.admin-promo-benefits .wc-icon {
  --wc-icon-size: 18px;
  margin-top: 1px;
  color: #ffcb32;
}

.admin-promo-actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.admin-promo-primary,
.admin-promo-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.admin-promo-primary {
  background: #ffcb32;
  color: #063b29;
  box-shadow: 0 14px 34px rgba(255, 203, 50, 0.2);
}

.admin-promo-secondary {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.admin-promo-primary:hover,
.admin-promo-primary:focus-visible,
.admin-promo-secondary:hover,
.admin-promo-secondary:focus-visible {
  transform: translateY(-1px);
}

.admin-promo-primary:hover,
.admin-promo-primary:focus-visible {
  background: #ffd85f;
  box-shadow: 0 17px 40px rgba(255, 203, 50, 0.28);
}

.admin-promo-secondary:hover,
.admin-promo-secondary:focus-visible {
  border-color: rgba(255, 255, 255, 0.54);
  background: rgba(255, 255, 255, 0.14);
}

.admin-promo-primary:focus-visible,
.admin-promo-secondary:focus-visible,
.admin-promo-visual:focus-visible,
.admin-promo-close:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.admin-promo-note {
  display: block;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.45;
  text-align: center;
}

.admin-promo-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(0, 106, 55, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: #075a3b;
  box-shadow: 0 12px 30px rgba(0, 24, 16, 0.2);
  transition: transform 180ms ease, background-color 180ms ease;
}

.admin-promo-close:hover {
  transform: scale(1.03);
  background: #fff8df;
}

.admin-promo-close .wc-icon {
  --wc-icon-size: 19px;
}

@media (max-width: 820px) {
  .admin-promo-layer {
    align-items: center;
    padding:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .admin-promo-card {
    grid-template-columns: 1fr;
    width: min(400px, calc(100vw - 32px), calc(100dvh - 32px));
    height: auto;
    max-height: none;
    aspect-ratio: 1 / 1;
    overflow: hidden;
  }

  .admin-promo-visual {
    height: 100%;
    min-height: 0;
    padding: 0;
  }

  .admin-promo-copy {
    padding: 22px 18px max(20px, env(safe-area-inset-bottom));
    overflow: visible;
  }

  .admin-promo-copy h2 {
    max-width: calc(100% - 34px);
    margin-top: 16px;
    font-size: 1.55rem;
  }

  .admin-promo-copy > p {
    margin-top: 10px;
    font-size: 0.82rem;
  }

  .admin-promo-benefits {
    gap: 8px;
    margin-top: 15px;
  }

  .admin-promo-actions {
    grid-template-columns: 1fr 1fr;
    margin-top: 18px;
  }

  .admin-promo-close {
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.96);
    color: #075a3b;
  }

  .admin-promo-ad-label {
    top: 10px;
    left: 10px;
  }
}

@media (max-width: 480px) {
  .admin-promo-visual {
    height: 100%;
    min-height: 0;
  }

  .admin-promo-actions {
    grid-template-columns: 1fr;
  }

  .admin-promo-primary,
  .admin-promo-secondary {
    min-height: 46px;
  }

  .admin-promo-copy h2 {
    font-size: 1.35rem;
  }
}

@media (max-height: 590px) and (min-width: 821px) {
  .admin-promo-copy {
    justify-content: flex-start;
    padding: 52px 22px 22px;
  }

  .admin-promo-copy h2 {
    margin-top: 12px;
    font-size: 1.46rem;
  }

  .admin-promo-copy > p,
  .admin-promo-benefits,
  .admin-promo-actions {
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-promo-layer,
  .admin-promo-card,
  .admin-promo-primary,
  .admin-promo-secondary,
  .admin-promo-close {
    transition-duration: 0.01ms !important;
  }

  .admin-promo-card,
  .admin-promo-visual img,
  .admin-promo-primary:hover,
  .admin-promo-secondary:hover,
  .admin-promo-close:hover {
    transform: none;
  }
}

/* WhaChat v1.0 Admina shell: final cascade layer over the existing live dashboard. */
.dashboard.admina-shell {
  isolation: isolate;
  border: 1px solid rgba(8, 47, 31, 0.14);
  background: #edf5f0;
  box-shadow: 0 28px 72px rgba(4, 32, 20, 0.18);
}

.dashboard.admina-shell .app-nav {
  border-right-color: rgba(255, 255, 255, 0.1);
}

.dashboard.admina-shell .nav-brand,
.dashboard.admina-shell .nav-account {
  border-color: rgba(255, 255, 255, 0.13);
}

.dashboard.admina-shell .app-main {
  background:
    linear-gradient(180deg, rgba(0, 168, 80, 0.025), transparent 190px),
    #f5f8f6;
}

.dashboard.admina-shell .topbar {
  border-bottom-color: rgba(10, 63, 39, 0.1);
  box-shadow: 0 8px 28px rgba(14, 49, 34, 0.035);
}

.dashboard.admina-shell .page.active {
  animation: whachat-page-enter 180ms ease both;
}

.dashboard.admina-shell :where(.nav-menu button, .mobile-tabbar button)[aria-current="page"] {
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .dashboard.admina-shell .page.active {
    animation: none;
  }
}

/* Admina integration: classic SaaS shell using the licensed local Remix icon set. */
.dashboard.admina-shell {
  width: min(1760px, calc(100vw - 32px));
  border: 1px solid #dfe6e2;
  border-radius: 16px;
  background: #f5f6fa;
  box-shadow: 4px 16px 44px rgba(27, 36, 49, 0.14);
}

.dashboard.admina-shell .app-nav {
  padding: 18px 14px;
  background: #1b2431;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard.admina-shell .nav-brand {
  margin: 0 4px 18px;
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard.admina-shell .nav-brand img {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  padding: 4px;
  border-radius: 10px;
  box-shadow: none;
}

.dashboard.admina-shell .nav-brand strong {
  font-size: 0.98rem;
}

.dashboard.admina-shell .nav-brand span {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.68rem;
}

.dashboard.admina-shell .nav-section-label {
  margin: 18px 8px 5px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.61rem;
  letter-spacing: 0.08em;
}

.dashboard.admina-shell .nav-menu {
  gap: 4px;
  padding-right: 2px;
}

.dashboard.admina-shell .nav-menu button {
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem;
  font-weight: 750;
  transition: background 160ms ease, color 160ms ease;
}

.dashboard.admina-shell .nav-menu button::before {
  display: none;
}

.dashboard.admina-shell .nav-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.dashboard.admina-shell .nav-icon i,
.dashboard.admina-shell .nav-logout > i {
  color: currentColor;
  font-size: 1.18rem;
  font-style: normal;
  line-height: 1;
}

.dashboard.admina-shell .nav-menu button:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.075);
  color: #fff;
  box-shadow: none;
  transform: none;
}

.dashboard.admina-shell .nav-menu button.active {
  border-color: rgba(0, 168, 80, 0.42);
  background: rgba(0, 168, 80, 0.16);
  color: #fff;
  box-shadow: inset 3px 0 0 #00a850;
  transform: none;
}

.dashboard.admina-shell .nav-menu button.active .nav-icon {
  background: #00a850;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 168, 80, 0.28);
}

.dashboard.admina-shell .nav-menu button.active .nav-icon .wc-icon {
  color: inherit;
}

.dashboard.admina-shell .nav-account {
  padding: 11px;
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.dashboard.admina-shell .nav-logout {
  min-height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.dashboard.admina-shell .app-main {
  background: #f5f6fa;
}

.dashboard.admina-shell .topbar {
  min-height: 74px;
  padding: 12px 22px;
  border-bottom-color: #e4e8ec;
  background: #fff;
  box-shadow: none;
}

.dashboard.admina-shell .topbar h1 {
  color: #1f2937;
  font-size: 1.28rem;
  font-weight: 800;
}

.dashboard.admina-shell .topbar .eyebrow {
  color: #6b7280;
}

.dashboard.admina-shell .hero-panel,
.dashboard.admina-shell .client-daily-card,
.dashboard.admina-shell .client-quick-actions,
.dashboard.admina-shell .onboarding-panel {
  border: 1px solid #e4e8ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(46, 45, 116, 0.045);
}

.dashboard.admina-shell .hero-panel {
  background:
    linear-gradient(100deg, #ffffff 0%, #ffffff 69%, #ecfff5 100%);
}

.dashboard.admina-shell .hero-panel::before,
.dashboard.admina-shell .hero-panel::after {
  opacity: 0.55;
}

.dashboard.admina-shell .dashboard-state-pill,
.dashboard.admina-shell .client-plan-pill,
.dashboard.admina-shell .plan-badge {
  border-radius: 7px;
}

.dashboard.admina-shell .stats-row {
  gap: 14px;
}

.dashboard.admina-shell .stat-card {
  min-height: 130px;
  border: 1px solid #e4e8ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(46, 45, 116, 0.045);
}

.dashboard.admina-shell .stat-card:hover {
  border-color: rgba(0, 168, 80, 0.32);
  box-shadow: 0 10px 22px rgba(0, 168, 80, 0.1);
  transform: translateY(-2px);
}

.dashboard.admina-shell .stat-card-icon {
  border-radius: 9px;
  background: rgba(0, 168, 80, 0.1);
  color: #008a42;
}

.dashboard.admina-shell .stat-card.accent .stat-card-icon {
  background: rgba(255, 193, 45, 0.2);
  color: #9b6700;
}

.dashboard.admina-shell .client-action-grid button {
  border-radius: 10px;
}

.dashboard.admina-shell .client-action-grid button:hover {
  border-color: rgba(0, 168, 80, 0.34);
  background: #f2fff8;
}

@media (max-width: 820px) {
  .dashboard.admina-shell {
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .dashboard.admina-shell .topbar {
    min-height: 66px;
    padding: 10px 14px;
  }

  .dashboard.admina-shell .topbar h1 {
    font-size: 1.08rem;
  }

  .dashboard.admina-shell .hero-panel,
  .dashboard.admina-shell .client-daily-card,
  .dashboard.admina-shell .client-quick-actions,
  .dashboard.admina-shell .onboarding-panel,
  .dashboard.admina-shell .stat-card {
    border-radius: 10px;
  }
}

/* Admina integration: Live Chats workspace keeps WhaChat behavior with a denser support-inbox surface. */
.dashboard.admina-shell #chats-page.page.active {
  --chat-shell-radius: 12px;
  padding: 16px;
  background: #f5f6fa;
}

.dashboard.admina-shell #chats-page.page.active .chat-workspace {
  border-color: #e4e8ec;
  border-radius: var(--chat-shell-radius);
  background: #fff;
  box-shadow: 0 4px 20px rgba(46, 45, 116, 0.07);
}

.dashboard.admina-shell #chats-page .chat-workspace .sidebar {
  border-right-color: #e4e8ec;
  background: #fff;
}

.dashboard.admina-shell #chats-page .app-header {
  padding: 18px;
  border-bottom: 1px solid #edf0f2;
  background: #fff;
}

.dashboard.admina-shell #chats-page .app-header h1,
.dashboard.admina-shell #chats-page .conversation-title h1 {
  color: #1f2937;
}

.dashboard.admina-shell #chats-page .admin-tabs,
.dashboard.admina-shell #chats-page .team-tabs {
  gap: 6px;
  padding: 10px 14px;
  border-bottom-color: #edf0f2;
  background: #fff;
}

.dashboard.admina-shell #chats-page .admin-tabs button,
.dashboard.admina-shell #chats-page .team-tabs button {
  min-height: 34px;
  border-radius: 6px;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 750;
}

.dashboard.admina-shell #chats-page .admin-tabs button.active,
.dashboard.admina-shell #chats-page .team-tabs button.active {
  background: #00a850;
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 168, 80, 0.18);
}

.dashboard.admina-shell #chats-page .chat-list {
  gap: 6px;
  padding: 10px;
  background: #fff;
}

.dashboard.admina-shell #chats-page .chat-item {
  min-height: 70px;
  padding: 11px;
  border-color: transparent;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.dashboard.admina-shell #chats-page .chat-item:hover {
  border-color: #e0e9e4;
  background: #f7fbf8;
  box-shadow: none;
}

.dashboard.admina-shell #chats-page .chat-item.active {
  border-color: #cdeedb;
  background: #eafaf1;
  box-shadow: inset 3px 0 0 #00a850;
}

.dashboard.admina-shell #chats-page .chat-item.priority-urgent {
  box-shadow: inset 3px 0 0 #e5484d;
}

.dashboard.admina-shell #chats-page .conversation {
  background: #f5f6fa;
}

.dashboard.admina-shell #chats-page .conversation-header {
  min-height: 72px;
  border-bottom-color: #e4e8ec;
  background: #fff;
  box-shadow: none;
}

.dashboard.admina-shell #chats-page .visitor-avatar {
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #d9eee1;
}

.dashboard.admina-shell #chats-page .header-menu-button,
.dashboard.admina-shell #chats-page .back-button,
.dashboard.admina-shell #chats-page .tool-button {
  border: 1px solid #e3e8eb;
  border-radius: 8px;
  background: #fff;
  color: #008a42;
}

.dashboard.admina-shell #chats-page .header-menu-button:hover,
.dashboard.admina-shell #chats-page .back-button:hover,
.dashboard.admina-shell #chats-page .tool-button:hover {
  border-color: #a9dfbf;
  background: #f2fff7;
}

.dashboard.admina-shell #chats-page .admin-menu {
  border-color: #e0e5e8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(27, 36, 49, 0.16);
  backdrop-filter: none;
}

.dashboard.admina-shell #chats-page .admin-menu button {
  border-radius: 7px;
}

.dashboard.admina-shell #chats-page .team-inbox-bar {
  padding: 8px 12px;
  border-bottom-color: #e4e8ec;
  background: #fff;
}

.dashboard.admina-shell #chats-page .team-tools-toggle {
  min-height: 48px;
  border: 1px solid #dfe8e3;
  border-radius: 8px;
  background: #f7fbf8;
  box-shadow: none;
}

.dashboard.admina-shell #chats-page .messages {
  background: #f5f6fa;
}

.dashboard.admina-shell #chats-page .message {
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(31, 41, 55, 0.07);
}

.dashboard.admina-shell #chats-page .message.visitor {
  border-top-left-radius: 4px;
}

.dashboard.admina-shell #chats-page .message.admin {
  border-top-right-radius: 4px;
}

.dashboard.admina-shell #chats-page .team-tools-panel {
  border: 1px solid #dfe5e8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(27, 36, 49, 0.18);
}

.dashboard.admina-shell #chats-page .team-tools-panel-header {
  border-bottom: 1px solid #edf0f2;
  border-radius: 12px 12px 0 0;
  background: #fff;
  backdrop-filter: none;
}

.dashboard.admina-shell #chats-page .team-tools-panel section {
  border-radius: 8px;
}

.dashboard.admina-shell #chats-page .composer {
  border-top-color: #e4e8ec;
  background: #fff;
  box-shadow: 0 -4px 14px rgba(46, 45, 116, 0.045);
}

.dashboard.admina-shell #chats-page .composer textarea[name="text"] {
  border-radius: 8px;
  background: #f7f8fa;
}

.dashboard.admina-shell #chats-page .composer .send-button {
  border-radius: 8px;
  background: #00a850;
  box-shadow: 0 8px 18px rgba(0, 168, 80, 0.2);
}

@media (max-width: 820px) {
  .dashboard.admina-shell #chats-page.page.active {
    padding: 0;
    background: #fff;
  }

  .dashboard.admina-shell #chats-page.page.active .chat-workspace {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .dashboard.admina-shell #chats-page .app-header,
  .dashboard.admina-shell #chats-page .conversation-header,
  .dashboard.admina-shell #chats-page .composer {
    background: #fff;
  }

  .dashboard.admina-shell #chats-page .team-tools-panel {
    border-radius: 12px 12px 8px 8px;
  }
}

/* Admina integration: visitor intelligence, team operations, and ticket workspaces. */
.dashboard.admina-shell :is(#visitors-page, #admins-page, #departments-page, #tickets-page).page.active {
  padding: 16px;
  background: #f5f6fa;
}

.dashboard.admina-shell :is(#visitors-page, #admins-page, #departments-page, #tickets-page) .client-section-hero {
  min-height: 0;
  padding: 20px 22px;
  border: 1px solid #e4e8ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(46, 45, 116, 0.045);
}

.dashboard.admina-shell :is(#visitors-page, #admins-page, #departments-page, #tickets-page) .client-section-hero h2 {
  color: #1f2937;
}

.dashboard.admina-shell :is(#visitors-page, #admins-page, #departments-page, #tickets-page) .client-section-hero > .secondary-action {
  min-height: 40px;
  border-radius: 8px;
}

.dashboard.admina-shell #visitors-page .visitor-summary-grid,
.dashboard.admina-shell #admins-page .team-summary-grid {
  gap: 14px;
}

.dashboard.admina-shell #visitors-page .visitor-summary-grid article,
.dashboard.admina-shell #admins-page .team-summary-grid article {
  min-height: 116px;
  border: 1px solid #e4e8ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(46, 45, 116, 0.045);
}

.dashboard.admina-shell #visitors-page .visitor-summary-grid article:hover,
.dashboard.admina-shell #admins-page .team-summary-grid article:hover {
  border-color: rgba(0, 168, 80, 0.3);
  box-shadow: 0 10px 20px rgba(0, 168, 80, 0.08);
}

.dashboard.admina-shell #visitors-page .visitor-list-panel,
.dashboard.admina-shell #visitors-page .visitor-detail-panel,
.dashboard.admina-shell #admins-page .settings-panel,
.dashboard.admina-shell #departments-page .settings-panel,
.dashboard.admina-shell #tickets-page .ticket-board,
.dashboard.admina-shell #tickets-page .ticket-detail-panel {
  border: 1px solid #e4e8ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(46, 45, 116, 0.045);
}

.dashboard.admina-shell #visitors-page .visitor-panel-heading,
.dashboard.admina-shell #visitors-page .visitor-detail-heading,
.dashboard.admina-shell #admins-page .settings-heading,
.dashboard.admina-shell #departments-page .settings-heading,
.dashboard.admina-shell #tickets-page .ticket-board-heading {
  border-bottom-color: #edf0f2;
}

.dashboard.admina-shell #visitors-page .visitor-item {
  border-radius: 8px;
}

.dashboard.admina-shell #visitors-page .visitor-item:hover,
.dashboard.admina-shell #visitors-page .visitor-item.active {
  background: #f1fbf5;
}

.dashboard.admina-shell #visitors-page .visitor-detail-empty,
.dashboard.admina-shell #visitors-page .visitor-empty {
  border-radius: 10px;
  background: #f8faf9;
}

.dashboard.admina-shell #admins-page .team-member-card,
.dashboard.admina-shell #departments-page .department-card,
.dashboard.admina-shell #departments-page .reply-manager-card,
.dashboard.admina-shell #departments-page .tag-manager-card,
.dashboard.admina-shell #admins-page .support-ticket-card.manager,
.dashboard.admina-shell #tickets-page .ticket-flow-card {
  border-color: #e4e8ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.dashboard.admina-shell #admins-page .team-member-card:hover,
.dashboard.admina-shell #departments-page .department-card:hover,
.dashboard.admina-shell #tickets-page .ticket-flow-card:hover {
  border-color: rgba(0, 168, 80, 0.28);
  box-shadow: 0 8px 18px rgba(46, 45, 116, 0.055);
}

.dashboard.admina-shell :is(#admins-page, #departments-page, #tickets-page) .team-form input,
.dashboard.admina-shell :is(#admins-page, #departments-page, #tickets-page) .team-form select,
.dashboard.admina-shell :is(#admins-page, #departments-page, #tickets-page) .team-form textarea,
.dashboard.admina-shell :is(#admins-page, #departments-page, #tickets-page) .ticket-manager-grid input,
.dashboard.admina-shell :is(#admins-page, #departments-page, #tickets-page) .ticket-manager-grid select,
.dashboard.admina-shell :is(#admins-page, #departments-page, #tickets-page) .ticket-manager-grid textarea {
  border-color: #dfe5e8;
  border-radius: 8px;
  background: #fff;
}

.dashboard.admina-shell #tickets-page .ticket-filter-row button,
.dashboard.admina-shell #tickets-page .ticket-quick-actions button {
  border-radius: 7px;
}

.dashboard.admina-shell #tickets-page .ticket-filter-row button.active {
  background: #00a850;
  color: #fff;
}

.dashboard.admina-shell #tickets-page .ticket-timeline {
  border-left-color: #d7e6dd;
}

@media (max-width: 820px) {
  .dashboard.admina-shell :is(#visitors-page, #admins-page, #departments-page, #tickets-page).page.active {
    padding: 12px;
  }

  .dashboard.admina-shell :is(#visitors-page, #admins-page, #departments-page, #tickets-page) .client-section-hero {
    padding: 16px;
    border-radius: 10px;
  }

  .dashboard.admina-shell #visitors-page .visitor-list-panel,
  .dashboard.admina-shell #visitors-page .visitor-detail-panel,
  .dashboard.admina-shell #admins-page .settings-panel,
  .dashboard.admina-shell #departments-page .settings-panel,
  .dashboard.admina-shell #tickets-page .ticket-board,
  .dashboard.admina-shell #tickets-page .ticket-detail-panel {
    border-radius: 10px;
  }
}

/* WhaChat restored admin R2: semantic foundation, shell, navigation, and plan states. */
:root {
  --wc-color-brand: #00a850;
  --wc-color-brand-hover: #008f45;
  --wc-color-brand-strong: #06743c;
  --wc-color-accent: #ffc12d;
  --wc-color-danger: #d92d20;
  --wc-color-warning: #b76e00;
  --wc-color-info: #2563eb;
  --wc-color-success: #07883f;
  --wc-page-bg: #f4f6f8;
  --wc-surface: #ffffff;
  --wc-surface-muted: #f8fafb;
  --wc-surface-subtle: #eef2f3;
  --wc-text: #1f2937;
  --wc-text-muted: #667085;
  --wc-border: #e1e6e9;
  --wc-border-strong: #cdd5da;
  --wc-nav-bg: #17212f;
  --wc-nav-surface: #202c3b;
  --wc-nav-text: #d8dee7;
  --wc-nav-muted: #8f9baa;
  --wc-focus: 0 0 0 3px rgba(0, 168, 80, 0.22);
  --wc-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --wc-shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --wc-shadow-lg: 0 20px 48px rgba(16, 24, 40, 0.16);
  --wc-radius-xs: 4px;
  --wc-radius-sm: 6px;
  --wc-radius-md: 8px;
  --wc-radius-lg: 10px;
  --wc-sidebar-width: 248px;
  --wc-sidebar-collapsed: 76px;
  --wc-topbar-height: 64px;
  --wc-mobile-nav-height: 70px;
  --wc-motion-fast: 150ms ease;
  --wc-motion-base: 220ms ease;
  --wc-z-topbar: 1000;
  --wc-z-drawer-scrim: 2900;
  --wc-z-drawer: 3000;
  --wc-z-popover: 4200;
  --wc-z-toast: 4300;
  --wc-z-modal: 5000;
  color-scheme: light;
  font-family: "Segoe UI Variable", "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html[data-theme="dark"] {
  --wc-page-bg: #0f1722;
  --wc-surface: #182230;
  --wc-surface-muted: #1d2938;
  --wc-surface-subtle: #263445;
  --wc-text: #edf2f7;
  --wc-text-muted: #a9b4c2;
  --wc-border: #304052;
  --wc-border-strong: #405167;
  --wc-nav-bg: #0b111b;
  --wc-nav-surface: #141e2b;
  --wc-nav-text: #e7edf5;
  --wc-nav-muted: #94a0af;
  --wc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
  --wc-shadow-md: 0 10px 28px rgba(0, 0, 0, 0.28);
  --wc-shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
}

/* Supporting brand artwork for genuine empty and recovery states only. */
.wc-mascot {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.wc-mascot-empty {
  width: min(176px, 72%);
  max-height: 156px;
  margin: 2px auto 8px;
}

.wc-mascot-inline {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}

.wc-mascot-recovery {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
}

.wc-mascot-state.mascot-unavailable .wc-mascot,
.wc-mascot[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .wc-mascot-empty {
    width: min(132px, 62%);
    max-height: 116px;
    margin-bottom: 4px;
  }

  .wc-mascot-recovery {
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wc-mascot {
    animation: none !important;
  }
}

body {
  background: var(--wc-page-bg);
  color: var(--wc-text);
  font-family: inherit;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 50%;
  z-index: calc(var(--wc-z-modal) + 1);
  padding: 9px 14px;
  border-radius: var(--wc-radius-sm);
  background: var(--wc-color-brand-strong);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  transform: translate(-50%, -160%);
  transition: transform var(--wc-motion-fast);
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

.shell-loader {
  position: fixed;
  inset: 0;
  z-index: var(--wc-z-modal);
  display: none;
  place-items: center;
  padding: 20px;
  background: var(--wc-page-bg);
}

.shell-loader.active,
html.admin-token-boot .shell-loader {
  display: grid;
}

.shell-loader-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(380px, 100%);
  padding: 28px;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius-lg);
  background: var(--wc-surface);
  color: var(--wc-text);
  text-align: center;
  box-shadow: var(--wc-shadow-lg);
}

.shell-loader-mark {
  display: grid;
  place-items: center;
  width: 154px;
  height: 52px;
}

.shell-loader-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shell-loader-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(0, 168, 80, 0.16);
  border-top-color: var(--wc-color-brand);
  border-radius: 50%;
  animation: wc-shell-spin 700ms linear infinite;
}

.shell-loader.error .shell-loader-spinner {
  border-color: rgba(217, 45, 32, 0.18);
  border-top-color: var(--wc-color-danger);
  animation: none;
}

.shell-loader-card strong {
  font-size: 1rem;
}

.shell-loader-card > span:last-of-type {
  max-width: 310px;
  color: var(--wc-text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

@keyframes wc-shell-spin {
  to { transform: rotate(360deg); }
}

.app-shell {
  min-height: 100dvh;
  padding: 14px;
  background: var(--wc-page-bg);
}

.dashboard.admina-shell {
  grid-template-columns: var(--wc-sidebar-width) minmax(0, 1fr);
  width: min(1800px, calc(100vw - 28px));
  height: calc(100dvh - 28px);
  margin: 0 auto;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius-lg);
  background: var(--wc-page-bg);
  color: var(--wc-text);
  box-shadow: var(--wc-shadow-md);
  transition: grid-template-columns var(--wc-motion-base);
}

.dashboard.admina-shell .app-nav {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  min-width: 0;
  padding: 14px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--wc-nav-bg);
  color: var(--wc-nav-text);
  transition: width var(--wc-motion-base), transform var(--wc-motion-base), padding var(--wc-motion-base);
}

.dashboard.admina-shell .nav-brand {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 32px;
  gap: 9px;
  align-items: center;
  min-height: 52px;
  margin: 0;
  padding: 5px 4px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: transparent;
}

.nav-brand-art {
  position: relative;
  display: block;
  width: 108px;
  height: 38px;
  overflow: hidden;
}

.dashboard.admina-shell .nav-brand-art img {
  display: block;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
}

.dashboard.admina-shell .nav-brand .nav-brand-logo {
  width: 108px;
  height: 38px;
  object-position: left center;
}

.dashboard.admina-shell .nav-brand .nav-brand-icon {
  display: none;
  width: 126px;
  height: 38px;
  object-position: left center;
}

.nav-brand-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.dashboard.admina-shell .nav-brand-copy strong {
  display: none;
}

.dashboard.admina-shell .nav-brand-copy span {
  color: var(--wc-nav-muted);
  font-size: 0.64rem;
  font-weight: 700;
}

.nav-collapse {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--wc-radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--wc-nav-text);
  transition: background var(--wc-motion-fast), color var(--wc-motion-fast);
}

.nav-collapse:hover,
.nav-collapse:focus-visible {
  background: rgba(0, 168, 80, 0.2);
  color: #fff;
}

.dashboard.admina-shell .nav-menu {
  gap: 3px;
  padding: 0 2px 8px 0;
}

.dashboard.admina-shell .nav-section-label {
  margin: 13px 9px 4px;
  color: var(--wc-nav-muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0;
}

.dashboard.admina-shell .nav-section-label::after {
  background: rgba(255, 255, 255, 0.09);
}

.dashboard.admina-shell .nav-menu button {
  gap: 9px;
  min-height: 40px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--wc-radius-sm);
  background: transparent;
  color: var(--wc-nav-text);
  font-size: 0.79rem;
  font-weight: 650;
  transform: none;
  box-shadow: none;
}

.dashboard.admina-shell .nav-menu button::before {
  display: none;
}

.dashboard.admina-shell .nav-icon {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--wc-radius-sm);
  background: transparent;
  color: var(--wc-nav-muted);
  box-shadow: none;
}

.dashboard.admina-shell .nav-icon i {
  color: currentColor;
  font-size: 1.08rem;
}

.dashboard.admina-shell .nav-menu button:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.dashboard.admina-shell .nav-menu button:hover .nav-icon {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  transform: none;
}

.dashboard.admina-shell .nav-menu button.active {
  border-color: rgba(0, 168, 80, 0.3);
  background: rgba(0, 168, 80, 0.16);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--wc-color-brand);
}

.dashboard.admina-shell .nav-menu button.active .nav-icon {
  background: var(--wc-color-brand);
  color: #fff;
  box-shadow: none;
}

.dashboard.admina-shell .nav-count-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border: 0;
  border-radius: 10px;
  background: var(--wc-color-danger);
  font-size: 0.62rem;
  box-shadow: none;
}

.nav-upgrade {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 193, 45, 0.22);
  border-radius: var(--wc-radius-md);
  background: rgba(255, 193, 45, 0.09);
}

.nav-upgrade-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--wc-radius-sm);
  background: var(--wc-color-accent);
  color: #3d2a00;
}

.nav-upgrade-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.nav-upgrade-copy strong {
  color: #fff;
  font-size: 0.72rem;
}

.nav-upgrade-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--wc-nav-muted);
  font-size: 0.62rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.nav-upgrade button {
  grid-column: 1 / -1;
  min-height: 32px;
  border-radius: var(--wc-radius-sm);
  background: var(--wc-color-accent);
  color: #342300;
  font-size: 0.68rem;
  font-weight: 800;
}

.dashboard.admina-shell .nav-account {
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--wc-radius-md);
  background: var(--wc-nav-surface);
}

.dashboard.admina-shell .nav-account-avatar {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: none;
}

.dashboard.admina-shell .nav-account-copy strong {
  font-size: 0.74rem;
}

.dashboard.admina-shell .nav-account-copy span {
  color: var(--wc-nav-muted);
  font-size: 0.63rem;
}

.dashboard.admina-shell .nav-logout {
  min-height: 34px;
  border-radius: var(--wc-radius-sm);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.68rem;
  box-shadow: none;
}

.dashboard.admina-shell .nav-logout:hover {
  background: rgba(217, 45, 32, 0.16);
  color: #ffd7d3;
  transform: none;
}

.nav-scrim {
  display: none;
}

.dashboard.admina-shell .app-main {
  grid-template-rows: var(--wc-topbar-height) minmax(0, 1fr);
  background: var(--wc-page-bg);
}

.dashboard.admina-shell .topbar {
  position: relative;
  z-index: var(--wc-z-topbar);
  min-height: var(--wc-topbar-height);
  padding: 9px 18px;
  border-bottom: 1px solid var(--wc-border);
  background: var(--wc-surface);
  box-shadow: var(--wc-shadow-sm);
}

.dashboard.admina-shell .topbar h1 {
  color: var(--wc-text);
  font-size: 1.08rem;
  font-weight: 750;
}

.dashboard.admina-shell .topbar .eyebrow {
  color: var(--wc-text-muted);
  font-size: 0.62rem;
}

.dashboard.admina-shell .topbar-actions {
  gap: 6px;
}

.dashboard.admina-shell :is(.mobile-menu, .icon-button, .user-button, .theme-toggle) {
  width: 36px;
  height: 36px;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius-sm);
  background: var(--wc-surface);
  color: var(--wc-text-muted);
  box-shadow: none;
}

.dashboard.admina-shell :is(.mobile-menu, .icon-button, .user-button, .theme-toggle):hover,
.dashboard.admina-shell :is(.mobile-menu, .icon-button, .user-button, .theme-toggle):focus-visible {
  border-color: rgba(0, 168, 80, 0.34);
  background: rgba(0, 168, 80, 0.07);
  color: var(--wc-color-brand-strong);
}

.theme-toggle i {
  font-size: 1.08rem;
}

.dashboard.admina-shell #socketStatus {
  min-height: 30px;
  max-width: 180px;
  padding: 0 9px;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius-sm);
  background: var(--wc-surface-muted);
  color: var(--wc-text-muted);
  font-size: 0.67rem;
  box-shadow: none;
}

.dashboard.admina-shell #socketStatus::before {
  width: 7px;
  height: 7px;
  box-shadow: none;
}

.dashboard.admina-shell .plan-badge {
  min-height: 30px;
  max-width: 128px;
  padding: 0 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 193, 45, 0.45);
  border-radius: var(--wc-radius-sm);
  background: rgba(255, 193, 45, 0.16);
  color: #755000;
  font-size: 0.67rem;
  text-overflow: ellipsis;
  box-shadow: none;
}

html[data-theme="dark"] .dashboard.admina-shell .plan-badge {
  color: #ffd76e;
}

.dashboard.admina-shell .plan-badge::before {
  display: none;
}

.dashboard.admina-shell .plan-badge .wc-icon {
  width: 14px;
  height: 14px;
  color: currentColor;
}

.dashboard.admina-shell .page {
  background: var(--wc-page-bg);
  color: var(--wc-text);
}

.dashboard.admina-shell .page.active {
  animation-duration: 150ms;
}

.dashboard.admina-shell :is(input, select, textarea) {
  border-color: var(--wc-border);
  border-radius: var(--wc-radius-sm);
  background: var(--wc-surface);
  color: var(--wc-text);
  box-shadow: none;
}

.dashboard.admina-shell :is(input, select, textarea):focus {
  border-color: var(--wc-color-brand);
  box-shadow: var(--wc-focus);
}

.dashboard.admina-shell :is(.primary-action, .primary-button) {
  border-radius: var(--wc-radius-sm);
  background: var(--wc-color-brand);
  color: #fff;
  box-shadow: none;
}

.dashboard.admina-shell :is(.primary-action, .primary-button):hover {
  background: var(--wc-color-brand-hover);
  transform: none;
}

.dashboard.admina-shell :is(.secondary-action, .ghost-button) {
  border-color: var(--wc-border);
  border-radius: var(--wc-radius-sm);
  background: var(--wc-surface);
  color: var(--wc-text);
  box-shadow: none;
}

.dashboard.admina-shell :is(.secondary-action, .ghost-button):hover {
  border-color: rgba(0, 168, 80, 0.35);
  background: rgba(0, 168, 80, 0.06);
  color: var(--wc-color-brand-strong);
  transform: none;
}

.dashboard.admina-shell :is(
  .hero-panel,
  .client-daily-card,
  .client-quick-actions,
  .onboarding-panel,
  .stat-card,
  .settings-panel,
  .account-hero,
  .visitor-list-panel,
  .visitor-detail-panel,
  .ticket-board,
  .ticket-detail-panel,
  .analytics-card,
  .status-card
) {
  border-color: var(--wc-border);
  border-radius: var(--wc-radius-md);
  background: var(--wc-surface);
  color: var(--wc-text);
  box-shadow: var(--wc-shadow-sm);
}

.dashboard.admina-shell :is(.settings-heading, .client-card-heading, .visitor-panel-heading, .ticket-board-heading) {
  border-bottom-color: var(--wc-border);
}

.dashboard.admina-shell :is(h1, h2, h3, strong) {
  color: inherit;
}

.dashboard.admina-shell :is(p, small, label, .field-hint) {
  color: var(--wc-text-muted);
}

.dashboard.admina-shell .notification-panel,
.dashboard.admina-shell .user-dropdown {
  z-index: var(--wc-z-popover) !important;
  border: 1px solid var(--wc-border);
  border-radius: var(--wc-radius-md);
  background: var(--wc-surface);
  color: var(--wc-text);
  box-shadow: var(--wc-shadow-lg);
}

.dashboard.admina-shell .notification-item {
  border-color: var(--wc-border);
  background: var(--wc-surface);
  color: var(--wc-text);
}

.dashboard.admina-shell .notification-empty,
.dashboard.admina-shell .notification-item-copy small i,
.dashboard.admina-shell .notification-item-copy small b {
  background: var(--wc-surface-muted);
}

.toast-region {
  z-index: var(--wc-z-toast) !important;
}

:is(.notification-detail-modal, .admin-media-modal, .status-admin-modal) {
  z-index: var(--wc-z-modal) !important;
}

.dashboard.admina-shell [tabindex="-1"]:focus {
  outline: none;
}

.dashboard.admina-shell .shell-section-focus {
  border-color: rgba(0, 168, 80, 0.55) !important;
  box-shadow: var(--wc-focus), var(--wc-shadow-sm) !important;
}

.dashboard.admina-shell[data-plan-ready="false"] #billing-section,
.dashboard.admina-shell[data-plan-ready="error"] #billing-section {
  position: relative;
  min-height: 220px;
}

.dashboard.admina-shell[data-plan-ready="false"] #billing-section > *,
.dashboard.admina-shell[data-plan-ready="error"] #billing-section > * {
  visibility: hidden;
}

.dashboard.admina-shell[data-plan-ready="false"] #billing-section::after,
.dashboard.admina-shell[data-plan-ready="error"] #billing-section::after {
  content: "Loading secure plan details...";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--wc-text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  visibility: visible;
}

.dashboard.admina-shell[data-plan-ready="error"] #billing-section::after {
  content: "Plan details are temporarily unavailable. Use Try again in the workspace notice.";
  color: var(--wc-color-danger);
}

@media (min-width: 821px) {
  .dashboard.admina-shell.sidebar-collapsed,
  html.admin-sidebar-collapsed .dashboard.admina-shell {
    grid-template-columns: var(--wc-sidebar-collapsed) minmax(0, 1fr);
  }

  .dashboard.admina-shell.sidebar-collapsed .app-nav,
  html.admin-sidebar-collapsed .dashboard.admina-shell .app-nav {
    padding-inline: 10px;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-brand,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-brand {
    grid-template-columns: 44px;
    justify-content: center;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-brand-logo,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-brand-logo {
    display: none;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-brand-icon,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-brand-icon {
    display: block;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-brand-art,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-brand-art {
    width: 44px;
  }

  .dashboard.admina-shell.sidebar-collapsed :is(.nav-brand-copy, .nav-section-label, .nav-label, .nav-upgrade, .nav-account-copy, .nav-logout span),
  html.admin-sidebar-collapsed .dashboard.admina-shell :is(.nav-brand-copy, .nav-section-label, .nav-label, .nav-upgrade, .nav-account-copy, .nav-logout span) {
    display: none;
  }

  .dashboard.admina-shell.sidebar-collapsed .app-nav,
  html.admin-sidebar-collapsed .dashboard.admina-shell .app-nav {
    overflow: visible;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-brand,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-brand {
    position: relative;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-collapse,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-collapse {
    position: absolute;
    top: 7px;
    right: -23px;
    z-index: 4;
    display: grid;
    width: 28px;
    height: 28px;
    border-color: var(--wc-border);
    background: var(--wc-surface);
    color: var(--wc-text-muted);
    box-shadow: var(--wc-shadow-md);
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-menu,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-menu {
    overflow-y: auto;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-menu button,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-menu button {
    justify-content: center;
    min-height: 44px;
    padding: 5px;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-menu button.active,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-menu button.active {
    box-shadow: none;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-count-badge,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-count-badge {
    position: absolute;
    top: 2px;
    right: 1px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-account,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-account {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 8px 4px;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-logout,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-logout {
    width: 36px;
    padding: 0;
  }
}

html[data-theme="dark"] .dashboard.admina-shell .app-main,
html[data-theme="dark"] .dashboard.admina-shell .page,
html[data-theme="dark"] .dashboard.admina-shell :is(#chats-page, #visitors-page, #admins-page, #departments-page, #tickets-page).page.active {
  background: var(--wc-page-bg);
}

html[data-theme="dark"] .dashboard.admina-shell :is(
  .topbar,
  .hero-panel,
  .client-daily-card,
  .client-quick-actions,
  .onboarding-panel,
  .stat-card,
  .settings-panel,
  .account-hero,
  .visitor-list-panel,
  .visitor-detail-panel,
  .ticket-board,
  .ticket-detail-panel,
  .team-member-card,
  .department-card,
  .reply-manager-card,
  .tag-manager-card,
  .ticket-flow-card,
  .notification-detail-card,
  .conversation,
  .chat-workspace,
  .app-header,
  .conversation-header,
  .composer,
  .team-tools-panel
) {
  border-color: var(--wc-border);
  background: var(--wc-surface);
  color: var(--wc-text);
}

html[data-theme="dark"] .dashboard.admina-shell :is(.stat-card, .hero-panel, .client-daily-card, .client-quick-actions, .onboarding-panel) {
  background-image: none;
}

html[data-theme="dark"] .dashboard.admina-shell :is(.notification-item, .user-dropdown, .notification-panel) {
  border-color: var(--wc-border);
  background: var(--wc-surface);
  color: var(--wc-text);
}

/* Team controls need explicit theme ownership because legacy agent fields and
   the Admina cards otherwise win the cascade with opposite-theme colors. */
html:not([data-theme="dark"]) .dashboard.admina-shell #admins-page .agent-edit-grid :is(input, select),
html[data-theme="light"] .dashboard.admina-shell #admins-page .agent-edit-grid :is(input, select) {
  border-color: #dfe5e8;
  background: #fff;
  color: #1f2937;
}

html[data-theme="dark"] .dashboard.admina-shell #admins-page :is(
  .team-member-card,
  .settings-panel,
  .client-section-hero,
  .team-summary-grid article
) {
  border-color: var(--wc-border);
  background: var(--wc-surface);
  color: var(--wc-text);
}

html[data-theme="dark"] .dashboard.admina-shell #admins-page :is(
  .agent-edit-grid,
  #teamAdminForm
) :is(input, select) {
  border-color: var(--wc-border);
  background: var(--wc-surface-strong, #101923);
  color: var(--wc-text);
}

html[data-theme="dark"] .dashboard.admina-shell #tickets-page :is(
  .ticket-create-form,
  .ticket-manager-grid
) :is(input, select, textarea) {
  border-color: var(--wc-border);
  background: var(--wc-surface-strong, #101923);
  color: var(--wc-text);
}

html[data-theme="dark"] .dashboard.admina-shell #tickets-page :is(input, textarea)::placeholder {
  color: var(--wc-muted);
  opacity: 1;
}

html[data-theme="dark"] .dashboard.admina-shell #visitors-page :is(
  .visitor-list-panel,
  .visitor-detail-panel,
  .visitor-detail-header,
  .visitor-detail-grid article,
  .visitor-page-card,
  .visitor-latest-message,
  .visitor-timeline-panel,
  .visitor-timeline-item,
  .visitor-search
) {
  border-color: var(--wc-border);
  background: var(--wc-surface);
  background-image: none;
  color: var(--wc-text);
}

html[data-theme="dark"] .dashboard.admina-shell #visitors-page :is(
  .visitor-item,
  .visitor-timeline-empty,
  .visitor-detail-empty
) {
  border-color: var(--wc-border);
  background: var(--wc-surface-muted);
  color: var(--wc-text);
}

html[data-theme="dark"] .dashboard.admina-shell #visitors-page :is(
  .visitor-item-name-row strong,
  .visitor-detail-grid strong,
  .visitor-page-card strong,
  .visitor-page-card a,
  .visitor-latest-message p,
  .visitor-search input
) {
  color: var(--wc-text);
}

/* Keep the notification popover clear of the shell header at every scale.
   The previous bell-relative offset started inside the 64px topbar on high-DPI
   displays, so the header could visually cover the first row of the panel. */
@media (min-width: 821px) {
  .dashboard.admina-shell .notification-panel {
    position: fixed;
    top: calc(var(--wc-topbar-height) + 8px);
    right: 18px;
  }
}

html[data-theme="dark"] .dashboard.admina-shell :is(.nav-menu button, .nav-account, .nav-upgrade) {
  color: var(--wc-nav-text);
}

@media (max-width: 820px) {
  body.dashboard-drawer-open {
    overflow: hidden;
  }

  .app-shell {
    padding: 0;
  }

  .dashboard.admina-shell,
  .dashboard.admina-shell.sidebar-collapsed,
  html.admin-sidebar-collapsed .dashboard.admina-shell {
    display: block;
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .dashboard.admina-shell .app-nav,
  .dashboard.admina-shell.sidebar-collapsed .app-nav,
  html.admin-sidebar-collapsed .dashboard.admina-shell .app-nav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: var(--wc-z-drawer);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    width: min(310px, calc(100vw - 42px));
    padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
    transform: translateX(-104%);
    visibility: hidden;
    pointer-events: none;
    box-shadow: var(--wc-shadow-lg);
  }

  .dashboard.admina-shell.nav-open .app-nav,
  .dashboard.admina-shell[data-drawer-state="open"] .app-nav {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .dashboard.admina-shell .nav-brand,
  .dashboard.admina-shell.sidebar-collapsed .nav-brand,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-brand {
    grid-template-columns: 108px minmax(0, 1fr) 32px;
    justify-content: stretch;
  }

  .dashboard.admina-shell .nav-brand-art,
  .dashboard.admina-shell.sidebar-collapsed .nav-brand-art,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-brand-art {
    width: 108px;
  }

  .dashboard.admina-shell .nav-brand-logo,
  .dashboard.admina-shell.sidebar-collapsed .nav-brand-logo,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-brand-logo {
    display: block;
  }

  .dashboard.admina-shell .nav-brand-icon,
  .dashboard.admina-shell.sidebar-collapsed .nav-brand-icon,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-brand-icon {
    display: none;
  }

  .dashboard.admina-shell.sidebar-collapsed :is(.nav-brand-copy, .nav-collapse, .nav-section-label, .nav-label, .nav-upgrade, .nav-account-copy, .nav-logout span),
  html.admin-sidebar-collapsed .dashboard.admina-shell :is(.nav-brand-copy, .nav-collapse, .nav-section-label, .nav-label, .nav-upgrade, .nav-account-copy, .nav-logout span) {
    display: initial;
  }

  .dashboard.admina-shell .nav-collapse,
  .dashboard.admina-shell.sidebar-collapsed .nav-collapse,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-collapse {
    display: grid;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-brand-copy,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-brand-copy,
  .dashboard.admina-shell.sidebar-collapsed .nav-upgrade,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-upgrade,
  .dashboard.admina-shell.sidebar-collapsed .nav-account-copy,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-account-copy {
    display: grid;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-section-label,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-section-label {
    display: flex;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-menu button,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-menu button {
    justify-content: flex-start;
    padding: 4px 8px;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-count-badge,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-count-badge {
    position: static;
    margin-left: auto;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-account,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-account {
    grid-template-columns: 36px minmax(0, 1fr);
    justify-items: stretch;
    padding: 9px;
  }

  .dashboard.admina-shell.sidebar-collapsed .nav-logout,
  html.admin-sidebar-collapsed .dashboard.admina-shell .nav-logout {
    width: 100%;
    padding: 0 9px;
  }

  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: var(--wc-z-drawer-scrim);
    display: block;
    background: rgba(5, 12, 20, 0.62);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--wc-motion-base);
  }

  .dashboard.nav-open .nav-scrim,
  .dashboard[data-drawer-state="open"] .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .dashboard.nav-open::before {
    display: none;
  }

  .dashboard.admina-shell .app-main {
    height: 100dvh;
    padding-bottom: calc(var(--wc-mobile-nav-height) + env(safe-area-inset-bottom));
  }

  .dashboard.admina-shell .topbar {
    grid-template-columns: 36px minmax(64px, 1fr) auto;
    gap: 7px;
    min-height: 60px;
    padding: 8px 10px;
  }

  .dashboard.admina-shell .topbar h1 {
    font-size: 0.94rem;
  }

  .dashboard.admina-shell .topbar .eyebrow {
    font-size: 0.56rem;
  }

  .dashboard.admina-shell .topbar-actions {
    gap: 4px;
  }

  .dashboard.admina-shell :is(.mobile-menu, .icon-button, .user-button, .theme-toggle) {
    width: 34px;
    height: 34px;
  }

  .dashboard.admina-shell .plan-badge {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    padding: 0;
    color: transparent;
  }

  .dashboard.admina-shell .plan-badge::before {
    display: none;
  }

  .dashboard.admina-shell .plan-badge .wc-icon {
    width: 17px;
    height: 17px;
    color: #ffd76e;
  }

  .dashboard.admina-shell .plan-badge #planBadgeText {
    display: none;
  }

  .dashboard.admina-shell .notification-panel {
    top: calc(60px + 8px + env(safe-area-inset-top));
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100dvh - 150px);
  }

  .dashboard.admina-shell .notification-list {
    max-height: calc(100dvh - 286px);
  }

  .dashboard.admina-shell .page.active {
    padding-bottom: calc(var(--wc-mobile-nav-height) + 16px + env(safe-area-inset-bottom));
  }

  .dashboard.admina-shell .mobile-tabbar {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: calc(var(--wc-z-topbar) + 10);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    min-height: 62px;
    padding: 5px;
    border: 1px solid var(--wc-border);
    border-radius: var(--wc-radius-lg);
    background: color-mix(in srgb, var(--wc-surface) 94%, transparent);
    box-shadow: var(--wc-shadow-lg);
    backdrop-filter: blur(16px);
  }

  .dashboard.admina-shell .mobile-tabbar button {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    min-height: 50px;
    padding: 5px 2px;
    border: 0;
    border-radius: var(--wc-radius-sm);
    background: transparent;
    color: var(--wc-text-muted);
    font-size: 0.58rem;
    font-weight: 700;
    transform: none;
    box-shadow: none;
  }

  .dashboard.admina-shell .mobile-tabbar button > i:not(.mobile-tab-badge) {
    font-size: 1.16rem;
    font-style: normal;
  }

  .dashboard.admina-shell .mobile-tabbar button.active {
    border: 0;
    background: rgba(0, 168, 80, 0.1);
    color: var(--wc-color-brand-strong);
    transform: none;
    box-shadow: inset 0 -2px 0 var(--wc-color-brand);
  }

  .dashboard.admina-shell .mobile-tab-badge {
    top: 1px;
    right: 8px;
    border-color: var(--wc-surface);
  }

  .shell-loader-card {
    padding: 22px 18px;
  }
}

@media (max-width: 420px) {
  .dashboard.admina-shell .topbar {
    grid-template-columns: 34px minmax(54px, 1fr) auto;
    gap: 5px;
    padding-inline: 7px;
  }

  .dashboard.admina-shell .topbar .eyebrow,
  .dashboard.admina-shell #installButton {
    display: none;
  }

  .dashboard.admina-shell .topbar h1 {
    font-size: 0.86rem;
  }

  .dashboard.admina-shell :is(.mobile-menu, .icon-button, .user-button, .theme-toggle) {
    width: 32px;
    height: 32px;
  }

  .dashboard.admina-shell .mobile-tabbar {
    left: 5px;
    right: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shell-loader-spinner,
  .dashboard.admina-shell .page.active {
    animation: none !important;
  }

  .dashboard.admina-shell,
  .dashboard.admina-shell .app-nav,
  .nav-scrim {
    transition-duration: 0.01ms !important;
  }
}

/* Final Ticket Desk control ownership must follow every legacy Admina rule. */
html:not([data-theme="dark"]) .dashboard.admina-shell #tickets-page :is(.ticket-manager-grid, .ticket-create-form) :is(input, select, textarea),
html[data-theme="light"] .dashboard.admina-shell #tickets-page :is(.ticket-manager-grid, .ticket-create-form) :is(input, select, textarea) {
  border-color: #dfe5e8;
  background: #fff;
  color: #1f2937;
}

html[data-theme="dark"] .dashboard.admina-shell #tickets-page :is(.ticket-manager-grid, .ticket-create-form) :is(input, select, textarea) {
  border-color: var(--wc-border);
  background: var(--wc-surface-strong, #101923);
  color: var(--wc-text);
}

html[data-theme="dark"] .dashboard.admina-shell #tickets-page :is(.ticket-manager-grid, .ticket-create-form) select option {
  background: var(--wc-surface-strong, #101923);
  color: var(--wc-text);
}

/* P9 platform installation guides */
#settings-page .install-guide-shell {
  gap: 14px;
}

#settings-page .install-guide-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

#settings-page .install-guide-heading h3,
#settings-page .install-guide-heading p {
  margin: 0;
}

#settings-page .install-guide-heading h3 {
  color: var(--wc-text, var(--ink));
  font-size: 1rem;
  line-height: 1.3;
}

#settings-page .install-guide-heading > span {
  max-width: 330px;
  color: var(--wc-text-muted, var(--muted));
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: right;
}

#settings-page .install-platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#settings-page .install-guide-loading {
  grid-column: 1 / -1;
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--wc-border, rgba(0, 168, 80, 0.22));
  border-radius: var(--wc-radius-md, 8px);
  color: var(--wc-text-muted, var(--muted));
  font-weight: 750;
}

#settings-page .install-platform-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--wc-border, rgba(20, 32, 38, 0.1));
  border-radius: var(--wc-radius-md, 8px);
  background: var(--wc-surface, #fff);
  box-shadow: 0 10px 24px rgba(20, 32, 38, 0.055);
}

#settings-page .install-platform-card-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
}

#settings-page .install-platform-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--wc-color-brand, var(--brand)) 12%, var(--wc-surface, #fff));
  color: var(--wc-color-brand-strong, var(--brand-dark));
}

#settings-page .install-platform-icon i {
  font-size: 1.35rem;
  line-height: 1;
}

#settings-page .install-platform-card strong {
  display: block;
  color: var(--wc-text, var(--ink));
  font-size: 0.94rem;
  line-height: 1.3;
}

#settings-page .install-platform-card p {
  margin: 4px 0 0;
  color: var(--wc-text-muted, var(--muted));
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.5;
}

#settings-page .install-platform-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

#settings-page .install-platform-copy {
  width: 100%;
  min-height: 42px;
  justify-content: center;
  gap: 7px;
}

#settings-page .install-platform-details {
  border-top: 1px solid var(--wc-border, rgba(20, 32, 38, 0.1));
}

#settings-page .install-platform-details summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--wc-color-brand-strong, var(--brand-dark));
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

#settings-page .install-platform-details summary::-webkit-details-marker {
  display: none;
}

#settings-page .install-platform-details summary::after {
  content: "+";
  font-size: 1.1rem;
  line-height: 1;
}

#settings-page .install-platform-details[open] summary::after {
  content: "−";
}

#settings-page .install-platform-details ol {
  display: grid;
  gap: 7px;
  margin: 0 0 10px;
  padding-left: 20px;
}

#settings-page .install-platform-details li,
#settings-page .install-platform-details small {
  color: var(--wc-text-muted, var(--muted));
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.5;
}

#settings-page .install-platform-details small {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--wc-color-brand, var(--brand)) 8%, var(--wc-surface, #fff));
}

#settings-page .install-platform-card :focus-visible {
  outline: 3px solid var(--wc-color-accent, #ffc12d);
  outline-offset: 2px;
}

html[data-theme="dark"] #settings-page .install-platform-card {
  background: var(--wc-surface, #111b24);
  box-shadow: none;
}

html[data-theme="dark"] #settings-page :is(
  .install-code-column,
  .install-preview-column,
  .install-readiness-card,
  .install-status-summary article,
  .install-domain-row,
  .install-domain-form,
  .install-empty
) {
  border-color: var(--wc-border, #2a3948);
  background: var(--wc-surface, #182230);
  box-shadow: none;
}

html[data-theme="dark"] #settings-page :is(
  .install-empty strong,
  .install-status-summary strong,
  .install-domain-row strong,
  .install-readiness-card strong
) {
  color: var(--wc-text, #edf2f7);
}

html[data-theme="dark"] #settings-page :is(
  .install-empty span,
  .install-status-summary small,
  .install-domain-row span:not(.install-status-pill),
  .install-domain-row small,
  .install-readiness-card span,
  .install-readiness-card small,
  .install-hint,
  .install-policy-note
) {
  color: var(--wc-text-muted, #a9b4c2);
}

html[data-theme="dark"] #settings-page :is(.copy-field, #installEmbedCode) {
  border-color: var(--wc-border, #2a3948);
  background: var(--wc-surface-strong, #101923);
  color: var(--wc-text, #edf2f7);
  box-shadow: none;
}

html[data-theme="dark"] #settings-page .install-platform-icon {
  background: rgba(0, 168, 80, 0.16);
  color: #62d99a;
}

html[data-theme="dark"] #settings-page .install-platform-details summary {
  color: #62d99a;
}

html[data-theme="dark"] #settings-page .install-platform-details small {
  background: rgba(0, 168, 80, 0.1);
}

@media (max-width: 1024px) {
  #settings-page .install-platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #settings-page .install-guide-heading {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }

  #settings-page .install-guide-heading > span {
    max-width: none;
    text-align: left;
  }

  #settings-page .install-platform-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #settings-page .install-platform-card {
    padding: 13px;
  }
}
/* P10: tenant-safe in-app WhaChat Support Desk */
.support-desk-launcher[hidden] {
  display: none !important;
}
.support-desk-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 54;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 5px 14px 5px 5px;
  border: 1px solid rgba(0, 168, 80, 0.2);
  border-radius: 999px;
  background: var(--panel);
  color: var(--brand-deep);
  box-shadow: 0 16px 34px rgba(0, 64, 46, 0.2);
  font-size: 0.78rem;
  font-weight: 900;
}

.support-desk-launcher img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.support-desk-launcher:hover,
.support-desk-launcher:focus-visible {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 18px 38px rgba(0, 168, 80, 0.25);
}

.support-desk-drawer {
  position: fixed;
  right: 22px;
  bottom: 84px;
  z-index: var(--wc-z-drawer);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  width: min(410px, calc(100vw - 32px));
  height: min(680px, calc(100dvh - 96px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 28px 70px rgba(0, 31, 23, 0.3);
}

.support-desk-drawer.hidden,
.support-desk-scrim.hidden,
.support-desk-view.hidden,
.support-desk-status.hidden,
.support-desk-back.hidden {
  display: none !important;
}

.support-desk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 70px;
  padding: 12px 14px;
  background: var(--brand-deep);
  color: #fff;
}

.support-desk-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.support-desk-brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.support-desk-brand div,
.support-desk-form-head div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.support-desk-brand strong { font-size: 0.92rem; }
.support-desk-brand span { color: rgba(255,255,255,.78); font-size: 0.72rem; }
.support-desk-header > button {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 1.2rem;
}

.support-desk-header > button:hover { background: rgba(255,255,255,.24); }
.support-desk-header > button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.support-desk-open .support-desk-launcher { z-index: calc(var(--wc-z-drawer) + 1); }
#supportDeskHistory, #supportDeskNewView, #supportDeskConversation { grid-row: 4; }

.support-desk-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.support-desk-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--brand-dark);
  font-size: 0.74rem;
  font-weight: 900;
}

.support-desk-new { margin-left: auto; }
.support-desk-status {
  margin: 10px 12px 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--brand-light);
  color: var(--brand-deep);
  font-size: 0.76rem;
  font-weight: 750;
}
.support-desk-status[data-tone="error"] { background: rgba(220,38,38,.12); color: #b91c1c; }
.support-desk-status[data-tone="warning"] { background: rgba(245,158,11,.14); color: #8a5200; }

.support-desk-view {
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.support-desk-history-list,
.support-desk-timeline {
  display: grid;
  gap: 9px;
}

.support-desk-ticket-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(20,32,38,.05);
}
.support-desk-ticket-item:hover,
.support-desk-ticket-item:focus-visible { border-color: rgba(0,168,80,.55); }
.support-desk-ticket-item > span,
.support-desk-ticket-meta,
.support-desk-message-meta { color: var(--muted); font-size: 0.7rem; }
.support-desk-ticket-item strong { font-size: 0.84rem; overflow-wrap: anywhere; }
.support-desk-ticket-row,
.support-desk-ticket-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.support-desk-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 300px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}
.support-desk-empty img { width: 108px; height: 108px; object-fit: contain; }
.support-desk-empty strong { color: var(--ink); font-size: 0.95rem; }
.support-desk-empty p { margin: 0; font-size: 0.8rem; line-height: 1.5; }

.support-desk-form,
.support-desk-composer {
  display: grid;
  gap: 11px;
}
.support-desk-form-head { display: flex; align-items: center; gap: 10px; }
.support-desk-form-head .wc-icon { --wc-icon-size: 28px; color: var(--brand); }
.support-desk-form-head strong { font-size: 0.92rem; }
.support-desk-form-head small { color: var(--muted); font-size: 0.72rem; }
.support-desk-form label,
.support-desk-composer label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}
.support-desk-form input,
.support-desk-form select,
.support-desk-form textarea,
.support-desk-composer textarea,
.support-desk-composer input {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font: inherit;
}
.support-desk-form textarea,
.support-desk-composer textarea { min-height: 96px; resize: vertical; }
.support-desk-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.support-desk-file span { display: inline-flex; align-items: center; gap: 5px; color: var(--brand-dark); }
.support-desk-file small { color: var(--muted); font-weight: 600; }

.support-desk-conversation-head {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.support-desk-conversation-head h3 { margin: 0; color: var(--ink); font-size: 0.96rem; overflow-wrap: anywhere; }
.support-desk-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.support-desk-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.64rem;
  font-weight: 900;
}
.support-desk-badge.priority-urgent { background: rgba(220,38,38,.12); color: #b91c1c; }
.support-desk-badge.priority-important { background: rgba(245,158,11,.14); color: #8a5200; }

.support-desk-message {
  display: grid;
  gap: 5px;
  max-width: 88%;
  padding: 10px 11px;
  border-radius: 10px 10px 10px 3px;
  background: var(--panel-soft);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.support-desk-message.customer {
  justify-self: end;
  border-radius: 10px 10px 3px 10px;
  background: var(--brand-light);
}
.support-desk-message p { margin: 0; font-size: 0.8rem; line-height: 1.48; overflow-wrap: anywhere; white-space: pre-wrap; }
.support-desk-message strong { font-size: 0.72rem; }
.support-desk-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid rgba(0,168,80,.2);
  border-radius: 7px;
  background: var(--panel);
  color: var(--brand-dark);
  font-size: 0.7rem;
  font-weight: 850;
}
.support-desk-composer { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.support-desk-composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ticket-public-reply-note { display: grid; align-content: center; gap: 3px; min-width: 0; padding: 10px 12px; border: 1px solid var(--wc-border); border-radius: var(--wc-radius-sm); background: var(--wc-surface-muted); }
.ticket-public-reply-note strong,
.ticket-public-reply-note span { overflow-wrap: anywhere; }
.ticket-public-reply-note strong { color: var(--wc-text); font-size: 0.75rem; }
.ticket-public-reply-note span { color: var(--wc-text-muted); font-size: 0.68rem; line-height: 1.4; }
.ticket-file-field { min-width: 0; }
.ticket-file-field input[type="file"] { width: 100%; min-width: 0; color: var(--wc-text-muted); font-size: 0.72rem; }
.support-desk-readonly { display: grid; gap: 8px; padding: 12px; border-radius: 8px; background: var(--panel-soft); color: var(--muted); font-size: 0.76rem; }
.support-desk-scrim { display: none; }

[data-theme="dark"] .support-desk-drawer,
[data-theme="dark"] .support-desk-launcher,
[data-theme="dark"] .support-desk-ticket-item,
[data-theme="dark"] .support-desk-message,
[data-theme="dark"] .support-desk-attachment {
  border-color: rgba(255,255,255,.1);
  background: var(--panel);
  color: var(--ink);
}
[data-theme="dark"] .support-desk-status[data-tone="error"] { color: #ffaaaa; }
[data-theme="dark"] .support-desk-status[data-tone="warning"],
[data-theme="dark"] .support-desk-badge.priority-important { color: #ffd36a; }
[data-theme="dark"] .support-desk-badge.priority-urgent { color: #ff9b9b; }

@media (max-width: 820px) {
  .support-desk-launcher { right: 12px; bottom: calc(var(--wc-mobile-nav-height, 70px) + 12px); padding-right: 8px; }
  .support-desk-launcher span { display: none; }
  .support-desk-drawer {
    inset: auto 8px calc(var(--wc-mobile-nav-height, 70px) + 72px + env(safe-area-inset-bottom)) 8px;
    width: auto;
    height: min(720px, calc(100dvh - var(--wc-mobile-nav-height, 70px) - 84px - env(safe-area-inset-bottom)));
    border-radius: 14px;
  }
  .support-desk-scrim {
    position: fixed;
    inset: 0;
    z-index: var(--wc-z-drawer-scrim);
    display: block;
    background: rgba(3,18,13,.52);
    backdrop-filter: blur(2px);
  }
  .support-desk-form-grid { grid-template-columns: 1fr; }
  .support-desk-view { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

@media (max-width: 360px) {
  .support-desk-drawer { inset-inline: 4px; }
  .support-desk-header { min-height: 62px; padding: 9px 10px; }
  .support-desk-brand img { width: 36px; height: 36px; }
  .support-desk-view { padding: 10px; }
  .support-desk-message { max-width: 94%; }
}
