/* ============================================================
   OS.CSS  ·  Odanisi Operating System chrome
   Clean and near monochrome. One font family. Very few lines:
   space and weight do the separating, not borders.
   Loads after app.css so it overrides the old dashboard chrome.
   ============================================================ */

/* ---------- global calm ---------- */
.page-title { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }
.content { padding-top: var(--sp-8); }

/* the old shell had a topbar; it is gone, so reclaim the height */
.main { min-height: 100vh; }

/* soften the borrowed dashboard: fewer hard lines */
:root[data-theme="paper"] .card { box-shadow: none; border-color: var(--border); }

/* ============================================================
   SIDEBAR
   Bold wordmark, collapse button pinned top right, and when
   collapsed it floats over the content and opens on hover so
   the layout never jumps.
   ============================================================ */
.sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg);
  padding: var(--sp-4) var(--sp-3);
  gap: var(--sp-5);
}
.brand {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2) 0;
  border: 0; margin: 0; min-height: 30px;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700; letter-spacing: -0.025em;
  color: var(--text); white-space: nowrap;
  opacity: 1; transition: opacity .18s var(--ease);
}
.rail-toggle {
  margin-left: auto; width: 28px; height: 28px; flex: none;
  display: grid; place-items: center; border: 0; background: transparent;
  border-radius: var(--radius-sm); color: var(--text-subtle); cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.rail-toggle:hover { color: var(--text); background: var(--surface-hover); }
.rail-toggle svg { width: 17px; height: 17px; }

.nav { gap: var(--sp-5); }
.nav-group { gap: 1px; }
.nav-group + .nav-group { border-top: 0; padding-top: 0; }
.nav-heading {
  font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-subtle); padding: 0 var(--sp-2) var(--sp-2);
  white-space: nowrap; opacity: 1; transition: opacity .18s var(--ease);
}
.nav-item {
  gap: var(--sp-3); padding: 7px var(--sp-2); border-radius: var(--radius-sm);
  font-size: var(--fs-md); color: var(--text-muted); white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-item svg { width: 16px; height: 16px; opacity: .75; }
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.is-active { background: var(--surface-2); color: var(--text); font-weight: 500; }
.nav-item.is-active svg { opacity: 1; }
.nav-label { opacity: 1; transition: opacity .18s var(--ease); }
.nav-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--text-subtle);
  background: transparent; padding: 0; min-width: 0; height: auto;
}

.sidebar-foot { border-top: 1px solid var(--border); padding-top: var(--sp-3); gap: var(--sp-3); }
.sidebar-foot .avatar { width: 26px; height: 26px; font-size: 10px; background: var(--surface-2); color: var(--text-muted); }
.foot-name { font-size: var(--fs-sm); font-weight: 500; }
.foot-role { font-size: var(--fs-xs); color: var(--text-subtle); }

/* ----- collapsed rail: floats, expands on hover, smooth ----- */
.app { transition: grid-template-columns .22s var(--ease); }
.app.is-rail { grid-template-columns: 56px 1fr; }
.app.is-rail .sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
  width: 56px; overflow: hidden;
  transition: width .22s var(--ease), box-shadow .22s var(--ease);
}
.app.is-rail .sidebar:hover { width: 232px; box-shadow: var(--shadow-pop); background: var(--surface); }
/* the fixed sidebar leaves the grid flow, so pin main to column 2 */
.app.is-rail .main { grid-column: 2; }
/* collapse the wordmark's width too, so the toggle stays visible in the rail */
.app.is-rail .brand-name { max-width: 0; overflow: hidden; transition: max-width .22s var(--ease), opacity .18s var(--ease); }
.app.is-rail .sidebar:hover .brand-name { max-width: 180px; }
.app.is-rail .brand-name,
.app.is-rail .nav-heading,
.app.is-rail .nav-label,
.app.is-rail .nav-badge,
.app.is-rail .foot-meta { opacity: 0; pointer-events: none; }
.app.is-rail .sidebar:hover .brand-name,
.app.is-rail .sidebar:hover .nav-heading,
.app.is-rail .sidebar:hover .nav-label,
.app.is-rail .sidebar:hover .nav-badge,
.app.is-rail .sidebar:hover .foot-meta { opacity: 1; pointer-events: auto; }
.app.is-rail .nav-heading { height: 0; padding-bottom: 0; overflow: hidden; transition: height .18s var(--ease), padding .18s var(--ease), opacity .18s var(--ease); }
.app.is-rail .sidebar:hover .nav-heading { height: auto; padding-bottom: var(--sp-2); }

