/* Cream and bark, like Together Progress: a cream sidebar, a white page with a soft
   rounded corner, warm brown type and one deep purple accent. */
:root {
  --cream: #fbf7f0; --page: #ffffff; --bark: #5a422d; --accent: #25184e;
  --muted: rgba(90, 66, 45, .62); --faint: rgba(90, 66, 45, .42); --line: rgba(90, 66, 45, .1); --line2: rgba(90, 66, 45, .18);
  --sel: #f6efe3; --soft: #f3eefb; --good: #2f7a4a; --bad: #a3322a; --flag: #c47f12;
  --sans: 'Avenir Next', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --cream: #1b1714; --page: #231e1a; --bark: #eadfd2; --accent: #c9b8ff; --muted: rgba(234, 223, 210, .62); --faint: rgba(234, 223, 210, .4); --line: rgba(234, 223, 210, .1); --line2: rgba(234, 223, 210, .18); --sel: #2d2620; --soft: #2a2438; --flag: #e3a43b; }
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--cream); color: var(--bark); }
body { font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 14px; } .tiny { font-size: 12px; }
.good { color: var(--good); } .bad { color: var(--bad); }
h1, h2, h3 { color: var(--accent); font-weight: 500; letter-spacing: -0.01em; }

/* Layout: sidebar | page( list | detail ) */
#app { display: grid; grid-template-columns: 250px 1fr; height: 100dvh; }
#side { overflow-y: auto; padding: 18px 12px 24px; display: flex; flex-direction: column; }
#page { background: var(--page); border-left: 1px solid var(--line); border-top-left-radius: 18px; box-shadow: 0 10px 30px rgba(90, 66, 45, .08); display: grid; grid-template-columns: minmax(320px, 400px) 1fr; min-width: 0; overflow: hidden; margin-top: 10px; }
#list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#read { overflow-y: auto; min-width: 0; }
#mhead, #tabs { display: none; }

@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  #side { display: none; }
  #page { grid-template-columns: 1fr; border: 0; border-radius: 0; margin: 0; box-shadow: none; min-height: 0; }
  #list, #read { display: none; border: 0; }
  body[data-pane="list"] #list, body[data-pane="read"] #read { display: flex; flex-direction: column; }
  body[data-pane="read"] #read { display: block; }
  #mhead { display: flex; align-items: center; gap: 4px; height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 6px 0; border-bottom: 1px solid var(--line); background: var(--cream); }
  #mhead .t { flex: 1; text-align: center; color: var(--accent); font-weight: 500; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #tabs { display: flex; justify-content: space-around; border-top: 1px solid var(--line); background: var(--cream); padding: 4px 4px env(safe-area-inset-bottom); }
  #tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 4px; font-size: 11px; color: var(--muted); text-decoration: none; position: relative; }
  #tabs a svg { width: 22px; height: 22px; }
  #tabs a.on { color: var(--accent); font-weight: 600; }
  #tabs a .badge { position: absolute; top: 2px; left: calc(50% + 6px); }
  .wide-only { display: none !important; }
}
@media (min-width: 761px) { .narrow-only { display: none !important; } }
@media (min-width: 761px) and (max-width: 1050px) { #app { grid-template-columns: 210px 1fr; } #page { grid-template-columns: 320px 1fr; } }

/* Sidebar */
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 16px; color: var(--accent); font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.brand svg { width: 30px; height: 30px; }
.find { position: relative; margin: 0 4px 14px; }
.find input { width: 100%; border: 1px solid var(--line2); background: var(--page); border-radius: 10px; padding: 8px 12px 8px 34px; outline: none; }
.find input:focus { border-color: var(--accent); }
.find svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--faint); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; text-decoration: none; cursor: pointer; }
.nav a svg { width: 20px; height: 20px; flex: none; opacity: .8; }
.nav a .l { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a.on { background: var(--page); color: var(--accent); font-weight: 600; box-shadow: 0 1px 3px rgba(90, 66, 45, .08); }
.nav a.sub { padding: 5px 10px 5px 42px; font-size: 14px; color: var(--muted); }
.nav a.sub.on { color: var(--accent); }
.badge { background: var(--accent); color: var(--cream); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; min-width: 18px; text-align: center; }
.count { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
details.more { margin-top: 10px; }
details.more summary { list-style: none; cursor: pointer; padding: 6px 10px; color: var(--faint); font-size: 13px; }
details.more summary::-webkit-details-marker { display: none; }
.acct { padding: 10px 10px 2px 42px; font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-err { color: var(--bad); font-size: 12px; padding: 0 10px 4px 42px; }
.side-foot { margin-top: auto; padding: 18px 10px 0; font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }
.dot.off { background: var(--faint); }
.demo { margin: 0 4px 12px; background: var(--soft); color: var(--accent); border-radius: 10px; padding: 8px 12px; font-size: 13px; }

/* List column */
.lhead { padding: 18px 20px 10px; display: flex; align-items: center; gap: 8px; }
.lhead h2 { margin: 0; font-size: 22px; flex: 1; }
.lhead .sub { color: var(--muted); font-size: 14px; }
.lfind { padding: 4px 16px 10px; }
.lfind input { width: 100%; border: 1px solid var(--line2); background: var(--cream); border-radius: 10px; padding: 9px 12px; outline: none; }
.lfind input:focus { border-color: var(--accent); background: var(--page); }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 30px; min-height: 0; }
.group { padding: 14px 20px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; }
.row { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 10px 20px; cursor: pointer; text-decoration: none; border-radius: 0; }
.row:hover { background: var(--sel); }
.row.on { background: var(--sel); box-shadow: inset 3px 0 0 var(--accent); }
.row .top { display: flex; gap: 8px; align-items: baseline; }
.row .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .when { color: var(--faint); font-size: 13px; flex: none; font-variant-numeric: tabular-nums; }
.row .subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.row .prev { color: var(--muted); font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.row.unread .who { font-weight: 700; color: var(--accent); }
.row.unread .subj { font-weight: 600; }
.row .chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line2); border-radius: 8px; padding: 1px 8px; font-size: 12px; color: var(--muted); max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--page); cursor: pointer; }
.chip b { color: var(--accent); font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: .04em; }
.flag { color: var(--flag); }
.empty { padding: 48px 28px; color: var(--muted); text-align: center; }
.empty h3 { margin: 0 0 6px; font-size: 20px; }
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 600; color: #fff; flex: none; letter-spacing: .02em; }
.av.lg { width: 64px; height: 64px; font-size: 24px; }
.av.sm { width: 28px; height: 28px; font-size: 12px; }
.filters { display: flex; gap: 6px; padding: 2px 16px 10px; overflow-x: auto; scrollbar-width: none; }
.filters button { border: 1px solid var(--line2); background: var(--page); border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; color: var(--muted); }
.filters button.on { background: var(--accent); color: var(--cream); border-color: var(--accent); }
.speed { padding: 0 20px 6px; font-size: 12px; color: var(--faint); }

