:root {
  --bg: #0e0e0c;
  --bg-side: #0a0a09;
  --surface: #141412;
  --surface-2: #1b1b18;
  --ink: #f4f1ea;
  --muted: #a39e94;
  --line: #2c2c28;
  --line-strong: #3c3c36;
  --lime: #dff34d;
  --late: #ff8f80;
  --today: #dff34d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --sans: Manrope, "Segoe UI", sans-serif;
  --display: Syne, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--lime);
  z-index: 80;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
::selection { background: var(--lime); color: #141412; }
[hidden] { display: none !important; }
.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.app {
  display: none;
  grid-template-columns: 248px minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
}
body.is-in .app { display: grid; }
.side footer p { margin: 0; }
.side {
  background: var(--bg-side);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 22px 18px 16px;
}
.mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--lime);
  color: #141412;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
}
.brand strong {
  display: block;
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: -0.04em;
  font-weight: 750;
}
.brand small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 10px;
}
.side nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
}
.nav-btn {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: transparent;
  border: 0;
  color: #d9d3c8;
  border-radius: 10px;
  padding: 10px 12px 10px 14px;
  font-weight: 650;
}
.nav-btn:hover { background: #141412; color: white; }
.nav-btn.is-on { background: #1c1c18; color: white; }
.nav-btn.is-on::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--lime);
}
.nav-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--lime);
  color: #141412;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.side footer {
  margin-top: auto;
  padding: 16px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.foot-actions { display: flex; gap: 8px; }
.sync-btn { width: 100%; }
#sync.is-error { color: #ffb4a8; }

main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding: 22px 28px 14px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(14, 14, 12, 0.92);
  backdrop-filter: blur(12px);
}
.kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 750;
}
.top-actions { display: flex; gap: 10px; align-items: center; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #171714;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px 0 12px;
}
.search svg { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; }
.search input {
  border: 0;
  background: transparent;
  padding: 10px 0;
  width: min(320px, 38vw);
  outline: none;
}
.search:focus-within { border-color: var(--lime); }

#view {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px 28px 28px;
}
#view.is-fill {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#view.is-fill .chips { flex: 0 0 auto; }
#view.is-fill .inbox { flex: 1 1 auto; height: auto; min-height: 0; }

.btn {
  background: var(--lime);
  color: #141412;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 650;
}
.btn.danger {
  background: transparent;
  color: #ffb4a8;
  border: 1px solid #5a2e28;
  font-weight: 650;
}
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}
.text-btn {
  background: none;
  border: 0;
  color: var(--lime);
  padding: 0;
  font-weight: 750;
}
button:focus-visible, a:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(223, 243, 77, 0.16);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat {
  text-align: left;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px 16px;
}
.stat:hover { border-color: var(--line-strong); }
.stat p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.stat strong {
  display: block;
  margin: 10px 0 4px;
  font-family: var(--display);
  font-size: clamp(22px, 2vw, 30px);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat span { color: var(--muted); font-size: 12px; }

.mrr {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  margin: 0;
  padding: 22px 26px 20px;
  border: 1px solid rgba(223, 243, 77, 0.45);
  border-radius: 18px;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(223, 243, 77, 0.18), transparent 52%),
    var(--surface);
}
.revenue {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
  margin-bottom: 12px;
}
.ca {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 22px 26px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.ca:hover, .mrr:hover { border-color: var(--lime); }
.mrr p, .ca p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
}
.mrr p { color: var(--lime); }
.ca p { color: var(--muted); }
.mrr strong, .ca strong {
  display: block;
  margin: 8px 0 8px;
  font-family: var(--display);
  font-size: clamp(40px, 5vw, 64px);
  letter-spacing: -0.05em;
  line-height: 0.92;
  font-variant-numeric: tabular-nums;
}
.mrr strong { color: var(--lime); }
.ca strong { color: var(--ink); }
.mrr span, .ca span { color: var(--muted); font-size: 14px; }

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
  margin-top: 12px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  min-width: 0;
}
.panel-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.panel h2, .group h3, .drawer h3 {
  font-family: var(--display);
  letter-spacing: -0.03em;
}
.panel h2 { margin: 0; font-size: 18px; }
.panel.wide { margin-top: 12px; }
.template-list { display: flex; flex-direction: column; gap: 10px; }
.template-card .panel-h { align-items: flex-start; flex-wrap: wrap; }
.template-card h2 { font-size: 20px; }
.template-card .subject { margin: 4px 0 0; font-weight: 750; }
.template-body {
  margin: 8px 0 0;
  color: var(--muted);
  white-space: pre-wrap;
  max-height: 8.6em;
  overflow: hidden;
}
.template-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.composer-picks .text-btn { white-space: nowrap; }
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  color: inherit;
  padding: 11px 2px;
  text-align: left;
}
.row:hover b { color: var(--lime); }
.row span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row small, .sub, .muted { color: var(--muted); }
.row small { font-size: 12px; }
.row b { font-weight: 750; }
.due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.row > .due { white-space: normal; text-align: right; }
.due .renew { margin-left: auto; max-width: 240px; }
.due.is-late { color: var(--late); font-weight: 750; }
.due.is-today { color: var(--today); font-weight: 750; }

