:root {
  color-scheme: light;
  --ink: #181c1a;
  --muted: #69716c;
  --paper: #f4f3ee;
  --card: #fffef9;
  --line: #dedfd8;
  --green: #315f4b;
  --green-soft: #dce8df;
  --amber: #a76a26;
  --red: #a4493e;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 20px max(48px, env(safe-area-inset-bottom));
}
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.eyebrow { margin: 0 0 5px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(29px, 6vw, 42px); font-weight: 500; letter-spacing: -.03em; }
h2 { margin: 18px 0 8px; font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.muted { color: var(--muted); line-height: 1.55; }

.login-card, .summary-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(29, 42, 35, .06);
}
.login-card { margin-top: 8vh; }
.status-dot { color: var(--muted); font-size: 13px; font-weight: 700; }
.status-dot span { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: #55a075; }
label { display: block; margin: 25px 0 8px; font-size: 13px; font-weight: 700; }
input { width: 100%; padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); outline: none; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49, 95, 75, .12); }
.primary, .secondary { border: 0; border-radius: 12px; padding: 12px 17px; font-weight: 750; }
.primary { width: 100%; margin-top: 13px; background: var(--ink); color: white; }
.secondary { background: var(--green-soft); color: #224937; white-space: nowrap; }
.text-button { border: 0; background: transparent; color: var(--muted); padding: 8px; }
.error { min-height: 20px; margin: 11px 0 0; color: var(--red); font-size: 13px; }

.summary-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.summary { margin: 0; font-family: Georgia, serif; font-size: 21px; line-height: 1.35; }
.notice { margin-top: 14px; padding: 14px 16px; border-radius: 13px; background: #eee8d9; color: #66522f; font-size: 14px; line-height: 1.45; }
.filters { display: flex; gap: 7px; margin: 24px 0 15px; overflow-x: auto; }
.filter { border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; background: transparent; color: var(--muted); white-space: nowrap; }
.filter.active { border-color: var(--ink); background: var(--ink); color: white; }
.messages { display: grid; gap: 10px; }
.message { position: relative; padding: 19px 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--card); }
.message.unread { border-left: 4px solid var(--green); }
.message.urgent { border-left-color: var(--red); }
.message.important { border-left-color: var(--amber); }
.message-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.source { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.message h3 { margin: 0 0 7px; font-size: 17px; line-height: 1.3; }
.message p { margin: 0; color: #505751; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.message-preview { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.tag { border-radius: 999px; padding: 5px 8px; background: #eef0eb; color: #5c655f; font-size: 11px; font-weight: 700; }
.message-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 15px; }
.read-button, .report-button, .delete-button { border: 0; padding: 0; background: transparent; font-size: 13px; font-weight: 750; }
.read-button, .report-button { color: var(--green); }
.delete-button { color: var(--red); }
.report-dialog { width: min(calc(100% - 24px), 620px); max-height: calc(100dvh - 28px); overflow: auto; padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 80px rgba(13, 20, 16, .3); }
.report-dialog::backdrop { background: rgba(13, 20, 16, .48); backdrop-filter: blur(3px); }
.dialog-shell { padding: 22px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-header > div { display: grid; gap: 4px; }
.dialog-close { border: 0; border-radius: 999px; padding: 8px 12px; background: var(--green-soft); color: #224937; font-weight: 750; }
.report-dialog h2 { margin: 20px 0 12px; font-family: Georgia, serif; font-size: 25px; line-height: 1.2; }
.dialog-body { margin: 0; color: #3f4741; font-size: 15px; line-height: 1.65; white-space: pre-wrap; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.dialog-actions .secondary { width: auto; }
.empty { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 8px; color: var(--ink); font-family: Georgia, serif; font-size: 22px; }
.empty span { font-size: 14px; }

@media (max-width: 560px) {
  .shell { padding-left: 15px; padding-right: 15px; }
  .summary-card { align-items: flex-start; flex-direction: column; }
  .secondary { width: 100%; }
}
