:root {
  --bg: #f2f4f7;
  --panel: #ffffff;
  --text: #2e3b4e;
  --text-soft: #75839a;
  --line: #d4d9e2;
  --accent: #067efe;
  --accent-soft: #d8eaff;
  --success: #20a46a;
  --warning: #d98514;
  --danger: #d64141;
  --radius-pill: 999px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow: 0 14px 38px rgba(44, 71, 112, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  font-family: "Roboto", sans-serif;
  color: var(--text);
  background: var(--bg);
}

body {
  position: relative;
}

.hidden {
  display: none !important;
}

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

body.app-mode .app-bg {
  opacity: 0.35;
}

body.app-mode .bubble {
  display: none;
}

body.app-mode .dot {
  opacity: 0.45;
}

.bubble {
  position: absolute;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 700;
  display: grid;
  place-items: center;
  opacity: 0.92;
  animation: bob 4.5s ease-in-out infinite;
}

.bubble-a {
  left: 5%;
  top: 46%;
  width: 48px;
  height: 48px;
  color: #ffffff;
  background: #e5b856;
}

.bubble-b {
  right: 12%;
  bottom: 30%;
  width: 42px;
  height: 42px;
  color: #ffffff;
  background: #2f7ff6;
  animation-delay: -0.9s;
}

.bubble-c {
  right: 2%;
  top: 58%;
  width: 34px;
  height: 34px;
  color: #ffffff;
  background: #bcccf0;
  animation-delay: -1.2s;
}

.bubble-d {
  right: 8%;
  top: 48%;
  width: 54px;
  height: 54px;
  color: #ffffff;
  background: #e5b856;
  animation-delay: -0.5s;
}

.dot {
  position: absolute;
  border-radius: 999px;
}

.dot-a {
  left: 7%;
  top: 69%;
  width: 8px;
  height: 8px;
  background: var(--accent);
}

.dot-b {
  right: 17%;
  top: 59%;
  width: 6px;
  height: 6px;
  background: #7cb1ff;
}

.dot-c {
  right: 5%;
  bottom: 35%;
  width: 5px;
  height: 5px;
  background: #f4b255;
}

.auth-screen,
.app-shell {
  position: relative;
  z-index: 1;
}

.auth-screen {
  min-height: 100vh;
  padding: 30px 56px 48px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-mark,
.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 35px;
  letter-spacing: 0.1px;
}

.brand-left {
  color: #3d4f67;
  font-weight: 300;
  line-height: 1;
}

.brand-pill {
  background: var(--accent);
  color: #ffffff;
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 0.56em;
  line-height: 1;
  font-weight: 400;
}

.auth-switch-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}

.auth-switch-label {
  color: #2d3f57;
  font-size: 18px;
}

.outline-pill,
.outline-small,
.primary-small,
.primary-pill,
.social-pill,
.logout-btn {
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.outline-pill {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  height: 56px;
  min-width: 140px;
  padding: 0 28px;
  font-size: 32px;
  line-height: 1;
  font-weight: 500;
}

.outline-pill:hover {
  background: var(--accent-soft);
}

.auth-card {
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-title {
  margin: 0;
  text-align: center;
  font-size: 56px;
  font-weight: 700;
  color: #2f3f53;
}

.stepper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin: 12px 0 2px;
  gap: 8px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 112px;
}

.step-index {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 2px solid #c4cad3;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #97a2b1;
}

.step.active .step-index {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.step-name {
  font-size: 28px;
  color: #97a2b1;
}

.step.active .step-name {
  color: #2e3f56;
  font-weight: 500;
}

.step-line {
  width: 70px;
  height: 2px;
  margin-top: 17px;
  background: #c4cad3;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pill-input {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  border: 1px solid #c6ced9;
  border-radius: var(--radius-pill);
  height: 72px;
  background: rgba(255, 255, 255, 0.35);
}

.pill-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.pill-input input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 26px;
  font-size: 34px;
  color: #32445d;
}

.pill-input input::placeholder {
  color: #9aa5b4;
}

.eye-btn {
  background: transparent;
  border: 0;
  width: 52px;
  height: 52px;
  margin-right: 14px;
  color: #9aa5b4;
  font-size: 24px;
  cursor: pointer;
}

.auth-helpers {
  display: flex;
  justify-content: flex-end;
}

.forgot-link {
  font-size: 33px;
  color: var(--accent);
}

.terms-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 35px;
  line-height: 1.2;
  color: #2f3f54;
}

.terms-row input {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.terms-row a {
  color: var(--accent);
}

.primary-pill {
  margin-top: 6px;
  width: 100%;
  height: 76px;
  background: var(--accent);
  color: #ffffff;
  border: 0;
  font-size: 42px;
  font-weight: 700;
}

.primary-pill.disabled,
.primary-pill:disabled {
  background: #c9d0d9;
  color: #f8f9fb;
  cursor: not-allowed;
}

.or-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 8px 0 2px;
}

.or-row span {
  flex: 1;
  height: 1px;
  background: #c3cad4;
}

.or-row strong {
  font-size: 36px;
  color: #667890;
}

