:root{
  --bg:#0b1020;
  --panel:#0f1730;
  --text:#e8ecff;
  --muted:#a7b0d6;
  --line:rgba(255,255,255,.10);
  --brand:#7c5cff;
  --brand2:#14b8a6;
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --radius:14px;
  --max:1080px;
}
*{box-sizing:border-box}
/*
  Background is applied to `html` (not `body`) to avoid a visible seam when the
  document is taller than the viewport (some browsers will paint beyond `body`
  using the `html` background).
*/
html{min-height:100%}
body{min-height:100%}
html{
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(124,92,255,.25), transparent 60%),
    radial-gradient(1000px 500px at 90% 10%, rgba(20,184,166,.18), transparent 60%),
    var(--bg);
  background-repeat:no-repeat;
  background-attachment:fixed;
}
body{
  margin:0;
  font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  color:var(--text);
  background:transparent;
}
a{color:inherit;text-decoration:none}
a:hover{opacity:.9}
code{background:rgba(255,255,255,.08);padding:.15rem .35rem;border-radius:.4rem}
.inline-code{display:inline-flex;align-items:center;gap:10px;flex-wrap:wrap}

.icon-btn{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--muted);
  padding:0;
  cursor:pointer;
}
.icon-btn:hover{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.18);color:var(--text)}
.icon-btn.is-copied{color:rgba(20,184,166,.95);border-color:rgba(20,184,166,.35)}
.icon{width:16px;height:16px;display:block}
.container{max-width:var(--max);margin:0 auto;padding:0 18px}
.site-header{position:sticky;top:0;backdrop-filter:blur(10px);background:rgba(11,16,32,.72);border-bottom:1px solid var(--line);z-index:10}
.nav{display:flex;align-items:center;gap:16px;padding:14px 18px}
.nav-left{display:flex;align-items:center;gap:16px;min-width:0}
.brand{font-weight:700;letter-spacing:.2px}
.nav-links{display:flex;gap:14px;opacity:.95}
.nav-menu{display:none; position:relative}
.nav-menu > summary{list-style:none}
.nav-menu > summary::-webkit-details-marker{display:none}
.account-menu > summary{list-style:none}
.account-menu > summary::-webkit-details-marker{display:none}
.nav-menu-panel{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  min-width: 180px;
  display:grid;
  gap:6px;
  padding:10px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(15,23,48,.98);
  box-shadow:var(--shadow);
}
.nav-menu-panel a{padding:8px 10px;border-radius:10px}
.nav-menu-panel a:hover{background:rgba(255,255,255,.06);opacity:1}
.nav-menu[open] > summary{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.18);color:var(--text)}

.account-menu{position:relative}
.account-menu-panel{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  min-width: 180px;
  display:grid;
  gap:6px;
  padding:10px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(15,23,48,.98);
  box-shadow:var(--shadow);
}
.account-menu-panel a,
.account-menu-button{
  padding:8px 10px;
  border-radius:10px;
  text-align:left;
}
.account-menu-button{
  width:100%;
  border:0;
  background:transparent;
  color:inherit;
  font:inherit;
}
.account-menu-panel a:hover,
.account-menu-button:hover{background:rgba(255,255,255,.06);opacity:1}
.account-menu[open] > summary{border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.08)}
.nav-cta{margin-left:auto;display:flex;gap:10px}
.beta-banner,.trial-banner{border-top:1px solid var(--line);background:rgba(255,255,255,.03);padding:10px 0;color:var(--muted);font-size:14px}
.site-footer{border-top:1px solid var(--line);margin-top:60px;padding:24px 0;color:var(--muted)}
.footer-grid{display:flex;justify-content:space-between;gap:12px;align-items:center}
.footer-links{display:flex;gap:14px}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.06);
  box-shadow:none;
  color:var(--text);
}
.btn-icon{width:46px;height:46px;min-width:46px;padding:0}
.btn-icon .icon{width:18px;height:18px}
.btn-small{padding:6px 10px;border-radius:10px;font-size:13px}
.btn-primary{background:linear-gradient(135deg,var(--brand),var(--brand2));border-color:transparent;color:#06111a;font-weight:700}
.btn, button{cursor:pointer}
.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
}
.btn:active{transform: translateY(0px); opacity:.96}
.btn-primary:hover{
  /* keep the same gradient colors; just a subtle lift + shadow */
  background:linear-gradient(135deg,var(--brand),var(--brand2));
  border-color:transparent;
  box-shadow:0 12px 34px rgba(0,0,0,.35);
}
  .btn:focus-visible{outline: none; box-shadow:0 0 0 4px rgba(124,92,255,.14)}

  /* When HTMX polling is swapping the mailbox list, the DOM can be replaced while the user is
     hovering/clicking, which looks like the hover state is rapidly applied/unapplied ("pulsing").
     Disable the hover translate effect during polling to reduce UI jitter. */
  #mailbox-list.is-polling .btn:hover{transform:none}
.hero{display:grid;grid-template-columns:1.2fr .8fr;gap:22px;align-items:start;padding:46px 0 22px}
.hero h1{font-size:46px;line-height:1.05;margin:0 0 12px}
.lead{font-size:18px;color:var(--muted);margin:0 0 16px}
.hero-actions{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}
.card{background:rgba(255,255,255,.04);border:1px solid var(--line);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow)}
.auth-wrap{display:grid;place-items:center;min-height:calc(100vh - 180px);padding:28px 0}
.auth-card{width:min(520px, 100%);}
.form{display:grid;gap:12px;margin-top:14px}
.field{display:grid;gap:6px}
label{color:var(--muted);font-size:13px}
input[type="email"],input[type="password"],input[type="text"]{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.22);
  color:var(--text);
  outline:none;
}
input:focus{border-color:rgba(124,92,255,.65);box-shadow:0 0 0 4px rgba(124,92,255,.12)}
  .row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:6px}
  .row > .message-close{margin-left:auto}
