* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, rgba(80,80,120,0.28), transparent 35%), #070707;
  color: white;
  overflow-x: hidden;
}

.auth-page,
.email-page {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
}

.inbox {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 88px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 16px 20px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(15,15,18,0.72);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.container {
  padding: 18px;
  overflow-y: auto;
}

.container h3 {
  font-size: 13px;
  opacity: 0.6;
  margin: 20px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card {
  background: rgba(255,255,255,0.075);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: .18s ease;
  overflow: hidden;
}

.card:hover {
  transform: scale(0.985);
  background: rgba(255,255,255,0.11);
}

.card b {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}

.card small {
  display: block;
  opacity: 0.55;
  font-size: 12px;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card span {
  opacity: 0.82;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.box {
  width: min(94vw, 620px);
  max-height: 88vh;
  overflow-y: auto;
  background: rgba(22,22,26,0.9);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.45);
}

#composer {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 100;
  width: min(94vw, 430px);
  display: none;
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

#composer.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#composer .composer-box {
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    background: rgba(22,22,26,0.94);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.55);
    backdrop-filter: blur(20px);
}

@media (max-width: 600px) {
    #composer {
        inset: auto 0 0 0;
        width: 100%;
        bottom: 0;
    }

    #composer .composer-box {
        height: auto;
        max-height: 82vh;
        border-radius: 26px 26px 0 0;
    }
}

#r-subject {
  margin: 0 0 8px;
  font-size: 24px;
}

#r-from {
  opacity: 0.62;
  font-size: 13px;
  word-break: break-word;
}

#r-frame {
  width: 100%;
  height: 420px;
  border: none;
  background: #fff;
  border-radius: 18px;
  margin-top: 16px;
}

input,
textarea {
  width: 100%;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  color: white;
  outline: none;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

button {
  padding: 13px 16px;
  border-radius: 16px;
  border: none;
  background: white;
  color: black;
  font-weight: 700;
  cursor: pointer;
}

.composer-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.composer-actions button {
  flex: 1;
}

.composer-actions button:last-child {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.18);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 8px;
  padding: 8px;
  background: rgba(22,22,26,0.72);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.bottom-nav a {
  color: white;
  text-decoration: none;
  padding: 10px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.72;
}

.bottom-nav a.active {
  background: white;
  color: black;
  opacity: 1;
}

@media (max-width: 600px) {
  .box,
  .composer-box {
    width: 100%;
    max-height: none;
    border-radius: 28px;
  }

  .email-page {
    align-items: flex-start;
  }

  #r-frame {
    height: calc(100dvh - 285px);
  }

  .composer-actions {
    flex-direction: column;
  }
}