.social-pill {
  width: 100%;
  height: 72px;
  background: transparent;
  border-color: #48586c;
  color: #4f5f74;
  font-size: 40px;
  font-weight: 500;
}

.social-pill:hover {
  background: #f3f7ff;
}

.password-hints {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin-top: -4px;
}

.hint-item {
  font-size: 24px;
  color: #8a97a9;
  position: relative;
  padding-left: 18px;
}

.hint-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #c6ceda;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.hint-item.valid {
  color: var(--success);
}

.hint-item.valid::before {
  background: var(--success);
}

.app-shell {
  min-height: 100vh;
  min-width: 0;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  min-width: 0;
  border-right: 1px solid #dde3ec;
  background: #f6f8fb;
  padding: 26px 16px 20px;
  display: flex;
  flex-direction: column;
}

.sidebar .brand-left {
  font-size: 30px;
}

.sidebar .brand-pill {
  font-size: 16px;
}

.sidebar-nav {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: #4b5d76;
  border-radius: 10px;
  font: inherit;
  text-align: left;
  padding: 11px 12px;
  font-size: 15px;
  cursor: pointer;
}

.nav-item:hover {
  background: #eaf1ff;
}

.nav-item.active {
  background: #e0ecff;
  color: #1e58b7;
  font-weight: 500;
}

.logout-btn {
  margin-top: auto;
  width: 100%;
  height: 40px;
  background: #ffffff;
  border-color: #c8d2e0;
  color: #50627b;
  font-size: 14px;
}

.main-shell {
  min-width: 0;
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  background: #ffffff;
  border: 1px solid #dce3ed;
  border-radius: var(--radius-lg);
  padding: 18px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow);
}

.topbar h2 {
  margin: 0;
  font-size: 26px;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 14px;
}

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

.topbar-actions input {
  width: 330px;
  max-width: 44vw;
  border: 1px solid #ccd5e2;
  background: #ffffff;
  border-radius: 999px;
  height: 40px;
  padding: 0 14px;
  font: inherit;
}

