* {
  box-sizing: border-box;
}

:root {
  --bg: #edf3ff;
  --shell: rgba(255, 255, 255, .82);
  --panel: rgba(255, 255, 255, .88);

  --text: #182230;
  --muted: #667085;

  --line: rgba(40, 67, 110, .12);

  --accent: #5b7cfa;
  --accent2: #3155d8;

  --danger: #c0394b;

  --shadow:
    0 24px 70px rgba(42, 64, 110, .14);
}


html,
body {
  margin: 0;
  min-height: 100%;

  font-family:
    Poppins,
    system-ui,
    sans-serif;

  color: var(--text);
  background: var(--bg);
}


body:before,
body:after {
  content: "";

  position: fixed;

  border-radius: 50%;

  filter: blur(50px);

  pointer-events: none;

  z-index: -1;
}


body:before {
  width: 360px;
  height: 360px;

  left: -120px;
  top: -80px;

  background:
    rgba(93, 190, 255, .28);
}


body:after {
  width: 340px;
  height: 340px;

  right: -120px;
  bottom: -80px;

  background:
    rgba(125, 105, 255, .18);
}


button,
a {
  font: inherit;
}


.page {
  padding: 18px;
  min-height: 100vh;
}


.shell {
  max-width: 1180px;

  margin: auto;

  min-height:
    calc(100vh - 36px);

  padding: 18px;

  border:
    1px solid rgba(255,255,255,.8);

  border-radius: 34px;

  background:
    var(--shell);

  box-shadow:
    var(--shadow);

  backdrop-filter:
    blur(22px);

  -webkit-backdrop-filter:
    blur(22px);
}


/* =========================
   NAVBAR
========================= */

.navbar {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 14px;
}


.brand {
  display: flex;

  align-items: center;

  gap: 10px;

  text-decoration: none;

  color: var(--text);
}


.brand-mark {
  width: 45px;
  height: 45px;

  border-radius: 15px;

  display: grid;

  place-items: center;

  background:
    linear-gradient(
      135deg,
      #7fcdf3,
      #5b7cfa
    );

  color: white;

  font-weight: 800;

  box-shadow:
    0 10px 24px
    rgba(91,124,250,.25);
}


.brand-name {
  font-size: 13px;

  font-weight: 800;

  letter-spacing: .2px;
}


.brand-name b {
  color: var(--accent2);
}


.top-actions {
  display: flex;

  align-items: center;

  gap: 9px;
}


.private-note {
  font-size: 10px;

  color: var(--muted);
}


/* =========================
   BUTTONS
========================= */

.button,
.icon-button {
  border:
    1px solid var(--line);

  cursor: pointer;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  gap: 7px;

  border-radius: 12px;

  transition: .2s ease;
}


.button {
  min-height: 40px;

  padding: 0 13px;

  font-size: 12px;

  font-weight: 650;

  background:
    rgba(255,255,255,.68);

  color: var(--text);
}


.button:hover,
.icon-button:hover {
  transform:
    translateY(-1px);

  border-color:
    rgba(91,124,250,.25);
}


.button.primary {
  background:
    var(--accent);

  border-color:
    var(--accent);

  color: white;
}


.button.ghost {
  background:
    rgba(255,255,255,.52);
}


.button.danger {
  color: var(--danger);

  background:
    rgba(255,92,112,.08);

  border-color:
    rgba(255,92,112,.18);
}


.button.small {
  min-height: 34px;

  padding: 0 10px;
}


.button svg,
.icon-button svg {
  width: 17px;
  height: 17px;
}


.icon-button {
  width: 40px;
  height: 40px;

  background:
    rgba(255,255,255,.72);

  color: var(--text);
}


/* =========================
   SETTINGS
========================= */

.settings-wrap {
  position: relative;
}


.settings-menu {
  position: absolute;

  right: 0;
  top: 48px;

  width: 220px;

  padding: 9px;

  z-index: 50;

  background:
    rgba(255,255,255,.96);

  border:
    1px solid
    rgba(71,91,125,.18);

  border-radius: 17px;

  box-shadow:
    0 18px 45px
    rgba(31,45,70,.18);

  backdrop-filter:
    blur(10px);
}


