:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #25312f;
  background: #f6f7f4;
  font-size: 15px;
  --green: #245c49;
  --line: #e1e6df;
  --muted: #758079;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 10px 15px;
  color: inherit;
}
button:hover {
  background: #edf2ec;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #d7dfd5;
  border-radius: 7px;
  padding: 11px;
  background: white;
  color: inherit;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #8cbaa5;
  outline-offset: 1px;
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 550;
  margin-bottom: 16px;
}
label input,
label select,
label textarea {
  display: block;
  margin-top: 7px;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  font-size: 2rem;
  font-weight: 550;
  letter-spacing: -1px;
  margin-bottom: 8px;
}
h2 {
  font-size: 1.1rem;
  font-weight: 600;
}
p {
  line-height: 1.6;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.8rem;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.primary:hover {
  background: #184735;
}
.brand {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.7px;
}
.brand span {
  font-weight: 400;
  color: var(--muted);
}
.brand-dot {
  color: #71a08a !important;
}
.login-card {
  width: min(430px, calc(100% - 40px));
  margin: 12vh auto;
  padding: 35px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.login-card .brand {
  margin-bottom: 45px;
}
.login-card h1 {
  font-size: 2.4rem;
  line-height: 1.2;
}
.login-card form {
  margin: 30px 0;
}
.login-card .primary {
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.login-card > .small {
  margin-bottom: 0;
}
#workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}
[hidden] {
  display: none !important;
}
.sidebar {
  padding: 30px 20px;
  background: #eef2eb;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 30px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .primary {
  width: 100%;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav-button {
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
  padding: 12px;
  border-radius: 7px;
}
.nav-button.active {
  background: #dfe9dd;
  color: #1c503a;
  font-weight: 600;
}
.sidebar-bottom {
  margin-top: auto;
}
.sidebar-bottom #identity {
  padding: 18px 10px 2px;
  overflow-wrap: anywhere;
}
progress {
  width: 100%;
  height: 5px;
  accent-color: var(--green);
  margin: 12px 0 20px;
}
.main {
  padding: 32px 36px;
  min-width: 0;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 0.67rem;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 9px;
}
.header-tools {
  display: flex;
  gap: 8px;
}
.header-tools input {
  max-width: 260px;
}
.mail-layout {
  display: grid;
  grid-template-columns: minmax(250px, 36%) minmax(0, 1fr);
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  min-height: 68vh;
  overflow: hidden;
}
#message-list {
  border-right: 1px solid var(--line);
  max-height: 75vh;
  overflow-y: auto;
}
.message-row {
  width: 100%;
  display: block;
  border: 0;
  border-bottom: 1px solid #eef0eb;
  border-radius: 0;
  text-align: left;
  padding: 20px;
  background: white;
}
.message-row.selected {
  background: #eef4ed;
}
.message-row.unread {
  border-left: 3px solid #44765a;
  padding-left: 17px;
}
.message-row .sender-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.8rem;
}
.message-row .subject {
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-row.unread .subject {
  font-weight: 650;
}
.message-row time {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}
.message-row .sender-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#reader {
  padding: 28px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.empty {
  padding: 100px 20px;
  text-align: center;
  color: var(--muted);
}
.empty h2 {
  color: #58675b;
}
.empty p {
  font-size: 0.85rem;
}
.empty-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 20px;
}
.reader-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 25px;
}
.reader-actions button {
  font-size: 0.8rem;
  padding: 8px 10px;
}
.message-meta {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.8;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.message-text {
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.message-html {
  border: 0;
  width: 100%;
  height: 440px;
  background: white;
}
.attachment {
  display: block;
  margin: 8px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--green);
  text-decoration: none;
  font-size: 0.85rem;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
  color: var(--muted);
  font-size: 0.8rem;
}
.pagination button {
  font-size: 0.8rem;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 20px;
}
.settings-grid .card {
  margin-bottom: 0;
}
.card p {
  font-size: 0.88rem;
}
.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}
.status-box {
  background: white;
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 10px;
}
.status-box strong {
  display: block;
  font-size: 1.25rem;
  margin-top: 10px;
}
.user-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.user-item:last-child {
  border: 0;
}
.user-item header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.user-item .user-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.user-item button {
  font-size: 0.8rem;
  padding: 7px 10px;
}
.alias-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  background: #f1f4ef;
  border-radius: 6px;
  margin: 4px;
  font-size: 0.8rem;
}
.audit-row {
  font-size: 0.78rem;
  line-height: 1.6;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
dialog {
  width: min(730px, calc(100% - 25px));
  max-height: 94vh;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 25px 100px #182a302e;
}
dialog::backdrop {
  background: #182a3055;
}
.compose-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.compose-header h2 {
  margin: 0;
}
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
textarea {
  resize: vertical;
}
.compose-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.attachment-input input {
  font-size: 0.8rem;
}
.body-label {
  margin-bottom: 8px;
}
#notice {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(650px, 90vw);
  padding: 15px 22px;
  background: #253c31;
  color: white;
  border-radius: 10px;
  box-shadow: 0 4px 25px #0002;
  z-index: 100;
  line-height: 1.5;
  font-size: 0.9rem;
}
#notice.error {
  background: #7c352e;
}
#storage {
  overflow-wrap: anywhere;
}
.back-list {
  display: none;
}
.confirm-card {
  padding: 30px;
}
.danger {
  color: #9a413a;
}
@media (max-width: 1100px) {
  .main {
    padding: 25px 20px;
  }
  .sidebar {
    padding: 25px 14px;
  }
  #workspace {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .mail-layout {
    grid-template-columns: 42% minmax(0, 1fr);
  }
  #reader {
    padding: 20px;
  }
  .status-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 760px) {
  #workspace {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
    gap: 15px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar > .brand {
    display: none;
  }
  .sidebar > .primary {
    width: auto;
    align-self: flex-start;
  }
  .sidebar nav {
    flex-direction: row;
    overflow-x: auto;
  }
  .sidebar nav button {
    white-space: nowrap;
    width: auto;
    font-size: 0.85rem;
    padding: 9px;
  }
  .sidebar-bottom {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }
  .sidebar-bottom progress,
  #storage {
    display: none;
  }
  .sidebar-bottom .nav-button {
    width: auto;
    font-size: 0.75rem;
    padding: 7px;
  }
  .sidebar-bottom #identity {
    padding: 7px;
    font-size: 0.75rem;
    order: -1;
  }
  .main {
    padding: 22px 12px;
  }
  .page-header {
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 18px;
  }
  .header-tools {
    width: 100%;
  }
  .header-tools form {
    flex: 1;
  }
  .header-tools input {
    max-width: none;
  }
  .mail-layout {
    display: block;
    min-height: 50vh;
  }
  #message-list {
    border: 0;
    max-height: none;
  }
  #reader {
    display: none;
  }
  .mail-layout.reading #message-list {
    display: none;
  }
  .mail-layout.reading #reader {
    display: block;
  }
  .back-list {
    display: inline-block;
  }
  .empty {
    padding: 70px 15px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 20px;
  }
  .status-box {
    padding: 14px;
  }
  .two-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }
  dialog {
    padding: 18px;
  }
  .compose-footer .small {
    width: 100%;
  }
}