.primary-small,
.outline-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.primary-small {
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

.primary-small:hover {
  filter: brightness(0.95);
}

.outline-small {
  border-color: #c8d2e0;
  background: #ffffff;
  color: #4e6179;
}

.outline-small:hover {
  background: #f2f6ff;
}

.outline-small.danger {
  border-color: #e3b7b7;
  color: #b34c4c;
}

.outline-small.danger:hover {
  background: #fff3f3;
}

.module-content {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.module-content > * {
  min-width: 0;
}

.panel {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid #dce3ed;
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
  max-width: 100%;
}

.campaigns-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.campaigns-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.campaigns-sidebar {
  padding: 12px;
  min-width: 0;
}

.campaign-nav-group {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.campaign-nav-group:last-child {
  margin-bottom: 0;
}

.campaign-nav-title {
  margin: 6px 4px 2px;
  font-size: 12px;
  font-weight: 600;
  color: #6c7e95;
}

.campaign-nav-link {
  border: 0;
  border-radius: 12px;
  text-align: left;
  font: inherit;
  background: transparent;
  padding: 9px 10px;
  color: #304862;
  cursor: pointer;
}

.campaign-nav-link:hover {
  background: #eef4ff;
}

.campaign-nav-link.active {
  background: #dce9ff;
  color: #2059ae;
  font-weight: 600;
}

.outline-small.active-toggle {
  background: #dce9ff;
  border-color: #b6ccf4;
  color: #2059ae;
}

.view-switch-row {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grouped-section {
  margin: 14px 0;
}

.contact-group-import-form {
  display: grid;
  gap: 10px;
}

.contact-group-import-form textarea {
  width: 100%;
  border: 1px solid #c8d2e0;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  resize: vertical;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #4f647d;
}

.checkbox-inline input {
  width: 15px;
  height: 15px;
}

.checkbox-inline.compact {
  white-space: nowrap;
}

.csv-import-empty {
  border: 1px dashed #c8d2e0;
  border-radius: 12px;
  padding: 14px;
  margin-top: 4px;
  background: #f8fbff;
}

.csv-import-workspace {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.csv-template-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.csv-template-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 280px;
  font-size: 13px;
  color: #4e6179;
}

.csv-template-toolbar select {
  border: 1px solid #c8d2e0;
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
}

.csv-template-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.csv-import-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
}

.csv-mapping-table select {
  width: 100%;
  border: 1px solid #c8d2e0;
  border-radius: 10px;
  padding: 8px 9px;
  font: inherit;
}

.csv-filter-box {
  border: 1px solid #dde5f0;
  border-radius: 12px;
  padding: 12px;
  background: #fafcff;
}

.csv-filter-box h5,
.csv-import-preview h5 {
  margin: 0 0 8px;
  font-size: 15px;
}

.csv-filter-grid {
  display: grid;
  gap: 8px;
}

.csv-filter-item {
  border: 1px solid #d9e3ef;
  border-radius: 10px;
  padding: 9px;
  display: grid;
  gap: 5px;
  background: #fff;
}

.csv-filter-item input {
  margin: 0;
}

.csv-filter-item.locked {
  background: #f3f7fd;
}

.csv-filter-item small {
  color: #5f738d;
  line-height: 1.35;
}

.csv-filter-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.csv-import-preview .table-wrap {
  max-height: 280px;
}

.csv-warning-list {
  border: 1px solid #ffe2a8;
  background: #fff9ed;
  border-radius: 10px;
  padding: 10px 12px;
  color: #6a5327;
}

.csv-warning-list p {
  margin: 0 0 6px;
}

.csv-warning-list ul {
  margin: 0;
  padding-left: 18px;
}

.csv-warning-list li {
  line-height: 1.4;
}

.csv-import-actions {
  display: flex;
  justify-content: flex-end;
}

.campaign-builder-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.campaign-builder-form {
  display: grid;
  gap: 14px;
  min-width: 0;
}

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

.campaign-builder-grid label,
.campaign-step-row label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #4e6179;
}

.campaign-builder-grid input,
.campaign-builder-grid select,
.campaign-step-row input,
.campaign-step-row select,
.campaign-step-row textarea {
  border: 1px solid #c8d2e0;
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
}

.campaign-step-row {
  border: 1px solid #dce3ed;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #f9fbff;
}

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

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

.metric-card {
  border: 1px solid #dce3ed;
  border-radius: var(--radius-md);
  padding: 12px;
  background: linear-gradient(160deg, #ffffff, #f6f9ff);
}

.metric-card.is-loading {
  opacity: 0.82;
}

.metric-card h4 {
  margin: 0;
  color: #6f8097;
  font-size: 12px;
  font-weight: 500;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.metric-card p {
  margin: 8px 0 0;
  font-size: 12px;
  color: #6f8097;
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
  min-width: 0;
}

.data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #e7ebf2;
}

.data-table th {
  color: #6f7f95;
  font-weight: 500;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  padding: 3px 9px;
  font-weight: 500;
}

.badge.active {
  background: #d6f4e8;
  color: #0c8253;
}

.badge.paused {
  background: #fff1d8;
  color: #ba7615;
}

.badge.draft,
.badge.pending {
  background: #ebeff6;
  color: #61738a;
}

.badge.neutral {
  background: #ebeff6;
  color: #61738a;
}

.badge.error {
  background: #ffe0e0;
  color: #c03838;
}

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

.module-head h3 {
  margin: 0;
}

.module-head .inline-tools {
  flex: 1 1 360px;
  justify-content: flex-end;
}

.module-head.compact {
  margin-bottom: 8px;
}

.module-head.compact h4 {
  margin: 0;
  font-size: 15px;
}

.meta {
  color: #6a7d95;
  font-size: 12px;
}

.inline-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-tools > * {
  max-width: 100%;
}

.contacts-toolbar > input[type="search"] {
  flex: 1 1 220px;
}

.contacts-toolbar .contact-fub-filter-row {
  flex: 1 1 100%;
}

.contacts-add-form {
  display: grid;
  grid-template-columns:
    minmax(140px, 1fr)
    minmax(170px, 1fr)
    minmax(180px, 1fr)
    minmax(300px, 1.8fr)
    auto;
  gap: 8px;
  align-items: center;
}

.contacts-add-form > * {
  min-width: 0;
}

.contacts-add-form button {
  white-space: nowrap;
}

.inline-tools input,
.inline-tools select,
.panel input,
.panel select,
.panel textarea {
  border: 1px solid #cfd8e6;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  background: #ffffff;
}

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

.timeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #dce4ef;
  background: #fbfcfe;
}

.timeline-item .time {
  font-weight: 700;
  color: #355f99;
  min-width: 58px;
}

.messenger-panel {
  padding: 14px;
  overflow: hidden;
}

.messenger-hydration-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: #f3f8ff;
  color: #355f99;
  font-size: 13px;
  font-weight: 600;
}

.reporting-hydration-banner {
  margin-top: 2px;
}

.dashboard-hydration-banner,
.campaigns-hydration-banner {
  margin: 0 0 12px;
}

.messenger-hydration-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #1d70f2;
  animation: messenger-hydration-pulse 1.2s ease-in-out infinite;
}

@keyframes messenger-hydration-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.messenger-sync-note {
  margin: 0 0 4px;
  color: #5b6f8d;
  font-size: 12px;
  font-weight: 600;
}

.messenger-loaded-note {
  margin: 0 0 10px;
  color: #6f8097;
  font-size: 12px;
  font-weight: 500;
}

.messenger-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  min-height: 620px;
  height: calc(100vh - 220px);
  max-height: calc(100vh - 220px);
  overflow: hidden;
}

.messenger-sidebar {
  border: 1px solid #dce4ef;
  border-radius: 14px;
  background: #fbfcff;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.messenger-sidebar-section {
  display: grid;
  gap: 8px;
}

.messenger-section-title {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6f8097;
  font-weight: 700;
}

.messenger-nav-item {
  border: 0;
  background: transparent;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  padding: 10px 12px;
  color: #31486a;
  font-weight: 600;
}

.messenger-nav-item:hover {
  background: #eef4ff;
}

.messenger-nav-item.active {
  background: #dce9ff;
  color: #1558c0;
}

.messenger-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.thread-list {
  border: 1px solid #dce4ef;
  border-radius: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fbfcff;
  height: 100%;
  min-height: 0;
}

