/* ============================================================================
   Mailroom — Leads Generation Company
   Palette: a faintly green-shifted stone ramp with one saturated jade accent.
   Type:    serif for what you read (subjects, bodies), sans for chrome,
            mono only for literal email addresses.
   ========================================================================= */

:root {
  --bg:          #eaeeeb;
  --surface:     #ffffff;
  --surface-2:   #f3f6f4;
  --surface-3:   #e2e7e3;
  --line:        #d4dcd7;
  --line-soft:   #e2e8e4;
  --ink:         #16211e;
  --ink-2:       #46554f;
  --ink-3:       #6f7d77;
  --accent:      #0e7c66;
  --accent-hi:   #0b6b58;
  --accent-ink:  #ffffff;
  --accent-soft: #dcece6;
  --star:        #c0851d;
  --danger:      #a4402f;
  --danger-soft: #f6e5e1;
  --shadow-dock: 0 1px 2px rgba(22,33,30,.10), 0 12px 34px -8px rgba(22,33,30,.26);
  --shadow-pop:  0 1px 2px rgba(22,33,30,.10), 0 10px 26px -10px rgba(22,33,30,.30);

  --font-ui:   ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-read: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --rail-w: 232px;
  --top-h: 56px;
  --t: 150ms ease;
  color-scheme: light;
}

/* Dark by system preference, unless the user has explicitly chosen light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0e1413;
    --surface:     #161d1b;
    --surface-2:   #1c2422;
    --surface-3:   #232d2a;
    --line:        #27322f;
    --line-soft:   #1f2926;
    --ink:         #e6ede9;
    --ink-2:       #adbcb6;
    --ink-3:       #7d8d87;
    --accent:      #35b394;
    --accent-hi:   #4cc4a6;
    --accent-ink:  #05201a;
    --accent-soft: #16332c;
    --star:        #dfa33c;
    --danger:      #e0705c;
    --danger-soft: #35211d;
    --shadow-dock: 0 1px 2px rgba(0,0,0,.5), 0 16px 40px -10px rgba(0,0,0,.65);
    --shadow-pop:  0 1px 2px rgba(0,0,0,.5), 0 12px 30px -10px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
/* Manual override wins in both directions. */
:root[data-theme="dark"] {
  --bg:          #0e1413;
  --surface:     #161d1b;
  --surface-2:   #1c2422;
  --surface-3:   #232d2a;
  --line:        #27322f;
  --line-soft:   #1f2926;
  --ink:         #e6ede9;
  --ink-2:       #adbcb6;
  --ink-3:       #7d8d87;
  --accent:      #35b394;
  --accent-hi:   #4cc4a6;
  --accent-ink:  #05201a;
  --accent-soft: #16332c;
  --star:        #dfa33c;
  --danger:      #e0705c;
  --danger-soft: #35211d;
  --shadow-dock: 0 1px 2px rgba(0,0,0,.5), 0 16px 40px -10px rgba(0,0,0,.65);
  --shadow-pop:  0 1px 2px rgba(0,0,0,.5), 0 12px 30px -10px rgba(0,0,0,.7);
  color-scheme: dark;
}

/* ── reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 13.5px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* ── brand ─────────────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 9px; color: var(--accent); }
.brand-mark { width: 22px; height: 22px; flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 13.5px; font-weight: 600; letter-spacing: .012em; color: var(--ink); }
.brand-text i { font-style: normal; font-size: 10.5px; color: var(--ink-3); letter-spacing: .01em; }
.brand--lg { gap: 11px; margin-bottom: 26px; }
.brand--lg .brand-mark { width: 30px; height: 30px; }
.brand--lg .brand-text b { font-size: 16px; }
.brand--lg .brand-text i { font-size: 11.5px; }

/* ── buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 16px; border-radius: 6px;
  font-size: 13px; font-weight: 550; letter-spacing: .005em; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: background var(--t), border-color var(--t), color var(--t);
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn--primary[disabled] { opacity: .55; cursor: default; }
.btn--block { width: 100%; height: 38px; }
.btn--quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn--quiet:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 5px; color: var(--ink-3);
  transition: background var(--t), color var(--t);
}
.icon-btn svg { width: 16px; height: 16px; display: block; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn--onbar { color: var(--ink-2); }
.link-btn {
  font-size: 12px; color: var(--ink-3); padding: 2px 4px; border-radius: 4px;
  transition: color var(--t);
}
.link-btn:hover { color: var(--accent); }

/* ── login ─────────────────────────────────────────────────────────────── */
.login { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.login-card {
  width: min(400px, 100%); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 34px 32px 28px;
  box-shadow: var(--shadow-pop);
}
.login-title {
  margin: 0 0 22px; font-family: var(--font-read);
  font-size: 23px; font-weight: 400; letter-spacing: -.012em; line-height: 1.25;
}
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 11.5px; font-weight: 550; color: var(--ink-2); margin-bottom: 5px; }
.field input {
  width: 100%; height: 38px; padding: 0 11px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  transition: border-color var(--t), background var(--t);
}
.field input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.login-error {
  margin: 0 0 14px; padding: 9px 11px; border-radius: 7px;
  background: var(--danger-soft); color: var(--danger);
  font-size: 12.5px; border: 1px solid transparent; white-space: pre-wrap;
}
.login-note { margin: 14px 0 0; font-size: 11.5px; color: var(--ink-3); text-align: center; }

