/* nullmail app — playful toy theme (Fuzzy Bubbles + Homemade Apple, 5-color palette) */
:root {
  --bg: #ffffff;
  --ink: #0e1116;
  --muted: rgba(14, 17, 22, 0.62);
  --accent: #85ff47;
  --gold: #fddf21;
  --saffron: #ff9933;
  --danger: #ff9933;
  --card-blue: rgba(109, 165, 217, 0.18);
  --panel: #ffffff;
  --line: rgba(14, 17, 22, 0.12);
  --address-bg: #0e1116;
  --code-bg: rgba(253, 223, 33, 0.28);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 "Fuzzy Bubbles", "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
}
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; border-radius: 4px; }
h2 { font-size: 1.15rem; margin: 0 0 0.8rem; letter-spacing: -0.01em; }
p { margin: 0.5rem 0; }
.muted { color: var(--muted); }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  max-width: 1080px; margin: 0 auto; padding: 0.7rem 1.4rem;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; color: var(--ink); }
.brand svg { width: 26px; height: 26px; }
.top nav { display: flex; gap: 0.5rem; }

/* main split view */
main {
  max-width: 1080px; margin: 0 auto; padding: 1.6rem 1.4rem 3rem;
  display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 1.4rem; align-items: start;
}

/* buttons — pills */
.cta, .ghost, .danger {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; border-radius: 999px; font-weight: 600; cursor: pointer;
  font: inherit; padding: 0.4rem 1.1rem; transition: background 0.15s, border-color 0.15s;
}
.cta {
  background: var(--accent); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink); font-weight: 700;
}
.cta:hover { background: var(--gold); }
.cta:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.cta.small, .ghost.small, .danger.small { min-height: 34px; padding: 0.2rem 0.85rem; font-size: 0.88rem; }
.ghost { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.ghost:hover { color: var(--ink); border-color: #d1d5db; }
.danger { background: #fff; color: var(--danger); border: 1px solid rgba(255, 153, 51, 0.5); }
.danger:hover { background: rgba(255, 153, 51, 0.08); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

/* address card — pastel blue, no border */
.addr-card {
  background: var(--card-blue); border-radius: 20px;
  padding: 1.6rem 1.5rem;
}
.hand {
  font-family: "Homemade Apple", "Segoe Print", cursive;
  font-size: 1.3rem; line-height: 1.4; color: var(--ink);
  margin: 0 0 0.9rem;
}
.addr-row { display: flex; gap: 0.6rem; align-items: stretch; flex-wrap: wrap; }
.address {
  flex: 1; min-width: 180px; display: flex; align-items: center;
  font: 700 1.02rem/1.4 ui-monospace, Menlo, Consolas, monospace;
  background: var(--address-bg); color: #fff; border-radius: 12px;
  padding: 0.6rem 0.85rem; overflow-wrap: anywhere;
}
.meta { color: var(--muted); font-size: 0.85rem; margin-top: 0.8rem; }
.meta .dot { margin: 0 0.4rem; }

/* inbox card — white, hairline border */
.inbox-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 1.5rem; min-height: 380px;
}
.list-head { display: flex; align-items: baseline; justify-content: space-between; }

/* mail list */
.mail-list { list-style: none; padding: 0; margin: 0.9rem 0 0; display: grid; gap: 0.6rem; }
.mail-row {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 0.75rem 0.95rem; font: inherit; color: var(--ink);
  transition: border-color 0.15s;
}
.mail-row:hover { border-color: rgba(255, 153, 51, 0.6); }
.mail-row .from { color: var(--muted); font-size: 0.82rem; }
.mail-row .subj { font-weight: 600; margin-top: 0.1rem; overflow-wrap: anywhere; }
.mail-row .when { color: var(--muted); font-size: 0.78rem; margin-top: 0.15rem; }

/* empty state */
.empty { text-align: center; padding: 3.2rem 1rem; }
.empty-icon svg { width: 76px; height: 76px; }

/* detail */
#detail-view h2 { overflow-wrap: anywhere; margin-top: 0.6rem; }
.body {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.1rem; margin-top: 1rem; overflow-wrap: anywhere;
}
.body img { max-width: 100%; height: auto; }
.body pre { white-space: pre-wrap; font: inherit; margin: 0; }
.row { display: flex; gap: 0.6rem; margin: 0.9rem 0; flex-wrap: wrap; }

/* otp chip */
.otp {
  display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
  background: var(--code-bg); border: none;
  border-radius: 12px; padding: 0.7rem 0.95rem; margin: 0.9rem 0;
}
.otp-label { color: var(--muted); font-size: 0.85rem; }
.otp code {
  font: 700 1.3rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.12em;
  color: var(--ink);
}
.links { margin: 0.9rem 0; display: grid; gap: 0.4rem; }
.links a { overflow-wrap: anywhere; font-size: 0.92rem; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  background: var(--ink); border: none; border-radius: 999px;
  color: #fff; padding: 0.55rem 1.2rem; z-index: 20; max-width: 90vw;
}

/* footer */
.foot {
  max-width: 1080px; margin: 0 auto; padding: 1.2rem 1.4rem 2.4rem;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem;
}
.foot p { margin: 0.3rem 0; }
.fineprint { font-size: 0.8rem; }

@media (max-width: 860px) {
  main { grid-template-columns: 1fr; }
  .inbox-card { min-height: 0; }
  .addr-row .cta { width: 100%; }
}