.thread-list-load-more {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #e4ebf5;
  background: linear-gradient(180deg, rgba(251, 252, 255, 0.85), #fbfcff 45%);
}

.thread-list-render-more {
  position: static;
  border-top: 1px solid #ebeff6;
  background: #fbfcff;
}

.thread-item {
  border: 0;
  width: 100%;
  text-align: left;
  font: inherit;
  background: transparent;
  padding: 12px;
  border-bottom: 1px solid #ebeff6;
  cursor: pointer;
}

.thread-item:hover,
.thread-item.active {
  background: #e7f0ff;
}

.thread-item strong {
  display: block;
  margin-bottom: 4px;
}

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

.thread-item-top small {
  color: #6f8097;
  font-size: 11px;
  white-space: nowrap;
}

.thread-item-preview {
  font-size: 12px;
  color: #556d8f;
  line-height: 1.35;
  margin-top: 3px;
}

.thread-item-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.thread-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  white-space: nowrap;
}

.thread-pill.missed {
  background: #fff3de;
  color: #9d5b00;
}

.thread-pill.unread {
  background: #e6f1ff;
  color: #0f60cf;
}

.thread-view {
  border: 1px solid #dce4ef;
  border-radius: 14px;
  background: #ffffff;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.thread-head {
  padding: 14px;
  border-bottom: 1px solid #e7ebf2;
}

.thread-head h4 {
  margin: 0;
}

.thread-head-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.thread-content {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.thread-content.has-contact-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.thread-contact-panel {
  border-bottom: 1px solid #e7ebf2;
  background: #f8fbff;
  padding: 12px 14px;
  overflow-y: auto;
  min-height: 0;
  max-height: min(26vh, 220px);
}

@media (min-width: 1220px) {
  .thread-content.has-contact-panel {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 36%);
    grid-template-rows: minmax(0, 1fr);
  }

  .thread-content.has-contact-panel .thread-messages {
    grid-column: 1;
    grid-row: 1;
  }

  .thread-content.has-contact-panel .thread-contact-panel {
    grid-column: 2;
    grid-row: 1;
    border-bottom: none;
    border-left: 1px solid #e7ebf2;
    max-height: none;
  }
}

.thread-contact-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.thread-contact-panel-head strong {
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #4a6282;
}

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

.thread-contact-field {
  display: grid;
  gap: 3px;
}

.thread-contact-field span {
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #68809f;
  font-weight: 600;
}

.thread-contact-field strong {
  font-size: 14px;
  color: #22374f;
  font-weight: 600;
  line-height: 1.35;
}

.thread-contact-field small {
  font-size: 12px;
  color: #7388a4;
}

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

.thread-contact-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.thread-contact-inline strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.thread-property-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.thread-contact-link {
  font-size: 12px;
  color: #0f60cf;
  text-decoration: none;
  width: fit-content;
}

.thread-contact-link:hover {
  text-decoration: underline;
}

.thread-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.thread-contact-action {
  text-decoration: none;
}

button.thread-contact-action[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.thread-messages {
  padding: 12px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
}

.thread-loading-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.thread-loading-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #d0daea;
  border-top-color: #2f6ecf;
  border-radius: 999px;
  display: inline-block;
  animation: thread-loading-spin 0.8s linear infinite;
}

@keyframes thread-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.msg {
  max-width: 70%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.35;
}

.msg.agent {
  align-self: flex-end;
  background: #e1edff;
}

.msg.contact {
  align-self: flex-start;
  background: #f1f4f8;
}

.msg.call-event {
  border: 1px solid #f2d199;
  background: #fff7e8;
}

.msg .meta {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: #667a94;
}

.thread-compose {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e7ebf2;
}

.thread-compose textarea {
  flex: 1;
  min-height: 72px;
  resize: vertical;
}

.thread-compose-standalone {
  display: grid;
  gap: 10px;
  border-top: 0;
  padding: 14px;
}

.thread-compose-standalone label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #415a7f;
}

.thread-compose-standalone textarea {
  min-height: 120px;
}

.new-message-body-field {
  grid-column: 1 / -1;
}

.thread-compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.thread-note {
  margin: 0;
  padding: 12px;
}

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

.workflow-card {
  border: 1px solid #dce3ed;
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
}

.workflow-card h4 {
  margin: 0;
  font-size: 15px;
}

.workflow-card p {
  margin: 8px 0;
  color: #6f7f95;
  font-size: 13px;
}

.workflow-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-tag {
  font-size: 11px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e8effb;
  color: #3d5c8f;
}

.contact-tag-summary {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: #f8fbff;
}

.contact-tag-summary > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #5b7394;
  font-size: 12px;
}

