/* app.css */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/PlusJakartaSans-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/PlusJakartaSans-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --font: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  /* The only three text sizes in the app (the widget previews mirror the real widget instead). */
  --text-sm: 13px;
  --text-md: 15px;
  --text-lg: 28px;
  --bg: #fafaf7;
  --surface: #fff;
  --soft: #f0f1f3;
  --ink: #172033;
  --muted: #6b7280;
  --line: #e0e1e4;
  --blue: #1749d3;
  --blue-soft: #edf2ff;
  --green: #2c8065;
  --danger: #b74442;
  --warning: #d9480f;
  --radius: 12px;
  --sidebar: 246px;
  --shadow: 0 8px 28px #19223809;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  font-size: var(--text-md);
  line-height: 1.55;
  background: var(--bg);
}
button,
input,
textarea,
select {
  font: inherit;
}
strong,
b {
  font-weight: 600;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
a {
  color: inherit;
  text-decoration: none;
}
/* The widget has no hover effects: its controls look the same under the pointer. */
:where(body:not(.widget-page)) a:hover {
  color: var(--blue);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.8px;
  line-height: 1.3;
}
h2 {
  font-size: var(--text-md);
  font-weight: 500;
  letter-spacing: -0.45px;
}
h3 {
  font-size: var(--text-md);
  font-weight: 500;
}
strong {
  font-weight: 550;
}
small,
.small {
  font-size: var(--text-sm);
}
svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
img {
  max-width: 100%;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
[hidden] {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: var(--text-sm);
  letter-spacing: 0.9px;
  font-weight: 500;
  color: var(--muted);
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 18px;
}
.spacer {
  flex: 1;
}
.full {
  width: 100%;
}
.danger-text {
  color: var(--danger);
}
.text-right {
  text-align: right;
}
.nowrap {
  white-space: nowrap;
}
.truncate {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pre-wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.skip-link {
  position: fixed;
  top: -80px;
  left: 15px;
  z-index: 100;
  background: white;
  padding: 12px;
}
.skip-link:focus {
  top: 15px;
}
.button,
.icon-button,
.text-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  min-height: 37px;
  padding: 8px 13px;
  font-weight: 450;
  line-height: 1.4;
  transition:
    background 0.16s,
    border-color 0.16s,
    box-shadow 0.16s;
  white-space: nowrap;
}
:where(body:not(.widget-page)) :is(.button, .icon-button):hover {
  background: var(--soft);
  border-color: #cbcdd0;
}
.button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
:where(body:not(.widget-page)) .button.primary:hover {
  background: #123eb9;
}
.button.danger {
  color: var(--danger);
  border-color: #e9ceca;
}
.button.small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: var(--text-sm);
}
.icon-button {
  width: 35px;
  min-width: 35px;
  padding: 7px;
  border-color: transparent;
  background: transparent;
  font-size: var(--text-md);
}
.text-button {
  padding: 3px 0;
  border: 0;
  background: none;
  min-height: 25px;
  color: var(--muted);
}
:where(body:not(.widget-page)) .text-button:hover {
  color: var(--blue);
}
.button[aria-busy="true"],
button[aria-busy="true"] {
  color: transparent !important;
  pointer-events: none;
  opacity: 1;
}
.button[aria-busy="true"] > *,
button[aria-busy="true"] > * {
  visibility: hidden;
}
.button[aria-busy="true"]::after,
button[aria-busy="true"]::after {
  content: "";
  position: absolute;
  left: calc(50% - 7px);
  top: calc(50% - 7px);
  width: 14px;
  height: 14px;
  border: 1.7px solid #7f95cc;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
.button.primary[aria-busy="true"]::after {
  border-color: #ffffff80;
  border-right-color: white;
}
input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]),
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  min-height: 40px;
}
input::placeholder,
textarea::placeholder {
  color: #94a096;
}
textarea {
  resize: vertical;
  line-height: 1.7;
  min-height: 100px;
}
input:focus,
textarea:focus,
select:focus {
  border-color: #7794e9;
  box-shadow: 0 0 0 3px #1749d308;
}
input[aria-invalid="true"] {
  border-color: var(--danger);
}
label.field {
  display: grid;
  gap: 7px;
  font-size: var(--text-sm);
}
label.field > span {
  font-weight: 450;
}
.field-help {
  color: var(--muted);
  font-size: var(--text-sm);
}
.field-error,
.form-error {
  color: var(--danger);
  font-size: var(--text-sm);
}
.form-error {
  background: #fff5f3;
  padding: 11px 13px;
  border-radius: 10px;
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: var(--text-sm);
}
.checkbox-row input {
  margin-top: 4px;
  accent-color: var(--blue);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-grid .span-all {
  grid-column: 1/-1;
}
.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrap input {
  padding-right: 48px;
}
.password-wrap button {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  color: var(--muted);
}
.password-wrap button:hover {
  color: var(--ink);
}
.password-wrap button svg {
  width: 18px;
  height: 18px;
}
.field-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}
.search-field {
  position: relative;
}
.search-field svg {
  position: absolute;
  top: 11px;
  left: 11px;
  color: var(--muted);
}
.search-field input {
  padding-left: 36px;
}
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
}
.sidebar {
  background: #f3f4f6;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 23px 15px 10px;
  z-index: 30;
  min-width: 0;
}
.brand {
  display: inline-flex;
  align-items: center;
}
.sidebar > .brand {
  margin: 0 14px 27px;
}
.workspace-switch {
  padding: 0 8px 20px;
}
.workspace-switch label {
  display: block;
  margin: 0 3px 7px;
}
.workspace-switch select {
  background: white;
  font-size: var(--text-sm);
  max-width: 100%;
}
.workspace-switch .text-button {
  margin-top: 7px;
  margin-left: 3px;
}
#main-nav {
  display: grid;
  gap: 4px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: 10px;
  color: #6b6e75;
  font-size: var(--text-sm);
}
.nav-link svg {
  width: 17px;
}
.nav-link:hover {
  background: #e9eaed;
  color: var(--ink);
}
.nav-link.active {
  color: var(--ink);
  background: #e6e8eb;
}
.nav-link.active svg {
  color: var(--blue);
}
.sidebar-help {
  margin-top: auto;
  padding: 20px 13px;
  color: var(--muted);
  font-size: var(--text-sm);
}
.sidebar-help a {
  display: flex;
  justify-content: space-between;
}
.profile-footer {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  position: relative;
}
.profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: none;
  border-radius: 10px;
  padding: 9px 7px;
  text-align: left;
}
.profile-trigger:hover {
  background: var(--soft);
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e4e6ea;
  color: #636871;
  font-size: var(--text-sm);
}
/* Teammate photos and default avatars fill their circle; customer initials keep the tinted chip. */
:is(.avatar, .team-avatar):has(> img, > svg) {
  background: none;
}
:is(.avatar, .team-avatar) > :is(img, svg) {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
/* Guests still on a generated name: dashed ring, muted italic name, "Guest" tag. */
.avatar.is-guest {
  outline: 1.5px dashed var(--muted);
  outline-offset: 1.5px;
}
.guest-label {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  vertical-align: bottom;
}
.guest-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
  color: var(--muted);
}
.guest-tag {
  flex: none;
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  line-height: 16px;
}
/* The thread header is tight; the dashed ring and the customer card carry the tag there. */
.th-who .guest-tag {
  display: none;
}
.profile-photo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-photo-preview.avatar {
  width: 64px;
  height: 64px;
}
.profile-photo-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.profile-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  font-size: var(--text-sm);
}
.profile-copy > *,
.profile-copy small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.profile-copy small {
  color: var(--muted);
  font-size: var(--text-sm);
  margin-top: 2px;
}
.profile-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  padding: 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 24px #19223813;
  z-index: 50;
  animation: appear 0.15s var(--ease);
}
.profile-menu button {
  display: block;
  text-align: left;
  width: 100%;
  padding: 9px;
  border: 0;
  background: none;
  border-radius: 5px;
  font-size: var(--text-sm);
}
.profile-menu button:hover {
  background: var(--soft);
}
.menu-divider {
  height: 1px;
  background: var(--line);
  margin: 5px;
}
.workspace-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.topbar {
  height: 69px;
  min-height: 69px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
}
.topbar-title {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.topbar-title h1 {
  font-size: var(--text-md);
  letter-spacing: 0;
  font-weight: 450;
}
.topbar-title > .muted {
  font-size: var(--text-sm);
}
.topbar-separator {
  color: #cbced3;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.availability-label {
  display: flex;
  align-items: center;
  gap: 5px;
}
.availability-label select {
  width: auto;
  padding: 4px;
  min-height: 28px;
  font-size: var(--text-sm);
  border: 0;
  background: none;
  color: var(--muted);
  box-shadow: none;
}
.status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a1a4ab;
  flex-shrink: 0;
}
.status-dot.online {
  background: var(--green);
}
.notification-trigger {
  position: relative;
}
/* Text morph (js/morph.js, vendored Torph): the rules Torph would inject at runtime, which our CSP blocks. */
[torph-root] {
  display: inline-block;
  position: relative;
  vertical-align: top;
  will-change: width, height;
  white-space: nowrap;
  text-align: inherit;
}
[torph-item]:not(br) {
  display: inline-block;
  position: relative;
  will-change: opacity, transform;
  transform: none;
  opacity: 1;
}
[torph-sr] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: pre;
  user-select: none;
}
[torph-slot] { clip-path: inset(0 -100vw); }
[torph-slot] > span {
  display: inline-block;
  will-change: opacity, transform;
}
@supports (mask-clip: no-clip) or (-webkit-mask-clip: no-clip) {
  [torph-slot] {
    --torph-mask: linear-gradient(to bottom, transparent, #000 var(--torph-fade, 0.15em), #000 calc(100% - var(--torph-fade, 0.15em)), transparent);
    -webkit-mask-image: var(--torph-mask);
    mask-image: var(--torph-mask);
    -webkit-mask-repeat: repeat-x;
    mask-repeat: repeat-x;
    -webkit-mask-clip: no-clip;
    mask-clip: no-clip;
  }
}
/* Sound toggle: the slash draws across the speaker and the waves fold away when muted. */
.sound-slash {
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1.02;
  --slash-ms: 200ms;
  transition: stroke-dashoffset var(--slash-ms) var(--ease);
}
[data-muted="true"] .sound-slash {
  stroke-dashoffset: 0;
  --slash-ms: 260ms;
}
.sound-wave {
  transform-box: view-box;
  transform-origin: 11px 12px;
  transition:
    opacity 130ms var(--ease) var(--wave-delay),
    transform 130ms var(--ease) var(--wave-delay),
    filter 130ms var(--ease) var(--wave-delay);
}
[data-muted="true"] .sound-wave {
  opacity: 0;
  transform: scale(0.25);
  filter: blur(1px);
}
.sound-wave-inner { --wave-delay: 45ms; }
.sound-wave-outer { --wave-delay: 20ms; }
[data-muted="true"] .sound-wave-inner { --wave-delay: 50ms; }
[data-muted="true"] .sound-wave-outer { --wave-delay: 75ms; }
.sound-speaker {
  --speaker-ms: 220ms;
  --speaker-delay: 0ms;
  transition: transform var(--speaker-ms) var(--ease) var(--speaker-delay);
}
[data-muted="true"] .sound-speaker {
  transform: translateX(5.5px);
  --speaker-ms: 260ms;
  --speaker-delay: 80ms;
}
.sound-toggle:active { transform: scale(0.96); }
@media (prefers-reduced-motion: reduce) {
  .sound-slash, .sound-wave, .sound-speaker { transition: none; }
}
.notification-trigger > span {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 2px var(--surface);
  color: white;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  animation: badge-pop 0.25s var(--ease);
}
.notification-trigger > span[hidden] {
  display: none;
}
@keyframes badge-pop {
  from { transform: scale(0.5); opacity: 0; }
}
/* The page scrolls here. Positioned on purpose: hidden screen-reader labels (.sr-only) anchor
   to it instead of the window, so they can't make the whole window scroll. */
#main {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: auto;
  outline: none;
}
.page-panel {
  max-width: 1230px;
  margin: 0 auto;
  padding: 36px 40px;
  animation: appear 0.2s var(--ease);
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.page-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--text-sm);
}
.mobile-menu {
  display: none;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: #19223850;
  z-index: 25;
  border: 0;
}
.loading-panel {
  padding: 38px;
  display: grid;
  gap: 25px;
}
/* Under a page's own heading, while only its content is loading. */
.loading-panel.in-frame {
  padding: 0;
}
.skeleton {
  background: linear-gradient(100deg, #f1f2f3 20%, #e7e9ec 45%, #f1f2f3 65%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
.heading-skeleton {
  height: 25px;
  width: 190px;
}
.surface-skeleton {
  height: 250px;
  width: 100%;
}
.nav-skeleton {
  height: 36px;
  margin: 2px 9px;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 300px;
  padding: 35px 20px;
  gap: 10px;
}
.empty-state .empty-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 14px;
  color: #92969f;
  margin-bottom: 7px;
}
.empty-state .empty-icon svg {
  width: 24px;
  height: 24px;
}
.empty-state h2 {
  font-size: var(--text-md);
  letter-spacing: -0.25px;
}
.empty-state p {
  max-width: 350px;
  color: var(--muted);
  font-size: var(--text-sm);
}
.empty-state .button {
  margin-top: 7px;
}
.error-panel {
  padding: 32px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 15px;
}
.error-panel p {
  color: var(--muted);
}
.tabs {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 25px;
  overflow: auto;
}
.tab {
  border: 0;
  background: none;
  padding: 0 0 13px;
  font-size: var(--text-sm);
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 1px solid transparent;
}
.tab.active {
  color: var(--ink);
  border-color: var(--blue);
}
.people-tabs {
  gap: clamp(20px, 3vw, 32px);
}
.people-tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-bottom: 12px;
}
.people-tabs .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.people-tabs .tab.active {
  color: var(--blue);
  border-color: var(--blue);
}
.people-tabs .tab.active .tab-count {
  background: var(--blue-soft);
  color: var(--blue);
}
@media (prefers-reduced-motion: no-preference) {
  .people-tabs .tab {
    transition:
      color 0.16s var(--ease),
      border-color 0.16s var(--ease);
  }
  .people-tabs .tab-count {
    transition:
      color 0.16s var(--ease),
      background-color 0.16s var(--ease);
  }
}
.panel-surface {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
}
.surface-header {
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.surface-body {
  padding: 24px;
}
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 40px;
}
.settings-section + .settings-section {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 28px;
}
.settings-section h3 {
  margin-bottom: 6px;
}
.settings-section > p {
  color: var(--muted);
  font-size: var(--text-sm);
  margin-bottom: 20px;
}
.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.detail-list {
  display: grid;
  gap: 15px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  font-size: var(--text-sm);
}
.detail-row > span:first-child {
  color: var(--muted);
}
.detail-row > span:last-child {
  overflow-wrap: anywhere;
  text-align: right;
}
.detail-row > span:last-child > small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
#staff-report {
  margin-top: 32px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  text-align: left;
}
th {
  font-size: var(--text-sm);
  font-weight: 450;
  color: var(--muted);
  padding: 12px 21px;
  background: #fcfcfc;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 16px 21px;
  border-bottom: 1px solid #eaecef;
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
td small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.chip {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border-radius: 5px;
  padding: 3px 7px;
  background: var(--soft);
  color: #636770;
  font-size: var(--text-sm);
  white-space: nowrap;
}
.chip.blue {
  color: #4262a1;
  background: var(--blue-soft);
}
.chip.warning {
  background: #fff0e5;
  color: var(--warning);
}
.chip.danger {
  background: #fbefeb;
  color: var(--danger);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}
.metric {
  padding: 21px 23px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.metric .label {
  color: var(--muted);
  font-size: var(--text-sm);
}
.metric .value {
  font-size: var(--text-lg);
  font-weight: 450;
  letter-spacing: -1px;
  margin-top: 9px;
}
.metric .hint {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: 5px;
}
.meter {
  height: 5px;
  background: var(--soft);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 12px;
}
.meter > span {
  display: block;
  height: 100%;
  background: var(--blue);
}
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.plan-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 17px;
}
.plan-card .price {
  font-size: var(--text-lg);
  letter-spacing: -1px;
}
.plan-card .price small {
  font-size: var(--text-sm);
  color: var(--muted);
  letter-spacing: 0;
}
.plan-card .detail-row {
  font-size: var(--text-sm);
}
.notice {
  border: 1px solid #dcdee3;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 13px 15px;
  font-size: var(--text-sm);
  color: #646972;
}
.notice.warning {
  background: #fff5ee;
  border-color: #ffd3b8;
  color: var(--warning);
}
.code-block {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f4f5f7;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 17px;
  font-family: ui-monospace, monospace;
  font-size: var(--text-sm);
  line-height: 1.8;
  color: #535965;
}
.integration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.integration-row:last-child {
  border-bottom: 0;
}
.integration-row p {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: 4px;
}
.notification-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.notification-row:last-child {
  border: 0;
}
.notification-row p {
  font-size: var(--text-sm);
}
.notification-row small {
  color: var(--muted);
}
.notification-row.unread {
  font-weight: 500;
}
.json-detail {
  max-width: 100%;
  overflow: auto;
  background: var(--bg);
  font-size: var(--text-sm);
  padding: 10px;
  border-radius: 6px;
}
.modal {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(520px, calc(100% - 28px));
  max-height: calc(100dvh - 36px);
  box-shadow: 0 25px 90px #19223820;
  background: white;
  color: var(--ink);
  overflow: auto;
}
.modal[open] {
  animation: modal-in 0.18s var(--ease);
}
/* Closing holds its last frame until the dialog is removed, and the dimmed page fades with it. */
.modal.closing {
  animation: modal-out 0.16s var(--ease) forwards;
  pointer-events: none;
}
.modal::backdrop {
  background: #1824344d;
  backdrop-filter: blur(2px);
  transition: opacity 0.18s var(--ease);
}
.modal.closing::backdrop {
  opacity: 0;
}
@starting-style {
  .modal[open]::backdrop {
    opacity: 0;
  }
}
.modal-heading {
  padding: 23px 25px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.modal-heading h2 {
  font-size: var(--text-md);
}
.dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1;
}
.dialog-close:hover,
.dialog-close:active {
  background: transparent;
}
.dialog-close svg {
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
}
@media (pointer: coarse) {
  .dialog-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}
#modal-body {
  padding: 0 25px 26px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}