/* ============================================================
   INBOX  ·  list, then conversation
   ============================================================ */
.ws-page { margin: 0; padding: 0; height: 100vh; overflow: hidden; }
.ws-page.is-hidden { display: none; }
body.on-inbox .content { padding: 0; max-width: none; }

.inbox-shell { display: grid; grid-template-columns: 196px minmax(0, 1fr); height: 100vh; }

/* ----- the Inbox's own states, OS language ----- */
.mail-nav {
  border-right: 1px solid var(--border); padding: var(--sp-6) var(--sp-3);
  display: flex; flex-direction: column; gap: var(--sp-5); overflow-y: auto;
}
.mail-nav-group { display: flex; flex-direction: column; gap: 1px; }
.mail-nav-item {
  display: flex; align-items: center; gap: var(--sp-2); width: 100%;
  text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 7px var(--sp-3); border-radius: var(--radius-pill);
  font-size: var(--fs-md); color: var(--text-muted);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.mail-nav-item:hover { background: var(--surface-hover); color: var(--text); }
.mail-nav-item.is-active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.mn-count { margin-left: auto; font-size: var(--fs-xs); color: var(--text-subtle); }

/* ----- list ----- */
.mail-main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.mail-main.is-hidden { display: none; }
.mail-bar {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6) var(--sp-4);
}
.mail-bar-title { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.02em; }
.mail-bar-meta { margin-left: auto; font-size: var(--fs-sm); color: var(--text-subtle); }

/* connect-Telegram control in the inbox bar */
.tg-btn {
  margin-left: var(--sp-3); display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted);
  border: 1px solid var(--border-strong); background: var(--surface);
  padding: 6px 12px; border-radius: var(--radius-pill); cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.tg-btn:hover { background: var(--surface-hover); color: var(--text); }
.tg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-subtle); flex: none; }
.tg-btn.is-connecting .tg-dot { background: var(--warning); animation: livePulse 1.2s infinite; }
.tg-btn.is-live { color: var(--positive); border-color: color-mix(in srgb, var(--positive) 35%, var(--border-strong)); }
.tg-btn.is-live .tg-dot { background: var(--positive); animation: livePulse 2.2s infinite; }
@keyframes livePulse { 0%{opacity:1} 50%{opacity:.35} 100%{opacity:1} }

.rows { overflow-y: auto; flex: 1; padding: 0 var(--sp-3) var(--sp-6); }
.row {
  display: grid;
  grid-template-columns: 22px 24px 108px minmax(0, 1fr) 116px 52px;
  align-items: center; gap: var(--sp-3);
  padding: 11px var(--sp-3); border-radius: var(--radius-sm);
  cursor: pointer; font-size: var(--fs-md); color: var(--text-muted);
  transition: background .13s var(--ease);
}
.row:hover { background: var(--surface-hover); }
.row.is-unread { color: var(--text); }
.row.is-unread .row-src, .row.is-unread .row-subject { font-weight: 600; }

.cbox { display: grid; place-items: center; cursor: pointer; }
.cbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.cbox span {
  width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--border-strong);
  display: block; transition: background .13s var(--ease), border-color .13s var(--ease);
}
.cbox input:checked + span { background: var(--text); border-color: var(--text); }
.star { border: 0; background: transparent; cursor: pointer; color: var(--text-subtle); display: grid; place-items: center; padding: 0; }
.star svg { width: 16px; height: 16px; }
.star:hover { color: var(--text-muted); }
.star.is-on { color: var(--brand); }
.star.is-on svg { fill: currentColor; }

.row-src { font-size: var(--fs-md); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-subject { color: var(--text); }
.row-sep { color: var(--text-subtle); margin: 0 4px; }
.row-snip { color: var(--text-subtle); }
.row-state { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-subtle); white-space: nowrap; }
.pip { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); flex: none; }
.pip-open { background: var(--brand); }
.pip-wait { background: var(--warning); }
.row-time { font-size: var(--fs-sm); color: var(--text-subtle); text-align: right; white-space: nowrap; }

/* ============================================================
   CONVERSATION VIEW
   ============================================================ */
.convo-view { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.convo-view.is-hidden { display: none; }

.cv-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); }
.cv-back, .cv-ctx-toggle {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  border: 0; background: transparent; border-radius: var(--radius-sm);
  color: var(--text-subtle); cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.cv-back:hover, .cv-ctx-toggle:hover { color: var(--text); background: var(--surface-hover); }
.cv-back svg, .cv-ctx-toggle svg { width: 18px; height: 18px; }
.cv-ctx-toggle { margin-left: auto; }
.cv-ctx-toggle.is-on { color: var(--text); background: var(--surface-2); }
.cv-title { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.01em; }
.cv-meta { font-size: var(--fs-sm); color: var(--text-subtle); display: flex; align-items: center; gap: 7px; margin-top: 1px; }
.cv-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-subtle); display: inline-block; }