.contact-fub-filter-row {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.contact-fub-filter-row .outline-small {
  height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

.messenger-sidebar .contact-fub-filter-row .outline-small {
  height: 32px;
  padding: 0 9px;
}

.contact-tag-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.contact-rule-manager {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: #fbfdff;
}

.data-table.compact th,
.data-table.compact td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.sentiment-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #d3dce8;
  background: #eff3f8;
  color: #5f748f;
}

.sentiment-pill.positive {
  border-color: #b8e2c7;
  background: #e9f8ef;
  color: #2b8452;
}

.sentiment-pill.neutral {
  border-color: #d3dce8;
  background: #eff3f8;
  color: #5f748f;
}

.sentiment-pill.negative {
  border-color: #ebc4c4;
  background: #fff1f1;
  color: #b04646;
}

.bars {
  display: grid;
  gap: 9px;
}

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

.bar-row strong {
  font-size: 13px;
}

.reporting-bar-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 6px 8px;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.reporting-bar-button:hover {
  border-color: #c9d6ea;
  background: #f8fbff;
}

.reporting-bar-button.active {
  border-color: #9ebafb;
  background: #edf4ff;
}

.reporting-row-count {
  color: #6d7f97;
  font-size: 11px;
  margin-left: 6px;
}

.reporting-range-panel {
  display: grid;
  gap: 8px;
}

.reporting-range-form {
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.reporting-date-field {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.reporting-date-field span {
  font-size: 12px;
  font-weight: 600;
  color: #6d7f97;
}

.reporting-date-field input {
  height: 38px;
  border: 1px solid #cdd9eb;
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
  color: #2a3b53;
  background: #fff;
}

.reporting-metric-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #2d4360;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.reporting-metric-button:hover {
  color: #1f64d8;
}

.reporting-metric-button.active {
  color: #1f64d8;
  text-decoration: underline;
}

.reporting-cost-stack {
  display: grid;
  gap: 6px;
}

.reporting-cost-stack p {
  margin: 0;
}

.bar-track {
  height: 11px;
  border-radius: 999px;
  background: #e7ecf5;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3090ff, #6db6ff);
}

.two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}

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

.dialer-note {
  margin: 0;
  color: #667a94;
  font-size: 13px;
}

.dialer-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dialer-tab {
  border: 1px solid #cdd6e5;
  background: #f7faff;
  color: #4a607f;
  border-radius: 999px;
  height: 36px;
  padding: 0 14px;
  font: inherit;
  cursor: pointer;
}

.dialer-tab.active {
  background: #dfe9ff;
  border-color: #9ebafb;
  color: #1f4f9c;
}

.dialer-content {
  display: grid;
  gap: 14px;
}

.dialer-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.dialer-form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.dialer-advanced {
  grid-column: 1 / -1;
  border: 1px dashed #ced8ea;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f9fbff;
}

.dialer-advanced > summary {
  cursor: pointer;
  color: #35537a;
  font-weight: 600;
}

.dialer-advanced-grid {
  margin-top: 10px;
}

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

.dialer-logic-card {
  border: 1px solid #dce4ef;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fbfdff;
}

.dialer-logic-card strong {
  display: block;
  color: #28466f;
  margin-bottom: 5px;
  font-size: 13px;
}

.dialer-logic-card p {
  margin: 0;
  color: #5f7492;
  font-size: 13px;
  line-height: 1.35;
}

.dialer-inline-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dialer-checkline {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.dialer-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.campaign-action-stack {
  display: flex;
  align-items: center;
  gap: 8px;
}

.campaign-menu-wrap {
  position: relative;
}

.campaign-menu-trigger {
  min-width: 36px;
  width: 36px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
}

.campaign-menu-trigger::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #415f88;
  box-shadow: 0 -7px 0 #415f88, 0 7px 0 #415f88;
}

.campaign-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  min-width: 190px;
  border: 1px solid #d3dcea;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(29, 51, 84, 0.16);
  display: grid;
  overflow: hidden;
}

.campaign-menu button {
  border: 0;
  text-align: left;
  background: #ffffff;
  font: inherit;
  padding: 10px 12px;
  color: #304560;
  cursor: pointer;
}

.campaign-menu button:hover {
  background: #eff5ff;
}

.campaign-run-summary {
  display: grid;
  gap: 4px;
}

.campaign-run-summary strong {
  font-size: 12px;
  color: #35527a;
  line-height: 1.25;
}

.campaign-run-summary span {
  font-size: 12px;
  color: #607592;
  line-height: 1.35;
}

.campaign-name-cell {
  display: grid;
  gap: 6px;
}

.campaign-name-cell strong {
  color: #263d5e;
  font-size: 14px;
  line-height: 1.25;
}

.campaign-name-link {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: #1f4f9c;
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.campaign-name-link:hover {
  text-decoration: underline;
}

.campaign-details-panel {
  margin-top: 2px;
}

.campaign-details-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.campaign-details-grid div {
  border: 1px solid #dce4ef;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fbfcff;
}

.campaign-details-grid strong {
  display: block;
  color: #6d7f96;
  font-size: 12px;
  font-weight: 600;
}

.campaign-details-grid p {
  margin: 7px 0 0;
  color: #2a3d57;
  font-size: 14px;
}

.campaign-config-json {
  margin: 0;
  padding: 14px;
  border: 1px solid #dce4ef;
  border-radius: 12px;
  background: #f7faff;
  color: #314d73;
  overflow: auto;
  max-height: 360px;
  font-size: 12px;
  line-height: 1.35;
}

.campaign-queue-panel {
  display: grid;
  gap: 10px;
}

.campaign-queue-toolbar {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(150px, 180px) auto;
  gap: 10px;
  align-items: end;
}

.campaign-queue-toolbar label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #5f7595;
}