/* Toasts: a pile at the top centre that opens into a list on hover or focus (laid out by core.js). */
.toasts {
  position: fixed;
  top: var(--toast-top, 16px);
  left: 50%;
  z-index: 100;
  width: min(380px, calc(100vw - 24px));
  height: var(--stack, 0px);
  transform: translateX(-50%);
  transition: height 0.3s var(--ease);
}
.toasts:empty {
  pointer-events: none;
}
.toast {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  height: var(--h, auto);
  padding: 12px 12px 13px 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 10px 30px #1922381a, 0 1px 3px #19223812;
  color: var(--ink);
  font-size: var(--text-sm);
  transform: translateY(var(--y, 0)) scale(var(--s, 1));
  transform-origin: top center;
  transition:
    transform 0.4s var(--ease),
    height 0.3s var(--ease),
    opacity 0.25s ease;
}
.toast > * {
  transition: opacity 0.2s ease;
}
/* Cards under the front one keep its height and hide their content, so only their edges show. */
.toast.is-tucked > * {
  opacity: 0;
}
.toast.is-buried {
  opacity: 0;
  pointer-events: none;
}
.toast.is-entering {
  opacity: 0;
  transform: translateY(-110%) scale(0.96);
  transition: none;
}
.toast.closing {
  opacity: 0;
  transform: translateY(calc(var(--y, 0px) - 18px)) scale(calc(var(--s, 1) * 0.96));
  pointer-events: none;
}
.toast-body {
  flex: 1;
  min-width: 0;
}
.toast-description {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.toast-action {
  margin-top: 9px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.toast-action:hover {
  background: color-mix(in srgb, var(--ink) 9%, transparent);
}
.toast-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--toast-tone) 18%, transparent);
  color: var(--toast-tone);
}
.toast-icon svg {
  width: 13px;
  height: 13px;
}
.toast-icon.is-detailed {
  width: 24px;
  height: 24px;
}
.toast-icon.is-detailed svg {
  width: 14px;
  height: 14px;
}
.toast.success {
  --toast-tone: var(--green);
}
.toast.error {
  --toast-tone: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}
