/* ==========================================================================
   YouCodes Finance — Design System Prototype
   Style: "Liquid Glass" (iOS 26 inspired) — white surfaces, warm sand/beige
   pastel accent, translucent navigation layer, hairline borders, calm
   system typography.
   ========================================================================== */

:root {
  /* Base surface — warm near-white paper (4× paler than v1) */
  --bg: #fdfcfa;
  --bg-soft: #fefefe;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-sunken: #fdfcfa;
  --border-hairline: rgba(60, 50, 34, 0.08);
  --border-hairline-strong: rgba(60, 50, 34, 0.14);

  /* Text — warm ink */
  --text: #1f1b14;
  --text-soft: #5c5546;
  --text-muted: #8f8674;
  --text-faint: #b6ad9b;

  /* Accent — muted sand / taupe (the single brand accent) */
  --accent: #b08d57;
  --accent-strong: #977540;
  --accent-tint: #f3ece0;
  --accent-tint-strong: #e7dbc8;
  --accent-line: rgba(176, 141, 87, 0.42);

  /* Semantic statuses — muted, used in text / border only */
  --pos: #5f8b6a;            /* оплачено / получено */
  --pos-line: rgba(95, 139, 106, 0.42);
  --pos-tint: #eaf1ea;
  --neg: #b06a55;            /* долг / к оплате */
  --neg-line: rgba(176, 106, 85, 0.42);
  --neg-tint: #f5ebe6;
  --info: #6f8299;           /* нейтральный статус */
  --info-line: rgba(111, 130, 153, 0.40);
  --info-tint: #eceff3;

  /* Back-compat aliases (older markup) — mapped onto the calm palette */
  --mint: var(--pos);      --mint-tint: var(--pos-tint);      --mint-tint-strong: #d9e6db;
  --rose: var(--neg);      --rose-tint: var(--neg-tint);      --rose-tint-strong: #ecd7cf;
  --sky: var(--info);      --sky-tint: var(--info-tint);      --sky-tint-strong: #dbe2ec;
  --lavender: #8a7fa8;     --lavender-tint: #efecf3;          --lavender-tint-strong: #e0dae9;
  --peach: var(--accent);  --peach-tint: var(--accent-tint);  --peach-tint-strong: var(--accent-tint-strong);
  --amber: #a8862f;        --amber-tint: #f4ecd9;             --amber-tint-strong: #e9dcbe;

  /* Radii */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-full: 999px;

  /* Shadows — soft, warm-tinted */
  --shadow-xs: 0 1px 2px rgba(60, 50, 34, 0.05);
  --shadow-sm: 0 2px 12px -5px rgba(60, 50, 34, 0.12);
  --shadow-md: 0 14px 34px -14px rgba(60, 50, 34, 0.18);
  --shadow-lg: 0 26px 60px -22px rgba(45, 37, 24, 0.30);

  /* Liquid-glass rim: bright top edge + soft side/bottom highlights */
  --glass-rim:
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    inset 0 -1px 1px rgba(255, 255, 255, 0.45),
    inset 1px 0 1px rgba(255, 255, 255, 0.30),
    inset -1px 0 1px rgba(255, 255, 255, 0.30);
  --shadow-glass: var(--glass-rim), 0 12px 34px -16px rgba(45, 37, 24, 0.24);

  --blur-glass: saturate(175%) brightness(1.05) blur(20px);
  --blur-dock: saturate(180%) brightness(1.06) blur(26px);

  /* Reserve space above the fixed mobile dock (+ home indicator) */
  --mobile-dock-space: calc(5.75rem + env(safe-area-inset-bottom, 0px));

  color-scheme: light;
}

* { -webkit-tap-highlight-color: transparent; }

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter',
    'Segoe UI', Roboto, ui-sans-serif, system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.006em;
}

.tabular-nums { font-variant-numeric: tabular-nums; }
[x-cloak] { display: none !important; }

body {
  background-image:
    radial-gradient(circle at 8% -8%, rgba(176, 141, 87, 0.025), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(150, 130, 100, 0.018), transparent 38%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 30rem);
  background-attachment: fixed;
}

/* Bottom inset so fixed dock never covers scrollable content on phones/tablets */
@media (max-width: 1023px) {
  /* Override Tailwind pb-28 on <body> — scroll room comes from .mobile-dock-spacer */
  body:not([data-chrome="off"]) {
    padding-bottom: 0 !important;
    scroll-padding-bottom: calc(var(--mobile-dock-space) + 1rem);
  }
}

