/* 1code house theme: dark, monochrome, emphasis by inversion. */
:root {
  --bg: radial-gradient(ellipse at top, #14171f 0%, #0b0d12 50%, #050608 100%);
  --text: #e8eaed;
  --strong: #fff;
  --muted: rgba(232, 234, 237, 0.55);
  --dim: #8a8e95;
  --accent: #6c7079;
  --panel: #000;
  --line: rgba(255, 255, 255, 0.08);
  --line-hover: rgba(255, 255, 255, 0.18);
  --hover: rgba(255, 255, 255, 0.04);
  --radius: 14px;
  --wordmark: 700 21px/1 Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 400 14px/1.5 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--strong); }

.wordmark { font: var(--wordmark); color: var(--strong); letter-spacing: -0.03em; text-decoration: none; }
.wordmark span { color: var(--dim); font-weight: 500; }

.btn {
  border: 1px solid var(--line-hover);
  background: transparent;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.35); }
.btn.primary { background: #fff; color: #000; border-color: #fff; font-weight: 600; }
.btn.primary:hover { background: #e8eaed; }

/* ---------- signed out / empty ---------- */
.center { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.card .wordmark { display: inline-block; margin-bottom: 28px; }
.card .btn.primary { padding: 12px 22px; font-size: 14px; width: 100%; }
.card p { color: var(--muted); margin: 0 0 20px; }
.card .note { margin: 16px 0 0; font-size: 13px; }
.card code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--dim); word-break: break-all; user-select: all; }

/* ---------- shell ---------- */
.shell { height: 100%; display: grid; grid-template-rows: 56px 1fr; }
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid var(--line);
}
.top .who { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.panes { display: grid; grid-template-columns: 232px 380px 1fr; min-height: 0; }

.side { border-right: 1px solid var(--line); padding: 14px 10px; overflow-y: auto; }
.box { margin-bottom: 10px; }
.box-name {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  background: none; border: 0; padding: 8px 10px; border-radius: 10px; text-align: left;
  color: var(--strong); font-weight: 600; font-size: 13px;
}
.box-name:hover { background: var(--hover); }
.folder {
  display: flex; justify-content: space-between; width: 100%;
  background: none; border: 0; padding: 7px 10px 7px 22px; border-radius: 10px;
  color: var(--muted); text-align: left; font-size: 13px;
}
.folder:hover { background: var(--hover); color: var(--text); }
.folder.on { background: #fff; color: #000; font-weight: 600; }
.count { font-variant-numeric: tabular-nums; }

.list { border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; }
.list-head { padding: 14px 18px 10px; color: var(--dim); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.row {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--line); padding: 12px 18px;
}
.row:hover { background: var(--hover); }
.row.on { background: rgba(255, 255, 255, 0.07); }
.row-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.row-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.row-time { color: var(--dim); font-size: 12px; flex: none; font-variant-numeric: tabular-nums; }
.row-subject, .row-snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-subject { color: var(--text); }
.row-snippet { color: var(--dim); font-size: 13px; }
.row.unread .row-from, .row.unread .row-subject { color: var(--strong); font-weight: 600; }
.row.unread .row-from::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; margin-right: 8px; vertical-align: middle;
}
.clip { width: 12px; height: 12px; vertical-align: -1px; margin-left: 6px; stroke: var(--dim); }
.empty { padding: 48px 18px; color: var(--dim); text-align: center; }
.more { display: block; margin: 14px auto; }

.reader { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.reader-head { padding: 20px 28px 16px; border-bottom: 1px solid var(--line); }
.reader-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.back { display: none; }
.reader h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.03em; color: var(--strong); margin: 0 0 12px; line-height: 1.3; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 13px; }
.meta dt { color: var(--dim); }
.meta dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.warn {
  margin-top: 14px; padding: 10px 14px; border-radius: 10px;
  background: #fff; color: #000; font-size: 13px; font-weight: 500;
}
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.att {
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12px;
  text-decoration: none; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.att:hover { border-color: var(--line-hover); }
.att span { color: var(--dim); margin-left: 6px; }
.body { flex: 1; min-height: 0; overflow: auto; }
/* Mail HTML renders on white, as senders design it. */
.body iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.body pre {
  margin: 0; padding: 22px 28px; white-space: pre-wrap; overflow-wrap: anywhere;
  font: 14px/1.6 Inter, system-ui, sans-serif; color: var(--text);
}
.reader .empty { margin: auto; }

@media (max-width: 1080px) {
  .panes { grid-template-columns: 200px 320px 1fr; }
}
/* Phone: one pane at a time. */
@media (max-width: 760px) {
  .top { padding: 0 16px; }
  .top .who .name { display: none; }
  .panes { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; display: flex; gap: 6px; overflow-x: auto; }
  .box { display: flex; gap: 4px; margin: 0; flex: none; }
  .box-name { display: none; }
  .folder { padding: 7px 12px; flex: none; width: auto; gap: 8px; }
  .list { border-right: 0; }
  .reader { display: none; }
  .shell.reading .list, .shell.reading .side { display: none; }
  .shell.reading .reader { display: flex; grid-row: 1 / -1; }
  .back { display: inline-block; }
  .reader-head { padding: 14px 16px; }
  .body pre { padding: 16px; }
}
