:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #161827;
  --muted: #5f6477;
  --line: rgba(107, 114, 128, 0.18);
  --pink: #ff3ea5;
  --violet: #7657ff;
  --blue: #16b8ff;
  --green: #23c779;
  --gold: #ffc83d;
  --orange: #ff7a3d;
  --cyan: #4de7ff;
  --rose: #ff5f8f;
  --panel: rgba(255, 255, 255, 0.82);
  --glass: rgba(255, 255, 255, 0.74);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --shadow-soft: 0 18px 54px rgba(37, 38, 69, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.74);
  --shadow-hot: 0 18px 42px rgba(230, 64, 165, 0.18), 0 0 28px rgba(22, 184, 255, 0.14);
  --rainbow: linear-gradient(90deg, var(--pink), var(--orange), var(--gold), var(--green), var(--cyan), var(--blue), var(--violet), var(--pink));
  --soft-rainbow: linear-gradient(135deg, rgba(255, 62, 165, 0.14), rgba(255, 200, 61, 0.13), rgba(35, 199, 121, 0.12), rgba(22, 184, 255, 0.14), rgba(118, 87, 255, 0.13));
  --sheen: linear-gradient(115deg, transparent 0 34%, rgba(255, 255, 255, 0.54) 45%, transparent 58% 100%);
  background: #fff8fd;
  color: var(--ink);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background:
    linear-gradient(120deg, rgba(255, 62, 165, 0.12), rgba(255, 200, 61, 0.1), rgba(35, 199, 121, 0.1), rgba(22, 184, 255, 0.12), rgba(118, 87, 255, 0.1)),
    conic-gradient(from 130deg at 50% -18%, rgba(255, 62, 165, 0.28), rgba(255, 200, 61, 0.2), rgba(35, 199, 121, 0.18), rgba(22, 184, 255, 0.24), rgba(118, 87, 255, 0.18), rgba(255, 62, 165, 0.28)),
    linear-gradient(135deg, #fff7fb 0%, #f8fff9 46%, #f7f5ff 100%);
  background-size: 230% 100%, 160% 160%, 100% 100%;
  animation: pageGlow 18s ease-in-out infinite alternate;
  color: var(--ink);
  isolation: isolate;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -30%;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background:
    repeating-linear-gradient(105deg, rgba(255, 255, 255, 0.38) 0 1px, transparent 1px 24px),
    conic-gradient(from 20deg at 50% 50%, rgba(255, 62, 165, 0.16), rgba(255, 200, 61, 0.13), rgba(35, 199, 121, 0.12), rgba(22, 184, 255, 0.15), rgba(118, 87, 255, 0.13), rgba(255, 62, 165, 0.16));
  filter: blur(18px);
  opacity: 0.82;
  animation: auroraTurn 30s linear infinite;
}

body::after {
  background: linear-gradient(118deg, transparent 30%, rgba(255, 255, 255, 0.5) 45%, transparent 60%);
  mix-blend-mode: soft-light;
  opacity: 0.68;
  transform: translateX(-18%);
  animation: diagonalSheen 16s ease-in-out infinite;
}

main {
  display: grid;
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 18px 42px;
}

.panel {
  position: relative;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.72)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.3), rgba(255, 200, 61, 0.22), rgba(35, 199, 121, 0.2), rgba(22, 184, 255, 0.26), rgba(118, 87, 255, 0.24)) border-box;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(1.08);
}

.panel::before {
  content: "";
  display: block;
  height: 5px;
  margin: -24px -24px 20px;
  background: var(--rainbow);
  background-size: 220% 100%;
  animation: rainbowShift 9s linear infinite;
}

.hero-panel {
  padding-bottom: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.72)) padding-box,
    var(--rainbow) border-box;
  border-color: transparent;
  box-shadow: 0 24px 70px rgba(37, 38, 69, 0.14), 0 0 54px rgba(255, 62, 165, 0.12);
}

.hero-panel::before {
  height: 7px;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.brand-logo {
  width: clamp(64px, 8vw, 96px);
  height: clamp(64px, 8vw, 96px);
  flex: 0 0 auto;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 18px 34px rgba(45, 43, 86, 0.2), 0 0 0 4px rgba(255, 255, 255, 0.76), 0 0 34px rgba(255, 62, 165, 0.22);
  animation: logoLift 7s ease-in-out infinite;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: #a81586;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0 0 10px;
  line-height: 1.1;
}

h1 {
  max-width: 820px;
  font-size: clamp(2rem, 4.4vw, 3.8rem);
  letter-spacing: 0;
  background: linear-gradient(90deg, #161827, #7d4dff 34%, #e640a5 64%, #ff7a3d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
}

.summary {
  max-width: 68ch;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.55;
}

.numbers,
.activity {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.numbers {
  margin: 0 0 12px;
}

.top-actions {
  display: grid;
  grid-template-columns: minmax(170px, 0.9fr) minmax(150px, 0.7fr) minmax(135px, 0.6fr) auto repeat(5, minmax(104px, auto));
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}

.top-actions .button-row {
  justify-content: flex-end;
  margin: 0;
}

.route-control-strip {
  display: grid;
  grid-template-columns: minmax(108px, 0.45fr) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.68)) padding-box,
    linear-gradient(90deg, rgba(255, 62, 165, 0.32), rgba(255, 200, 61, 0.22), rgba(35, 199, 121, 0.2), rgba(22, 184, 255, 0.25), rgba(118, 87, 255, 0.26)) border-box;
  box-shadow: 0 14px 34px rgba(37, 38, 69, 0.09);
}

.quick-control-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.2fr);
  gap: 12px;
  align-items: stretch;
}

.control-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.74)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.28), rgba(255, 200, 61, 0.18), rgba(35, 199, 121, 0.18), rgba(22, 184, 255, 0.24), rgba(118, 87, 255, 0.2)) border-box;
  box-shadow: 0 16px 34px rgba(37, 38, 69, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.control-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sheen);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-42%);
  transition: opacity 160ms ease;
}

.control-card:hover::after {
  opacity: 0.42;
  animation: cardSheen 1.9s ease;
}

.control-card h2,
.control-card p {
  margin: 0;
}

.control-card p:not(.eyebrow),
.outbound-card #outboundCallStatus {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.login-card,
.outbound-card,
.test-call-card {
  grid-template-columns: 1fr;
}

.route-card {
  grid-row: span 2;
}

.route-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.compact-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-action-row button {
  flex: 1 1 92px;
  width: auto;
  margin: 0;
}

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

.route-mode-cards button {
  display: grid;
  gap: 5px;
  min-height: 98px;
  margin: 0;
  border: 1px solid rgba(124, 118, 255, 0.16);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: #34364d;
  text-align: left;
  box-shadow: 0 10px 24px rgba(37, 38, 69, 0.06);
}

.route-mode-cards button strong {
  color: #161827;
  font-size: 0.94rem;
}

.route-mode-cards button span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.route-mode-cards button.active {
  color: #fff;
  border-color: transparent;
  background: var(--rainbow);
  background-size: 220% 100%;
  box-shadow: 0 16px 32px rgba(230, 64, 165, 0.26), 0 0 22px rgba(22, 184, 255, 0.14);
  animation: rainbowShift 8s linear infinite;
}

.route-mode-cards button.active strong,
.route-mode-cards button.active span {
  color: #fff;
}

.sr-select {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.power-switch {
  min-height: 42px;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(35, 199, 121, 0.12);
  color: #087443;
  font-weight: 900;
}

.power-switch.is-paused {
  background: rgba(255, 122, 61, 0.12);
  color: #b45309;
}

.route-summary {
  display: grid;
  gap: 3px;
  min-height: 44px;
  align-content: center;
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.76);
}

.route-summary strong {
  color: #a81586;
}

.route-summary span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.tabbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  padding: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.76)) padding-box,
    var(--rainbow) border-box;
  box-shadow: var(--shadow-hot);
  backdrop-filter: blur(16px);
  overscroll-behavior-x: contain;
}

.tabbar::-webkit-scrollbar {
  height: 6px;
}

.tabbar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--gold), var(--green), var(--blue), var(--violet));
}

.tab-button {
  flex: 0 0 auto;
  min-height: 42px;
  margin: 0;
  border: 1px solid rgba(118, 87, 255, 0.15);
  border-radius: 999px;
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.78);
  color: #34364d;
  box-shadow: none;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.tab-button.active {
  color: #fff;
  background: var(--rainbow);
  background-size: 220% 100%;
  box-shadow: 0 14px 30px rgba(230, 64, 165, 0.28), 0 0 24px rgba(22, 184, 255, 0.16);
  transform: translateY(-1px);
  animation: rainbowShift 7s linear infinite;
}

.tab-button:hover,
button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.sticky-access-bar {
  position: sticky;
  top: 74px;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 10px 0 14px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.76)) padding-box,
    linear-gradient(90deg, #ff3ea5, #ff7a3d, #ffc83d, #23c779, #16b8ff, #7657ff) border-box;
  box-shadow: 0 14px 34px rgba(118, 87, 255, 0.15);
  backdrop-filter: blur(18px);
}

.sticky-access-bar label {
  display: grid;
  gap: 4px;
  color: #676a83;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sticky-access-bar input {
  min-height: 38px;
  border-radius: 8px;
  font-size: 0.92rem;
}

.sticky-access-bar p {
  margin: 0;
  color: #282a43;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
}

.sticky-access-bar button {
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 0.86rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: panelIn 240ms ease both;
}

.overview-grid,
.two-column,
.lead-capture {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lead-capture {
  align-items: start;
}

.wide-field {
  grid-column: 1 / -1;
}

.compact-options {
  align-items: center;
}

.compact-options label {
  min-height: 72px;
  justify-content: center;
  padding: 12px;
  border: 1px solid rgba(230, 64, 165, 0.12);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.compact-test {
  margin-top: 16px;
}

.numbers div,
.activity > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 16px;
  padding: 12px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)) padding-box,
    var(--rainbow) border-box;
  box-shadow: 0 14px 30px rgba(31, 32, 48, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.numbers div:hover,
.activity > div:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(31, 32, 48, 0.12), 0 0 26px rgba(22, 184, 255, 0.1);
}

.settings-grid {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
}

.admin-subgrid,
.flow-grid {
  display: grid;
  gap: 12px;
}

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

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-title-row.compact-title {
  margin-bottom: 10px;
}

.routing-card {
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)) padding-box,
    var(--rainbow) border-box;
  box-shadow: 0 14px 30px rgba(37, 38, 69, 0.08), 0 0 26px rgba(255, 62, 165, 0.08);
}

.inbox-auth {
  display: block;
  margin-bottom: 14px;
}

.inbox-access-note {
  margin: -2px 0 12px;
  border: 1px solid rgba(118, 87, 255, 0.16);
  border-radius: 14px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(247, 252, 255, 0.72));
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.inbox-login-card {
  display: grid;
  grid-template-columns: 1.1fr repeat(3, minmax(150px, 1fr));
  align-items: end;
  gap: 12px;
  border: 1px solid rgba(124, 118, 255, 0.18);
  border-radius: 18px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)) padding-box,
    var(--rainbow) border-box;
  box-shadow: 0 16px 34px rgba(37, 38, 69, 0.09), 0 0 28px rgba(255, 62, 165, 0.08);
}

.inbox-login-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.team-control-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
  gap: 14px;
  align-items: stretch;
}

.team-current-card,
.team-code-editor,
.editor-note {
  border: 1px solid rgba(118, 87, 255, 0.16);
  border-radius: 16px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.22), rgba(255, 200, 61, 0.16), rgba(22, 184, 255, 0.2)) border-box;
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(37, 38, 69, 0.08);
}