/* Physical spacer appended by chrome.js — guarantees scroll past the dock */
.mobile-dock-spacer {
  display: block;
  width: 100%;
  height: calc(var(--mobile-dock-space) + 0.75rem);
  flex-shrink: 0;
  pointer-events: none;
}

@media (min-width: 1024px) {
  .mobile-dock-spacer { display: none !important; }
}

/* ==========================================================================
   Glass primitives
   ========================================================================== */

/* Core liquid-glass material. Frost + refractive rim + diagonal sheen.
   Reserved for the navigation layer only (header, dock, menus, sheets). */
.glass, .glass-strong {
  position: relative;
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur-glass);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-glass);
  isolation: isolate;
}
.glass-strong { background: var(--surface-strong); }

/* Diagonal specular sheen — a soft light streak across the pane. */
.glass::after, .glass-strong::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.12) 22%,
    rgba(255, 255, 255, 0) 46%,
    rgba(255, 255, 255, 0) 70%,
    rgba(255, 255, 255, 0.14) 100%
  );
  pointer-events: none;
}

/* Real backdrop refraction (Chromium only) — gently bends content behind
   glass via an SVG displacement map. Gated so Safari/FF keep the plain blur. */
@supports (backdrop-filter: url(#lg-refraction)) {
  .lg-refract {
    -webkit-backdrop-filter: blur(14px) saturate(175%) brightness(1.05) url(#lg-refraction);
    backdrop-filter: blur(14px) saturate(175%) brightness(1.05) url(#lg-refraction);
  }
}

.card {
  background: var(--surface-solid);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}

.card-pad { padding: 22px; }
@media (min-width: 640px) { .card-pad { padding: 26px; } }

.card-row {
  background: var(--surface-solid);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
.card-row:hover { box-shadow: var(--shadow-sm); border-color: var(--border-hairline-strong); }
a.card-row:hover { transform: translateY(-1px); }

.surface-sunken { background: var(--surface-sunken); border-radius: var(--r-md); }

.divider { border-color: var(--border-hairline); }

/* ==========================================================================
   Typography helpers
   ========================================================================== */

.page-title {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
@media (min-width: 640px) { .page-title { font-size: 28px; } }
.section-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.label-caps {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--r-full);
  font-weight: 600;
  white-space: nowrap;
  transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease, color .15s ease, border-color .15s ease;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }
.btn-md { padding: 11px 20px; font-size: 13.5px; min-height: 44px; }
@media (min-width: 640px) { .btn-md { min-height: 0; padding: 10px 18px; } }

.btn-primary {
  background: linear-gradient(180deg, #a5824c, var(--accent-strong));
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(151, 117, 64, 0.6), 0 1px 0 rgba(255,255,255,.3) inset;
}
.btn-primary:hover { box-shadow: 0 14px 28px -12px rgba(151, 117, 64, 0.72); }

.btn-glass {
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: var(--blur-glass);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-hairline-strong);
  color: var(--text-soft);
  box-shadow: var(--shadow-xs), inset 0 1px 1px rgba(255,255,255,0.7);
}
.btn-glass:hover { color: var(--text); border-color: var(--accent-line); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 12px;
  font-size: 13px;
}
.btn-ghost:hover { background: rgba(15, 23, 42, 0.05); color: var(--text); }

.btn-danger {
  background: var(--rose-tint);
  color: var(--rose);
  border: 1px solid var(--rose-tint-strong);
}
.btn-danger:hover { background: var(--rose-tint-strong); }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
  border-radius: var(--r-full);
  background: var(--surface-solid);
  border: 1px solid var(--border-hairline);
  color: var(--text-soft);
  box-shadow: var(--shadow-xs);
  transition: all .15s ease;
}
.btn-icon:hover { color: var(--text); border-color: var(--border-hairline-strong); box-shadow: var(--shadow-sm); }
.btn-icon.sm { height: 34px; width: 34px; }

/* ==========================================================================
   Forms
   ========================================================================== */

.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}
.field-hint { margin-top: 6px; font-size: 12px; color: var(--text-muted); }

.input, select.input, textarea.input {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border-hairline-strong);
  background: var(--surface-sunken);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

@media (max-width: 1023px) {
  .input, select.input, textarea.input {
    font-size: max(16px, 1em);
  }
}
.input::placeholder { color: var(--text-faint); }
.input:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-tint), inset 0 1px 2px rgba(60,50,34,0.04);
}
textarea.input { resize: vertical; min-height: 90px; }

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-hairline-strong);
  background: var(--surface-solid);
  font-size: 13px;
  font-weight: 550;
  color: var(--text-soft);
  cursor: pointer;
  transition: all .15s ease;
}
.checkbox-pill.is-checked {
  background: var(--accent-tint);
  border-color: var(--accent-tint-strong);
  color: var(--accent-strong);
}

