
:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #ffffff;
  --surface: #f7f8fa;
  --line: #e4e7ec;
  --muted: #667085;
  --text: #101828;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --danger: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); }
button, input { font: inherit; }
button { color: inherit; }
.boot, .empty { display: grid; min-height: 100vh; place-items: center; color: var(--muted); }
.shell { display: grid; grid-template-columns: 250px minmax(320px, 430px) minmax(420px, 1fr); height: 100vh; overflow: hidden; }
.sidebar, .list-pane { border-right: 1px solid var(--line); min-width: 0; }
.sidebar { display: flex; flex-direction: column; padding: 22px 14px 16px; background: #fbfcfd; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 8px 24px; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; color: #fff; background: var(--blue); font-weight: 800; letter-spacing: -1px; }
.brand strong { display: block; font-size: 20px; letter-spacing: -.4px; }
.brand small { color: var(--muted); }
.mailbox-select { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.avatar { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #fff; background: #316fe8; font-weight: 700; }
.mailbox-copy { min-width: 0; text-align: left; }
.mailbox-copy strong, .mailbox-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mailbox-copy small { color: var(--muted); }
.nav { display: grid; gap: 3px; margin-top: 18px; }
.nav-button { display: flex; align-items: center; justify-content: space-between; padding: 10px 11px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; }
.nav-button:hover, .nav-button.active { color: var(--blue); background: var(--blue-soft); }
.add-mailbox { display: flex; gap: 10px; align-items: center; margin-top: 22px; padding: 13px 10px; border: 0; border-top: 1px solid var(--line); background: transparent; cursor: pointer; color: #344054; }
.plus { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid #98a2b3; border-radius: 50%; }
.private { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--line); }
.private strong, .private small { display: block; }
.private small { margin-top: 3px; color: var(--muted); }
.list-pane { display: flex; flex-direction: column; background: #fff; min-height: 0; }
.search-wrap { display: flex; gap: 10px; padding: 18px; border-bottom: 1px solid var(--line); }
.search { width: 100%; padding: 10px 13px; border: 1px solid #d0d5dd; border-radius: 7px; outline: none; }
.search:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #dbeafe; }
.list-head { display: flex; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.list-head span:last-child { color: var(--muted); }
.message-list { overflow-y: auto; }
.message-row { position: relative; display: block; width: 100%; padding: 15px 18px 15px 28px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; }
.message-row:hover { background: #f9fafb; }
.message-row.active { background: var(--blue-soft); box-shadow: inset 3px 0 var(--blue); }
.message-row.unread::before { content: ""; position: absolute; left: 13px; top: 22px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.row-top { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; }
.row-top strong, .subject, .preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-top strong { font-size: 14px; }
.row-top time { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.subject { margin-top: 5px; font-size: 14px; }
.preview { margin-top: 4px; color: var(--muted); font-size: 13px; }
.reader { min-width: 0; overflow-y: auto; }
.reader-empty { display: grid; height: 100%; place-items: center; color: var(--muted); }
.reader-head { padding: 28px 34px 18px; border-bottom: 1px solid var(--line); }
.reader-head h1 { margin: 0 0 22px; font-size: clamp(23px, 2.2vw, 32px); letter-spacing: -.6px; }
.sender { display: flex; gap: 12px; align-items: center; }
.sender-details { min-width: 0; }
.sender-details strong, .sender-details span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sender-details span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.sender time { margin-left: auto; color: var(--muted); font-size: 13px; }
.reader-body { max-width: 850px; padding: 34px; white-space: pre-wrap; font-family: inherit; font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.toolbar { display: flex; gap: 8px; padding: 12px 34px; border-bottom: 1px solid var(--line); }
.tool { padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
.tool:hover { border-color: #98a2b3; }
.error { margin: 12px 18px; padding: 11px; border-radius: 7px; color: var(--danger); background: #fef3f2; font-size: 13px; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 210px minmax(300px, 1fr); }
  .reader { position: fixed; inset: 0; z-index: 5; background: #fff; transform: translateX(100%); transition: transform .2s ease; }
  .reader.open { transform: translateX(0); }
  .mobile-back { display: inline-block !important; }
}
@media (max-width: 640px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
.mobile-back { display: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