/* ── app frame ─────────────────────────────────────────────────────────── */
.app {
  display: grid; height: 100dvh;
  grid-template-columns: var(--rail-w) minmax(340px, 34vw) minmax(0, 1fr);
  grid-template-rows: var(--top-h) 1fr;
  grid-template-areas: "top top top" "rail list reader";
}

/* topbar */
.topbar {
  grid-area: top; display: grid; align-items: center;
  grid-template-columns: var(--rail-w) 1fr auto;
  gap: 16px; padding-right: 14px;
  border-bottom: 1px solid var(--line); background: var(--bg);
}
.topbar .brand { padding-left: 18px; }

.search { position: relative; display: flex; align-items: center; max-width: 660px; }
.search-icon { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--ink-3); pointer-events: none; }
#search-input {
  width: 100%; height: 36px; padding: 0 74px 0 34px;
  border: 1px solid transparent; border-radius: 8px;
  background: var(--surface-3); color: var(--ink);
  transition: background var(--t), border-color var(--t);
}
#search-input::placeholder { color: var(--ink-3); }
#search-input:focus { outline: none; background: var(--surface); border-color: var(--accent); }
#search-input::-webkit-search-cancel-button { display: none; }
.search-count { position: absolute; right: 36px; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.search-clear { position: absolute; right: 4px; }

.account { position: relative; justify-self: end; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 650; letter-spacing: .04em;
  display: grid; place-items: center;
  transition: background var(--t);
}
.avatar:hover { background: var(--accent-hi); }
.menu {
  position: absolute; top: 38px; right: 0; z-index: 60; width: 244px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; box-shadow: var(--shadow-pop);
}
.menu-head { padding: 8px 9px 9px; }
.menu-name { display: block; font-size: 13px; font-weight: 600; }
.menu-addr { display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); margin-top: 2px; word-break: break-all; }
.menu-sep { height: 1px; background: var(--line-soft); margin: 4px 0; }
.menu-label { padding: 6px 9px 4px; font-size: 11px; color: var(--ink-3); }
.menu-item {
  display: block; width: 100%; text-align: left; padding: 8px 9px;
  border-radius: 6px; font-size: 13px; transition: background var(--t);
}
.menu-item:hover { background: var(--surface-2); }
.menu-item--danger { color: var(--danger); }
.seg { display: flex; gap: 3px; padding: 2px 6px 6px; }
.seg button {
  flex: 1; height: 27px; border-radius: 5px; font-size: 12px; color: var(--ink-2);
  border: 1px solid var(--line-soft); background: var(--surface-2);
  transition: background var(--t), color var(--t), border-color var(--t);
}
.seg button:hover { background: var(--surface-3); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }

/* rail */
.rail {
  grid-area: rail; display: flex; flex-direction: column;
  padding: 16px 12px 12px; border-right: 1px solid var(--line); min-height: 0;
}
.compose-btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 42px; padding: 0 20px; margin: 0 4px 18px; border-radius: 21px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 13.5px; font-weight: 600; letter-spacing: .006em;
  align-self: flex-start;
  transition: background var(--t), transform var(--t);
}
.compose-btn svg { width: 16px; height: 16px; }
.compose-btn:hover { background: var(--accent-hi); }
.compose-btn:active { transform: translateY(1px); }
.nav { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  height: 33px; padding: 0 12px 0 11px; border-radius: 0 17px 17px 0;
  color: var(--ink-2); font-size: 13px; text-align: left;
  transition: background var(--t), color var(--t);
}
.nav-item svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.nav-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item[aria-current="true"] svg { opacity: 1; }
.nav-count {
  font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--ink-3); flex: none;
}
.nav-item[aria-current="true"] .nav-count { color: var(--accent); }
.rail-foot { margin: 12px 6px 0; font-size: 10.5px; line-height: 1.5; color: var(--ink-3); }