.settings-menu[hidden] {
  display: none;
}


.settings-title {
  padding:
    8px 10px 7px;

  font-size: 10px;

  font-weight: 800;

  text-transform:
    uppercase;

  letter-spacing: .9px;

  color: var(--muted);
}


.settings-menu button,
.settings-menu a {
  width: 100%;

  min-height: 40px;

  padding: 0 10px;

  border: 0;

  border-radius: 11px;

  background: transparent;

  color: #25324a;

  display: flex;

  align-items: center;

  gap: 9px;

  text-decoration: none;

  text-align: left;

  font-size: 12px;

  font-weight: 600;

  cursor: pointer;
}


.settings-menu button:hover,
.settings-menu a:hover {
  background:
    rgba(91,124,250,.11);

  color:
    #3155d8;
}


.settings-menu svg {
  width: 17px;
  height: 17px;

  flex: none;
}


.settings-menu small {
  margin-left: auto;

  color: var(--muted);
}


.settings-menu a svg:last-child {
  margin-left: auto;

  width: 13px;
}


/* =========================
   INTRO
========================= */

.intro {
  text-align: center;

  padding:
    42px 10px 28px;
}


.intro-icon {
  width: 60px;
  height: 60px;

  margin: auto;

  display: grid;

  place-items: center;

  border-radius: 20px;

  background:
    rgba(91,124,250,.10);

  color:
    var(--accent2);

  border:
    1px solid
    rgba(91,124,250,.14);
}


.intro-icon svg {
  width: 29px;
  height: 29px;
}


.eyebrow {
  margin-top: 16px;

  font-size: 9px;

  font-weight: 800;

  letter-spacing: 1.7px;

  color:
    var(--accent2);
}


h1 {
  margin:
    6px 0 7px;

  font-size: 34px;

  line-height: 1.15;

  letter-spacing: -1.5px;
}


.intro p {
  max-width: 560px;

  margin: auto;

  color: var(--muted);

  font-size: 12px;

  line-height: 1.7;
}


/* =========================
   ADDRESS
========================= */

.address-card,
.panel {
  background:
    var(--panel);

  border:
    1px solid var(--line);

  border-radius: 22px;

  box-shadow:
    0 12px 35px
    rgba(50,72,110,.07);
}


.address-row {
  padding: 15px 16px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 15px;
}


.address-value {
  display: flex;

  align-items: center;

  gap: 11px;

  min-width: 0;

  font-size: 14px;

  font-weight: 650;

  overflow-wrap: anywhere;
}


.address-icon {
  width: 40px;
  height: 40px;

  flex: none;

  display: grid;

  place-items: center;

  border-radius: 13px;

  background:
    rgba(91,124,250,.1);

  color:
    var(--accent2);
}


.address-icon svg {
  width: 19px;
  height: 19px;
}


.address-actions {
  display: flex;

  gap: 8px;
}


.address-foot {
  min-height: 35px;

  padding: 0 17px;

  display: flex;

  align-items: center;

  gap: 7px;

  border-top:
    1px solid var(--line);

  font-size: 9px;

  color: var(--muted);
}


.address-foot svg {
  width: 14px;
  height: 14px;
}


/* =========================
   ERROR
========================= */

.error-banner {
  display: none;

  align-items: center;

  gap: 9px;

  margin-top: 12px;

  padding: 10px 12px;

  border-radius: 14px;

  background:
    rgba(255,92,112,.08);

  border:
    1px solid
    rgba(255,92,112,.16);

  color: #a83245;

  font-size: 11px;
}


.error-banner.visible {
  display: flex;
}


.error-banner svg {
  width: 16px;
}


.error-banner button {
  margin-left: auto;

  border: 0;

  background: transparent;

  color: inherit;

  font-weight: 700;

  cursor: pointer;
}


/* =========================
   INBOX
========================= */

.inbox-layout {
  display: grid;

  grid-template-columns:
    minmax(300px,.9fr)
    minmax(0,1.1fr);

  gap: 14px;

  margin-top: 14px;
}