.cv-body { flex: 1; display: flex; min-height: 0; }
/* the scroll container is full width, so its scrollbar sits at the far right;
   the content is centred inside via .cv-inner. */
.cv-stream { flex: 1; overflow-y: auto; min-width: 0; padding: var(--sp-3) 0 var(--sp-8); }
.cv-inner {
  max-width: 780px; margin: 0 auto; padding: 0 var(--sp-8);
  display: flex; flex-direction: column; gap: var(--sp-5);
}

/* thin, quiet scrollbars everywhere in the app (ChatGPT/Claude style) */
.app { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-subtle) 32%, transparent) transparent; }
.app ::-webkit-scrollbar { width: 9px; height: 9px; }
.app ::-webkit-scrollbar-track { background: transparent; }
.app ::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-subtle) 32%, transparent);
  border-radius: 999px; border: 3px solid transparent; background-clip: padding-box;
}
.app ::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text-subtle) 55%, transparent); background-clip: padding-box; }

/* the whole reasoning trail is one collapsible block */
.trail-wrap { display: flex; flex-direction: column; }
.trail-wrap[hidden] { display: none; }
.trail-head {
  display: inline-flex; align-items: center; gap: var(--sp-2); align-self: flex-start;
  border: 0; background: transparent; cursor: pointer; padding: 4px 0; margin-bottom: var(--sp-2);
  color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500;
}
.trail-head:hover { color: var(--text); }
.trail-caret { width: 13px; height: 13px; flex: none; color: var(--text-subtle); transition: transform .2s var(--ease); }
.trail-wrap.is-collapsed .trail-caret { transform: rotate(-90deg); }
.trail-head-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-subtle); }
.trail-wrap.is-collapsed .trail { display: none; }

/* messages: guest on the left, business on the right, clearly distinct */
#msgs { display: flex; flex-direction: column; gap: 6px; }
.m-in { max-width: 76%; align-self: flex-start; }
.m-out { max-width: 76%; align-self: flex-end; }
.m-bubble {
  position: relative;
  padding: 8px 12px 8px 13px; border-radius: 16px;
  font-size: var(--fs-base); line-height: 1.5; color: var(--text);
}
.m-bubble::after { content: ""; display: block; clear: both; }
.m-text { overflow-wrap: anywhere; }
/* time (and delivered tick) sit inside the bubble, bottom-right */
.m-meta {
  float: right; display: inline-flex; align-items: center; gap: 3px;
  margin: 8px -3px -2px 10px; font-size: 10px; line-height: 1;
  color: var(--text-subtle); user-select: none;
}
.m-tick { width: 15px; height: 9px; }

.m-in .m-bubble { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }

/* "Odanisi is typing" indicator */
.typing-dots { display: inline-flex; align-items: center; gap: 4px; padding: 11px 14px; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-subtle);
  animation: os-typing 1.2s infinite ease-in-out both;
}
.typing-dots span:nth-child(2) { animation-delay: .18s; }
.typing-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes os-typing {
  0%, 80%, 100% { opacity: .3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.m-out.ai .m-bubble { background: var(--brand-soft); border: 1px solid var(--brand-soft-border); border-bottom-right-radius: 5px; }
.m-out.ai .m-meta { color: color-mix(in srgb, var(--brand) 70%, var(--text-subtle)); }
.m-out.staff .m-bubble { background: var(--text); color: var(--bg); border-bottom-right-radius: 5px; }
.m-out.staff .m-meta { color: color-mix(in srgb, var(--bg) 60%, transparent); }
/* consecutive same-side bubbles hug together a touch tighter */
.m-in + .m-in, .m-out + .m-out { margin-top: -2px; }

/* ----- the milestone trail: status, never narration ----- */
.trail { display: flex; flex-direction: column; }
.ms { position: relative; padding-left: 22px; }
/* the spine that connects milestones */
.ms::before {
  content: ""; position: absolute; left: 5px; top: 20px; bottom: -2px;
  width: 1px; background: var(--border);
}
.ms:last-child::before { display: none; }

.ms-head {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%;
  text-align: left; border: 0; background: transparent; cursor: default;
  padding: 7px 0; color: var(--text-muted); font-size: var(--fs-md);
}
.ms.has-detail .ms-head { cursor: pointer; }
.ms.has-detail:hover .ms-label { color: var(--text); }
.ms-mark {
  position: absolute; left: 0; width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); background: var(--bg);
}
.ms.is-active .ms-mark { border-color: var(--text-subtle); }
.ms.is-active .ms-mark::after {
  content: ""; position: absolute; inset: 1.5px; border-radius: 50%;
  border: 1.5px solid transparent; border-top-color: var(--text-muted);
  animation: msSpin .7s linear infinite;
}
@keyframes msSpin { to { transform: rotate(360deg); } }
.ms.is-done .ms-mark { background: var(--text); border-color: var(--text); }
.ms.is-waiting .ms-mark { border-color: var(--warning); border-style: dashed; }
.ms.is-done .ms-label { color: var(--text); font-weight: 500; }
.ms.is-waiting .ms-label { color: var(--warning); }
.ms-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-subtle); }
.ms-caret {
  width: 13px; height: 13px; margin-left: auto; flex: none; color: var(--text-subtle);
  opacity: 0; transition: transform .2s var(--ease), opacity .15s var(--ease);
}
.ms.has-detail .ms-caret { opacity: 1; }
.ms.is-open .ms-caret { transform: rotate(90deg); }

