:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f7f6;
  color: #15201d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(20, 125, 100, 0.13), transparent 32rem),
    linear-gradient(315deg, rgba(227, 68, 48, 0.08), transparent 28rem),
    #f4f7f6;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: #136f63;
  color: #fff;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 650;
}

button.secondary {
  background: #e9eeec;
  color: #1c2926;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar,
.account,
.controls,
.workspace {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(22, 46, 40, 0.12);
  box-shadow: 0 18px 40px rgba(28, 51, 45, 0.08);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-radius: 8px;
  padding: 20px 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #60716d;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 17px;
}

.status {
  border-radius: 999px;
  background: #e9eeec;
  color: #46615a;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status.ok {
  background: #dff5ec;
  color: #0e654d;
}

.status.bad {
  background: #ffe7e0;
  color: #9b2c17;
}

.controls {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto auto;
  gap: 14px;
  align-items: end;
  border-radius: 8px;
  margin-top: 16px;
  padding: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: #54645f;
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #ccd8d4;
  border-radius: 8px;
  background: #fff;
  color: #14201d;
  padding: 0 12px;
  outline: none;
}

input:focus {
  border-color: #136f63;
  box-shadow: 0 0 0 3px rgba(19, 111, 99, 0.12);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.check input {
  width: 18px;
  min-height: 18px;
}

.account {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-radius: 8px;
  margin-top: 16px;
  padding: 16px;
}

.label {
  display: block;
  margin-bottom: 5px;
  color: #667773;
  font-size: 13px;
  font-weight: 700;
}

#addressText {
  word-break: break-all;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.actions button {
  background: #e9eeec;
  color: #1c2926;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  min-height: 560px;
  border-radius: 8px;
  margin-top: 16px;
  overflow: hidden;
}

.listPane {
  border-right: 1px solid rgba(22, 46, 40, 0.12);
  background: #fbfcfc;
}

.paneHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(22, 46, 40, 0.12);
}

.paneHead span {
  color: #667773;
  font-size: 13px;
  font-weight: 700;
}

.mailList {
  max-height: 520px;
  overflow: auto;
}

.mailList.empty,
.mailDetail.muted {
  color: #6b7d78;
  padding: 18px;
}

.mailItem {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(22, 46, 40, 0.1);
  border-radius: 0;
  background: transparent;
  color: #15201d;
  padding: 14px 16px;
  text-align: left;
}

.mailItem:hover,
.mailItem.active {
  background: #eef7f4;
}

.mailItem strong,
.mailItem span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mailItem strong {
  font-size: 14px;
}

.mailItem span {
  color: #64756f;
  font-size: 12px;
}

.detailPane {
  min-width: 0;
  background: #fff;
}

.mailDetail {
  padding: 22px;
}

.meta {
  display: grid;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(22, 46, 40, 0.12);
}

.meta h2 {
  font-size: 22px;
}

.meta p {
  margin: 0;
  color: #64756f;
  word-break: break-word;
}

.body {
  margin-top: 18px;
  overflow: auto;
}

.body pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: #26332f;
  line-height: 1.55;
}

.body iframe {
  width: 100%;
  min-height: 420px;
  border: 1px solid rgba(22, 46, 40, 0.12);
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 820px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding: 10px 0;
  }

  .topbar,
  .account {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .listPane {
    border-right: 0;
    border-bottom: 1px solid rgba(22, 46, 40, 0.12);
  }

  .mailList {
    max-height: 300px;
  }
}