.panel {
  min-height: 460px;

  overflow: hidden;
}


.panel-head {
  min-height: 68px;

  padding: 0 18px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  border-bottom:
    1px solid var(--line);
}


.panel-head h2 {
  margin: 0;

  font-size: 15px;
}


.panel-head p {
  margin: 3px 0 0;

  color: var(--muted);

  font-size: 10px;
}


.live {
  display: flex;

  align-items: center;

  gap: 5px;

  font-size: 10px;

  color: var(--muted);
}


.live > span:first-child {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: #2fbf71;
}


.badge {
  display: none;

  margin-left: 3px;

  min-width: 18px;

  height: 18px;

  padding: 0 5px;

  border-radius: 9px;

  place-items: center;

  background: var(--accent);

  color: white;

  font-size: 9px;
}


.badge.visible {
  display: grid;
}


/* =========================
   MESSAGE LIST
========================= */

.message-item {
  position: relative;

  display: grid;

  grid-template-columns:
    38px
    minmax(0,1fr)
    auto
    30px;

  align-items: center;

  gap: 10px;

  padding: 13px 15px;

  border-bottom:
    1px solid var(--line);

  cursor: pointer;

  transition: .18s ease;
}


.message-item:hover,
.message-item.selected {
  background:
    rgba(91,124,250,.055);
}


.message-item.unread
.message-sender {
  font-weight: 800;
}


.sender-avatar {
  width: 36px;
  height: 36px;

  border-radius: 12px;

  display: grid;

  place-items: center;

  background:
    rgba(91,124,250,.11);

  color:
    var(--accent2);

  font-size: 10px;

  font-weight: 800;
}


.message-content {
  min-width: 0;

  display: flex;

  flex-direction: column;

  gap: 3px;
}


.message-sender,
.message-subject {
  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;
}


.message-sender {
  font-size: 11px;
}


.message-subject {
  font-size: 10px;

  color: var(--muted);
}


.message-meta {
  display: flex;

  align-items: center;

  gap: 6px;

  font-size: 9px;

  color: var(--muted);

  white-space: nowrap;
}


.unread-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background:
    var(--accent);
}


.delete-btn {
  width: 29px;
  height: 29px;

  border: 0;

  border-radius: 9px;

  background: transparent;

  color: #8a93a3;

  display: grid;

  place-items: center;

  cursor: pointer;
}


.delete-btn:hover {
  background:
    rgba(255,92,112,.09);

  color:
    var(--danger);
}


.delete-btn svg {
  width: 15px;
  height: 15px;
}


/* =========================
   EMPTY
========================= */

.empty-state {
  min-height: 390px;

  display: grid;

  place-items: center;

  text-align: center;

  padding: 30px;
}


.empty-state > div {
  max-width: 330px;
}


.empty-icon {
  width: 65px;
  height: 65px;

  margin:
    0 auto 13px;

  display: grid;

  place-items: center;

  border-radius: 20px;

  background:
    rgba(117,102,183,.08);

  color: #7566b7;

  border:
    1px solid
    rgba(117,102,183,.13);
}


.empty-icon svg {
  width: 27px;
  height: 27px;
}


.empty-state h3 {
  margin: 0;

  font-size: 15px;
}


.empty-state p {
  margin:
    7px auto 15px;

  color: var(--muted);

  font-size: 11px;

  line-height: 1.7;
}


/* =========================
   READER
========================= */

.reader-panel {
  display: block;
}


.reader-content {
  position: relative;

  min-height: 100%;

  padding: 22px;
}


.reader-toolbar {
  min-height: 1px;
}


.mobile-only {
  display: none;
}


.reader-header {
  padding-bottom: 17px;

  border-bottom:
    1px solid var(--line);
}


.reader-subject {
  margin: 0;

  font-size: 23px;

  line-height: 1.35;

  letter-spacing: -.5px;

  overflow-wrap: anywhere;
}


.reader-meta {
  display: flex;

  align-items: center;

  flex-wrap: wrap;

  gap: 8px;

  margin-top: 12px;

  color: var(--muted);

  font-size: 11px;
}