.toast.info {
  --toast-tone: var(--blue, #2563eb);
}
/* Tones by outcome: done well, something removed, a notice, or a failure. */
.toast.tone-positive {
  --toast-tone: #23845f;
}
.toast.tone-negative {
  --toast-tone: #c2416b;
}
.toast.tone-neutral {
  --toast-tone: #5b6b82;
}
.toast.tone-error {
  --toast-tone: var(--danger);
}
.toast:is(.tone-positive, .tone-negative, .tone-neutral) {
  border-color: color-mix(in srgb, var(--toast-tone) 22%, var(--line));
}
.toast:is(.tone-positive, .tone-negative, .tone-neutral) .toast-timer {
  opacity: 0.6;
}
html[data-theme="dark"] .toast.tone-positive {
  --toast-tone: #5fc79c;
}
html[data-theme="dark"] .toast.tone-negative {
  --toast-tone: #ee88aa;
}
html[data-theme="dark"] .toast.tone-neutral {
  --toast-tone: #9aa8bd;
}
.toast-message {
  margin: 0;
  padding-top: 2px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.toast-count {
  flex: none;
  margin-top: 1px;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--line);
  color: var(--muted);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
.toast-count:empty {
  display: none;
}
.toast-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: -1px -2px 0 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, background 0.15s;
}
.toast-close svg {
  width: 13px;
  height: 13px;
}
.toast:hover .toast-close,
.toast-close:focus-visible {
  opacity: 1;
}
.toast-close:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.toast-timer {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: var(--toast-tone);
  opacity: 0.45;
  transform-origin: left;
  animation: toast-timer var(--toast-duration, 4500ms) linear forwards;
}
.toasts:is(:hover, :focus-within) .toast-timer {
  animation-play-state: paused;
}
.toast.bump {
  animation: toast-bump 0.28s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .toasts,
  .toast,
  .toast > * {
    transition: none;
  }
}
.auth-page {
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.auth-header {
  padding: 30px 45px;
}
.auth-layout {
  width: min(420px, calc(100% - 40px));
  margin: auto;
  padding: 35px 0 50px;
}
.auth-card {
  padding: 0 12px;
}
.auth-card h1 {
  font-size: var(--text-lg);
  letter-spacing: -1.1px;
  margin-bottom: 10px;
}
.auth-intro {
  color: var(--muted);
  font-size: var(--text-md);
  line-height: 1.8;
  margin-bottom: 30px;
}
.auth-card form {
  display: grid;
  gap: 18px;
}
.auth-card input:not([type="checkbox"], [type="radio"]) {
  min-height: 45px;
}
.auth-card .checkbox-row {
  line-height: 20px;
}
.auth-card .checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 2px 0 0;
}
.auth-card .button {
  min-height: 44px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 24px 0;
  color: #91959c;
  font-size: var(--text-sm);
}
.auth-divider:before,
.auth-divider:after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.google-button {
  width: 100%;
}
.google-icon {
  font-family: Arial, sans-serif;
  font-weight: 600;
  color: #4285f4;
  font-size: var(--text-md);
}
.auth-switch {
  font-size: var(--text-sm);
  text-align: center;
  color: var(--muted);
  margin-top: 27px;
}
.auth-switch a,
.auth-card .text-link {
  color: var(--ink);
}
.auth-assurance {
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: var(--text-sm);
  margin-top: 40px;
  white-space: nowrap;
}
.auth-footer {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 22px;
  color: var(--muted);
  font-size: var(--text-sm);
}
.auth-check {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  border-radius: 12px;
  color: var(--blue);
  font-size: var(--text-lg);
  margin-bottom: 25px;
}
.auth-status {
  margin-bottom: 18px;
}
.turnstile-slot:empty {
  display: none;
}
.docs-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 5%;
  border-bottom: 1px solid var(--line);
  background: white;
}
.docs-header > .button {
  margin-left: auto;
}
.docs-layout {
  max-width: 1150px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr);
  gap: 65px;
  padding: 50px 30px;
}
.docs-layout nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.docs-layout nav a {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: var(--text-sm);
  color: var(--muted);
}
.docs-layout nav a.active {
  background: #e7e9ed;
  color: var(--ink);
}
.docs-layout main {
  max-width: 760px;
}
.docs-layout h1 {
  font-size: var(--text-lg);
  margin-bottom: 17px;
}
.docs-layout h2 {
  margin: 28px 0 12px;
}
.docs-layout p {
  color: #63676f;
  line-height: 1.9;
  margin-bottom: 15px;
}
.docs-layout li {
  margin-bottom: 10px;
  color: #63676f;
}
.docs-layout .code-block {
  margin: 17px 0;
}
.docs-layout .notice {
  margin: 22px 0;
}
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 100dvh;
  padding: 40px 25px 12vh;
  text-align: center;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes modal-out {
  to {
    opacity: 0;
    transform: translateY(7px) scale(0.985);
  }
}
@keyframes toast-timer {
  to {
    transform: scaleX(0);
  }
}
@keyframes toast-bump {
  40% {
    scale: 1.025;
  }
}
@media (min-width: 1500px) {
  .page-panel {
    padding-top: 43px;
  }
}
@media (max-width: 1150px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-panel {
    padding: 28px;
  }
  .settings-layout {
    gap: 25px;
  }
  .plan-grid {
    grid-template-columns: 1fr;
  }
  .plan-card {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
  .plan-card .button {
    grid-column: 1/-1;
  }
}
@media (max-width: 850px) {
  :root {
    --sidebar: 222px;
  }
  .sidebar {
    padding-inline: 10px;
  }
  .topbar {
    padding-inline: 21px;
  }
  .topbar-title > .muted,
  .topbar-separator {
    display: none;
  }
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .page-panel {
    padding: 26px 22px;
  }
  .docs-layout {
    gap: 30px;
    grid-template-columns: 170px 1fr;
  }
  .metrics {
    gap: 12px;
  }
  .metric {
    padding: 17px;
  }
  .auth-header {
    padding: 24px;
  }
}
@media (max-width: 680px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(310px, 86vw);
    transform: translateX(-103%);
    transition: transform 0.2s var(--ease);
    box-shadow: 0 0 50px #19223820;
  }
  .sidebar.drawer-open {
    transform: translateX(0);
  }
  .mobile-menu {
    display: inline-flex;
  }
  .topbar {
    height: 60px;
    min-height: 60px;
    padding: 0 14px;
  }
  .topbar-title {
    gap: 9px;
  }
  .topbar-actions {
    gap: 7px;
  }
  .page-panel {
    padding: 25px 18px;
  }
  .page-heading {
    gap: 12px;
    margin-bottom: 23px;
    align-items: flex-start;
  }
  .page-heading h1 {
    font-size: var(--text-lg);
  }
  .page-heading > .button {
    font-size: var(--text-sm);
    padding: 8px 10px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 15px;
  }
  .metric .value {
    font-size: var(--text-lg);
  }
  .metric .label {
    font-size: var(--text-sm);
  }
  .surface-body {
    padding: 18px;
  }
  .surface-header {
    padding: 16px 18px;
  }
  .modal-heading {
    padding: 19px 20px 13px;
  }
  #modal-body {
    padding: 0 20px 23px;
  }
  .auth-layout {
    padding-top: 20px;
  }
  .auth-header {
    padding: 24px;
  }
  .auth-assurance {
    font-size: var(--text-sm);
    gap: 5px;
  }
  .auth-assurance img {
    width: 16px;
  }
  .docs-header {
    padding: 19px;
    gap: 13px;
  }
  .docs-header .brand img {
    width: 115px;
  }
  .docs-header .muted {
    display: none;
  }
  .docs-layout {
    display: block;
    padding: 26px 20px;
  }
  .docs-layout nav {
    flex-direction: row;
    overflow-x: auto;
    margin-bottom: 28px;
    padding-bottom: 6px;
  }
  .docs-layout nav a {
    white-space: nowrap;
  }
  .docs-layout h1 {
    font-size: var(--text-lg);
  }
  .toasts {
    bottom: 18px;
    right: 18px;
  }
  .integration-row {
    flex-wrap: wrap;
  }
  .plan-card {
    padding: 20px;
  }
  .loading-panel {
    padding: 25px;
  }
  .table-wrap {
    margin-inline: -1px;
  }
  td,
  th {
    padding: 14px;
  }
  .auth-card {
    padding: 0 4px;
  }
  .profile-menu button {
    padding: 12px;
  }
  .sidebar-help {
    padding-bottom: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Focused setup tools */
.onboarding-panel {
  max-width: 580px;
}
.onboarding-panel .surface-body {
  padding: 30px;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 23px;
}
.team-grid .surface-body {
  display: grid;
  gap: 15px;
}
.team-grid h2 {
  font-size: var(--text-md);
}
.team-grid .row {
  gap: 7px;
}
.preview-widget {
  width: 100%;
  max-width: 350px;
  border-radius: 12px;
  border: 1px solid #dbdee3;
  background: white;
  box-shadow: 0 10px 30px #1d302210;
  overflow: hidden;
}
.widget-preview-welcome {
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 20px;
  gap: 12px;
}
.welcome-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
}
.welcome-mark svg {
  width: 19px;
  height: 19px;
}
.widget-preview-welcome[data-align="left"] {
  align-items: flex-start;
  text-align: left;
}
.widget-preview-welcome[data-align="right"] {
  align-items: flex-end;
  text-align: right;
}
.welcome-mark.has-logo {
  background: none;
}
.welcome-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.widget-preview-welcome h3 {
  font-size: 14px;
}
.widget-preview-welcome p {
  font-size: 10px;
  color: var(--muted);
}
.preview-brand {
  text-align: center;
  font-size: 8px;
  color: #888d98;
  margin-top: 12px;
}
/* Same dark palette as the real widget (widget.css). */
.preview-dark {
  background: #131316;
  color: #ececef;
  --line: #2a2a30;
  --muted: #94949c;
}
.preview-dark .avatar {
  background: #1f1f24;
  color: #94949c;
}
.widget-editor-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
/* Widget appearance: balanced editor with an independent customer preview. */
.widget-form-section {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.widget-form-section h2 {
  font-size: var(--text-md);
  font-weight: 550;
  letter-spacing: -0.15px;
}
.widget-form-section .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 16px;
}
.widget-form-section textarea {
  min-height: 68px;
}
.widget-logo-field {
  display: grid;
  gap: 9px;
  font-size: var(--text-sm);
}
.widget-logo-control {
  display: flex;
  align-items: center;
  gap: 15px;
}
.widget-logo-thumbnail {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  color: var(--muted);
}
.widget-logo-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.widget-logo-actions .row {
  flex-wrap: wrap;
  gap: 8px;
}
.widget-logo-actions .field-help {
  display: block;
  margin-top: 5px;
  font-size: var(--text-sm);
}
.widget-accent-control {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 10px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: var(--text-sm);
  color: var(--muted);
}
.dashboard-page .app-shell:not(.is-setup) .widget-accent-control input {
  width: 25px;
  height: 25px;
  min-height: 25px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  background: transparent;
  flex-shrink: 0;
  cursor: pointer;
}
.widget-accent-control input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.widget-accent-control input::-webkit-color-swatch,
.widget-accent-control input::-moz-color-swatch {
  border: 0;
  border-radius: 4px;
}
.widget-preview-stage {
  display: block;
  padding: 17px;
  border: 1px solid var(--line);
  background: #f4f6f9;
  --widget-preview-canvas: #e8edf3;
  --widget-preview-dot: #c9d3df;
}
.widget-preview-stage .preview-widget {
  flex-shrink: 0;
  max-width: 340px;
  color-scheme: light;
  --ink: #192238;
  --line: #e1e6ee;
  --muted: #7c899b;
  color: var(--ink);
  border-radius: 14px;
}
.widget-preview-stage .preview-widget.preview-dark {
  color-scheme: dark;
  --ink: #ececef;
  --line: #2a2a30;
  --muted: #94949c;
  border-color: var(--line);
}
.widget-preview-stage[data-device="mobile"] .preview-widget {
  max-width: 290px;
}
.widget-preview-stage .widget-preview-welcome {
  height: 250px;
  overflow-wrap: anywhere;
  overflow-y: auto;
}
.widget-preview-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: flex-end;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 24px;
  background: #1749d3;
  color: #fff;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.widget-preview-launcher svg {
  width: 15px;
  height: 15px;
}
.widget-preview-launcher[data-icon-side="right"] {
  flex-direction: row-reverse;
}
.widget-preview-stage[data-position="left"] .widget-preview-launcher {
  align-self: flex-start;
}
@media (max-width: 1100px) {
  
  .widget-preview-stage {
    position: static;
  }
}
@media (max-width: 680px) {
  .widget-form-section .form-grid {
    grid-template-columns: 1fr;
  }
  
  
}
input[type="color"] {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  padding: 5px;
  border-radius: 10px;
  background: white;
}
.billing-summary {
  max-width: 680px;
}
.billing-summary .surface-body {
  display: grid;
  gap: 15px;
}
.usage-progress {
  width: 100%;
  height: 6px;
  appearance: none;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
}
.usage-progress::-webkit-progress-bar {
  background: var(--soft);
}
.usage-progress::-webkit-progress-value {
  background: var(--blue);
}
.billing-controls {
  max-width: 600px;
  margin: 30px auto 35px;
}
.billing-controls > .row {
  font-size: var(--text-sm);
}
.billing-controls input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
  margin: 20px 0 10px;
  cursor: pointer;
}
.billing-cycle {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: max-content;
  margin: 28px auto 0;
  padding: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.billing-cycle button {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 5px;
  padding: 8px 13px;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
}
.billing-cycle button.active {
  background: white;
  box-shadow: 0 1px 4px #1922380c;
  color: var(--ink);
}
.plan-card del {
  font-size: var(--text-md);
  color: #93979e;
  letter-spacing: 0;
}
.plan-card.muted-plan {
  opacity: 0.52;
}
.settings-section > .notice {
  margin-top: 22px;
}
.settings-section .field-help {
  margin-top: 9px;
}
.surface-body > .field-help {
  margin-top: 20px;
}
.settings-section > label,
.settings-section > div.stack {
  margin-top: 16px;
}
#routing-settings input[type="number"] {
  margin-top: 0;
}
@media (max-width: 1000px) {
  .widget-editor-layout {
    grid-template-columns: 1fr;
  }
  
  .team-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 680px) {
  
  .team-grid .row {
    flex-wrap: wrap;
  }
  .onboarding-panel .surface-body {
    padding: 22px;
  }
  .plan-card .price {
    font-size: var(--text-lg);
  }
  .billing-summary .row {
    flex-wrap: wrap;
  }
  .settings-section > h2 {
    font-size: var(--text-md);
  }
  .widget-preview-welcome {
    height: 220px;
  }
}
.ops-header {
  padding: 24px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.ops-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 28px;
}
.ops-elevation {
  max-width: 430px;
  margin: 8vh auto;
}
.ops-elevation h1 {
  margin-top: 16px;
}
.ops-elevation form {
  margin-top: 28px;
}
.ops-main dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.ops-main .settings-section:first-child {
  margin-top: 0;
}
@media (max-width: 600px) {
  .ops-header {
    padding: 18px;
  }
  .ops-main {
    padding: 28px 18px;
  }
  .ops-main .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Settings rhythm: headings breathe, side cards hug their content. */
.settings-layout {
  align-items: start;
}
.settings-layout h2 + p {
  margin-top: 6px;
  margin-bottom: 22px;
}
.settings-layout h2 + p + .row {
  margin-bottom: 8px;
}
.settings-main > .settings-section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.panel-surface .surface-body > h3:first-child {
  margin-bottom: 16px;
}
.billing-summary + .billing-plans-section {
  margin-top: 44px;
}
.billing-plans-section > h2 + p {
  margin-top: 6px;
}
.plan-card.current-plan {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue) inset;
}

