:root {
  --bg: #101614;
  --bg-deep: #0c1210;
  --panel: rgba(22, 30, 27, 0.92);
  --panel-solid: #16201c;
  --ink: #f6f3ec;
  --muted: #a7b2ab;
  --mint: #8fe0bf;
  --mint-2: #e7fff4;
  --mint-ink: #10241b;
  --line: rgba(246, 243, 236, 0.1);
  --line-strong: rgba(143, 224, 191, 0.55);
  --danger: #ffb4c0;
  --amber: #f0d7a2;
  --lime: #d7f2a8;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  --mono: "DM Mono", ui-monospace, monospace;
  --sans: Outfit, "Segoe UI", sans-serif;
  --display: Fraunces, Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  background: var(--bg-deep);
}

::selection { background: rgba(143, 224, 191, 0.35); color: #10241b; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--mint-2);
  color: var(--mint-ink);
  padding: 8px 12px;
  z-index: 30;
  border-radius: 8px;
}
.skip:focus { top: 12px; }

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(820px 460px at 100% -10%, rgba(143, 224, 191, 0.16), transparent 58%),
    radial-gradient(640px 420px at -10% 110%, rgba(240, 215, 162, 0.08), transparent 50%),
    linear-gradient(180deg, #141c19 0%, #101614 42%, #0c1210 100%);
}
.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px 16px;
  border-right: 1px solid var(--line);
  background: rgba(12, 18, 16, 0.72);
  min-height: 0;
  overflow: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 8px; }
.mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--mint-2);
  color: var(--mint-ink);
  font-family: var(--display);
  font-size: 20px;
  line-height: 1;
}
.brand strong {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 560;
  letter-spacing: -0.03em;
}
.brand em {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-rule { height: 1px; margin: 10px 12px; background: var(--line); }
.sidebar nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
}
.sidebar nav button:hover { color: var(--ink); background: rgba(246, 243, 236, 0.04); }
.sidebar nav button[aria-current="page"] {
  color: var(--mint-ink);
  background: var(--mint-2);
}
.nav-badge {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--mint-ink);
  color: var(--mint-2);
  font-family: var(--mono);
  font-size: 11px;
}
.sidebar nav button[aria-current="page"] .nav-badge {
  background: var(--mint-ink);
  color: var(--mint-2);
}
.side-foot {
  margin-top: auto;
  padding: 14px 12px;
  border-radius: 16px;
  background: rgba(246, 243, 236, 0.04);
  border: 1px solid var(--line);
}
.side-foot p { margin: 0 0 6px; font-weight: 500; }
.fine { color: var(--muted); font-size: 12px; line-height: 1.45; }
.sidebar nav .signout { margin: 8px 0 0; }
.sidebar nav .signout button { color: var(--muted); }
.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate-card { width: min(420px, 100%); display: grid; gap: 12px; position: relative; z-index: 1; }
.gate-card h1 { font-size: 36px; }
.gate-card .mark { width: 40px; height: 40px; }