.campaign-queue-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.campaign-queue-table-wrap {
  max-height: 380px;
  overflow: auto;
}

.campaign-queue-table td small {
  display: block;
  margin-top: 4px;
  color: #6d7f96;
}

.queue-error {
  color: #973f3f !important;
}

.campaign-timeline-panel {
  border: 1px solid #dce4ef;
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
  display: grid;
  gap: 10px;
}

.campaign-timeline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.campaign-timeline-steps,
.campaign-timeline-events {
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
  min-height: 220px;
}

.campaign-timeline-steps h5,
.campaign-timeline-events h5 {
  margin: 0 0 8px;
  color: #2a466d;
  font-size: 13px;
}

.campaign-timeline-steps ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.campaign-step-event {
  border: 1px solid #dce4ef;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 5px;
  background: #fbfdff;
}

.campaign-step-event.sending {
  border-color: #b9cef2;
  background: #f3f8ff;
}

.campaign-step-event.failed,
.campaign-step-event.opted_out {
  border-color: #efc8c8;
  background: #fff6f6;
}

.campaign-step-event.sent {
  border-color: #cae8d6;
  background: #f6fffa;
}

.campaign-step-event-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.campaign-step-event p {
  margin: 0;
  color: #2e4362;
  font-size: 13px;
  line-height: 1.35;
}

.campaign-step-event small {
  color: #6f8097;
  font-size: 12px;
}

.campaign-timeline-stream {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.campaign-event-row {
  border: 1px solid #dce4ef;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.campaign-event-row.outbound {
  background: #f4f8ff;
}

.campaign-event-row.inbound {
  background: #f7fff6;
}

.campaign-event-row header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.campaign-event-row header strong {
  color: #274675;
  font-size: 12px;
}

.campaign-event-row header span {
  color: #6f8097;
  font-size: 12px;
}

.campaign-event-row p {
  margin: 0;
  color: #2e4362;
  font-size: 13px;
  line-height: 1.35;
}

.campaign-event-row small {
  color: #6d7f96;
  font-size: 12px;
}

.outline-small.active-view {
  background: #e4efff;
  border-color: #a8c3f7;
  color: #1f4f9c;
}

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

.call-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  padding: 10px;
}

.call-item strong {
  display: block;
}

.call-item span {
  color: #6f8097;
  font-size: 12px;
}

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

.settings-span-all {
  grid-column: 1 / -1;
}

.numbers-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.numbers-form-panel {
  position: static;
}

.numbers-table-panel .table-wrap {
  max-height: 68vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.numbers-table {
  table-layout: fixed;
}

.numbers-table th:nth-child(1),
.numbers-table td:nth-child(1) {
  width: 20%;
}

.numbers-table th:nth-child(2),
.numbers-table td:nth-child(2) {
  width: 11%;
}

.numbers-table th:nth-child(3),
.numbers-table td:nth-child(3) {
  width: 22%;
}

.numbers-table th:nth-child(4),
.numbers-table td:nth-child(4) {
  width: 8%;
}

.numbers-table th:nth-child(5),
.numbers-table td:nth-child(5) {
  width: 8%;
}

.numbers-table th:nth-child(6),
.numbers-table td:nth-child(6) {
  width: 10%;
}

.numbers-table th:nth-child(7),
.numbers-table td:nth-child(7) {
  width: 11%;
}

.numbers-table th:nth-child(8),
.numbers-table td:nth-child(8) {
  width: 10%;
}

.numbers-table td:first-child small {
  display: block;
  color: #6d7f96;
  font-size: 12px;
  margin-top: 2px;
}

.numbers-table td,
.numbers-table th {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.numbers-table .badge {
  white-space: nowrap;
}

.twilio-market-form {
  margin-bottom: 10px;
}

.twilio-market-form input {
  min-width: 140px;
}

.data-table td small {
  display: block;
  margin-top: 3px;
  color: #6f8097;
  font-size: 12px;
}

.numbers-alerts {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.numbers-strategy-form {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #d9e3f1;
  border-radius: 12px;
  background: #f9fbff;
}

.numbers-strategy-form h4 {
  margin: 0;
}

.numbers-alert {
  border: 1px solid #d6e3f7;
  border-radius: 10px;
  background: #f4f8ff;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
}

.numbers-alert strong {
  color: #274675;
  font-size: 13px;
}

.numbers-alert span {
  color: #5f7595;
  font-size: 12px;
}

.numbers-alert-warning {
  border-color: #e7d4a8;
  background: #fff9ec;
}

.numbers-alert-warning strong {
  color: #8a6216;
}

.numbers-alert-warning span {
  color: #946b1a;
}

.numbers-alert-error {
  border-color: #efc8c8;
  background: #fff3f3;
}

.numbers-alert-error strong {
  color: #8f2d2d;
}

.numbers-alert-error span {
  color: #8b4747;
}

.numbers-row-warning {
  background: #fff8f5;
}

.numbers-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.numbers-edit-row td {
  background: #f8fbff;
}

.numbers-edit-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.numbers-edit-form label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: #526a8d;
}

.numbers-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-grid h4 {
  margin: 0 0 12px;
}

.form-stack {
  display: grid;
  gap: 10px;
}

.form-stack label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.form-stack .field-block {
  display: grid;
  gap: 6px;
}

.form-stack .field-label {
  font-size: 13px;
  font-weight: 600;
  color: #294a72;
}

.form-stack .inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #516a8b;
}

.form-stack .inline-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.field-help {
  color: #667f9f;
  font-size: 12px;
  line-height: 1.35;
}

.warning-help {
  color: #8a6216;
  background: #fff9ec;
  border: 1px solid #e7d4a8;
  border-radius: 10px;
  padding: 8px 10px;
}

.dispatch-explainer {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.dispatch-explainer article {
  border: 1px solid #d9e4f1;
  border-radius: 10px;
  background: #f7fbff;
  padding: 10px 12px;
}

.dispatch-explainer strong {
  display: block;
  color: #2a4d80;
  font-size: 13px;
  margin-bottom: 4px;
}

.dispatch-explainer p {
  margin: 0;
  color: #4d678a;
  font-size: 12px;
  line-height: 1.4;
}

.strategy-options {
  display: grid;
  gap: 8px;
}

.strategy-option {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  row-gap: 2px;
  align-items: start;
  border: 1px solid #d7dfec;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fbfcff;
  cursor: pointer;
}

.strategy-option input[type="radio"] {
  margin-top: 2px;
}

.strategy-option .strategy-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f3b64;
}

.strategy-option .strategy-copy {
  grid-column: 2 / 3;
  font-size: 12px;
  color: #6d7f96;
  line-height: 1.4;
}

.strategy-option:has(input:checked) {
  border-color: #1b7bf2;
  box-shadow: 0 0 0 2px rgba(27, 123, 242, 0.12);
  background: #f4f9ff;
}

.sender-options {
  display: grid;
  gap: 6px;
  max-height: 150px;
  overflow: auto;
  border: 1px solid #d7dfec;
  border-radius: 10px;
  padding: 8px;
  background: #fbfcff;
}

.sender-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 4px 2px;
}

