/* =========================================================================
   CLANDESTINS — styles.css
   Thème : registre clandestin / encre lumineuse bleue dans le noir.
   Fraunces = voix (titres, montants, wordmark) — IBM Plex Sans = corps
   IBM Plex Mono = chiffres, identifiants, tout ce qui ressemble à un registre.
   ========================================================================= */

/* -------------------------------------------------------------------------
   0. RESET & TOKENS
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
img { max-width: 100%; display: block; }

:root {
  /* --- surfaces --- */
  --ink-950: #05080f;
  --ink-900: #0a0f1c;
  --ink-850: #0d1424;
  --ink-800: #121b30;
  --ink-750: #17223c;
  --ink-700: #1c2947;
  --line: rgba(148, 178, 235, 0.14);
  --line-soft: rgba(148, 178, 235, 0.08);

  /* --- electric blue ink --- */
  --blue-300: #8fc7ff;
  --blue-400: #5eb0ff;
  --blue-500: #2f8bff;
  --blue-600: #1868e0;
  --cyan-400: #5df1ff;
  --glow-soft: rgba(47, 139, 255, 0.28);
  --glow-strong: rgba(94, 176, 255, 0.55);
  --glow-cyan: rgba(93, 241, 255, 0.35);

  /* --- signal colors --- */
  --positive: #46e0a4;
  --positive-glow: rgba(70, 224, 164, 0.35);
  --negative: #ff6b7d;
  --negative-glow: rgba(255, 107, 125, 0.35);
  --warn: #ffb648;
  --warn-glow: rgba(255, 182, 72, 0.32);

  /* --- text --- */
  --text-hi: #eef4ff;
  --text-mid: #b7c4e0;
  --text-low: #7d8bab;
  --text-faint: #5a6684;

  /* --- type --- */
  --font-display: "Fraunces", "IBM Plex Sans", serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  /* --- shape / motion --- */
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --speed: 0.22s;

  --nav-w: 240px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------------------------------------------------
   1. BASE
   ------------------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(47, 139, 255, 0.16), transparent 60%),
    radial-gradient(900px 700px at 100% 0%, rgba(93, 241, 255, 0.08), transparent 55%),
    var(--ink-950);
  color: var(--text-hi);
  min-height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }

::selection { background: var(--glow-soft); color: var(--text-hi); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--blue-600), var(--blue-400));
  border-radius: 10px;
  border: 2px solid var(--ink-950);
}

:focus-visible {
  outline: 2px solid var(--blue-400);
  outline-offset: 2px;
  border-radius: 6px;
}

.hidden { display: none !important; }

/* -------------------------------------------------------------------------
   2. APP SHELL / LAYOUT
   ------------------------------------------------------------------------- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: calc(78px + var(--safe-b));
}

.content {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 18px 40px;
  animation: viewIn 0.38s var(--ease);
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------------------
   3. LEDGER BAR (top status strip)
   ------------------------------------------------------------------------- */
.ledger-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  background: rgba(10, 15, 28, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(94, 176, 255, 0.06);
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 96px;
  padding: 12px 18px;
  border-radius: var(--radius-m);
  background: linear-gradient(160deg, var(--ink-800), var(--ink-850));
  border: 1px solid var(--line);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset, 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(148, 178, 235, 0.28); }

.stat-card-value {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--text-hi);
  line-height: 1;
}
.stat-card-value.is-accent {
  color: var(--cyan-400);
  text-shadow: 0 0 16px var(--glow-cyan);
}

.stat-card-label {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-low);
}

.ledger-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ledger-label {
  font-size: 11px;
  color: var(--text-low);
  letter-spacing: 0.02em;
}

.ledger-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-hi);
  overflow-wrap: anywhere;
}

.ledger-value-accent {
  color: var(--cyan-400);
  text-shadow: 0 0 16px var(--glow-cyan);
}

/* -------------------------------------------------------------------------
   4. BLOCK BANNER
   ------------------------------------------------------------------------- */
.block-banner {
  margin: 0;
  padding: 12px 20px;
  background: linear-gradient(90deg, rgba(255, 107, 125, 0.14), transparent);
  border-bottom: 1px solid rgba(255, 107, 125, 0.28);
  border-left: 3px solid var(--negative);
  color: #ffd6dc;
  font-size: 14px;
  animation: bannerDrop 0.35s var(--ease);
}
.block-banner strong { color: var(--negative); font-weight: 600; margin-right: 6px; }

@keyframes bannerDrop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------------------
   5. NAV — leaderboard-rail on desktop, dock on mobile
   ------------------------------------------------------------------------- */
.nav {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: rgba(9, 13, 24, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}

#main-nav-inner {
  justify-content: space-around;
  align-items: stretch;
}