.reader-from {
  font-weight: 700;

  color: var(--text);
}


.reader-time {
  white-space: nowrap;
}


.reader-actions {
  display: flex;

  flex-wrap: wrap;

  gap: 8px;

  margin-top: 15px;
}


.reader-actions .button {
  min-height: 35px;

  font-size: 11px;
}


.reader-body {
  margin-top: 19px;

  padding-bottom: 90px;

  font-size: 14px;

  line-height: 1.75;

  overflow-wrap: anywhere;
}


.reader-body pre {
  margin: 0;

  padding: 17px;

  white-space: pre-wrap;

  word-break: break-word;

  font: inherit;

  background:
    rgba(255,255,255,.58);

  border:
    1px solid var(--line);

  border-radius: 16px;
}


.reader-body iframe {
  display: block;

  width: 100%;

  min-height: 420px;

  border: 0;

  border-radius: 14px;

  background: white;
}


/* =========================
   VERIFICATION FLOAT
========================= */

.verification-float {
  position: fixed;

  z-index: 1000;

  left: 50%;

  bottom: 18px;

  transform:
    translateX(-50%);

  display: flex;

  align-items: center;

  gap: 8px;

  min-height: 46px;

  padding: 0 14px;

  border:
    1px solid
    rgba(91,124,250,.22);

  border-radius: 15px;

  background:
    rgba(255,255,255,.95);

  color:
    #3155d8;

  box-shadow:
    0 12px 35px
    rgba(31,55,100,.18);

  backdrop-filter:
    blur(12px);

  cursor: pointer;

  font-size: 11px;

  font-weight: 700;
}


.verification-float:hover {
  transform:
    translateX(-50%)
    translateY(-2px);
}


.verification-float svg {
  width: 17px;
  height: 17px;
}


.verification-code-preview {
  padding:
    4px 7px;

  border-radius: 7px;

  background:
    rgba(91,124,250,.1);

  font:
    11px ui-monospace,
    monospace;
}


.verification-float.unavailable {
  opacity: .62;
}


/* =========================
   TOAST
========================= */

.toast {
  position: fixed;

  z-index: 2000;

  top: 16px;
  right: 16px;

  display: flex;

  align-items: center;

  gap: 10px;

  width:
    min(390px,calc(100vw - 32px));

  padding: 12px;

  border:
    1px solid
    rgba(91,124,250,.18);

  border-radius: 16px;

  background:
    rgba(255,255,255,.95);

  box-shadow:
    0 15px 40px
    rgba(31,55,100,.18);

  backdrop-filter:
    blur(13px);

  transform:
    translateY(-20px);

  opacity: 0;

  pointer-events: none;

  transition: .35s ease;
}


.toast.visible {
  transform:
    translateY(0);

  opacity: 1;

  pointer-events: auto;
}


.toast.error {
  border-color:
    rgba(255,92,112,.2);
}


.toast-icon {
  width: 30px;
  height: 30px;

  flex: none;

  display: grid;

  place-items: center;

  border-radius: 10px;

  background:
    rgba(47,191,113,.1);

  color: #24945a;
}


.toast.error .toast-icon {
  background:
    rgba(255,92,112,.1);

  color:
    var(--danger);
}


.toast-icon svg {
  width: 17px;
}


.toast-copy {
  display: flex;

  flex-direction: column;

  gap: 2px;

  min-width: 0;
}


.toast-copy strong {
  font-size: 11px;
}


.toast-copy small {
  font-size: 9px;

  color: var(--muted);

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;
}


.toast > button {
  margin-left: auto;

  border: 0;

  background: transparent;

  color: var(--muted);

  cursor: pointer;
}


.toast > button svg {
  width: 15px;
}


footer {
  text-align: center;

  color: var(--muted);

  font-size: 9px;

  padding:
    18px 0 4px;
}


/* =========================
   LOADING
========================= */

.spinner {
  display: inline-block;

  width: 15px;
  height: 15px;

  border:
    2px solid
    rgba(91,124,250,.22);

  border-top-color:
    var(--accent);

  border-radius: 50%;

  animation:
    spin .8s linear infinite;
}