.workspace { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 28px 12px;
}
.kicker {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
h1, h2, h3 { font-family: var(--display); font-weight: 560; letter-spacing: -0.03em; }
h1 { margin: 0; font-size: 28px; line-height: 1.1; }
h2 { margin: 0 0 8px; font-size: 30px; line-height: 1.05; }
h3 { margin: 0; font-size: 20px; }
.top-actions, .modal-actions, .row-actions, .token-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.stage { overflow: auto; padding: 4px 28px 28px; min-height: 0; }
.stage.fill { display: flex; flex-direction: column; padding: 0 28px 28px; overflow: hidden; }

.btn {
  border-radius: 999px;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(246, 243, 236, 0.03);
  color: var(--ink);
}
.btn:hover { border-color: rgba(246, 243, 236, 0.22); background: rgba(246, 243, 236, 0.06); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  border: 0;
  color: var(--mint-ink);
  background: var(--mint-2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.04); background: #f4fff9; }
.btn-danger { color: var(--danger); border-color: rgba(255, 180, 192, 0.35); background: transparent; }
.btn-small { padding: 7px 11px; font-size: 12.5px; }
.linkish {
  border: 0;
  padding: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  white-space: normal;
  overflow-wrap: break-word;
}
.linkish:hover { color: var(--mint); }

.measure { max-width: 1120px; min-width: 0; }
.stack, .panel, .split { min-width: 0; }
.sheet { display: grid; gap: 14px; max-width: 980px; }
.panel .account-list { margin-top: 0; }
.hero, .panel, .stat, .account-card, .letter, .editor, .empty-block {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 42%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.hero { padding: 30px; }
.hero p, .panel p, .empty-block p { color: var(--muted); line-height: 1.6; }
.steps { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.step-no {
  font-family: var(--display);
  color: var(--mint);
  font-size: 22px;
}
.steps strong { display: block; margin-bottom: 4px; }
.steps p { margin: 0; }

.stat-grid, .split, .compose-layout, .contact-layout { display: grid; gap: 14px; }
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.split { grid-template-columns: 1.2fr 0.8fr; }
.split > *, .compose-layout > *, .contact-layout > *, .sheet > * { min-width: 0; }
.compose-layout { grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr); align-items: start; }
.contact-layout { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr); align-items: start; }
.stat { padding: 16px 18px; }
.stat span, .panel-head span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat strong {
  display: block;
  margin: 6px 0 2px;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 560;
  letter-spacing: -0.04em;
}
.stat em { font-style: normal; color: var(--muted); font-size: 13px; }
.panel, .editor, .letter { padding: 18px; }
.panel-head, .row-between { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.stack { display: grid; gap: 10px; }
.reply-item, .account-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 11, 0.28);
}
.account-card { align-items: flex-start; }
.account-main { min-width: 0; flex: 1; }
.account-card .row-actions { flex: 0 0 auto; }
.person-sub { overflow-wrap: break-word; }
.reply-item { width: 100%; max-width: 100%; min-width: 0; color: inherit; cursor: pointer; text-align: left; }
.reply-item > span:nth-child(2) { min-width: 0; flex: 1; overflow: hidden; }
.reply-item .when { flex: 0 0 auto; }
.reply-item strong, .reply-item .person-sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reply-item:hover, .thread-row:hover { border-color: rgba(246, 243, 236, 0.2); background: rgba(246, 243, 236, 0.04); }
.person-sub, .hint, .meta-line { color: var(--muted); font-size: 12.5px; }
.meta-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; font-family: var(--mono); font-size: 11px; }
.pipe { display: grid; gap: 10px; }
.pipe-row { display: grid; grid-template-columns: 72px 1fr 28px; gap: 10px; align-items: center; }
.track { height: 7px; border-radius: 99px; background: rgba(246, 243, 236, 0.08); overflow: hidden; }
.bar { height: 100%; border-radius: 99px; background: var(--mint); }
.bar.status-replied { background: var(--lime); }
.bar.status-won { background: var(--amber); }
.bar.status-skipped { background: var(--danger); }
.bar.status-new { background: #6d7872; }

.fields { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field.inline { grid-template-columns: 1fr 1fr; gap: 12px; }
.field label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink);
}
.label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.label-row .token-row { margin: 0; }
.compose-form { margin-top: 16px; }
.compose-who {
  display: grid;
  gap: 12px;
  margin-bottom: 2px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
input, textarea, select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 11, 0.45);
  color: var(--ink);
  padding: 12px 13px;
  font: 14.5px/1.45 var(--sans);
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: #8fe0bf;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.editor { position: sticky; top: 0; align-self: start; }
.editor textarea { min-height: 72px; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(143, 224, 191, 0.7);
  box-shadow: 0 0 0 3px rgba(143, 224, 191, 0.14);
}
input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px #121a17 inset;
}
.hint { margin: 8px 0 0; }
.warn { color: var(--amber); }
.disclosure { margin-top: 14px; }
.disclosure summary { cursor: pointer; color: var(--ink); font-size: 13px; }
details:not([open]) > :not(summary) { display: none; }
.copy-row { display: flex; gap: 8px; min-width: 0; align-items: flex-start; }
.copy-row .btn { flex: 0 0 auto; }
.uri {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 11, 0.45);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink);
}

.account-list, .stack-lg { display: grid; gap: 10px; margin-top: 16px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge, .chip, .status {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge, .chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--ink);
  background: rgba(246, 243, 236, 0.03);
}
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; overflow-wrap: anywhere; }
.chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.status-sent { color: var(--mint); }
.status-replied { color: var(--lime); }
.status-won { color: var(--amber); }
.status-skipped { color: var(--danger); }
.status-new { color: var(--muted); }
.error-line { color: var(--danger); font-size: 12.5px; margin: 6px 0 0; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(12, 18, 16, 0.45);
}
table.contacts { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 0; }
table.contacts th:nth-child(1),
table.contacts td.pick-cell { width: 44px; }
table.contacts th:nth-child(2),
table.contacts td:nth-child(2) { width: 36%; }
table.contacts th:nth-child(3),
table.contacts td:nth-child(3) { width: 20%; }
table.contacts th:nth-child(4),
table.contacts td:nth-child(4) { width: 16%; }
table.contacts th:nth-child(5),
table.contacts td:nth-child(5) { width: 92px; }
table.contacts th:nth-child(6),
table.contacts td.action-cell { width: 104px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: break-word; }
td.action-cell { white-space: nowrap; overflow-wrap: normal; }
th {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(246, 243, 236, 0.025); }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .search { flex: 1 1 200px; max-width: none; }
.search { max-width: 280px; padding: 9px 12px; }