.nav-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-low);
  transition: color var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 16px;
  border-radius: 50%;
  transition: transform var(--speed) var(--ease), background var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease), color var(--speed) var(--ease);
}

.nav-item:hover { color: var(--text-mid); }
.nav-item:hover .nav-icon { transform: translateY(-2px); }
.nav-item:active .nav-icon { transform: scale(0.88); }

.nav-item.is-active { color: var(--blue-300); }
.nav-item.is-active .nav-icon {
  background: radial-gradient(circle, rgba(47, 139, 255, 0.28), transparent 70%);
  color: var(--cyan-400);
  box-shadow: 0 0 18px var(--glow-strong);
  transform: translateY(-2px);
}

.nav-item.is-active::after {
  content: "";
  position: absolute;
  top: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan-400);
  box-shadow: 0 0 10px var(--glow-cyan);
  animation: dotPop 0.3s var(--ease);
}

@keyframes dotPop {
  from { opacity: 0; transform: scale(0.3); }
  to { opacity: 1; transform: scale(1); }
}

/* -------------------------------------------------------------------------
   6. ADMIN TABS (segmented control)
   ------------------------------------------------------------------------- */
.admin-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  width: fit-content;
}

.admin-tab {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--text-low);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--speed) var(--ease);
}

.admin-tab:hover { color: var(--text-mid); }

.admin-tab.is-active {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
  color: #fff;
  box-shadow: 0 4px 18px var(--glow-soft);
}

/* -------------------------------------------------------------------------
   7. VIEW HEADS
   ------------------------------------------------------------------------- */
.view-head { margin-bottom: 14px; }
.view-head h2 { font-size: 20px; color: var(--text-hi); }
.view-head-spaced { margin-top: 34px; }
.view-sub { font-size: 13px; color: var(--text-low); margin-top: 4px; }

/* -------------------------------------------------------------------------
   8. LEDGER LIST / ROWS
   ------------------------------------------------------------------------- */
.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ledger-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 14px 16px;
  background: var(--ink-850);
  border: 1px solid var(--line-soft);
  border-left: 3px solid transparent;
  border-radius: var(--radius-m);
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease),
    background var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.ledger-row:hover {
  transform: translateX(4px);
  border-left-color: var(--blue-500);
  background: var(--ink-800);
  box-shadow: -6px 0 18px -8px var(--glow-soft);
}

.ledger-row-main { display: flex; flex-direction: column; gap: 3px; flex: 1 1 200px; min-width: 200px; }
.ledger-row-title { font-size: 14.5px; font-weight: 500; color: var(--text-hi); overflow-wrap: anywhere; }
.ledger-row-desc { font-size: 13px; color: var(--text-mid); overflow-wrap: anywhere; }
.ledger-row-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); overflow-wrap: anywhere; }

.ledger-row-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 10px;
  flex: 0 1 auto;
  margin-left: auto;
}

.ledger-price {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-hi);
}
.ledger-price.is-positive { color: var(--positive); text-shadow: 0 0 12px var(--positive-glow); }
.ledger-price.is-negative { color: var(--negative); text-shadow: 0 0 12px var(--negative-glow); }

.empty-state {
  padding: 26px 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13.5px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-m);
  background: rgba(255, 255, 255, 0.015);
}

/* -------------------------------------------------------------------------
   9. PILLS (status)
   ------------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.pill-pending {
  color: var(--warn);
  background: rgba(255, 182, 72, 0.1);
  border-color: rgba(255, 182, 72, 0.28);
  box-shadow: 0 0 12px var(--warn-glow);
}
.pill-available {
  color: var(--positive);
  background: rgba(70, 224, 164, 0.1);
  border-color: rgba(70, 224, 164, 0.28);
  box-shadow: 0 0 12px var(--positive-glow);
}
.pill-taken {
  color: var(--blue-300);
  background: rgba(47, 139, 255, 0.12);
  border-color: rgba(47, 139, 255, 0.3);
  box-shadow: 0 0 12px var(--glow-soft);
}
.pill-blocked {
  color: var(--negative);
  background: rgba(255, 107, 125, 0.1);
  border-color: rgba(255, 107, 125, 0.28);
  box-shadow: 0 0 12px var(--negative-glow);
}

/* -------------------------------------------------------------------------
   10. BUTTONS
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
    background var(--speed) var(--ease), border-color var(--speed) var(--ease), opacity var(--speed) var(--ease);
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  color: #fff;
  box-shadow: 0 4px 20px var(--glow-soft);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 28px var(--glow-strong);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: rgba(94, 176, 255, 0.35);
  color: var(--blue-300);
}
.btn-outline:hover:not(:disabled) {
  background: rgba(47, 139, 255, 0.1);
  border-color: var(--blue-400);
  box-shadow: 0 0 16px var(--glow-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-hi);
}

.btn-danger {
  background: rgba(255, 107, 125, 0.12);
  border-color: rgba(255, 107, 125, 0.35);
  color: #ffb3bd;
}
.btn-danger:hover:not(:disabled) {
  background: rgba(255, 107, 125, 0.2);
  box-shadow: 0 0 16px var(--negative-glow);
}

.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* -------------------------------------------------------------------------
   11. FORMS
   ------------------------------------------------------------------------- */