.bar-row {
  display: grid;
  grid-template-columns: 108px 1fr 96px;
  gap: 10px;
  align-items: center;
  margin: 9px 0;
  font-size: 13px;
}
.bar-row b { text-align: right; }
.bar-row b { font-variant-numeric: tabular-nums; font-weight: 700; }
.track {
  height: 8px;
  background: #242420;
  border-radius: 99px;
  overflow: hidden;
}
.track span {
  display: block;
  height: 100%;
  background: var(--lime);
  border-radius: 99px;
}
.ponder {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 10px 6px 12px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.chip em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.is-on { background: var(--lime); color: #141412; border-color: var(--lime); font-weight: 800; }
.chip.is-on em { color: #141412; }
.summary { color: var(--muted); margin: -2px 0 14px; font-size: 13px; }
.summary strong { color: var(--ink); font-weight: 750; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 750;
  padding: 12px 14px;
  background: #191916;
}
td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}
tr:hover td { background: #191916; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
.linkish {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 750;
  padding: 0;
  text-align: left;
}
.linkish:hover { color: var(--lime); }
.sub { display: block; font-size: 12px; margin-top: 2px; }
.renew { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1.35; }
.due .renew { text-align: right; }
.renew.is-change { color: #ffb4a8; }
.renew-inline { display: none; }
.sub a { color: inherit; text-underline-offset: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-b2b { color: var(--lime); background: transparent; border-color: rgba(223, 243, 77, 0.45); }
.badge-partner { color: #efe6ff; background: #3a2758; }
.badge-endclient { color: #d9f4ff; background: #163e4d; }
.badge-prospect { color: #d9d3c8; background: #2a2a26; }
.badge-active { color: #102216; background: #9dffbf; }
.badge-paused { color: #2a1d08; background: #ffd27a; }
.badge-lost, .badge-unqualified { color: #ffd2cb; background: #4a2420; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

.board {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 280px;
  scroll-snap-type: x proximity;
}
.col {
  width: 286px;
  flex: 0 0 286px;
  background: #121210;
  border: 1px solid var(--line);
  border-radius: 16px;
  scroll-snap-align: start;
}
.col.is-drop { border-color: var(--lime); }
.col-h {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 12px 12px 10px;
  font-size: 13px;
  font-weight: 750;
}
.col-h .dot-label { display: inline-flex; align-items: center; gap: 8px; }
.col-h .muted { font-weight: 550; font-size: 11px; text-align: right; }
.col-body { min-height: 148px; padding: 0 8px 8px; }
.dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }
.dot-nouveau { background: #8a847a; }
.dot-qualifie { background: #8eb6ff; }
.dot-rdv { background: #7ee0d6; }
.dot-proposition { background: #dff34d; }
.dot-negociation { background: #ffb020; }
.dot-gagne { background: #3dd68c; }
.dot-perdu, .dot-non_qualifie { background: #ff6b5a; }
.qual-select { width: 148px; padding: 8px 10px; border-radius: 10px; background: #10100e; border: 1px solid var(--line); }
.card {
  background: var(--surface-2);
  border: 1px solid #2c2c28;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
}
.card:hover { border-color: #4a4a40; }
.card.is-dragging { opacity: 0.4; }
.card h3 { margin: 8px 0 0; font-size: 15px; letter-spacing: -0.02em; }
.card-title { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.card-amount {
  margin: 10px 0 0;
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: -0.03em;
}
.card-amount span { font-family: var(--sans); font-size: 12px; color: var(--muted); font-weight: 550; }
.card-next { margin: 8px 0 0; font-size: 12px; color: #d9d3c8; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.drop-hint { color: var(--muted); font-size: 12px; text-align: center; padding: 22px 8px; }

.group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.group h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 800;
}
.task {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.task:hover { border-color: var(--line-strong); }
.check {
  width: 18px; height: 18px;
  border-radius: 6px;
  border: 1.5px solid #6f6a60;
  background: transparent;
  padding: 0;
  position: relative;
}
.check.is-done { background: var(--lime); border-color: var(--lime); }
.check.is-done::after {
  content: "";
  position: absolute;
  left: 5px; top: 2px;
  width: 4px; height: 8px;
  border: solid #141412;
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}
.task.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.inbox {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  height: 100%;
  min-height: 0;
}
.thread-list { overflow: auto; border-right: 1px solid var(--line); min-height: 0; }
.thread-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  padding: 12px 14px 12px 18px;
  position: relative;
}
.thread-item:hover { background: #191916; }
.thread-item.is-on { background: #1e1e1a; }
.thread-item.has-unread b { font-weight: 800; }
.thread-item.has-unread::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 99px;
  background: var(--lime);
  position: absolute;
  left: 7px; top: 18px;
}
.ti-top { display: flex; justify-content: space-between; gap: 8px; }
.ti-top b { font-weight: 750; }
.ti-top time, .ti-sub, .ti-preview { color: var(--muted); font-size: 12px; }
.ti-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.thread-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.thread-head h2 { margin: 6px 0 0; font-family: var(--display); font-size: 22px; letter-spacing: -0.03em; }
.bubbles {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.bubbles::before { content: ""; flex: 1 1 auto; min-height: 0; }
.bubble { max-width: min(560px, 88%); padding: 10px 12px; border-radius: 14px; }
.bubble p { margin: 0; }
.bubble time { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.bubble.out { margin-left: auto; background: #2a2c16; border-bottom-right-radius: 4px; }
.bubble.in { margin-right: auto; background: #22221e; border-bottom-left-radius: 4px; }
.bubble.note {
  margin-inline: auto;
  background: transparent;
  border: 1px dashed #3f3f38;
  color: #e7e1d6;
}
.composer { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.composer textarea, .composer input, .field input, .field select, .field textarea, .deal-actions select, .composer select {
  width: 100%;
  border-radius: 10px;
  background: #10100e;
  border: 1px solid var(--line);
  padding: 10px 12px;
}
.composer textarea { resize: none; min-height: 72px; max-height: 28vh; }
.composer .hint { margin: 0; }
.mail-secret { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 650; }
.composer-tools, .composer-foot, .composer-picks, .composer-send { display: flex; gap: 8px; align-items: center; }
.composer-tools { justify-content: space-between; }
.composer-send { margin-left: auto; }
.composer-tools select, .composer-picks select { width: auto; max-width: 180px; }
.bubble-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.unsent { color: #ffb4a8; font-size: 12px; font-weight: 750; }

.empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); font-family: var(--display); margin: 0 0 6px; font-size: 22px; }
.empty p { margin: 0; }
.results h3 {
  margin: 18px 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

#drawer, #modal { position: fixed; top: 0; right: 0; bottom: 0; }
#modal { left: 0; z-index: 40; }
#drawer { left: 248px; z-index: 20; }
#modal { z-index: 40; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); }
.drawer {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(540px, 100%);
  overflow: auto;
  background: #121210;
  border-left: 1px solid var(--line);
  z-index: 1;
  padding: 22px 22px 40px;
}
.drawer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer h2 {
  margin: 10px 0 6px;
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.lede { margin: 0; color: #d9d3c8; }
.lede a { color: var(--lime); }
.notes { color: #e7e1d6; margin: 14px 0 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.drawer h3 {
  margin: 26px 0 8px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 800;
}
.callout {
  background: #163e4d;
  color: #d9f4ff;
  padding: 12px 14px;
  border-radius: 12px;
  margin-top: 14px;
}
.callout button {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  padding: 0;
}
.person, .deal-line, .port-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.deal-actions { display: flex; gap: 8px; align-items: center; }
.deal-actions select { width: 148px; padding: 8px 10px; }
.person-actions { display: flex; gap: 8px; align-items: center; }

.modal {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100% - 28px));
  margin: 6vh auto;
  background: #161614;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  max-height: 88vh;
  overflow: auto;
}
.modal header, .modal footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
}
.modal header { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #161614; z-index: 1; }
.modal footer { border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #161614; }
.modal h2 { margin: 0; font-family: var(--display); font-size: 22px; letter-spacing: -0.03em; }
.modal-body { padding: 16px 18px 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.field > span { color: var(--muted); }
.checkline { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.hint { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.privacy { display: grid; gap: 12px; }
.privacy .panel h2 { margin: 0 0 8px; }
.panel h3 {
  margin: 16px 0 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.plain { margin: 0; padding-left: 18px; }
.plain li { margin: 4px 0; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; max-width: 460px; }
.user-list { margin-top: 8px; }
.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.gate-card {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}
.gate-card h1 {
  font-family: var(--display);
  font-size: clamp(28px, 6vw, 36px);
  margin: 4px 0 0;
}
.gate-card .btn { margin-top: 4px; }
.gate-error { margin: 0; color: #ffb4a8; }
.modal-actions { display: flex; gap: 8px; }

#toasts {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
}
.toast {
  background: var(--lime);
  color: #141412;
  font-weight: 800;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: rise 0.18s ease;
}
.toast.is-error { background: #3a1612; color: #ffd2cb; }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }

@media (max-width: 1100px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  #drawer { left: 0; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .side footer { flex-direction: row; flex-wrap: wrap; align-items: center; margin-top: 0; padding: 8px 12px 12px; }
  .sync-btn { width: auto; }
  .side nav { flex-direction: row; overflow-x: auto; }
  .nav-btn { width: auto; white-space: nowrap; min-height: 44px; }
  .nav-btn.is-on::before { top: auto; bottom: 0; left: 10px; right: 10px; width: auto; height: 3px; }
  .topbar, .top-actions { flex-direction: column; align-items: stretch; }
  .topbar { padding: 16px; }
  .search, .search input { width: 100%; }
  .top-actions .btn { align-self: flex-start; }
  #view { padding: 4px 16px 24px; }
  .inbox { grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; }
  #view.is-fill { overflow: auto; }
  .thread, .bubbles { overflow: visible; }
  .composer { position: sticky; bottom: 0; }
  .thread-list { max-height: 280px; border-right: 0; border-bottom: 1px solid var(--line); }
  .col-hide, .col-renew { display: none; }
  .renew-inline { display: block; }
  h1 { font-size: 28px; }
}
@media (max-width: 640px) {
  .stats, .form-grid, .revenue { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .deal-line, .person, .composer-tools, .composer-foot, .task { flex-direction: column; align-items: flex-start; }
  .composer-send { margin-left: 0; }
  .modal { margin: 12px auto; width: calc(100% - 16px); }
  #toasts { left: 12px; right: 12px; }
  .mrr, .ca { padding: 16px; }
}
body.is-modal { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