/* Segmented control — glassy navigation control */
.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: var(--blur-glass);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-hairline);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6);
  gap: 2px;
}
.segmented button {
  border-radius: var(--r-full);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all .18s ease;
  white-space: nowrap;
}
.segmented button.is-active {
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.9);
}
.segmented button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.segmented-compact {
  padding: 3px;
}
.segmented-compact button {
  padding: 6px 12px;
  font-size: 12px;
}

/* ==========================================================================
   Badges & chips
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-mint { background: var(--pos-tint); color: var(--pos); border-color: var(--pos-line); }
.badge-sky { background: var(--info-tint); color: var(--info); border-color: var(--info-line); }
.badge-lavender { background: var(--lavender-tint); color: #6a5f86; border-color: rgba(138,127,168,.35); }
.badge-peach { background: var(--accent-tint); color: var(--accent-strong); border-color: var(--accent-line); }
.badge-rose { background: var(--neg-tint); color: var(--neg); border-color: var(--neg-line); }
.badge-amber { background: var(--amber-tint); color: #8a6d26; border-color: rgba(168,134,47,.35); }
.badge-slate { background: var(--surface-sunken); color: var(--text-muted); border-color: var(--border-hairline); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-full);
  background: var(--surface-sunken);
  border: 1px solid var(--border-hairline);
  font-size: 12px;
  font-weight: 550;
  color: var(--text-soft);
}

.client-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: -2px 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.client-fav:hover { color: var(--peach); background: var(--peach-tint); }
.client-fav.is-on { color: var(--peach); }
.client-fav:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: linear-gradient(160deg, #f5efe4, #e9dcc7);
  color: var(--accent-strong);
  font-weight: 600;
  flex-shrink: 0;
}

/* ==========================================================================
   Progress bar
   ========================================================================== */

.progress-track {
  height: 7px;
  width: 100%;
  border-radius: var(--r-full);
  background: var(--surface-sunken);
  overflow: hidden;
}
.progress-fill { height: 100%; border-radius: var(--r-full); transition: width .3s ease; }
.progress-fill.mint { background: linear-gradient(90deg, #86ab90, var(--pos)); }
.progress-fill.rose { background: linear-gradient(90deg, #ca9686, var(--neg)); }
.progress-fill.sky { background: linear-gradient(90deg, #9aabbe, var(--info)); }
.progress-fill.accent { background: linear-gradient(90deg, #cbb185, var(--accent)); }

/* ==========================================================================
   Header (desktop)
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.68);
  -webkit-backdrop-filter: var(--blur-glass);
  backdrop-filter: var(--blur-glass);
  border-bottom: 1px solid var(--border-hairline);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 6px 24px -18px rgba(45, 37, 24, 0.5);
}

/* Horizontal wordmark — height drives width, never squash */
.app-logo {
  display: block;
  height: 34px;
  width: auto;
  max-width: none;
  object-fit: contain;
  flex-shrink: 0;
}
@media (min-width: 640px) { .app-logo { height: 38px; } }
@media (min-width: 1024px) { .app-logo { height: 40px; } }

.app-logo--login {
  height: 44px;
  margin-inline: auto;
}
@media (min-width: 640px) { .app-logo--login { height: 48px; } }

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-soft);
  transition: all .15s ease;
  position: relative;
}
.nav-pill:hover { background: rgba(60, 50, 34, 0.06); color: var(--text); }
.nav-pill.is-active {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  border: 1px solid var(--accent-line);
  box-shadow: var(--shadow-sm), inset 0 1px 1px rgba(255,255,255,0.8);
}
.nav-pill.is-active .nav-chevron { color: var(--accent-strong); }

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--rose);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

/* Currency switcher — glassy pill matching the nav language */
.currency-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: var(--blur-glass);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-hairline-strong);
  box-shadow: var(--shadow-xs), inset 0 1px 1px rgba(255,255,255,0.7);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.currency-pill:hover { border-color: var(--accent-line); }
.currency-pill.is-open { border-color: var(--accent-line); box-shadow: var(--shadow-sm), 0 0 0 3px var(--accent-tint); }
.currency-caret { display: inline-flex; color: var(--text-muted); transition: transform .18s ease; }
.currency-code { letter-spacing: .01em; }
.currency-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--accent-tint);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 600;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: var(--blur-glass);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-hairline-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-rim), var(--shadow-lg);
  padding: 8px;
  z-index: 60;
  overflow: hidden;
  isolation: isolate;
}
.dropdown-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(150deg, rgba(255,255,255,0.55), rgba(255,255,255,0) 44%);
  pointer-events: none;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text-soft);
  text-align: left;
  transition: background .15s ease, color .15s ease;
}
.dropdown-item:hover { background: var(--surface-sunken); color: var(--text); }
.dropdown-item.is-active { background: var(--accent-tint); color: var(--accent-strong); }
/* "+ New …" items are secondary, not accent — keep them quiet. */
.dropdown-item.accent { color: var(--text-soft); font-weight: 550; }
.dropdown-item.accent svg { color: var(--text-muted); }
.dropdown-divider { height: 1px; background: var(--border-hairline); margin: 6px 4px; }