/* ── list ──────────────────────────────────────────────────────────────── */
.list { grid-area: list; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.list-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 16px 12px 10px 18px;
}
.list-title {
  margin: 0; font-family: var(--font-read); font-weight: 400;
  font-size: 19px; letter-spacing: -.01em;
}
.list-tools { display: flex; align-items: center; gap: 4px; }
.list-meta { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rows { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 6px 18px; outline: none; }

.row {
  position: relative; display: grid; align-items: center;
  grid-template-columns: 22px 1fr 64px;
  gap: 8px; padding: 9px 8px 9px 10px; border-radius: 6px;
  cursor: pointer; transition: background var(--t), box-shadow var(--t);
}
.row + .row { box-shadow: 0 -1px 0 var(--line-soft); }
.row:hover { background: var(--surface-2); }
.row:hover + .row, .row.is-open + .row { box-shadow: none; }
.row.is-open {
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.row.is-cursor::after {
  content: ""; position: absolute; inset: 0; border-radius: 6px;
  box-shadow: inset 0 0 0 1.5px var(--accent); pointer-events: none;
}
/* unread marker: a jade tick at the leading edge, not just bold text */
.row.is-unread::before {
  content: ""; position: absolute; left: 2px; top: 12px; bottom: 12px;
  width: 2px; border-radius: 1px; background: var(--accent);
}
.row-star { justify-self: center; color: var(--ink-3); opacity: 0; transition: opacity var(--t), color var(--t); }
.row-star svg { width: 15px; height: 15px; display: block; }
.row:hover .row-star, .row-star.is-on { opacity: 1; }
.row-star.is-on { color: var(--star); }
.row-star:hover { color: var(--star); }

.row-main { min-width: 0; }
.row-from {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 12.5px; color: var(--ink-2); margin-bottom: 1px;
}
.row-from b { font-weight: 500; color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.is-unread .row-from b { font-weight: 700; color: var(--ink); }
.row-n { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; }
.row-line {
  display: flex; align-items: baseline; gap: 7px; min-width: 0;
  white-space: nowrap; overflow: hidden;
}
/* the subject keeps its natural width up to 62% of the row; the snippet is what
   gives way first, so you can always read what a message is about */
.row-subject {
  font-family: var(--font-read); font-size: 14.5px; color: var(--ink);
  flex: 0 1 auto; max-width: 62%; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.row.is-unread .row-subject { font-weight: 600; }
.row-snippet { font-size: 12.5px; color: var(--ink-3); flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row-clip { flex: none; display: flex; align-items: center; color: var(--ink-3); }
.row-clip svg { width: 13px; height: 13px; }

.row-end { position: relative; justify-self: end; height: 24px; display: flex; align-items: center; }
.row-time {
  font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums;
  white-space: nowrap; transition: opacity var(--t);
}
.row.is-unread .row-time { color: var(--ink-2); font-weight: 600; }
.row-actions {
  position: absolute; right: -2px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 1px; opacity: 0; pointer-events: none;
  background: inherit; transition: opacity var(--t);
}
.row-actions .icon-btn { width: 25px; height: 25px; }
.row:hover .row-time { opacity: 0; }
.row:hover .row-actions { opacity: 1; pointer-events: auto; }
@media (hover: none) {
  .row-actions { position: static; transform: none; opacity: 1; pointer-events: auto; }
  .row-time { display: none; }
}

/* skeletons */
.sk-row { display: grid; grid-template-columns: 22px 1fr 64px; gap: 8px; padding: 12px 8px 12px 10px; align-items: center; }
.sk { height: 9px; border-radius: 4px; background: var(--surface-3); position: relative; overflow: hidden; }
.sk::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: sweep 1.4s infinite;
}
:root[data-theme="dark"] .sk::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sk::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); } }
@keyframes sweep { to { transform: translateX(100%); } }
.sk-lines { display: grid; gap: 7px; }

/* empty / error states */
.state { display: grid; place-content: center; justify-items: center; gap: 10px; height: 100%; padding: 40px 28px; text-align: center; }
.state svg { width: 30px; height: 30px; color: var(--ink-3); opacity: .7; }
.state-title { font-family: var(--font-read); font-size: 17px; letter-spacing: -.008em; }
.state-copy { font-size: 12.5px; color: var(--ink-3); max-width: 40ch; line-height: 1.55; }
.state-copy--err { color: var(--danger); font-family: var(--font-mono); font-size: 11.5px; word-break: break-word; white-space: pre-wrap; }

/* ── reader ────────────────────────────────────────────────────────────── */
.reader { grid-area: reader; background: var(--surface); overflow-y: auto; overscroll-behavior: contain; min-width: 0; }
.rd { max-width: 78ch; margin: 0 auto; padding: 26px 32px 64px; }
.rd-back { display: none; }
.rd-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.rd-subject {
  flex: 1; margin: 0; font-family: var(--font-read); font-weight: 400;
  font-size: 25px; line-height: 1.24; letter-spacing: -.016em; word-break: break-word;
}
.rd-count { font-size: 13px; color: var(--ink-3); font-family: var(--font-ui); }
.rd-tools { display: flex; gap: 2px; flex: none; padding-top: 3px; }
.rd-thread { margin-top: 20px; display: flex; flex-direction: column; gap: 2px; }

.msg { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.msg:first-child { border-top: 0; padding-top: 0; }
.msg-collapsed {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline;
  width: 100%; text-align: left; padding: 9px 6px; margin: 0 -6px; border-radius: 6px;
  transition: background var(--t);
}
.msg-collapsed:hover { background: var(--surface-2); }
.msg-collapsed .c-from { font-size: 13px; font-weight: 600; white-space: nowrap; flex: none; }
.msg-collapsed .c-snip { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-collapsed .c-left { display: flex; gap: 8px; min-width: 0; align-items: baseline; }
.msg-collapsed .c-time { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

.msg-head { display: flex; align-items: flex-start; gap: 12px; padding: 4px 0 12px; }
.msg-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 650;
  background: var(--accent-soft); color: var(--accent); letter-spacing: .03em;
}
.msg-who { flex: 1; min-width: 0; }
.msg-name { font-size: 13.5px; font-weight: 650; }
.msg-addr { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); word-break: break-all; }
.msg-rcpt { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; word-break: break-word; }
.msg-date { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; flex: none; padding-top: 2px; }

.imgbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 11px; margin-bottom: 12px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  font-size: 12px; color: var(--ink-2);
}
.imgbar b { font-weight: 400; flex: 1; min-width: 12ch; }
.imgbar button { font-size: 12px; font-weight: 600; color: var(--accent); padding: 2px 4px; border-radius: 4px; }
.imgbar button:hover { text-decoration: underline; }
.imgbar .imgbar-x { color: var(--ink-3); font-weight: 400; }

.msg-body { width: 100%; border: 0; display: block; background: transparent; }
/* sender markup sits on its own sheet; in dark mode that sheet needs an edge */
.msg-body--paper { border-radius: 6px; background: #fff; }
:root[data-theme="dark"] .msg-body--paper { box-shadow: 0 0 0 1px var(--line); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .msg-body--paper { box-shadow: 0 0 0 1px var(--line); }
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  padding: 5px 11px 5px 8px; border-radius: 15px;
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 12px; color: var(--ink-2); cursor: default;
}
.chip svg { width: 13px; height: 13px; color: var(--ink-3); flex: none; }
.chip b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip i { font-style: normal; color: var(--ink-3); font-size: 11px; flex: none; }

.rd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-soft); }