.button.loading svg:first-child {
  display: none;
}


.button.loading:after {
  content: "";

  width: 14px;
  height: 14px;

  border:
    2px solid
    rgba(255,255,255,.35);

  border-top-color:
    currentColor;

  border-radius: 50%;

  animation:
    spin .8s linear infinite;
}


@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


/* =========================
   DARK MODE
========================= */

body.dark {
  --bg: #0b1019;

  --shell:
    rgba(17,24,36,.9);

  --panel:
    rgba(18,26,40,.94);

  --text:
    #eef3fb;

  --muted:
    #9aa7ba;

  --line:
    rgba(148,163,184,.15);

  --shadow:
    0 24px 70px
    rgba(0,0,0,.32);
}


body.dark .button.ghost,
body.dark .icon-button {
  background:
    rgba(255,255,255,.055);
}


body.dark .settings-menu {
  background:
    rgba(22,29,42,.98);

  border-color:
    rgba(148,163,184,.18);

  box-shadow:
    0 18px 45px
    rgba(0,0,0,.38);
}


body.dark
.settings-menu button,
body.dark
.settings-menu a {
  color:
    #e8edf5;
}


body.dark .reader-from {
  color:
    #e8edf5;
}


body.dark .reader-body pre {
  background:
    rgba(18,25,38,.9);
}


body.dark .verification-float,
body.dark .toast {
  background:
    rgba(20,28,42,.97);

  box-shadow:
    0 14px 38px
    rgba(0,0,0,.38);
}


/* =========================
   MOBILE
========================= */

@media (max-width: 760px) {

  .page {
    padding: 8px;
  }


  .shell {
    min-height:
      calc(100vh - 16px);

    padding:
      12px 11px 16px;

    border-radius: 30px;
  }


  .private-note {
    display: none;
  }


  .brand-mark {
    width: 43px;
    height: 43px;

    border-radius: 14px;
  }


  .brand-name {
    font-size: 11px;
  }


  .top-actions {
    gap: 7px;
  }


  .button.small {
    min-height: 33px;

    padding: 0 9px;
  }


  .intro {
    padding:
      25px 0 18px;
  }


  .intro h1,
  h1 {
    font-size: 25px;
  }


  .intro p {
    font-size: 10px;
  }


  .address-row {
    align-items:
      flex-start;

    flex-direction:
      column;

    padding:
      16px 14px;

    gap: 12px;
  }


  .address-value {
    font-size: 13px;
  }


  .address-actions {
    width: 100%;
  }


  .address-actions .button {
    flex: 1;
  }


  .inbox-layout {
    display: block;

    margin-top: 14px;
  }


  .panel {
    min-height: 0;
  }


  .reader-panel {
    display: none;

    margin-top: 14px;
  }


  .reader-panel.open {
    display: block;
  }


  .panel-head {
    min-height: 59px;

    padding: 0 15px;
  }


  .empty-state {
    min-height: 230px;

    padding: 24px 18px;
  }


  .reader-content {
    padding:
      18px 15px 76px;
  }


  .mobile-only {
    display: inline-flex;
  }


  .message-item {
    grid-template-columns:
      34px
      minmax(0,1fr)
      auto
      30px;
  }


  .reader-subject {
    font-size: 20px;
  }


  .reader-actions {
    width: 100%;
  }


  .reader-actions .button {
    flex: 1;

    justify-content: center;
  }


  .reader-body {
    font-size: 13px;

    padding-bottom: 85px;
  }


  .reader-body pre {
    padding: 15px;

    font-size: 13px;
  }


  .verification-float {
    bottom: 14px;

    max-width:
      calc(100vw - 28px);

    min-height: 44px;

    padding: 0 12px;
  }


  .verification-float
  .verification-float-text {
    font-size: 10px;
  }


  .verification-code-preview {
    font-size: 10px;
  }


  .toast {
    top: 16px;

    right: 16px;

    bottom: auto;

    left: 16px;

    width: auto;

    max-width: none;
  }

}