:root {
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f3ed;
  color: #17211e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  min-height: 100vh;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 48px);
}

.shell--split,
.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: start;
}

.client-panel,
.send-panel,
.list-panel,
.intro,
.route-list {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid #d4d5c9;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 18px 50px rgba(35, 38, 30, 0.09);
}

.client-panel {
  max-width: 760px;
  margin: 0 auto;
}

.intro {
  box-shadow: none;
}

.route-list {
  align-content: start;
}

.eyebrow {
  margin: 0;
  color: #176b5b;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

.muted {
  margin: 0;
  color: #5e6963;
}

h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.status-strip div {
  min-height: 82px;
  padding: 14px;
  border: 1px solid #d9ddd2;
  border-radius: 8px;
  background: #fbfbf8;
}

.status-strip span {
  display: block;
  margin-bottom: 8px;
  color: #5e6963;
  font-size: 13px;
}

.status-strip strong {
  font-size: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.message-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #176b5b;
  border-radius: 6px;
  color: #176b5b;
  text-decoration: none;
}

.badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #c9252d;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.reply-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #176b5b;
  border-radius: 6px;
  background: #176b5b;
  color: #fff;
  cursor: pointer;
}

button.secondary,
button.ghost {
  background: #fff;
  color: #176b5b;
}

button.ghost {
  border-color: transparent;
}

button:disabled {
  border-color: #c9cec6;
  background: #e9ece6;
  color: #7b837e;
  cursor: not-allowed;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: #5e6963;
  font-size: 14px;
}

input {
  min-height: 46px;
}

input,
textarea {
  min-height: 46px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid #c9cec6;
  border-radius: 6px;
}

textarea {
  min-height: 112px;
  padding: 12px;
  resize: vertical;
}

.log {
  min-height: 180px;
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: #17211e;
  color: #eef4ee;
  white-space: pre-wrap;
  word-break: break-word;
}

.route {
  display: block;
  padding: 18px;
  border: 1px solid #c9cec6;
  border-radius: 8px;
  color: #17211e;
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
}

.list-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.checkline input,
.recipient input {
  width: 18px;
  min-height: 18px;
  accent-color: #176b5b;
}

.subscription-list {
  display: grid;
  gap: 10px;
}

.recipient {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #d4d5c9;
  border-radius: 8px;
  background: #fbfbf6;
}

.recipient-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.recipient-main small {
  color: #5e6963;
  overflow-wrap: anywhere;
}

code {
  color: #176b5b;
  font-size: 12px;
}

.empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed #b8beb4;
  border-radius: 8px;
  color: #5e6963;
}

.reply-heading {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #d4d5c9;
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #d4d5c9;
  border-radius: 8px;
  background: #fbfbf6;
}

.event-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.event-card p,
.reply-empty {
  margin: 0;
  color: #45514b;
}

.event-card small,
.reply-list span {
  color: #5e6963;
}

.reply-list {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.reply-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #eef3ec;
}

.message-list {
  display: grid;
  gap: 10px;
}

.message-item {
  border: 1px solid #d4d5c9;
  border-radius: 8px;
  background: #fbfbf6;
}

.message-item--unread {
  border-color: #c9252d;
}

.message-item a {
  display: grid;
  gap: 7px;
  padding: 14px;
  color: #17211e;
  text-decoration: none;
}

.message-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.red-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #c9252d;
}

.message-item small {
  color: #5e6963;
}

.reply-list--grouped li {
  align-items: start;
}

.reply-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.reply-main small {
  overflow-wrap: anywhere;
}

.admin-dark {
  min-height: 100vh;
  background: #0f1513;
  color: #eef5ef;
}

.admin-dark .send-panel,
.admin-dark .list-panel {
  border-color: #26332f;
  background: #161f1c;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

.admin-dark .eyebrow,
.admin-dark code {
  color: #69d2b3;
}

.admin-dark .field span,
.admin-dark .recipient-main small,
.admin-dark .event-card small,
.admin-dark .reply-list span,
.admin-dark .event-card p,
.admin-dark .reply-empty,
.admin-dark .empty {
  color: #aab8b0;
}

.admin-dark input,
.admin-dark textarea {
  border-color: #34433e;
  background: #0f1513;
  color: #eef5ef;
}

.admin-dark input:focus,
.admin-dark textarea:focus {
  outline: 2px solid #69d2b3;
  outline-offset: 2px;
}

.admin-dark button {
  border-color: #69d2b3;
  background: #69d2b3;
  color: #0f1513;
}

.admin-dark button.secondary,
.admin-dark button.ghost {
  background: transparent;
  color: #69d2b3;
}

.admin-dark button.ghost {
  border-color: transparent;
}

.admin-dark button:disabled {
  border-color: #34433e;
  background: #202a26;
  color: #66746d;
}

.admin-dark .log {
  border: 1px solid #26332f;
  background: #0b100e;
  color: #d7f5e6;
}

.admin-dark .recipient,
.admin-dark .event-card {
  border-color: #34433e;
  background: #101815;
}

.admin-dark .reply-list li {
  background: #1d2a25;
}

.admin-dark .reply-heading {
  border-top-color: #34433e;
}

.admin-dark .empty {
  border-color: #34433e;
}

.admin-dark .checkline input,
.admin-dark .recipient input {
  accent-color: #69d2b3;
}

@media (max-width: 640px) {
  .shell {
    padding: 14px;
  }

  .shell--split,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
  }

  .reply-actions {
    grid-template-columns: 1fr;
  }

  .recipient {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .recipient code {
    grid-column: 2;
  }
}
