* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background-color: #f6f3ee;

  background-image: radial-gradient(rgba(0, 0, 0, 0.08) 2px, transparent 2px);

  background-size: 32px 32px;

  font-family: Inter, sans-serif;

  color: #000;
}

.container {
  height: 100vh;

  display: flex;

  flex-direction: column;

  padding: 16px;

  overflow: hidden;
}

.header {
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;

  font-size: 24px;
  font-weight: 900;

  margin-bottom: 10px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.hero-logo {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
}

.hero-logo img {
  width: 72px;
  height: 72px;
}

#currentEmail {
  margin-top: 12px;

  display: inline-block;

  background: #6ee7b7;

  border: 3px solid #000;

  padding: 10px 14px;

  font-size: 15px;

  font-weight: 700;

  box-shadow: 4px 4px 0 #000;
}

body.dark #currentEmail {
  color: #000;
}

.social-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.social-btn {
  text-decoration: none;
  color: #000;

  background: #ffe45c;

  border: 3px solid #000;

  padding: 8px 12px;

  font-weight: bold;

  box-shadow: 4px 4px 0 #000;
}

.email-box {
  background: white;

  border: 4px solid #000;

  box-shadow: 8px 8px 0 #000;

  padding: 16px;

  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  gap: 20px;
}

.actions {
  display: flex;
  gap: 10px;
}

button {
  border: 3px solid #000;

  background: #6ee7b7;

  padding: 10px 16px;

  cursor: pointer;

  font-weight: bold;

  box-shadow: 4px 4px 0 #000;

  transition: 0.15s;
}

button:hover {
  transform: translate(-1px, -1px);
}

button:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.layout {
  display: flex;

  gap: 16px;

  flex: 1;

  min-height: 0;
}

.sidebar {
  flex: 0 0 340px;

  max-width: 340px;
  min-width: 280px;

  overflow: auto;

  padding-right: 4px;
}

.viewer {
  position: relative;

  flex: 1;

  display: flex;

  flex-direction: column;

  border: 4px solid #000;

  box-shadow: 8px 8px 0 #000;

  background: white;

  overflow: hidden;
}

.viewer-header {
  padding: 12px 16px;

  background: #ffe45c;

  border-bottom: 3px solid #000;

  font-weight: 700;

  flex-shrink: 0;
}

body.dark .viewer-header {
  background: #ffe45c;

  color: #000;
}

#viewerFrame {
  flex: 1;

  width: 100%;

  height: 100%;

  border: none;

  display: none;
}

#welcomeScreen {
  height: 100%;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  text-align: center;
}

.welcome-icon {
  margin-bottom: 20px;

  animation: float 2s ease-in-out infinite;
}

.welcome-icon img {
  width: 90px;
  height: 90px;
}

@keyframes float {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }

  100% {
    transform: translateY(0);
  }
}

#welcomeScreen h1 {
  margin-bottom: 10px;
}

#welcomeScreen p {
  opacity: 0.7;
}

.email-card {
  background: white;

  border: 3px solid #000;

  box-shadow: 6px 6px 0 #000;

  padding: 14px;

  margin-bottom: 12px;

  cursor: pointer;
}

.email-card:hover {
  transform: translateY(-2px);
}

.email-sender {
  font-weight: 700;
  margin-bottom: 6px;
}

.email-subject {
  font-size: 14px;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.otp {
  display: inline-block;

  margin-top: 8px;

  background: #ffe45c;

  border: 2px solid #000;

  padding: 4px 8px;

  font-weight: bold;
}

.home {
  max-width: 900px;
  margin: 80px auto;
}

.hero {
  margin-bottom: 30px;
}

.hero h1 {
  font-size: 64px;
  font-weight: 900;
  margin-bottom: 10px;
}

.hero p {
  font-size: 20px;
}

.home-card {
  background: white;

  border: 4px solid #000;

  box-shadow: 8px 8px 0 #000;

  padding: 20px;

  display: flex;

  gap: 10px;
}

.home-card input {
  flex: 1;

  border: 3px solid #000;

  padding: 14px;
}

.footer {
  margin-top: 30px;
  opacity: 0.6;
}

body.dark {
  background: #151515;
  color: white;
}

body.dark .email-box,
body.dark .email-card,
body.dark .viewer,
body.dark .home-card {
  background: #242424;

  color: white;

  border-color: white;
}

body.dark button,
body.dark .social-btn {
  border-color: white;
}

body.dark .otp {
  color: black;
}

/* Laptop */

@media (max-width: 1400px) {
  .sidebar {
    flex: 0 0 300px;
    max-width: 300px;
  }
}

/* Tablet */

@media (max-width: 1024px) {
  html,
  body {
    overflow: auto;
  }

  .container {
    height: auto;
    min-height: 100vh;
  }

  .layout {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
    max-width: none;
    height: 260px;
  }

  .viewer {
    min-height: 600px;
  }
}

/* Mobile */

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .email-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    width: 100%;

    display: grid;

    grid-template-columns: repeat(3, 1fr);
  }

  .brand {
    font-size: 20px;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero-logo img {
    width: 56px;
    height: 56px;
  }
}

/* Small Mobile */

@media (max-width: 480px) {
  .social-links {
    width: 100%;
  }

  .social-btn {
    flex: 1;
    text-align: center;
  }

  .home {
    margin: 30px auto;
  }

  .welcome-icon img {
    width: 72px;
    height: 72px;
  }
}

/* =========================
   SPRINT 2.2
========================= */

#toast {
  position: fixed;

  bottom: 20px;

  right: 20px;

  background: #000;

  color: #fff;

  padding: 12px 18px;

  border: 3px solid #000;

  box-shadow: 6px 6px 0 #444;

  font-weight: bold;

  opacity: 0;

  transform: translateY(20px);

  transition: 0.25s;

  pointer-events: none;

  z-index: 9999;
}

#toast.show {
  opacity: 1;

  transform: translateY(0);
}

body.dark #toast {
  background: #fff;

  color: #000;

  border-color: #fff;

  box-shadow: 6px 6px 0 #666;
}

.empty-box {
  background: white;

  border: 3px solid #000;

  box-shadow: 6px 6px 0 #000;

  padding: 20px;

  text-align: center;
}

.empty-box h3 {
  margin-bottom: 8px;
}

.empty-box p {
  opacity: 0.7;
}

body.dark .empty-box {
  background: #242424;

  color: white;

  border-color: white;
}

.email-time {
  margin-top: 8px;

  font-size: 12px;

  opacity: 0.6;
}

.otp-copy {
  cursor: pointer;

  transition: 0.15s;
}

.otp-copy:hover {
  transform: translateY(-2px);
}

.otp-copy:active {
  transform: translateY(1px);
}

.email-card.active {
  background: #d9fbe8;
}

body.dark .email-card.active {
  background: #2d4a3a;
}
