:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, sans-serif;
  color: #1c2c2a;
  background: #f3f6f3;
  --muted: #526762;
  --line: #dce6df;
  --accent: #174f43;
  --surface: #fff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #238168; outline-offset: 3px; }

.topbar {
  min-height: 72px;
  padding: .8rem max(1.25rem, calc((100vw - 68rem) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.wordmark { display: flex; align-items: center; gap: .65rem; font-size: .97rem; font-weight: 700; }
.mark {
  width: 2.125rem;
  height: 2.125rem;
  display: grid;
  place-items: center;
  border-radius: .65rem;
  background: #e2f1e9;
  color: var(--accent);
  font-size: 1.15rem;
}
main { width: min(100% - 2rem, 52rem); margin: 0 auto; padding: clamp(2rem, 9vh, 5.5rem) 0 2.5rem; }
.panel {
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: 0 12px 32px #1539290b;
}
.login { max-width: 28rem; margin: 0 auto; padding: clamp(1.25rem, 6vw, 2.4rem); }
h1 { margin: 0; font-size: clamp(1.5rem, 5vw, 2rem); letter-spacing: -.035em; line-height: 1.15; overflow-wrap: anywhere; }
.description { margin: .65rem 0 0; color: var(--muted); line-height: 1.5; }
.digits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.5rem, 2vw, .85rem); margin: 1.8rem 0 1.3rem; }
.digits input {
  width: 100%; height: 3.7rem; border: 1px solid #b9cbc3; border-radius: .7rem;
  background: #f7faf8; color: var(--accent); text-align: center; font: 700 1.6rem ui-monospace, monospace;
}
.digits input:focus { border-color: var(--accent); background: white; }
.primary {
  width: 100%; min-height: 3rem; display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; border: 0; border-radius: .65rem; padding: .7rem 1rem;
  background: var(--accent); color: white; font-weight: 650;
}
.primary:hover:enabled { background: #103d34; }
.status { min-height: 1.25rem; margin: .8rem 0 0; font-size: .88rem; color: var(--muted); }
.status.error { color: #9b3026; }
.inbox { padding: clamp(1.1rem, 4vw, 2.2rem); }
.section-header { display: flex; justify-content: space-between; align-items: start; gap: 1rem; flex-wrap: wrap; }
.quiet {
  padding: .52rem .76rem; border: 1px solid var(--line); border-radius: .55rem;
  background: var(--surface); color: var(--accent); font-size: .88rem; font-weight: 650;
}
.quiet:hover:enabled { background: #eef5f0; }
.inbox-status { margin: .85rem 0 0; color: var(--muted); }
.inbox-status:empty { margin: 0; }
.mail-list, .attachments ul { list-style: none; padding: 0; margin: 0; }
.mail-list:not(:empty) { margin-top: 1.4rem; border-top: 1px solid var(--line); }
.mail-row {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem 1rem;
  border: 0; border-bottom: 1px solid var(--line); padding: .85rem .25rem;
  background: var(--surface); color: inherit; text-align: left;
}
.mail-row:hover { background: #f5f9f6; }
.mail-subject { font-weight: 680; overflow-wrap: anywhere; }
.mail-time, .mail-address { color: var(--muted); font-size: .82rem; }
.mail-address { grid-column: 1 / -1; overflow-wrap: anywhere; }
.more { margin-top: 1rem; }
.back { margin-bottom: 1.3rem; }
.envelope {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem .8rem;
  margin: 1.3rem 0; color: var(--muted); font-size: .9rem;
}
.envelope dt { font-weight: 650; }
.envelope dd { margin: 0; overflow-wrap: anywhere; }
.mail-text { border-top: 1px solid var(--line); padding-top: 1.2rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.attachments { border-top: 1px solid var(--line); margin-top: 1.4rem; padding-top: 1rem; }
.attachments h2 { margin: 0 0 .5rem; font-size: 1rem; }
.attachments li + li { margin-top: .45rem; }
.attachments a { color: var(--accent); overflow-wrap: anywhere; }
footer { width: min(100% - 2rem, 28rem); margin: 0 auto 2rem; color: var(--muted); font-size: .82rem; }
.privacy summary { width: fit-content; cursor: pointer; }
.privacy p { line-height: 1.5; }
.privacy a { color: var(--accent); }

@media (max-width: 440px) {
  .topbar { min-height: 60px; }
  .mail-row { grid-template-columns: 1fr; }
  .mail-address { grid-column: auto; }
  .digits input { height: 3.3rem; }
}
