:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f9;
  color: #172033;
}

body {
  margin: 0;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  box-sizing: border-box;
}

.shell.legal-shell {
  place-items: start center;
}

.panel {
  width: min(680px, 100%);
  background: #fff;
  border: 1px solid #dce3ef;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 48px rgba(24, 38, 61, 0.08);
}

.panel.legal-panel {
  width: min(900px, 100%);
}

.legal-panel h2 {
  margin: 28px 0 10px;
  font-size: 20px;
}

.legal-panel p,
.legal-panel li {
  line-height: 1.58;
}

.legal-panel ul {
  margin: 10px 0 0;
  padding-left: 22px;
  color: #52627a;
}

.legal-meta {
  margin-top: 8px;
  color: #697993;
  font-size: 14px;
}

.legal-link {
  color: #1777f2;
  font-weight: 700;
  text-decoration: none;
}

.legal-link:hover {
  text-decoration: underline;
}

.topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.12;
}

p {
  margin: 0;
  color: #52627a;
}

.status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 11px;
  background: #edf2f7;
  color: #41516a;
  font-size: 13px;
  font-weight: 750;
}

.status.ok {
  background: #e8f8ee;
  color: #158047;
}

.status.warn {
  background: #fff5d9;
  color: #875d00;
}

.status.error {
  background: #fde8e8;
  color: #b42318;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  background: #1777f2;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

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

.secondary {
  min-height: 36px;
  padding: 0 14px;
  background: #e8eef7;
  color: #172033;
  font-size: 13px;
}

.primary {
  width: 100%;
  font-size: 16px;
}

.admin-alert {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  border: 1px solid #f4a6a6;
  border-left: 4px solid #d92d20;
  border-radius: 6px;
  padding: 12px 14px;
  background: #fff7f7;
  color: #172033;
}

.admin-alert strong {
  color: #8a1f17;
}

.admin-alert p {
  color: #4a5568;
  line-height: 1.35;
}

.admin-alert span {
  color: #697993;
  font-size: 12px;
  font-weight: 700;
}

.admin-alert-action {
  justify-self: start;
  margin-top: 4px;
}

.compact-alert {
  margin-top: 10px;
  padding: 10px 12px;
}

.qr-box {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 20px;
  align-items: center;
  border: 1px solid #dce3ef;
  border-radius: 8px;
  padding: 18px;
  margin-top: 20px;
  background: #f8fbff;
}

.qr-frame {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #52627a;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.qr-box img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}

.qr-box strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.details {
  margin-top: 22px;
  border-top: 1px solid #e4e9f2;
  padding-top: 16px;
}

summary {
  cursor: pointer;
  color: #52627a;
  font-weight: 700;
}

#failed-jobs-count {
  color: #b42318;
}

.details-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.failed-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  color: #52627a;
  font-size: 13px;
}

.failed-item {
  display: grid;
  gap: 4px;
  border-left: 3px solid #f04438;
  padding: 10px 12px;
  background: #fff7f7;
  border-radius: 6px;
}

.failed-item.warn {
  border-left-color: #f7b955;
  background: #fffaf0;
}

.failed-item.error {
  border-left-color: #f04438;
  background: #fff7f7;
}

.failed-item strong {
  color: #172033;
  overflow-wrap: anywhere;
}

.failed-item span {
  color: #697993;
}

.failed-item p {
  overflow-wrap: anywhere;
  color: #8a1f17;
}

.media-list {
  display: grid;
  gap: 4px;
  margin: 4px 0 0;
  padding-left: 18px;
  color: #52627a;
}

.media-list li {
  overflow-wrap: anywhere;
}

.failed-retry {
  justify-self: start;
  margin-top: 4px;
}

.contact-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  color: #52627a;
  font-size: 13px;
}

.contact-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid #e4e9f2;
  border-radius: 6px;
  padding: 10px 12px;
  background: #f8fbff;
}

.contact-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8eef7;
  color: #52627a;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
}

.contact-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.contact-body strong,
.contact-body span {
  overflow-wrap: anywhere;
}

.contact-body strong {
  color: #172033;
}

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

.queue-cell {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid #e4e9f2;
  border-radius: 6px;
  padding: 10px 12px;
  background: #f8fbff;
}

.queue-cell strong {
  color: #172033;
  font-size: 20px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.queue-cell span {
  color: #52627a;
  font-size: 12px;
  font-weight: 700;
}

.queue-cell.warn {
  border-color: #f7d98b;
  background: #fffaf0;
}

.queue-cell.error {
  border-color: #f4a6a6;
  background: #fff7f7;
}

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

.message-cell {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid #e4e9f2;
  border-radius: 6px;
  padding: 10px 12px;
  background: #f8fbff;
}

.message-cell strong {
  color: #172033;
  font-size: 20px;
  line-height: 1;
}

.message-cell span {
  color: #52627a;
  font-size: 12px;
  font-weight: 700;
}

.message-cell.warn {
  border-color: #f7d98b;
  background: #fffaf0;
}

.message-cell.error {
  border-color: #f4a6a6;
  background: #fff7f7;
}

.communication-cell strong {
  font-size: 14px;
  line-height: 1.2;
}

.communication-cell span {
  line-height: 1.25;
}

.communication-cell em {
  color: #697993;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.media-type-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.media-type-row {
  display: grid;
  gap: 3px;
  border: 1px solid #e4e9f2;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
}

.media-type-row strong {
  color: #172033;
  overflow-wrap: anywhere;
}

.media-type-row span {
  color: #52627a;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.media-type-row em {
  color: #8a5a00;
  font-size: 12px;
  font-style: normal;
}

.media-type-row.warn {
  border-color: #f7d98b;
  background: #fffaf0;
}

.media-type-row.error {
  border-color: #f4a6a6;
  background: #fff7f7;
}

.runtime-diagnostics {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
}

.runtime-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid #e4e9f2;
  border-radius: 6px;
  padding: 9px 11px;
  background: #f8fbff;
}

.runtime-row span {
  color: #52627a;
  font-weight: 700;
}

.runtime-row strong {
  color: #172033;
  overflow-wrap: anywhere;
}

.runtime-row.ok {
  border-color: #b8e5ca;
  background: #f1fbf5;
}

.runtime-row.warn {
  border-color: #f7d98b;
  background: #fffaf0;
}

.runtime-row.error {
  border-color: #f4a6a6;
  background: #fff7f7;
}

form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

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

input {
  min-height: 40px;
  border: 1px solid #cad4e2;
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
}

pre {
  overflow: auto;
  background: #101828;
  color: #d8e8ff;
  border-radius: 6px;
  padding: 14px;
  min-height: 72px;
  margin-top: 16px;
}

@media (max-width: 680px) {
  .topline {
    display: grid;
  }

  .qr-box {
    grid-template-columns: 1fr;
  }

  .qr-frame {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

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

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

  .runtime-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