.team-current-card p:not(.eyebrow),
.editor-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.team-current-details {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.team-current-details span {
  border-radius: 999px;
  padding: 8px 10px;
  background: var(--soft-rainbow);
  color: #34364d;
  font-size: 0.84rem;
  font-weight: 900;
}

.team-code-editor {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
}

.compact-row {
  gap: 12px;
}

.staff-code-rows {
  display: grid;
  gap: 10px;
}

.staff-code-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(110px, 0.7fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(217, 211, 238, 0.86);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.staff-code-row label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.staff-code-row label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.staff-code-row input {
  min-height: 44px;
}

.staff-code-row button {
  min-height: 44px;
  padding: 0 14px;
  background: #fff4f8;
  color: #b21f62;
  box-shadow: none;
}

.inbox-shell {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.4fr);
  min-height: 520px;
  border: 1px solid rgba(124, 118, 255, 0.22);
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 62, 165, 0.1), rgba(255, 200, 61, 0.06), rgba(35, 199, 121, 0.06), rgba(22, 184, 255, 0.1)),
    rgba(255, 255, 255, 0.52);
  box-shadow: 0 18px 45px rgba(37, 38, 69, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.conversation-list {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border-right: 1px solid rgba(124, 118, 255, 0.18);
  background: rgba(255, 255, 255, 0.68);
  overflow: auto;
  overscroll-behavior: contain;
}

.conversation-swipe {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  overflow: visible;
  border-radius: 14px;
}

.conversation-item {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 78px;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(217, 211, 238, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: #1f2030;
  text-align: left;
  box-shadow: 0 10px 22px rgba(37, 38, 69, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.conversation-swipe.archive-open .conversation-item {
  transform: translateX(-4px);
}

.conversation-archive-button {
  width: 82px;
  min-height: 78px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff3e6c, #ff7a3d);
  color: white;
  font-size: 0.82rem;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(255, 62, 108, 0.16);
}

.conversation-swipe:not(.archive-open):hover .conversation-archive-button {
  opacity: 0.9;
}

.conversation-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 62, 165, 0.28);
  box-shadow: 0 12px 26px rgba(37, 38, 69, 0.1);
}

.conversation-swipe.archive-open .conversation-item:hover {
  transform: translateX(-4px);
}

.conversation-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.conversation-item.selected {
  border-color: var(--pink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.74)) padding-box,
    var(--rainbow) border-box;
  box-shadow: 0 16px 32px rgba(255, 62, 165, 0.16), 0 0 22px rgba(22, 184, 255, 0.1);
}

.conversation-item span {
  overflow: hidden;
  color: #55576d;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item small,
.conversation-header span,
.message-bubble small {
  color: #74758b;
  font-size: 0.78rem;
}

.mini-confidence,
.confidence-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 137, 80, 0.12);
  color: #b45309;
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 900;
}

.mini-confidence.ready,
.confidence-pill.ready {
  background: rgba(35, 199, 121, 0.12);
  color: #087443;
}

.mini-confidence.needs-location,
.confidence-pill.needs-location {
  background: rgba(255, 62, 165, 0.12);
  color: #a81586;
}

.mini-confidence.needs-info,
.confidence-pill.needs-info {
  background: rgba(22, 184, 255, 0.13);
  color: #086e9e;
}

.confidence-pill.muted {
  background: rgba(107, 114, 128, 0.1);
  color: var(--muted);
}

.conversation-panel {
  display: grid;
  grid-template-rows: auto auto minmax(260px, 1fr) 24px auto auto;
  min-width: 0;
}

.conversation-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid rgba(124, 118, 255, 0.18);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(255, 247, 251, 0.72));
}

.conversation-header > div:first-child {
  display: grid;
  gap: 3px;
}

.conversation-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(124, 118, 255, 0.12);
  background: rgba(255, 255, 255, 0.54);
}

.conversation-details:empty {
  display: none;
}

.conversation-details div {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(217, 211, 238, 0.78);
  border-radius: 14px;
  padding: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.16), rgba(35, 199, 121, 0.12), rgba(22, 184, 255, 0.16)) border-box;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(37, 38, 69, 0.05);
}

.conversation-details span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.conversation-details strong {
  overflow-wrap: anywhere;
  font-size: 0.84rem;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 62, 165, 0.04), transparent 34%),
    linear-gradient(225deg, rgba(22, 184, 255, 0.05), transparent 36%);
  overflow: auto;
  overscroll-behavior: contain;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-replies:empty {
  display: none;
}

.quick-replies button {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(124, 118, 255, 0.2);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 252, 255, 0.78));
  color: #34364d;
  box-shadow: 0 8px 18px rgba(37, 38, 69, 0.06);
  font-size: 0.82rem;
}

.team-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  border: 1px solid rgba(118, 87, 255, 0.18);
  border-radius: 18px;
  padding: 12px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.72)) padding-box,
    linear-gradient(135deg, rgba(35, 199, 121, 0.28), rgba(22, 184, 255, 0.22), rgba(118, 87, 255, 0.2)) border-box;
  box-shadow: 0 14px 30px rgba(37, 38, 69, 0.08);
}

.presence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.presence-pill {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px;
  min-width: 116px;
  border: 1px solid rgba(217, 211, 238, 0.9);
  border-radius: 14px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 22px rgba(37, 38, 69, 0.06);
}

.presence-pill::before {
  content: "";
  grid-row: 1 / span 2;
  align-self: center;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #b8b7c8;
  box-shadow: 0 0 0 4px rgba(184, 183, 200, 0.12);
}

.presence-pill.status-available::before {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(35, 199, 121, 0.16), 0 0 14px rgba(35, 199, 121, 0.62);
  animation: statusPulseGreen 1.8s ease-in-out infinite;
}

.presence-pill.status-busy::before {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(255, 200, 61, 0.18), 0 0 14px rgba(255, 122, 61, 0.64);
}

.presence-pill.status-on-call::before {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(22, 184, 255, 0.18), 0 0 16px rgba(118, 87, 255, 0.62);
  animation: statusPulseBlue 1.8s ease-in-out infinite;
}

.presence-pill.status-active-call::before {
  background: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 62, 165, 0.18), 0 0 16px rgba(255, 62, 165, 0.74);
  animation: statusPulsePink 1.2s ease-in-out infinite;
}

.presence-pill.status-offline::before,
.presence-pill:not(.online)::before {
  background: #b8b7c8;
  box-shadow: 0 0 0 4px rgba(184, 183, 200, 0.12);
}

.presence-pill.status-on-call {
  border-color: rgba(22, 184, 255, 0.4);
  background: linear-gradient(135deg, rgba(22, 184, 255, 0.11), rgba(118, 87, 255, 0.08), #fff);
}

.presence-pill.status-active-call {
  border-color: rgba(255, 62, 165, 0.36);
  background: linear-gradient(135deg, rgba(255, 62, 165, 0.1), rgba(118, 87, 255, 0.08), #fff);
}

.presence-pill.status-busy {
  border-color: rgba(255, 200, 61, 0.5);
  background: linear-gradient(135deg, rgba(255, 200, 61, 0.14), rgba(255, 122, 61, 0.08), #fff);
}

.presence-pill small {
  color: #74758b;
  font-size: 0.74rem;
}

.presence-pill.muted {
  color: #74758b;
}

.typing-status {
  min-height: 24px;
  padding: 0 14px;
  color: #a81586;
  font-size: 0.86rem;
  font-weight: 700;
}

.message-bubble {
  max-width: min(78%, 460px);
  border-radius: 18px 18px 18px 7px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #ede8f8;
  box-shadow: 0 12px 26px rgba(37, 38, 69, 0.08);
}

.message-bubble p {
  margin: 0 0 6px;
  line-height: 1.35;
}

.message-bubble .delivery-issue {
  color: #9f1239;
  font-size: 0.78rem;
  font-weight: 800;
}

.message-bubble.outbound {
  align-self: flex-end;
  color: #fff;
  border-radius: 18px 18px 7px 18px;
  background: var(--rainbow);
  background-size: 220% 100%;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(230, 64, 165, 0.24), 0 0 22px rgba(22, 184, 255, 0.12);
  animation: rainbowShift 11s linear infinite;
}

.message-bubble.outbound small {
  color: rgba(255, 255, 255, 0.78);
}

.message-bubble.outbound .delivery-issue {
  color: #fff4f9;
}

.reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(124, 118, 255, 0.18);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.88), rgba(255, 247, 251, 0.82));
}

.call-log-shell {
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(0, 1.5fr);
  min-height: 560px;
  max-height: none;
  border: 1px solid rgba(124, 118, 255, 0.22);
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 62, 165, 0.09), rgba(255, 200, 61, 0.08), rgba(35, 199, 121, 0.06), rgba(22, 184, 255, 0.09)),
    rgba(255, 255, 255, 0.5);
  box-shadow: 0 18px 45px rgba(37, 38, 69, 0.1);
}

.call-log-list {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border-right: 1px solid rgba(124, 118, 255, 0.18);
  background: rgba(255, 255, 255, 0.76);
  overflow: auto;
  overscroll-behavior: contain;
}

.call-log-item {
  position: relative;
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 82px;
  margin: 0;
  padding: 10px 10px 10px 28px;
  border: 1px solid rgba(217, 211, 238, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #1f2030;
  text-align: left;
  box-shadow: 0 8px 20px rgba(37, 38, 69, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.call-log-item:hover {
  transform: translateY(-1px);
  border-color: rgba(22, 184, 255, 0.32);
  box-shadow: 0 12px 28px rgba(37, 38, 69, 0.1);
}

.call-outcome-dot {
  position: absolute;
  top: 14px;
  left: 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #a7adbb;
  box-shadow: 0 0 0 4px rgba(167, 173, 187, 0.16);
}

.call-outcome-dot.complete {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(35, 199, 121, 0.16), 0 0 16px rgba(35, 199, 121, 0.55);
  animation: statusPulseGreen 1.8s ease-in-out infinite;
}

.call-outcome-dot.incomplete {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 137, 80, 0.18), 0 0 16px rgba(255, 137, 80, 0.55);
}

.call-outcome-dot.needs-review {
  background: var(--pink);
  box-shadow: 0 0 0 4px rgba(230, 64, 165, 0.16), 0 0 16px rgba(230, 64, 165, 0.5);
}

.call-log-item.selected {
  border-color: var(--blue);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.74)) padding-box,
    linear-gradient(135deg, var(--blue), var(--green), var(--gold)) border-box;
  box-shadow: 0 16px 32px rgba(22, 184, 255, 0.14);
}

.call-log-item span,
.call-log-item small {
  overflow: hidden;
  color: #74758b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-detail {
  min-width: 0;
  padding: 18px;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.66)),
    var(--soft-rainbow);
}

.call-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.call-detail-header > span,
.status-pill {
  border-radius: 999px;
  padding: 6px 10px;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--blue));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.status-pill.incomplete {
  background: linear-gradient(90deg, var(--orange), var(--pink));
}

.status-pill.needs-review {
  background: linear-gradient(90deg, var(--violet), var(--blue));
}

.call-outcome-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 14px;
  border: 1px solid rgba(124, 118, 255, 0.18);
  border-radius: 14px;
  padding: 12px;
  background: var(--soft-rainbow);
}

.call-outcome-summary strong {
  min-width: 220px;
  flex: 1;
}

.call-outcome-summary span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.call-correction-panel {
  display: grid;
  grid-template-columns: minmax(140px, 0.72fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin: 0 0 14px;
  border: 1px solid rgba(118, 87, 255, 0.24);
  border-radius: 16px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(118, 87, 255, 0.1), rgba(255, 62, 165, 0.08), rgba(35, 199, 121, 0.07)),
    rgba(255, 255, 255, 0.86);
}

.call-correction-panel label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.call-correction-panel select,
.call-correction-panel input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(217, 211, 238, 0.95);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.call-correction-panel button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 9px 12px;
  background: linear-gradient(90deg, var(--violet), var(--pink), var(--orange));
  color: #fff;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(230, 64, 165, 0.18);
}

