:root {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel-strong: #f6f8fc;
  --text: #172033;
  --muted: #667085;
  --line: #d6dce8;
  --accent: #1457d9;
  --accent-strong: #0b3ea6;
  --success: #17784d;
  --danger: #9f1239;
  --warning: #8a5a00;
  --neutral: #4b5563;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(20, 87, 217, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(23, 120, 77, 0.12), transparent 24%),
    linear-gradient(180deg, #f9fbff, var(--bg));
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-end;
  padding: 18px 0 24px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: var(--muted);
}

h1, h2, h3, strong { font-family: "Trebuchet MS", "Segoe UI", sans-serif; }

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nav a, .button-link, button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(23, 32, 51, 0.06);
}

.nav a:hover, .button-link:hover, button:hover { border-color: var(--accent); }

.content { display: grid; gap: 20px; }

.card, .status-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.status-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.state-block {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.state-note { max-width: 360px; text-align: right; }

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

.alert { padding: 12px 14px; border-radius: 14px; background: var(--panel-strong); border: 1px solid var(--line); }
.alert.success { border-color: rgba(23, 120, 77, 0.25); color: var(--success); }
.alert.error { border-color: rgba(159, 18, 57, 0.25); color: var(--danger); }
.alert.warning { border-color: rgba(138, 90, 0, 0.25); color: var(--warning); }

.muted { color: var(--muted); }

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

.form-grid .full-width { grid-column: 1 / -1; }

label { display: grid; gap: 7px; font-family: "Trebuchet MS", "Segoe UI", sans-serif; }

input, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
}

textarea { resize: vertical; }

button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
}

button {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: white;
  border-color: transparent;
}

.ghost, .ghost-link {
  background: transparent;
  color: var(--text);
}

.inline-form { margin-top: 16px; }

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.86rem;
  border: 1px solid var(--line);
}

.pill.not_certified { color: var(--neutral); background: rgba(75, 85, 99, 0.08); }
.pill.certified_untrusted { color: var(--warning); background: rgba(138, 90, 0, 0.08); }
.pill.certified_trusted { color: var(--success); background: rgba(23, 120, 77, 0.08); }

.recipient-list, .message-list { display: grid; gap: 14px; }

.recipient-item, .message {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: var(--panel);
}

.recipient-item {
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr auto auto;
  align-items: start;
}

.recipient-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.recipient-details {
  display: grid;
  gap: 4px;
}

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

.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mono, .prewrap { font-family: Consolas, "Courier New", monospace; }
.prewrap { white-space: pre-wrap; word-break: break-word; padding: 16px; background: #f7f9fd; border-radius: 16px; border: 1px solid var(--line); }

.callout {
  padding: 16px;
  border-radius: 18px;
  background: #f7f9fd;
  border: 1px solid var(--line);
  margin-bottom: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.issue-form {
  display: grid;
  gap: 10px;
  min-width: min(100%, 360px);
}

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

.hint-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

ol { padding-left: 20px; }

@media (max-width: 760px) {
  .topbar, .status-card, .message-head, .recipient-item { grid-template-columns: 1fr; display: grid; align-items: start; }
  .form-grid { grid-template-columns: 1fr; }
  .state-block { justify-items: start; }
  .state-note { text-align: left; }
  .recipient-actions { justify-content: flex-start; }
}
