body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f7fb;
  color: #172033;
}

.panel {
  max-width: 1100px;
  margin: 32px auto;
  background: #fff;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  padding: 24px;
}

.narrow {
  max-width: 420px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  margin: 0 0 18px;
  font-size: 24px;
  line-height: 1.25;
}

h2 {
  margin-top: 24px;
  font-size: 18px;
}

form.search {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

input, select, button {
  height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 14px;
}

input {
  min-width: 280px;
}

button {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  padding: 10px;
  vertical-align: top;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 12px;
}

iframe {
  width: 100%;
  height: 360px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
}

.badge {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
}

.otp-cell {
  min-width: 142px;
}

.otp-empty {
  color: #94a3b8;
}

.copy-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 0 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.copy-code:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.copy-code-value {
  color: #0f172a;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}

.copy-code-label {
  color: #2563eb;
  font-size: 12px;
}

.message-panel {
  max-width: 960px;
  padding: 0;
  overflow: hidden;
}

.message-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #fbfdff;
}

.message-header h1 {
  margin: 14px 0 0;
  max-width: 760px;
  font-size: 26px;
  color: #111827;
}

.back-link {
  display: inline-flex;
  align-items: center;
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

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

.otp-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #14532d;
}

.otp-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.otp-code {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.copy-code-large {
  border-color: #86efac;
  background: #fff;
  color: #166534;
}

.copy-code-large:hover {
  border-color: #4ade80;
  background: #dcfce7;
}

.copy-code-large .copy-code-label {
  color: #166534;
}

.message-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0;
  padding: 0 24px;
  border-bottom: 1px solid #e5e7eb;
}

.message-meta div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #eef2f7;
}

.message-meta div:last-child {
  border-bottom: 0;
}

.message-meta dt {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.message-meta dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #172033;
  font-size: 14px;
}

.message-body {
  padding: 20px 24px 24px;
  background: #f8fafc;
}

.email-preview {
  display: block;
  width: 100%;
  min-height: 640px;
  height: 70vh;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.email-fallback {
  min-height: 240px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  padding: 22px;
  background: #fff;
  color: #172033;
  font-size: 15px;
  line-height: 1.6;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

@media (max-width: 720px) {
  .panel {
    margin: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .message-header,
  .message-meta,
  .message-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .message-header h1 {
    font-size: 22px;
  }

  .message-meta div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .otp-card {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .email-preview {
    min-height: 560px;
    height: 72vh;
  }
}
