:root {
  --bg: #0a0f1f;
  --bg-soft: #101935;
  --panel: rgba(11, 18, 36, 0.72);
  --panel-strong: rgba(17, 27, 52, 0.88);
  --ink: #e8f0ff;
  --muted: #9db3d7;
  --line: rgba(154, 185, 255, 0.16);
  --accent: #58e1ff;
  --accent-strong: #ff7a59;
  --lime: #c6ff72;
  --rose: #ff7fcf;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 20%, rgba(88, 225, 255, 0.22), transparent 18%),
    radial-gradient(circle at 80% 10%, rgba(255, 122, 89, 0.18), transparent 20%),
    radial-gradient(circle at 50% 85%, rgba(198, 255, 114, 0.14), transparent 22%),
    linear-gradient(135deg, #050913 0%, #0b1328 55%, #101633 100%);
}

.bg-orb,
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-orb {
  filter: blur(22px);
  opacity: 0.9;
}

.orb-a {
  background: radial-gradient(circle, rgba(88, 225, 255, 0.25), transparent 55%);
  transform: translate(-15%, -20%);
  animation: driftA 18s ease-in-out infinite alternate;
}

.orb-b {
  background: radial-gradient(circle, rgba(255, 127, 207, 0.18), transparent 55%);
  transform: translate(45%, 10%);
  animation: driftB 22s ease-in-out infinite alternate;
}

.bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
  opacity: 0.5;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.reveal {
  animation: riseIn 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.reveal-delay {
  animation-delay: 0.16s;
}

.sidebar,
.content {
  padding: 28px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand h1 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(2.2rem, 3vw, 3.4rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.eyebrow,
.card-label,
.metric-label,
.chip-label {
  margin: 0 0 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
}

.muted,
.toolbar-meta,
.metric-subtext,
.viewer-hint {
  color: var(--muted);
  line-height: 1.5;
}

.hero-stat-stack {
  display: grid;
  gap: 14px;
}

.metric-card,
.notice-card,
.domain-card,
.mailbox-item,
.message-item,
.message-viewer,
.status-chip {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-strong);
}

.metric-card::before,
.notice-card::before,
.message-viewer::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 180deg, transparent, rgba(88, 225, 255, 0.18), transparent 38%, rgba(255, 122, 89, 0.2), transparent 72%);
  animation: rotateHalo 12s linear infinite;
  opacity: 0.8;
}

.metric-card > *,
.notice-card > *,
.message-viewer > * {
  position: relative;
  z-index: 1;
}

.metric-card,
.notice-card,
.domain-card {
  padding: 18px;
}

.metric-primary {
  box-shadow: inset 0 0 0 1px rgba(88, 225, 255, 0.08), 0 0 42px rgba(88, 225, 255, 0.08);
}

.metric-warn {
  box-shadow: inset 0 0 0 1px rgba(255, 122, 89, 0.08), 0 0 42px rgba(255, 122, 89, 0.08);
}

.metric-value {
  display: block;
  font-family: "Syne", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.primary-button,
.secondary-button,
.danger-button {
  position: relative;
  border: 0;
  border-radius: 22px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.22s ease, filter 0.22s ease, opacity 0.22s ease;
}

.primary-button:hover:enabled,
.secondary-button:hover:enabled,
.danger-button:hover:enabled,
.magnetic-card:hover {
  transform: translateY(-3px) scale(1.01);
  filter: saturate(1.2);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary-button {
  background: linear-gradient(120deg, var(--accent), var(--rose), var(--accent-strong));
  color: #06111e;
  box-shadow: 0 12px 35px rgba(88, 225, 255, 0.25);
}

.pulse-button {
  animation: pulseFire 2.2s ease-in-out infinite;
}

.button-glow {
  position: absolute;
  inset: -20%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: translateX(-120%);
  animation: sweep 2.6s linear infinite;
}

.secondary-button {
  background: rgba(88, 225, 255, 0.12);
}

.danger-button {
  background: rgba(255, 122, 89, 0.18);
}

.rules {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.domain-value {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.2rem;
}

.sticky-heading,
.section-heading,
.toolbar,
.toolbar-actions,
.message-meta,
.mailbox-side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sticky-heading {
  margin-top: 4px;
}

.toolbar {
  align-items: flex-start;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.status-chip {
  padding: 14px 16px;
  animation: hoverWave 5s ease-in-out infinite;
}

.chip-ghost {
  color: var(--lime);
}

.grid {
  display: grid;
  grid-template-columns: minmax(290px, 410px) minmax(0, 1fr);
  gap: 20px;
  min-height: 0;
  flex: 1;
}

.inbox-column,
.viewer-column {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mailbox-list,
.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.mailbox-item,
.message-item {
  width: 100%;
  padding: 16px;
  text-align: left;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    var(--panel-strong);
}

.mailbox-item.active,
.message-item.active {
  border-color: rgba(88, 225, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(88, 225, 255, 0.28), 0 0 32px rgba(88, 225, 255, 0.12);
}

.mailbox-main,
.mailbox-side {
  display: grid;
  gap: 8px;
}

.mailbox-address,
.message-subject,
#selectedAddress {
  font-family: "Syne", sans-serif;
  letter-spacing: -0.03em;
}

.mailbox-created,
.mailbox-expiry,
.message-from,
.message-created {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.mailbox-arrow {
  color: var(--lime);
  font-weight: 700;
}

.pill {
  display: inline-flex;
  min-width: 34px;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(198, 255, 114, 0.12);
  color: var(--lime);
  font-weight: 700;
}

.accent-pill {
  background: rgba(88, 225, 255, 0.12);
  color: var(--accent);
}

.message-viewer {
  min-height: 480px;
  padding: 22px;
}

.viewer-header {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.viewer-body {
  line-height: 1.6;
}

.viewer-body iframe {
  width: 100%;
  min-height: 420px;
  border: 0;
  border-radius: 18px;
  background: white;
}

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent), var(--rose));
  border-radius: 999px;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes driftA {
  from { transform: translate(-20%, -18%) scale(1); }
  to { transform: translate(6%, 8%) scale(1.18); }
}

@keyframes driftB {
  from { transform: translate(42%, 8%) scale(1.05); }
  to { transform: translate(8%, 24%) scale(1.22); }
}

@keyframes rotateHalo {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulseFire {
  0%, 100% { box-shadow: 0 12px 35px rgba(88, 225, 255, 0.25); }
  50% { box-shadow: 0 18px 50px rgba(255, 122, 89, 0.34); }
}

@keyframes sweep {
  to { transform: translateX(120%); }
}

@keyframes hoverWave {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

@media (max-width: 1100px) {
  .shell,
  .grid,
  .status-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 14px;
  }

  .sidebar,
  .content {
    padding: 18px;
  }

  .toolbar,
  .toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
