:root {
  --bg: #f4f2ee; --card: #fff; --ink: #1b1b1b; --muted: #6b6760; --line: #e3dfd8;
  --accent: #5a7d2a; --accent-ink: #fff; --warn: #c2410c; --code-bg: #f1efe9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412; --card: #1e1e1b; --ink: #ecebe6; --muted: #9b978e; --line: #2f2e2a;
    --accent: #8fbf4d; --accent-ink: #111; --warn: #fb923c; --code-bg: #262622;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
main { max-width: 720px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 16px 40px; }
header h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
header h1 span { color: var(--accent); }
.tag { margin: 4px 0 20px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.addr-row { display: flex; gap: 8px; align-items: stretch; }
#address {
  flex: 1; min-width: 0; padding: 12px; border-radius: 10px; background: var(--code-bg);
  font: 600 17px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere;
  user-select: all; -webkit-user-select: all;
}
button {
  font: inherit; font-weight: 600; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); padding: 10px 16px; cursor: pointer; min-height: 44px;
  touch-action: manipulation;
}
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
button:disabled { opacity: .5; cursor: default; }
.timer-row { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 16px; }
.timer { font: 700 40px/1 ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.timer.low { color: var(--warn); }
.expired { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.expired p { margin: 0 0 12px; }
.error { color: var(--warn); margin: 12px 0 0; }
.inbox-head { display: flex; justify-content: space-between; align-items: center; }
.inbox-head h2 { margin: 0; font-size: 18px; }
.live { font-size: 13px; color: var(--muted); }
.live.on { color: var(--accent); }
#messages { list-style: none; margin: 12px 0 0; padding: 0; }
#messages li { border-top: 1px solid var(--line); }
.msg-head {
  width: 100%; text-align: left; border: 0; border-radius: 0; background: none; padding: 12px 2px;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-weight: 400;
}
.msg-head .from { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-head .time { color: var(--muted); font-size: 13px; }
.msg-head .subj { grid-column: 1 / -1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-head.new .from::before { content: "● "; color: var(--accent); }
.msg-body { padding-bottom: 14px; }
.msg-body iframe { width: 100%; height: 70vh; min-height: 320px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.attachments { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.empty { color: var(--muted); margin: 12px 0 0; }
footer { color: var(--muted); font-size: 13px; text-align: center; margin-top: 8px; }
