:root {
  --bg: #090511;
  --panel: rgba(24, 14, 42, 0.82);
  --panel-strong: #170d29;
  --panel-soft: #120a21;
  --text: #f7f2ff;
  --muted: #a99db9;
  --line: rgba(196, 166, 255, 0.18);
  --purple: #9b5cff;
  --purple-light: #c7a2ff;
  --purple-dark: #7130dd;
  --pink: #e77cff;
  --danger: #ff8b9d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 80% 8%, rgba(139, 76, 255, 0.2), transparent 31rem),
    radial-gradient(circle at 8% 62%, rgba(225, 96, 255, 0.1), transparent 26rem),
    linear-gradient(rgba(183, 143, 255, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(183, 143, 255, 0.065) 1px, transparent 1px);
  background-size: auto, auto, 38px 38px, 38px 38px;
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(9, 5, 17, 0.05), rgba(9, 5, 17, 0.72) 78%, var(--bg));
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.blob { position: fixed; z-index: -1; border-radius: 50%; pointer-events: none; filter: blur(34px); }
.blob-a { width: 410px; height: 410px; top: -220px; right: -90px; background: rgba(126, 62, 255, 0.21); }
.blob-b { width: 340px; height: 340px; top: 500px; left: -230px; background: rgba(225, 80, 255, 0.12); }

header, main, footer { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -0.02em; }
.brand-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(221, 199, 255, 0.27);
  border-radius: 13px;
  background: linear-gradient(145deg, var(--purple), var(--purple-dark));
  color: #fff;
  box-shadow: 0 10px 30px rgba(125, 56, 238, 0.32);
}
.safe-badge {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(20, 11, 34, 0.74);
  color: var(--muted);
  font-size: 13px;
  backdrop-filter: blur(12px);
}
.safe-badge i { width: 7px; height: 7px; border-radius: 50%; background: #b27aff; box-shadow: 0 0 0 4px rgba(178, 122, 255, 0.14), 0 0 18px #9b5cff; }

.hero { width: min(880px, 100%); margin-inline: auto; padding: 92px 0 66px; text-align: center; }
.eyebrow { margin: 0 0 18px; color: var(--purple-light); font-size: 12px; font-weight: 900; letter-spacing: 0.22em; }
h1 { margin: 0; font-size: clamp(46px, 6.5vw, 78px); line-height: 0.99; letter-spacing: -0.062em; text-wrap: balance; }
h1 span { color: transparent; background: linear-gradient(90deg, #b98aff, #ed9cff); -webkit-background-clip: text; background-clip: text; }
.lead { width: min(620px, 100%); margin: 28px auto 0; color: var(--muted); font-size: 17px; line-height: 1.75; text-wrap: pretty; }

.control-card {
  margin: 48px 0 0;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: linear-gradient(145deg, rgba(32, 17, 56, 0.92), rgba(19, 10, 34, 0.88));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38), 0 0 60px rgba(130, 67, 245, 0.08);
  backdrop-filter: blur(22px);
  text-align: left;
}
.control-card label { display: block; margin-bottom: 10px; color: #e9dcff; font-size: 13px; font-weight: 800; }
.input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 11px; }
.input-wrap {
  min-width: 0;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 16px;
  border: 1px solid rgba(194, 162, 255, 0.25);
  border-radius: 14px;
  background: rgba(8, 4, 15, 0.55);
  color: #a98bcf;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.input-wrap:focus-within { border-color: var(--purple); background: rgba(13, 7, 23, 0.84); box-shadow: 0 0 0 4px rgba(155, 92, 255, 0.13), 0 0 26px rgba(155, 92, 255, 0.1); }
.input-wrap input { width: 100%; min-width: 0; height: 52px; border: 0; outline: 0; background: transparent; color: var(--text); }
.input-wrap input::placeholder { color: #746681; }
.control-card button {
  min-height: 56px;
  padding: 0 23px;
  border: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: linear-gradient(135deg, #a15fff, #7a36e8);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(122, 54, 232, 0.34);
  transition: transform 0.18s, filter 0.18s;
}
.control-card button:hover { transform: translateY(-1px); filter: brightness(1.09); }
.control-card button:disabled { opacity: 0.58; cursor: wait; transform: none; }
.form-note { margin-top: 12px; display: flex; justify-content: space-between; gap: 20px; color: #8e809d; font-size: 12px; }
.form-note.single { justify-content: flex-end; }
.buy-mail {
  width: max-content;
  max-width: calc(100% - 24px);
  margin: 17px auto 0;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(196, 157, 255, 0.25);
  border-radius: 99px;
  background: rgba(20, 10, 35, 0.75);
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  backdrop-filter: blur(12px);
  transition: 0.18s;
}
.buy-mail strong, .buy-mail b { color: var(--purple-light); }
.buy-mail b { font-size: 15px; }
.buy-mail:hover { transform: translateY(-1px); border-color: var(--purple); background: rgba(38, 18, 65, 0.88); box-shadow: 0 10px 30px rgba(112, 50, 210, 0.18); }

.error-box {
  width: min(860px, 100%);
  margin: -32px auto 48px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 139, 157, 0.35);
  border-radius: 14px;
  background: rgba(84, 25, 42, 0.78);
  color: #ffd9df;
  backdrop-filter: blur(16px);
}
.error-box strong { width: 25px; height: 25px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--danger); color: #38101a; }
.error-box p { flex: 1; min-width: 0; margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.error-box button { min-height: 40px; border: 0; background: transparent; color: inherit; font-weight: 800; cursor: pointer; }

.results { width: min(960px, 100%); margin-inline: auto; padding: 24px 0 90px; }
.results-head { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.results-head > div { min-width: 0; }
.results-head .eyebrow { margin-bottom: 8px; }
.results-head h2 { margin: 0; font-size: clamp(26px, 4vw, 34px); letter-spacing: -0.04em; }
#result-caption { margin: 7px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.refresh {
  min-height: 46px;
  flex: 0 0 auto;
  padding: 0 17px;
  border: 1px solid rgba(193, 158, 255, 0.27);
  border-radius: 12px;
  background: rgba(29, 15, 50, 0.86);
  color: #e9dcff;
  font-weight: 800;
  cursor: pointer;
  transition: 0.18s;
}
.refresh:hover { border-color: var(--purple); background: rgba(47, 23, 81, 0.9); }
.refresh:disabled { opacity: 0.58; cursor: wait; }
.email-list { display: grid; gap: 11px; }
.email-card { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: rgba(23, 12, 40, 0.88); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2); backdrop-filter: blur(14px); }
.email-card[open] { border-color: rgba(178, 122, 255, 0.42); background: rgba(27, 14, 47, 0.95); }
.email-card summary { list-style: none; cursor: pointer; padding: 19px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 24px; gap: 14px; align-items: center; }
.email-card summary::-webkit-details-marker { display: none; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(208, 179, 255, 0.2); border-radius: 13px; background: linear-gradient(145deg, rgba(161, 95, 255, 0.28), rgba(107, 45, 202, 0.35)); color: #ddc6ff; font-size: 12px; font-weight: 900; }
.email-meta { min-width: 0; display: grid; gap: 3px; }
.sender-line { min-width: 0; display: flex; justify-content: space-between; gap: 20px; }
.sender-line strong, .subject, .snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sender-line strong { min-width: 0; color: #f2eaff; font-size: 13px; }
.sender-line time { flex: 0 0 auto; color: #81748f; font-size: 11px; }
.subject { color: #d8c7ef; font-size: 14px; font-weight: 800; }
.snippet { color: #9486a3; font-size: 12px; }
.chevron { color: #a88bcb; font-size: 20px; transition: transform 0.2s; }
.email-card[open] .chevron { transform: rotate(180deg); }
.email-content { min-width: 0; padding: 0 20px 22px 76px; }
.addresses { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; color: #9587a4; font-size: 11px; overflow-wrap: anywhere; }
.email-content pre { max-width: 100%; max-height: 520px; overflow: auto; margin: 10px 0 0; padding: 19px; border: 1px solid rgba(190, 154, 255, 0.12); border-radius: 13px; background: rgba(7, 3, 13, 0.62); color: #d9cfe4; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { padding: 70px 24px; border: 1px dashed rgba(195, 157, 255, 0.32); border-radius: 20px; background: rgba(24, 12, 41, 0.66); text-align: center; }
.empty > span { width: 62px; height: 62px; margin: 0 auto 17px; display: grid; place-items: center; border: 1px solid rgba(193, 158, 255, 0.22); border-radius: 20px; background: rgba(151, 85, 255, 0.16); color: var(--purple-light); font-size: 26px; }
.empty h3 { margin: 0; }
.empty p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

footer { min-height: 100px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #7f728c; font-size: 12px; }
footer strong { color: #d9cced; }
.hidden { display: none !important; }
.spinner { display: inline-block; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  header, main, footer { width: min(100% - 32px, 1120px); }
  .hero { padding: 76px 0 56px; }
  .results-head { align-items: flex-start; }
}

@media (max-width: 640px) {
  body { background-size: auto, auto, 32px 32px, 32px 32px; }
  header { height: 72px; }
  .safe-badge { padding: 9px 10px; font-size: 11px; }
  .hero { padding: 62px 0 46px; }
  h1 { font-size: clamp(42px, 13vw, 58px); }
  .lead { margin-top: 22px; font-size: 15px; line-height: 1.65; }
  .control-card { margin-top: 34px; padding: 20px; border-radius: 20px; }
  .input-row { grid-template-columns: 1fr; }
  .control-card button { width: 100%; }
  .form-note, .form-note.single { align-items: flex-end; justify-content: flex-end; }
  .buy-mail { width: 100%; max-width: 100%; flex-wrap: wrap; }
  .error-box { margin-top: -20px; }
  .results { padding-top: 16px; }
  .results-head { align-items: stretch; flex-direction: column; }
  .refresh { width: 100%; }
  .email-card summary { grid-template-columns: 38px minmax(0, 1fr) 18px; gap: 11px; padding: 15px; }
  .avatar { width: 38px; height: 38px; }
  .sender-line time { display: none; }
  .email-content { padding: 0 15px 17px; }
  .email-content pre { padding: 15px; font-size: 11px; }
  footer { min-height: 112px; align-items: flex-start; justify-content: center; flex-direction: column; gap: 6px; }
}

@media (max-width: 420px) {
  header, main, footer { width: min(100% - 24px, 1120px); }
  .brand { font-size: 14px; }
  .brand-icon { width: 37px; height: 37px; }
  .safe-badge { width: 38px; height: 38px; justify-content: center; padding: 0; font-size: 0; }
  .hero { padding-top: 50px; }
  .eyebrow { font-size: 10px; }
  h1 { font-size: 39px; }
  .control-card { padding: 16px; }
  .input-wrap { padding-inline: 13px; }
  .buy-mail span { display: none; }
  .results-head h2 { font-size: 25px; }
  .email-card summary { grid-template-columns: 36px minmax(0, 1fr) 16px; gap: 9px; padding: 13px; }
  .avatar { width: 36px; height: 36px; border-radius: 11px; }
  .sender-line strong { font-size: 12px; }
  .subject { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: 0.01ms !important; }
}
