:root {
  --bg: #eef2ec;
  --ink: #18211d;
  --muted: #66736c;
  --line: #cbd6cf;
  --panel: #fbfdf8;
  --panel-strong: #f5f8ef;
  --accent: #096b58;
  --accent-strong: #064f42;
  --accent-soft: #dcebe4;
  --danger: #9f3a2e;
  --shadow: 0 24px 70px rgba(25, 42, 32, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", sans-serif;
  background:
    linear-gradient(120deg, rgba(9, 107, 88, 0.12), transparent 32%),
    linear-gradient(310deg, rgba(168, 93, 55, 0.14), transparent 38%),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.95;
  letter-spacing: 0;
}

.status {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(251, 253, 248, 0.72);
  text-align: center;
}

.workspace {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  min-height: 680px;
  border: 1px solid rgba(75, 96, 84, 0.24);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(251, 253, 248, 0.82);
  box-shadow: var(--shadow);
}

.inbox-panel {
  border-right: 1px solid var(--line);
  background: rgba(245, 248, 239, 0.78);
}

.address-box {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 8px;
}

input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 12px;
  color: var(--ink);
  background: white;
}

.address-row button,
.address-actions button {
  border-radius: 8px;
  padding: 12px 14px;
  color: white;
  background: var(--accent);
  font-weight: 700;
}

.address-row button:hover,
.address-actions button:hover {
  background: var(--accent-strong);
}

.address-actions {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 8px;
  margin-top: 10px;
}

.address-actions button:last-child {
  color: var(--accent);
  background: var(--accent-soft);
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.message-list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.message-item {
  display: grid;
  width: 100%;
  gap: 7px;
  padding: 16px 18px;
  color: var(--ink);
  background: rgba(251, 253, 248, 0.92);
  text-align: left;
}

.message-item:hover,
.message-item.active {
  background: white;
}

.message-subject {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader {
  min-width: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(251, 253, 248, 0.92));
}

.empty-state {
  display: grid;
  min-height: 100%;
  place-content: center;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.empty-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
}

.mail {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
}

.mail-head {
  padding: 26px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.mail-head h2 {
  margin: 0 0 14px;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

.mail-meta {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 14px;
}

.mail-body {
  min-width: 0;
  padding: 28px 30px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.68;
}

.html-frame {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0 0;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--accent);
  background: white;
  font-weight: 700;
}

.tab.active {
  color: white;
  background: var(--accent);
}

.notice {
  padding: 15px 18px;
  color: var(--danger);
  background: #fff3ee;
}

@media (max-width: 840px) {
  .shell {
    width: min(100vw - 20px, 680px);
    padding: 16px 0;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
    gap: 14px;
  }

  .status {
    width: 100%;
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .inbox-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .reader {
    min-height: 420px;
  }

  .address-row,
  .address-actions {
    grid-template-columns: 1fr;
  }
}