.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--ink-850);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-m);
}
.stacked-form label { font-size: 12.5px; color: var(--text-low); margin-top: 6px; }
.stacked-form label:first-child { margin-top: 0; }
.stacked-form button { margin-top: 10px; align-self: flex-start; }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
.search-input {
  width: 100%;
  padding: 11px 13px;
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--text-hi);
  font-size: 14px;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }

input:focus, textarea:focus, .search-input:focus {
  outline: none;
  border-color: var(--blue-400);
  background: var(--ink-850);
  box-shadow: 0 0 0 3px var(--glow-soft);
}

textarea { resize: vertical; min-height: 72px; }

.search-input { margin-bottom: 14px; }

.input-with-btn { display: flex; gap: 8px; align-items: center; }
.input-with-btn input { flex: 1; }

/* -------------------------------------------------------------------------
   12. PRESET GRID (admin quick tasks)
   ------------------------------------------------------------------------- */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.preset-btn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  padding: 14px;
  background: var(--ink-850);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-m);
  cursor: pointer;
  text-align: left;
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease);
}
.preset-btn:hover {
  transform: translateY(-3px);
  border-color: var(--blue-500);
  box-shadow: 0 10px 28px -12px var(--glow-strong);
}
.preset-btn:active { transform: translateY(-1px) scale(0.98); }

.preset-btn-title { font-size: 14px; font-weight: 500; color: var(--text-hi); }
.preset-btn-price { font-family: var(--font-mono); font-size: 12.5px; color: var(--cyan-400); }

/* -------------------------------------------------------------------------
   13. WALLET
   ------------------------------------------------------------------------- */
.wallet-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 34px 20px;
  margin-bottom: 16px;
  border-radius: var(--radius-l);
  background:
    radial-gradient(circle at 50% 0%, rgba(47, 139, 255, 0.18), transparent 60%),
    var(--ink-850);
  border: 1px solid var(--line);
  text-align: center;
}

.wallet-hero-label { font-size: 12.5px; color: var(--text-low); }

.wallet-hero-value {
  font-family: var(--font-display);
  font-size: clamp(34px, 9vw, 52px);
  font-weight: 600;
  color: var(--text-hi);
  text-shadow: 0 0 28px var(--glow-strong);
  animation: valuePulse 3.6s ease-in-out infinite;
  overflow-wrap: anywhere;
  max-width: 100%;
}

@keyframes valuePulse {
  0%, 100% { text-shadow: 0 0 22px var(--glow-strong); }
  50% { text-shadow: 0 0 40px var(--glow-cyan); }
}

.wallet-hero-unit { font-size: 12px; color: var(--text-faint); }

.wallet-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 26px;
}
.wallet-actions .btn { flex: 1; }

/* -------------------------------------------------------------------------
   14. PROFILE
   ------------------------------------------------------------------------- */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 22px;
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}

.profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-600), var(--cyan-400));
  color: #041025;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  box-shadow: 0 0 20px var(--glow-strong);
}

.profile-name { font-size: 16px; font-weight: 600; color: var(--text-hi); }
.profile-id { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

/* -------------------------------------------------------------------------
   15. MODALS
   ------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(4, 7, 14, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: overlayIn 0.22s var(--ease);
}

@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-top: 2px solid var(--blue-500);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  box-shadow: 0 -20px 60px -20px var(--glow-soft);
  animation: modalUp 0.32s var(--ease);
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal h3 { font-size: 18px; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--text-low); margin-bottom: 4px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.member-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.member-detail-row span:first-child { color: var(--text-low); }
.member-detail-row span:last-child { font-family: var(--font-mono); color: var(--text-hi); }

.member-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.transfer-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
}

.transfer-result-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--ink-900);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-s);
  cursor: pointer;
  font-size: 13.5px;
  transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.transfer-result-item:hover {
  background: rgba(47, 139, 255, 0.1);
  border-color: var(--blue-500);
  transform: translateX(3px);
}

.transfer-selected {
  padding: 9px 12px;
  background: rgba(70, 224, 164, 0.1);
  border: 1px solid rgba(70, 224, 164, 0.3);
  border-radius: var(--radius-s);
  color: var(--positive);
  font-size: 13px;
  animation: dotPop 0.25s var(--ease);
}

/* -------------------------------------------------------------------------
   16. TOASTS
   ------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, 90vw);
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue-400);
  border-radius: var(--radius-s);
  font-size: 13.5px;
  color: var(--text-hi);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.3s var(--ease);
}
.toast.is-error {
  border-left-color: var(--negative);
  color: #ffd6dc;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* -------------------------------------------------------------------------
   16b. LOGO "CLANDESTINS" — police graffiti/encre, PC uniquement pour le nav
   ------------------------------------------------------------------------- */
.logo-clandestins {
  font-family: "Rubik Wet Paint", "Fraunces", serif;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-hi);
  text-shadow: 0 0 18px var(--glow-strong), 0 0 2px rgba(0,0,0,0.6);
  text-transform: uppercase;
  line-height: 1;
}