/* Screener */
.screen-hint { margin: 0 20px 8px; background: var(--soft); color: var(--accent); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.card { margin: 10px 16px; border: 1px solid var(--line2); border-radius: 14px; padding: 14px; background: var(--page); }
.card .top { display: flex; gap: 12px; align-items: center; }
.card .name { font-weight: 600; color: var(--accent); }
.card .addr { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.card .subj { margin: 10px 0 12px; font-size: 14px; color: var(--muted); }
.card .subj b { color: var(--bark); font-weight: 500; }
.card .actions { margin: 0; }

/* Files */
.file { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 9px 20px; cursor: pointer; }
.file:hover, .file.on { background: var(--sel); }
.thumb { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line2); background: var(--cream); display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; overflow: hidden; color: var(--muted); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.pdf { color: #b5432f; } .thumb.sheet { color: #2f7a4a; } .thumb.doc { color: #2f5fa8; } .thumb.slides { color: #b8661c; } .thumb.image { color: var(--accent); }
.file .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .meta { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .state { font-size: 12px; color: var(--faint); text-align: right; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }

/* Detail: reader and person */
.detail { max-width: 780px; padding: 0 32px 60px; }
@media (max-width: 760px) { .detail { padding: 0 18px 50px; } }
.dbar { display: flex; align-items: center; gap: 2px; padding: 12px 0; position: sticky; top: 0; background: var(--page); z-index: 2; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.icon { border: 0; background: none; padding: 6px 8px; min-width: 38px; min-height: 38px; border-radius: 10px; cursor: pointer; color: var(--bark); display: inline-grid; place-items: center; }
.icon:hover { background: var(--sel); }
.icon svg { width: 20px; height: 20px; }
.detail h1 { font-size: 26px; line-height: 1.25; margin: 20px 0 14px; }
.msg { border-bottom: 1px solid var(--line); padding: 14px 0 20px; }
.msg .head { display: flex; gap: 12px; align-items: center; }
.msg .head .who { flex: 1; min-width: 0; }
.msg .head .from { font-weight: 600; color: var(--accent); cursor: pointer; }
.msg .head .addr { color: var(--muted); font-size: 13px; }
.msg .head .date { color: var(--faint); font-size: 13px; white-space: nowrap; }
.msg.collapsed .bodywrap, .msg.collapsed .atts { display: none; }
.msg.collapsed .prevline { display: block; }
.prevline { display: none; color: var(--muted); font-size: 14px; cursor: pointer; padding-left: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin: 14px 0 4px; }
.att { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; border: 1px solid var(--line2); border-radius: 12px; padding: 8px 10px; background: var(--page); cursor: pointer; text-align: left; }
.att:hover { border-color: var(--accent); }
.att .thumb { width: 40px; height: 40px; }
.att .name { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .meta { font-size: 12px; color: var(--muted); }
.body { white-space: pre-wrap; word-wrap: break-word; font-size: 15.5px; line-height: 1.6; margin: 14px 0 0; }
.body a { word-break: break-all; color: var(--accent); }
.body .quoted { color: var(--faint); }
iframe.html { width: 100%; border: 0; margin-top: 14px; border-radius: 10px; min-height: 60px; }
iframe.html.designed { background: #fff; }
iframe.html.plain { background: transparent; }
.notice { background: var(--soft); color: var(--accent); border-radius: 10px; padding: 8px 12px; font-size: 14px; margin-top: 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }

.person-top { display: flex; gap: 16px; align-items: center; margin: 24px 0 8px; }
.person-top h1 { margin: 0; }
.said { border-radius: 14px; padding: 16px 18px; margin: 16px 0; background: var(--cream); border: 1px solid var(--line); }
.said.theirs { background: var(--soft); border-color: transparent; }
.said .lab { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.said .subj { color: var(--accent); font-weight: 500; margin: 6px 0 4px; cursor: pointer; }
.said .words { white-space: pre-wrap; font-size: 15px; line-height: 1.55; max-height: 14em; overflow: hidden; }
.sect { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; margin: 26px 0 8px; }
.tl { border-left: 2px solid var(--line2); margin-left: 6px; }
.tl a { display: block; padding: 6px 0 10px 16px; text-decoration: none; cursor: pointer; position: relative; }
.tl a::before { content: ''; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--page); border: 2px solid var(--line2); }
.tl a.theirs::before { border-color: var(--accent); }
.tl .s { font-weight: 500; } .tl .p { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl .d { color: var(--faint); font-size: 12px; }

/* Buttons */
.btn { border: 0; background: var(--accent); color: var(--cream); border-radius: 10px; padding: 9px 16px; cursor: pointer; min-height: 40px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; }
.btn svg { width: 17px; height: 17px; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line2); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.quiet { background: transparent; color: var(--muted); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.sm { padding: 4px 12px; min-height: 32px; font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }

/* Sheet */
#sheetWrap { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; }
#sheetWrap[hidden] { display: none; }
#sheetBg { position: absolute; inset: 0; background: rgba(37, 24, 78, .28); }
#sheet { position: relative; background: var(--page); width: min(700px, 100vw); max-height: min(92dvh, 920px); overflow-y: auto; border-radius: 18px; padding: 22px 26px 24px; box-shadow: 0 20px 60px rgba(37, 24, 78, .25); }
@media (max-width: 760px) { #sheetWrap { place-items: end center; } #sheet { border-radius: 18px 18px 0 0; max-height: 96dvh; padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); } }
#sheet h2 { margin: 0 0 12px; font-size: 22px; }
#sheet h3 { margin: 24px 0 6px; font-size: 16px; }
.field { display: grid; grid-template-columns: 70px 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.field label { color: var(--muted); font-size: 14px; }
.field input, .field select { border: 0; background: none; padding: 10px 0; outline: none; min-width: 0; }
textarea.compose { width: 100%; min-height: 240px; border: 0; background: none; padding: 14px 0; outline: none; resize: vertical; font: 15.5px/1.6 var(--sans); }
.ai { display: flex; gap: 8px; align-items: center; background: var(--soft); border-radius: 12px; padding: 8px 8px 8px 12px; margin-top: 12px; }
.ai input { flex: 1; border: 0; background: none; outline: none; min-width: 0; color: var(--accent); }
.ai input::placeholder { color: var(--muted); }
.ai svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.writing { color: var(--accent); font-size: 13px; }
.stack { display: grid; gap: 8px; }
.stack input, .stack select { border: 1px solid var(--line2); background: var(--cream); border-radius: 10px; padding: 9px 11px; width: 100%; outline: none; }
.help { font-size: 13px; color: var(--muted); margin: 0; }
.help code { font-size: 12px; background: var(--sel); padding: 1px 4px; border-radius: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.welcome { max-width: 460px; margin: 10vh auto; text-align: center; padding: 0 24px; }
.welcome h1 { font-size: 28px; margin-bottom: 6px; }
.welcome p { color: var(--muted); }

#toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--accent); color: var(--cream); padding: 10px 18px; border-radius: 12px; font-size: 14px; transition: .2s; pointer-events: none; z-index: 30; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }
@media (min-width: 761px) { #toast { bottom: 28px; } }

/* Accounts and settings */
.adot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; margin-right: 6px; vertical-align: 1px; }
.adot.lg { width: 14px; height: 14px; margin: 0 4px 0 2px; }
.acct { display: flex; align-items: center; }
.filters button .adot { margin-right: 6px; }
.steps { padding-left: 20px; color: var(--bark); line-height: 1.7; margin: 8px 0 16px; }
.steps code { font-size: 13px; background: var(--sel); padding: 1px 5px; border-radius: 4px; }

/* Ask */
.chat { padding: 4px 20px 20px; }
.ask-intro { display: flex; gap: 12px; align-items: flex-start; background: var(--soft); color: var(--accent); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.ask-intro svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.ask-intro p { margin: 0; font-size: 14.5px; }
.suggest { display: block; width: 100%; text-align: left; border: 1px solid var(--line2); background: var(--page); border-radius: 12px; padding: 10px 14px; margin: 8px 0; cursor: pointer; color: var(--bark); }
.suggest:hover { border-color: var(--accent); color: var(--accent); }
.chat .q { margin: 18px 0 8px auto; max-width: 85%; width: fit-content; background: var(--accent); color: var(--cream); border-radius: 14px 14px 4px 14px; padding: 9px 14px; }
.chat .a { margin: 0 0 6px; }
.chat .a .txt { font-size: 15.5px; line-height: 1.6; }
.chat .a .txt p { margin: 0 0 10px; }
.chat .a .txt ul { margin: 0 0 10px; padding-left: 20px; }
.chat .a .txt li { margin: 3px 0; }
.chat .tools { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 8px; font-size: 12px; color: var(--faint); }
.chat .tools span::before { content: '✓ '; color: var(--good); }
.ref { display: inline-flex; align-items: center; gap: 4px; background: var(--soft); color: var(--accent); border-radius: 7px; padding: 0 7px; font-size: 13.5px; text-decoration: none; cursor: pointer; vertical-align: 1px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ref svg { width: 13px; height: 13px; flex: none; }
.ref:hover { background: var(--accent); color: var(--cream); }
.askbox { display: flex; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--page); }
.askbox input { flex: 1; min-width: 0; border: 1px solid var(--line2); background: var(--cream); border-radius: 10px; padding: 9px 12px; outline: none; }
.askbox input:focus { border-color: var(--accent); background: var(--page); }
.askrow { display: flex; align-items: center; gap: 10px; margin: 0 16px 8px; padding: 10px 14px; border-radius: 12px; background: var(--soft); color: var(--accent); cursor: pointer; text-decoration: none; }
.askrow svg { width: 18px; height: 18px; flex: none; }
.askrow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon.on { color: var(--accent); background: var(--soft); }
@media (max-width: 760px) { .askbox { padding-bottom: 12px; } }

/* Replies */
.rstate { font-size: 13px; margin-top: 3px; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rstate.ready { color: var(--good); }
.rstate.none { color: var(--muted); }
.rstate.writing { color: var(--accent); }
.rstate.failed { color: var(--bad); }
.rstate.wait { color: var(--faint); }
.rstate .muted { overflow: hidden; text-overflow: ellipsis; }
.spin { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--soft); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
textarea.rbox { border: 1px solid var(--line2); border-radius: 12px; padding: 14px 16px; min-height: 200px; background: var(--page); }
textarea.rbox:focus { border-color: var(--accent); }
@media (max-width: 760px) { #tabs a { font-size: 10px; } #tabs a svg { width: 20px; height: 20px; } }

/* Latest as a reply queue */
.sec { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px 6px; }
.sec b { font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.sec span { font-size: 12px; color: var(--faint); }
.c-card { display: block; margin: 6px 14px 10px; border: 1px solid var(--line2); border-radius: 14px; padding: 12px 14px; cursor: pointer; background: var(--page); position: relative; }
.c-card:hover { border-color: var(--accent); }
.c-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.c-card .top { display: flex; gap: 10px; align-items: center; }
.c-card .nm { font-weight: 600; color: var(--bark); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-card.unread .nm { font-weight: 700; color: var(--accent); }
.c-card .tm, .fyi .tm { font-size: 12px; color: var(--faint); flex: none; }
.c-card .ask { margin: 8px 0 10px; font-size: 15px; line-height: 1.45; }
.c-card .ask b { font-weight: 650; color: var(--accent); }
.c-card .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.c-card .acts button { font-size: 13px; border-radius: 8px; padding: 5px 11px; border: 1px solid var(--line2); color: var(--accent); background: var(--page); display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.c-card .acts button:hover { border-color: var(--accent); }
.c-card .acts button.go { background: var(--accent); color: var(--cream); border-color: var(--accent); }
.c-card .acts svg { width: 13px; height: 13px; }
.c-card .acts .spin { border-color: rgba(255,255,255,.3); border-top-color: var(--cream); }
.edged::before { content: ''; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--edge); }
.fyi { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 8px 20px; cursor: pointer; text-decoration: none; position: relative; }
.fyi:hover, .fyi.on { background: var(--sel); }
.fyi.edged::before { top: 8px; bottom: 8px; left: 0; }
.fyi .t { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fyi .t b { font-weight: 500; color: var(--bark); }
.fyi.unread .t b { font-weight: 700; color: var(--accent); }
.av.xs { width: 28px; height: 28px; font-size: 11px; }

/* 0.6.01: calmer Latest. No box around each item, quiet secondary actions */
.c-card { border: 0; border-radius: 12px; margin: 0 8px; padding: 14px 14px 12px; background: transparent; }
.c-card + .c-card { margin-top: 4px; }
.c-card:hover { background: var(--sel); border: 0; }
.c-card.on { background: var(--sel); box-shadow: none; }
.c-card .acts { gap: 2px; margin-left: -8px; }
.c-card .acts button { border: 0; background: transparent; color: var(--muted); padding: 5px 8px; }
.c-card .acts button:hover { color: var(--accent); background: var(--soft); }
.c-card .acts button.go { background: var(--accent); color: var(--cream); margin-right: 6px; margin-left: 8px; }
.c-card .acts button.go:hover { background: var(--accent); color: var(--cream); }
.edged::before { top: 16px; bottom: 16px; }

/* 0.6.02: one thin line between items */
.c-card { border-radius: 0; margin: 0 20px; padding: 16px 0 14px; }
.c-card + .c-card { margin-top: 0; border-top: 1px solid var(--line); }
.c-card:hover, .c-card.on { background: transparent; }
.c-card.on .nm, .c-card:hover .nm { color: var(--accent); }
.c-card.on::after { content: ''; position: absolute; left: -20px; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.c-card .acts { margin-left: -8px; }
.c-card .acts button.go { margin-left: 0; }
.edged::before { left: -14px; }
.c-card .acts { margin-left: 0; }
.c-card .ask { margin: 6px 0 0; } .c-card { padding: 14px 0; }

/* Who's waiting: faces at the top of Latest, overlapping a little */
.waiting { padding: 4px 20px 6px; }
.faces { display: flex; align-items: center; }
.faces a { display: block; cursor: pointer; margin-left: -10px; transition: transform .15s; position: relative; }
.faces a:first-child { margin-left: 0; }
.faces a:hover { transform: translateY(-2px); z-index: 2; }
.faces .av { width: 44px; height: 44px; font-size: 15px; box-shadow: 0 0 0 3px var(--page); }
.faces .fn { display: none; }
.faces .more { margin-left: 6px; font-size: 13px; color: var(--muted); }
.wline { margin-top: 8px; font-size: 14px; color: var(--muted); }
/* The alternative, side by side with first names: <div class="waiting apart"> */
.waiting.apart .faces { gap: 14px; overflow-x: auto; scrollbar-width: none; }
.waiting.apart .faces a { margin-left: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; }
.waiting.apart .faces .av { width: 52px; height: 52px; font-size: 17px; box-shadow: none; }
.waiting.apart .faces .fn { display: block; font-size: 12px; color: var(--bark); }
.waiting.apart .wline { display: none; }
.waiting { padding-top: 14px; }
.faces a { margin-left: -8px; }
.faces a:hover { z-index: 30 !important; }
@media (min-width: 761px) { .waiting { padding-top: 2px; } }

/* Clear actions: a bar that stays at the bottom of the open email */
.actionbar { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 8px; margin: 24px -32px 0; padding: 14px 32px calc(14px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.btn.big { min-height: 46px; padding: 10px 18px; font-size: 15.5px; border-radius: 12px; }
.btn.big svg { width: 18px; height: 18px; }
.btn kbd { font: 600 11px var(--sans); opacity: .55; margin-left: 4px; border: 1px solid currentColor; border-radius: 5px; padding: 0 5px; line-height: 16px; }
.btn.quiet.big:hover { color: var(--accent); background: var(--soft); }
.icon:disabled { opacity: .3; cursor: default; }
@media (max-width: 760px) {
  .actionbar { margin: 20px -18px 0; padding: 10px 14px; gap: 6px; }
  .btn.big { padding: 10px 13px; font-size: 15px; }
  .btn kbd { display: none; }
}
/* The action bar sits at the bottom of the panel even when the email is short */
#read > .detail { min-height: 100%; display: flex; flex-direction: column; }
#read > .detail > .actionbar { margin-top: auto; }
#read > .detail > :nth-last-child(2) { margin-bottom: 24px; }
#read > .detail { padding-bottom: 0; }
.btn.big { white-space: nowrap; }
@media (max-width: 760px) { .actionbar .btn.quiet .lbl { display: none; } .actionbar .btn.quiet.big { padding: 10px; } }

/* Favourites at the top of Latest */
.favs { padding: 2px 20px 4px; }
.favlab { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.favs .faces { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.favs .faces a { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 60px; flex: none; text-decoration: none; position: relative; }
.favs .faces a:hover { transform: none; }
.favs .faces a:hover .av { box-shadow: 0 0 0 2px var(--page), 0 0 0 4px var(--soft); }
.favs .faces .av { width: 48px; height: 48px; font-size: 16px; box-shadow: none; }
.favs .faces .fn { display: block; font-size: 12px; color: var(--bark); max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wdot { position: absolute; top: 0; right: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2.5px var(--page); }

/* The person a conversation is with, at its top */
.contact-head { display: flex; gap: 14px; align-items: center; margin: 22px 0 6px; padding: 14px 16px; border-radius: 14px; background: var(--cream); cursor: pointer; }
.contact-head:hover { background: var(--sel); }
.contact-head .av.lg { width: 56px; height: 56px; font-size: 20px; }
.contact-head .cname { font-size: 18px; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.contact-head .caddr { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-head .cmeta { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.contact-head .cgo { font-size: 13px; color: var(--muted); white-space: nowrap; }
.contact-head .pinmark svg { width: 14px; height: 14px; color: var(--muted); }
.contact-head + h1 { margin-top: 16px; }
@media (max-width: 760px) { .contact-head .cgo { display: none; } }
/* the list item you're on, in every list */
.fyi.on, .row.on { background: var(--sel); }
.file.on { background: var(--sel); box-shadow: inset 3px 0 0 var(--accent); }

/* Conversation profile header */
.contact-head { display: none; }
.phead { text-align: center; padding: 26px 0 18px; border-bottom: 1px solid var(--line); }
.phead .pface { display: inline-block; cursor: pointer; }
.av.xl { width: 84px; height: 84px; font-size: 30px; }
.phead .pname { display: block; margin-top: 10px; font-size: 22px; font-weight: 600; color: var(--accent); text-decoration: none; cursor: pointer; }
.phead .paddr { color: var(--muted); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.pchips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.pchips a, .pchips span { display: inline-flex; gap: 5px; align-items: center; background: var(--cream); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; color: var(--bark); text-decoration: none; cursor: pointer; }
.pchips span { cursor: default; color: var(--muted); }
.pchips a:hover { background: var(--sel); }
.pchips a.on { background: var(--soft); color: var(--accent); }
.pchips svg { width: 13px; height: 13px; }
.ptools { display: flex; justify-content: center; gap: 18px; }
.ptools button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); cursor: pointer; padding: 0; }
.ptools i { width: 42px; height: 42px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; color: var(--accent); transition: background .15s; }
.ptools button:hover i { background: var(--accent); color: var(--cream); }
.ptools button.on i { background: #fdecd8; color: var(--flag); }
.ptools svg { width: 18px; height: 18px; }
.phead + h1 { margin-top: 20px; }
@media (max-width: 760px) { .ptools { gap: 12px; } .phead { padding-top: 18px; } }
.fyi.need .t strong { font-weight: 600; color: var(--accent); }
.fyi.need .t { color: var(--bark); }
.fyi.scr .t b { font-weight: 600; color: var(--bark); }
.fyi.more { padding-top: 4px; padding-bottom: 8px; }
.fyi.more .t { font-size: 13px; }
.phead > .av { margin: 0 auto; }

/* ⌘K: one place for every search */
.find-btn { display: flex; align-items: center; gap: 10px; width: calc(100% - 8px); margin: 0 4px 14px; border: 1px solid var(--line2); background: var(--page); border-radius: 10px; padding: 8px 10px 8px 12px; color: var(--faint); cursor: pointer; font-size: 15px; }
.find-btn:hover { border-color: var(--accent); color: var(--muted); }
.find-btn svg { width: 16px; height: 16px; }
.find-btn span { flex: 1; text-align: left; }
.find-btn kbd, .cmdk kbd { font: 600 11px var(--sans); border: 1px solid var(--line2); border-radius: 5px; padding: 1px 6px; color: var(--muted); background: var(--cream); }
.ver { color: inherit; text-decoration: none; cursor: pointer; }
.ver:hover { color: var(--accent); text-decoration: underline; }
#cmdk { position: fixed; inset: 0; z-index: 40; }
#cmdk[hidden] { display: none; }
.cmdk-bg { position: absolute; inset: 0; background: rgba(37, 24, 78, .28); }
.cmdk { position: relative; margin: 12vh auto 0; width: min(680px, calc(100vw - 32px)); max-height: 72vh; display: flex; flex-direction: column; background: var(--page); border-radius: 16px; box-shadow: 0 24px 70px rgba(37, 24, 78, .3); overflow: hidden; }
.cmdk-in { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cmdk-in svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.cmdk-in input { flex: 1; border: 0; outline: none; background: none; font-size: 18px; min-width: 0; color: var(--bark); }
.cmdk-in kbd { cursor: pointer; }
.cmdk-scopes { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; align-items: center; }
.cmdk-scopes button { border: 1px solid var(--line2); background: var(--page); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.cmdk-scopes button.on { background: var(--accent); border-color: var(--accent); color: var(--cream); }
.cmdk-scopes button.kf { border-style: dashed; }
.cmdk-scopes button.kf.on { border-style: solid; background: var(--soft); color: var(--accent); border-color: var(--accent); }
.cmdk-scopes button:disabled { opacity: .35; cursor: default; }
.ksep { width: 1px; height: 18px; background: var(--line2); margin: 0 4px; flex: none; }
.cmdk-res { overflow-y: auto; padding: 6px 8px 10px; flex: 1; }
.klabel { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 10px 10px 4px; }
.kitem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; text-decoration: none; color: var(--bark); font-size: 14.5px; }
.kitem > span:first-of-type, .kitem > svg + span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kitem > svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin: 0 5px; }
.kitem b { font-weight: 600; color: var(--accent); }
.kitem .kunread b { font-weight: 700; }
.kitem .thumb { width: 28px; height: 28px; border-radius: 7px; font-size: 8px; }
.kitem.on { background: var(--soft); }
.kmeta { font-size: 12px; color: var(--faint); flex: none; }
.cmdk-foot { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); align-items: center; }
.cmdk-foot kbd { margin-right: 3px; }
@media (max-width: 760px) {
  .cmdk { margin: 0; width: 100vw; height: 100dvh; max-height: none; border-radius: 0; padding-top: env(safe-area-inset-top); }
  .cmdk-foot { display: none; }
}
.kitem > span:first-of-type, .kitem > svg + span { flex: initial; }
.kitem > .av, .kitem > .thumb { flex: none; }
.kitem .kt { flex: 1 !important; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


.screenseg { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--page); color: var(--muted); padding: 6px 12px; font-size: 13.5px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button svg { width: 15px; height: 15px; }
.seg button.on { background: var(--soft); color: var(--accent); font-weight: 600; }
.seg button.on.out { background: var(--sel); color: var(--bark); }
.msg .head .mcopy { opacity: 0; min-width: 32px; min-height: 32px; }
.msg .head .mcopy svg { width: 16px; height: 16px; }
.msg:hover .head .mcopy, .msg .head .mcopy:focus { opacity: .7; }
@media (hover: none) { .msg .head .mcopy { opacity: .6; } }

/* To-do */
.todoadd { padding: 2px 16px 10px; }
.todoadd input { width: 100%; border: 1px solid var(--line2); background: var(--cream); border-radius: 10px; padding: 9px 12px; outline: none; }
.todoadd input:focus { border-color: var(--accent); background: var(--page); }
.todo { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 9px 20px; }
.todo:hover { background: var(--sel); }
.todo .tick { width: 22px; height: 22px; margin-top: 1px; border: 1.5px solid var(--line2); border-radius: 7px; background: var(--page); display: grid; place-items: center; cursor: pointer; padding: 0; color: var(--cream); }
.todo .tick:hover { border-color: var(--accent); }
.todo.done .tick { background: var(--accent); border-color: var(--accent); }
.todo .tick svg { width: 20px; height: 20px; }
.todo .tick svg rect { display: none; }
.todo .tt { min-width: 0; font-size: 15px; }
.todo.done .tt > div:first-child { text-decoration: line-through; color: var(--faint); }
.todo .tmeta { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo .tmeta a { cursor: pointer; text-decoration: none; }
.todo .tmeta a:hover { color: var(--accent); text-decoration: underline; }
.todo .tdel { opacity: 0; min-width: 30px; min-height: 30px; }
.todo .tdel svg { width: 15px; height: 15px; }
.todo:hover .tdel { opacity: .6; }
@media (hover: none) { .todo .tdel { opacity: .5; } }
.sugg { display: grid; gap: 6px; }
.sugtodo { display: flex; align-items: center; gap: 8px; background: var(--soft); border-radius: 10px; padding: 6px 6px 6px 12px; color: var(--accent); font-size: 14.5px; }
.sugtodo span { flex: 1; }
.sugtodo .icon { min-width: 30px; min-height: 30px; color: var(--muted); font-size: 18px; }
.todo .ttext { cursor: text; border-radius: 6px; margin: -2px -6px; padding: 2px 6px; }
.todo .ttext:hover { background: var(--page); box-shadow: inset 0 0 0 1px var(--line2); }
.todo #todo-edit { width: 100%; border: 1px solid var(--accent); border-radius: 6px; padding: 2px 6px; margin: -3px -7px; font: inherit; background: var(--page); outline: none; }

/* A list's own filter (People, Files) */
.lfilter { display: flex; align-items: center; gap: 8px; margin: 0 16px 10px; border: 1px solid var(--line2); background: var(--cream); border-radius: 10px; padding: 0 4px 0 11px; }
.lfilter:focus-within { border-color: var(--accent); background: var(--page); }
.lfilter svg { width: 15px; height: 15px; color: var(--faint); flex: none; }
.lfilter input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 8px 0; }
.lfilter input::-webkit-search-cancel-button { display: none; }
.lfilter .icon { min-width: 28px; min-height: 28px; color: var(--muted); font-size: 18px; }
.todo { grid-template-columns: 18px 26px 1fr auto; padding-left: 8px; }
.todo .grip { width: 18px; height: 22px; display: grid; place-items: center; color: var(--faint); cursor: grab; touch-action: none; opacity: 0; border-radius: 4px; }
.todo .grip svg { width: 16px; height: 16px; }
.todo:hover .grip, .todo .grip:focus { opacity: 1; outline: none; }
.todo .grip:focus { box-shadow: 0 0 0 2px var(--soft); }
@media (hover: none) { .todo .grip { opacity: .7; } }

/* Dragging a to-do: a lifted copy follows you, the row becomes a gap */
.todo-ghost { position: fixed; z-index: 50; margin: 0; pointer-events: none; background: var(--page); border-radius: 12px; box-shadow: 0 1px 2px rgba(37, 24, 78, .08); transition: box-shadow .16s, transform .16s, top .16s cubic-bezier(.2,.8,.2,1); will-change: top, transform; }
.todo-ghost:not(.settling) { transition: box-shadow .16s, transform .16s; }
.todo-ghost.lifted { transform: scale(1.025) rotate(-.6deg); box-shadow: 0 14px 34px rgba(37, 24, 78, .2), 0 2px 6px rgba(37, 24, 78, .12); }
.todo-ghost .grip { opacity: 1; color: var(--accent); }
.todo-ghost .tdel { opacity: 0 !important; }
.todo.todo-gap { background: transparent; }
.todo.todo-gap > * { visibility: hidden; }
.todo.todo-gap { outline: 1.5px dashed var(--line2); outline-offset: -4px; border-radius: 12px; background: color-mix(in srgb, var(--soft) 50%, transparent); }
body.dragging-todo, body.dragging-todo * { cursor: grabbing !important; user-select: none; }
.filters button .cn { opacity: .6; margin-left: 2px; font-variant-numeric: tabular-nums; }
/* ⌘K: the box, scopes and footer keep their size; only the results shrink and scroll */
.cmdk-in, .cmdk-scopes, .cmdk-foot { flex: none; }
.cmdk-res { min-height: 0; }
