:root {
  --bg: #0f172a;
  --card: #1e293b;
  --line: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --danger: #f87171;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
header { text-align: center; padding: 28px 12px 6px; }
header h1 { margin: 0; font-size: 1.8rem; }
.sub { color: var(--muted); margin: 6px 0 0; }
main { max-width: 1080px; margin: 0 auto; padding: 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.addr-row { margin-top: 10px; }
.addr-row code {
  flex: 1; background: #0b1220; border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; font-size: 0.95rem;
  overflow-x: auto; white-space: nowrap;
}
input, textarea {
  background: #0b1220; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; font-size: 0.95rem;
}
input { flex: 1; min-width: 180px; }
textarea { width: 100%; resize: vertical; }
button {
  background: var(--accent); color: #06202e; border: none;
  border-radius: 8px; padding: 9px 16px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
button:hover { filter: brightness(1.1); }
button.danger { background: var(--danger); color: #2e0606; margin-top: 12px; }
.hint { color: var(--muted); font-size: 0.85rem; }
.badge {
  background: var(--accent); color: #06202e; border-radius: 999px;
  font-size: 0.75rem; padding: 2px 10px; vertical-align: middle;
}
.cols { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.inbox-list { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; }
.msg-item {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; cursor: pointer; background: #0b1220;
}
.msg-item:hover { border-color: var(--accent); }
.msg-item.unread { border-left: 3px solid var(--accent); }
.msg-item.unread .msg-subj { font-weight: 700; }
.msg-item.active { outline: 2px solid var(--accent); }
.msg-from { font-size: 0.85rem; color: var(--accent); overflow: hidden; text-overflow: ellipsis; }
.msg-subj { margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-meta { font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-head { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 10px; }
.atts { margin-bottom: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.atts a { color: var(--accent); font-size: 0.9rem; }
.body-frame { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.body-text { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 0.95rem; }
.form { display: flex; flex-direction: column; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--muted); }
.form input[readonly] { opacity: 0.7; }
#btnSend { align-self: flex-start; }
footer { text-align: center; padding: 8px 0 28px; }
