:root {
  font:
    14px/1.5 system-ui,
    sans-serif;
  color: #1e293b;
  background: #f6f7fa;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
[hidden] {
  display: none !important;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid #e4e8ef;
}
header strong {
  font-size: 19px;
}
header span {
  margin-left: 14px;
  color: #64748b;
}
main {
  max-width: 1480px;
  margin: auto;
  padding: 24px 28px;
  min-width: 0;
}
h1 {
  font-size: 25px;
  line-height: 1.2;
  margin: 0 0 6px;
}
h2 {
  font-size: 19px;
  margin: 0 0 16px;
}
h3 {
  font-size: 16px;
  margin: 18px 0 12px;
}
h4 {
  font-size: 14px;
  margin: 12px 0;
}
p {
  margin: 8px 0 14px;
}
a {
  color: #345bd2;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  border: 1px solid #cbd3df;
  border-radius: 7px;
  background: #fff;
}
button {
  min-height: 38px;
  padding: 8px 12px;
  cursor: pointer;
  max-width: 100%;
}
button:hover {
  background: #f0f3f8;
}
button.primary {
  color: #fff;
  background: #365cce;
  border-color: #365cce;
}
button.primary:hover {
  background: #284bb4;
}
button.danger {
  color: #b33440;
  border-color: #dba6ac;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
:where(button, input, textarea, select, summary, a):focus-visible {
  outline: 3px solid #95afff;
  outline-offset: 2px;
}
input,
textarea,
select {
  display: block;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
  margin-top: 5px;
  min-width: 0;
}
textarea {
  resize: vertical;
}
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  margin-bottom: 12px;
  min-width: 0;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
fieldset:disabled {
  opacity: 0.7;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.card {
  background: #fff;
  border: 1px solid #e0e5ed;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 18px;
  min-width: 0;
}
.login {
  max-width: 420px;
  margin: 50px auto;
}
.intro,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.intro {
  margin-bottom: 16px;
}
.intro p {
  color: #64748b;
  margin: 0;
}
.section-heading h2 {
  margin: 0;
}
.section-heading {
  margin-bottom: 18px;
}
.hint,
.muted {
  font-size: 12px;
  color: #69778b;
  font-weight: 400;
}
.banner {
  background: #eef2fa;
  color: #53627b;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 12px;
}
#notice {
  padding-right: 42px;
  position: fixed;
  z-index: 100;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(460px, calc(100vw - 32px));
  max-height: 35vh;
  overflow: auto;
  margin: 0;
  box-shadow: 0 8px 32px #172b4d26;
  padding: 12px 42px 12px 16px;
  border: 1px solid #ccd9f2;
  border-radius: 8px;
  background: #eef4ff;
  overflow-wrap: anywhere;
}
#notice.error {
  border-color: #dfada7;
  background: #fff1ef;
}
.workspace-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 18px 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dfe5ed;
}
.workspace-nav button {
  border-color: transparent;
  color: #53627b;
  background: transparent;
}
.workspace-nav [aria-current="page"] {
  color: #2f52b5;
  border-color: #d6e0fa;
  background: #eaf0ff;
}
#nav-toggle {
  display: none;
}
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.row > label {
  flex: 1 1 180px;
}
.row > button {
  margin-bottom: 12px;
  flex-shrink: 0;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 0 14px;
  align-items: end;
  margin: 12px 0;
}
.filter-grid > button {
  margin-bottom: 12px;
}
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  font-size: 12px;
  color: #66758b;
  font-weight: 600;
  background: #f8fafc;
  white-space: nowrap;
}
th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #e8ecf2;
  vertical-align: top;
}
td {
  min-width: 80px;
}
td strong,
td small {
  display: block;
}
td small {
  color: #738094;
  margin-top: 3px;
}
td:first-child {
  min-width: 40px;
}
td a {
  font-weight: 550;
}
td button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}
td details {
  min-width: 150px;
  max-width: 340px;
}
.badge {
  display: inline-block;
  padding: 3px 8px;
  background: #eef2fb;
  color: #536381;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
}
.pagination,
.selection-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 0;
}
.selection-bar {
  border-top: 1px solid #e7ebf2;
}
.selection-bar span {
  margin-right: auto;
  font-size: 12px;
  color: #63718a;
}
#selection-actions {
  margin-bottom: 16px;
}
.inline-details {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(0, 1.3fr);
  gap: 6px 16px;
  margin: 10px 0;
  font-size: 12px;
}
.inline-details dt {
  color: #6b7890;
}
.inline-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
#directory-list tr:has(.inline-details) td {
  background: #fafbfe;
}
.section-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
.section-layout > * {
  min-width: 0;
}
#audience-form {
  border: 1px solid #e0e6f0;
  border-radius: 8px;
  padding: 16px;
}
.editor-navigation {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  grid-column: 1/-1;
  margin-bottom: 18px;
}
.editor-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.editor-tabs button {
  border-color: transparent;
}
.editor-tabs [aria-selected="true"] {
  border-color: #cddafa;
  background: #edf2ff;
  color: #3156c0;
}
.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0 22px;
  min-width: 0;
}
.editor-card {
  grid-column: 1;
}
.preview-card {
  grid-column: 1;
}
.editor-card > .section-heading {
  align-items: flex-start;
}
.editor-card h2 {
  overflow-wrap: anywhere;
}
#campaign-form > button {
  margin-top: 16px;
}
#actions,
#history {
  grid-column: 1/-1;
}
.message-preview {
  padding: 14px;
  background: #edf3fa;
  border: 1px solid #e1e9f4;
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.message-preview p {
  white-space: pre-wrap;
}
#preview-media img,
#preview-media video {
  width: 100%;
  max-height: 330px;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}