/* ==========================================================================
   Mobile / tablet bottom dock
   ========================================================================== */

/* Full-width bottom bar (edge to edge, PWA-style) */
.app-dock-wrap {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 55;
  pointer-events: none;
}
.app-dock {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  padding: 6px 14px max(6px, env(safe-area-inset-bottom, 0px));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: var(--blur-dock);
  backdrop-filter: var(--blur-dock);
  border-top: 1px solid var(--border-hairline-strong);
  box-shadow: 0 -1px 0 rgba(255,255,255,0.7) inset, 0 -12px 34px -20px rgba(45, 37, 24, 0.4);
  isolation: isolate;
}
.app-dock::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0) 60%);
  pointer-events: none;
}
.dock-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px 4px;
  border-radius: var(--r-full);
  color: var(--text-muted);
  transition: all .18s ease;
}
.dock-item.is-active { color: var(--accent-strong); }
.dock-item.is-active .dock-item-icon-wrap { background: var(--accent-tint); }
.dock-item-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  width: 30px;
  border-radius: var(--r-full);
  transition: background .18s ease;
}
.dock-item-label { font-size: 10px; font-weight: 600; }
.dock-item .nav-badge { position: absolute; top: 2px; right: 14px; }

.dock-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  width: 52px;
  border-radius: var(--r-full);
  background: linear-gradient(180deg, #b99a68, var(--accent-strong));
  color: #fff;
  box-shadow: 0 10px 22px -8px rgba(151, 117, 64, 0.55), inset 0 1px 0 rgba(255,255,255,.35);
  flex-shrink: 0;
  margin: 0 18px;
  transition: transform .15s ease;
}
.dock-fab:active { transform: scale(.93); }

.dock-popover {
  min-width: 230px;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: var(--blur-glass);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-hairline-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-rim), var(--shadow-lg);
  padding: 8px;
}

/* Absolute above dock button — do NOT use position:fixed here: backdrop-filter
   on .app-dock creates a containing block and clips fixed popovers. */
.dock-popover-wrap {
  position: absolute;
  bottom: calc(100% + 14px);
  z-index: 70;
  pointer-events: auto;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
}
.dock-popover-wrap--start { left: 0; right: auto; }
.dock-popover-wrap--center { left: 50%; transform: translateX(-50%); }
.dock-popover-wrap--end { right: 0; left: auto; }

.app-dock { overflow: visible; }

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumbs {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 5px 6px 5px 8px;
  margin-bottom: 16px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: var(--blur-glass);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-hairline);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6);
  font-size: 12.5px;
  line-height: 1;
  color: var(--text-muted);
}
.breadcrumbs a,
.breadcrumbs .crumb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--r-full);
  font-weight: 500;
  color: var(--text-muted);
  transition: color .15s ease, background .15s ease;
}
.breadcrumbs a:hover { color: var(--text); background: rgba(60,50,34,0.05); }
.breadcrumbs .crumb-home,
.breadcrumbs .crumb-icon-only { padding: 4px 8px; color: var(--text-soft); }
.breadcrumbs .crumb-icon-only.current {
  background: var(--accent-tint);
  color: var(--accent-strong);
}
.breadcrumbs a svg,
.breadcrumbs .crumb svg,
.breadcrumbs .crumb-home svg,
.breadcrumbs .current svg { height: 14px; width: 14px; flex-shrink: 0; }
.breadcrumbs .sep {
  display: inline-flex;
  align-items: center;
  color: var(--text-faint);
}
.breadcrumbs .sep svg { height: 13px; width: 13px; }
.breadcrumbs .current {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--accent-tint);
  color: var(--accent-strong);
  font-weight: 600;
}