.letter { position: sticky; top: 0; }
.letter h2 { font-size: 28px; word-break: break-word; }
.letter pre {
  margin: 12px 0 0;
  white-space: pre-wrap;
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
}
.token-row { margin: 8px 0 12px; }

.inbox {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(14, 20, 18, 0.72);
}
.thread-list, .chat { min-height: 0; }
.thread-list { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-right: 1px solid var(--line); }
.inbox-tools { display: grid; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.inbox-filters { display: flex; gap: 8px; min-width: 0; }
.inbox-filters .search { flex: 1; max-width: none; min-width: 0; }
.inbox-filters select { width: 138px; flex: 0 0 auto; padding: 9px 10px; }
.seg { display: flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: rgba(8, 12, 11, 0.35); }
.seg button {
  flex: 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 8px;
  cursor: pointer;
}
.seg button.active { background: var(--mint-2); color: var(--mint-ink); }
#thread-rows { flex: 1; min-height: 0; overflow: auto; padding: 8px; display: grid; align-content: start; gap: 4px; }
.thread-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  width: 100%;
  text-align: left;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  padding: 10px;
  cursor: pointer;
  font-family: var(--sans);
}
.thread-row.active { border-color: var(--line); background: rgba(246, 243, 236, 0.05); }
.thread-row > span:nth-child(2) { min-width: 0; }
.thread-row strong { display: block; font-weight: 600; overflow-wrap: break-word; }
.thread-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.thread-row.unread strong { color: var(--ink); }
.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: rgba(246, 243, 236, 0.04);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
}
.when {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); display: inline-block; }

.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: rgba(8, 12, 11, 0.25); }
.chat-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex: 0 0 auto;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 22, 20, 0.9);
}
.chat-head > div { min-width: 0; }
.chat-head h3, .chat-head .person-sub { overflow-wrap: break-word; }
.chat-head .status, .chat-head .btn { flex: 0 0 auto; }
.transcript {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 16px 24px;
}
.daychip {
  align-self: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(246, 243, 236, 0.04);
  border-radius: 999px;
  padding: 4px 8px;
}
.bubble {
  max-width: min(680px, 86%);
  padding: 12px 14px;
  border-radius: 18px 18px 18px 6px;
  border: 1px solid var(--line);
  background: #1a2320;
}
.bubble.out {
  align-self: flex-end;
  border-radius: 18px 18px 6px 18px;
  background: #d7ffe8;
  color: var(--mint-ink);
  border-color: transparent;
}
.bubble.in { align-self: flex-start; }
.bubble.out .meta-line,
.bubble.out .subject-label { color: #3d6756; }
.bubble .text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; margin-top: 8px; }
.bubble .meta-line span { min-width: 0; flex: 1 1 100%; overflow-wrap: break-word; }
.bubble .meta-line time { white-space: nowrap; margin-left: auto; }
.subject-label { margin-top: 8px; color: var(--ink); font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.reply-box {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding: 10px;
  display: grid;
  gap: 8px;
  background: #121a17;
}
.reply-meta { display: grid; gap: 8px; min-width: 0; }
.reply-meta select, .reply-meta input { width: 100%; min-width: 0; padding: 8px 10px; }
.reply-meta .hint { margin: 0; overflow-wrap: anywhere; }
.reply-compose { display: flex; gap: 8px; align-items: flex-end; }
.reply-compose textarea { min-height: 52px; max-height: 140px; }
.reply-compose .btn { flex: 0 0 auto; }
.from-mail { display: none; }
.empty-block { margin: 8px; padding: 28px 18px; text-align: left; }
.thread-list .empty-block h2, .transcript .empty-block h2 { font-size: 22px; }
.back-btn { display: none; }

.results { display: grid; gap: 6px; margin-top: 12px; }
.result { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.result.bad { color: var(--danger); }

.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 40; }
.toast {
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 14px;
  background: #1a2420;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.toast.bad { border-color: rgba(255, 180, 192, 0.45); }

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 10, 9, 0.72);
  z-index: 25;
}
.modal-card {
  width: min(460px, 100%);
  padding: 22px;
  border-radius: 22px;
  background: #171f1c;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.modal-card p { color: var(--muted); line-height: 1.5; }
.modal-actions { justify-content: flex-end; }

body.busy { cursor: progress; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

.docs {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  max-width: 1080px;
  min-width: 0;
}
.docs-nav {
  position: sticky;
  top: 0;
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(12, 18, 16, 0.55);
}
.docs-nav button {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 500 13.5px/1.3 var(--sans);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.docs-nav button:hover { color: var(--ink); background: rgba(246, 243, 236, 0.04); }
.doc { display: grid; gap: 14px; min-width: 0; }
.doc section { scroll-margin-top: 8px; min-width: 0; overflow-wrap: anywhere; }
.doc h2 { font-size: 32px; }
.doc h3 { margin: 18px 0 6px; }
.doc p, .doc li, .kv dd { color: var(--muted); line-height: 1.65; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc ol, .doc ul { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 8px; }
.doc code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--mint-2);
  background: rgba(246, 243, 236, 0.06);
  border-radius: 6px;
  padding: 1px 6px;
  overflow-wrap: anywhere;
}
.doc pre {
  margin: 10px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 11, 0.5);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  overflow: auto;
  white-space: pre-wrap;
}
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 12px 0 0; }
.kv dt, .kv dd { margin: 0; }

