:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --border: #2a2f3a;
  --text: #e6e8ef;
  --muted: #8a92a5;
  --accent: #6aa7ff;
  --accent-bg: #1f3a66;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.logo {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 1.15rem;
}
.logo span { color: var(--accent); }

.inbox-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.inbox-form input[type=text] {
  padding: 0.5rem 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  min-width: 160px;
}
.inbox-form .at { color: var(--muted); }
.inbox-form button {
  padding: 0.5rem 0.9rem;
  background: var(--accent);
  color: #0b1220;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

.hero { text-align: center; padding: 3rem 1rem; }
.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.hero code {
  background: var(--panel);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  color: var(--accent);
}
.hero .small { color: var(--muted); margin-top: 2rem; font-size: 0.9rem; }

.inbox h1, .message h1 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  word-break: break-all;
}

table.messages {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border-radius: 6px;
  overflow: hidden;
}
table.messages th, table.messages td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
table.messages th { color: var(--muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
table.messages tr { cursor: pointer; }
table.messages tbody tr:hover { background: var(--accent-bg); }
table.messages tr:last-child td { border-bottom: none; }

.refresh { margin-top: 1rem; text-align: right; }
.refresh a, .message a { color: var(--accent); text-decoration: none; }
.refresh a:hover, .message a:hover { text-decoration: underline; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
  background: var(--panel);
  border-radius: 6px;
}

dl.meta {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.3rem 1rem;
  margin-bottom: 1rem;
  background: var(--panel);
  padding: 0.9rem;
  border-radius: 6px;
}
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; word-break: break-word; }

.body-tabs iframe {
  width: 100%;
  min-height: 500px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

pre.body-text, details pre {
  background: var(--panel);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
}

details.headers, details { margin-top: 1rem; }
details summary { cursor: pointer; color: var(--muted); padding: 0.4rem 0; }

.attachments {
  padding: 0.8rem;
  margin-bottom: 1rem;
  background: var(--panel);
  border-radius: 6px;
}
.attachments a {
  display: inline-block;
  margin-right: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

.legal {
  max-width: 900px;
  margin: 3rem auto 1rem;
  padding: 0 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.legal .warning {
  background: rgba(229, 38, 58, 0.08);
  border: 1px solid rgba(229, 38, 58, 0.4);
  border-left: 4px solid #e5263a;
  border-radius: 6px;
  padding: 1rem 1.4rem;
}

.legal .warning h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: #ff8090;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.legal .warning ul {
  margin: 0;
  padding-left: 1.2rem;
  color: #cfd3dd;
}

.legal .warning li {
  margin-bottom: 0.35rem;
}

.legal .warning strong {
  color: var(--text);
}

.legal .full-terms {
  margin-top: 1.2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.legal .full-terms summary {
  padding: 0.8rem 1.2rem;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  list-style: none;
}

.legal .full-terms summary::-webkit-details-marker { display: none; }

.legal .full-terms summary::after {
  content: "▸";
  float: right;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.legal .full-terms[open] summary::after {
  transform: rotate(90deg);
  display: inline-block;
}

.legal .terms-content {
  padding: 0.2rem 1.4rem 1.4rem;
  color: #cfd3dd;
  border-top: 1px solid var(--border);
}

.legal .terms-content h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin-top: 1.4rem;
  margin-bottom: 0.4rem;
}

.legal .terms-content p,
.legal .terms-content ul {
  margin: 0.4rem 0;
}

.legal .terms-content a {
  color: var(--accent);
  text-decoration: none;
}
.legal .terms-content a:hover { text-decoration: underline; }

footer {
  text-align: center;
  padding: 2rem 1rem;
}
.footer-logo {
  max-width: 360px;
  height: auto;
  opacity: 0.95;
}