/* Account dialogs: one clear title per section, separated by a rule. */
.dialog-section {
  margin-top: 6px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.dialog-section-title {
  margin-bottom: 12px;
}
.notify-events {
  display: grid;
  gap: 8px;
}
.notify-events .dialog-section-title {
  margin-bottom: 4px;
}
.table-action-cell {
  text-align: right;
  white-space: nowrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* Widget editor: a section rail, one card per section, and a live preview. */
#widget-publish-status.is-pending {
  color: var(--warning, #d9480f);
  background: color-mix(in srgb, var(--warning, #d9480f) 14%, transparent);
}
#widget-publish-status.is-pending::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  display: inline-block;
  vertical-align: 1px;
}
.studio-rail {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 22px 16px 22px 0;
}
.studio-rail-heading {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  padding: 12px 10px 6px;
}
.studio-rail-heading:first-child {
  padding-top: 0;
}
.studio-rail-item {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.studio-rail-item:hover {
  background: var(--soft);
}
.studio-rail-item[aria-current="true"] {
  background: var(--blue-soft);
}
.studio-rail-number {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
}
.studio-rail-item[aria-current="true"] .studio-rail-number {
  background: var(--theme-primary, #1749d3);
  color: #fff;
}
.studio-rail-text {
  display: grid;
  min-width: 0;
}
.studio-rail-text strong {
  font-size: var(--text-sm);
  font-weight: 550;
}
.studio-rail-text small {
  font-size: var(--text-sm);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.studio-card-head h2 {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.15px;
}
.studio-card-head p {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: 1px;
}
.studio-card-head .chip {
  margin-left: auto;
}

@media (max-width: 900px) {
  
  .studio-rail {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  
  .studio-rail-heading {
    display: none;
  }
  .studio-rail-item {
    width: auto;
    flex-shrink: 0;
  }
  .studio-rail-text small {
    display: none;
  }
  
  
  
}
@media (max-width: 680px) {
  .studio-card-head .chip {
    display: none;
  }
}
/* Widget editor sections: brand drop zone, launcher studio, message moments, start flow. */
/* Brand */
.brand-logo,
[data-logo-slot] {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  flex-shrink: 0;
}
.brand-logo {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  margin-bottom: 4px;
  border: 1px solid var(--line);
}
.brand-logo img,
[data-logo-slot] img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.brand-logo svg {
  width: 30px;
  height: 30px;
}
[data-logo-slot] svg {
  width: 55%;
  height: 55%;
}
/* Look & feel */
.look-stage {
  --accent: var(--blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 28px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 20%, color-mix(in srgb, var(--accent) 14%, var(--soft)), var(--soft) 70%);
}
.look-stage[data-theme="dark"] {
  background: radial-gradient(ellipse at 50% 20%, color-mix(in srgb, var(--accent) 22%, #121418), #0d0e12 70%);
  border-color: #2a2d33;
}
.look-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 30px #0003;
  cursor: text;
  transition: transform 0.25s var(--ease);
}
.look-launcher[data-side="right"] {
  flex-direction: row-reverse;
}
.dashboard-page .app-shell:not(.is-setup) .look-launcher #launcher-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 0;
  aspect-ratio: 1;
  margin: -6px;
  padding: 0;
  border: 1px dashed transparent;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: inherit;
  cursor: grab;
  touch-action: none;
  transform: translateX(var(--drag-x, 0));
}
.dashboard-page .app-shell:not(.is-setup) .look-launcher #launcher-icon:hover,
.dashboard-page .app-shell:not(.is-setup) .look-launcher #launcher-icon[aria-expanded="true"] {
  border-color: #ffffffa0;
  background: #ffffff1f;
}
.dashboard-page .app-shell:not(.is-setup) .look-launcher #launcher-icon.is-dragging {
  cursor: grabbing;
  background: #ffffff33;
}
.look-launcher #launcher-icon:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}
.dashboard-page .app-shell:not(.is-setup) .look-launcher[data-icon="none"] #launcher-icon {
  border-color: #ffffff80;
  cursor: pointer;
  opacity: 0.85;
}
.look-launcher svg {
  width: 20px;
  height: 20px;
}
.look-launcher[data-icon="none"] svg {
  width: 14px;
  height: 14px;
}
/* A pointer up to the launcher ties the picker to the icon. */
/* While picking an icon, the rest of the stage steps back. */
.dashboard-page .app-shell:not(.is-setup) .look-launcher #widget-launcher-input {
  field-sizing: content;
  min-width: 6ch;
  max-width: min(60vw, 420px);
  min-height: 0;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px dashed #ffffff80;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  outline: none;
}
.dashboard-page .app-shell:not(.is-setup) .look-launcher #widget-launcher-input:focus {
  border-bottom: 1px solid #fff;
}
#widget-accent-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
/* Messages */
.moments {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0 0 0 48px;
  list-style: none;
}
/* Each step links down to the next; the last one ends at its node. */
.moment:not(:last-child)::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 48px;
  bottom: -26px;
  width: 2px;
  background: linear-gradient(hsl(var(--tone) 70% 60%), hsl(var(--next-tone) 70% 60%));
}
.moment {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  --tone: 222;
  --next-tone: 38;
}
.moment[data-moment="expect"] {
  --tone: 38;
  --next-tone: 160;
}
.moment[data-moment="type"] {
  --tone: 160;
}
/* Conversation start */
/* A menu-routed inbox: the note stands where the start choices would. */
.dashboard-page .app-shell:not(.is-setup) .flow-node :is(input, textarea) {
  width: 100%;
  min-height: 0;
  padding: 2px 0 3px;
  border: 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--ink) 30%, transparent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
  outline: none;
}
.dashboard-page .app-shell:not(.is-setup) .flow-node :is(input, textarea):focus {
  border-bottom: 1px solid var(--blue);
}
#start-settings[hidden],
#start-options[hidden],
#start-typing[hidden] {
  display: none;
}
.flow-branches {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.flow-branches-head {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--muted);
}
.flow-branches-head span {
  font-weight: 600;
}
.flow-branch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flow-branch-list:empty {
  display: none;
}
.flow-branch {
  --team-hue: 220;
  position: relative;
  display: grid;
  gap: 4px;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.flow-branch::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: hsl(var(--team-hue) 60% 60%);
}
.flow-branch.is-inbox::before {
  background: color-mix(in srgb, var(--ink) 25%, transparent);
}
.flow-branch.is-dragging {
  opacity: 0.5;
}
.flow-branch-main,
.flow-branch-reply {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.flow-branch-handle {
  color: var(--muted);
  letter-spacing: -2px;
  cursor: grab;
  user-select: none;
}
.dashboard-page .app-shell:not(.is-setup) .flow-branch :is([data-option-label], [data-option-reply]) {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}
.dashboard-page .app-shell:not(.is-setup) .flow-branch [data-option-label] {
  font-weight: 600;
}
.dashboard-page .app-shell:not(.is-setup) .flow-branch [data-option-reply] {
  font-size: var(--text-sm);
  color: var(--muted);
}
.flow-branch :is([data-option-label], [data-option-reply]):focus-visible {
  box-shadow: 0 1px 0 var(--blue) !important;
}
.flow-branch-reply > span[aria-hidden] {
  padding-left: 18px;
  color: var(--muted);
}
.flow-branch-team {
  flex-shrink: 0;
  max-width: 48%;
}
.dashboard-page .app-shell:not(.is-setup) .flow-branch-team .dh-select-trigger {
  min-height: 0;
  height: 26px;
  padding: 0 8px 0 10px;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  background: hsl(var(--team-hue) 60% 55% / 0.16);
  color: hsl(var(--team-hue) 60% 32%);
  font-size: var(--text-sm);
  font-weight: 600;
}
html[data-theme="dark"] .dashboard-page .app-shell:not(.is-setup) .flow-branch-team .dh-select-trigger {
  color: hsl(var(--team-hue) 70% 72%);
}
.dashboard-page .app-shell:not(.is-setup) .flow-branch.is-inbox .flow-branch-team .dh-select-trigger {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--muted);
}
.flow-branch-actions {
  display: flex;
  gap: 2px;
  margin-left: auto;
  opacity: 0.55;
  transition: opacity 0.15s var(--ease);
}
.flow-branch:hover .flow-branch-actions,
.flow-branch:focus-within .flow-branch-actions {
  opacity: 1;
}
.flow-branch-actions .icon-button {
  width: 26px;
  height: 26px;
  min-height: 0;
}
.flow-branch-actions svg {
  width: 14px;
  height: 14px;
}
.flow-branch-actions [data-remove-option]:hover {
  color: var(--danger);
}
.flow-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 550;
}
.flow-add:hover:not(:disabled) {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 30%, transparent);
}
.flow-add:disabled {
  cursor: default;
  opacity: 0.6;
}
.flow-add svg {
  width: 14px;
  height: 14px;
}
/* When the card is narrow, the branches drop below the question. */
@container (max-width: 900px) {
  
  .flow-arrow.is-out,
  #start-typing,
  #start-options {
    grid-column: 1 / -1;
  }
  
  
  
}
@container (max-width: 520px) {
  
  
  
  .flow-branch-main {
    flex-wrap: wrap;
  }
  .flow-branch-team {
    max-width: 100%;
  }
  .flow-branch-reply {
    flex-wrap: wrap;
  }
  .dashboard-page .app-shell:not(.is-setup) .flow-branch [data-option-reply] {
    flex-basis: calc(100% - 40px);
  }
}
@media (max-width: 680px) {
  
  
  
  
  .moments {
    padding-left: 0;
  }
  .moment::before,
  .moment-node {
    display: none;
  }
  
}
/* The preview's buttons use the widget's accent, not the dashboard's. */
.dashboard-page .app-shell:not(.is-setup) .preview-widget .button.primary,
.dashboard-page .app-shell:not(.is-setup) .preview-widget .button.primary:hover {
  background: var(--blue);
  border-color: var(--blue);
}
/* Copy buttons confirm on themselves as well as with a toast. */
.copy-host {
  position: relative;
  overflow: hidden;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}