/* -------------------------------------------------------------------------
   16c. MESSAGERIE
   ------------------------------------------------------------------------- */
.nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--negative);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 8px var(--negative-glow);
}

.msg-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 4px 2px 14px;
  margin-bottom: 12px;
}

.msg-row { display: flex; }
.msg-row.is-user { justify-content: flex-end; }
.msg-row.is-admin { justify-content: flex-start; }

.msg-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: var(--radius-m);
  background: var(--ink-850);
  border: 1px solid var(--line-soft);
}
.msg-row.is-user .msg-bubble {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
  border-color: transparent;
}
.msg-text { font-size: 14px; color: var(--text-hi); overflow-wrap: anywhere; white-space: pre-wrap; }
.msg-row.is-user .msg-text { color: #fff; }
.msg-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); margin-top: 4px; }
.msg-row.is-user .msg-meta { color: rgba(255,255,255,0.7); }

.msg-form { display: flex; gap: 10px; align-items: flex-end; }
.msg-form textarea {
  flex: 1;
  resize: vertical;
  padding: 10px 12px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: var(--ink-900);
  color: var(--text-hi);
}

.code-pill {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 6px 12px;
  border-radius: var(--radius-s);
  background: rgba(93, 241, 255, 0.12);
  border: 1px solid rgba(93, 241, 255, 0.3);
  color: var(--cyan-400);
}

.login-step-hint {
  font-size: 12.5px;
  color: var(--text-mid);
  line-height: 1.5;
  margin: 0 0 4px;
}

/* -------------------------------------------------------------------------
   17. LOGIN SCREEN
   ------------------------------------------------------------------------- */
.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background: var(--ink-950);
}

.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  z-index: 0;
}
.login-screen::before {
  background: var(--blue-600);
  top: -180px;
  left: -160px;
  animation: blobFloat 14s ease-in-out infinite;
}
.login-screen::after {
  background: var(--cyan-400);
  bottom: -200px;
  right: -160px;
  animation: blobFloat 16s ease-in-out infinite reverse;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.1); }
}

.login-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: 1fr;
  border-radius: var(--radius-l);
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(10, 15, 28, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.7);
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  padding: 40px 34px;
  background: linear-gradient(160deg, rgba(47, 139, 255, 0.16), transparent 60%);
  border-bottom: 1px solid var(--line);
}

.login-brand-inner { display: flex; flex-direction: column; gap: 14px; }

.login-brand-glyph {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--blue-400);
  box-shadow: 0 0 22px var(--glow-strong), inset 0 0 12px var(--glow-cyan);
  position: relative;
}
.login-brand-glyph::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--cyan-400);
  box-shadow: 0 0 16px var(--glow-cyan);
}

.login-wordmark { font-size: 30px; color: var(--text-hi); }
.login-tagline { font-size: 14px; color: var(--text-mid); max-width: 34ch; line-height: 1.6; }
.login-brand-foot { font-size: 12px; color: var(--text-faint); max-width: 32ch; }

.login-panel { padding: 40px 34px; }
.login-panel-inner { display: flex; flex-direction: column; gap: 16px; }

.login-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}

.login-toggle-btn {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--text-low);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--speed) var(--ease);
}
.login-toggle-btn.is-active {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
  color: #fff;
  box-shadow: 0 4px 16px var(--glow-soft);
}

.login-error {
  padding: 10px 12px;
  font-size: 13px;
  color: #ffd6dc;
  background: rgba(255, 107, 125, 0.1);
  border: 1px solid rgba(255, 107, 125, 0.3);
  border-radius: var(--radius-s);
}

.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-form label { font-size: 12.5px; color: var(--text-low); }
.login-form button { margin-top: 8px; }

.login-panel-foot { font-size: 11.5px; color: var(--text-faint); text-align: center; margin-top: 4px; }