/* ==========================================================================
   Tabs (pill)
   ========================================================================== */

.tab-pills {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: var(--blur-glass);
  backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-hairline);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6);
  gap: 2px;
}
.tab-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-full);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all .18s ease;
}
.tab-pill.is-active { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.9); }

/* ==========================================================================
   KPI tiles
   ========================================================================== */

/* KPI tiles — white surface, colour lives only in the border + a small
   accent bar. No flat "traffic-light" fills. */
.kpi-tile {
  position: relative;
  border-radius: var(--r-lg);
  padding: 18px 18px 18px 20px;
  background: var(--surface-solid);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.kpi-tile::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: var(--r-full);
  background: var(--border-hairline-strong);
}
.kpi-tile.mint { border-color: var(--pos-line); }
.kpi-tile.mint::before { background: var(--pos); }
.kpi-tile.rose { border-color: var(--neg-line); }
.kpi-tile.rose::before { background: var(--neg); }
.kpi-tile.sky { border-color: var(--info-line); }
.kpi-tile.sky::before { background: var(--info); }
.kpi-tile.lavender { border-color: rgba(138,127,168,.4); }
.kpi-tile.lavender::before { background: #8a7fa8; }
.kpi-tile.peach { border-color: var(--accent-line); }
.kpi-tile.peach::before { background: var(--accent); }
.kpi-tile.plain::before { background: var(--border-hairline-strong); }
.kpi-value { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }

@media (max-width: 639px) {
  .kpi-tile {
    padding: 10px 12px 10px 15px;
    border-radius: var(--r-md);
  }
  .kpi-tile::before {
    top: 7px;
    bottom: 7px;
    width: 2.5px;
  }
  .kpi-tile .label-caps {
    font-size: 9.5px;
    letter-spacing: .09em;
    line-height: 1.2;
  }
  .kpi-tile .kpi-value {
    font-size: 17px;
    margin-top: 2px;
    line-height: 1.15;
  }
  /* Breakdown rows inside analytics KPI tiles */
  .kpi-tile > .mt-3 {
    margin-top: 6px;
  }
  .kpi-tile > .mt-3.space-y-1 {
    gap: 2px;
  }
  .kpi-tile > .mt-3 .text-\[12\.5px\],
  .kpi-tile > .mt-3 span {
    font-size: 11px;
    line-height: 1.25;
  }
}

/* ==========================================================================
   Table
   ========================================================================== */

.table-glass { width: 100%; font-size: 13.5px; border-collapse: separate; border-spacing: 0; }
.table-glass thead th {
  text-align: left;
  padding: 11px 18px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-hairline);
}
.table-glass tbody td { padding: 14px 18px; border-bottom: 1px solid var(--border-hairline); }
.table-glass tbody tr:last-child td { border-bottom: none; }
.table-glass tbody tr { transition: background .15s ease; }
.table-glass tbody tr:hover { background: rgba(176, 141, 87, 0.05); }

/* ==========================================================================
   Grid table (expandable rows) — used by Долги
   ========================================================================== */

.grid-table { width: 100%; font-size: 13.5px; }
.grid-thead,
.grid-row {
  display: grid;
  grid-template-columns: 34px 100px minmax(180px, 1.4fr) 120px 150px minmax(160px, 1.6fr);
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}
.grid-thead {
  height: 42px;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-hairline);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.grid-group { border-bottom: 1px solid var(--border-hairline); }
.grid-group:last-child { border-bottom: none; }
.grid-row {
  min-height: 60px;
  padding-top: 12px;
  padding-bottom: 12px;
  cursor: pointer;
  transition: background .15s ease;
}
.grid-row:hover { background: rgba(176, 141, 87, 0.05); }
.grid-group.is-open > .grid-row { background: rgba(176, 141, 87, 0.06); }
.grid-cell { min-width: 0; }
.note-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.caret-cell { display: flex; align-items: center; justify-content: center; }
.row-caret { display: inline-flex; color: var(--text-faint); transition: transform .2s ease; }
.grid-detail {
  background: var(--surface-sunken);
  border-top: 1px solid var(--border-hairline);
}

