:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7f7;
  color: #142626;
  --line: #d5dfdf;
  --accent: #085d54;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
body > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(18px, 4vw, 58px);
  background: #123937;
  color: white;
}
h1 { margin: 0; font-size: clamp(1.2rem, 4vw, 1.55rem); font-weight: 660; }
h2 { margin: 0 0 .6em; overflow-wrap: anywhere; }
main { max-width: 1560px; margin: auto; padding: clamp(12px, 3vw, 32px); }
form, article, .index { background: white; border: 1px solid var(--line); border-radius: 12px; }
label { display: grid; gap: 6px; color: #385452; font-size: .88rem; font-weight: 620; }
button, input, select { font: inherit; }
button, input, select { min-height: 40px; border-radius: 7px; }
button { padding: 7px 14px; border: 1px solid var(--line); background: white; color: var(--accent); cursor: pointer; }
button:hover { background: #eaf5f3; }
button:disabled { opacity: .58; cursor: wait; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #007c70; outline-offset: 2px; }
input, select { width: 100%; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); background: #fff; color: #142626; }
button[type="submit"] { background: var(--accent); color: white; border-color: var(--accent); font-weight: 660; }
#login { max-width: 400px; padding: 24px; display: grid; gap: 9px; margin: min(8vh, 54px) auto; }
#login button { margin-top: 8px; }
#login-status { margin: 0; color: #8b2d26; overflow-wrap: anywhere; }
#filters { display: grid; align-items: end; grid-template-columns: minmax(170px, 1fr) 135px minmax(180px, 1.5fr) auto; gap: 12px; padding: 14px; }
.panes { display: flex; align-items: start; gap: 16px; margin-top: 16px; }
.index { flex: 1 1 40%; min-width: 0; overflow: hidden; }
article { flex: 1 1 60%; min-width: 0; padding: 21px; position: sticky; top: 10px; }
#status { color: #486361; padding: 12px 14px; margin: 0; font-size: .9rem; }
#messages { list-style: none; margin: 0; padding: 0; }
.message { display: grid; text-align: left; width: 100%; gap: 4px; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 12px 14px; color: inherit; }
.message strong, .sender, .meta { overflow-wrap: anywhere; }
.sender { font-size: .91rem; }
.meta { color: #486361; font-size: .82rem; }
#more { margin: 12px 14px; }
.close { margin-bottom: 16px; }
.letter { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 68vh; overflow: auto; padding-bottom: 12px; line-height: 1.55; }
.read-on { display: block; margin-top: 12px; }
@media (max-width: 720px) {
  #filters { grid-template-columns: minmax(0, 1fr) minmax(100px, .6fr); }
  #filters .search { grid-column: 1; }
  .panes { display: block; }
  article { position: fixed; inset: 0; z-index: 1; border-radius: 0; overflow: auto; padding: 16px; }
  .letter { max-height: none; overflow: visible; }
}