/* -------------------------------------------------------------------------
   18. RESPONSIVE — DESKTOP: sidebar leaderboard rail
   ------------------------------------------------------------------------- */
@media (min-width: 861px) {
  .app {
    padding-bottom: 0;
    padding-left: var(--nav-w);
  }

  .content { max-width: 860px; padding: 32px 40px 56px; }

  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    bottom: 0;
    width: var(--nav-w);
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    border-top: none;
    border-right: 1px solid var(--line);
    padding: 26px 14px;
  }

  #main-nav-inner {
    flex-direction: column;
    gap: 4px;
    justify-content: flex-start;
    width: 100%;
  }

  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-m);
    font-size: 14px;
    border-left: 3px solid transparent;
  }

  .nav-item:hover {
    background: rgba(47, 139, 255, 0.08);
    transform: translateX(6px);
  }
  .nav-item:hover .nav-icon { transform: none; }
  .nav-item:active { transform: translateX(3px) scale(0.98); }

  .nav-item.is-active {
    background: linear-gradient(90deg, rgba(47, 139, 255, 0.18), transparent);
    border-left-color: var(--cyan-400);
  }
  .nav-item.is-active .nav-icon { transform: none; }
  .nav-item.is-active::after {
    top: 50%;
    left: auto;
    right: 12px;
    transform: translateY(-50%);
  }

  .modal-overlay { align-items: center; }
  .modal {
    border-radius: var(--radius-l);
    border-top: 1px solid var(--line);
    border-left: 2px solid var(--blue-500);
    animation: modalPop 0.28s var(--ease);
  }
  @keyframes modalPop {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .login-frame { grid-template-columns: 1fr 1fr; }
  .login-brand { border-bottom: none; border-right: 1px solid var(--line); }
}

/* -------------------------------------------------------------------------
   19. SMALL PHONES
   ------------------------------------------------------------------------- */
@media (max-width: 380px) {
  .nav-item { font-size: 10px; }
  .wallet-hero-value { font-size: 42px; }
  .ledger-bar { gap: 14px; padding: 12px 14px; }
}

/* -------------------------------------------------------------------------
   20. ÉCRAN DE CHARGEMENT INITIAL (anti-flash)
   ------------------------------------------------------------------------- */
.app-loading {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-950);
}
.app-loading .loader-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--cyan-400);
  animation: loaderSpin 0.8s linear infinite;
}
@keyframes loaderSpin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------------------
   21. REFRESH — calm glass dashboard / mobile-first navigation
   ------------------------------------------------------------------------- */
:root {
  --ink-950: #070b14;
  --ink-900: #0d1422;
  --ink-850: #111a2b;
  --ink-800: #172338;
  --ink-750: #1d2d47;
  --line: rgba(164, 190, 228, 0.16);
  --line-soft: rgba(164, 190, 228, 0.1);
  --blue-300: #b8d8ff;
  --blue-400: #7eb9ff;
  --blue-500: #4f96f7;
  --blue-600: #3475d5;
  --cyan-400: #8bdcff;
  --glow-soft: rgba(79, 150, 247, 0.24);
  --glow-strong: rgba(126, 185, 255, 0.4);
  --glow-cyan: rgba(139, 220, 255, 0.24);
  --text-hi: #f4f8ff;
  --text-mid: #b5c3d9;
  --text-low: #8292aa;
  --text-faint: #5f6e86;
  --radius-s: 12px;
  --radius-m: 18px;
  --radius-l: 26px;
}

html { background: var(--ink-950); }
body {
  background: radial-gradient(900px 480px at 50% -12%, rgba(79,150,247,.16), transparent 70%), var(--ink-950);
}
.app { padding-bottom: calc(86px + var(--safe-b)); }
.content { padding: 24px 16px 42px; }
.ledger-bar {
  justify-content: flex-start;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding: 12px 16px;
  scrollbar-width: none;
  background: rgba(7, 11, 20, .78);
}
.ledger-bar::-webkit-scrollbar { display: none; }
.stat-card { min-width: 92px; padding: 10px 14px; }
.nav { background: rgba(13,20,34,.9); box-shadow: 0 -12px 30px rgba(0,0,0,.22); }
.nav-item { min-height: 64px; }
.nav-icon { width: 30px; height: 30px; }
.nav-item.is-active { font-weight: 600; }
.nav-item.is-active .nav-icon { background: rgba(79,150,247,.16); }
.ledger-row { padding: 15px; border-radius: var(--radius-m); }
.ledger-row:hover { transform: translateY(-2px); }
.btn { min-height: 44px; }
.modal { width: min(100% - 24px, 560px); max-height: min(86vh, 760px); overflow-y: auto; }
.login-screen { padding: 14px; overflow-y: auto; }
.login-frame { border-radius: var(--radius-l); }
.login-brand {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 20px;
  min-height: 0;
  gap: 10px;
}
.login-brand-inner { flex-direction: row; align-items: center; gap: 8px; }
.login-wordmark { font-size: 18px; }
.login-tagline { display: none; }
.login-panel { padding: 16px 20px; }
.login-panel-inner { gap: 10px; }
.login-panel-heading { margin-bottom: 12px; }
.login-panel-heading h2 { font-size: 22px; }
.login-panel-foot { display: none; }
.login-step-hint { font-size: 11.5px; line-height: 1.35; margin-bottom: 2px; }
.login-toggle-btn { min-height: 38px; }
.login-form { gap: 6px; }
.login-form input { min-height: 42px; }
.login-form button { margin-top: 4px; }