/* Mobile: collapse the grid into stacked labelled rows */
@media (max-width: 720px) {
  .grid-thead { display: none; }
  .grid-row {
    grid-template-columns: 28px 1fr auto;
    grid-template-areas:
      "caret who amount"
      "caret meta repay";
    row-gap: 4px;
    padding: 12px 14px;
  }
  .grid-row .caret-cell { grid-area: caret; align-self: start; margin-top: 4px; }
  .grid-row > .grid-cell:nth-child(2) { grid-area: meta; color: var(--text-muted); font-size: 12px; }
  .grid-row > .grid-cell:nth-child(3) { grid-area: who; }
  .grid-row > .grid-cell:nth-child(4) { grid-area: amount; text-align: right; }
  .grid-row > .grid-cell:nth-child(5) { grid-area: repay; text-align: right; }
  .grid-row > .note-cell { display: none; }
}

/* ==========================================================================
   Kanban
   ========================================================================== */

.kanban-scroller { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kanban-column {
  flex: 0 0 280px;
  width: 280px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 640px;
}
.kanban-cards { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 40px; }
.kanban-card {
  background: var(--surface-solid);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-md);
  padding: 12px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: all .15s ease;
}
.kanban-card:hover { border-color: var(--accent-tint-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.kanban-card.sortable-ghost { opacity: .35; }

/* Kanban card modal */
body.modal-open { overflow: hidden; }
.kanban-card-modal-backdrop {
  background: rgba(45, 37, 24, .32);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  overflow: hidden;
  overscroll-behavior: none;
}
.kanban-card-modal-panel {
  max-height: min(85vh, calc(100dvh - 2rem));
  min-height: 0;
}
.kanban-card-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(85vh, calc(100dvh - 2rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Kanban card — Markdown description (EasyMDE) */
.kanban-md-editor { min-height: 200px; }
.kanban-md-editor .EasyMDEContainer { margin-top: 0; }
.kanban-md-editor .EasyMDEContainer .CodeMirror-wrapper { border-radius: var(--r-md); overflow: hidden; }
.kanban-md-editor .editor-toolbar {
  border: 1px solid var(--border-hairline);
  border-bottom: none;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: var(--surface-sunken);
  opacity: 1;
  padding: 6px 8px;
}
.kanban-md-editor .editor-toolbar button {
  color: var(--text-muted) !important;
  border-color: transparent !important;
  width: 28px;
  height: 28px;
}
.kanban-md-editor .editor-toolbar button:hover,
.kanban-md-editor .editor-toolbar button.active {
  background: var(--surface-solid) !important;
  border-color: var(--border-hairline) !important;
  color: var(--text) !important;
}
.kanban-md-editor .editor-toolbar i.separator {
  border-left-color: var(--border-hairline);
  border-right-color: transparent;
  margin: 0 4px;
}
.kanban-md-editor .CodeMirror {
  border: 1px solid var(--border-hairline);
  border-radius: 0 0 var(--r-md) var(--r-md);
  background: var(--surface-solid);
  color: var(--text);
  min-height: 160px !important;
  font-size: 13.5px;
  line-height: 1.55;
}
.kanban-md-editor .CodeMirror-scroll { min-height: 160px !important; }
.kanban-md-editor .CodeMirror-cursor { border-left-color: var(--text); }
.kanban-md-editor .editor-preview,
.kanban-md-editor .editor-preview-side {
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-md);
  background: var(--surface-solid);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-soft);
}
.kanban-md-editor .editor-preview-side {
  border-left: none;
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.kanban-md-editor .editor-preview h2,
.kanban-md-editor .editor-preview-side h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0.75em 0 0.35em;
  color: var(--text);
}
.kanban-md-editor .editor-preview ul,
.kanban-md-editor .editor-preview-side ul {
  margin: 0.35em 0;
  padding-left: 1.25em;
}
.kanban-md-editor .editor-preview a,
.kanban-md-editor .editor-preview-side a {
  color: var(--accent-strong);
}
.kanban-md-editor .editor-statusbar { display: none; }
.kanban-md-editor .cm-s-easymde .cm-header-1,
.kanban-md-editor .cm-s-easymde .cm-header-2,
.kanban-md-editor .cm-s-easymde .cm-header-3 { color: var(--text); }

/* Kanban card modal — status row + meta fields */
.kanban-card-status-row {
  align-items: center;
}
.kanban-card-status-row .segmented-kanban-status {
  padding: 2px;
  height: 34px;
  box-sizing: border-box;
  align-items: center;
}
.kanban-card-status-row .segmented-kanban-status button {
  padding: 0 14px;
  height: 30px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 30px;
}
.kanban-card-status-row .kanban-card-delete-btn {
  height: 34px;
  padding: 0 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
}
.kanban-card-meta-grid .field-label {
  margin-bottom: 6px;
  font-size: 12.5px;
}
.kanban-card-meta-input {
  height: 38px;
  padding: 0 12px;
  font-size: 13.5px;
  line-height: 38px;
  box-sizing: border-box;
}
.kanban-card-meta-input[type="date"] {
  line-height: normal;
  padding-top: 0;
  padding-bottom: 0;
}
.select-left-arrow {
  position: relative;
}
.select-left-arrow::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  z-index: 1;
  width: 0;
  height: 0;
  margin-top: -2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted);
  pointer-events: none;
}
.select-left-arrow select {
  appearance: none;
  -webkit-appearance: none;
  padding-left: 28px;
  padding-right: 12px;
  background-image: none;
}
.kanban-card-meta-static {
  display: flex;
  align-items: center;
  cursor: pointer;
  background: var(--surface-sunken);
  border: 1px solid var(--border-hairline-strong);
  border-radius: var(--r-md);
  transition: border-color .15s ease, background .15s ease;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
}
.kanban-card-meta-static:hover {
  background: #fff;
  border-color: var(--accent-line);
}
.kanban-desc-preview {
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-soft);
  min-height: 56px;
}
.kanban-desc-preview.is-empty {
  display: flex;
  align-items: center;
}
.kanban-desc-preview :is(h2, h3) {
  font-weight: 600;
  color: var(--text);
  margin: 0.6em 0 0.35em;
}
.kanban-desc-preview h2 { font-size: 1.05rem; }
.kanban-desc-preview h3 { font-size: 0.98rem; }
.kanban-desc-preview :is(ul, ol) {
  margin: 0.35em 0;
  padding-left: 1.25em;
}
.kanban-desc-preview a { color: var(--accent-strong); }
.kanban-desc-preview p { margin: 0.35em 0; }
.kanban-desc-preview p:first-child { margin-top: 0; }
.kanban-desc-preview p:last-child { margin-bottom: 0; }
.label-dot { height: 6px; width: 22px; border-radius: var(--r-full); display: inline-block; }