.link{
  /* Softer than the primary brand purple to reduce visual intensity in body copy. */
  color: rgba(170, 160, 255, .92);
  text-decoration: underline;
  text-decoration-color: rgba(170, 160, 255, .35);
  text-underline-offset: 2px;
}
.link:hover{color: rgba(186, 178, 255, .95); text-decoration-color: rgba(186, 178, 255, .55); opacity: 1}
.errorlist{margin:0;padding-left:18px;color:#ff9c9c}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:18px 0 40px}
.grid-2{display:grid;grid-template-columns:1.1fr .9fr;gap:14px;margin:18px 0 40px}
.dash-head{display:flex;justify-content:space-between;gap:12px;align-items:end;margin-top:18px}
.dash-actions{display:flex;gap:10px;align-items:center}
.status-card{margin:14px 0}
.list{display:grid;gap:10px;margin-top:12px}
.list-row{display:flex;gap:12px;justify-content:space-between;align-items:start;padding:12px;border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.02)}
.list-actions{display:flex;gap:8px;flex-wrap:wrap}
.forwarding-address-row{color:rgba(232,236,255,.92)}
.forwarding-address{
  font-weight:650;
  background:rgba(124,92,255,.14);
  border:1px solid rgba(124,92,255,.22);
}
  .forwarding-warning{margin-top:4px;max-width:72ch;font-style:italic;opacity:.92}
  .pill{font-size:12px;border:1px solid var(--line);padding:2px 8px;border-radius:999px;color:var(--muted)}
  .pill-disabled{border-color:rgba(255, 90, 90, .55);color:rgba(255, 165, 165, 1);background:rgba(255, 90, 90, .10);font-weight:700}
  .pill-ok{border-color:rgba(20,184,166,.35);color:rgba(20,184,166,.95)}
  .pill-warn{border-color:rgba(255, 196, 0, .35);color:rgba(255, 220, 130, .95)}
  .pill-error{border-color:rgba(255, 90, 90, .40);color:rgba(255, 150, 150, .95)}
.clean{margin:0;padding-left:18px;color:var(--muted)}
.stack{display:grid;gap:12px;max-width:820px}
  .muted{color:var(--muted)}
  .small{font-size:13px}

  /* Dismiss/close control (used for Django messages + apply-status banner) */
  .message-close{
    margin-left:auto;
    width:28px;
    height:28px;
    display:grid;
    place-items:center;
    border-radius:999px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.04);
    color:var(--muted);
    line-height:1;
    font-size:18px;
    padding:0;
    cursor:pointer;
    appearance:none;
    -webkit-appearance:none;
  }
  .message-close:hover{background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.18);color:var(--text)}
  .messages{display:grid;gap:8px;margin:16px 0}
  .message{border:1px solid var(--line);background:rgba(255,255,255,.03);padding:10px 12px;border-radius:12px;display:flex;gap:12px;align-items:center;justify-content:flex-start}
  .message .message-body{flex:1;min-width:0}
  .message.error{border-color:rgba(255,90,90,.35)}
  .message.success{border-color:rgba(20,184,166,.35)}

  .btn-danger{
    border-color:rgba(255,90,90,.35);
    background:rgba(255,90,90,.10);
    color:rgba(255,210,210,1);
    font-weight:650;
  }
  .btn-danger:hover{background:rgba(255,90,90,.16);border-color:rgba(255,90,90,.5);opacity:1}

  .rule{border:0;border-top:1px solid var(--line);margin:18px 0}

  /* Account: manage email */
  .email-list{display:grid;gap:10px;margin:10px 0 6px}
  .email-item{
    display:flex;
    gap:10px;
    align-items:flex-start;
    padding:12px;
    border:1px solid var(--line);
    border-radius:14px;
    background:rgba(255,255,255,.02);
    cursor:pointer;
  }
  .email-item:hover{background:rgba(255,255,255,.04);border-color:rgba(255,255,255,.16)}
  .email-item input{margin-top:3px}
  .email-item-main{display:flex;flex-direction:column;gap:6px;min-width:0}
  .email-address{font-weight:650;word-break:break-word}
  .email-badges{display:flex;gap:8px;flex-wrap:wrap}

  /* HTMX loading indicator */
  .spinner{
    width:14px;
    height:14px;
    border-radius:999px;
    border:2px solid rgba(255,255,255,.25);
    border-top-color: rgba(255,255,255,.75);
    display:inline-block;
    animation: spin 0.8s linear infinite;
  }
  .htmx-indicator{display:none}
  /* HTMX can add `.htmx-request` to either the requesting element or the indicator itself. */
  .htmx-request .htmx-indicator,
  .htmx-request.htmx-indicator{display:inline-block}
  @keyframes spin{to{transform:rotate(360deg)}}
@media (max-width: 860px){
  .hero{grid-template-columns:1fr;}
  .grid-3{grid-template-columns:1fr;}
  .grid-2{grid-template-columns:1fr;}
  .nav-links{display:none}
  .nav-menu{display:block}
}