@media (min-width: 861px) {
  .app { padding-bottom: 0; }
  .content { max-width: 980px; padding: 40px 52px 64px; }
  .ledger-bar { padding: 14px 32px; }
  .nav { padding: 28px 16px; }
  .nav-item { min-height: 48px; }

  .login-brand { flex-direction: column; justify-content: space-between; padding: 40px 34px; min-height: initial; gap: 30px; }
  .login-brand-inner { flex-direction: column; align-items: stretch; gap: 14px; }
  .login-wordmark { font-size: 30px; }
  .login-tagline { display: block; }
  .login-panel { padding: 40px 34px; }
  .login-panel-inner { gap: 16px; }
  .login-panel-heading { margin-bottom: 26px; }
  .login-panel-heading h2 { font-size: clamp(25px, 3vw, 32px); }
  .login-panel-foot { display: block; }
  .login-step-hint { font-size: 12.5px; line-height: 1.5; margin-bottom: 4px; }
  .login-toggle-btn { min-height: 42px; }
  .login-form { gap: 8px; }
  .login-form input { min-height: 46px; }
  .login-form button { margin-top: 8px; }
}

@media (max-width: 520px) {
  .content { padding-inline: 12px; }
  .view-head h2 { font-size: 22px; }
  .ledger-row-main { min-width: 0; flex-basis: 100%; }
  .ledger-row-side { width: 100%; justify-content: space-between; margin-left: 0; }
  .btn { flex: 1; }
  .btn-block { width: 100%; }
  .admin-tabs { width: 100%; overflow-x: auto; }
  .admin-tab { flex: 1 0 auto; }
  .msg-form { flex-direction: column; align-items: stretch; }
  .msg-form .btn { width: 100%; }
}

@media (max-width: 380px) {
  .nav-item { padding-inline: 2px; }
  .nav-icon { width: 27px; height: 27px; }
  .content { padding-inline: 10px; }
}

/* -------------------------------------------------------------------------
   23. 2026 PRODUCT SYSTEM — clean, layered, official-grade UI
   ------------------------------------------------------------------------- */
:root {
  --ink-950: #080d18;
  --ink-900: #0d1422;
  --ink-850: #121b2c;
  --ink-800: #17243a;
  --line: rgba(185, 204, 234, .14);
  --line-soft: rgba(185, 204, 234, .08);
  --blue-400: #7db3ff;
  --blue-500: #4c8df5;
  --blue-600: #316fd3;
  --cyan-400: #8bdcff;
  --text-hi: #f6f9ff;
  --text-mid: #afbdd1;
  --text-low: #77869f;
  --text-faint: #56647c;
  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 20px;
}

* { box-sizing: border-box; }
body { background: #080d18; color: var(--text-hi); letter-spacing: -.008em; }
button, input, textarea, select { font: inherit; }
button { transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue-400); outline-offset: 2px; }