/* ── compose dock ──────────────────────────────────────────────────────── */
.dock {
  position: fixed; right: 22px; bottom: 0; z-index: 50; width: min(536px, calc(100vw - 44px));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 10px 10px 0 0; box-shadow: var(--shadow-dock);
  animation: dock-in 170ms ease;
}
@keyframes dock-in { from { transform: translateY(14px); opacity: 0; } }
.dock-bar {
  display: flex; align-items: center; gap: 8px; padding: 0 6px 0 14px; height: 40px;
  background: var(--surface-3); border-radius: 9px 9px 0 0; cursor: pointer;
}
.dock-title { flex: 1; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-bar-tools { display: flex; gap: 1px; }
.dock-body { padding: 4px 14px 0; }
.dock.is-min .dock-body, .dock.is-min .dock-foot { display: none; }
.dock-row { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line-soft); }
.dock-lab { font-size: 12px; color: var(--ink-3); width: 40px; flex: none; }
.dock-in { flex: 1; min-width: 0; height: 36px; border: 0; background: none; }
.dock-in:focus { outline: none; }
.dock-text {
  width: 100%; min-height: 220px; max-height: 44vh; margin: 12px 0 0; padding: 0;
  border: 0; background: none; resize: none;
  font-family: var(--font-read); font-size: 14.5px; line-height: 1.6;
}
.dock-text:focus { outline: none; }
.dock-quote {
  margin: 12px 0 0; padding: 8px 10px; border-left: 2px solid var(--line);
  font-size: 11.5px; color: var(--ink-3);
}
.dock-foot { display: flex; align-items: center; gap: 12px; padding: 12px 14px 14px; }
.dock-status { flex: 1; font-size: 11.5px; color: var(--ink-3); }
.dock-discard { margin-left: auto; }
.dock-discard:hover { color: var(--danger); }