/* ==========================================================================
   Chat
   ========================================================================== */

.chat-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  height: min(58vh, 520px);
  max-height: min(58vh, 520px);
}
.chat-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-hairline);
  flex-shrink: 0;
}
.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 14px;
  min-height: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, var(--surface-sunken) 100%);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-load-more {
  display: flex;
  justify-content: center;
  padding: 2px 0 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, var(--surface-sunken) 70%, rgba(238,241,246,0));
}
.chat-entry {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.chat-entry.is-grouped {
  margin-top: -1px;
}
.chat-entry.is-grouped .chat-msg-bubble {
  border-top-left-radius: 10px;
}
.chat-day-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: .02em;
}
.chat-day-sep::before,
.chat-day-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-hairline);
}
.chat-msg {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 2px;
  max-width: min(82%, 620px);
  align-items: end;
}
.chat-msg.is-me {
  margin-left: auto;
  grid-template-columns: minmax(0, 1fr);
}
.chat-msg > .avatar,
.chat-msg > .chat-msg-spacer {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  width: 28px;
  height: 28px;
  font-size: 10px;
}
.chat-msg-spacer {
  display: block;
  flex-shrink: 0;
}
.chat-msg-col {
  display: contents;
}
.chat-msg-meta {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-bottom: 3px;
  padding: 0 2px;
}
.chat-msg.is-me .chat-msg-meta {
  justify-content: flex-end;
}
.chat-msg-author {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text);
}
.chat-msg-meta time {
  font-size: 10.5px;
  color: var(--text-faint);
}
.chat-edited {
  font-size: 10.5px;
  color: var(--text-faint);
  font-style: italic;
}
.chat-msg-bubble {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  padding: 8px 12px;
  border-radius: 15px;
  background: var(--surface-solid);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-xs);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-soft);
  word-break: break-word;
}
.chat-msg.is-me .chat-msg-bubble {
  grid-column: 1;
}
.chat-msg:not(.is-me) .chat-msg-bubble {
  border-bottom-left-radius: 4px;
}
.chat-msg.is-me .chat-msg-bubble {
  background: linear-gradient(180deg, #faf6ef 0%, var(--accent-tint) 100%);
  border-color: var(--accent-line);
  color: var(--text);
  border-bottom-right-radius: 4px;
}
.chat-msg-bubble p { margin: 0; }
.chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.chat-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--border-hairline);
  font-size: 11.5px;
  font-weight: 550;
  color: var(--accent-strong);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.chat-attach-chip:hover {
  background: #fff;
  border-color: var(--accent-line);
}
.chat-msg-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-xs);
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, color .15s ease, background .15s ease, border-color .15s ease;
}
.chat-msg-bubble:hover .chat-msg-icon-btn,
.chat-msg-bubble:focus-within .chat-msg-icon-btn {
  opacity: 1;
  pointer-events: auto;
}
.chat-msg-icon-btn:hover {
  color: var(--text);
  background: #fff;
  border-color: var(--border-hairline-strong);
}
.chat-msg-icon-btn.is-danger { color: var(--rose); }
.chat-msg-icon-btn.is-danger:hover {
  color: #fff;
  background: var(--rose);
  border-color: var(--rose);
}
.chat-msg-reply {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
}
.chat-msg-tools--own {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: flex;
  gap: 4px;
}
.chat-msg-tools--own .chat-msg-icon-btn {
  position: static;
}
.chat-composer {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border-hairline);
  background: rgba(255,255,255,0.78);
  -webkit-backdrop-filter: var(--blur-glass);
  backdrop-filter: var(--blur-glass);
  flex-shrink: 0;
}
.chat-composer-box {
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  background: var(--surface-solid);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.chat-composer-box:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-tint), var(--shadow-xs);
}
.chat-composer-box textarea {
  display: block;
  width: 100%;
  border: none;
  box-shadow: none;
  background: transparent;
  resize: none;
  min-height: 38px;
  max-height: 112px;
  padding: 10px 14px 4px;
  font-size: 13px;
  line-height: 1.4;
}
.chat-composer-box textarea:focus { outline: none; }
.chat-composer-hint {
  padding: 0 14px 2px;
  font-size: 10.5px;
  color: var(--text-faint);
}
.chat-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 8px 10px;
}
.chat-composer-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}
.chat-composer-tools label {
  cursor: pointer;
}
.chat-composer-tools input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.chat-bubble {
  background: var(--surface-solid);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.chat-mention { color: var(--accent-strong); font-weight: 650; }
.chat-card-ref {
  color: var(--sky, #2f8fe0);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px dashed rgba(47, 143, 224, 0.45);
  transition: color .15s ease, border-color .15s ease;
}
a.chat-card-ref:hover {
  color: #1f6eb8;
  border-bottom-color: rgba(31, 110, 184, 0.65);
}
.chat-card-ref.is-closed {
  color: var(--text-faint);
  font-weight: 500;
  border-bottom: none;
  cursor: default;
}
.chat-ac-prefix {
  display: inline-block;
  min-width: 1.1em;
  font-weight: 650;
  color: var(--text-muted);
}

/* ==========================================================================
   Misc utilities
   ========================================================================== */

.empty-state {
  border: 1.5px dashed var(--border-hairline-strong);
  border-radius: var(--r-xl);
  padding: 48px 24px;
  text-align: center;
  background: rgba(255,255,255,0.4);
}

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r-lg);
  font-size: 13.5px;
  font-weight: 550;
  margin-bottom: 18px;
}
.flash-success { background: var(--pos-tint); color: var(--pos); border: 1px solid var(--pos-line); }
.flash-error { background: var(--neg-tint); color: var(--neg); border: 1px solid var(--neg-line); }

.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { scrollbar-width: none; }

.action-bar {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(238,241,246,0) 0%, var(--bg) 32%);
  padding-top: 24px;
}

/* Impersonation banner */
.imp-banner {
  background: linear-gradient(90deg, #f5a742, #e8862f);
  color: #fff;
}