.login-screen { background: radial-gradient(700px 480px at 50% 0%, rgba(76,141,245,.17), transparent 70%), #080d18; }
.login-frame { border: 1px solid var(--line); border-radius: 20px; background: rgba(13,20,34,.84); box-shadow: 0 30px 80px rgba(0,0,0,.36), inset 0 1px rgba(255,255,255,.05); overflow: hidden; }
.login-brand { background: linear-gradient(145deg, rgba(23,36,58,.95), rgba(13,20,34,.92)); }
.login-panel { background: rgba(13,20,34,.96); }
.login-wordmark { letter-spacing: -.06em; }
.login-subtitle, .login-help, .form-label { color: var(--text-mid); }
.login-form input, .login-form select { border: 1px solid var(--line); border-radius: 10px; background: rgba(8,13,24,.72); color: var(--text-hi); }
.login-form input:hover { border-color: rgba(126,185,255,.35); }
.login-form input:focus { border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(76,141,245,.14); }

.app { background: #080d18; }
.topbar { min-height: 62px; border-bottom: 1px solid var(--line-soft); background: rgba(8,13,24,.86); backdrop-filter: blur(18px); }
.nav { border-right: 1px solid var(--line-soft); background: #0b1220; }
.nav-item { color: var(--text-low); border-radius: 10px; }
.nav-item:hover { color: var(--text-hi); background: rgba(125,179,255,.08); }
.nav-item.is-active { color: var(--text-hi); background: rgba(76,141,245,.14); box-shadow: inset 2px 0 var(--blue-400); }
.content { background: radial-gradient(650px 360px at 50% -10%, rgba(76,141,245,.09), transparent 70%); }
.view-head h2 { letter-spacing: -.045em; }
.view-head p, .muted, .stat-card-label { color: var(--text-low); }

.ledger-bar { border-bottom: 1px solid var(--line-soft); background: rgba(11,18,32,.82); backdrop-filter: blur(16px); }
.stat-card { border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(23,36,58,.58); box-shadow: inset 0 1px rgba(255,255,255,.04); }
.stat-card-value { color: var(--text-hi); font-variant-numeric: tabular-nums; }
.ledger-row { border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(18,27,44,.72); box-shadow: 0 12px 26px rgba(0,0,0,.12); }
.ledger-row:hover { border-color: rgba(125,179,255,.3); background: rgba(23,36,58,.8); }
.btn { border-radius: 9px; font-weight: 650; }
.btn-primary { background: var(--blue-500); color: #fff; box-shadow: 0 7px 18px rgba(76,141,245,.22); }
.btn-primary:hover { background: #5d9afb; transform: translateY(-1px); box-shadow: 0 9px 22px rgba(76,141,245,.32); }
.btn-secondary, .btn-ghost { border: 1px solid var(--line); background: rgba(23,36,58,.64); color: var(--text-mid); }
.btn-secondary:hover, .btn-ghost:hover { border-color: rgba(125,179,255,.38); color: var(--text-hi); background: rgba(125,179,255,.1); }

.msg-thread { border: 1px solid var(--line-soft); border-radius: 16px; background: rgba(13,20,34,.58); box-shadow: inset 0 1px rgba(255,255,255,.035); }
.msg-bubble { border: 1px solid var(--line-soft); border-radius: 14px; }
.msg-bubble.is-own { background: rgba(49,111,211,.82); border-color: rgba(125,179,255,.24); }
.msg-form { border-top: 1px solid var(--line-soft); }
.msg-form textarea { border: 1px solid var(--line); border-radius: 10px; background: rgba(8,13,24,.72); color: var(--text-hi); }

/* -------------------------------------------------------------------------
   24. STRUCTURE — signature Clandestins, moins template, plus produit
   ------------------------------------------------------------------------- */
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; transform: translateY(-150%); padding: 9px 13px; border-radius: 8px; background: var(--blue-500); color: #fff; font-size: 13px; font-weight: 600; }
.skip-link:focus { transform: translateY(0); }
.login-eyebrow { margin: 0; color: var(--blue-400); font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.login-brand-inner { position: relative; }
.login-highlights { display: grid; gap: 9px; margin-top: 28px; color: var(--text-mid); font-size: 13px; }
.login-highlights span { display: flex; align-items: center; gap: 9px; }
.login-highlights i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #65d29b; box-shadow: 0 0 0 4px rgba(101,210,155,.1); }
.login-brand-foot { display: flex; align-items: center; gap: 10px; }
.login-brand-foot span { color: var(--blue-400); font-family: var(--font-mono); font-size: 10px; }
.login-panel-heading h2 { margin: 8px 0 5px; color: var(--text-hi); letter-spacing: -.055em; }
.login-panel-heading p:last-child { margin: 0; color: var(--text-low); font-size: 13px; }
/* En-tête unique : logo + "Clandestins", identique en haut sur PC et mobile. */
.app-header { display: flex; align-items: center; justify-content: center; min-height: 58px; padding: 0 28px; border-bottom: 1px solid var(--line-soft); background: rgba(8,13,24,.88); }
.app-header-brand { display: flex; align-items: center; gap: 10px; }
.app-header-logo { width: 28px; height: 28px; flex: 0 0 28px; object-fit: cover; object-position: 50% 82%; border-radius: 9px; border: 1px solid rgba(184,216,255,.3); box-shadow: 0 0 16px rgba(126,185,255,.2); }
.app-header-name { color: var(--text-hi); font-size: 17px; }

@media (max-width: 860px) {
  .app-header { min-height: 54px; padding: 0 14px; }
}

/* Final responsive fixes */
.login-logo-art {
  display: none;
  width: 86px;
  height: 86px;
  object-fit: cover;
  object-position: 50% 82%;
  border: 1px solid rgba(184, 216, 255, .28);
  border-radius: 22px;
  box-shadow: 0 16px 34px rgba(0,0,0,.34), 0 0 24px rgba(126,185,255,.2);
}

@media (min-width: 861px) {
  .login-logo-art { display: block; }
}

@media (max-width: 860px) {
  .login-logo-art { display: none; }
  .content:has(.msg-thread) { padding-bottom: 16px; }
  .content:has(.msg-thread) .msg-form {
    position: relative;
    z-index: 5;
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 2px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(13,20,34,.96);
    box-shadow: 0 8px 22px rgba(0,0,0,.28);
  }
  .content:has(.msg-thread) .msg-form textarea {
    min-height: 44px;
    max-height: 74px;
    resize: none;
    padding: 10px 11px;
  }
  .content:has(.msg-thread) .msg-form .btn {
    display: inline-flex;
    align-self: stretch;
    min-width: 82px;
    height: auto;
    padding: 8px 12px;
  }
}

/* -------------------------------------------------------------------------
   22. SIGNATURE — interface compacte, éditoriale et verrouillée sur mobile
   ------------------------------------------------------------------------- */
.logo-clandestins,
.login-wordmark {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.045em;
  text-transform: none;
}

.ledger-bar {
  justify-content: center;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(7, 11, 20, .9);
}
.stat-card {
  min-width: 108px;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(23,35,56,.72), rgba(13,20,34,.7));
  box-shadow: inset 0 1px rgba(255,255,255,.045);
}
.stat-card-value { font-size: 18px; line-height: 1.15; }
.stat-card-label { margin-top: 3px; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.ledger-row {
  border: 1px solid var(--line-soft);
  border-left: 1px solid rgba(126,185,255,.28);
  background: linear-gradient(135deg, rgba(23,35,56,.72), rgba(13,20,34,.72));
  box-shadow: 0 14px 30px rgba(0,0,0,.12);
}
.ledger-row-side { gap: 12px; }
.ledger-price { color: var(--cyan-400); font-size: 15px; }
.btn-sm[data-take] { width: auto; min-width: 70px; padding: 7px 12px; }
.btn-primary { box-shadow: 0 8px 20px rgba(52,117,213,.18); }

.msg-thread {
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: rgba(13,20,34,.58);
  box-shadow: inset 0 1px rgba(255,255,255,.035);
}
.msg-bubble { max-width: min(78%, 520px); border-radius: 17px; }
.msg-text { font-size: clamp(13px, 3.5vw, 14px); line-height: 1.5; }
.msg-form textarea { min-height: 46px; max-height: 112px; font-size: 14px; }

@media (max-width: 860px) {
  html, body { overflow: hidden; height: 100%; }
  .app { height: 100dvh; min-height: 0; overflow: hidden; padding-bottom: calc(86px + var(--safe-b)); }
  .content { height: calc(100dvh - 155px - var(--safe-b)); min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .content:has(.msg-thread) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 10px;
  }
  .content:has(.msg-thread) .view-head { flex: 0 0 auto; }
  .content:has(.msg-thread) .msg-thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .content:has(.msg-thread) .msg-form { flex: 0 0 auto; padding-top: 10px; }
  .nav {
    position: fixed;
    z-index: 30;
    right: 10px;
    bottom: calc(10px + var(--safe-b));
    left: 10px;
    width: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(13,20,34,.94);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 34px rgba(0,0,0,.35);
  }
  .nav-item { min-height: 56px; border-radius: 13px; }
  .nav-item.is-active { background: rgba(79,150,247,.13); }
  .nav-item.is-active::after { display: none; }
}

@media (max-width: 520px) {
  .ledger-bar { gap: 7px; padding: 9px 10px; }
  .stat-card { min-width: 0; flex: 1; padding: 9px 5px; }
  .stat-card-value { font-size: 16px; }
  .stat-card-label { font-size: 8px; letter-spacing: .08em; }
  .content { padding: 17px 12px 18px; }
  .view-head { margin-bottom: 12px; }
  .view-head h2 { font-size: 23px; }
  .ledger-row { padding: 14px; }
  .ledger-row-side { margin-top: 10px; }
  .btn-sm[data-take] { min-width: 62px; padding: 6px 10px; }
  .msg-thread { border-radius: 16px; padding: 12px; }
  .msg-bubble { max-width: 88%; padding: 9px 11px; }
  .msg-form { gap: 7px; }
  .msg-form textarea { width: 100%; }
  .msg-form .btn { flex: 0 0 auto; width: auto; min-width: 72px; padding-inline: 12px; }
}