.attachment-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f5f7fb;
  border-radius: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}
.variant-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.variant-tabs [aria-pressed="true"] {
  background: #edf2ff;
  border-color: #a9bde9;
  color: #3156c0;
}
.variant-tabs button {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.keyboard-row-editor {
  border: 1px solid #e0e6ef;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
}
.keyboard-row-heading,
.keyboard-button-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.keyboard-row-heading h4 {
  flex: 1;
  min-width: 70px;
  margin: 0;
}
.keyboard-row-heading button,
.keyboard-button-actions button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}
.keyboard-button-editor {
  border-top: 1px solid #e5eaf2;
  margin-top: 12px;
  padding-top: 12px;
}
.keyboard-button-actions select {
  width: auto;
  max-width: 100%;
}

.preview-keyboard-row {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}
.preview-action {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 9px 5px;
  border: 1px solid #cedbed;
  border-radius: 7px;
  background: #e0eafa;
  color: #34588d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.preview-action.button-primary {
  background: #316ac2;
  color: #fff;
}
.preview-action.button-success {
  background: #348452;
  color: #fff;
}
.preview-action.button-danger {
  background: #bd424c;
  color: #fff;
}
.preview-action[data-type="web_app"]::after {
  content: " ▣";
}
.preview-action[data-type="url"]::after {
  content: " ↗";
}
details {
  border: 1px solid #e0e6ef;
  padding: 10px 12px;
  border-radius: 7px;
}
summary {
  cursor: pointer;
  font-weight: 550;
  font-size: 13px;
}
details[open] > summary {
  margin-bottom: 12px;
}
.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.counts span {
  padding: 5px 9px;
  background: #f0f3f8;
  border-radius: 6px;
}
.incident {
  padding: 14px;
  border: 1px solid #e0e6ef;
  border-left: 3px solid #d3a046;
  border-radius: 7px;
  margin: 12px 0;
}
.incident.critical {
  border-left-color: #c64e58;
}
[aria-invalid="true"] {
  border: 2px solid #bf4135;
  background: #fff5f3;
}
.field-error {
  display: block;
  margin-top: 5px;
  color: #af3329;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.form-errors {
  border: 1px solid #e2b2ab;
  background: #fff4f1;
  padding: 10px 12px;
  border-radius: 7px;
  color: #a5382d;
  margin-bottom: 16px;
}
dialog {
  width: min(460px, calc(100vw - 28px));
  border: 1px solid #d9e1ec;
  border-radius: 12px;
  padding: 22px;
  color: #233249;
  box-shadow: 0 18px 65px #18253b30;
}
dialog::backdrop {
  background: #1b2b4555;
}
dialog .row {
  justify-content: flex-end;
}
@media (min-width: 1100px) {
  .detail {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
  .preview-card {
    grid-column: 2;
    grid-row: 2;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow: auto;
  }
}
@media (max-width: 760px) {
  main {
    padding: 16px 14px;
  }
  header {
    padding: 12px 14px;
  }
  h1 {
    font-size: 22px;
  }
  .card {
    padding: 16px;
  }
  #nav-toggle {
    display: inline-block;
    margin: 8px 0 16px;
  }
  .workspace-nav {
    display: none;
    margin: 0 0 18px;
  }
  .workspace-nav.is-open {
    display: flex;
  }
  .intro {
    align-items: flex-start;
  }
  .intro > button {
    width: 100%;
  }
  .intro p {
    font-size: 12px;
  }
  .row > label {
    flex-basis: 100%;
  }
  .row {
    gap: 0 10px;
  }
  .row > button {
    margin-top: 0;
  }
  .editor-navigation {
    gap: 10px;
  }
  .editor-tabs {
    gap: 2px;
  }
  .editor-tabs button {
    padding: 7px 8px;
    font-size: 12px;
  }
  .section-heading {
    gap: 8px;
  }
  .section-heading h2 {
    width: 100%;
  }
  .selection-bar span {
    width: 100%;
  }
  .keyboard-row-editor {
    padding: 10px;
  }
  .preview-card {
    position: static;
  }
  .table-scroll {
    width: 100%;
  }
  .filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.notice-close {
  position: absolute;
  top: 4px;
  right: 4px;
  min-height: 30px;
  padding: 2px 8px;
  border: 0;
  background: transparent;
}
.schedule-overview {
  background: #eef4ff;
  border: 1px solid #cbd9ee;
  border-radius: 8px;
  padding: 12px;
  line-height: 1.65;
}

/* Shared readable tables, help, and step-by-step editing. */
fieldset:disabled {
  opacity: 1;
}
fieldset:disabled input,
fieldset:disabled select,
fieldset:disabled textarea {
  color: #43516a;
  -webkit-text-fill-color: #43516a;
  background: #f5f7fa;
  opacity: 1;
}
.table-detail-action {
  text-align: right;
  white-space: nowrap;
}
.table-detail-action button {
  min-height: 32px;
}
.table-detail-row > td {
  padding: 0;
  background: #f5f8fc;
}
.table-detail-content {
  padding: 16px 20px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.table-detail-content p {
  margin: 0 0 10px;
}
.table-detail-content .inline-details {
  grid-template-columns: minmax(160px, 1fr) minmax(70px, 1fr);
  max-width: 760px;
}
.field-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}
.help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  width: 22px;
  flex: 0 0 22px;
  padding: 0;
  border: 1px solid #acbbd4;
  border-radius: 50%;
  color: #405b83;
  background: #f2f6fc;
  font-size: 12px;
  line-height: 1;
}
.help-popup {
  position: fixed;
  inset: auto;
  margin: 0;
  z-index: 1000;
  max-width: min(340px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  border: 1px solid #b9c9e2;
  border-radius: 10px;
  background: #192e4b;
  color: white;
  padding: 14px 16px;
  box-shadow: 0 8px 28px #14283b33;
  font-size: 13px;
  line-height: 1.55;
}
.help-popup::backdrop {
  background: transparent;
}
.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.review-summary {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  gap: 10px 18px;
}
.review-summary dt {
  color: #5c6e86;
}
.review-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.review-variant {
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}
.review-variant summary {
  font-weight: 600;
}
.review-message {
  white-space: pre-wrap;
}
.review-ids,
.review-variant p {
  overflow-wrap: anywhere;
}
#review-edit {
  margin-bottom: 20px;
}
.detail[data-step="review"] #actions {
  grid-column: 1;
  grid-row: 2;
}
@media (max-width: 1099px) {
  .detail[data-step="review"] .preview-card {
    grid-row: 3;
  }
}
@media (max-width: 600px) {
  .review-summary {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .review-summary dd {
    margin-bottom: 12px;
  }
  .wizard-actions > button {
    flex: 1 1 140px;
  }
  .table-detail-content {
    padding: 12px;
  }
}

.review-media {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
  margin: 12px 0;
  object-fit: contain;
}

/* Search lists stay above cards and remain usable on narrow screens. */
.timezone-control {
  margin: 0;
  display: flex;
  min-width: 0;
  position: relative;
}
.timezone-control .timezone-picker {
  min-width: 0;
  padding-right: 40px;
}
.timezone-toggle {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  min-height: 0;
  padding: 0 12px;
  border: 0;
  background: transparent;
}
.timezone-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: white;
  box-shadow: 0 12px 40px #17314b33;
  z-index: 10000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}