.call-correction-panel p {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.call-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.call-metric {
  min-height: 74px;
  border: 1px solid rgba(217, 211, 238, 0.9);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(37, 38, 69, 0.05);
}

.call-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.call-metric strong {
  overflow-wrap: anywhere;
}

.call-metric.ok {
  border-color: rgba(35, 199, 121, 0.38);
  background: rgba(35, 199, 121, 0.08);
}

.call-metric.warn {
  border-color: rgba(255, 137, 80, 0.38);
  background: rgba(255, 137, 80, 0.08);
}

.call-metric.bad {
  border-color: rgba(230, 64, 165, 0.38);
  background: rgba(230, 64, 165, 0.08);
}

.call-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.call-facts div,
.related-records,
.transcript-line,
.transcript-group,
.transcript-conversation,
.call-synopsis {
  border: 1px solid rgba(217, 211, 238, 0.9);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(37, 38, 69, 0.05);
}

.call-facts dd {
  overflow-wrap: anywhere;
}

.call-section {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.call-section h4 {
  margin: 0;
}

.related-records {
  display: grid;
  gap: 6px;
}

.related-record {
  display: grid;
  gap: 8px;
}

.record-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.record-links a {
  border: 1px solid rgba(118, 87, 255, 0.28);
  border-radius: 999px;
  padding: 7px 10px;
  background: linear-gradient(135deg, rgba(118, 87, 255, 0.1), rgba(255, 62, 165, 0.1));
  color: #34364d;
  font-weight: 900;
  text-decoration: none;
}

.related-records p,
.transcript-line p {
  margin: 0;
  line-height: 1.4;
}

.transcript-box {
  display: block;
  max-height: 420px;
  overflow: auto;
  border-radius: 16px;
  padding: 0;
  background:
    linear-gradient(135deg, rgba(255, 62, 165, 0.06), rgba(35, 199, 121, 0.05), rgba(22, 184, 255, 0.06));
}

.transcript-line small {
  display: block;
  margin-bottom: 5px;
  color: #74758b;
}

.transcript-line.caller {
  border-color: rgba(22, 184, 255, 0.28);
  background: rgba(22, 184, 255, 0.08);
}

.transcript-line.ai {
  border-color: rgba(230, 64, 165, 0.24);
  background: rgba(230, 64, 165, 0.06);
}

.call-synopsis {
  display: grid;
  gap: 7px;
  background: linear-gradient(135deg, rgba(255, 62, 165, 0.08), rgba(35, 199, 121, 0.07), rgba(22, 184, 255, 0.08));
}

.call-synopsis p {
  margin: 0;
  line-height: 1.38;
}

.transcript-group {
  padding: 0;
  overflow: hidden;
}

.transcript-group summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
}

.transcript-group summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.transcript-group p {
  margin: 0;
  padding: 0 10px 10px;
  white-space: pre-wrap;
  line-height: 1.42;
}

.transcript-group.caller {
  border-color: rgba(22, 184, 255, 0.28);
  background: rgba(22, 184, 255, 0.07);
}

.transcript-group.ai {
  border-color: rgba(230, 64, 165, 0.24);
  background: rgba(230, 64, 165, 0.06);
}

.transcript-conversation {
  display: grid;
  gap: 0;
  max-height: 420px;
  overflow: auto;
  border-color: transparent;
  border-radius: 16px;
  padding: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78)) padding-box,
    var(--rainbow) border-box;
}

.transcript-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.24fr) minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(217, 211, 238, 0.7);
}

.transcript-row:last-child {
  border-bottom: 0;
}

.transcript-row.caller {
  background: linear-gradient(90deg, rgba(22, 184, 255, 0.09), transparent 70%);
}

.transcript-row.ai,
.transcript-row.assistant {
  background: linear-gradient(90deg, rgba(255, 62, 165, 0.08), transparent 70%);
}

.transcript-meta {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.transcript-meta strong {
  color: #1f2030;
  overflow-wrap: anywhere;
}

.transcript-meta span {
  color: #74758b;
  font-size: 0.76rem;
  font-weight: 800;
}

.transcript-row p {
  margin: 0;
  min-width: 0;
  color: #34364d;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.42;
}

.status-timeline {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.status-timeline li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(217, 211, 238, 0.9);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(37, 38, 69, 0.05);
}

.status-timeline span {
  color: var(--muted);
}

.reply-form textarea {
  width: 100%;
  max-width: none;
  resize: vertical;
}

.empty-state {
  margin: 8px 0;
  color: #74758b;
}

.button-row audio {
  width: min(100%, 340px);
}

.scenario-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.scenario-row button {
  min-height: 38px;
  margin: 0;
  padding: 0 10px;
  background: linear-gradient(90deg, rgba(22, 184, 255, 0.92), rgba(35, 199, 121, 0.92));
  box-shadow: 0 8px 18px rgba(22, 184, 255, 0.18);
  font-size: 0.86rem;
}

.qa-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.insight-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.insight-highlights:empty {
  display: none;
}

.insight-highlight,
.focus-card,
.insight-card,
.insight-suggestions {
  border: 1px solid rgba(124, 118, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(37, 38, 69, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.insight-highlight:hover,
.focus-card:hover,
.insight-card:hover,
.insight-suggestions:hover,
.qa-card:hover,
.test-box:hover,
.call-metric:hover,
.activity-overview div:hover,
.activity-item:hover,
.conversation-details div:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(37, 38, 69, 0.12), 0 0 24px rgba(255, 62, 165, 0.08);
}

.insight-highlight {
  display: grid;
  gap: 4px;
  min-height: 88px;
  padding: 12px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82)) padding-box,
    var(--rainbow) border-box;
  border-color: transparent;
}

.insight-highlight span,
.insight-metric span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.insight-highlight strong {
  font-size: 1.55rem;
}

.insight-highlight small,
.insight-metric small {
  color: #7d4dff;
  font-weight: 800;
}

.insight-focus-strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.focus-card {
  display: grid;
  gap: 5px;
  padding: 13px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)) padding-box,
    var(--rainbow) border-box;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(37, 38, 69, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.focus-card.priority-high {
  border-color: rgba(255, 62, 103, 0.32);
  box-shadow: 0 12px 28px rgba(255, 62, 103, 0.12);
}

.focus-card span {
  color: #a81586;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.focus-card strong {
  font-size: 1rem;
}

.focus-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.insight-suggestions {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62)),
    var(--soft-rainbow);
}

.insight-learning-box {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 14px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.74)) padding-box,
    var(--rainbow) border-box;
  box-shadow: 0 12px 30px rgba(37, 38, 69, 0.08);
}

.learning-preview {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(124, 118, 255, 0.16);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.learning-preview:empty {
  display: none;
}

.learning-preview p {
  margin: 0;
  color: #55576d;
  line-height: 1.35;
}

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

.suggestion-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  border: 1px solid rgba(255, 62, 165, 0.18);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #34364d;
  font-size: 0.9rem;
  font-weight: 700;
}

.suggestion-row span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--pink), var(--orange));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
}

.suggestion-row p {
  margin: 2px 0 0;
  line-height: 1.36;
}

.insight-grid {
  display: grid;
  gap: 14px;
}

.insight-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.76)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.2), rgba(35, 199, 121, 0.14), rgba(22, 184, 255, 0.2), rgba(118, 87, 255, 0.18)) border-box;
  border-color: transparent;
}

.insight-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.insight-card-header span {
  border-radius: 999px;
  padding: 6px 10px;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--blue));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.insight-mini-grid,
.insight-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

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

.insight-metric,
.insight-top-list,
.insight-change-box,
.insight-call {
  border: 1px solid rgba(217, 211, 238, 0.9);
  border-radius: 14px;
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.84));
  box-shadow: 0 8px 18px rgba(37, 38, 69, 0.05);
}

.insight-metric strong {
  display: block;
  margin: 4px 0;
  overflow-wrap: anywhere;
  font-size: 1.16rem;
}

.insight-top-list,
.insight-change-box,
.recent-call-strip {
  display: grid;
  gap: 7px;
}

.insight-top-list p,
.insight-change-box p {
  margin: 0;
  color: #55576d;
  line-height: 1.35;
}

.action-box {
  background: linear-gradient(135deg, rgba(35, 199, 121, 0.08), rgba(22, 184, 255, 0.08));
}

.insight-top-list p {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.insight-top-list span {
  overflow-wrap: anywhere;
}

.insight-call {
  display: grid;
  gap: 3px;
}

.insight-call span,
.insight-call small {
  color: #74758b;
  font-size: 0.82rem;
}

.qa-card {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid rgba(124, 118, 255, 0.2);
  border-radius: 16px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.74)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.18), rgba(35, 199, 121, 0.12), rgba(22, 184, 255, 0.18)) border-box;
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(37, 38, 69, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.notification-box {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(124, 118, 255, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255, 62, 165, 0.08), rgba(255, 200, 61, 0.08), rgba(35, 199, 121, 0.08), rgba(22, 184, 255, 0.08));
}

.noise-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)) padding-box,
    linear-gradient(135deg, rgba(118, 87, 255, 0.85), rgba(255, 62, 165, 0.78), rgba(255, 200, 61, 0.78), rgba(22, 184, 255, 0.82)) border-box;
  border-color: transparent;
  box-shadow: 0 16px 32px rgba(118, 87, 255, 0.1);
}

.noise-panel h3 {
  margin: 0;
}

.noise-switch {
  min-height: 46px;
}

.web-push-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.72)) padding-box,
    linear-gradient(135deg, #7657ff, #ff3ea5, #ff7a3d, #23c779, #16b8ff) border-box;
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(118, 87, 255, 0.12);
}

.web-push-panel strong {
  display: block;
  color: #17172f;
  font-size: 0.96rem;
}

.web-push-panel p {
  margin: 3px 0 0;
  color: #55576d;
  font-size: 0.88rem;
  line-height: 1.35;
}

.web-push-diagnostic {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(118, 87, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: #32324a;
  font-size: 0.78rem;
  line-height: 1.35;
}

.access-session-status {
  margin: -2px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #4d4f68;
  font-size: 0.8rem;
  line-height: 1.3;
}

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

.web-push-actions button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.alert-audit-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  width: 100%;
}

.alert-audit-row input {
  max-width: 220px;
  min-height: 38px;
  padding: 0 12px;
}

.alert-audit-row button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #24d8db, #ff3ba8, #ff7a3d);
  color: #fff;
}

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

.qa-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  border: 1px solid rgba(217, 211, 238, 0.9);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.qa-row p {
  grid-column: 1 / -1;
  margin: 0;
  color: #55576d;
  line-height: 1.35;
}

.qa-row span {
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
}

.qa-row.ok span {
  background: var(--green);
}

.qa-row.warn span {
  background: linear-gradient(90deg, var(--orange), var(--pink));
}

.switch-row {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch-row input {
  width: 20px;
  height: 20px;
}

.range-row {
  max-width: 520px;
  grid-template-columns: 1fr auto;
}

.range-row input {
  width: 100%;
  accent-color: var(--pink);
}

.range-row output {
  width: 64px;
  justify-self: end;
  color: var(--violet);
  font-weight: 800;
}

.numbers div {
  border-left: 3px solid var(--pink);
}

dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  font-weight: 750;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  margin-right: 8px;
  background: var(--rainbow);
  background-size: 240% 100%;
  color: white;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(230, 64, 165, 0.24), 0 0 20px rgba(255, 200, 61, 0.12);
  transition: transform 160ms ease, box-shadow 160ms ease, background-position 220ms ease;
}

button:hover:not(:disabled) {
  background-position: 100% 50%;
  box-shadow: 0 16px 32px rgba(230, 64, 165, 0.3), 0 0 28px rgba(22, 184, 255, 0.16);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 650;
}

input,
select,
textarea {
  width: min(100%, 620px);
  box-sizing: border-box;
  border: 1px solid #ddd8ec;
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  background:
    linear-gradient(rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.12), rgba(35, 199, 121, 0.08), rgba(22, 184, 255, 0.12)) border-box;
  color: var(--ink);
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

textarea {
  line-height: 1.4;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(22, 184, 255, 0.22);
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(255, 62, 165, 0.1), 0 10px 24px rgba(22, 184, 255, 0.1);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #fbf9ff;
  color: #55576d;
  cursor: default;
  opacity: 1;
}

input[readonly],
textarea[readonly],
.locked-field {
  background:
    linear-gradient(rgba(251, 249, 255, 0.96), rgba(255, 255, 255, 0.86)) padding-box,
    linear-gradient(135deg, rgba(118, 87, 255, 0.12), rgba(255, 62, 165, 0.1), rgba(22, 184, 255, 0.1)) border-box;
  color: #3f4258;
  cursor: pointer;
}

body:not(.edit-mode) .settings-grid label {
  color: #55576d;
}

textarea#businessKnowledgeInput,
textarea#voiceDirectionInput,
textarea#serviceAreaInput,
textarea#offeredServicesInput,
textarea#notOfferedServicesInput,
textarea#pricingNotesInput,
textarea#emergencyInstructionsInput,
textarea#emergencyQuestionsInput,
textarea#humanHandoffRulesInput,
textarea#humanRouteNumbersInput,
textarea#humanRouteTriggersInput,
textarea#callOutcomeRulesInput,
textarea#fallbackRulesInput,
textarea#afterHoursInstructionsInput,
textarea#applyInstructionsInput,
textarea#bookingDestinationsInput,
textarea#qualifyingServicesInput,
textarea#outOfScopeHandlingInput,
textarea#followUpStyleInput,
textarea#newClientsFlowInput,
textarea#existingClientsFlowInput,
textarea#salesFlowInput,
textarea#otherCallersFlowInput,
textarea#smsFollowUpMessageInput,
textarea#reviewFollowUpMessageInput,
textarea#staffAccessCodesInput,
textarea#qaChecklistInput,
textarea#customInstructionsInput,
textarea#scriptPreview,
textarea#testCallerInput,
textarea#testScriptOutput {
  width: 100%;
  max-width: none;
}