.ms-body { max-height: 0; overflow: hidden; transition: max-height .26s var(--ease); }
.ms.is-open .ms-body { max-height: 460px; }
.ms-inner {
  margin: 0 0 var(--sp-3); padding: var(--sp-3) var(--sp-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column; gap: 6px;
}

/* ----- the live draft card: the workspace everything revolves around ----- */
.dcard {
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden; margin-top: var(--sp-4);
}
.dcard-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border);
}
.dcard-kind { font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--text-subtle); }
.dcard-id { font-size: var(--fs-lg); font-weight: 600; margin-top: 2px; letter-spacing: -0.01em; }
.dcard-unit { font-size: var(--fs-md); font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.dcard-status {
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted);
  background: var(--surface-2); border-radius: var(--radius-pill); padding: 4px 11px; white-space: nowrap; flex: none;
}
.dcard-status.wait { color: var(--warning); }
.dcard-status.ok { color: var(--bg); background: var(--text); }

.dcard-sec { padding: var(--sp-4) var(--sp-5); }
.dcard-sec + .dcard-sec { border-top: 1px solid var(--border); }
.dcard-h { font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--text-subtle); margin-bottom: var(--sp-3); }

.drow { display: flex; align-items: center; gap: var(--sp-3); padding: 4px 0; font-size: var(--fs-md); }
.drow-mark { width: 12px; height: 12px; border-radius: 50%; flex: none; position: relative; }
.drow.is-empty .drow-mark { border: 1.5px dashed var(--border-strong); }
.drow.is-filled .drow-mark { background: var(--positive); }
.drow.is-filled .drow-mark::after {
  content: ""; position: absolute; left: 3.5px; top: 2.5px; width: 3px; height: 5.5px;
  border: 1.5px solid var(--surface); border-top: 0; border-left: 0; transform: rotate(42deg);
}
.drow-k { color: var(--text-subtle); min-width: 116px; }
.drow-v { color: var(--text); font-weight: 500; }
.drow.is-empty .drow-v { color: var(--text-subtle); font-weight: 400; font-style: italic; }

.pchecks { display: flex; flex-wrap: wrap; gap: 6px; }
.pchk {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm);
  color: var(--text); background: var(--surface-2); border-radius: var(--radius-pill); padding: 4px 11px;
}
.pchk i { width: 5px; height: 5px; border-radius: 50%; background: var(--positive); flex: none; }

.kv b.bad { color: var(--negative); }
.cv-replay { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 0; background: transparent; border-radius: var(--radius-sm); color: var(--text-subtle); cursor: pointer; margin-left: auto; transition: color .15s var(--ease), background .15s var(--ease); }
.cv-replay:hover { color: var(--text); background: var(--surface-hover); }
.cv-replay svg { width: 17px; height: 17px; }
.cv-ctx-toggle { margin-left: 0; }

/* the trace: one card per stage, sized to its own content */
.trace { align-self: flex-start; max-width: 100%; }
.trace-toggle {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  border: 0; background: transparent; cursor: pointer;
  padding: 3px 0; color: var(--text-muted); font-size: var(--fs-md);
  transition: color .15s var(--ease);
}
.trace-toggle:hover { color: var(--text); }
.caret { width: 14px; height: 14px; flex: none; color: var(--text-subtle); transition: transform .2s var(--ease); }
.trace.is-open .caret { transform: rotate(90deg); }
.t-label { font-weight: 500; }
.t-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-subtle); }

