:root {
  color-scheme: light;
  --ink: #183037;
  --muted: #6c7b7e;
  --line: #e1e8e6;
  --paper: #f6f8f5;
  --white: #fff;
  --teal: #126b68;
  --teal-dark: #0d5553;
  --teal-pale: #e6f1ed;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #76b9b0; outline-offset: 3px; }
[hidden] { display: none !important; }

.grain { pointer-events: none; position: fixed; inset: 0; opacity: .13; background-image: radial-gradient(#b8c8c3 0.6px, transparent 0.6px); background-size: 6px 6px; z-index: 0; }
.eyebrow { margin: 0 0 14px; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .19em; text-transform: uppercase; }
.brand, .auth-brand { display: flex; align-items: center; gap: 11px; font-size: 25px; font-weight: 800; letter-spacing: -.055em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--teal); color: white; font-size: 23px; font-weight: 400; }
.primary-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 50px; border: 0; border-radius: 12px; padding: 13px 18px; background: var(--teal); color: white; font-weight: 700; transition: background .15s, transform .15s; }
.primary-button:not(:disabled):hover { background: var(--teal-dark); transform: translateY(-1px); }
.primary-button span { font-size: 21px; line-height: 1; font-weight: 400; }
.error-message { color: #a53232; font-size: 14px; line-height: 1.5; }

/* Passkey screens */
.auth-layout { min-height: 100vh; position: relative; z-index: 1; display: flex; flex-direction: column; padding: 34px 5vw 24px; background: radial-gradient(circle at 80% 18%, #e8f2e7, transparent 35%), radial-gradient(circle at 12% 85%, #e5f0ec, transparent 38%); }
.auth-brand { color: var(--ink); }
.auth-card { width: min(100%, 490px); margin: auto; padding: 45px 46px 43px; background: rgba(255,255,255,.92); border: 1px solid #e7eeeb; border-radius: 24px; box-shadow: 0 24px 70px rgba(25, 67, 62, .09); }
.lock-icon { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 31px; border-radius: 15px; background: var(--teal-pale); color: var(--teal); font-size: 32px; }
.auth-card h1 { margin: 0; font-size: clamp(38px, 5vw, 53px); font-weight: 730; line-height: 1.08; letter-spacing: -.07em; }
.auth-card h1 em { color: var(--teal); font-style: normal; }
.auth-copy { max-width: 365px; margin: 21px 0 32px; color: var(--muted); line-height: 1.65; font-size: 15px; }
.auth-card form { display: grid; gap: 10px; }
.auth-card label { color: var(--ink); font-size: 13px; font-weight: 750; }
.auth-card input { width: 100%; min-height: 52px; padding: 12px 15px; border: 1px solid #d8e3de; border-radius: 11px; background: #fcfdfc; color: var(--ink); }
.auth-card input::placeholder { color: #a2adab; }
.auth-card form .primary-button { margin-top: 12px; }
.auth-card > .primary-button { width: 100%; }
.auth-hint { margin: 22px 0 0; color: #899895; font-size: 12px; line-height: 1.5; }
.auth-card .error-message { margin: 17px 0 0; }
.auth-footer { display: flex; justify-content: space-between; color: #7d908c; font-size: 12px; font-weight: 600; }
.auth-footer span:first-child::before { content: "●"; color: #44a68b; font-size: 9px; margin-right: 8px; }

/* Mail workspace */
.app-layout { position: relative; z-index: 1; display: flex; min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; width: 250px; min-width: 250px; min-height: 100vh; padding: 28px 17px 19px; background: #f9fbf9; border-right: 1px solid var(--line); }
.sidebar .brand { padding: 0 13px; margin-bottom: 39px; }
.account-card { display: flex; align-items: center; gap: 11px; margin: 0 4px 28px; padding: 12px 9px; background: white; border: 1px solid var(--line); border-radius: 13px; }
.account-avatar, .message-avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--teal-pale); color: var(--teal); font-weight: 800; }
.account-card div { min-width: 0; }
.account-card strong, .account-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-card strong { font-size: 13px; }
.account-card small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; width: 100%; gap: 13px; min-height: 43px; padding: 10px 13px; border: none; border-radius: 10px; background: transparent; color: #5c7272; font-size: 13px; font-weight: 650; text-align: left; }
.nav-item:hover, .nav-item.active { background: var(--teal-pale); color: var(--teal-dark); }
.nav-icon { width: 21px; font-size: 18px; font-weight: 400; text-align: center; }
.sidebar-bottom { margin-top: auto; }
.security-card { display: flex; align-items: flex-start; gap: 10px; margin: 12px 2px 17px; padding: 14px 13px; border-radius: 13px; background: #e8f3ed; }
.security-dot, .topbar-private span { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #53ad82; box-shadow: 0 0 0 4px rgba(83,173,130,.11); }
.security-card strong, .security-card small { display: block; }
.security-card strong { color: #2d6954; font-size: 12px; }
.security-card small { margin-top: 4px; color: #69917b; font-size: 11px; }
.logout-button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 14px; border: 0; background: transparent; color: #7a8b89; font-size: 12px; font-weight: 700; }
.logout-button:hover { color: var(--teal-dark); }
.logout-button span { font-size: 18px; }
.workspace { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 72px; padding: 0 38px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.56); }
.topbar > div { display: flex; align-items: center; gap: 15px; min-width: 0; }
.topbar-label { color: var(--teal); font-size: 10px; font-weight: 850; letter-spacing: .16em; white-space: nowrap; }
.topbar-divider { width: 1px; height: 17px; background: #d4e0dc; }
.topbar-address { overflow: hidden; text-overflow: ellipsis; color: #8b9b98; font-size: 12px; white-space: nowrap; }
.topbar-private { display: flex; align-items: center; gap: 10px; color: #698379; font-size: 11px; font-weight: 700; white-space: nowrap; }
.topbar-private span { margin: 0; }
.view { display: none; max-width: 1350px; margin: 0 auto; padding: 49px 46px; }
.view.active { display: block; }
.view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.view-heading h1 { margin: 0; font-size: clamp(37px, 4vw, 52px); letter-spacing: -.065em; line-height: 1.1; }
.heading-period { color: var(--teal); }
.view-subtitle { margin: 12px 0 0; color: #899995; font-size: 14px; }
.outline-button { display: inline-flex; align-items: center; gap: 8px; height: 39px; padding: 0 14px; border: 1px solid #dae5df; border-radius: 10px; background: white; color: #4a6664; font-size: 12px; font-weight: 700; }
.outline-button:hover { border-color: #96c7ba; color: var(--teal); }
.outline-button:first-letter { font-size: 19px; }
.inbox-grid { display: grid; grid-template-columns: minmax(260px, 39%) minmax(300px, 1fr); min-height: 570px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 12px 34px rgba(39,72,64,.035); }
.message-list { border-right: 1px solid var(--line); max-height: 720px; overflow-y: auto; }
.message-item { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; column-gap: 10px; align-items: center; width: 100%; padding: 17px 17px; border: 0; border-bottom: 1px solid #eff3ef; background: white; color: var(--ink); text-align: left; }
.message-item:hover, .message-item.selected { background: #f1f8f4; }
.message-avatar { grid-row: 1 / 3; }
.message-sender { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 750; }
.message-date { color: #a0afab; font-size: 10px; white-space: nowrap; }
.message-subject { grid-column: 2 / 4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #52686a; font-size: 12px; font-weight: 500; }
.message-detail { min-width: 0; padding: 33px 34px; }
.detail-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 480px; color: #a0aeaa; text-align: center; }
.detail-placeholder span { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 22px; background: #f0f7f2; color: #8db5a4; font-size: 35px; }
.detail-placeholder h2 { margin: 20px 0 6px; color: #597371; font-size: 16px; }
.detail-placeholder p { max-width: 245px; margin: 0; font-size: 12px; line-height: 1.6; }
.detail-header h2 { margin: 0; overflow-wrap: anywhere; font-size: 27px; line-height: 1.2; letter-spacing: -.035em; }
.detail-meta { margin: 24px 0; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #70827f; font-size: 12px; }
.detail-meta p { margin: 4px 0; overflow-wrap: anywhere; }
.detail-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #415556; font-family: inherit; font-size: 14px; line-height: 1.75; }
.attachment-note { margin-top: 28px; padding: 13px 15px; border-radius: 10px; background: #f4f7f4; color: #6c817d; font-size: 12px; }
.loading, .empty-state { padding: 28px; color: #95a5a0; font-size: 13px; line-height: 1.6; }
.compose-card { overflow: hidden; max-width: 850px; padding: 25px 31px 24px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 12px 34px rgba(39,72,64,.035); }
.compose-row { display: flex; align-items: center; gap: 20px; min-height: 60px; border-bottom: 1px solid #edf1ee; }
.compose-row label { width: 55px; flex: none; color: #879995; font-size: 12px; font-weight: 700; }
.compose-row input { flex: 1; min-width: 0; padding: 11px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.compose-row select { flex: 1; min-width: 0; padding: 11px 28px 11px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; cursor: pointer; }
.compose-row input[readonly] { color: #6a8a80; }
.compose-row input::placeholder, .compose-card textarea::placeholder { color: #abb9b4; }
.body-label { display: block; margin: 25px 0 10px; color: #879995; font-size: 12px; font-weight: 700; }
.compose-card textarea { width: 100%; min-height: 280px; resize: vertical; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; line-height: 1.7; }
.compose-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.compose-footer > span { color: #9aa9a3; font-size: 11px; }
.outbox-list { max-width: 850px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 12px 34px rgba(39,72,64,.035); }
.outbox-item { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 80px; padding: 17px 24px; border-bottom: 1px solid var(--line); }
.outbox-item:last-child { border-bottom: none; }
.outbox-item strong, .outbox-item small { display: block; overflow-wrap: anywhere; }
.outbox-item strong { font-size: 13px; }
.outbox-item small { margin-top: 6px; color: #9aaba4; font-size: 11px; }
.status-pill { flex: none; padding: 7px 10px; border-radius: 999px; background: #edf2f1; color: #66817d; font-size: 10px; font-weight: 800; }
.status-pill.sent { background: #e7f6ee; color: #369269; }
.status-pill.failed { background: #fff0ec; color: #b25341; }
.toast { position: fixed; right: 28px; bottom: 25px; z-index: 5; max-width: 340px; padding: 15px 20px; border-radius: 12px; background: var(--ink); color: white; box-shadow: 0 15px 40px rgba(16,38,38,.2); font-size: 13px; }

@media (max-width: 950px) {
  .sidebar { width: 205px; min-width: 205px; }
  .view { padding: 36px 25px; }
  .topbar { padding: 0 25px; }
  .inbox-grid { grid-template-columns: minmax(220px, 43%) minmax(270px, 1fr); }
  .message-detail { padding: 25px; }
}
@media (max-width: 700px) {
  .app-layout { display: block; }
  .sidebar { width: 100%; min-height: auto; padding: 14px 17px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin: 0 0 14px; padding: 0; font-size: 20px; }
  .brand-mark { width: 31px; height: 31px; font-size: 19px; }
  .account-card, .sidebar-bottom { display: none; }
  .nav { display: flex; gap: 7px; }
  .nav-item { flex: 1; justify-content: center; min-height: 38px; padding: 8px 4px; font-size: 11px; }
  .nav-icon { width: auto; font-size: 15px; }
  .topbar { height: 48px; padding: 0 17px; }
  .topbar-label, .topbar-divider, .topbar-private { display: none; }
  .view { padding: 31px 16px; }
  .view-heading { align-items: center; margin-bottom: 25px; }
  .view-heading h1 { font-size: 39px; }
  .view-subtitle { font-size: 12px; }
  .outline-button span { display: none; }
  .inbox-grid { grid-template-columns: 1fr; }
  .message-list { max-height: 300px; border-right: 0; border-bottom: 1px solid var(--line); }
  .message-detail { min-height: 330px; }
  .detail-placeholder { min-height: 280px; }
  .compose-card { padding: 17px; }
  .compose-footer { align-items: stretch; flex-direction: column; }
  .compose-footer .primary-button { width: 100%; }
  .auth-layout { padding: 20px 17px; }
  .auth-card { padding: 33px 25px; }
}

/* vsdm.uk: warm paper, serif headings and hand drawn outlines */
:root {
  color-scheme: light;
  --paper: #fbfbfa;
  --ink: #26241f;
  --ink-mid: #4d4842;
  --ink-soft: #6f6862;
  --rule: #e4e1dc;
  --line: #bdb5ad;
  --accent: #8c746c;
  --marker: #f1dcdf;
  --marker-2: #e4e8dd;
  --surface: #fffefd;
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-family: var(--sans);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1a1815;
  --ink: #ece7df;
  --ink-mid: #c5beb4;
  --ink-soft: #9a9288;
  --rule: #2e2a26;
  --line: #5a524a;
  --accent: #c9a99a;
  --marker: #6e4349;
  --marker-2: #3f4a38;
  --surface: #211e1a;
}
body { background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.65; }
button, input, select, textarea { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--marker); }
.grain { opacity: .13; background-image: radial-gradient(var(--line) .45px, transparent .45px); background-size: 8px 8px; }
.eyebrow { color: var(--accent); font-size: 10px; letter-spacing: .24em; }
.brand, .auth-brand { color: var(--ink); font-family: var(--serif); font-size: 29px; font-weight: 500; letter-spacing: -.045em; }
.brand-mark { display: inline; width: auto; height: auto; border: 0; border-radius: 0; background: none; color: var(--accent); font-size: 27px; }
.theme-toggle { display: inline-grid; place-items: center; flex: none; width: 39px; height: 39px; padding: 0; border: 1px solid var(--line); border-radius: 3px 7px 3px 6px / 7px 3px 6px 3px; background: var(--surface); color: var(--ink); font-family: var(--serif); font-size: 22px; }
.theme-toggle:hover { background: var(--marker); border-color: var(--accent); }
.primary-button, .outline-button { border: 1px solid var(--line); border-radius: 3px 7px 3px 6px / 7px 3px 6px 3px; background: var(--surface); color: var(--ink); box-shadow: none; }
.primary-button:hover:not(:disabled), .outline-button:hover { border-color: var(--accent); background: var(--marker); color: var(--ink); }
.primary-button:hover:not(:disabled) { transform: translateY(-2px) rotate(-.3deg); }
.primary-button span { color: var(--accent); }
.error-message { color: #a44343; }
:root[data-theme="dark"] .error-message { color: #ef9b91; }

.auth-layout { padding: 28px clamp(22px, 5vw, 76px) 22px; background: var(--paper); }
.auth-top { display: flex; align-items: center; justify-content: space-between; }
.auth-card { position: relative; width: min(100%, 640px); margin: auto; padding: 72px 0 84px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.auth-card::after { content: ""; position: absolute; right: 0; bottom: 37px; left: 0; height: 17px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='17' viewBox='0 0 280 17'%3E%3Cpath d='M0 9 Q35 1 70 9 T140 9 T210 9 T280 9' fill='none' stroke='%23bdb5ad' stroke-width='1.2'/%3E%3C/svg%3E") repeat-x left center / 280px 17px; }
.lock-icon { position: absolute; top: 48px; right: 32px; display: block; width: auto; height: auto; margin: 0; border: 0; background: transparent; color: var(--accent); font-size: 25px; transform: rotate(16deg); }
.auth-card h1 { font-family: var(--serif); font-size: clamp(52px, 7vw, 77px); font-weight: 500; line-height: 1.06; letter-spacing: -.055em; }
.auth-card h1 em { position: relative; color: var(--ink); white-space: nowrap; }
.auth-card h1 em::after { content: ""; position: absolute; z-index: -1; right: -1%; bottom: 5px; left: 1%; height: .24em; border-radius: 45% 55% 40% 50%; background: var(--marker); transform: rotate(-2deg); }
.auth-copy { max-width: 100%; margin: 38px 0 28px; padding: 19px 22px; border: 1px solid var(--line); border-radius: 3px 6px 2px 5px / 7px 2px 5px 3px; background: var(--surface); color: var(--ink-mid); line-height: 1.75; transform: rotate(-.2deg); }
.auth-card label { color: var(--ink-mid); }
.auth-card input { border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: var(--ink); }
.auth-card input::placeholder { color: var(--ink-soft); }
.auth-hint { color: var(--ink-soft); }
.auth-footer { gap: 16px; padding-top: 17px; border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: 10px; font-weight: 650; letter-spacing: .13em; }
.auth-footer span:first-child::before { content: none; }

.sidebar { width: 254px; min-width: 254px; padding: 29px 19px 23px; border-right: 1px solid var(--rule); background: var(--paper); }
.sidebar .brand { padding: 0 11px; margin-bottom: 39px; }
.account-card { margin: 0 2px 28px; padding: 13px 11px; border: 1px solid var(--line); border-radius: 3px 6px 2px 7px / 6px 3px 7px 2px; background: var(--surface); }
.account-avatar, .message-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--marker); color: var(--ink-mid); font-family: var(--serif); font-size: 19px; }
.account-card strong { font-family: var(--serif); font-size: 17px; font-weight: 500; }
.account-card small { color: var(--ink-soft); }
.nav { gap: 7px; }
.nav-item { min-height: 48px; border: 1px solid transparent; border-radius: 2px 6px 3px 5px; color: var(--ink-mid); font-size: 13px; font-weight: 600; }
.nav-item:hover, .nav-item.active { border-color: var(--line); background: var(--surface); color: var(--ink); }
.nav-item.active { transform: rotate(-.25deg); }
.nav-icon { display: grid; place-items: center; flex: none; width: 31px; height: 25px; border: 1px solid var(--line); color: var(--accent); font-family: var(--serif); font-size: 13px; }
.nav-item.active .nav-icon { background: var(--marker); }
.sidebar-bottom { display: grid; gap: 13px; justify-items: start; padding: 12px 2px 0; }
.security-card { width: 100%; margin: 0; padding: 11px; border-top: 1px solid var(--rule); border-radius: 0; background: transparent; }
.security-dot, .topbar-private span { width: 7px; height: 7px; margin-top: 6px; border: 1px solid var(--accent); background: var(--marker-2); box-shadow: none; }
.security-card strong { color: var(--ink); font-family: var(--serif); font-size: 16px; font-weight: 500; }
.security-card small { color: var(--ink-soft); }
.logout-button { padding: 5px 9px; color: var(--ink-soft); }
.logout-button:hover { color: var(--ink); }
.topbar { height: 69px; padding: 0 clamp(28px, 4vw, 64px); border-bottom: 1px solid var(--rule); background: transparent; }
.topbar-label { color: var(--accent); }
.topbar-divider { background: var(--line); }
.topbar-address, .topbar-private { color: var(--ink-soft); }
.topbar-private span { margin: 0; }
.view { padding: 54px clamp(28px, 4vw, 64px) 72px; }
.view-heading { position: relative; margin-bottom: 32px; padding-bottom: 29px; }
.view-heading::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 12px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='12' viewBox='0 0 280 12'%3E%3Cpath d='M0 6 Q35 0 70 6 T140 6 T210 6 T280 6' fill='none' stroke='%23bdb5ad' stroke-width='1'/%3E%3C/svg%3E") repeat-x left center / 280px 12px; }
.view-heading h1 { font-family: var(--serif); font-size: clamp(43px, 4.6vw, 62px); font-weight: 500; line-height: 1.08; letter-spacing: -.055em; }
.heading-period { color: var(--accent); }
.view-subtitle { color: var(--ink-soft); }
.outline-button { color: var(--ink); }
.inbox-grid, .compose-card, .outbox-list { border: 1px solid var(--line); border-radius: 3px 7px 2px 8px / 7px 3px 8px 2px; background: var(--surface); box-shadow: none; }
.message-list { border-right: 1px solid var(--rule); }
.message-item { border-bottom: 1px solid var(--rule); background: transparent; color: var(--ink); }
.message-item:hover, .message-item.selected { background: var(--marker-2); }
.message-sender { color: var(--ink); }
.message-date { color: var(--ink-soft); }
.message-subject { color: var(--ink-mid); }
.message-detail { padding: 34px; }
.detail-placeholder { color: var(--ink-soft); }
.detail-placeholder span { width: auto; height: auto; border: 0; background: transparent; color: var(--accent); font-family: var(--serif); font-size: 42px; }
.detail-placeholder h2, .detail-header h2 { color: var(--ink); font-family: var(--serif); font-weight: 500; }
.detail-placeholder h2 { font-size: 22px; }
.detail-header h2 { font-size: 31px; }
.detail-meta { border-color: var(--rule); color: var(--ink-soft); }
.detail-body { color: var(--ink-mid); }
.attachment-note { border-left: 2px solid var(--accent); border-radius: 0; background: var(--marker-2); color: var(--ink-mid); }
.loading, .empty-state { color: var(--ink-soft); }
.compose-card { padding: 24px 30px; }
.compose-row { border-bottom: 1px solid var(--rule); }
.compose-row label, .body-label { color: var(--accent); }
.compose-row input, .compose-row select, .compose-card textarea { color: var(--ink); }
.compose-row input::placeholder, .compose-card textarea::placeholder { color: var(--ink-soft); }
.compose-footer { border-top: 1px solid var(--rule); }
.compose-footer > span { color: var(--ink-soft); }
.outbox-item { border-bottom: 1px solid var(--rule); }
.outbox-item strong { font-family: var(--serif); font-size: 18px; font-weight: 500; }
.outbox-item small { color: var(--ink-soft); }
.status-pill { border: 1px solid var(--line); border-radius: 2px 5px 2px 4px; background: transparent; color: var(--ink-mid); }
.status-pill.sent { background: var(--marker-2); color: var(--ink-mid); }
.status-pill.failed { background: var(--marker); color: var(--ink-mid); }
.toast { border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: none; }

@media (max-width: 960px) {
  .sidebar { width: 211px; min-width: 211px; }
  .view, .topbar { padding-right: 29px; padding-left: 29px; }
  .message-detail { padding: 25px; }
}
@media (max-width: 700px) {
  .app-layout { display: block; }
  .sidebar { display: grid; grid-template-columns: 1fr auto; width: 100%; min-width: 0; min-height: auto; padding: 15px 17px 13px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .sidebar .brand { grid-column: 1; grid-row: 1; margin: 0; padding: 0; font-size: 24px; }
  .brand-mark { font-size: 22px; }
  .account-card, .security-card { display: none; }
  .nav { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 5px; margin-top: 16px; }
  .nav-item { flex: 1; justify-content: center; gap: 6px; min-height: 42px; padding: 5px 3px; font-size: 11px; }
  .nav-icon { width: 21px; height: 20px; font-size: 10px; }
  .sidebar-bottom { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
  .sidebar-bottom .theme-toggle { width: 34px; height: 34px; font-size: 18px; }
  .logout-button { width: auto; gap: 4px; padding: 3px; font-size: 11px; }
  .topbar { height: 45px; padding: 0 17px; }
  .view { padding: 33px 17px 54px; }
  .view-heading { margin-bottom: 22px; }
  .view-heading h1 { font-size: 43px; }
  .message-list { border-right: 0; border-bottom: 1px solid var(--rule); }
  .message-detail { min-height: 330px; }
  .compose-card { padding: 17px; }
  .auth-layout { padding: 20px 17px; }
  .auth-brand { font-size: 25px; }
  .auth-card { padding: 72px 2px 90px; }
  .auth-card h1 { font-size: clamp(48px, 12vw, 65px); }
  .lock-icon { right: 6px; }
}
