:root {
  --bg: #101418;
  --panel: #171d24;
  --line: #262f3a;
  --text: #dbe4ee;
  --dim: #7c8a99;
  --accent: #62a8ff;
  --danger: #ff7a76;
  --unseen: #cfe4ff;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
}
body.centered { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.dim { color: var(--dim); }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
main { padding: 18px 22px 60px; max-width: 1200px; margin: 0 auto; }
h1 { font-size: 19px; margin: 14px 0 8px; font-weight: 600; }
h2 { font-size: 16px; margin: 26px 0 8px; }

nav.top {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px 16px;
}
nav .brand { font-weight: 700; letter-spacing: .3px; }
nav .folders { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
nav .folders a {
  color: var(--text); padding: 4px 9px; border-radius: 6px; font-weight: 500;
}
nav .folders a.active { background: var(--line); }
nav .folders a b.badge {
  background: var(--accent); color: #08131f; border-radius: 9px;
  font-size: 11px; padding: 0 6px; margin-left: 2px;
}
nav .right { display: flex; gap: 14px; align-items: center; }
nav .right a { color: var(--text); }
button.link { background: none; border: none; color: var(--text); cursor: pointer; font: inherit; padding: 0; }
button.link:hover { color: var(--accent); text-decoration: underline; }
button.link.danger, .danger { color: var(--danger); }
form.inline { display: inline; }

.flash {
  margin: 12px 22px 0; padding: 9px 14px; border-radius: 8px;
  background: #14324a; border: 1px solid #234d6e; color: #bfe0ff;
  word-break: break-word;
}
.error {
  margin: 10px 0; padding: 9px 12px; border-radius: 8px;
  background: #3a1b1e; border: 1px solid #6e2a2f; color: #ffc3c1;
}

.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 34px 38px; width: 330px; text-align: center;
}
.login-card h1 { font-size: 20px; margin: 0 0 18px; }
.login-card input {
  width: 100%; margin: 7px 0; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.login-card button {
  width: 100%; margin-top: 10px; padding: 10px; border-radius: 8px; border: none;
  background: var(--accent); color: #08131f; font-weight: 700; cursor: pointer;
}

.listhead { display: flex; align-items: baseline; gap: 14px; }
table { border-collapse: collapse; width: 100%; }
table.mail td, table.mail th, table.accts td, table.accts th {
  border-bottom: 1px solid var(--line); padding: 7px 10px; text-align: left;
}
table th { color: var(--dim); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
table.mail td a { color: var(--text); }
tr.unseen td { background: #131a22; }
tr.unseen td.subjectcell a, tr.unseen td a { color: var(--unseen); font-weight: 600; }
td.dotcol { width: 14px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
td.from, td.to { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 26px; text-align: center; }
.pager { display: flex; gap: 18px; justify-content: center; padding: 14px; }

.crumbs { margin: 4px 0; }
.msghead h1 { margin: 6px 0 12px; }
table.meta th { width: 90px; text-align: left; color: var(--dim); font-weight: 500; padding: 3px 10px 3px 0; vertical-align: top; }
table.meta td { padding: 3px 0; }
table.meta, table.meta td { border: none; }
.attachments { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 4px 12px; color: var(--text) !important;
}
.rawhdr summary { color: var(--dim); cursor: pointer; margin-top: 8px; }
.rawhdr pre { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto; font-size: 12px; }
.msgbody { margin-top: 16px; }
.msgbody iframe { width: 100%; min-height: 480px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.msgbody pre.plain {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px; white-space: pre-wrap; word-break: break-word; overflow-x: auto;
}
.plaintext summary { color: var(--dim); cursor: pointer; margin: 10px 0; }

.compose label { display: block; margin: 10px 0; max-width: 640px; }
.compose input, .compose textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 12px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: inherit;
}
.compose textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.compose button {
  margin-top: 12px; padding: 10px 26px; border-radius: 8px; border: none;
  background: var(--accent); color: #08131f; font-weight: 700; cursor: pointer;
}