.timezone-menu[hidden] {
  display: none;
}
.timezone-menu > input {
  flex: none;
}
.timezone-options {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
}
.timezone-options button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.timezone-options button:hover,
.timezone-options button.highlighted {
  background: #e8efff;
}
.timezone-options [aria-selected="true"] {
  font-weight: 600;
  background: #f0f4fc;
}
.admin-preferences {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-zone-panel {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}
time[data-admin-time] {
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  header {
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
  }
  .admin-preferences {
    align-items: flex-start;
    flex-wrap: wrap;
    max-width: 100%;
  }
  .admin-zone-panel {
    min-width: 0;
  }
}

.raw-response {
  margin: 12px 0;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 0;
}
.raw-response pre {
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f6f7fa;
  padding: 12px;
  border-radius: 6px;
  font-size: 12px;
}
.raw-response button {
  margin-right: 12px;
}

/* Full-row details must not inherit the compact single-cell details width. */
.table-detail-content details {
  width: 100%;
  max-width: none;
  min-width: 0;
}

/* Audience editor belongs to its full-width detail row, not a side column. */
.audience-layout {
  display: block;
}
.audience-layout #audience-form {
  min-width: 0;
  width: 100%;
}
.audience-layout .table-detail-content {
  min-width: 0;
}
#settings-section .subnav {
  margin-bottom: 20px;
}
#settings-admin .admin-zone-panel {
  max-width: 580px;
}
#queue-sender:not(:empty) {
  padding: 12px;
  background: #fff3da;
  margin-bottom: 12px;
  border-radius: 8px;
}