/* ── toasts ────────────────────────────────────────────────────────────── */
/* clear of the rail's footnote, so a toast never lands on top of small print */
.toasts { position: fixed; left: calc(var(--rail-w) + 18px); bottom: 22px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 12px; max-width: 420px;
  padding: 10px 14px; border-radius: 8px;
  background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.4;
  box-shadow: var(--shadow-pop); animation: toast-in 170ms ease;
}
.toast--err { background: var(--danger); color: #fff; }
.toast button { color: inherit; font-weight: 650; font-size: 12.5px; text-decoration: underline; flex: none; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ── shortcuts overlay ─────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(10,18,16,.42); }
.sheet {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px 22px 22px; box-shadow: var(--shadow-pop);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; font-family: var(--font-read); font-weight: 400; font-size: 19px; letter-spacing: -.01em; }
.keys { margin: 0; display: grid; gap: 1px; }
.keys > div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; padding: 6px 0; }
.keys dt { display: flex; gap: 4px; }
.keys dd { margin: 0; font-size: 12.5px; color: var(--ink-2); }
kbd {
  display: inline-block; min-width: 21px; padding: 2px 6px; text-align: center;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  background: var(--surface-2); font-family: var(--font-mono); font-size: 11px; color: var(--ink-2);
}

/* ── responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: var(--top-h) auto 1fr;
    grid-template-areas: "top" "rail" "list";
  }
  .topbar { grid-template-columns: auto 1fr auto; gap: 10px; padding: 0 10px; }
  .topbar .brand { padding-left: 4px; }
  .brand-text { display: none; }
  .rail {
    flex-direction: row; align-items: center; gap: 6px;
    padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line);
    overflow-x: auto; scrollbar-width: none;
  }
  .rail::-webkit-scrollbar { display: none; }
  .compose-btn { height: 32px; padding: 0 15px; margin: 0; flex: none; font-size: 12.5px; }
  .nav { display: flex; gap: 4px; overflow: visible; flex: none; }
  .nav-item { height: 32px; border-radius: 16px; padding: 0 13px; white-space: nowrap; }
  .nav-item span { flex: none; }
  .rail-foot { display: none; }
  .list { border-right: 0; }
  .reader {
    position: fixed; inset: 0; z-index: 40; transform: translateX(100%);
    transition: transform 170ms ease; border-left: 1px solid var(--line);
  }
  .app[data-pane="reading"] .reader { transform: none; }
  .rd { padding: 12px 18px 56px; }
  .rd-back {
    display: inline-flex; align-items: center; gap: 6px; height: 32px;
    margin-bottom: 8px; font-size: 12.5px; color: var(--ink-2);
  }
  .rd-back svg { width: 15px; height: 15px; }
  .rd-subject { font-size: 21px; }
  .dock {
    right: 0; left: 0; top: 0; bottom: 0; width: auto;
    border-radius: 0; border: 0; animation: none;
  }
  .dock-bar { border-radius: 0; }
  .dock-body { flex: 1; overflow-y: auto; }
  .dock-text { max-height: none; min-height: 40vh; }
  .dock.is-min { top: auto; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
}
@media (max-width: 460px) {
  .row { grid-template-columns: 20px 1fr 52px; gap: 6px; }
  .rd { padding: 12px 14px 56px; }
  .row-snippet { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
