.settings-layout--wa {
  padding: 14px;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  background: #f7fbff;
}

.settings-help--wa,
.wa-panel,
.wa-webhook-card,
.wa-integration-item,
.wa-form-section {
  border: 1px solid #dbe5f2;
  border-radius: 16px;
  background: #fff;
}

.settings-help--wa {
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.settings-guide-head {
  display: grid;
  gap: 6px;
}

.settings-guide-head strong,
.settings-hero-copy h2,
.wa-panel-head h3,
.wa-form-section-head strong,
.wa-webhook-card-head strong {
  color: #133f78;
}

.settings-guide-head p,
.settings-hero-copy p,
.wa-panel-head p,
.wa-form-section-head small,
.wa-webhook-card-head small,
.wa-inline-help,
.field-help {
  color: #627896;
}

.wa-checklist {
  display: grid;
  gap: 10px;
}

.wa-check-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e6eef8;
  border-radius: 14px;
  background: #f9fbff;
}

.wa-check-item.is-done {
  border-color: #cce5d7;
  background: #eefbf4;
}

.wa-check-index,
.wa-check-state,
.wa-status-chip,
.wa-badge,
.settings-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.wa-check-index {
  width: 34px;
  min-width: 34px;
  padding: 0;
  background: #e8f0ff;
  color: #20539f;
}

.wa-check-copy {
  display: grid;
  gap: 2px;
}

.wa-check-copy strong {
  color: #173e72;
}

.wa-check-copy small {
  color: #627896;
  line-height: 1.45;
}

.wa-check-state,
.wa-status-chip,
.wa-badge.is-muted {
  background: #f3f6fb;
  border: 1px solid #dbe5f2;
  color: #69809a;
}

.wa-status-chip.is-active,
.wa-badge.is-active {
  background: #e9f8ef;
  border: 1px solid #ccebd7;
  color: #0f6a3d;
}

.wa-status-chip.is-error,
.wa-badge.is-error {
  background: #fff3f3;
  border: 1px solid #f1cccc;
  color: #8a2626;
}