.trace-body {
  max-height: 0; overflow: hidden;
  transition: max-height .26s var(--ease);
}
.trace.is-open .trace-body { max-height: 520px; }
.trace-inner {
  margin-top: var(--sp-2);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-4);
  display: flex; flex-direction: column; gap: 7px;
}

.kv { display: flex; justify-content: space-between; gap: var(--sp-5); font-size: var(--fs-md); }
.kv span { color: var(--text-subtle); }
.kv b { font-weight: 500; color: var(--text); text-align: right; }
.kv b.add { color: var(--positive); }
.kv b.hold { color: var(--warning); }
.note { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.55; margin-top: 3px; }

/* ----- permission card: sits in the composer area, never in the thread ----- */
.ask {
  max-width: 780px; margin: 0 auto var(--sp-3);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: var(--sp-4) var(--sp-4) var(--sp-3);
}
.ask.is-hidden { display: none; }
.ask-q { font-size: var(--fs-base); font-weight: 600; color: var(--text); }
.ask-sub { font-size: var(--fs-md); color: var(--text-muted); margin-top: 3px; }
.ask-body {
  margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2); border-radius: var(--radius-sm);
  font-size: var(--fs-md); line-height: 1.6; color: var(--text);
}
.ask-acts { display: flex; align-items: center; margin-top: var(--sp-3); }
.ask-deny, .ask-allow {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-size: var(--fs-md); font-weight: 500; border-radius: var(--radius-sm);
  padding: 7px var(--sp-3); transition: background .15s var(--ease), color .15s var(--ease);
}
.ask-deny { border: 0; background: var(--surface-2); color: var(--text-muted); }
.ask-deny:hover { background: var(--surface-hover); color: var(--text); }
.ask-allow { margin-left: auto; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); }
.ask-allow:hover { background: var(--surface-2); }
.ask-k { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-subtle); }

/* ----- context panel: closed until asked for ----- */
.ctx {
  width: 0; flex: none; overflow: hidden; border-left: 1px solid transparent;
  transition: width .24s var(--ease), border-color .24s var(--ease);
}
.ctx.is-open { width: 296px; border-left-color: var(--border); }
.ctx-inner {
  width: 296px; height: 100%; overflow-y: auto;
  padding: var(--sp-4) var(--sp-5) var(--sp-8);
  display: flex; flex-direction: column; gap: var(--sp-5);
}
.ctx-block { display: flex; flex-direction: column; gap: 5px; }
.ctx-h { font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--text-subtle); }
.ctx-v { font-size: var(--fs-base); font-weight: 600; color: var(--text); margin-bottom: 3px; }

/* ----- composer ----- */
.composer { padding: 0 var(--sp-8) var(--sp-5); }
.composer-box {
  display: flex; align-items: flex-end; gap: var(--sp-3);
  max-width: 780px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.composer-box:focus-within { border-color: var(--text-subtle); box-shadow: 0 0 0 3px var(--surface-2); }
.composer-box textarea {
  flex: 1; border: 0; background: transparent; resize: none; outline: none;
  font: inherit; font-size: var(--fs-base); line-height: 1.55; color: var(--text);
  max-height: 160px; padding: 4px 0;
}
.c-send {
  width: 30px; height: 30px; flex: none; border: 0; border-radius: var(--radius-sm);
  background: var(--text); color: var(--bg); display: grid; place-items: center; cursor: pointer;
  transition: opacity .15s var(--ease);
}
.c-send:hover { opacity: .88; }
.c-send svg { width: 17px; height: 17px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .ctx.is-open { width: 0; border-left-color: transparent; }
}
@media (max-width: 900px) {
  .inbox-shell { grid-template-columns: 1fr; }
  .mail-nav { display: none; }
  .row { grid-template-columns: 22px 24px minmax(0, 1fr) 52px; }
  .row-src, .row-state { display: none; }
  .cv-inner, .composer { padding-left: var(--sp-4); padding-right: var(--sp-4); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
}

/* inline edit of a drafted reply before it is sent */
.ask-edit { background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted); border-radius: var(--radius-sm); padding: 7px 12px; font-size: var(--fs-md); font-weight: 500; cursor: pointer; margin-left: var(--sp-2); transition: background .15s var(--ease), color .15s var(--ease); }
.ask-edit:hover { color: var(--text); background: var(--surface-hover); }
.ask-body.is-editing { outline: none; border: 1px solid var(--brand); box-shadow: 0 0 0 3px var(--surface-2); background: var(--surface); }