.sender-option input {
  margin: 0;
}

.sender-option span {
  color: #6f8097;
  font-size: 12px;
}

.campaign-modal {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(520px, 92vw);
}

.campaign-modal::backdrop {
  background: rgba(19, 35, 58, 0.4);
}

.campaign-form {
  margin: 0;
  padding: 18px;
  display: grid;
  gap: 10px;
  font: inherit;
}

.campaign-form h3 {
  margin: 0 0 6px;
}

.campaign-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.campaign-form fieldset {
  border: 1px solid #d7dfec;
  border-radius: 12px;
  margin: 0;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.campaign-form legend {
  padding: 0 4px;
  font-size: 12px;
  color: #58749a;
}

.campaign-help {
  margin: 0;
  color: #6d7f96;
  font-size: 12px;
}

.campaign-strategy-option {
  background: #ffffff;
}

.campaign-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.app-ui-dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(520px, 92vw);
  max-height: 90vh;
}

.app-ui-dialog::backdrop {
  background: rgba(19, 35, 58, 0.4);
}

.app-ui-dialog-card {
  margin: 0;
  padding: 18px;
  display: grid;
  gap: 10px;
  font: inherit;
}

.app-ui-dialog-card h3 {
  margin: 0;
}

.app-ui-dialog-message {
  margin: 0;
  color: #6d7f96;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.app-ui-dialog-field-wrap {
  display: grid;
  gap: 6px;
}

.app-ui-dialog-field-label {
  color: #58749a;
  font-size: 12px;
}

.app-ui-dialog-field-wrap input,
.app-ui-dialog-field-wrap textarea,
.app-ui-dialog-field-wrap select {
  border: 1px solid #d7dfec;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: #2a3a53;
  width: 100%;
}

.app-ui-dialog-field-wrap input:focus,
.app-ui-dialog-field-wrap textarea:focus,
.app-ui-dialog-field-wrap select:focus {
  outline: none;
  border-color: #1b7bf2;
  box-shadow: 0 0 0 2px rgba(27, 123, 242, 0.15);
}

.app-ui-dialog-field-wrap textarea {
  min-height: 110px;
  resize: vertical;
}

.app-ui-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.app-ui-dialog--tag-rule {
  width: min(620px, 94vw);
}

.app-ui-dialog--tag-picker {
  width: min(700px, 94vw);
}

.tag-picker-sentiment {
  display: grid;
  gap: 8px;
}

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

.sentiment-status-option {
  border: 1px solid #d7dfec;
  border-radius: 999px;
  padding: 9px 12px;
  text-align: center;
  font-size: 12px;
  color: #5d708d;
  background: #f8fbff;
}

.sentiment-status-option.active.positive {
  border-color: #4fb88f;
  background: #e8f8f0;
  color: #1f7a56;
}

.sentiment-status-option.active.neutral {
  border-color: #8ca0bc;
  background: #f0f4fa;
  color: #3f5675;
}

.sentiment-status-option.active.negative {
  border-color: #df8080;
  background: #fdeeee;
  color: #a83c3c;
}

.tag-picker-wrap {
  display: grid;
  gap: 8px;
}