@media (max-height: 640px) {
  .topbar { padding-top: 12px; padding-bottom: 8px; }
  h1 { font-size: 28px; }
  .inbox-tools, .chat-head { padding: 8px 10px; }
  .reply-compose textarea { min-height: 40px; }
  .transcript { padding-top: 10px; padding-bottom: 12px; }
}
@media (max-width: 1280px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .split, .compose-layout, .contact-layout { grid-template-columns: 1fr; }
  .letter, .editor { position: static; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  body:has(.app) { overflow: hidden; }
  .app { height: 100dvh; min-height: 0; overflow: hidden; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .sidebar {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }
  .side-foot, .brand em { display: none; }
  .sidebar nav .signout { margin: 0; }
  .brand { padding: 0; }
  .brand strong { font-size: 18px; }
  .mark { width: 30px; height: 30px; font-size: 16px; border-radius: 10px; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; width: 100%; align-items: center; }
  .nav-rule { display: none; }
  .sidebar nav button { width: auto; white-space: nowrap; padding: 8px 10px; font-size: 13px; }
  .inbox-filters { flex-direction: column; }
  .inbox-filters select { width: 100%; }
  .topbar { flex-wrap: wrap; align-items: flex-start; }
  .topbar, .stage { padding-left: 16px; padding-right: 16px; }
  .stage.fill { padding: 0 12px 12px; min-height: 0; height: 100%; }
  .inbox { grid-template-columns: 1fr; min-height: 0; height: 100%; border-radius: 18px; }
  .inbox .chat { display: none; }
  .inbox.show-chat .thread-list { display: none; }
  .inbox.show-chat .chat { display: flex; min-height: 0; height: 100%; }
  .back-btn { display: inline-flex; margin-bottom: 6px; }
  .account-card { flex-direction: column; }
  .account-card .row-actions { width: 100%; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs-nav { position: static; display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .docs-nav button { width: auto; white-space: nowrap; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; }
  .field.inline { grid-template-columns: 1fr; }
  .table-wrap { overflow: visible; border: 0; background: transparent; border-radius: 0; }
  table.contacts { table-layout: auto; }
  table.contacts thead { display: none; }
  table.contacts tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "pick person action"
      "pick company company"
      "pick role role"
      "pick status status";
    gap: 2px 10px;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(8, 12, 11, 0.28);
  }
  table.contacts tr.empty-row { display: block; }
  table.contacts td {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
  }
  table.contacts td.pick-cell { grid-area: pick; align-self: start; padding-top: 4px; }
  table.contacts td:nth-child(2) { grid-area: person; }
  table.contacts td:nth-child(3) { grid-area: company; color: var(--muted); font-size: 12.5px; }
  table.contacts td:nth-child(4) { grid-area: role; color: var(--muted); font-size: 12.5px; }
  table.contacts td:nth-child(5) { grid-area: status; }
  table.contacts td.pick-cell,
  table.contacts td:nth-child(2),
  table.contacts td:nth-child(3),
  table.contacts td:nth-child(4),
  table.contacts td:nth-child(5),
  table.contacts td.action-cell { width: auto; }
  .from-mail { display: block; }
  table.contacts td.action-cell { grid-area: action; align-self: start; }
  table.contacts tr.empty-row td { display: block; }
  table.contacts td:nth-child(3)::before,
  table.contacts td:nth-child(4)::before {
    content: attr(data-label) "  ";
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
  }
  h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
