:root {
  --bg: #08111f;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --text: #eff6ff;
  --muted: #a8bdd8;
  --line: rgba(255, 255, 255, 0.16);
  --primary: #60a5fa;
  --primary-strong: #2563eb;
  --success: #34d399;
  --danger: #fb7185;
  --warning: #fbbf24;
  --shadow: 0 30px 100px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(37, 99, 235, 0.32), transparent 32%),
    radial-gradient(circle at 90% 0%, rgba(52, 211, 153, 0.2), transparent 26%),
    linear-gradient(145deg, #08111f 0%, #111827 48%, #0f172a 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.hero {
  min-height: 560px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar,
.hero-grid,
.content-grid,
.panel-title-row,
.card-head,
.meta-grid,
.toggle-row,
.dialog-head {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  color: #07111f;
  background: linear-gradient(135deg, var(--success), var(--primary));
  box-shadow: 0 18px 40px rgba(96, 165, 250, 0.35);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.92rem;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.16);
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.16);
}

.status-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(251, 113, 133, 0.16);
}

.hero-grid {
  justify-content: space-between;
  gap: 28px;
}

.hero-copy {
  max-width: 660px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  letter-spacing: -0.055em;
}

h1 {
  max-width: 720px;
  font-size: clamp(3rem, 7vw, 6.1rem);
  line-height: 0.92;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.lead {
  max-width: 620px;
  margin: 26px 0;
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-btn,
.secondary-btn,
.small-btn,
.wide-btn,
.icon-btn {
  min-height: 48px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 850;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary-btn,
.wide-btn {
  padding: 0 22px;
  color: #07111f;
  background: linear-gradient(135deg, var(--success), var(--primary));
  box-shadow: 0 18px 42px rgba(96, 165, 250, 0.28);
}

.secondary-btn,
.small-btn,
.icon-btn {
  padding: 0 18px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.primary-btn:hover,
.secondary-btn:hover,
.small-btn:hover,
.wide-btn:hover,
.icon-btn:hover {
  transform: translateY(-2px);
}

.address-card,
.panel,
.message-dialog {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.06));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.address-card {
  width: min(430px, 100%);
  padding: 22px;
  border-radius: 28px;
}

.card-head,
.panel-title-row,
.dialog-head {
  justify-content: space-between;
  gap: 16px;
}

.card-head {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.email-display {
  min-height: 76px;
  display: flex;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: #dbeafe;
  background: rgba(0, 0, 0, 0.25);
  font-size: clamp(1rem, 2vw, 1.32rem);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.meta-grid {
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.meta-grid > div {
  flex: 1;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
}

.meta-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.76rem;
}

.content-grid {
  align-items: stretch;
  gap: 22px;
  margin-top: 22px;
}

.controls-panel {
  width: 360px;
  flex: 0 0 360px;
}

.inbox-panel {
  flex: 1;
  min-width: 0;
}

.panel {
  padding: 24px;
  border-radius: 30px;
}

.control-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.control-card {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-weight: 800;
}

.control-card input,
.control-card select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  color: var(--text);
  outline: 0;
  background: rgba(0, 0, 0, 0.22);
}

.control-card select option {
  color: #111827;
}

.toggle-row {
  justify-content: flex-start;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.last-updated {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 280px;
  margin-top: 22px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 24px;
  text-align: center;
  color: var(--muted);
}

.empty-state[hidden] {
  display: none;
}

.empty-icon {
  display: grid;
  place-items: center;
  min-width: 92px;
  height: 42px;
  margin-bottom: 18px;
  border-radius: 999px;
  color: #07111f;
  background: var(--primary);
  font-weight: 900;
}

.empty-state h3 {
  margin-bottom: 8px;
  color: var(--text);
}

.mail-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.mail-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
}

.mail-item h3 {
  margin-bottom: 7px;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.mail-item p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.mail-time {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.message-dialog {
  width: min(820px, calc(100% - 28px));
  max-height: 86vh;
  margin: auto;
  padding: 24px;
  border-radius: 28px;
  color: var(--text);
}

.message-dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
}

.icon-btn {
  width: 44px;
  min-height: 44px;
  padding: 0;
}

.message-meta {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.message-meta div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.message-meta dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.message-meta dd {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.message-body {
  max-height: 45vh;
  overflow: auto;
  padding: 18px;
  border-radius: 18px;
  color: #111827;
  background: #f8fafc;
  line-height: 1.7;
}

.message-body a {
  color: #2563eb;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  max-width: min(520px, calc(100% - 28px));
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(8, 17, 31, 0.92);
  box-shadow: var(--shadow);
  transform: translate(-50%, 160%);
  transition: transform 0.22s ease;
  font-weight: 800;
}

.toast.show {
  transform: translate(-50%, 0);
}

@media (max-width: 920px) {
  .hero-grid,
  .content-grid {
    flex-direction: column;
  }

  .controls-panel,
  .address-card {
    width: 100%;
    flex-basis: auto;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 9px;
  }

  .hero,
  .panel {
    border-radius: 24px;
    padding: 18px;
  }

  .topbar,
  .panel-title-row,
  .dialog-head,
  .meta-grid,
  .mail-item {
    align-items: stretch;
    flex-direction: column;
  }

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

  .primary-btn,
  .secondary-btn,
  .wide-btn {
    width: 100%;
  }

  .mail-item {
    display: flex;
  }

  .last-updated,
  .mail-time {
    white-space: normal;
  }
}
