* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0b1120; --card: #151f36; --border: #2a3a5c;
  --teal: #2dd4bf; --teal-dark: #0d9488; --blue: #3b82f6;
  --text: #e8eefc; --muted: #8fa0c2;
}
body {
  font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #14224a 0%, var(--bg) 60%);
  color: var(--text); min-height: 100vh; line-height: 1.6;
}
.hidden { display: none !important; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 28px; max-width: 960px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; }
.tagline { color: var(--muted); font-size: 14px; }

main { max-width: 960px; margin: 0 auto; padding: 10px 20px 40px; }

.hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.15; margin: 26px 0 8px; font-weight: 800; }
.accent {
  background: linear-gradient(90deg, var(--teal), var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { color: var(--muted); margin-bottom: 22px; font-size: 17px; }

.address-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 26px; text-align: center;
  box-shadow: 0 20px 60px rgba(45, 212, 191, .08);
}
.address-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.address {
  font-size: clamp(18px, 3vw, 26px); font-weight: 800; color: var(--teal);
  margin: 10px 0 18px; word-break: break-all; font-family: ui-monospace, monospace;
}
.address-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.btn {
  background: #22314f; color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 18px; font-size: 14px;
  cursor: pointer; font-weight: 700; transition: transform .08s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--teal-dark); }
.btn.primary { background: linear-gradient(135deg, var(--teal-dark), var(--blue)); border: none; color: #fff; }
.btn.danger { background: #5b1a1a; border-color: #7f2a2a; color: #fca5a5; font-size: 13px; }
.btn.back { margin-bottom: 14px; }

.qr-wrap { margin-top: 16px; display: flex; justify-content: center; }
.qr-wrap #qr { background: #fff; padding: 10px; border-radius: 12px; display: inline-block; }

.addr-switch { margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.addr-chip {
  font-size: 12px; background: #22314f; border: 1px solid var(--border);
  color: var(--muted); border-radius: 20px; padding: 5px 12px; cursor: pointer;
  max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.addr-chip.active { border-color: var(--teal); color: var(--teal); }

.inbox-head { display: flex; justify-content: space-between; align-items: center; margin: 30px 4px 12px; }
.inbox-head h2 { font-size: 20px; }
.count { background: var(--teal-dark); color: #fff; font-size: 12px; border-radius: 12px; padding: 2px 10px; margin-left: 6px; }
.auto-note { font-size: 13px; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #34d399; margin-right: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

.inbox-list { display: grid; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 44px 10px; background: var(--card); border: 1px dashed var(--border); border-radius: 14px; }
.msg-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; display: grid;
  grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
}
.msg-item:hover { border-color: var(--teal-dark); }
.msg-item.unread { border-left: 3px solid var(--teal); }
.msg-item .from { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-item .subject { color: var(--muted); grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.msg-item.unread .subject { color: var(--text); font-weight: 700; }
.msg-item .time { font-size: 12px; color: var(--muted); }
.msg-item .del { grid-row: 1 / span 2; grid-column: 2; background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.msg-item .del:hover { color: #f87171; }

.modal { position: fixed; inset: 0; background: rgba(4, 8, 18, .8); display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px; z-index: 50; overflow-y: auto; }
.modal-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 24px; max-width: 720px; width: 100%; }
.msg-subject { font-size: 20px; font-weight: 800; margin-bottom: 8px; word-break: break-word; }
.msg-meta { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.9; word-break: break-word; }
.meta-label { color: #5b6b8c; }
.modal-card .btn.danger { margin-bottom: 14px; }
.msg-body { background: #fff; color: #111; border-radius: 10px; padding: 16px; max-height: 50vh; overflow-y: auto; font-size: 14px; word-break: break-word; }
.msg-body.plain { white-space: pre-wrap; }

.info { margin-top: 48px; }
.info h2 { font-size: 24px; margin-bottom: 16px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.step { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.step-n {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--teal-dark), var(--blue)); font-weight: 800; margin-bottom: 10px;
}
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14px; }

.faq details { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { color: var(--muted); margin-top: 8px; font-size: 14px; }

.privacy-note {
  margin-top: 36px; background: #3a2b12; border: 1px solid #7a5a1e; color: #fcd34d;
  border-radius: 12px; padding: 16px 20px; font-size: 14px;
}

footer {
  max-width: 960px; margin: 0 auto; padding: 24px 20px 40px;
  display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; flex-wrap: wrap;
}
.foot-logo { width: 26px; height: 26px; border-radius: 8px; }
.foot-sub { margin-left: auto; font-size: 12px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #065f46; color: #a7f3d0; padding: 10px 20px; border-radius: 10px;
  font-weight: 700; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
@media (max-width: 600px) {
  .topbar { padding: 14px 16px; }
  .tagline { display: none; }
}