.tag-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-picker-bubble {
  border: 1px solid #d7dfec;
  border-radius: 999px;
  background: #fff;
  color: #476489;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tag-picker-bubble:hover {
  border-color: #91b5ea;
}

.tag-picker-bubble.selected {
  border-color: #1b7bf2;
  background: #e9f2ff;
  color: #1b4f9f;
}

.tag-rule-editor-grid {
  display: grid;
  gap: 10px;
}

.app-ui-dialog-error {
  margin: 0;
  color: #bf1d1d;
  font-size: 12px;
  line-height: 1.4;
}

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

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

@media (max-width: 1200px) {
  .auth-screen {
    padding: 24px 28px 38px;
  }

  .brand-mark {
    font-size: 24px;
  }

  .auth-switch-label {
    font-size: 14px;
  }

  .outline-pill {
    height: 40px;
    min-width: 108px;
    font-size: 24px;
    padding: 0 20px;
  }

  .auth-card {
    max-width: 450px;
  }

  .auth-title {
    font-size: 46px;
  }

  .step-name {
    font-size: 16px;
  }

  .pill-input {
    height: 52px;
  }

  .pill-input input,
  .terms-row,
  .social-pill,
  .forgot-link,
  .or-row strong,
  .primary-pill {
    font-size: 28px;
  }

  .primary-pill,
  .social-pill {
    height: 52px;
  }

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

  .hint-item {
    font-size: 14px;
  }
}

@media (max-width: 1320px) {
  .messenger-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    height: auto;
    max-height: none;
  }

  .messenger-sidebar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .messenger-grid {
    grid-template-columns: minmax(250px, 36%) minmax(0, 1fr);
    min-height: 540px;
    height: min(64vh, 640px);
  }
}

@media (max-width: 1200px) {
  .contacts-add-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contacts-add-form button {
    justify-self: start;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    min-width: 0;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid #dde3ec;
    padding: 16px;
    gap: 12px;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 0;
  }

  .nav-item {
    text-align: center;
    padding: 10px 8px;
    min-height: 42px;
    white-space: normal;
    line-height: 1.2;
  }

  .main-shell {
    min-width: 0;
    width: 100%;
  }

  .logout-btn {
    margin-top: 0;
    width: fit-content;
    padding: 0 14px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .topbar-actions input {
    max-width: none;
    width: 100%;
  }

  .module-head {
    flex-direction: column;
    align-items: stretch;
  }

  .module-head .inline-tools {
    flex: 1 1 auto;
    justify-content: flex-start;
  }

  .metrics-grid,
  .workflows-grid,
  .settings-grid,
  .numbers-layout,
  .two-col,
  .campaign-details-grid,
  .campaign-timeline-grid,
  .campaigns-shell,
  .campaign-builder-shell,
  .campaign-builder-grid,
  .campaign-step-grid,
  .dialer-kpis,
  .dialer-logic-grid,
  .dialer-form-grid,
  .messenger-shell,
  .messenger-grid {
    grid-template-columns: 1fr;
  }

  .messenger-sidebar {
    grid-template-columns: 1fr;
  }

  .campaign-action-stack {
    flex-wrap: wrap;
  }

  .campaign-queue-toolbar {
    grid-template-columns: 1fr;
  }

  .messenger-shell,
  .messenger-grid,
  .thread-list,
  .thread-view {
    height: auto;
    max-height: none;
  }

  .thread-contact-grid {
    grid-template-columns: 1fr;
  }

  .contacts-add-form {
    grid-template-columns: 1fr;
  }

  .numbers-edit-form {
    grid-template-columns: 1fr;
  }

  .csv-import-layout {
    grid-template-columns: 1fr;
  }

  .csv-template-toolbar label {
    min-width: 0;
    width: 100%;
  }

  .reporting-date-field {
    min-width: 0;
    width: 100%;
  }

  .tag-picker-sentiment-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .auth-screen {
    padding: 16px 16px 28px;
    gap: 16px;
  }

  .auth-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .auth-switch-wrap {
    gap: 10px;
  }

  .auth-title {
    font-size: 33px;
  }

  .step {
    min-width: 84px;
  }

  .step-line {
    width: 24px;
  }

  .step-name {
    font-size: 13px;
  }

  .pill-input input,
  .terms-row,
  .social-pill,
  .forgot-link,
  .or-row strong,
  .primary-pill {
    font-size: 18px;
  }

  .password-hints {
    grid-template-columns: 1fr;
  }

  .main-shell {
    padding: 12px;
  }

  .dialer-tabs {
    overflow: auto;
    padding-bottom: 4px;
  }

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

  .nav-item {
    font-size: 14px;
  }

  .thread-compose {
    flex-direction: column;
    align-items: stretch;
  }

  .thread-compose textarea {
    min-height: 88px;
  }

  .thread-compose .primary-small {
    align-self: flex-end;
  }

  .msg {
    max-width: 84%;
  }

  .thread-view,
  .messenger-shell,
  .messenger-grid {
    min-height: 0;
  }

  .campaign-menu {
    right: auto;
    left: 0;
  }

  .csv-template-actions {
    width: 100%;
  }

  .csv-template-actions button,
  .csv-import-actions button {
    width: 100%;
  }
}
