:root {
  --bg: #07111c;
  --bg-2: #0b1826;
  --card: #122033;
  --card-2: #182a40;
  --ink: #f3efe6;
  --muted: #93a3b5;
  --line: rgba(232, 214, 176, 0.12);
  --gold: #d4b37a;
  --gold-dim: #8d7344;
  --ok: #7dbaa3;
  --warn: #d4a054;
  --danger: #d17a7a;
  --pad: 20px;
  --radius: 22px;
  --dock: 88px;
  --serif: "Fraunces", "Times New Roman", serif;
  --sans: "Figtree", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 420px at 50% -80px, #14304a 0%, transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
}
body {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(var(--dock) + 24px + env(safe-area-inset-bottom, 0px));
}
body.has-group-bar {
  padding-bottom: calc(var(--dock) + 168px + env(safe-area-inset-bottom, 0px));
}
button, input, textarea { font: inherit; }
h1, h2, .serif { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; text-wrap: pretty; }
.top { padding: 22px var(--pad) 8px; }
.kicker {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
h1 {
  margin: 6px 0 0;
  font-size: 34px;
  line-height: 1.05;
}
.lede {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 40rem;
}
main {
  padding: 8px var(--pad) 36px;
  display: grid;
  gap: 14px;
}
.panel {
  background: linear-gradient(180deg, var(--card) 0%, #101c2c 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.panel h2, .panel h3, .tap-card h3, .hist h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}
.meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}
.why { margin: 10px 0 0; font-size: 15px; }
.amount {
  margin: 10px 0 0;
  color: var(--gold);
  font-weight: 650;
  font-size: 16px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.kpis.one { grid-template-columns: 1fr; }
.kpi, .kpis div {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 10px;
  text-align: left;
  color: inherit;
  min-height: 72px;
}
.kpi:active { background: rgba(212, 179, 122, 0.12); }
.kpis b {
  display: block;
  font-size: 28px;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1;
}
.kpis span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.today-layout { display: grid; gap: 14px; }
.tap-card {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
}
.tap-card:first-of-type { border-top: 0; padding-top: 2px; }
.tap-body { flex: 1; min-width: 0; }
.chev {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--gold-dim);
}
.tap-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.mini-check {
  display: grid;
  place-items: center;
  padding-top: 4px;
}
.mini-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}
.flag { font-style: normal; }
.filters, .pills, .subtabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar, .pills::-webkit-scrollbar, .subtabs::-webkit-scrollbar { display: none; }
.filters button, .pills button, .subtabs button {
  white-space: nowrap;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  min-height: 40px;
}
.filters button.on, .pills button.on, .subtabs button.on {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.actions button, .ghost, .primary, .danger {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  padding: 12px;
  font-weight: 650;
  color: var(--ink);
  background: var(--card-2);
}
.primary { background: var(--gold); color: #1a1408; }
.danger { background: #3a1d22; color: #f0c4c4; }
.ghost { background: transparent; border: 1px solid var(--line); }
.ghost.compact, .compact {
  min-height: 36px;
  padding: 8px 12px;
  width: auto;
  font-size: 13px;
}
.dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: rgba(10, 20, 32, 0.94);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 6px;
  backdrop-filter: blur(16px);
  z-index: 8;
}
.dock button {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  min-height: 52px;
  border-radius: 16px;
  padding: 6px 4px 8px;
}
.dock button.active {
  color: var(--ink);
  background: rgba(212, 179, 122, 0.12);
}
.dock svg { width: 20px; height: 20px; fill: currentColor; }
.kv { display: grid; gap: 10px; margin-top: 12px; }
.kv div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.kv span { color: var(--muted); flex: 0 0 42%; }
.kv b { font-weight: 600; text-align: right; }
.email {
  white-space: pre-wrap;
  font-size: 13.5px;
  line-height: 1.55;
  background: #0c1622;
  border-radius: 16px;
  padding: 14px;
  overflow: auto;
  max-height: 62vh;
}
.pdf-frame {
  width: 100%;
  height: 68vh;
  border: 0;
  border-radius: 16px;
  background: #0c1622;
}
.empty {
  padding: 28px 8px;
  text-align: center;
  color: var(--muted);
}
.empty strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 8px;
}
#toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--dock) + 16px);
  background: #173328;
  color: var(--ok);
  padding: 12px 14px;
  border-radius: 14px;
  text-align: center;
  z-index: 9;
}
.back { margin-bottom: 4px; width: max-content; }
.sources { display: grid; gap: 8px; margin-top: 10px; }
.sources a, .sources p { margin: 0; color: var(--ink); text-decoration: none; font-size: 14px; }
.sources a { color: var(--gold); }
.fiche-grid { display: grid; gap: 12px; }
.block {
  background: rgba(8, 16, 26, 0.35);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
.block h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  font-family: var(--sans);
  font-weight: 650;
}
.block p { margin: 0 0 8px; }
.doc-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.decide { margin-top: 16px; }
textarea {
  width: 100%;
  margin-top: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #0c1622;
  color: var(--ink);
  padding: 10px 12px;
  resize: vertical;
}
.effects {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.5px;
}
.group-bar {
  position: sticky;
  bottom: calc(var(--dock) + 12px);
  background: rgba(10, 20, 32, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  z-index: 7;
}
.hist { padding: 12px 0; border-top: 1px solid var(--line); }
.hist:first-of-type { border-top: 0; }
.eyebrow.spaced { margin-top: 16px; }
.actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ico { width: 16px; height: 16px; fill: currentColor; flex: 0 0 16px; }
.sel-count { margin: 0 0 8px; color: var(--gold); font-size: 13px; font-weight: 650; }
.ctx {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #0c1622;
}
.ctx p { margin: 0 0 8px; color: var(--muted); font-size: 13.5px; }
.ctx-actions { display: flex; gap: 8px; margin-top: 10px; }
.ctx-actions button { flex: 1; }
.stack-row { margin-top: 12px; }
.stack-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.stack-row p { margin: 0; }
.cond-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.cond-list li {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
}
.deadline {
  margin: 12px 0 0;
  font-weight: 650;
  color: var(--ink);
}
.chip-line { color: var(--gold); font-size: 13px; font-weight: 650; }
.status-line { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.fiche-nav {
  position: sticky;
  top: 0;
  z-index: 6;
  background: linear-gradient(180deg, var(--bg) 78%, transparent);
  padding: 4px 0 12px;
  display: grid;
  gap: 8px;
}
.filter-bar { display: flex; gap: 8px; align-items: center; }
@media (min-width: 920px) {
  #app { max-width: 1100px; margin: 0 auto; }
  h1 { font-size: 42px; }
  .today-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: start;
  }
  .fiche-grid { grid-template-columns: 1fr 1fr; }
  .actions { grid-template-columns: repeat(4, 1fr); }
  .kpis { gap: 14px; }
  main { padding-bottom: 48px; }
}
.send-entry { margin-top: 12px; }
.send-entry button { width: 100%; }
.send-note { margin-top: 10px; }
.banner-test {
  border: 1px solid rgba(212, 179, 122, 0.45);
}
.banner-test strong { color: var(--gold); font-weight: 650; }
.banner-pro {
  border: 1px solid rgba(212, 179, 122, 0.7);
}
.banner-pro strong { color: var(--gold); font-weight: 650; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