.copy-label {
  display: inline-flex;
  align-items: center;
  gap: inherit;
  transition: opacity 0.18s ease, transform 0.22s var(--ease);
}
.copy-confirm {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(8px) scale(0.85);
  transition: opacity 0.18s ease, transform 0.26s var(--ease);
  pointer-events: none;
}
.copy-confirm svg {
  width: 16px;
  height: 16px;
}
.copy-confirm path {
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  transition: stroke-dashoffset 0.32s ease 0.06s;
}
.copy-host[data-copied] .copy-label {
  opacity: 0;
  transform: translateY(-8px);
}
.copy-host[data-copied] .copy-confirm {
  opacity: 1;
  transform: none;
}
.copy-host[data-copied] .copy-confirm path {
  stroke-dashoffset: 0;
}
.copy-host[data-copied] {
  color: #176246;
  border-color: #bdd8ca;
  background: #f0f8f3;
}
html[data-theme="dark"] body:not(.widget-page) .copy-host[data-copied] {
  color: #95d8b7;
  border-color: #345845;
  background: #12251c;
}
@media (prefers-reduced-motion: reduce) {
  .copy-label,
  .copy-confirm {
    transform: none !important;
  }
}

/* The preview is clickable like the real widget. */
.dashboard-page .app-shell:not(.is-setup) .widget-preview-launcher {
  border: 0;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.widget-preview-launcher:focus-visible,
.preview-close:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
/* A slim, pill-shaped message box with a round send button. */
/* While confirming, the copy button is disabled but keeps its green confirmation look. */
.copy-host[data-copied]:disabled,
.copy-host[data-copied][aria-disabled="true"] {
  opacity: 1;
  cursor: default;
  pointer-events: none;
}
/* Widget → Install: three guided steps beside the platform guides. */
.install-step.is-todo .install-step-body > :not(h3, p) {
  opacity: 0.75;
}
@keyframes install-ping {
  0% { transform: scale(0.3); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}
@keyframes install-pop {
  0% { transform: scale(0.5); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes install-nudge {
  20% { transform: translateX(-4px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}

/* Copied confirmations everywhere: a subtle translucent green, label centred. */
:is(.copy-host, #copy-install, .install-copy, .setup-code-copy)[data-copied] {
  justify-content: center;
  text-align: center;
}
html body :is(.copy-host, #copy-install, .install-copy, .setup-code-copy)[data-copied],
html body .dashboard-page .app-shell:not(.is-setup) .install-copy[data-copied],
html body .project-setup-dialog .setup-code-copy[data-copied] {
  border-color: rgb(31 157 108 / 0.35);
  background: rgb(31 157 108 / 0.1);
  color: #1a7f58;
}
html[data-theme="dark"] body :is(.copy-host, #copy-install, .install-copy, .setup-code-copy)[data-copied],
html[data-theme="dark"] body .dashboard-page .app-shell:not(.is-setup) .install-copy[data-copied],
html[data-theme="dark"] body .project-setup-dialog .setup-code-copy[data-copied],
html body :is(.install-code, .setup-code) :is(.install-copy, .setup-code-copy)[data-copied],
html body .dashboard-page .app-shell:not(.is-setup) .install-code .install-copy[data-copied] {
  border-color: rgb(76 197 151 / 0.35);
  background: rgb(76 197 151 / 0.12);
  color: #6fd6ac;
}
/* Copy buttons sitting on the dark code bars keep the light-on-dark green in both themes. */
html body .install-code #copy-install[data-copied],
html body .install-code #copy-install.install-copy[data-copied],
html body .project-setup-dialog .setup-code #setup-copy[data-copied] {
  border-color: rgb(76 197 151 / 0.35);
  background: rgb(76 197 151 / 0.12);
  color: #6fd6ac;
}

/* New-password checklist (password-rules.js): each rule's ring fills green and draws a tick as
   it's met. The last rule only turns red once the basics are met and it still fails. */
.pw-rules {
  display: grid;
  gap: 6px;
  margin: 10px 0 2px;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}
.pw-rules li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.pw-mark {
  display: grid;
  flex: none;
  width: 16px;
  height: 16px;
}
.pw-mark svg {
  width: 16px;
  height: 16px;
  overflow: visible;
}
.pw-ring {
  fill: transparent;
  stroke: color-mix(in srgb, var(--muted) 45%, transparent);
  stroke-width: 1.4;
  transition: fill 0.25s ease, stroke 0.25s ease;
}
.pw-tick {
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 10;
  stroke-dashoffset: 10;
  transition: stroke-dashoffset 0.28s cubic-bezier(0.3, 0.9, 0.3, 1) 0.06s;
}
.pw-rules li.is-met {
  color: var(--ink);
}
.pw-rules li.is-met .pw-ring {
  fill: #23a26d;
  stroke: #23a26d;
}
.pw-rules li.is-met .pw-tick {
  stroke-dashoffset: 0;
}
.pw-rules li.is-met .pw-mark {
  animation: pw-pop 0.32s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.pw-rules li.is-missed {
  color: var(--danger);
}
.pw-rules li.is-missed .pw-ring {
  stroke: var(--danger);
}
@keyframes pw-pop {
  50% {
    transform: scale(1.18);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pw-ring,
  .pw-tick {
    transition: none;
  }
  .pw-rules li.is-met .pw-mark {
    animation: none;
  }
}

/* motion.css */
/* Shared motion is restrained, brief, and never required for interaction. */
@media (prefers-reduced-motion: no-preference) {
  .loading-panel {
    animation: loading-reveal 0.22s ease 0.16s both;
  }
  .profile-menu {
    animation: none;
  }
  .modal[open]:not(.closing) {
    animation-duration: 0.22s;
  }
  .modal.closing {
    animation-duration: 0.16s;
  }
  .skeleton {
    animation-duration: 1.7s;
  }
  .auth-page .button,
  .docs-page .button,
  .dashboard-page .button,
  .dashboard-page .icon-button,
  .dashboard-page .nav-link {
    transition:
      background-color 0.16s ease,
      border-color 0.16s ease,
      color 0.16s ease,
      box-shadow 0.16s ease;
  }
}
.dashboard-page #main.page-pending {
  opacity: 0;
}
.dashboard-page .app-shell:not(.is-setup) #main > .page-panel {
  animation: none;
}
@keyframes loading-reveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  #main,
  #auth-content,
  #docs-content,
  .profile-menu,
  .loading-panel {
    animation: none !important;
    transition: none !important;
  }
}

/* brand-loader.css */
/* The owl stays upright and readable; the orbit supplies continuous loading feedback. */
.brand-loader {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 116px;
  height: 132px;
  color: #164bdd;
}
.brand-loader-halo,
.brand-loader-orbit {
  position: absolute;
  top: 0;
  width: 116px;
  height: 116px;
  border-radius: 50%;
}
.brand-loader-halo {
  border: 1px solid currentColor;
  opacity: 0.1;
  animation: brand-loader-breathe 2800ms ease-in-out infinite;
}
.brand-loader-orbit {
  border: 1px solid transparent;
  border-top-color: currentColor;
  animation: brand-loader-orbit 2600ms linear infinite;
}
.brand-loader-orbit::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px #164bdd0a;
}
.brand-loader-owl {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 76px;
  height: 76px;
  object-fit: contain;
  animation: brand-loader-float 2800ms ease-in-out infinite;
}
.brand-loader-shadow {
  position: absolute;
  bottom: 0;
  width: 38px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.12;
  filter: blur(3px);
  animation: brand-loader-shadow 2800ms ease-in-out infinite;
}
html[data-theme="dark"] .brand-loader {
  color: #8cadff;
}
html[data-theme="dark"] .brand-loader-owl {
  filter: brightness(1.5);
}
@keyframes brand-loader-orbit {
  to {
    transform: rotate(360deg);
  }
}
@keyframes brand-loader-float {
  0%,
  100% {
    transform: translateY(2px) rotate(-3deg);
  }
  50% {
    transform: translateY(-4px) rotate(3deg);
  }
}
@keyframes brand-loader-breathe {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.08;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.17;
  }
}
@keyframes brand-loader-shadow {
  0%,
  100% {
    transform: scaleX(1);
    opacity: 0.12;
  }
  50% {
    transform: scaleX(0.75);
    opacity: 0.06;
  }
}
@media (prefers-reduced-motion: reduce) {
  .brand-loader * {
    animation: none;
  }
}

/* theme.css */
/* App preference only: customer widgets and their configured previews stay independent. */
:root {
  --menu-hover: #f3f4f6;
}
body:not(.widget-page) .profile-menu button:hover,
body:not(.widget-page) .profile-menu button:focus-visible {
  background: var(--menu-hover);
}
html[data-theme="dark"]:not(:has(> body.widget-page)),
html[data-theme="dark"] > body:not(.widget-page) {
  color-scheme: dark;
  --bg: #000000;
  --surface: #111111;
  --soft: #242424;
  --ink: #ededed;
  --muted: #b5b5b5;
  --line: #333333;
  --blue: #8cadff;
  --blue-soft: #223252;
  --green: #76c9ac;
  --danger: #ffaaa3;
  --warning: #ff922b;
  --shadow: 0 8px 28px #00000026;
  --menu-hover: #262626;
  --theme-raised: #181818;
  --theme-faint: #a0a0a0;
  --theme-primary: #365edb;
  --theme-primary-hover: #416ce8;
  --theme-info-line: #383838;
  --theme-danger-bg: #352427;
  --theme-danger-line: #704347;
  --theme-warning-bg: #2e1c10;
  --theme-warning-line: #7a3d14;
}
html[data-theme="dark"] body:not(.widget-page) {
  background: var(--bg);
  color: var(--ink);
  scrollbar-color: #626262 var(--surface);
}
html[data-theme="dark"] body:not(.widget-page) ::selection {
  background: #395286;
  color: #fff;
}
/* Preserve brand color while lifting the existing blue artwork off black. */
html[data-theme="dark"] body:not(.widget-page) .brand > img,
html[data-theme="dark"] body:not(.widget-page) .auth-assurance > img {
  filter: brightness(1.45);
}
html[data-theme="dark"]
  body:not(.widget-page)
  :is(
    .panel-surface,
    .modal,
    .toast,
    .docs-header,
    .skip-link,
    .overview-stat,
    .timezone-trigger,
    .website-input,
    .usecase-card,
    .platform-card,
    .installation-card,
    .composer-box,
    .conversation-row,
    .customer-details
  ) {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"]
  body:not(.widget-page)
  :is(.profile-menu, .timezone-popover) {
  background: var(--theme-raised);
  border-color: var(--line);
  box-shadow: 0 12px 36px #00000040;
}
html[data-theme="dark"] body:not(.widget-page) .modal {
  box-shadow: 0 25px 90px #00000066;
}
html[data-theme="dark"] body:not(.widget-page) .modal::backdrop {
  background: #000000b3;
}
html[data-theme="dark"] body:not(.widget-page) .drawer-backdrop {
  background: #0000009c;
}
html[data-theme="dark"] body:not(.widget-page) :is(input, select, textarea) {
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"]
  body:not(.widget-page)
  input:not([type="checkbox"], [type="radio"], [type="range"]),
html[data-theme="dark"] body:not(.widget-page) select,
html[data-theme="dark"] body:not(.widget-page) textarea {
  background-color: var(--surface);
}
html[data-theme="dark"]
  body:not(.widget-page)
  :is(input, textarea)::placeholder {
  color: var(--theme-faint);
  opacity: 1;
}
html[data-theme="dark"]
  body:not(.widget-page)
  :is(input:not([type="checkbox"], [type="radio"]), textarea, select):focus {
  border-color: #858585;
  box-shadow: 0 0 0 3px #ffffff12;
}
html[data-theme="dark"] body:not(.widget-page) input[aria-invalid="true"] {
  border-color: var(--danger);
}
html[data-theme="dark"] body:not(.widget-page) option {
  color: var(--ink);
  background: var(--surface);
}
html[data-theme="dark"] body:not(.widget-page) .button:hover,
html[data-theme="dark"] body:not(.widget-page) .icon-button:hover {
  background: var(--menu-hover);
  border-color: #555555;
}
html[data-theme="dark"] body:not(.widget-page) .button.primary,
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  .button.primary {
  background: var(--theme-primary);
  border-color: var(--theme-primary);
  color: #fff;
  box-shadow: 0 2px 3px #0000001f;
}
html[data-theme="dark"] body:not(.widget-page) .button.primary:hover,
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  .button.primary:hover {
  background: var(--theme-primary-hover);
  border-color: var(--theme-primary-hover);
}
html[data-theme="dark"] body:not(.widget-page) .button.danger {
  border-color: var(--theme-danger-line);
}
html[data-theme="dark"] body:not(.widget-page) :is(.form-error, .chip.danger) {
  color: var(--danger);
  background: var(--theme-danger-bg);
  border-color: var(--theme-danger-line);
}
html[data-theme="dark"] body:not(.widget-page) .toast {
  background: var(--theme-raised);
  box-shadow: 0 14px 40px #00000059;
}
html[data-theme="dark"] body:not(.widget-page) .toast.error {
  border-color: var(--theme-danger-line);
}
html[data-theme="dark"] body:not(.widget-page) .notice {
  background: var(--theme-raised);
  color: var(--muted);
  border-color: var(--line);
}
html[data-theme="dark"] body:not(.widget-page) .auth-check {
  background: #1b1e23;
  color: #88a8f7;
  border-color: #3b404a;
}
html[data-theme="dark"]
  body:not(.widget-page)
  :is(.notice.warning, .chip.warning) {
  background: var(--theme-warning-bg);
  color: var(--warning);
  border-color: var(--theme-warning-line);
}
html[data-theme="dark"] body:not(.widget-page) .chip {
  background: var(--soft);
  color: var(--muted);
  border-color: var(--line);
}
html[data-theme="dark"] body:not(.widget-page) .chip.blue {
  background: var(--blue-soft);
  color: #b4c9fc;
}
html[data-theme="dark"] body:not(.widget-page) .chip.warning {
  background: var(--theme-warning-bg);
  color: var(--warning);
}
html[data-theme="dark"] body:not(.widget-page) .chip.danger {
  background: var(--theme-danger-bg);
  color: var(--danger);
}
html[data-theme="dark"] body:not(.widget-page) .chip.success {
  background: color-mix(in srgb, var(--green) 16%, transparent);
  color: var(--green);
}
html[data-theme="dark"]
  body:not(.widget-page)
  :is(.code-block, #ready-widget-script) {
  background: #0c0c0c;
  border-color: var(--line);
  color: #cccccc;
}
html[data-theme="dark"] body:not(.widget-page) .skeleton {
  background: linear-gradient(100deg, #181818 20%, #242424 45%, #181818 65%);
  background-size: 200% 100%;
}
html[data-theme="dark"]
  body:not(.widget-page)
  :is(
    .auth-divider,
    .empty-state .empty-icon,
    .plan-card del
  ) {
  color: var(--theme-faint);
}
html[data-theme="dark"]
  body:not(.widget-page)
  :is(.docs-layout p, .docs-layout li) {
  color: var(--muted);
}
html[data-theme="dark"] body:not(.widget-page) .docs-layout nav a.active {
  background: var(--blue-soft);
  color: var(--blue);
}
html[data-theme="dark"]
  body:not(.widget-page)
  :is(th, .thread-subbar, .overview-methodology) {
  background: #181818;
  color: var(--muted);
  border-color: var(--line);
}
html[data-theme="dark"]
  body:not(.widget-page)
  :is(
    td,
    .surface-header,
    .table-wrap,
    .overview-response-row,
    .overview-member,
    .overview-team-link,
    .profile-footer,
    .thread-composer,
    .brand-summary,
    .installation-heading
  ) {
  border-color: var(--line);
}
html[data-theme="dark"] body:not(.widget-page) .billing-cycle button.active {
  background: #333333;
  box-shadow: 0 1px 4px #00000026;
}

/* Dashboard chrome and both navigation sizes. */
html[data-theme="dark"] .dashboard-page .app-shell.is-setup,
html[data-theme="dark"] .dashboard-page .app-shell:not(.is-setup) .sidebar {
  background: var(--bg);
}
html[data-theme="dark"] .dashboard-page .app-shell.is-setup .workspace-main {
  background: transparent;
}
html[data-theme="dark"] .dashboard-page .app-shell:not(.is-setup) .topbar {
  border-color: var(--line);
}
html[data-theme="dark"] .dashboard-page .app-shell:not(.is-setup) .nav-link {
  color: var(--muted);
}
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  .nav-link:hover,
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  .sidebar-help
  a:hover,
html[data-theme="dark"]
  .dashboard-page
  :is(.sidebar-project-action, .sidebar-collapse):hover {
  background: var(--menu-hover);
  color: var(--ink);
}
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  .nav-link.active {
  background: var(--blue-soft);
  color: #b2c9ff;
}
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  .nav-link.active
  svg {
  color: #b2c9ff;
}
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  .workspace-switch
  select,
html[data-theme="dark"] .dashboard-page .availability-label select {
  background-color: transparent;
  color: var(--ink);
}
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  .workspace-switch
  select:hover {
  background-color: var(--menu-hover);
}
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  :is(.notification-trigger, .sound-toggle),
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  .topbar-title
  h1,
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  .page-heading
  p,
html[data-theme="dark"]
  .dashboard-page
  :is(
    .sidebar-section-label,
    .sidebar-project-action,
    .sidebar-collapse,
    .view-label,
    .workspace-switch label,
    .profile-chevron,
    .overview-stat-heading,
    .overview-stat p,
    .overview-response-label,
    .overview-response-value small,
    .overview-member-copy small,
    .overview-member-status,
    .overview-contributions p
  ) {
  color: var(--muted);
}
html[data-theme="dark"] .dashboard-page :is(.view-label, .project-avatar) {
  border-color: var(--line);
}
html[data-theme="dark"] .dashboard-page .project-avatar {
  background: var(--soft);
  color: var(--ink);
}
html[data-theme="dark"] .dashboard-page .avatar {
  color: #cccccc;
  background: #262626;
  border-color: #404040;
}
html[data-theme="dark"] .dashboard-page .topbar-separator {
  color: #626262;
}
html[data-theme="dark"] .dashboard-page .overview-eyebrow {
  color: var(--theme-faint) !important;
}
html[data-theme="dark"]
  .dashboard-page
  :is(.overview-stat-heading svg, .overview-response-label svg) {
  color: var(--theme-faint);
}
html[data-theme="dark"] .dashboard-page .overview-stat.needs-attention {
  background: #202c43;
  border-color: var(--theme-info-line);
}
html[data-theme="dark"]
  .dashboard-page
  :is(
    .overview-stat.needs-attention .overview-stat-value,
    .overview-team-link
  ) {
  color: #b0c7ff;
}

/* Inbox messages deliberately distinguish customer, agent and private notes. */
html[data-theme="dark"] .dashboard-page .conversation-row:hover {
  background: var(--menu-hover);
}
html[data-theme="dark"] .dashboard-page .conversation-row.active {
  background: var(--blue-soft);
  border-left-color: #88a8f7;
}
html[data-theme="dark"] .dashboard-page .conversation-row + .conversation-row {
  border-top-color: var(--line);
}
html[data-theme="dark"]
  .dashboard-page
  :is(
    .conversation-row .meta,
    .message-footer,
    .timeline-event,
    .composer-tab,
    .composer-tools .icon-button,
    .keyboard-hint
  ) {
  color: var(--theme-faint);
}
html[data-theme="dark"] .dashboard-page .message-bubble {
  background: #262626;
  color: var(--ink);
}
html[data-theme="dark"] .dashboard-page .message.staff .message-bubble {
  background: #263754;
  color: #d3e0ff;
}
html[data-theme="dark"] .dashboard-page .message.private_note .message-bubble {
  background: color-mix(in srgb, #8b74ef 12%, var(--surface));
  border-color: color-mix(in srgb, #8b74ef 40%, var(--line));
  color: var(--ink);
}
html[data-theme="dark"] .dashboard-page .message.private_note .message-author {
  color: #b9a9ff;
}
html[data-theme="dark"] .dashboard-page .message.th-msg .message-bubble {
  background: #2a2a2e;
  color: var(--ink);
}
html[data-theme="dark"] .dashboard-page .message.th-msg.staff:not(.private_note) .message-bubble {
  background: var(--theme-primary);
  color: #fff;
}
html[data-theme="dark"] .dashboard-page .message.th-msg.staff.is-auto .message-bubble {
  background: color-mix(in srgb, var(--theme-primary) 16%, var(--surface));
  border-color: color-mix(in srgb, var(--theme-primary) 45%, var(--line));
  color: var(--ink);
}
html[data-theme="dark"] .dashboard-page .message.th-msg.private_note .message-bubble {
  background: color-mix(in srgb, #8b74ef 14%, var(--surface));
  border-color: color-mix(in srgb, #8b74ef 55%, var(--line));
}
html[data-theme="dark"] .dashboard-page .composer-box textarea {
  background: transparent;
}
html[data-theme="dark"] body:not(.widget-page) .composer-box {
  --composer-accent: #7794e9;
}
html[data-theme="dark"] body:not(.widget-page) .composer-box.note-mode {
  --composer-accent: #9b87f5;
  background: color-mix(in srgb, #8b74ef 7%, var(--surface));
  border-color: color-mix(in srgb, #8b74ef 30%, var(--line));
}
html[data-theme="dark"] body:not(.widget-page) .composer-box:focus-within {
  border-color: var(--composer-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--composer-accent) 20%, transparent);
}
html[data-theme="dark"] .dashboard-page .composer-seg {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
html[data-theme="dark"] .dashboard-page .composer-seg-thumb {
  background: color-mix(in srgb, var(--ink) 13%, var(--surface));
  box-shadow: 0 1px 2px rgb(0 0 0 / 40%);
}
html[data-theme="dark"] .dashboard-page .composer-tab.active {
  color: var(--ink);
}
html[data-theme="dark"] .dashboard-page .note-mode .composer-audience {
  color: #b9a9ff;
}
html[data-theme="dark"] .dashboard-page .app-shell .composer-box.note-mode .composer-send {
  background: #7357e6;
  border-color: #7357e6;
}
html[data-theme="dark"] .dashboard-page .app-shell .composer-box.note-mode .composer-send:hover {
  background: #6446dc;
  border-color: #6446dc;
}

/* Guided setup uses the same palette without changing geometry or transitions. */
html[data-theme="dark"] .onboarding-wizard {
  --wizard-ink: var(--ink);
  --wizard-muted: var(--muted);
  --wizard-line: var(--line);
}
html[data-theme="dark"]
  .onboarding-wizard
  :is(
    .wizard-step,
    .wizard-kicker,
    .wizard-heading > p,
    .field-help,
    .wizard-fineprint,
    .wizard-skip,
    .wizard-back,
    .website-prefix,
    .website-site-icon,
    .brand-upload-row small,
    .timezone-trigger > svg,
    .timezone-empty,
    .usecase-card small,
    .theme-options label,
    .brand-summary small,
    .brand-summary > span:last-child,
    .installation-card > p,
    .installation-heading svg,
    .setup-recommendation p
  ) {
  color: var(--muted);
}
html[data-theme="dark"]
  .onboarding-wizard
  .website-input
  input:not([type="radio"], [type="color"], [type="file"]) {
  background: transparent;
}
html[data-theme="dark"] .onboarding-wizard .website-input:focus-within {
  border-color: #858585;
  box-shadow: 0 0 0 3px #ffffff12;
}
html[data-theme="dark"] .onboarding-wizard .website-input input:focus {
  box-shadow: none;
}
html[data-theme="dark"] .onboarding-wizard .upload-brand {
  background: var(--soft);
  border-color: var(--theme-info-line);
}
html[data-theme="dark"]
  .onboarding-wizard
  :is(.choice-check, .brand-summary > span:last-child) {
  border-color: var(--line);
}
html[data-theme="dark"]
  body:not(.widget-page)
  #timezone-options
  [role="option"] {
  color: var(--ink);
}
html[data-theme="dark"]
  body:not(.widget-page)
  #timezone-options
  [role="option"]
  small {
  color: var(--muted);
}
html[data-theme="dark"]
  body:not(.widget-page)
  #timezone-options
  [role="option"].active {
  background: var(--menu-hover);
  color: var(--ink);
}
html[data-theme="dark"]
  .onboarding-wizard
  :is(.usecase-card, .platform-card):has(input:checked) {
  border-color: #617ba9;
  background: #233149;
  color: #c5d7ff;
}
html[data-theme="dark"] .onboarding-wizard .choice-icon {
  background: var(--soft);
  border-color: var(--line);
  color: var(--muted);
}
html[data-theme="dark"]
  .onboarding-wizard
  .usecase-card:has(input:checked)
  .choice-icon {
  background: #2b4269;
  border-color: #475f87;
  color: #c6d8ff;
}
html[data-theme="dark"]
  .onboarding-wizard
  .usecase-card:has(input:checked)
  .choice-check {
  background: var(--theme-primary);
  border-color: var(--theme-primary);
}
/* These bundled platform symbols are monochrome, unlike customer-uploaded logos. */
html[data-theme="dark"] .onboarding-wizard .platform-card > img {
  filter: invert(1);
  opacity: 0.85;
}
html[data-theme="dark"] .onboarding-wizard .theme-options > div {
  background: #0c0c0c;
  border-color: var(--line);
}
html[data-theme="dark"]
  .onboarding-wizard
  .theme-options
  label:has(input:checked) {
  background: #333333;
  color: var(--ink);
  box-shadow: 0 1px 3px #00000026;
}
html[data-theme="dark"] .onboarding-wizard .setup-recommendation {
  background: #181818;
  border-color: var(--theme-info-line);
}
html[data-theme="dark"]
  .onboarding-wizard
  :is(.setup-recommendation strong, .setup-recommendation > svg) {
  color: #d4d4d4;
}

/* A dark dashboard must not silently recolor a customer's chosen light preview. */
html[data-theme="dark"] .dashboard-page .widget-preview-stage {
  background: #181b22;
  --widget-preview-canvas: #202631;
  --widget-preview-dot: #414957;
}
html[data-theme="dark"] .dashboard-page .preview-widget:not(.preview-dark) {
  color-scheme: light;
  --ink: #192238;
  --surface: #fff;
  --line: #e0e1e4;
  --muted: #6b7280;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}
html[data-theme="dark"]
  .dashboard-page
  .preview-widget:not(.preview-dark)
  .avatar {
  color: #636871;
  background: #e4e6ea;
  border-color: var(--line);
}
html[data-theme="dark"] .dashboard-page .preview-widget.preview-dark .avatar {
  color: #b1b4ba;
  background: #2f3237;
  border-color: var(--line);
}
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  .preview-widget
  .button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

/* One quiet preference control, in the same position before and after switching. */
.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.theme-toggle {
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 35px;
  height: 35px;
  min-height: 35px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}
.theme-toggle:hover {
  background: var(--menu-hover);
  color: var(--ink);
}
.theme-toggle > svg {
  width: 17px;
  height: 17px;
}
.theme-toggle .theme-sun {
  display: none;
}
html[data-theme="dark"] body:not(.widget-page) .theme-toggle .theme-sun {
  display: block;
}
html[data-theme="dark"] body:not(.widget-page) .theme-toggle .theme-moon {
  display: none;
}
html[data-theme="dark"] body:not(.widget-page) .account-signout {
  color: var(--danger);
}

/* Match dashboard control specificity, including the compact form overrides. */
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
  border-color: var(--line);
}
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  :is(
    input:not([type="checkbox"]):not([type="radio"]),
    textarea,
    select
  ):focus {
  border-color: #858585;
}
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  input:not([type="checkbox"]):not([type="radio"])[aria-invalid="true"] {
  border-color: var(--danger);
}
html[data-theme="dark"]
  .dashboard-page
  .app-shell:not(.is-setup)
  .profile-footer {
  border-color: var(--line);
}

/* Cover browser autofill paint without hiding values, caret or validity states.
   Separate selectors keep an unknown vendor pseudo-class from dropping both. */
html[data-theme="dark"] body:not(.widget-page) input:autofill {
  background-color: var(--surface) !important;
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--surface) inset !important;
}
html[data-theme="dark"] body:not(.widget-page) input:-webkit-autofill {
  background-color: var(--surface) !important;
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--surface) inset !important;
}

/* Count badges: white numbers need the deep primary blue, not the light text blue. */
html[data-theme="dark"] :is(.notification-trigger > span, .nav-count, .today-count) {
  background: var(--theme-primary);
}

/* auth.css */
.auth-session-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.auth-layout[data-session-state="checking"] .auth-assurance {
  visibility: hidden;
}

/* The individual elements enter once; keep the shared surface entrance still. */
.auth-page #auth-content {
  animation: none;
}
@media (prefers-reduced-motion: no-preference) {
  .auth-layout:is([data-session-state="ready"], [data-session-state="error"])
    #auth-content
    > :not(form, .auth-session-status),
  .auth-layout:is([data-session-state="ready"], [data-session-state="error"])
    #auth-content
    > form
    > *,
  .auth-layout:is([data-session-state="ready"], [data-session-state="error"])
    .auth-assurance {
    animation: auth-element-enter 280ms var(--ease)
      var(--auth-enter-delay, 0ms) backwards;
  }
  #auth-content > .auth-intro {
    --auth-enter-delay: 30ms;
  }
  #auth-content > .google-button {
    --auth-enter-delay: 60ms;
  }
  #auth-content > .auth-divider {
    --auth-enter-delay: 90ms;
  }
  #auth-content > form > :nth-child(1) {
    --auth-enter-delay: 120ms;
  }
  #auth-content > form > :nth-child(2) {
    --auth-enter-delay: 144ms;
  }
  #auth-content > form > :nth-child(3) {
    --auth-enter-delay: 168ms;
  }
  #auth-content > form > :nth-child(4) {
    --auth-enter-delay: 192ms;
  }
  #auth-content > form > :nth-child(5) {
    --auth-enter-delay: 216ms;
  }
  #auth-content > form > :nth-child(6) {
    --auth-enter-delay: 240ms;
  }
  #auth-content > form > :nth-child(7) {
    --auth-enter-delay: 264ms;
  }
  #auth-content > form > :nth-child(n + 8) {
    --auth-enter-delay: 288ms;
  }
  #auth-content > .auth-switch,
  #auth-content > .invite-account,
  .auth-assurance {
    --auth-enter-delay: 300ms;
  }
}

