:root {
  color-scheme: light;
  font-family: "Inter", system-ui, sans-serif;
  color: #202721;
  background: #f5f5f1;
  --muted: #5e6961;
  --border: #dfe4dd;
  --green: #25563d;
  --green-dark: #18442e;
  --tint: #e7efe7;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #327552; outline-offset: 3px; }
h1, h2, p, ul, dl, dd { margin: 0; }
[hidden] { display: none !important; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.04em;
  white-space: nowrap;
}

.mark {
  width: 29px;
  height: 24px;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--green);
  overflow: hidden;
}

.mark::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 5px;
  width: 17px;
  height: 17px;
  border: solid white;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.auth {
  min-height: 100dvh;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 28px 18px;
}

.auth-layout { width: min(100%, 426px); }
.auth-layout > .brand { display: flex; justify-content: center; margin: 0 0 18px; }
.auth-card, .mail-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
}
.auth-card { padding: 28px 32px 32px; box-shadow: 0 14px 38px #263d2810; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: #f0f3ef;
  border-radius: 10px;
  margin-bottom: 27px;
}
.auth-tabs a { padding: 8px 6px; text-align: center; font-size: 14px; font-weight: 600; color: var(--muted); border-radius: 7px; }
.auth-tabs a[aria-current] { color: var(--green-dark); background: #fff; box-shadow: 0 1px 3px #1b33221a; }
h1 { font-size: clamp(23px, 4.5vw, 29px); font-weight: 690; letter-spacing: -.055em; line-height: 1.15; }
.auth-card h1 { margin-bottom: 25px; text-align: center; }
label { display: block; margin: 16px 0 7px; font-size: 14px; font-weight: 650; }
input, textarea, .address-input {
  width: 100%;
  border: 1px solid #cbd4cc;
  border-radius: 9px;
  color: inherit;
  background: white;
  min-height: 45px;
}
input, textarea { padding: 11px 12px; }
input::placeholder { color: #707c73; }
textarea { display: block; resize: vertical; min-height: 140px; }
.address-input { display: flex; align-items: stretch; overflow: hidden; }
.address-input:focus-within { outline: 2px solid #327552; outline-offset: 2px; }
.address-input input { border: 0; min-width: 0; min-height: auto; outline: none; }
.address-input span {
  align-content: center;
  padding: 0 10px;
  flex: 0 0 auto;
  background: #f0f4ef;
  border-left: 1px solid var(--border);
  color: #425747;
  font-size: clamp(11px, 3vw, 13px);
  white-space: nowrap;
}
.password-input { position: relative; }
.password-input input { padding-right: 50px; }
.password-input input::-ms-reveal { display: none; }
.password-toggle {
  position: absolute;
  display: grid;
  place-items: center;
  inset: 4px 4px 4px auto;
  width: 39px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--green-dark);
}
.password-toggle:hover { background: var(--tint); }
.eye {
  position: relative;
  display: grid;
  place-items: center;
  width: 15px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 62% 30%;
  transform: rotate(17deg);
}
.eye::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.password-toggle[aria-pressed="true"] .eye::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  box-shadow: 0 -1.5px 0 white;
  transform: rotate(-55deg);
}
.help { display: block; color: var(--muted); margin-top: 7px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 650;
}
.primary { background: var(--green); color: #fff; }
.primary:hover { background: var(--green-dark); }
.full { width: 100%; margin-top: 23px; min-height: 44px; }
.quiet { color: var(--green-dark); background: transparent; }
.quiet:hover { background: var(--tint); }
.secondary { color: var(--green-dark); background: #fff; border-color: var(--border); }
.secondary:hover { background: #f3f7f2; }
.feedback { padding: 10px 12px; border-radius: 7px; font-size: 14px; }
.error { background: #fbece9; color: #8c2e26; margin-top: 14px; }
.notice { background: var(--tint); margin: 15px 22px 0; color: var(--green-dark); }

.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 70px;
  max-width: 1136px;
  padding: 0 26px;
  margin: auto;
}
.account { margin-left: auto; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.workspace {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  gap: 22px;
  max-width: 1136px;
  margin: 0 auto;
  padding: 32px 26px;
}
.compose { width: 100%; min-height: 44px; margin-bottom: 18px; }
.compose span { font-size: 18px; line-height: 1; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 14px;
  white-space: nowrap;
}
.sidebar nav a:hover, .sidebar nav a[aria-current] { background: var(--tint); color: var(--green-dark); }
.sidebar nav a[aria-current] { font-weight: 680; }
.folder-icon { width: 14px; height: 11px; border: 1.5px solid currentColor; border-radius: 3px; flex: 0 0 auto; }
.folder-icon.sent { transform: rotate(-35deg); border-radius: 2px 50% 50% 2px; }
.mail-card { min-height: 440px; overflow: hidden; }
.mail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 76px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.mail-heading .button { flex-shrink: 0; }
.empty { display: grid; justify-items: center; align-content: center; min-height: 350px; padding: 20px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 20px; background: var(--tint); margin-bottom: 15px; }
.empty h2 { letter-spacing: -.025em; font-size: 19px; }
.copy { margin-top: 6px; overflow-wrap: anywhere; }
.copy-status { color: var(--muted); font-size: 12px; min-height: 1.2em; }
.message-list { padding: 0; list-style: none; }
.message-list a {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr) auto;
  gap: 12px;
  padding: 14px 22px;
  align-items: center;
  border-bottom: 1px solid #edf0ec;
  font-size: 14px;
}
.message-list a:hover { background: #f4f8f3; }
.message-list :is(strong, .message-peer) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-list time { color: var(--muted); font-size: 12px; }
.more { margin: 12px; }
.read-mail, .write-form { padding: 16px 22px 24px; }
.back, .attachments a { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.read-mail h2 { margin: 18px 0; overflow-wrap: anywhere; }
.read-mail dl { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 5px; font-size: 14px; }
.read-mail dt { color: var(--muted); }
.read-mail dd, .attachments li { overflow-wrap: anywhere; }
.message-body { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 18px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.attachments { padding-left: 20px; margin-top: 18px; }
.write-form label:first-of-type { margin-top: 0; }
.write-form button { margin-top: 16px; }

@media (max-width: 680px) {
  .topbar-inner { min-height: 60px; padding: 0 14px; gap: 8px; flex-wrap: wrap; }
  .topbar-inner .account { max-width: 52%; }
  .topbar-inner form { margin-left: auto; }
  .workspace { display: block; padding: 15px 12px; }
  .sidebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
  .sidebar nav { display: flex; gap: 2px; white-space: nowrap; }
  .sidebar nav a { gap: 5px; padding: 7px; font-size: 13px; }
  .sidebar nav .folder-icon { display: none; }
  .compose { width: auto; margin: 0; min-height: 39px; }
  .mail-heading { min-height: 61px; padding: 12px; }
  .auth-card { padding: 20px 17px 24px; }
  .message-list a { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px; }
  .message-list strong { grid-row: 2; grid-column: span 2; }
  .read-mail, .write-form { padding: 15px 12px; }
}