.wa-webhook-card {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.wa-webhook-card-head,
.wa-panel-head,
.wa-integration-title-row,
.settings-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.wa-webhook-url {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.wa-webhook-url code {
  display: block;
  border: 1px solid #d7e4f6;
  border-radius: 12px;
  background: #f6faff;
  padding: 12px;
  color: #1f467e;
  word-break: break-all;
}

.wa-webhook-actions {
  display: grid;
  gap: 8px;
}

.wa-inline-help.is-ok {
  color: #186842;
}

.wa-inline-help.is-error {
  color: #9e3333;
}

.settings-main {
  display: grid;
  gap: 14px;
}

.settings-hero {
  padding: 18px;
  border: 1px solid #dbe5f2;
  border-radius: 18px;
  background: linear-gradient(135deg, #eef6ff 0%, #ffffff 65%);
}

.settings-hero-copy {
  display: grid;
  gap: 6px;
}

.settings-hero-copy h2 {
  margin: 0;
  font-size: 24px;
}

.settings-hero-copy p {
  margin: 0;
  max-width: 620px;
}

.settings-hero-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-pill {
  background: #fff;
  border: 1px solid #d9e5f7;
  color: #1d4b88;
}

.wa-panel {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.wa-panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.wa-panel-head p {
  margin: 4px 0 0;
  font-size: 13px;
}

.wa-last-test {
  border-radius: 999px;
  border: 1px solid #dbe5f2;
  background: #f7fbff;
  color: #627896;
  padding: 8px 12px;
  font-size: 13px;
}

.wa-last-test.is-ok {
  background: #eefbf4;
  border-color: #cce5d7;
  color: #19613d;
}

.wa-last-test.is-error {
  background: #fff4f4;
  border-color: #efcccc;
  color: #9e3333;
}

.wa-integration-list {
  display: grid;
  gap: 12px;
}

.wa-integration-item {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  box-shadow: 0 8px 20px rgba(17, 63, 135, 0.04);
}

.wa-integration-item.is-default {
  border-color: #bfd4fa;
  background: #f4f8ff;
}

.wa-integration-item.is-connected {
  border-left: 4px solid #2f9d62;
}

.wa-integration-item.is-pending {
  border-left: 4px solid #b38d1e;
}

.wa-integration-item.is-error {
  border-left: 4px solid #c94848;
}

.wa-integration-main {
  display: grid;
  gap: 6px;
}

.wa-integration-title-row h4 {
  margin: 0;
  font-size: 17px;
}

.wa-integration-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wa-badge.is-default {
  background: #eef4ff;
  border: 1px solid #cddcff;
  color: #1b4f9c;
}

.wa-badge.is-usage {
  background: #fff9eb;
  border: 1px solid #f3dfac;
  color: #8a6410;
}

.wa-integration-phone {
  margin: 0;
  font-weight: 700;
  color: #1c355b;
}

.wa-integration-meta {
  margin: 0;
  color: #647a97;
  font-size: 13px;
}

.wa-integration-actions,
.actions-row,
.token-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.wa-test-grid {
  align-items: end;
}

.wa-test-message {
  min-width: 0;
}

.wa-config-form {
  gap: 14px;
}

.wa-form-section {
  padding: 14px;
  display: grid;
  gap: 12px;
  background: #fbfdff;
}

.wa-form-section-head {
  display: grid;
  gap: 4px;
}

.field-help {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
}

.token-field .token-input-wrap input {
  flex: 1 1 auto;
}

.wa-empty {
  border: 1px dashed #d7e2f1;
  border-radius: 14px;
  padding: 16px;
  color: #647a97;
  background: #f9fbff;
}

.wa-embedded-panel {
  background:
    radial-gradient(circle at top right, rgba(32, 83, 159, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.wa-embedded-summary {
  display: grid;
  gap: 12px;
}

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

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

.wa-embedded-card {
  border: 1px solid #dbe5f2;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 6px;
}

.wa-embedded-card span {
  font-size: 12px;
  color: #68809b;
}

.wa-embedded-card strong {
  color: #163f77;
  font-size: 14px;
  word-break: break-word;
}

.wa-embedded-card small {
  color: #627896;
  line-height: 1.45;
}

.wa-embedded-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wa-embedded-alert {
  border-radius: 12px;
  border: 1px solid #f1d7ab;
  background: #fff8ea;
  color: #885f10;
  padding: 10px 12px;
}

.btn-danger-soft {
  border-color: #f2c4c4;
  color: #a62f2f;
}

.btn-danger-soft:hover {
  background: #fff1f1;
}

.msg {
  margin: 0;
}

.msg.msg-ok,
.msg.msg-error {
  border-radius: 12px;
  padding: 10px 12px;
}

.msg.msg-ok {
  background: #eefbf4;
  border: 1px solid #c9e5d6;
  color: #1e5e3d;
}

.msg.msg-error {
  background: #fff3f3;
  border: 1px solid #f1cccc;
  color: #8a2626;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

.role-banner {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid #fee4a8;
  color: #7a5316;
  background: #fff8e8;
}

.hidden {
  display: none;
}

@media (max-width: 1120px) {
  .settings-layout--wa {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .wa-integration-item,
  .wa-test-grid,
  .wa-form-grid,
  .wa-webhook-url {
    grid-template-columns: 1fr;
  }
}

.wisphub-token-layout {
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 16px;
  background:
    radial-gradient(circle at top left, rgba(30, 102, 216, 0.08), transparent 28%),
    linear-gradient(180deg, #f7fbff 0%, #f1f6fd 100%);
}

.wisphub-token-layout .settings-help {
  gap: 16px;
  display: grid;
  position: sticky;
  top: 18px;
  align-self: start;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid #dbe6f5;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 38px rgba(18, 50, 96, 0.08);
}

.wisphub-doc-grid {
  display: grid;
  gap: 12px;
}

.wisphub-help-steps {
  display: grid;
  gap: 10px;
}

.wisphub-help-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid #e2ebf7;
  border-radius: 14px;
  background: #f8fbff;
}

.wisphub-help-step span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #1f67d8, #3f8cff);
  box-shadow: 0 10px 20px rgba(31, 103, 216, 0.25);
}

.wisphub-help-step strong,
.wisphub-overview-card strong {
  color: #13396b;
}

.wisphub-help-step p {
  margin: 4px 0 0;
  color: #607694;
  line-height: 1.5;
}

.wisphub-doc-card,
.wisphub-mode-card,
.wisphub-log-item {
  border: 1px solid #dbe5f2;
  border-radius: 16px;
  background: #fff;
}

.wisphub-doc-card {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.wisphub-doc-accordion {
  padding: 0;
  overflow: hidden;
}

.wisphub-doc-accordion[open] {
  box-shadow: 0 10px 24px rgba(17, 63, 135, 0.05);
}

.wisphub-doc-accordion summary {
  list-style: none;
  cursor: pointer;
}

.wisphub-doc-accordion summary::-webkit-details-marker {
  display: none;
}

.wisphub-doc-head,
.wisphub-new-token-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wisphub-doc-head {
  padding: 14px;
}

.wisphub-doc-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wisphub-doc-card code,
.wisphub-doc-card pre {
  margin: 0 14px 14px;
  display: block;
  border: 1px solid #dce7f7;
  border-radius: 12px;
  background: #f7fbff;
  padding: 12px;
  color: #1f467e;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.wisphub-doc-tip {
  margin: -4px 14px 14px;
  color: #627896;
  font-size: 12px;
  line-height: 1.45;
}

.wisphub-doc-tip strong {
  color: #1b4c87;
}

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

.wisphub-token-stack {
  gap: 18px;
}

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

.wisphub-overview-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid #dce6f4;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 14px 30px rgba(17, 63, 135, 0.05);
}

.wisphub-overview-card small {
  color: #7086a3;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.wisphub-overview-card strong {
  font-size: 28px;
  line-height: 1.05;
}

.wisphub-overview-card span {
  color: #617896;
  line-height: 1.45;
}

.wisphub-overview-inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #1b4c87;
  word-break: break-all;
}

.wisphub-token-section {
  display: grid;
  gap: 14px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.wisphub-token-section + .wisphub-token-section {
  border-top: 1px solid #e7eef8;
  padding-top: 18px;
}

.wisphub-mode-card {
  padding: 14px;
  display: grid;
  gap: 6px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.wisphub-mode-card strong {
  color: #143f77;
}

.wisphub-mode-card p {
  margin: 0;
  color: #627896;
  line-height: 1.5;
}

.wisphub-mode-card.is-active {
  border-color: #bfd4fa;
  background: #eef5ff;
  box-shadow: 0 10px 24px rgba(29, 75, 136, 0.08);
}

.wisphub-mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.wisphub-mode-badge.is-sandbox {
  background: #fff6db;
  color: #8c5b00;
  border: 1px solid #ffe2a0;
}

.wisphub-mode-badge.is-production {
  background: #eaf7ee;
  color: #1d6b44;
  border: 1px solid #ccebd8;
}

.wisphub-new-token {
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #c9e5d6;
  background: #eefbf4;
  color: #1e5e3d;
  display: grid;
  gap: 8px;
  box-shadow: 0 16px 28px rgba(28, 94, 61, 0.08);
}

.wisphub-new-token code {
  background: #fff;
  border: 1px solid #d7e6de;
  border-radius: 10px;
  padding: 10px 12px;
  word-break: break-all;
}

.wisphub-table--tokens th,
.wisphub-table--tokens td {
  white-space: nowrap;
}

.wisphub-table--tokens thead th {
  background: #f5f9ff;
  color: #37567f;
  border-bottom-color: #dce7f5;
}

.wisphub-table--tokens tbody tr:hover {
  background: #f8fbff;
}

.wisphub-table--tokens td strong {
  color: #153a6d;
}

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

.wisphub-log-item {
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.wisphub-log-item strong {
  color: #153d77;
}

.wisphub-log-item p {
  margin: 0;
  color: #5f7694;
  line-height: 1.45;
}

.wisphub-logs-page {
  padding: 18px;
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
}

.wisphub-logs-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

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

.wisphub-logs-copy strong {
  display: block;
  font-size: 1.05rem;
  color: #153d77;
}

.wisphub-logs-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  min-width: 0;
  max-width: 100%;
}

.wisphub-logs-field {
  min-width: 200px;
  max-width: 100%;
}

.wisphub-logs-page .table-wrap,
.wisphub-logs-table,
.wisphub-logs-table tbody,
.wisphub-logs-table tr,
.wisphub-logs-table td {
  min-width: 0;
  max-width: 100%;
}

.wisphub-logs-table td code {
  white-space: pre-wrap;
  word-break: break-all;
}

.wisphub-system-page {
  min-width: 0;
}

.wisphub-system-help {
  gap: 12px;
}

.wisphub-system-help h2 {
  margin: 0;
  color: #133f78;
  font-size: 22px;
}

.wisphub-system-help p {
  margin: 0;
  color: #627896;
  line-height: 1.5;
}

.wisphub-system-help ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: #314b70;
}

.wisphub-system-help li {
  line-height: 1.5;
}

.wisphub-system-panel,
.wisphub-system-form,
.wisphub-system-page .settings-main {
  min-width: 0;
}

.wisphub-system-form .field input {
  min-width: 0;
}

.wisphub-system-form .actions-row {
  width: 100%;
}

.wisphub-system-form .actions-row .btn {
  min-width: 0;
}

.wisphub-system-panel .wa-empty {
  line-height: 1.5;
  word-break: break-word;
}

.wisphub-system-panel .wa-empty code {
  white-space: pre-wrap;
  word-break: break-all;
}

/* UX refresh 2026-05-03: settings-whatsapp */
.settings-layout--wa {
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 10px;
  background: #f4f7fc;
}

.settings-main {
  order: 1;
  display: grid;
  gap: 14px;
}

.settings-help--wa {
  order: 2;
  display: grid;
}

.settings-hero {
  padding: 20px 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f5f9ff 100%);
  border: 1px solid #dce6f4;
  box-shadow: 0 18px 38px rgba(17, 63, 135, 0.06);
}

.settings-hero-copy h2 {
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #122f60;
}

.settings-hero-copy p {
  font-size: 19px;
  color: #5c7292;
}

.settings-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.settings-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #d9e6f6;
  background: #ffffff;
  color: #28548d;
  font-size: 12px;
  font-weight: 700;
}

.wa-panel {
  border-radius: 20px;
  border: 1px solid #dce6f4;
  background: #fff;
  padding: 18px;
  box-shadow: 0 18px 34px rgba(18, 50, 96, 0.05);
}

.wa-panel-head h3 {
  font-size: 28px;
  color: #102f60;
}

.wa-panel-head p {
  font-size: 16px;
  color: #5e7392;
}

.wa-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.wa-panel-head .btn {
  min-height: 44px;
  border-radius: 12px;
  padding-inline: 18px;
  font-size: 16px;
  font-weight: 800;
}

.wa-integration-list {
  gap: 10px;
}

.wa-integration-item {
  border-radius: 14px;
  padding: 14px;
  grid-template-columns: auto 1fr auto;
}

.wa-integration-logo-wrap {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: #eaf9ef;
  border: 1px solid #cdebd9;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: start;
}

.wa-integration-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

.wa-integration-title-row h4 {
  font-size: 18px;
  color: #123768;
}

.wa-integration-phone {
  font-size: 34px;
  line-height: 1.08;
  color: #0f2f62;
}

.wa-integration-meta {
  font-size: 16px;
}

.wa-integration-kpis {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.wa-integration-kpis span {
  display: block;
  font-size: 12px;
  color: #6980a0;
}

.wa-integration-kpis strong {
  color: #183a6a;
  font-size: 16px;
}

.wa-panel-head-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wa-integration-actions .btn {
  min-height: 38px;
  border-radius: 10px;
}

.settings-guide-head {
  border-bottom: 1px solid #e7eef8;
  padding-bottom: 10px;
}

.settings-guide-head strong {
  font-size: 24px;
  color: #123668;
}

.settings-guide-head p {
  margin: 6px 0 0;
  color: #607694;
  line-height: 1.55;
}

.settings-guide-head p {
  font-size: 16px;
  color: #607895;
}

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

.wa-check-item {
  grid-template-columns: 30px 1fr;
  align-items: start;
  gap: 10px;
  min-height: 180px;
  border-radius: 14px;
  padding: 12px;
}

.wa-check-state {
  display: none;
}

.wa-check-index {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  font-size: 14px;
}

.wa-check-copy strong {
  font-size: 20px;
}

.wa-check-copy small {
  font-size: 14px;
}

.wa-webhook-card {
  border-radius: 14px;
  padding: 12px;
  margin-top: 2px;
}

.wa-webhook-card-head strong {
  font-size: 20px;
}

.wa-webhook-url code {
  min-height: 48px;
  display: flex;
  align-items: center;
  font-size: 13px;
}

.wa-webhook-actions .btn {
  min-height: 40px;
  border-radius: 10px;
}

.wa-test-grid {
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.wa-test-grid .field input,
.wa-test-grid .field select {
  min-height: 44px;
}

.wa-last-test {
  margin-top: 6px;
}

.wa-integration-item--skeleton {
  border-left: none;
}

.wa-skel {
  background: linear-gradient(90deg, #eef3fb 20%, #dfe9f7 38%, #eef3fb 56%);
  background-size: 220% 100%;
  animation: waSkel 1.1s linear infinite;
  border-radius: 10px;
}

.wa-skel-circle {
  width: 58px;
  height: 58px;
  border-radius: 999px;
}

.wa-skel-line {
  height: 14px;
  margin-bottom: 8px;
}

.wa-skel-line-lg {
  height: 22px;
  width: 48%;
}

@keyframes waSkel {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 1260px) {
  .wa-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .wa-embedded-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .settings-layout--wa {
    padding: 10px;
    gap: 12px;
  }

  .settings-main {
    gap: 12px;
  }

  .settings-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
  }

  .settings-hero-copy {
    gap: 4px;
  }

  .settings-hero-copy h2 {
    font-size: 24px;
    line-height: 1.1;
  }

  .settings-hero-copy p {
    font-size: 14px;
    max-width: none;
  }

  .settings-hero-pills {
    width: 100%;
  }

  .settings-hero-pills .btn {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }

  .wa-checklist,
  .wa-test-grid {
    grid-template-columns: 1fr;
  }

  .wa-integration-item {
    grid-template-columns: 1fr;
  }

  .wa-integration-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .wa-embedded-grid {
    grid-template-columns: 1fr;
  }

  .wa-panel {
    padding: 14px;
    border-radius: 18px;
  }

  .wa-panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .wa-panel-head h3 {
    font-size: 22px;
  }

  .wa-panel-head p {
    font-size: 14px;
  }

  .wa-panel-head-right {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .wa-status-chip,
  .wa-panel-head .btn,
  .wa-integration-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .wa-integration-item {
    padding: 12px;
    gap: 10px;
  }

  .wa-integration-logo-wrap {
    width: 52px;
    height: 52px;
  }

  .wa-integration-logo {
    width: 88px;
    height: 88px;
  }

  .wa-integration-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .wa-integration-badges {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .wa-integration-phone {
    font-size: 24px;
    line-height: 1.1;
    word-break: break-word;
  }

  .wa-integration-meta {
    font-size: 14px;
  }

  .wa-integration-kpis {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .wa-integration-actions,
  .actions-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .wa-integration-actions .btn,
  .actions-row .btn {
    min-width: 0;
  }

  .wa-last-test {
    width: 100%;
    border-radius: 14px;
    padding: 10px 12px;
    line-height: 1.45;
  }

  .wa-test-grid {
    gap: 10px;
  }

  .wa-test-grid .field input,
  .wa-test-grid .field select {
    min-height: 42px;
  }
}

@media (max-width: 640px) {
  .settings-layout--wa {
    padding: 8px;
    gap: 10px;
  }

  .wa-panel {
    padding: 12px;
    border-radius: 16px;
  }

  .settings-hero {
    padding: 14px;
    border-radius: 16px;
  }

  .settings-hero-copy h2 {
    font-size: 21px;
  }

  .settings-hero-copy p {
    font-size: 13px;
    line-height: 1.5;
  }

  .wa-panel-head h3 {
    font-size: 20px;
  }

  .wa-panel-head p {
    font-size: 13px;
    line-height: 1.45;
  }

  .wa-integration-phone {
    font-size: 20px;
  }

  .wa-integration-kpis {
    grid-template-columns: 1fr;
  }

  .wa-integration-title-row h4 {
    font-size: 16px;
  }

  .wa-integration-meta {
    font-size: 13px;
    line-height: 1.45;
  }

  .wa-webhook-url {
    grid-template-columns: 1fr;
  }

  .wa-webhook-url code {
    min-height: 42px;
    font-size: 12px;
    word-break: break-all;
  }

  .wa-webhook-actions,
  .wa-integration-actions,
  .actions-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .wa-webhook-actions .btn,
  .wa-integration-actions .btn,
  .actions-row .btn {
    width: 100%;
  }

  .wa-modal-card {
    width: min(100vw - 10px, 1420px);
  }
}

.wa-modal-card {
  width: min(1420px, calc(100vw - 28px));
}

.wa-modal-wizard {
  display: block;
}

.wa-modal-step {
  display: none;
  padding: 12px;
  border: 1px solid #dce6f4;
  border-radius: 12px;
  gap: 10px;
  align-content: start;
}

.wa-modal-step.is-active {
  display: grid;
}

.wa-modal-step h4 {
  margin: 0;
  color: #123768;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.wa-modal-step h4 span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #1f67d8;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.wa-modal-step .field input,
.wa-modal-step .field select {
  min-height: 38px;
}

.wa-modal-ok {
  border: 1px solid #cce5d7;
  background: #eefbf4;
  color: #1a6c43;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
}

@media (max-width: 1320px) {
  .wa-modal-wizard {
    display: block;
  }
}

@media (max-width: 860px) {
  .wa-modal-wizard {
    display: block;
  }
}

.wisphub-log-item small {
  color: #7a8ea8;
}

.wisphub-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 39, 77, 0.38);
  backdrop-filter: blur(4px);
}

.wisphub-modal-backdrop.hidden {
  display: none;
}

.wisphub-modal-card {
  width: min(640px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.wisphub-modal-form {
  display: grid;
  gap: 14px;
}

.wisphub-token-section .actions-row {
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .wisphub-overview,
  .wisphub-logs {
    grid-template-columns: 1fr;
  }

  .wisphub-mode-grid {
    grid-template-columns: 1fr;
  }

  .wisphub-token-layout {
    grid-template-columns: 1fr;
  }

  .wisphub-token-layout .settings-help {
    position: static;
    top: auto;
  }

  .wisphub-token-layout {
    padding: 10px;
    gap: 12px;
  }

  .wisphub-token-layout .settings-help,
  .wisphub-token-stack {
    border-radius: 18px;
  }

  .wisphub-doc-grid {
    grid-template-columns: 1fr;
  }

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

  .wisphub-token-section .actions-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .wisphub-token-section .actions-row .btn,
  .wisphub-token-section .actions-row .wa-last-test {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .wisphub-system-help {
    padding: 14px;
    border-radius: 16px;
  }

  .wisphub-system-help h2 {
    font-size: 20px;
  }

  .wisphub-system-help ol {
    padding-left: 18px;
    gap: 8px;
    font-size: 13px;
  }

  .wisphub-system-form {
    gap: 12px;
  }

  .wisphub-system-form .actions-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .wisphub-system-form .actions-row .btn {
    width: 100%;
  }

  .wisphub-system-panel .wa-empty {
    padding: 14px;
    font-size: 13px;
  }

  .wisphub-logs-page {
    padding: 12px;
    gap: 12px;
  }

  .wisphub-logs-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .wisphub-logs-copy strong {
    font-size: 1rem;
  }

  .wisphub-logs-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  .wisphub-logs-field {
    min-width: 0;
    width: 100%;
  }

  .wisphub-logs-field input,
  .wisphub-logs-filters .btn {
    width: 100%;
  }

  .wisphub-logs-page .table-wrap {
    overflow: visible;
    width: 100%;
  }

  .wisphub-logs-table,
  .wisphub-logs-table thead,
  .wisphub-logs-table tbody,
  .wisphub-logs-table tr,
  .wisphub-logs-table th,
  .wisphub-logs-table td {
    display: block;
    width: 100%;
  }

  .wisphub-logs-table thead {
    display: none;
  }

  .wisphub-logs-table tbody {
    display: grid;
    gap: 10px;
  }

  .wisphub-logs-table tr {
    border: 1px solid #dbe5f2;
    border-radius: 14px;
    background: #fbfdff;
    padding: 10px 12px;
    box-shadow: 0 10px 20px rgba(17, 63, 135, 0.04);
  }

  .wisphub-logs-table td {
    padding: 6px 0;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .wisphub-logs-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: #6d84a0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  
  .wisphub-token-layout {
    padding: 8px;
    gap: 10px;
  }

  .wisphub-token-layout .settings-help {
    padding: 14px;
    border-radius: 16px;
    gap: 14px;
  }

  .wisphub-help-steps {
    gap: 8px;
  }

  .wisphub-help-step {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
  }

  .wisphub-help-step span {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .wisphub-help-step p {
    font-size: 13px;
    line-height: 1.45;
  }

  .wisphub-doc-card {
    padding: 12px;
    border-radius: 14px;
    gap: 8px;
  }

  .wisphub-doc-head,
  .wisphub-new-token-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0;
  }

  .wisphub-doc-actions {
    width: 100%;
  }

  .wisphub-doc-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .wisphub-doc-card code,
  .wisphub-doc-card pre,
  .wisphub-doc-tip {
    margin: 0;
  }

  .wisphub-doc-card code,
  .wisphub-doc-card pre {
    padding: 10px;
    font-size: 12px;
    border-radius: 10px;
  }

  .wisphub-doc-tip {
    font-size: 11px;
  }

  .wisphub-overview {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .wisphub-overview-card {
    padding: 14px;
    border-radius: 16px;
  }

  .wisphub-overview-card strong {
    font-size: 22px;
  }

  .wisphub-overview-card span {
    font-size: 13px;
    line-height: 1.45;
  }

  .wisphub-token-stack {
    gap: 14px;
  }

  .wisphub-token-section {
    gap: 12px;
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .wisphub-token-section + .wisphub-token-section {
    padding-top: 14px;
  }

  .wisphub-token-section .actions-row {
    grid-template-columns: 1fr;
  }

  .wisphub-token-section .actions-row .btn,
  .wisphub-token-section .actions-row .wa-last-test {
    width: 100%;
  }

  .wisphub-token-section .table-wrap {
    overflow: visible;
  }

  .wisphub-table--tokens,
  .wisphub-table--tokens thead,
  .wisphub-table--tokens tbody,
  .wisphub-table--tokens tr,
  .wisphub-table--tokens th,
  .wisphub-table--tokens td {
    display: block;
    width: 100%;
  }

  .wisphub-table--tokens thead {
    display: none;
  }

  .wisphub-table--tokens tbody {
    display: grid;
    gap: 10px;
  }

  .wisphub-table--tokens tr {
    border: 1px solid #dbe5f2;
    border-radius: 14px;
    background: #fbfdff;
    padding: 10px 12px;
    box-shadow: 0 10px 20px rgba(17, 63, 135, 0.04);
  }

  .wisphub-table--tokens td {
    white-space: normal;
    border: 0;
    padding: 6px 0;
    font-size: 13px;
    word-break: break-word;
  }

  .wisphub-table--tokens td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: #6d84a0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .wisphub-table--tokens td code {
    white-space: pre-wrap;
    word-break: break-all;
  }

  .wisphub-table--tokens td:last-child {
    padding-top: 10px;
  }

  .wisphub-table--tokens td:last-child .btn {
    width: 100%;
  }

  .wisphub-logs {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .wisphub-log-item {
    padding: 10px 12px;
    border-radius: 14px;
  }

  .wisphub-modal-card {
    width: min(calc(100vw - 12px), 560px);
  }

  .wisphub-modal-form {
    gap: 12px;
  }
}

@media (max-width: 540px) {
  .wisphub-overview {
    grid-template-columns: 1fr;
  }

  .wisphub-overview-card strong {
    font-size: 20px;
  }

  .wisphub-token-layout .settings-help,
  .wisphub-token-stack {
    border-radius: 14px;
  }
}

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

.openai-help-steps {
  margin: 0;
  padding: 10px 0 0;
  list-style: none;
  display: grid;
  gap: 14px;
  position: relative;
}

.openai-help-steps::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 22px;
  bottom: 18px;
  width: 2px;
  background: #d8e6fb;
}

.openai-help-steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
  color: #2b4974;
  line-height: 1.45;
}

.openai-help-steps .step-bullet {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1f76ff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  position: relative;
  z-index: 1;
}

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

.openai-result {
  border-radius: 14px;
  border: 1px solid #d5e5ff;
  background: #f5f9ff;
  padding: 14px;
  display: grid;
  gap: 8px;
  min-height: 150px;
}

.openai-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.openai-result pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #193f74;
  line-height: 1.45;
  min-height: 64px;
}

@media (max-width: 720px) {
  .openai-grid-2 {
    grid-template-columns: 1fr;
  }
}