@keyframes auth-element-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Invitation page: the project's logo, a refusal, and the account that is logged in. */
.invite-mark {
  overflow: hidden;
  font-size: var(--text-md);
  font-weight: 550;
}
.invite-mark.has-logo {
  border: 1px solid var(--line);
}
.invite-mark img {
  width: 100%;
  height: 100%;
  padding: 7px;
  object-fit: contain;
  background: white;
}
.auth-card .invite-error {
  margin: -8px 0 18px;
  line-height: 1.6;
}
.invite-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: var(--text-sm);
}
.invite-account span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.invite-account strong {
  color: var(--ink);
  font-weight: 500;
}
.invite-account .text-button {
  flex: none;
  color: var(--ink);
  font-size: var(--text-sm);
}

/* form-controls.css */
/* Shared staff/account form controls. Inputs retain native semantics and values. */
body input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  display: inline-block; width: 18px; height: 18px; min-width: 18px; min-height: 18px;
  flex: 0 0 18px; margin: 1px 0 0; padding: 0;
  border: 1.5px solid var(--line); border-radius: 5px;
  background-color: var(--surface); background-position: center; background-repeat: no-repeat; background-size: 14px 14px;
  vertical-align: middle; cursor: pointer; box-shadow: none;
  transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease;
}
body input[type="checkbox"]:hover:not(:disabled) { border-color: var(--blue); }
body input[type="checkbox"]:checked {
  background-color: #124bce; border-color: #124bce;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m4 10 4 4 8-8' stroke='white' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
body input[type="checkbox"]:indeterminate {
  background-color: #124bce; border-color: #124bce;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10h10' stroke='white' stroke-width='2.1' stroke-linecap='round'/%3E%3C/svg%3E");
}
body input[type="checkbox"]:disabled { opacity: .45; cursor: not-allowed; }
body input[type="checkbox"]:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
body input[type="checkbox"][aria-invalid="true"] { border-color: var(--danger); }
.checkbox-row:has(input[type="checkbox"]) { cursor: pointer; gap: 10px; }
.checkbox-row:has(input[type="checkbox"]:disabled) { cursor: not-allowed; }
.people-member-option input[type="checkbox"] { width: 18px; height: 18px; flex-basis: 18px; margin: 0; }

.dh-select { position: relative; display: inline-flex; flex-direction: column; min-width: 0; width: 100%; vertical-align: middle; }
/* Leave the native source measurable for existing integrations, but not interactive. */
select[data-custom-select] {
  position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important;
  opacity: 0 !important; pointer-events: none !important; margin: 0 !important;
}
.dh-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-width: 0; min-height: 40px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface);
  font: inherit; font-size: var(--text-sm); font-weight: 400; text-align: left; cursor: pointer;
  transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease;
}
.dh-select-trigger:hover:not(:disabled) { border-color: color-mix(in srgb,var(--muted) 65%,var(--line)); }
/* Open: a slightly firmer border, no glow ring; the list itself shows it's open. */
.dh-select-trigger[aria-expanded="true"] { border-color: color-mix(in srgb,var(--ink) 22%,var(--line)); box-shadow: none; }
.dh-select-trigger:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.dh-select-trigger>svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; transition: transform .14s ease; }
.dh-select-trigger[aria-expanded="true"]>svg { transform: rotate(180deg); }
.dh-select-value { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-select.is-disabled .dh-select-trigger { background: var(--soft); opacity: .55; cursor: not-allowed; }
.dh-select.is-invalid .dh-select-trigger { border-color: var(--danger); }
.dh-select-error { margin-top: 7px; color: var(--danger); font-size: var(--text-sm); }
.dh-select-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 100;
  display: flex; flex-direction: column; gap: 6px; width: 100%; max-height: 320px;
  margin: 0; padding: 6px; overflow: hidden; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px #00000022;
}
.dh-select-panel[popover] { position: fixed; inset: auto; }
.dh-select-panel.opens-up { top: auto; bottom: calc(100% + 6px); }
.dh-select-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.dh-select-panel .dh-select-search { width: 100%; min-height: 38px; flex-shrink: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: var(--text-sm); }
.dh-select-list [role="option"] {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; min-height: 36px; padding: 9px 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink); font: inherit; font-size: var(--text-sm); text-align: left; cursor: pointer;
  transition: background-color .12s ease;
}
.dh-select-list [role="option"]>span:first-child { min-width: 0; overflow-wrap: anywhere; }
/* Only the row under the pointer (or keyboard) tints, softly; the chosen one has its check, no box. */
.dh-select-list [role="option"]:is(:hover,.is-active):not(:disabled) { background: color-mix(in srgb,var(--ink) 6%,transparent); }
.dh-select-list [role="option"][aria-selected="true"] { font-weight: 500; }
.dh-select-list [role="option"]:disabled { opacity: .4; cursor: not-allowed; }
.dh-select-list [role="option"] + [role="option"] { margin-top: 2px; }
.dh-select-mark { display: flex; align-items: center; width: 14px; flex-shrink: 0; color: var(--blue); opacity: 0; }
.dh-select-mark svg { width: 14px; height: 14px; }
[aria-selected="true"]>.dh-select-mark { opacity: 1; }
.dh-select-value.is-placeholder { color: var(--muted); }
/* Options can carry a colour dot (data-dot on the <option>), e.g. an inbox's colour. */
.dh-select-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--muted)); }
.dh-select-value.has-dot { display: flex; align-items: center; gap: 10px; }
.dh-select-value.has-dot .dh-select-dot { margin-left: 1px; }
.dh-select-list [role="option"]:has(>.dh-select-dot) { justify-content: flex-start; gap: 10px; }
.dh-select-list [role="option"]:has(>.dh-select-dot)>span:not(.dh-select-mark) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* Multi-select: checkbox marks show every chosen item; rows only tint on hover/keyboard focus. */
.is-multiple .dh-select-list [role="option"] { justify-content: flex-start; gap: 10px; }
.is-multiple .dh-select-list [role="option"]>span:first-child { order: 2; flex: 1; }
.is-multiple .dh-select-mark { order: 1; justify-content: center; width: 16px; height: 16px; border: 1px solid color-mix(in srgb,var(--muted) 55%,var(--line)); border-radius: 4px; color: #fff; opacity: 1; }
.is-multiple .dh-select-mark svg { width: 11px; height: 11px; opacity: 0; }
.is-multiple [aria-selected="true"]>.dh-select-mark { border-color: #124bce; background: #124bce; }
.is-multiple [aria-selected="true"]>.dh-select-mark svg { opacity: 1; }

.dh-select-group { padding: 10px 10px 5px; color: var(--muted); font-size: var(--text-sm); font-weight: 500; }
.dh-select-empty { margin: 0; padding: 16px 10px; color: var(--muted); font-size: var(--text-sm); text-align: center; }
/* Keep compact filters compact and ordinary form fields full width. */
.row>.dh-select { width: auto; flex: 1 1 auto; }
.surface-header>.dh-select { width: auto; min-width: 135px; }
.overview-report-controls>.dh-select { width: auto; }
.overview-report-controls .dh-select-trigger { font-size: var(--text-sm); min-height: 31px; padding: 6px 9px; gap: 10px; }
.dh-select:has(select.filter-chip) { width: auto; }
.dh-select:has(select.filter-chip) .dh-select-trigger { border-color: transparent; background: transparent; padding: 5px 8px; min-height: 30px; font-size: var(--text-sm); color: var(--muted); }
.setup-team-controls>.dh-select,.setup-guide-controls>.dh-select { flex: 1; }
.project-setup-dialog .dh-select-trigger { font-size: var(--text-md); }
@media(pointer:coarse) { .dh-select-list [role="option"] { min-height: 44px; } }
@media(max-width:540px) { .dh-select-panel .dh-select-search { font-size: var(--text-md); } }
@media(prefers-reduced-motion:reduce) { body input[type="checkbox"],.dh-select-trigger,.dh-select-trigger>svg { transition: none; } }
@media(forced-colors:active) {
  body input[type="checkbox"] { appearance: auto; background-image: none; }
  .dh-select-trigger,.dh-select-panel { border-color: ButtonText; }
  .dh-select-mark { color: Highlight; }
}
@media(prefers-reduced-motion:no-preference) {
  .dh-select-panel:popover-open { animation: dh-select-in .12s ease-out; }
}
@keyframes dh-select-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
.people-filter>.dh-select { width: auto; min-width: 128px; }
.dh-select:has(select.people-role-select) { width: 130px; }
:is(.people-filter, .member-table) .dh-select-trigger { font-size: var(--text-sm); min-height: 32px; padding: 6px 10px; gap: 10px; }

/* Dropdown scrollbars: no track, a slim thumb flush with the panel's right edge that stays
   visible. Each list bleeds into its panel's right padding (--dropdown-pad) and gives back
   the rest after the scrollbar, so rows sit with equal space on both sides. */
html :is(.dh-select-list, .timezone-picker-list, #project-options, #notification-items, #timezone-options) {
  --dropdown-bar: 6px;
  scrollbar-gutter: stable;
  margin-right: calc(-1 * var(--dropdown-pad, 0px));
  padding-right: max(0px, calc(var(--dropdown-pad, 0px) - var(--dropdown-bar)));
}
html .dh-select-list { --dropdown-pad: 6px; }
html .timezone-picker-list, html #timezone-options { --dropdown-pad: 8px; }
html #project-options { --dropdown-pad: 7px; }
@supports selector(::-webkit-scrollbar) {
  /* Chromium ignores ::-webkit-scrollbar while scrollbar-width/color apply (theme.css inherits one). */
  html :is(.dh-select-list, .timezone-picker-list, #project-options, #notification-items, #timezone-options) {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }
  html :is(.dh-select-list, .timezone-picker-list, #project-options, #notification-items, #timezone-options)::-webkit-scrollbar {
    width: var(--dropdown-bar);
    background: transparent;
  }
  html :is(.dh-select-list, .timezone-picker-list, #project-options, #notification-items, #timezone-options)::-webkit-scrollbar-track {
    background: transparent;
  }
  html :is(.dh-select-list, .timezone-picker-list, #project-options, #notification-items, #timezone-options)::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: color-mix(in srgb, var(--ink, #172033) 24%, transparent);
  }
  html :is(.dh-select-list, .timezone-picker-list, #project-options, #notification-items, #timezone-options)::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--ink, #172033) 40%, transparent);
  }
}
@supports not selector(::-webkit-scrollbar) {
  html :is(.dh-select-list, .timezone-picker-list, #project-options, #notification-items, #timezone-options) {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--ink, #172033) 24%, transparent) transparent;
  }
}
/* Custom switches, segments and chips keep a hidden native checkbox for semantics; it must stay
   hidden when disabled (e.g. while saving), otherwise it flashes beside the label. */
body :is(.home-setting, .routing-switch, .look-switch, .people-mode-switch, .studio-seg, .routing-chip, .platform-card, .theme-options, .look-choice) input[type="checkbox"],
body :is(.home-setting, .routing-switch, .look-switch, .people-mode-switch, .studio-seg, .routing-chip, .platform-card, .theme-options, .look-choice) input[type="checkbox"]:disabled {
  opacity: 0;
  transition: none;
}
/* Controls you click shouldn't select their label text on quick or double clicks. */
:is(button, .button, .home-setting, .routing-switch, .look-switch, .people-mode-switch, .studio-seg label, .routing-chip, .routing-day-toggle, .checkbox-row, .account-switch, .account-theme, .account-rail-link, .account-rail-sublink, .nav-link, .nav-sublink, .view-toggle, .dh-select-trigger, .dh-select-list [role="option"], label:has(> input[type="checkbox"]), label:has(> input[type="radio"])) {
  -webkit-user-select: none;
  user-select: none;
}