.test-box {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(230, 64, 165, 0.18);
  border-radius: 16px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.68)),
    linear-gradient(135deg, rgba(255, 62, 165, 0.12), rgba(255, 200, 61, 0.1), rgba(22, 184, 255, 0.12));
  box-shadow: 0 12px 26px rgba(37, 38, 69, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.account-links-card {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.76)) padding-box,
    var(--rainbow) border-box;
  box-shadow: 0 16px 34px rgba(37, 38, 69, 0.09), 0 0 28px rgba(22, 184, 255, 0.08);
}

.account-links-card h3,
.account-links-card p {
  margin: 0;
}

.account-links-card p {
  color: var(--muted);
  line-height: 1.36;
}

.account-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.account-link-grid a {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(124, 118, 255, 0.16);
  border-radius: 14px;
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.8));
  color: #1f2030;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(37, 38, 69, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.account-link-grid a:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 62, 165, 0.28);
  box-shadow: 0 16px 30px rgba(37, 38, 69, 0.1), 0 0 22px rgba(255, 62, 165, 0.08);
}

.account-link-grid span {
  color: #a81586;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.account-link-grid strong {
  overflow-wrap: anywhere;
}

#status,
#leadStatus,
#settingsStatus,
#inboxStatus {
  min-height: 22px;
  color: #55576d;
}

h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

ul {
  min-height: 44px;
  margin: 0;
  padding: 0;
  list-style: none;
}

li {
  border-top: 1px solid #f0edf8;
  padding: 9px 0;
  color: #55576d;
  font-size: 0.92rem;
}

.legacy-activity {
  display: none;
}

.activity-shell {
  display: grid;
  gap: 12px;
}

.activity-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.activity-overview div {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(124, 118, 255, 0.16);
  border-radius: 14px;
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.76)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.14), rgba(255, 200, 61, 0.12), rgba(22, 184, 255, 0.14)) border-box;
  border-color: transparent;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.activity-overview span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.activity-overview strong {
  font-size: 1.35rem;
}

.activity-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.activity-filter {
  width: auto;
  min-height: 34px;
  border-color: rgba(124, 118, 255, 0.22);
  background: rgba(255, 255, 255, 0.82);
  color: #34364d;
  box-shadow: none;
}

.activity-filter.active {
  border-color: transparent;
  background: var(--rainbow);
  background-size: 220% 100%;
  color: #fff;
  box-shadow: 0 12px 26px rgba(255, 62, 165, 0.22), 0 0 18px rgba(22, 184, 255, 0.1);
  animation: rainbowShift 9s linear infinite;
}

.activity-timeline {
  position: relative;
  display: grid;
  gap: 9px;
}

.activity-timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 13px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(var(--pink), var(--gold), var(--green), var(--blue), var(--violet));
  opacity: 0.42;
}

.activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid rgba(217, 211, 238, 0.82);
  border-radius: 14px;
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.82));
  box-shadow: 0 10px 24px rgba(37, 38, 69, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.activity-item.empty-state {
  display: block;
  color: var(--muted);
}

.activity-dot {
  z-index: 1;
  width: 12px;
  height: 12px;
  margin: 5px auto 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 2px rgba(22, 184, 255, 0.16);
  animation: statusPulseBlue 2s ease-in-out infinite;
}

.activity-item.green .activity-dot {
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(35, 199, 121, 0.18);
  animation-name: statusPulseGreen;
}

.activity-item.pink .activity-dot {
  background: var(--pink);
  box-shadow: 0 0 0 2px rgba(255, 62, 165, 0.18);
  animation-name: statusPulsePink;
}

.activity-item.violet .activity-dot {
  background: var(--violet);
  box-shadow: 0 0 0 2px rgba(118, 87, 255, 0.18);
  animation-name: statusPulseViolet;
}

.activity-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.activity-copy div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.activity-copy strong {
  overflow-wrap: anywhere;
}

.activity-copy time,
.activity-copy span {
  color: #74758b;
  font-size: 0.78rem;
  font-weight: 800;
}

.activity-copy p {
  margin: 0;
  color: #55576d;
  overflow-wrap: anywhere;
  line-height: 1.36;
}

li.ready {
  color: #12824d;
}

li.missing {
  color: #c23b52;
}

@media (max-width: 680px) {
  .sticky-access-bar {
    top: 70px;
    grid-template-columns: 1fr auto;
    gap: 8px;
    border-radius: 14px;
    padding: 8px;
  }

  .sticky-access-bar label {
    grid-column: 1 / -1;
  }

  .sticky-access-bar p {
    font-size: 0.78rem;
  }

  .sticky-access-bar button {
    min-width: 88px;
    padding: 0 12px;
  }

  .numbers,
  .activity,
  .activity-overview,
  .flow-grid,
  .qa-grid,
  .insight-highlights,
  .insight-focus-strip,
  .insight-mini-grid,
  .insight-columns,
  .scenario-row,
  .overview-grid,
  .two-column,
  .lead-capture,
  .top-actions,
  .quick-control-grid,
  .mini-fields,
  .route-control-strip,
  .team-control-grid,
  .inbox-auth,
  .inbox-login-card,
  .inbox-shell,
  .conversation-details,
  .team-strip,
  .call-log-shell,
  .call-metrics,
  .call-facts,
  .reply-form {
    grid-template-columns: 1fr;
  }

  .quick-control-grid {
    gap: 8px;
  }

  .control-card {
    gap: 8px;
    border-radius: 14px;
    padding: 10px;
  }

  .control-card p:not(.eyebrow),
  .outbound-card #outboundCallStatus {
    font-size: 0.78rem;
    line-height: 1.28;
  }

  .login-card,
  .outbound-card,
  .test-call-card {
    align-content: stretch;
  }

  .login-card .mini-fields,
  .outbound-card .mini-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-card .compact-action-row,
  .test-call-card .compact-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-card .compact-action-row button:first-child {
    grid-column: 1 / -1;
  }

  .compact-action-row button {
    min-height: 34px;
  }

  .route-card {
    grid-row: auto;
  }

  .route-card-header {
    align-items: flex-start;
  }

  .route-mode-cards {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .route-mode-cards button {
    min-height: 0;
    grid-template-columns: minmax(82px, 0.38fr) minmax(0, 1fr);
    align-items: center;
    padding: 8px;
  }

  .route-mode-cards button span {
    font-size: 0.76rem;
  }

  .staff-code-row {
    grid-template-columns: 1fr;
  }

  main {
    gap: 9px;
    padding: max(6px, env(safe-area-inset-top)) 6px calc(64px + env(safe-area-inset-bottom));
  }

  .panel {
    padding: 10px;
    box-shadow: 0 10px 34px rgba(37, 38, 69, 0.11);
    border-radius: 14px;
  }

  .panel::before {
    height: 3px;
    margin: -10px -10px 9px;
  }

  .hero-panel {
    padding-bottom: 10px;
  }

  .tabbar {
    position: fixed;
    left: 6px;
    right: 6px;
    bottom: max(5px, env(safe-area-inset-bottom));
    top: auto;
    z-index: 30;
    margin-inline: 0;
    padding: 5px;
    gap: 4px;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: none;
    border-radius: 20px;
    box-shadow: 0 18px 46px rgba(37, 38, 69, 0.24), 0 0 34px rgba(255, 62, 165, 0.18);
  }

  .tab-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    min-height: 31px;
    padding: 0 8px;
    font-size: 0.68rem;
    scroll-snap-align: none;
    white-space: nowrap;
    box-shadow: none;
  }

  .tab-button:nth-child(1).active { background: linear-gradient(135deg, #ff3ea5, #ff7a3d); }
  .tab-button:nth-child(2).active { background: linear-gradient(135deg, #ff7a3d, #ffc83d); }
  .tab-button:nth-child(3).active { background: linear-gradient(135deg, #ffc83d, #23c779); }
  .tab-button:nth-child(4).active { background: linear-gradient(135deg, #23c779, #16b8ff); }
  .tab-button:nth-child(5).active { background: linear-gradient(135deg, #16b8ff, #7657ff); }
  .tab-button:nth-child(6).active { background: linear-gradient(135deg, #7657ff, #23c779); }
  .tab-button:nth-child(7).active { background: linear-gradient(135deg, #7657ff, #ff3ea5); }
  .tab-button:nth-child(8).active { background: linear-gradient(135deg, #ff5f8f, #ff7a3d); }
  .tab-button:nth-child(9).active { background: linear-gradient(135deg, #23c779, #7657ff); }
  .tab-button:nth-child(10).active { background: linear-gradient(135deg, #ffc83d, #ff3ea5); }
  .tab-button:nth-child(11).active { background: linear-gradient(135deg, #16b8ff, #ff3ea5); }

  .top-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 7px;
  }

  .route-control-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
  }

  .route-summary {
    grid-column: 1 / -1;
    min-height: 0;
    padding: 8px;
  }

  .top-actions button,
  .top-actions .switch-row,
  .pin-field,
  .staff-name-field,
  .staff-status-field {
    width: 100%;
  }

  .pin-field {
    grid-column: 1 / -1;
  }

  .top-actions .button-row {
    justify-content: flex-start;
  }

  .brand-header {
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 8px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  h1 {
    font-size: 1.28rem;
    margin-bottom: 3px;
  }

  h2 {
    font-size: 1.05rem;
    margin-bottom: 4px;
  }

  h3 {
    font-size: 0.98rem;
  }

  .summary {
    margin-bottom: 6px;
    font-size: 0.78rem;
    line-height: 1.42;
  }

  .numbers {
    display: none;
  }

  .numbers div,
  .activity > div,
  .compact-options label {
    padding: 10px;
  }

  .numbers dd,
  .call-log-item strong,
  .conversation-item strong {
    overflow-wrap: anywhere;
  }

  input,
  select,
  textarea,
  button {
    font-size: 15px;
  }

  button {
    min-height: 36px;
    padding: 0 10px;
    width: 100%;
    margin-right: 0;
  }

  label,
  li,
  .suggestion-row {
    font-size: 0.9rem;
  }

  input,
  select,
  textarea {
    padding: 9px 10px;
  }

  .top-actions button {
    min-height: 36px;
    font-size: 0.86rem;
  }

  .switch-row {
    width: 100%;
    min-height: 40px;
  }

  .switch-row input {
    width: 18px;
    height: 18px;
  }

  .section-title-row {
    align-items: flex-start;
  }

  .section-title-row button {
    flex: 0 0 auto;
    width: auto;
  }

  .conversation-list {
    display: flex;
    gap: 8px;
    max-height: none;
    min-height: 82px;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid rgba(124, 118, 255, 0.18);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
  }

  .inbox-shell,
  .call-log-shell {
    border-radius: 14px;
  }

  .conversation-swipe {
    flex: 0 0 min(92vw, 372px);
    grid-template-columns: minmax(0, 1fr) 76px;
    scroll-snap-align: start;
  }

  .conversation-item {
    min-height: 72px;
  }

  .call-log-item {
    flex: 0 0 min(78vw, 280px);
    min-height: 72px;
    scroll-snap-align: start;
  }

  .conversation-archive-button {
    width: 76px;
    min-height: 72px;
    padding: 0 8px;
  }

  .conversation-panel {
    min-height: 0;
    grid-template-rows: auto auto minmax(240px, 42vh) 20px auto auto;
  }

  .message-list {
    min-height: 260px;
    max-height: 42vh;
    padding: 10px;
  }

  .conversation-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .quick-replies button {
    flex: 1 1 120px;
    width: auto;
  }

  .call-log-list {
    display: flex;
    gap: 8px;
    max-height: none;
    min-height: 82px;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid rgba(124, 118, 255, 0.18);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
  }

  .call-log-item {
    flex: 0 0 min(78vw, 290px);
    min-height: 72px;
    scroll-snap-align: start;
  }

  .call-detail {
    max-height: none;
    padding: 14px;
    overflow: visible;
  }

  .call-correction-panel {
    grid-template-columns: 1fr;
  }

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

  .call-metric {
    min-height: 68px;
  }

  .call-outcome-summary {
    align-items: flex-start;
  }

  .transcript-box {
    max-height: 44vh;
  }

  .message-bubble {
    max-width: 94%;
  }

  .account-link-grid,
  .transcript-row {
    grid-template-columns: 1fr;
  }

  .transcript-row {
    gap: 5px;
    padding: 10px;
  }

  .presence-pill {
    min-width: 0;
    flex: 1 1 130px;
  }

  .insight-highlight {
    min-height: 66px;
    padding: 10px;
  }

  .insight-highlight strong {
    font-size: 1.22rem;
  }

  .insight-card,
  .insight-suggestions,
  .insight-learning-box,
  .notification-box {
    padding: 12px;
  }

  .web-push-panel {
    grid-template-columns: 1fr;
  }

  .web-push-actions,
  .web-push-actions button {
    width: 100%;
  }

  .activity-filter {
    flex: 1 1 92px;
    width: auto;
    padding: 0 8px;
  }

  .activity-overview strong {
    font-size: 1.18rem;
  }

  .activity-item {
    padding: 9px;
  }
}

@media (max-width: 980px) {
  .quick-control-grid {
    grid-template-columns: 1fr;
  }

  .usage-hero,
  .usage-actions {
    grid-template-columns: 1fr;
  }

  .usage-grid {
    grid-template-columns: 1fr;
  }

  .usage-card {
    min-height: 0;
  }

  .route-card {
    grid-row: auto;
  }
}

/* Dispatch cleanup pass: keep the rainbow brand, lower the visual noise. */
body {
  background:
    linear-gradient(135deg, rgba(255, 62, 165, 0.08), rgba(35, 199, 121, 0.05), rgba(22, 184, 255, 0.07)),
    #fbfbff;
  background-size: auto;
  animation: none;
}

body::before,
body::after {
  display: none;
}

main {
  max-width: 1220px;
  gap: 12px;
}

.panel {
  border-color: rgba(224, 226, 236, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 32px rgba(37, 38, 69, 0.08);
}

.panel::before {
  height: 4px;
  animation-duration: 18s;
}

.hero-panel {
  padding: 18px;
  box-shadow: 0 14px 34px rgba(37, 38, 69, 0.1);
}

.brand-header {
  margin-bottom: 12px;
}

.brand-logo {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  animation: none;
}

h1 {
  font-size: clamp(1.8rem, 3vw, 2.75rem);
}

.summary {
  font-size: 0.98rem;
  line-height: 1.42;
}

.quick-control-grid {
  grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.3fr) minmax(280px, 0.95fr);
}

.control-card {
  gap: 10px;
  border-color: rgba(224, 226, 236, 0.88);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(37, 38, 69, 0.06);
}

.control-card::after {
  display: none;
}

.test-call-card {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.test-call-card .compact-action-row {
  min-width: 260px;
}

.route-mode-cards button {
  min-height: 78px;
  border-radius: 12px;
  background: #f8f9ff;
  box-shadow: none;
}

.route-mode-cards button.active {
  box-shadow: 0 10px 22px rgba(230, 64, 165, 0.22);
}

.route-control-strip,
.route-summary,
.numbers div,
.activity > div,
.routing-card,
.team-current-card,
.team-code-editor,
.editor-note,
.inbox-login-card,
.conversation-details div {
  border-color: rgba(224, 226, 236, 0.88);
  background: #fff;
  box-shadow: 0 7px 18px rgba(37, 38, 69, 0.05);
}

.tabbar {
  position: sticky;
  top: 8px;
  border-radius: 14px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(37, 38, 69, 0.1);
}

.tab-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  background: #f7f8ff;
  font-size: 0.86rem;
}

.tab-button.active {
  box-shadow: 0 8px 18px rgba(230, 64, 165, 0.2);
}

.section-title-row {
  margin-bottom: 10px;
}

.overview-grid,
.two-column,
.lead-capture {
  gap: 12px;
}

.inbox-shell,
.call-log-shell {
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(37, 38, 69, 0.08);
}

.conversation-list,
.call-log-list {
  background: #f7f8ff;
}

.conversation-item,
.call-log-item {
  border-radius: 12px;
  box-shadow: none;
}

.message-list {
  background: #fbfcff;
}

@media (max-width: 980px) {
  .quick-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-card,
  .outbound-card {
    grid-column: 1 / -1;
  }

  .test-call-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  main {
    gap: 8px;
    padding: max(6px, env(safe-area-inset-top)) 6px calc(62px + env(safe-area-inset-bottom));
  }

  .panel,
  .hero-panel {
    border-radius: 12px;
    padding: 9px;
  }

  .panel::before {
    margin: -9px -9px 8px;
  }

  .brand-header {
    gap: 8px;
    margin-bottom: 6px;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    box-shadow: 0 0 0 2px #fff, 0 8px 18px rgba(37, 38, 69, 0.16);
  }

  .eyebrow {
    margin-bottom: 3px;
    font-size: 0.68rem;
  }

  h1 {
    font-size: 1.16rem;
    margin-bottom: 2px;
  }

  h2 {
    font-size: 0.98rem;
  }

  .summary {
    display: none;
  }

  .quick-control-grid {
    display: flex;
    grid-template-columns: none;
    gap: 6px;
    margin-inline: -3px;
    padding: 0 3px 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .control-card {
    flex: 0 0 min(88vw, 350px);
    border-radius: 11px;
    padding: 7px;
    scroll-snap-align: start;
  }

  .login-card,
  .outbound-card {
    gap: 6px;
  }

  .login-card > div:first-child,
  .outbound-card > div:first-child,
  .test-call-card > div:first-child {
    display: none;
  }

  .login-card > div:first-child p:not(.eyebrow),
  .outbound-card > div:first-child p:not(.eyebrow),
  .test-call-card > div:first-child p:not(.eyebrow) {
    display: none;
  }

  .route-card-header {
    align-items: center;
  }

  .route-card-header h2 {
    margin: 0;
  }

  .route-mode-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .route-mode-cards button {
    display: block;
    min-height: 54px;
    padding: 7px;
    text-align: center;
  }

  .route-mode-cards button strong {
    display: block;
    font-size: 0.76rem;
  }

  .route-mode-cards button span {
    display: none;
  }

  .route-control-strip {
    margin-top: 4px;
    padding: 7px;
    grid-template-columns: minmax(80px, 0.36fr) minmax(0, 1fr);
  }

  .route-summary span {
    display: none;
  }

  .route-summary strong {
    font-size: 0.76rem;
  }

  .mini-fields {
    gap: 7px;
  }

  .pin-field,
  .staff-name-field,
  .staff-status-field {
    width: 100%;
  }

  .login-card .compact-action-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .login-card .compact-action-row button:first-child {
    grid-column: auto;
  }

  .outbound-card #outboundCallStatus {
    display: none;
  }

  .test-call-card {
    flex-basis: min(72vw, 290px);
  }

  input,
  select,
  textarea {
    min-height: 36px;
    padding: 7px 8px;
  }

  button {
    min-height: 34px;
    font-size: 0.86rem;
  }

  .tabbar {
    position: fixed;
    top: auto;
    left: 6px;
    right: 6px;
    bottom: max(5px, env(safe-area-inset-bottom));
    border-radius: 16px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.94);
  }

  .tab-button {
    min-height: 30px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 0.67rem;
  }
}

@media (max-width: 420px) {
  .brand-header {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .brand-logo {
    width: 34px;
    height: 34px;
  }

  h1 {
    font-size: 1.18rem;
  }

  h2 {
    font-size: 1.12rem;
  }

  .call-detail-header {
    display: grid;
    align-items: start;
  }

  .section-title-row {
    display: flex;
    align-items: center;
  }

  .section-title-row button {
    width: auto;
    min-width: 104px;
  }

  .tab-button {
    font-size: 0.64rem;
    min-height: 30px;
    padding: 0 6px;
  }

  .inbox-shell,
  .call-log-shell {
    min-height: 0;
  }

  .conversation-item,
  .call-log-item {
    flex-basis: 86vw;
    min-height: 78px;
  }

  .reply-form {
    padding: 10px;
  }

  .call-metrics,
  .numbers {
    grid-template-columns: 1fr;
  }
}

@keyframes rainbowShift {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 220% 50%;
  }
}

@keyframes pageGlow {
  from {
    background-position: 0% 50%, 50% 0%, 0% 0%;
  }

  to {
    background-position: 100% 50%, 50% 100%, 0% 0%;
  }
}

@keyframes auroraTurn {
  from {
    transform: rotate(0deg) scale(1);
  }

  to {
    transform: rotate(360deg) scale(1.04);
  }
}

@keyframes cardSheen {
  from {
    transform: translateX(-62%);
  }

  to {
    transform: translateX(62%);
  }
}

@keyframes diagonalSheen {
  0%,
  100% {
    transform: translateX(-28%) translateY(-4%);
  }

  50% {
    transform: translateX(24%) translateY(4%);
  }
}

@keyframes logoLift {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes statusPulseGreen {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(35, 199, 121, 0.15), 0 0 12px rgba(35, 199, 121, 0.48);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(35, 199, 121, 0.04), 0 0 22px rgba(35, 199, 121, 0.72);
  }
}

@keyframes statusPulseBlue {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(22, 184, 255, 0.15), 0 0 12px rgba(22, 184, 255, 0.48);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(22, 184, 255, 0.04), 0 0 22px rgba(22, 184, 255, 0.7);
  }
}

@keyframes statusPulsePink {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(255, 62, 165, 0.15), 0 0 12px rgba(255, 62, 165, 0.5);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(255, 62, 165, 0.04), 0 0 24px rgba(255, 62, 165, 0.76);
  }
}

@keyframes statusPulseViolet {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(118, 87, 255, 0.15), 0 0 12px rgba(118, 87, 255, 0.5);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(118, 87, 255, 0.04), 0 0 22px rgba(118, 87, 255, 0.72);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 680px) {
  main {
    gap: 7px;
    padding: max(5px, env(safe-area-inset-top)) 5px calc(116px + env(safe-area-inset-bottom));
  }

  .hero-panel {
    padding: 8px;
  }

  .hero-panel::before {
    height: 4px;
    margin-bottom: 7px;
  }

  .brand-header {
    margin-bottom: 5px;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  h1 {
    font-size: 1.08rem;
  }

  .compact-numbers {
    display: none;
  }

  .quick-control-grid {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    padding: 0;
    margin: 0;
  }

  .control-card {
    flex: none;
    padding: 8px;
  }

  body[data-access="admin"] .login-card,
  body[data-access="staff"] .login-card,
  body[data-access="backup"] .login-card,
  body[data-access="reviewer"] .login-card {
    display: none;
  }

  .outbound-card,
  .test-call-card {
    display: none;
  }

  .route-card {
    gap: 7px;
  }

  .route-card-header .eyebrow {
    display: none;
  }

  .route-card-header h2 {
    font-size: 0.95rem;
  }

  .route-control-strip {
    display: none;
  }

  .route-mode-cards {
    gap: 5px;
  }

  .route-mode-cards button {
    min-height: 42px;
    border-radius: 11px;
  }

  .sticky-access-bar {
    top: 4px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin: 0 0 7px;
    padding: 6px;
    border-radius: 14px;
  }

  body[data-access="admin"] .sticky-access-bar,
  body[data-access="staff"] .sticky-access-bar,
  body[data-access="backup"] .sticky-access-bar,
  body[data-access="reviewer"] .sticky-access-bar {
    grid-template-columns: 1fr;
  }

  body[data-access="admin"] .sticky-access-bar label,
  body[data-access="admin"] .sticky-access-bar button,
  body[data-access="staff"] .sticky-access-bar label,
  body[data-access="staff"] .sticky-access-bar button,
  body[data-access="backup"] .sticky-access-bar label,
  body[data-access="backup"] .sticky-access-bar button,
  body[data-access="reviewer"] .sticky-access-bar label,
  body[data-access="reviewer"] .sticky-access-bar button {
    display: none;
  }

  .sticky-access-bar p {
    min-width: 0;
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tabbar {
    left: 5px;
    right: 5px;
    bottom: max(5px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    max-height: none;
    overflow: visible;
    padding: 5px;
    border-radius: 18px;
  }

  .tab-button {
    min-width: 0;
    min-height: 31px;
    padding: 0 4px;
    font-size: 0.61rem;
    font-weight: 900;
    white-space: normal;
    line-height: 1.05;
  }

  .tab-button:nth-child(1).active,
  .tab-button:nth-child(1) {
    border-color: rgba(255, 62, 165, 0.3);
  }

  .tab-button:nth-child(2) {
    border-color: rgba(255, 122, 61, 0.34);
  }

  .tab-button:nth-child(3) {
    border-color: rgba(255, 200, 61, 0.42);
  }

  .tab-button:nth-child(4) {
    border-color: rgba(35, 199, 121, 0.34);
  }

  .tab-button:nth-child(5) {
    border-color: rgba(22, 184, 255, 0.34);
  }

  .tab-button:nth-child(6) {
    border-color: rgba(118, 87, 255, 0.34);
  }

  .tab-button:nth-child(7),
  .tab-button:nth-child(8),
  .tab-button:nth-child(9),
  .tab-button:nth-child(10),
  .tab-button:nth-child(11) {
    border-color: rgba(255, 62, 165, 0.22);
  }

  .section-title-row {
    gap: 8px;
  }

  .section-title-row h2 {
    font-size: 1.08rem;
  }

  .section-title-row button {
    min-height: 31px;
    min-width: 76px;
    padding: 0 9px;
    font-size: 0.74rem;
  }

  .inbox-access-note {
    display: none;
  }

  .inbox-shell,
  .call-log-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: calc(100vh - 250px);
  }

  .conversation-list,
  .call-log-list {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 4px;
    max-height: none;
    min-height: 86px;
  }

  .conversation-swipe {
    flex: 0 0 min(92vw, 386px);
    grid-template-columns: minmax(0, 1fr) 74px;
  }

  .conversation-item,
  .call-log-item {
    min-height: 72px;
  }

  .call-log-item {
    flex: 0 0 min(76vw, 310px);
  }

  .conversation-archive-button {
    width: 74px;
    min-height: 72px;
    padding: 0 7px;
    font-size: 0.72rem;
  }

  .conversation-panel,
  .call-detail {
    min-height: 360px;
    max-height: none;
  }

  .message-list {
    max-height: min(46vh, 430px);
  }

  .reply-form {
    position: sticky;
    bottom: calc(108px + env(safe-area-inset-bottom));
    z-index: 3;
  }

  .call-detail-header h3,
  .conversation-header strong {
    font-size: 1rem;
  }

  #callLogStatus,
  #inboxStatus,
  #insightsStatus,
  #qaStatus {
    font-size: 0.75rem;
  }
}

@media (max-width: 420px) {
  .tabbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tab-button {
    min-height: 30px;
    font-size: 0.57rem;
    padding: 0 3px;
  }

  .route-mode-cards button strong {
    font-size: 0.7rem;
  }
}

/* Final admin shell pass: keep daily-use tools obvious and tuck setup pages behind More. */
.simplified-tabbar {
  align-items: center;
}

.simplified-tabbar .advanced-tab {
  display: none;
}

.simplified-tabbar.show-advanced .advanced-tab {
  display: inline-flex;
}

.more-tab-button {
  border-color: rgba(255, 62, 165, 0.32);
  background:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.78)) padding-box,
    var(--rainbow) border-box;
}

.more-tab-button[aria-expanded="true"] {
  color: #fff;
  background: linear-gradient(135deg, #16b8ff, #7657ff, #ff3ea5);
  box-shadow: 0 12px 28px rgba(118, 87, 255, 0.24);
}

.usage-hero,
.usage-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: stretch;
  margin: 16px 0;
}

.usage-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.usage-actions > div {
  min-width: 0;
  align-self: stretch;
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.usage-actions > div:first-child {
  grid-column: 1 / -1;
}

.usage-hero,
.usage-actions,
.usage-card {
  border: 1px solid rgba(255, 62, 165, 0.34);
  background:
    linear-gradient(135deg, rgba(14, 20, 42, 0.9), rgba(55, 36, 92, 0.88)) padding-box,
    linear-gradient(135deg, #ff3ea5, #ff7a3d, #23c779, #16b8ff, #7657ff) border-box;
  color: #fff;
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(4, 8, 22, 0.28);
}

.usage-hero,
.usage-actions {
  padding: 18px;
}

.usage-hero > *,
.usage-actions > *,
.usage-card,
.usage-route-pill {
  min-width: 0;
}

.usage-hero p,
.usage-actions p,
.usage-card p {
  color: rgba(255, 255, 255, 0.82);
  overflow-wrap: anywhere;
}

.usage-note {
  margin: 8px 0 0;
  max-width: 72ch;
}

.usage-route-pill {
  min-width: 180px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.usage-route-pill span,
.usage-card-top {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.usage-route-pill strong {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.usage-card {
  padding: 18px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.usage-card.good {
  border-color: rgba(35, 199, 121, 0.56);
}

.usage-card.warning {
  border-color: rgba(255, 200, 61, 0.72);
}

.usage-card.critical {
  border-color: rgba(255, 62, 117, 0.88);
}

.usage-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.usage-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #16b8ff;
  box-shadow: 0 0 18px rgba(22, 184, 255, 0.8);
}

.usage-card.good .usage-dot {
  background: #23c779;
  box-shadow: 0 0 18px rgba(35, 199, 121, 0.9);
}

.usage-card.warning .usage-dot {
  background: #ffc83d;
  box-shadow: 0 0 18px rgba(255, 200, 61, 0.9);
}

.usage-card.critical .usage-dot {
  background: #ff3e75;
  box-shadow: 0 0 18px rgba(255, 62, 117, 0.9);
}

.usage-card h3,
.usage-actions h3 {
  margin: 0 0 10px;
  color: #fff;
  overflow-wrap: anywhere;
}

.usage-card strong {
  display: block;
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.usage-card-links,
.usage-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
}

.usage-card-links a,
.usage-link-grid a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.93);
  color: #16182d;
  font-weight: 900;
  text-decoration: none;
  max-width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
}

.usage-action-list {
  margin: 0;
  padding-left: 22px;
}

.usage-action-list li {
  margin: 8px 0;
  color: rgba(255, 255, 255, 0.88);
}

.usage-balance-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.usage-balance-editor label {
  display: grid;
  gap: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.15;
  min-width: 0;
  overflow-wrap: anywhere;
}

.usage-balance-editor input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.92);
  color: #16182d;
  font-size: 1rem;
  font-weight: 900;
  padding: 0 12px;
}

@media (min-width: 721px) {
  .simplified-tabbar {
    flex-wrap: wrap;
    overflow: visible;
  }

  .simplified-tabbar .tab-button {
    min-width: 104px;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .hero-panel {
    padding: 10px;
    border-radius: 16px;
  }

  .hero-panel::before {
    margin: -10px -10px 8px;
  }

  .brand-row {
    gap: 8px;
  }

  .brand-row img,
  .brand-row .logo-mark {
    width: 42px;
    height: 42px;
  }

  .brand-copy h1 {
    font-size: clamp(1.25rem, 7vw, 1.85rem);
    line-height: 1;
  }

  .quick-control-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .quick-control-grid .control-card {
    min-height: 0;
    padding: 10px;
    border-radius: 14px;
  }

  .quick-control-grid .control-card h2 {
    font-size: 0.96rem;
  }

  .quick-control-grid .control-card p {
    font-size: 0.76rem;
  }

  .usage-hero,
  .usage-actions,
  .usage-grid {
    grid-template-columns: 1fr;
  }

  .usage-hero,
  .usage-actions,
  .usage-card {
    border-radius: 16px;
  }

  .usage-card {
    min-height: 0;
  }

  .usage-balance-editor {
    grid-template-columns: 1fr;
  }

  .simplified-tabbar {
    left: 6px;
    right: 6px;
    bottom: max(6px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 36px;
    max-height: 44px;
    gap: 5px;
    padding: 5px;
    overflow: hidden;
    border-radius: 18px;
  }

  .simplified-tabbar.show-advanced {
    max-height: min(188px, 42vh);
    overflow-y: auto;
    align-content: start;
  }

  .simplified-tabbar .tab-button {
    width: 100%;
    min-height: 36px;
    height: 36px;
    padding: 0 4px;
    font-size: 0.64rem;
    line-height: 1;
    white-space: normal;
    justify-content: center;
  }

  .simplified-tabbar .advanced-tab {
    display: none;
  }

  .simplified-tabbar.show-advanced .advanced-tab {
    display: inline-flex;
  }

  .sticky-access-bar {
    top: 4px;
    margin-bottom: 8px;
    min-height: 42px;
  }

  .sticky-access-bar p {
    font-size: 0.72rem;
  }
}

@media (max-width: 420px) {
  .simplified-tabbar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 34px;
    max-height: 42px;
  }

  .simplified-tabbar.show-advanced {
    max-height: min(184px, 42vh);
  }

  .simplified-tabbar .tab-button {
    min-height: 34px;
    height: 34px;
    font-size: 0.58rem;
  }
}

/* Dark rainbow background pass: less all-white, still readable for dispatch work. */
:root {
  color-scheme: light;
}

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 62, 165, 0.42), transparent 28%),
    radial-gradient(circle at 88% 4%, rgba(22, 184, 255, 0.35), transparent 30%),
    radial-gradient(circle at 72% 90%, rgba(35, 199, 121, 0.24), transparent 32%),
    linear-gradient(145deg, #171729 0%, #281c43 38%, #10263f 72%, #111723 100%);
  background-attachment: fixed;
}

body::before,
body::after {
  display: block;
}

body::before {
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 18px),
    linear-gradient(90deg, rgba(255, 62, 165, 0.18), rgba(255, 200, 61, 0.1), rgba(35, 199, 121, 0.1), rgba(22, 184, 255, 0.14), rgba(118, 87, 255, 0.16));
  filter: none;
  opacity: 0.72;
  animation: auroraTurn 34s linear infinite;
}

body::after {
  inset: 0;
  background: linear-gradient(118deg, transparent 28%, rgba(255, 255, 255, 0.16) 44%, transparent 62%);
  opacity: 0.28;
  mix-blend-mode: screen;
  animation: diagonalSheen 18s ease-in-out infinite;
}

main {
  isolation: isolate;
}

.panel,
.hero-panel,
.tabbar,
.sticky-access-bar {
  border-color: rgba(255, 255, 255, 0.62);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.84)) padding-box,
    var(--rainbow) border-box;
  box-shadow: 0 18px 48px rgba(7, 10, 28, 0.28), 0 0 34px rgba(255, 62, 165, 0.14);
}

.tabbar,
.sticky-access-bar {
  backdrop-filter: blur(18px) saturate(1.12);
}

.hero-panel {
  box-shadow: 0 24px 70px rgba(7, 10, 28, 0.34), 0 0 54px rgba(22, 184, 255, 0.16);
}

@media (max-width: 720px) {
  .panel,
  .hero-panel {
    box-shadow: 0 14px 34px rgba(7, 10, 28, 0.32);
  }
}

/* Darken card interiors too, while preserving readable forms and messages. */
.panel,
.hero-panel,
.tabbar,
.sticky-access-bar {
  color: #f8f9ff;
  background:
    linear-gradient(145deg, rgba(20, 22, 42, 0.88), rgba(31, 29, 58, 0.78)) padding-box,
    var(--rainbow) border-box;
  border-color: transparent;
}

.panel h1,
.panel h2,
.panel h3,
.panel h4,
.panel strong,
.hero-panel h1,
.hero-panel h2,
.hero-panel h3,
.hero-panel strong,
.sticky-access-bar p {
  color: #ffffff;
}

.panel p,
.panel span,
.panel small,
.panel li,
.hero-panel p,
.hero-panel span,
.hero-panel small {
  color: rgba(248, 249, 255, 0.78);
}

.eyebrow,
.section-title-row .eyebrow,
.hero-panel .eyebrow {
  color: #ff9fde;
}

.control-card,
.metric,
.settings-grid,
.conversation-panel,
.conversation-item,
.call-log-shell,
.call-log-item,
.call-detail,
.conversation-details,
.call-correction-panel,
.noise-panel,
.web-push-panel,
.route-summary,
.switch-row,
.staff-card,
.team-card,
.insight-card,
.qa-card,
.activity-card {
  color: #f8f9ff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.065)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.36), rgba(35, 199, 121, 0.22), rgba(22, 184, 255, 0.28), rgba(118, 87, 255, 0.3)) border-box;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 32px rgba(5, 8, 24, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.conversation-item.selected,
.call-log-item.selected,
.tab-button.active {
  background: linear-gradient(135deg, #ff3ea5, #ff7a3d, #16b8ff);
  color: #fff;
}

.conversation-item strong,
.call-log-item strong,
.control-card h2,
.metric strong,
.route-summary strong,
.conversation-header strong,
.call-detail-header h3 {
  color: #ffffff;
}

.conversation-item span,
.conversation-item small,
.call-log-item span,
.call-log-item small,
.control-card p:not(.eyebrow),
.metric span,
.route-summary span,
.conversation-header span,
.conversation-details span {
  color: rgba(248, 249, 255, 0.72);
}

input,
select,
textarea,
.message-bubble,
.reply-form {
  color: #161827;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.62);
}

input::placeholder,
textarea::placeholder {
  color: rgba(52, 54, 77, 0.58);
}

.message-bubble p,
.message-bubble small {
  color: #252845;
}

.message-bubble.outbound {
  background: linear-gradient(135deg, #eaf8ff, #fff0fa);
}

.tab-button {
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.more-tab-button {
  background:
    linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08)) padding-box,
    var(--rainbow) border-box;
}

@media (max-width: 720px) {
  .panel,
  .hero-panel,
  .tabbar,
  .sticky-access-bar {
    background:
      linear-gradient(145deg, rgba(18, 20, 38, 0.93), rgba(34, 28, 60, 0.86)) padding-box,
      var(--rainbow) border-box;
  }
}

/* Readability pass for dark cards: info inside cards must stay visible. */
.inbox-shell,
.call-log-shell {
  background:
    linear-gradient(145deg, rgba(12, 15, 31, 0.72), rgba(38, 27, 61, 0.54)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.42), rgba(22, 184, 255, 0.36), rgba(35, 199, 121, 0.24)) border-box;
  border-color: transparent;
}

.conversation-list,
.call-log-list,
.message-list,
.call-detail {
  background: rgba(7, 10, 25, 0.26);
}

.conversation-header,
.reply-form {
  background: rgba(255, 255, 255, 0.9);
}

.conversation-header strong,
.conversation-header span,
.reply-form label,
.reply-form p {
  color: #17182a;
}

.conversation-details {
  background: rgba(255, 255, 255, 0.2);
}

.conversation-details div,
.metric,
.activity-list li,
.insight-list li,
.qa-list li,
.related-record,
.call-section {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.74);
  color: #17182a;
}

.conversation-details div span,
.metric span,
.activity-list li span,
.insight-list li span,
.qa-list li span,
.related-record span,
.call-section span {
  color: #626779;
}

.conversation-details div strong,
.metric strong,
.activity-list li strong,
.insight-list li strong,
.qa-list li strong,
.related-record strong,
.call-section strong {
  color: #17182a;
}

.conversation-item,
.call-log-item {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.93), rgba(229, 246, 255, 0.87)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.38), rgba(22, 184, 255, 0.34)) border-box;
  color: #17182a;
}

.conversation-item.selected,
.call-log-item.selected {
  background:
    linear-gradient(135deg, rgba(255, 62, 165, 0.96), rgba(255, 122, 61, 0.86), rgba(22, 184, 255, 0.82)) padding-box,
    linear-gradient(135deg, #ffffff, rgba(255, 255, 255, 0.44)) border-box;
  border-color: transparent;
}

.conversation-item strong,
.call-log-item strong {
  color: #17182a;
}

.conversation-item span,
.conversation-item small,
.call-log-item span,
.call-log-item small {
  color: #4b5166;
}

.conversation-item.selected strong,
.conversation-item.selected span,
.conversation-item.selected small,
.call-log-item.selected strong,
.call-log-item.selected span,
.call-log-item.selected small {
  color: #ffffff;
  text-shadow: 0 1px 10px rgba(23, 24, 42, 0.25);
}

.message-bubble {
  background: rgba(255, 255, 255, 0.94);
  color: #17182a;
}

.message-bubble.outbound {
  background: linear-gradient(135deg, #f4edff, #fff1f9);
  color: #17182a;
}

.message-bubble.outbound p,
.message-bubble.outbound small {
  color: #17182a;
}

.mini-confidence,
.confidence-pill {
  text-shadow: none;
}

/* Apply the readable card treatment across every admin tab. */
.overview-grid > div,
.account-links-card,
.test-box,
.lead-capture,
.admin-subgrid label,
.settings-grid label,
.flow-grid label,
.routing-card,
.notification-box,
.team-current-card,
.team-code-editor,
.team-strip,
.presence-pill,
.staff-code-row,
.noise-panel,
.web-push-panel,
.alert-audit-row,
.insight-highlight,
.insight-card,
.insight-suggestions,
.insight-learning-box,
.insight-metric,
.insight-top-list,
.insight-change-box,
.insight-call,
.qa-card,
.qa-row,
.activity-overview div,
.activity-item,
.status-timeline li,
.activity > div,
.account-link-grid a,
#setupList li,
#bookingsList li {
  color: #f8f9ff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.07)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.34), rgba(255, 200, 61, 0.18), rgba(35, 199, 121, 0.18), rgba(22, 184, 255, 0.28), rgba(118, 87, 255, 0.26)) border-box;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 28px rgba(5, 8, 24, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.overview-grid > div h3,
.account-links-card h3,
.test-box label,
.admin-subgrid label,
.settings-grid label,
.flow-grid label,
.routing-card h3,
.notification-box h3,
.team-current-card h3,
.team-code-editor h3,
.team-strip h3,
.presence-pill strong,
.insight-highlight strong,
.insight-card h3,
.insight-suggestions h3,
.insight-learning-box h3,
.insight-metric strong,
.insight-top-list strong,
.insight-change-box strong,
.insight-call strong,
.qa-card h3,
.qa-row strong,
.activity-overview strong,
.activity-copy strong,
.status-timeline strong,
.account-link-grid a strong,
#setupList li strong,
#bookingsList li strong {
  color: #ffffff;
}

.overview-grid > div p,
.account-links-card p,
.test-box p,
.admin-subgrid label span,
.settings-grid label span,
.flow-grid label span,
.routing-card p,
.notification-box p,
.team-current-card p,
.team-current-details span,
.team-code-editor p,
.team-strip small,
.presence-pill small,
.editor-note,
.insight-highlight span,
.insight-highlight small,
.insight-card span,
.insight-card small,
.insight-metric span,
.insight-metric small,
.insight-top-list p,
.insight-top-list span,
.insight-change-box p,
.insight-call span,
.insight-call small,
.qa-row p,
.qa-row span,
.activity-overview span,
.activity-copy time,
.activity-copy span,
.activity-copy p,
.status-timeline span,
.empty-state,
.account-link-grid a span,
#setupList li,
#bookingsList li {
  color: rgba(248, 249, 255, 0.76);
}

.account-link-grid a:hover,
.activity-filter.active,
.route-mode-cards button.active,
.scenario-row button:hover,
.quick-replies button:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #ff3ea5, #ff7a3d, #16b8ff);
}

.account-link-grid a:hover span,
.account-link-grid a:hover strong,
.activity-filter.active,
.route-mode-cards button.active strong,
.route-mode-cards button.active span {
  color: #ffffff;
}

.route-mode-cards button,
.scenario-row button,
.quick-replies button,
.activity-filter {
  color: #f8f9ff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.route-mode-cards button strong,
.route-mode-cards button span,
.scenario-row button,
.quick-replies button,
.activity-filter {
  color: rgba(248, 249, 255, 0.86);
}

.web-push-diagnostic,
.learning-preview,
#webhookUrl,
#inboxStatus,
#callLogStatus,
#insightsStatus,
#qaStatus,
#activityStatus {
  color: rgba(248, 249, 255, 0.74);
}

.status-pill,
.mini-confidence,
.confidence-pill,
.qa-row.ok span,
.qa-row.warn span {
  background: rgba(255, 255, 255, 0.9);
  color: #17182a;
}

.admin-subgrid input,
.admin-subgrid select,
.admin-subgrid textarea,
.settings-grid input,
.settings-grid select,
.settings-grid textarea,
.flow-grid textarea,
.test-box textarea,
.staff-code-row input {
  color: #17182a;
  background: rgba(255, 255, 255, 0.95);
}

body:not(.edit-mode) .settings-grid label {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.055)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.28), rgba(22, 184, 255, 0.24)) border-box;
}

/* Contrast lock: light info cards get dark ink, glass cards get bright ink. */
.numbers > div,
.call-metric,
.call-facts div,
.related-records,
.transcript-line,
.transcript-group,
.transcript-conversation,
.call-synopsis,
.focus-card,
.insight-highlight,
.suggestion-row,
.learning-preview {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 247, 255, 0.9)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.38), rgba(255, 200, 61, 0.22), rgba(22, 184, 255, 0.34)) border-box;
  border-color: transparent;
  color: #17182a;
}

.numbers > div :where(h3, strong, span, p, small),
.call-metric :where(strong, span),
.call-facts :where(dt, dd, a),
.related-records :where(h4, strong, span, p, small, a),
.transcript-line :where(strong, span, p, small),
.transcript-group :where(strong, span, p, small),
.transcript-conversation :where(strong, span, p, small),
.call-synopsis :where(strong, span, p, small),
.focus-card :where(strong, span, p, small),
.insight-highlight :where(strong, span, p, small),
.suggestion-row :where(strong, p),
.learning-preview :where(p, span, strong, small) {
  color: #17182a;
  text-shadow: none;
}

.numbers > div :where(span, small),
.call-metric span,
.call-facts dt,
.related-records :where(span, small),
.transcript-line small,
.transcript-group small,
.transcript-conversation small,
.focus-card :where(span, small),
.insight-highlight :where(span, small) {
  color: #555c70;
}

.call-metric.ok {
  background:
    linear-gradient(135deg, rgba(232, 255, 243, 0.96), rgba(224, 250, 255, 0.9)) padding-box,
    linear-gradient(135deg, rgba(35, 199, 121, 0.56), rgba(22, 184, 255, 0.32)) border-box;
}

.call-metric.warn {
  background:
    linear-gradient(135deg, rgba(255, 246, 226, 0.96), rgba(255, 232, 243, 0.9)) padding-box,
    linear-gradient(135deg, rgba(255, 122, 61, 0.56), rgba(255, 62, 165, 0.32)) border-box;
}

.call-metric.bad {
  background:
    linear-gradient(135deg, rgba(255, 235, 245, 0.96), rgba(238, 235, 255, 0.9)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.56), rgba(118, 87, 255, 0.32)) border-box;
}

.team-current-card p:not(.eyebrow),
.team-code-editor p,
.team-strip small,
.editor-note,
.web-push-diagnostic,
.learning-preview:empty,
.control-card p:not(.eyebrow),
.route-summary span,
.activity-copy p,
.activity-copy span,
.activity-copy time {
  color: rgba(248, 249, 255, 0.82);
}

.control-card :where(h2, h3, strong),
.routing-card :where(h3, strong),
.team-current-card :where(h3, strong),
.team-code-editor :where(h3, strong),
.team-strip :where(h3, strong),
.activity-item :where(strong),
.activity-overview :where(strong),
.insight-learning-box :where(h3, strong),
.insight-suggestions :where(h3, strong),
.qa-card :where(h3, strong) {
  color: #ffffff;
}

.record-links a {
  color: #17182a;
  background: rgba(255, 255, 255, 0.82);
}

/* Final admin polish: compact chrome, readable inner cards, no washed-out text. */
:root {
  --ddd-ink: #17182a;
  --ddd-muted: #555c70;
  --ddd-paper: rgba(247, 252, 255, 0.96);
  --ddd-paper-soft: rgba(238, 249, 255, 0.92);
  --ddd-glow-border: rgba(255, 62, 165, 0.34);
}

.app-shell,
.admin-shell,
.admin-page {
  background:
    radial-gradient(circle at 12% 7%, rgba(255, 62, 165, 0.2), transparent 28%),
    radial-gradient(circle at 86% 14%, rgba(22, 184, 255, 0.2), transparent 26%),
    linear-gradient(135deg, #170b2f 0%, #0d2235 45%, #351237 100%);
}

.simplified-tabbar {
  gap: 7px;
  padding: 8px 10px;
  border-radius: 18px;
}

.simplified-tabbar .tab-button {
  min-width: 0;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 12px;
}

.sticky-access-bar {
  min-height: 44px;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 18px;
  align-items: center;
}

.sticky-access-bar input {
  min-height: 36px;
  padding: 0 12px;
}

.sticky-access-bar button {
  min-height: 36px;
  padding: 0 16px;
}

body[data-access="admin"] .sticky-access-bar,
body[data-access="staff"] .sticky-access-bar,
body[data-access="backup"] .sticky-access-bar,
body[data-access="reviewer"] .sticky-access-bar {
  grid-template-columns: minmax(0, 1fr) auto;
}

body[data-access="admin"] .sticky-access-bar label,
body[data-access="admin"] .sticky-access-bar input,
body[data-access="staff"] .sticky-access-bar label,
body[data-access="staff"] .sticky-access-bar input,
body[data-access="backup"] .sticky-access-bar label,
body[data-access="backup"] .sticky-access-bar input,
body[data-access="reviewer"] .sticky-access-bar label,
body[data-access="reviewer"] .sticky-access-bar input {
  display: none;
}

.conversation-panel,
.call-detail,
.report-card,
.insight-learning-box,
.insight-suggestions,
.team-current-card,
.team-code-editor,
.activity-card,
.qa-card,
.control-card,
.routing-card,
.notification-box {
  background:
    linear-gradient(145deg, rgba(18, 35, 55, 0.92), rgba(60, 28, 82, 0.88)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.55), rgba(255, 200, 61, 0.24), rgba(22, 184, 255, 0.46)) border-box;
  border-color: transparent;
}

.conversation-header,
.call-section,
.call-facts div,
.call-metric,
.related-records,
.call-synopsis,
.transcript-box,
.transcript-line,
.transcript-group,
.transcript-conversation,
.focus-card,
.insight-highlight,
.suggestion-row,
.learning-preview,
.reply-form {
  background:
    linear-gradient(135deg, var(--ddd-paper), var(--ddd-paper-soft)) padding-box,
    linear-gradient(135deg, rgba(255, 62, 165, 0.36), rgba(255, 200, 61, 0.18), rgba(22, 184, 255, 0.34)) border-box !important;
  border: 1px solid transparent;
  color: var(--ddd-ink) !important;
  text-shadow: none !important;
}

.conversation-header :where(h3, p, span, strong, small),
.call-section :where(h4, h3, p, span, strong, small, a, dt, dd, summary),
.call-facts div :where(dt, dd, a),
.call-metric :where(strong, span),
.related-records :where(h4, p, span, strong, small, a),
.call-synopsis :where(h4, p, span, strong, small),
.transcript-box :where(h4, p, span, strong, small),
.transcript-line :where(p, span, strong, small),
.transcript-group :where(summary, p, span, strong, small),
.transcript-conversation :where(p, span, strong, small),
.focus-card :where(p, span, strong, small),
.insight-highlight :where(p, span, strong, small),
.suggestion-row :where(p, strong),
.learning-preview :where(p, span, strong, small),
.reply-form :where(label, p, span, strong, small) {
  color: var(--ddd-ink) !important;
  text-shadow: none !important;
}

.conversation-header :where(p, span, small),
.call-section :where(small, span, dt),
.call-facts div dt,
.call-metric span,
.related-records :where(span, small),
.call-synopsis :where(span, small),
.transcript-box :where(span, small),
.transcript-line small,
.transcript-group small,
.transcript-conversation small,
.focus-card :where(span, small),
.insight-highlight :where(span, small),
.learning-preview :where(span, small) {
  color: var(--ddd-muted) !important;
}

.transcript-row,
.transcript-row.caller,
.transcript-row.ai,
.transcript-row.assistant {
  color: var(--ddd-ink) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  border-color: rgba(118, 87, 255, 0.14);
}

.transcript-row :where(p, strong) {
  color: var(--ddd-ink) !important;
}

.transcript-meta,
.transcript-meta :where(strong, span) {
  color: var(--ddd-muted) !important;
}

.suggestion-row > span,
.status-pill,
.mini-confidence,
.confidence-pill {
  color: #ffffff !important;
  text-shadow: none;
}

.quick-replies button {
  color: var(--ddd-ink) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(255, 62, 165, 0.24) !important;
  opacity: 1;
  text-shadow: none;
}

.quick-replies button:hover,
.quick-replies button:focus-visible {
  color: #ffffff !important;
  background: linear-gradient(135deg, #ff3ea5, #ff7a3d, #16b8ff) !important;
}

.quick-replies button:disabled,
.reply-form textarea:disabled,
.reply-form button:disabled {
  opacity: 0.5;
}

.message-list {
  background: linear-gradient(180deg, rgba(10, 22, 38, 0.78), rgba(25, 18, 52, 0.72));
}

.conversation-empty,
.empty-state {
  color: rgba(248, 249, 255, 0.78) !important;
}

@media (min-width: 721px) {
  .simplified-tabbar.show-advanced {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }

  .simplified-tabbar.show-advanced .tab-button {
    width: auto;
  }
}

@media (max-width: 720px) {
  .simplified-tabbar {
    gap: 6px;
    padding: 7px;
  }

  .simplified-tabbar .tab-button {
    min-height: 38px;
    padding: 0 10px;
  }

  .sticky-access-bar {
    margin: 6px 0 8px;
    padding: 7px 9px;
  }

  .call-section,
  .call-synopsis,
  .transcript-box,
  .reply-form {
    padding: 12px;
  }
}

/* Operations-console pass: keep the live tools usable first. */
main {
  max-width: 1180px;
  padding-bottom: 36px;
}

.hero-panel {
  padding: 22px;
}

.brand-header {
  align-items: center;
}

.brand-logo {
  box-shadow: 0 14px 34px rgba(255, 62, 165, 0.28), 0 0 0 3px rgba(255, 255, 255, 0.72);
}

body[data-access="admin"] .login-card > div p,
body[data-access="staff"] .login-card > div p,
body[data-access="backup"] .login-card > div p,
body[data-access="reviewer"] .login-card > div p {
  display: none;
}

body[data-access="admin"] .login-card,
body[data-access="staff"] .login-card,
body[data-access="backup"] .login-card,
body[data-access="reviewer"] .login-card {
  min-height: 0;
}

body[data-access="admin"] .login-card .pin-field,
body[data-access="staff"] .login-card .pin-field,
body[data-access="backup"] .login-card .pin-field,
body[data-access="reviewer"] .login-card .pin-field {
  display: none;
}

.simplified-tabbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  background:
    linear-gradient(135deg, rgba(13, 18, 36, 0.94), rgba(50, 26, 68, 0.9)) padding-box,
    var(--rainbow) border-box;
}

.simplified-tabbar .tab-button:nth-child(1).active { background: linear-gradient(135deg, #ff3ea5, #ff7a3d); }
.simplified-tabbar .tab-button:nth-child(2).active { background: linear-gradient(135deg, #ff7a3d, #ffc83d); }
.simplified-tabbar .tab-button:nth-child(3).active { background: linear-gradient(135deg, #ffc83d, #23c779); }
.simplified-tabbar .tab-button:nth-child(4).active { background: linear-gradient(135deg, #23c779, #16b8ff); }
.simplified-tabbar .tab-button:nth-child(5).active { background: linear-gradient(135deg, #16b8ff, #7657ff, #ff3ea5); }

.sticky-access-bar {
  position: sticky;
  top: 54px;
  z-index: 25;
  background:
    linear-gradient(135deg, rgba(18, 27, 48, 0.92), rgba(62, 28, 82, 0.88)) padding-box,
    linear-gradient(90deg, #ff3ea5, #ff7a3d, #ffc83d, #23c779, #16b8ff, #7657ff) border-box;
}

.inbox-shell,
.call-log-shell {
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  min-height: min(760px, calc(100vh - 260px));
  max-height: none;
  overflow: hidden;
}

.conversation-list,
.call-log-list {
  max-height: min(760px, calc(100vh - 290px));
  overflow: auto;
  padding: 14px;
}

.conversation-panel,
.call-detail {
  min-width: 0;
  max-height: min(760px, calc(100vh - 290px));
  overflow: auto;
}

.conversation-panel {
  display: grid;
  grid-template-rows: auto auto minmax(240px, 1fr) auto auto auto;
}

.conversation-header,
.call-detail-header,
.call-outcome-summary,
.call-section,
.reply-form {
  border-radius: 18px;
}

.message-list {
  min-height: 280px;
  max-height: none;
  overflow: auto;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-replies button {
  flex: 1 1 138px;
  min-height: 40px;
}

.conversation-archive-button {
  min-width: 88px;
}

.call-detail .call-section,
.call-detail .call-facts,
.call-detail .call-metrics {
  margin-bottom: 14px;
}

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

.call-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.transcript-box {
  max-height: 420px;
  overflow: auto;
}

.transcript-conversation {
  display: grid;
  gap: 10px;
}

.transcript-row {
  border-radius: 14px;
  padding: 10px 12px;
}

.insight-focus-strip,
.insight-highlights,
.insight-mini-grid,
.qa-grid,
.activity-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.insight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.insight-card {
  overflow: hidden;
}

.insight-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.activity-shell {
  display: grid;
  gap: 14px;
}

.activity-timeline {
  display: grid;
  gap: 10px;
}

.activity-item {
  list-style: none;
  border-radius: 16px;
  padding: 14px;
}

@media (max-width: 720px) {
  main {
    padding: 8px 8px calc(82px + env(safe-area-inset-bottom));
  }

  .hero-panel {
    padding: 12px;
  }

  .brand-header {
    grid-template-columns: 54px 1fr;
    gap: 10px;
  }

  .brand-logo {
    width: 54px;
    height: 54px;
  }

  .hero-copy h1 {
    font-size: 1.55rem;
  }

  .hero-copy .summary,
  .compact-numbers {
    display: none;
  }

  .quick-control-grid {
    grid-template-columns: 1fr;
  }

  .simplified-tabbar {
    position: fixed;
    inset: auto 8px max(8px, env(safe-area-inset-bottom)) 8px;
    top: auto;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 44px;
    max-height: 56px;
    padding: 6px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 -10px 30px rgba(4, 8, 22, 0.36), 0 0 22px rgba(255, 62, 165, 0.18);
  }

  .simplified-tabbar.show-advanced {
    max-height: min(218px, 44vh);
    overflow-y: auto;
  }

  .simplified-tabbar .tab-button {
    min-height: 44px;
    height: 44px;
    padding: 0 5px;
    border-radius: 14px;
    font-size: 0.72rem;
  }

  .sticky-access-bar {
    top: 0;
    z-index: 50;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 42px;
    margin: 6px 0 10px;
  }

  .sticky-access-bar p {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  body[data-access="admin"] .sticky-access-bar,
  body[data-access="staff"] .sticky-access-bar,
  body[data-access="backup"] .sticky-access-bar,
  body[data-access="reviewer"] .sticky-access-bar {
    padding: 8px 10px;
  }

  .inbox-shell,
  .call-log-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .conversation-list,
  .call-log-list {
    display: flex;
    gap: 10px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 2px 12px;
    scroll-snap-type: x proximity;
  }

  .conversation-swipe,
  .call-log-item {
    flex: 0 0 min(82vw, 300px);
    scroll-snap-align: start;
  }

  .conversation-archive-button {
    flex: 0 0 86px;
  }

  .conversation-panel,
  .call-detail {
    max-height: none;
    overflow: visible;
  }

  .conversation-panel {
    grid-template-rows: auto auto minmax(260px, auto) auto auto auto;
  }

  .conversation-details,
  .call-metrics,
  .call-facts,
  .insight-focus-strip,
  .insight-highlights,
  .insight-mini-grid,
  .qa-grid,
  .activity-overview {
    grid-template-columns: 1fr;
  }

  .message-list {
    min-height: 300px;
    max-height: 52vh;
  }

  .reply-form {
    position: sticky;
    bottom: calc(66px + env(safe-area-inset-bottom));
    z-index: 20;
    box-shadow: 0 -12px 30px rgba(8, 12, 30, 0.2);
  }

  .reply-form textarea {
    min-height: 84px;
  }

  .quick-replies button {
    flex-basis: calc(50% - 5px);
    min-height: 38px;
    font-size: 0.72rem;
  }

  .call-detail-header {
    align-items: flex-start;
  }

  .transcript-box {
    max-height: 54vh;
  }

  .activity-filter-row {
    display: flex;
    overflow-x: auto;
    gap: 8px;
  }

  .activity-filter {
    flex: 0 0 auto;
  }
}
