/*
 * AgentOS — дизайн-система Mini App.
 * Dark Minimalist / AI Aesthetic. Все цвета — только через токены ниже.
 */

:root {
  /* rgb-тройки нужны, чтобы прозрачности собирались из токена, а не из
     копий hex по всему файлу. */
  --bg-rgb: 10, 12, 10;
  --lime-rgb: 198, 240, 49;
  --bg-hex: #0A0C0A;

  --bg: #0A0C0A;
  --bg-elevated: #141814;
  --surface: #141814;
  --surface-hi: #222822;
  --border: rgba(226, 240, 204, 0.12);
  --border-hi: rgba(226, 240, 204, 0.22);

  --lime: #C6F031;
  --lime-hi: #D8FF5A;
  --lime-hover: #B4E020;
  --lime-dim: rgba(var(--lime-rgb), 0.22);
  --on-lime: #14200A;
  /* Текст бейджа «Лучшее КВ»: на тёмном фоне сам акцент и читается.
     Светлые темы переопределяют — там акцент на своей подложке бледнеет. */
  --kv-best-ink: var(--lime);

  --text: #E2F0CC;
  --text-body: #E2F0CC;
  --text-muted: rgba(226, 240, 204, 0.62);
  --tab-text: var(--text-muted);
  --tab-active-text: var(--lime);

  --danger: #ff6b6b;
  --warn: #ffc857;
  --amber-rgb: 232, 180, 74;
  --amber: #E8B44A;
  --amber-hi: #FFD56A;
  --hot-rgb: 224, 75, 58;
  --hot: #E04B3A;
  --hot-hi: #FF8A7A;
  --ice-rgb: 110, 168, 214;
  --ice: #6EA8D6;
  --ice-hi: #9CC8E8;
  --edit-bg: #1a2f14;
  --edit-text: #E2F0CC;
  --edit-border: #C6F031;
  --btn-rest: #111411;
  --btn-rest-ink: #E2F0CC;
  --btn-white: var(--btn-rest);
  --btn-ink: #111411;

  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --header-h: 60px;
  --tabbar-h: 72px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI", Roboto, system-ui, sans-serif;

  /* Telegram themeParams не должны перебивать палитру. */
  --tg-theme-bg-color: #32363A !important;
  --tg-theme-secondary-bg-color: #012F13 !important;
  --tg-theme-header-bg-color: #32363A !important;
  --tg-theme-bottom-bar-bg-color: var(--bg) !important;
  --tg-theme-section-bg-color: #012F13 !important;
  --tg-theme-text-color: #E2F0CC !important;
  --tg-theme-hint-color: #E2F0CC !important;
  --tg-theme-subtitle-text-color: #E2F0CC !important;
  --tg-theme-section-header-text-color: #E2F0CC !important;
  --tg-theme-link-color: #C6F031 !important;
  --tg-theme-button-color: #C6F031 !important;
  --tg-theme-button-text-color: #14200A !important;
  --tg-theme-accent-text-color: #C6F031 !important;

  --select-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23B8C4A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m4 6 4 4 4-4'/></svg>");
}

[data-theme="light"] {
  --bg-rgb: 213, 216, 222;
  --bg-hex: #D5D8DE;
  --bg: #D5D8DE;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hi: #F7F8E8;
  --border: rgba(20, 24, 28, 0.08);
  --border-hi: rgba(198, 240, 49, 0.45);
  --text: #142016;
  --text-body: #2A3128;
  --text-muted: #6B7168;
  --tab-text: var(--text-body);
  --tab-active-text: #111411;
  --lime-rgb: 198, 240, 49;
  --lime: #C6F031;
  --lime-hi: #D8FF5A;
  --lime-hover: #B4E020;
  --lime-dim: rgba(198, 240, 49, 0.2);
  --on-lime: #14200A;
  --edit-bg: #F4FBD8;
  --edit-text: #3A4A10;
  /* На белом лайм как текст не читается — берём спокойный тёмно-оливковый,
     который уже используется в светлой теме. */
  --kv-best-ink: var(--edit-text);

  --edit-border: #C6F031;
  --btn-rest: #ffffff;
  --btn-rest-ink: #111411;
  --btn-white: var(--btn-rest);
  --btn-ink: #111411;
  --select-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B7168' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m4 6 4 4 4-4'/></svg>");
}

/* Оранжевая тема — тёплый акцент вместо лайма, светлая база Notion-style. */
[data-theme="orange"] {
  --bg-rgb: 250, 246, 240;
  --bg-hex: #FAF6F0;
  --bg: #FAF6F0;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hi: #FFF4E8;
  --border: rgba(60, 40, 20, 0.1);
  --border-hi: rgba(232, 120, 48, 0.45);
  --text: #2A1C12;
  --text-body: #3D2E22;
  --text-muted: #8A7464;
  --tab-text: var(--text-body);
  --tab-active-text: #2A1C12;
  --lime-rgb: 232, 120, 48;
  --lime: #E87830;
  --lime-hi: #FF9A4A;
  --lime-hover: #D46820;
  --lime-dim: rgba(232, 120, 48, 0.18);
  --on-lime: #FFF8F0;
  --edit-bg: #FFF0E4;
  --edit-text: #5A3010;
  --edit-border: #E87830;
  /* Оранжевый на оранжевой подложке бледнеет — текст берём густой
     терракотовый, подложка и рамка остаются фирменными. */
  --kv-best-ink: var(--edit-text);
  --btn-rest: #ffffff;
  --btn-rest-ink: #2A1C12;
  --btn-white: var(--btn-rest);
  --btn-ink: #2A1C12;
  --select-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A7464' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m4 6 4 4 4-4'/></svg>");
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------------------------------------------------------- icons */

/* Контурные иконки в стиле Lucide: цвет берут от родителя, поэтому одна
   иконка работает и в лаймовой кнопке, и в приглушённой строке. */
.icon {
  flex: 0 0 auto;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Круглый маркер вместо медалей и квадратов: ТОП-3 — лайм, остальные серые. */
.marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.2);
}

.marker--top {
  background: var(--lime);
  box-shadow: 0 0 8px rgba(var(--lime-rgb), 0.45);
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  background: #0A0C0A !important;
  color: #E8EDE4 !important;
  color-scheme: dark;
}

html[data-theme="light"],
html[data-theme="light"] body {
  background: #FAFCF7 !important;
  color: #3A4A2A !important;
  color-scheme: light;
}

html[data-theme="orange"],
html[data-theme="orange"] body {
  background: #FAF6F0 !important;
  color: #2A1C12 !important;
  color-scheme: light;
}

body {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  accent-color: var(--lime);
  caret-color: var(--lime);
}

::selection {
  background: rgba(var(--lime-rgb), 0.35);
  color: inherit;
}

input,
textarea,
select {
  accent-color: var(--lime);
  caret-color: var(--lime);
}

/* Chrome UA `input:focus-visible { outline: auto }` сильнее `.form-input`,
   иначе остаётся системный голубой. Навигация без outline — иначе «Клиенты»
   оставляют салатовую рамку после клика по другому пункту. */
:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.tab,
.tab:focus,
.tab:focus-visible,
.tab-sub__item,
.tab-sub__item:focus,
.tab-sub__item:focus-visible,
.tab-group:focus-within,
.sidebar__nav button:focus,
.sidebar__nav button:focus-visible,
.tabbar button:focus,
.tabbar button:focus-visible {
  outline: none !important;
  box-shadow: none;
}

.btn:focus-visible {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 2px rgba(var(--lime-rgb), 0.28);
}

html[data-theme="orange"] .btn:focus-visible,
html[data-theme="orange"] .btn--ghost:focus-visible {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 2px rgba(var(--lime-rgb), 0.28);
}

input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible,
select:focus,
select:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 0;
}

.form-input:focus,
.form-input:focus-visible,
.search__input:focus,
.search__input:focus-visible,
.header__search-input:focus,
.header__search-input:focus-visible,
.chat-widget__input:focus,
.profile-fields__input:focus,
.profile-fields__area:focus,
.upload-params__date:focus,
.report__comment:focus,
.auth-form .form-input:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 2px rgba(var(--lime-rgb), 0.4);
}

.header__search-input:focus,
.header__search-input:focus-visible {
  border-color: transparent;
  box-shadow: none;
  caret-color: var(--lime);
}

/* Мягкое лаймовое свечение — как ореол щита на референсе. */
.aurora {
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(42% 80% at 50% -10%, rgba(var(--lime-rgb), 0.28), transparent 72%),
    radial-gradient(60% 100% at 12% 0%, rgba(var(--lime-rgb), 0.12), transparent 70%),
    radial-gradient(50% 90% at 92% 8%, rgba(119, 137, 171, 0.08), transparent 70%);
  transition: opacity 0.6s ease;
}

html[data-theme="light"] .aurora {
  background:
    radial-gradient(60% 100% at 20% 0%, rgba(var(--lime-rgb), 0.22), transparent 72%),
    radial-gradient(50% 90% at 92% 8%, rgba(139, 197, 61, 0.12), transparent 70%);
}

/* --------------------------------------------------------------- header */

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(var(--bg-rgb), 0.82);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}

.header__search {
  display: none;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 420px;
  max-width: 520px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.header__search-input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #F4F6F2;
  caret-color: #F4F6F2;
  font: inherit;
  font-size: 14px;
}

.header__search-input::placeholder { color: rgba(244, 246, 242, 0.72); }

html[data-theme="light"] .header__search-input {
  color: #142016;
  caret-color: #142016;
}

html[data-theme="light"] .header__search-input::placeholder { color: #5A6158; }

.header__profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.header__profile:hover {
  border-color: rgba(var(--lime-rgb), 0.45);
  box-shadow: 0 6px 18px rgba(var(--lime-rgb), 0.12);
}

.header__avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(var(--lime-rgb), 0.18);
  color: var(--lime);
  overflow: hidden;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header__who {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.2;
}

.header__who-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header__who-role {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar__brand {
  display: none;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: 12px;
}

.header__brand:hover .logo-wrap,
.sidebar__brand:hover .logo-wrap {
  box-shadow: 0 0 22px rgba(var(--lime-rgb), 0.75);
}

.logo-wrap {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  position: relative;
  border-radius: 12px;
  background: rgba(var(--lime-rgb), 0.72);
  border: 2px solid var(--lime);
  box-shadow: 0 0 18px rgba(var(--lime-rgb), 0.55);
  transition: box-shadow 0.45s ease, border-color 0.45s ease, background 0.45s ease;
}

html[data-theme="dark"] .logo-wrap::after {
  content: '';
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--lime-rgb), 0.38) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  animation: logoHalo 4s ease-in-out infinite;
}

@keyframes logoHalo {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

html[data-theme="light"] .logo-wrap {
  background: rgba(var(--lime-rgb), 0.78);
  border-color: var(--lime);
  box-shadow: 0 0 16px rgba(var(--lime-rgb), 0.5);
}

html[data-theme="dark"] .logo-wrap {
  background: rgba(var(--lime-rgb), 0.68);
  border-color: var(--lime-hi);
  box-shadow: 0 0 20px rgba(var(--lime-rgb), 0.55);
}

.logo-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.app-intro {
  --bg-rgb: 10, 12, 10;
  --text: #E2F0CC;
  --text-muted: rgba(226, 240, 204, 0.62);
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #05070A;
  color: var(--text);
  pointer-events: auto;
  user-select: none;
  animation: introShellIn 0.55s ease both;
}

.app-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 55% at 50% 48%,
    transparent 0%,
    rgba(var(--bg-rgb), 0.55) 100%
  );
  pointer-events: none;
}

body.app-intro-lock {
  overflow: hidden;
}

.app-intro__glow {
  position: absolute;
  left: 50%;
  top: 48%;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(4px);
}

.app-intro__glow--lime {
  width: min(72vw, 560px);
  height: min(72vw, 560px);
  margin: 0;
  background: radial-gradient(circle, rgba(var(--lime-rgb), 0.34) 0%, transparent 68%);
  animation: introGlowLime 16s ease-out both;
}

.app-intro__glow--ice {
  left: 44%;
  top: 54%;
  width: min(62vw, 500px);
  height: min(62vw, 500px);
  background: radial-gradient(circle, rgba(var(--ice-rgb), 0.4) 0%, transparent 72%);
  animation: introGlowIce 16s ease-out 0.2s both;
}

.app-intro__stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100vw;
  min-height: 180px;
  padding: 24px;
  overflow: hidden;
}

.app-intro__copy,
.app-intro__brand {
  grid-area: 1 / 1;
  text-align: center;
}

.app-intro__copy {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 1.35em;
  pointer-events: none;
}

.app-intro.is-logo .app-intro__copy {
  animation: introCopyOut 0.55s ease forwards;
}

.app-intro__line {
  grid-area: 1 / 1;
  margin: 0;
  max-width: min(96vw, 920px);
  white-space: nowrap;
  font-size: clamp(22px, 4.6vw, 52px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.2;
  color: var(--text);
  opacity: 1;
  transform: translateX(0);
  transition: transform 0.22s cubic-bezier(0.2, 0, 0.12, 1), opacity 0.18s linear;
}

.app-intro__line.is-left {
  transform: translateX(-54vw);
  opacity: 0;
}

.app-intro__caret {
  display: inline-block;
  width: 2px;
  height: 0.86em;
  margin-left: 4px;
  vertical-align: -0.08em;
  background: var(--lime);
  box-shadow: 0 0 8px rgba(var(--lime-rgb), 0.8);
  animation: introCaret 0.9s steps(1) infinite;
}

.app-intro__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-self: center;
  width: max-content;
  max-width: 92vw;
  gap: 0;
  opacity: 0;
  pointer-events: none;
}

.app-intro.is-logo .app-intro__brand {
  opacity: 1;
}

.app-intro__kicker {
  position: relative;
  margin: 0 0 -8px 10px;
  line-height: 1;
  font-size: clamp(14px, 1.8vw, 18px);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: none;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  font-style: italic;
  color: rgba(226, 240, 204, 0.5);
  opacity: 0;
  transform: rotate(-6deg);
  transform-origin: left bottom;
}

.app-intro.is-kicker .app-intro__kicker {
  opacity: 1;
  animation: authKickerLand 1.2s cubic-bezier(0.22, 0.82, 0.28, 1) both;
}

.app-intro__name {
  position: relative;
  margin: 0;
  min-height: 1em;
  font-size: clamp(48px, 10vw, 92px);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1;
  white-space: nowrap;
  color: var(--text);
}

.app-intro__agent {
  color: var(--text);
}

.app-intro__os {
  color: var(--lime);
}

.app-intro__name:not(.is-on) {
  opacity: 0;
}

.app-intro--out {
  animation: introShellOut 0.55s ease forwards;
}

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

@keyframes introShellOut {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

@keyframes introBlurIn {
  from { opacity: 0; transform: translateY(18px); filter: blur(18px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes introCopyOut {
  to { opacity: 0; transform: translateY(-14px); filter: blur(14px); visibility: hidden; }
}

@keyframes introBrandIn {
  from { opacity: 0; transform: translateY(22px) scale(0.94); filter: blur(16px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes introGlowLime {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.72); }
  16% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0.72; transform: translate(-46%, -56%) scale(1.14); }
}

@keyframes introGlowIce {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.64); }
  20% { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0.45; transform: translate(-58%, -44%) scale(1.2); }
}

@keyframes introHalo {
  from { opacity: 0; transform: scale(0.72); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes introRise {
  from { opacity: 0; transform: translateY(14px) scale(0.96); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes introCaret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .app-intro__caret {
    animation: none;
  }

  .auth-screen--enter .auth-card {
    animation: none;
  }
}

.fullscreen-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: rgba(var(--bg-rgb), 0.92);
  backdrop-filter: blur(8px);
  text-align: center;
}

.fullscreen-loader p {
  margin: 0;
  max-width: 280px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}

.checkout-pdf-wrap {
  margin: 8px 0 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(var(--lime-rgb), 0.2);
  background: var(--surface);
}

.checkout-pdf {
  width: 100%;
  display: block;
  min-height: 420px;
  border: 0;
  background: var(--surface);
}

@keyframes logoPulseGlow {
  0%, 100% {
    filter: drop-shadow(0 0 6px rgba(var(--lime-rgb), 0.45));
    transform: scale(0.92);
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(var(--lime-rgb), 1));
    transform: scale(1.12);
  }
}

.animate-logo-pulse {
  animation: logoPulseGlow 4s infinite ease-in-out;
  transform-origin: center center;
}

.header__titles {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.header__name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
}

.header__sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: none;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  font-style: italic;
  line-height: 1.15;
}

.header__status {
  display: none;
}

.header__status #system-status-text:empty {
  display: none;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--text-muted);
}

.dot--ok { background: var(--lime); box-shadow: 0 0 8px rgba(var(--lime-rgb), 0.7); }
.dot--busy { background: var(--warn); animation: blink 1.1s steps(2) infinite; }
.dot--err { background: var(--danger); }
.dot--idle { background: var(--text-muted); }

@keyframes blink {
  50% { opacity: 0.25; }
}

/* ----------------------------------------------------------------- view */

.view {
  position: relative;
  z-index: 1;
  padding: 16px 16px calc(var(--tabbar-h) + 24px);
  max-width: 560px;
  margin: 0 auto;
  animation: rise 0.42s ease-out;
  /* Колонка на всю высоту: главная кнопка прижимается к низу через
     margin-top:auto и не накрывает короткий контент. */
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h) - var(--tabbar-h));
}

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

.screen-title {
  margin: 4px 0 14px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text);
}

.screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 8px;
}

.screen-head .screen-title {
  margin: 0;
}

.kv-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.kv-refresh:disabled {
  opacity: 0.6;
  cursor: wait;
}

.kv-refresh .icon {
  flex: 0 0 auto;
}

.screen-sub {
  margin: -8px 0 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.section-label {
  margin: 22px 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s ease,
    background 0.35s ease;
}

html[data-theme="dark"] .card {
  background:
    linear-gradient(color-mix(in srgb, var(--surface) 88%, transparent),
      color-mix(in srgb, var(--surface) 88%, transparent)) padding-box,
    linear-gradient(145deg,
      rgba(var(--lime-rgb), 0.42),
      rgba(226, 240, 204, 0.08) 42%,
      rgba(var(--lime-rgb), 0.16)) border-box;
  border: 1px solid transparent;
  box-shadow:
    0 0 0 1px rgba(var(--lime-rgb), 0.06),
    0 10px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html[data-theme="dark"] .card--tap:hover,
html[data-theme="dark"] .card--tap:focus-visible {
  box-shadow:
    0 0 28px rgba(var(--lime-rgb), 0.22),
    0 16px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.card + .card {
  margin-top: 10px;
}

/* В горизонтальной сетке соседние .card не должны получать margin-top —
   иначе 2-я/3-я карточки уезжают вниз относительно первой. */
.subs__row > .card + .card,
.integ-row > .card + .card,
.integ-list > .card + .card,
.bento__kpis > .card + .card,
.bento__kpis--compact > .card + .card {
  margin-top: 0;
}

.card--tap {
  cursor: pointer;
  transition: border-color 0.35s ease, transform 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}

.card--tap:active {
  transform: scale(0.985);
  border-color: var(--border-hi);
  background: var(--surface-hi);
}

.card--accent {
  border-color: rgba(var(--lime-rgb), 0.32);
  background: linear-gradient(160deg, rgba(var(--lime-rgb), 0.07), var(--surface) 55%);
}

.card.checkout-card,
.checkout-review .card {
  background: #ffffff;
  background-image: none;
  border: 1px solid rgba(20, 24, 28, 0.08);
  box-shadow: none;
}

html[data-theme="dark"] .card.checkout-card,
html[data-theme="dark"] .checkout-review .card {
  background: var(--surface);
  border-color: var(--border);
}

.checkout-review {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-review > .card + .card,
.review-split > .card + .card,
.drivers-grid > .card + .card {
  margin-top: 0;
}

.review-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.review-card__body {
  margin-top: 8px;
  min-width: 0;
}

.review-card,
.review-split > .review-card {
  min-width: 0;
}

.person-fields,
.review-card__body .form-stack,
.checkout-review .form-stack,
.drivers-section {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  gap: 10px;
}

.person-fields .form-input,
.review-card__body .form-input {
  width: 100%;
}

.drivers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.drivers-grid .driver-card {
  min-width: 0;
  padding: 14px 16px;
}

@media (min-width: 900px) {
  .review-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }

  .drivers-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  }
}

.checkout-review__hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.checkout-pay {
  margin-bottom: 12px;
}

.checkout-pay__text {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.checkout-pay__open {
  margin-top: 12px;
}

.checkout-pay__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.checkout-pay__actions .btn {
  width: 100%;
}

.checkout-pay__url {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.card__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* Флекс, чтобы иконка стояла в строке с подписью: у .icon display:block. */
.card__title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.1px;
}

.card__meta {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--text-body);
}

.card__muted {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-body);
}

.badge--lime {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
  font-variant-numeric: tabular-nums;
}

.badge--ghost-lime {
  background: var(--lime-dim);
  border-color: rgba(var(--lime-rgb), 0.3);
  color: var(--on-lime);
}

.badge--product {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border-hi);
}

.badge--ebso {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
}

/* «Лучшее КВ» — самая высокая комиссия по этой СК среди агрегаторов.
   Акцент один на все темы: тёмная берёт лайм, оранжевая — свой оранжевый
   (токен --lime там переопределён), светлая — тёмно-оливковый текст на
   светлой подложке, чтобы лайм не давил в покое. */
.badge--best-kv {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--lime-dim);
  border-color: rgba(var(--lime-rgb), 0.38);
  color: var(--kv-best-ink);
}

.badge--best-kv .icon { opacity: 0.85; }

.badge--muted { color: var(--text-muted); }
.badge--warn { color: var(--warn); border-color: rgba(255, 200, 87, 0.3); }
.badge--danger { color: var(--danger); border-color: rgba(255, 107, 107, 0.3); }

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------- search */

.search {
  position: relative;
  margin-bottom: 12px;
}

.search__input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 38px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.search__input::placeholder { color: var(--text-muted); }

.search__input:focus {
  border-color: rgba(var(--lime-rgb), 0.4);
}

.search__icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ------------------------------------------------------------- dropzone */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 26px 18px;
  min-height: 128px;
  border-radius: var(--radius-lg);
  border: 1.5px dashed rgba(var(--lime-rgb), 0.5);
  background:
    linear-gradient(180deg, rgba(var(--lime-rgb), 0.12), rgba(var(--lime-rgb), 0.04));
  color: var(--text);
  cursor: pointer;
  text-align: center;
  user-select: none;
  transition: border-color 0.35s ease, background 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone--over {
  border-color: var(--lime);
  background: rgba(var(--lime-rgb), 0.18);
  box-shadow: 0 0 24px rgba(var(--lime-rgb), 0.18), 0 12px 28px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
  outline: none;
}

.dropzone--busy {
  pointer-events: none;
  cursor: default;
}

.dropzone__icon {
  color: var(--lime);
}

.dropzone__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.dropzone__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.dropzone__error {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--danger);
}

.dropzone__input {
  display: none;
}

.calc-entry {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

@media (min-width: 720px) {
  .calc-entry {
    grid-template-columns: 1fr 1fr;
  }
}

.calc-entry__btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 20px 18px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.35s ease, background 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
  animation: riseIn 0.55s ease both;
}

html[data-theme="dark"] .calc-entry__btn {
  background:
    linear-gradient(color-mix(in srgb, var(--surface) 90%, transparent),
      color-mix(in srgb, var(--surface) 90%, transparent)) padding-box,
    linear-gradient(145deg,
      rgba(var(--lime-rgb), 0.38),
      rgba(226, 240, 204, 0.08) 50%,
      rgba(var(--lime-rgb), 0.14)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.calc-entry__btn--accent {
  background: linear-gradient(160deg, rgba(var(--lime-rgb), 0.12), var(--surface) 58%);
}

html[data-theme="dark"] .calc-entry__btn--accent {
  background:
    linear-gradient(160deg, rgba(var(--lime-rgb), 0.18),
      color-mix(in srgb, var(--surface) 88%, transparent) 62%) padding-box,
    linear-gradient(145deg,
      rgba(var(--lime-rgb), 0.55),
      rgba(226, 240, 204, 0.1) 48%,
      rgba(var(--lime-rgb), 0.2)) border-box;
}

.calc-entry__btn:nth-child(2) {
  animation-delay: 0.08s;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.calc-entry__btn .icon {
  color: var(--lime);
}

.calc-entry__btn:hover,
.calc-entry__btn:focus-visible {
  border-color: var(--lime);
  background: rgba(var(--lime-rgb), 0.12);
  transform: translateY(-2px);
  outline: none;
  box-shadow: 0 0 28px rgba(var(--lime-rgb), 0.2), 0 14px 32px rgba(0, 0, 0, 0.28);
}

.calc-entry__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.calc-entry__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.calc-entry__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}

.calc-entry__back:hover,
.calc-entry__back:focus-visible {
  color: var(--text);
  outline: none;
}

.file-preview {
  margin: 0 0 14px;
}

.file-preview__count {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}

.file-preview__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.file-preview .file-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  max-width: none;
  overflow: hidden;
  white-space: normal;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(20, 24, 28, 0.1);
  color: #142016;
  box-shadow: 0 8px 18px rgba(20, 24, 28, 0.06);
}

.file-chip__thumb {
  display: block;
  width: 100%;
  height: 76px;
  object-fit: cover;
  background: #EEF1EA;
}

.file-chip__icon {
  display: grid;
  place-items: center;
  height: 76px;
  background: #F3F5F0;
  color: #1C2118;
}

.file-chip__name {
  padding: 7px 8px 8px;
  font-size: 11px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1C2118;
}

.file-chip__status {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 20, 17, 0.72);
  color: #fff;
  pointer-events: none;
}

.file-chip__status .btn__spinner {
  width: 12px;
  height: 12px;
  border-width: 2px;
  border-color: #fff;
  border-top-color: transparent;
}

.file-chip__status--ok {
  background: var(--lime);
  color: #142016;
}

.file-chip__status--ok .icon {
  color: #142016;
  stroke: #142016;
}

.file-chip__status--err {
  background: var(--hot);
  color: #fff;
}

.file-chip__x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 20, 17, 0.72);
  color: #fff;
  cursor: pointer;
}

.file-chip__x .icon {
  color: #fff;
  stroke: #fff;
}

.upload-params {
  margin: 0 0 18px;
}

.upload-params__card {
  display: grid;
  gap: 4px;
  padding: 16px;
}

.upload-params__card .field-label:first-child {
  margin-top: 0;
}

.upload-params__card .toggle {
  width: 100%;
}

.upload-params__card .toggle__opt {
  flex: 1;
  text-align: center;
}

.upload-params__date {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  color-scheme: inherit;
}

.upload-params__date:focus {
  border-color: rgba(var(--lime-rgb), 0.7);
  background: var(--surface);
}

.upload-params__date::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
  filter: none;
}

html[data-theme="dark"] .upload-params__date::-webkit-calendar-picker-indicator {
  filter: invert(1) sepia(1) saturate(6) hue-rotate(40deg);
}

.upload-params__card .btn {
  margin-top: 12px;
}

.params-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

@media (min-width: 720px) {
  .params-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
  }
}

.params-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.params-col .field-label:first-child {
  margin-top: 0;
}

.params-card {
  margin-bottom: 16px;
  padding: 16px;
}

.form-input--readonly,
.upload-params__date--readonly {
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg) 70%, var(--surface));
  pointer-events: none;
  cursor: default;
}

.upload-params__date--readonly {
  background: color-mix(in srgb, var(--bg) 70%, var(--surface));
}

.calc-status-host {
  width: 100%;
}

.calc-status-bar {
  margin: 4px 0 0;
  padding: 0 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}

.calc-status-host .notice {
  margin-top: 8px;
}

.scan-notice {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(var(--lime-rgb), 0.45);
  background: rgba(var(--lime-rgb), 0.14);
  animation: scanNoticeIn 0.45s ease;
}

.scan-notice__text {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  color: var(--text);
}

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

.field-label--caps {
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 800;
}

.toggle--cats {
  display: flex;
  gap: 8px;
}

.toggle__opt--cat {
  flex: 1;
  min-height: 44px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.scan-preview {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.scan-preview__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.scan-preview__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.scan-preview__cell {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.scan-preview__cell--empty {
  border-color: var(--hot);
  background: rgba(var(--hot-rgb), 0.12);
  box-shadow: 0 0 0 1px var(--hot);
}

.scan-preview__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.scan-preview__value {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- chips */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

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

.chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip--active {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
  font-weight: 600;
}

.chip__count {
  opacity: 0.55;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------- timeline */

.timeline-section {
  margin-bottom: 4px;
}

.timeline-sticky {
  position: sticky;
  top: var(--header-h);
  z-index: 5;
  margin: 0 -16px 10px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(var(--bg-rgb), 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.client-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.view-toggle {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
}

.view-toggle__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.view-toggle__btn--active {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
}

.client-list--table {
  overflow-x: auto;
}

.client-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 720px;
}

.client-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 72px minmax(88px, auto) minmax(72px, auto);
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}

.client-row--head {
  cursor: default;
  background: transparent;
  border-color: transparent;
  padding-bottom: 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.client-row__name,
.client-row__brand,
.client-row__model,
.client-row__year {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-row__name { font-weight: 650; }
.client-row__brand,
.client-row__model,
.client-row__year {
  color: var(--text-muted);
  font-size: 13px;
}

.client-row__year {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.client-row__status { min-width: 0; }
.client-row__price { font-weight: 650; text-align: right; }
.client-row__price--empty { color: var(--text-muted); font-weight: 500; }

.cal-board { display: grid; gap: 10px; }
.cal-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cal-nav__group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cal-nav__btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  padding: 0;
}
.cal-nav__btn:hover {
  border-color: rgba(var(--lime-rgb), 0.55);
}
.cal-board__title,
.cal-board__year {
  margin: 0;
  min-width: 7.5em;
  text-align: center;
  font-size: 16px;
  font-weight: 650;
}
.cal-board__year { min-width: 3.2em; }
.cal-week, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.cal-week__d { font-size: 11px; color: var(--text-muted); text-align: center; }
.cal-cell {
  min-height: 72px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 6px;
}
.cal-cell--pad { background: transparent; border-color: transparent; }
.cal-cell--hit { border-color: rgba(var(--lime-rgb), 0.45); }
.cal-cell__day { font-size: 12px; font-weight: 650; }
.cal-cell__n { margin-left: 4px; font-size: 11px; color: var(--text-muted); }
.cal-cell__list { display: grid; gap: 3px; margin-top: 6px; }
.cal-cell__item {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  text-align: left;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card--journal {
  padding: 14px 16px;
}

.card--journal .card__title {
  font-size: 16px;
  margin: 0 0 4px;
}

.card--journal .card__car {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.card--journal .card__plate {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0;
  letter-spacing: 0.03em;
}

.card--journal .card__footer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.card-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.card-docs__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-body);
  border-radius: 99px;
  padding: 5px 9px;
  font: inherit;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
}

.card-docs__item:hover {
  border-color: rgba(var(--lime-rgb), 0.45);
  color: var(--text);
}

.load-more-sentinel {
  height: 1px;
  margin: 8px 0;
}

.checkout-warn-card {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(var(--lime-rgb), 0.15);
  background: var(--surface);
}

.checkout-warn-card__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.checkout-warn-card__sub {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

.checkout-warn-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.checkout-warn-card__actions .btn {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
}

.sticky-action .btn,
.sticky-action .btn--primary,
.sticky-action .btn--ghost,
.sticky-action .btn--edit,
.offer-checkout .btn--edit,
.checkout-pay .btn,
.checkout-pay .btn--primary,
.checkout-pay .btn--ghost {
  background: var(--btn-rest);
  border-color: var(--border-hi);
  color: var(--btn-rest-ink);
  box-shadow: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.sticky-action .btn span,
.sticky-action .btn--primary span,
.sticky-action .btn--ghost span,
.sticky-action .btn--edit span,
.offer-checkout .btn--edit span,
.checkout-pay .btn span,
.checkout-pay .btn--primary span,
.checkout-pay .btn--ghost span {
  color: var(--btn-rest-ink);
}

.sticky-action .btn .icon,
.sticky-action .btn--primary .icon,
.sticky-action .btn--ghost .icon,
.sticky-action .btn--edit .icon,
.offer-checkout .btn--edit .icon,
.checkout-pay .btn .icon,
.checkout-pay .btn--primary .icon,
.checkout-pay .btn--ghost .icon {
  color: var(--btn-rest-ink);
  stroke: var(--btn-rest-ink);
}

.sticky-action .btn:hover:not(:disabled),
.sticky-action .btn:active:not(:disabled),
.sticky-action .btn--primary:hover:not(:disabled),
.sticky-action .btn--primary:active:not(:disabled),
.sticky-action .btn--ghost:hover:not(:disabled),
.sticky-action .btn--ghost:active:not(:disabled),
.sticky-action .btn--edit:hover:not(:disabled),
.sticky-action .btn--edit:active:not(:disabled),
.offer-checkout .btn:hover:not(:disabled),
.offer-checkout .btn:active:not(:disabled),
.checkout-pay .btn:hover:not(:disabled),
.checkout-pay .btn:active:not(:disabled),
.checkout-pay .btn--primary:hover:not(:disabled),
.checkout-pay .btn--primary:active:not(:disabled),
.checkout-pay .btn--ghost:hover:not(:disabled),
.checkout-pay .btn--ghost:active:not(:disabled) {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--btn-ink);
}

.checkout-warn-card__actions .btn,
.checkout-warn-card__actions .btn--primary,
.checkout-warn-card__actions .btn--ghost {
  background: var(--btn-rest);
  border-color: var(--border-hi);
  color: var(--btn-rest-ink);
  box-shadow: none;
}

.checkout-warn-card__actions .btn span,
.checkout-warn-card__actions .btn--primary span,
.checkout-warn-card__actions .btn--ghost span,
.checkout-warn-card__actions .btn .icon,
.checkout-warn-card__actions .btn--primary .icon,
.checkout-warn-card__actions .btn--ghost .icon {
  color: var(--btn-rest-ink);
  stroke: var(--btn-rest-ink);
}

.checkout-warn-card__actions .btn:hover:not(:disabled),
.checkout-warn-card__actions .btn:active:not(:disabled),
.checkout-warn-card__actions .btn--primary:hover:not(:disabled),
.checkout-warn-card__actions .btn--primary:active:not(:disabled),
.checkout-warn-card__actions .btn--ghost:hover:not(:disabled),
.checkout-warn-card__actions .btn--ghost:active:not(:disabled) {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--btn-ink);
}

.sticky-action .btn:hover:not(:disabled) span,
.sticky-action .btn:hover:not(:disabled) .icon,
.sticky-action .btn--primary:hover:not(:disabled) span,
.sticky-action .btn--primary:hover:not(:disabled) .icon,
.offer-checkout .btn:hover:not(:disabled) span,
.offer-checkout .btn:hover:not(:disabled) .icon,
.checkout-pay .btn:hover:not(:disabled) span,
.checkout-pay .btn:hover:not(:disabled) .icon,
.checkout-pay .btn--primary:hover:not(:disabled) span,
.checkout-pay .btn--primary:hover:not(:disabled) .icon {
  color: var(--btn-ink);
  stroke: var(--btn-ink);
}

.btn--disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.checkout-pdf-wrap--hidden {
  display: none;
}


.btn {
  width: 100%;
  min-height: 50px;
  padding: 14px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  transition:
    transform 0.28s ease,
    opacity 0.28s ease,
    background 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

.btn > span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.btn__text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.22s ease;
  position: relative;
  z-index: 1;
}

.btn__shimmer {
  display: none;
  pointer-events: none;
}

.btn.btn--loading {
  opacity: 1 !important;
  cursor: default;
  overflow: hidden;
}

/* На checkout primary в покое тёмный — при загрузке снова лайм + shimmer. */
.sticky-action .btn.btn--loading,
.sticky-action .btn.btn--loading:disabled,
.checkout-pay .btn.btn--loading,
.checkout-pay .btn.btn--loading:disabled,
.offer-checkout .btn.btn--loading {
  background: var(--lime) !important;
  border-color: var(--lime) !important;
  color: var(--on-lime) !important;
  box-shadow: 0 6px 22px rgba(var(--lime-rgb), 0.18);
}

.sticky-action .btn.btn--loading span,
.sticky-action .btn.btn--loading .btn__caption,
.sticky-action .btn.btn--loading .icon,
.checkout-pay .btn.btn--loading span,
.checkout-pay .btn.btn--loading .btn__caption,
.checkout-pay .btn.btn--loading .icon,
.offer-checkout .btn.btn--loading span,
.offer-checkout .btn.btn--loading .btn__caption {
  color: var(--on-lime) !important;
  stroke: var(--on-lime) !important;
}

.btn.btn--loading .btn__text {
  width: 100%;
  justify-content: center;
}

.btn.btn--loading .btn__shimmer {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
}

.btn.btn--loading .btn__shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 45%,
    rgba(255, 255, 255, 0.38) 50%,
    rgba(255, 255, 255, 0.18) 55%,
    transparent 100%
  );
  animation: btn-shimmer 1.35s ease-in-out infinite;
}

[data-theme='light'] .btn.btn--loading .btn__shimmer::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 45%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(255, 255, 255, 0.35) 55%,
    transparent 100%
  );
}

@keyframes btn-shimmer {
  0% { transform: translateX(0); }
  100% { transform: translateX(350%); }
}

.offers-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.offers-feedback {
  margin: 4px 0 0;
  padding: 0 8px;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  font-weight: 400;
}

.offers-feedback[hidden] {
  display: none !important;
}

.offers-portal-status {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
}

.offers-portal-status__line {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

.offers-portal-status__line + .offers-portal-status__line {
  margin-top: 6px;
}

.offers-portal-status .notice__chat {
  margin-top: 8px;
}

.btn:active:not(:disabled) { transform: scale(0.985); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
  box-shadow: none;
}

.btn--primary:hover:not(:disabled),
.btn--primary:active:not(:disabled) {
  background: var(--text-body);
  border-color: var(--text-body);
  box-shadow: none;
  filter: brightness(1.05);
}

.btn--primary,
.btn--primary span,
label.btn.btn--primary,
label.btn.btn--primary span {
  color: var(--surface);
}

.btn--primary .icon,
label.btn.btn--primary .icon {
  color: var(--surface);
  stroke: var(--surface);
}

html[data-theme="orange"] .btn--primary {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
  box-shadow: 0 6px 22px rgba(var(--lime-rgb), 0.18);
}

html[data-theme="orange"] .btn--primary:hover:not(:disabled),
html[data-theme="orange"] .btn--primary:active:not(:disabled) {
  background: var(--lime-hover);
  border-color: var(--lime-hover);
  box-shadow: 0 8px 28px rgba(var(--lime-rgb), 0.28);
  filter: none;
}

html[data-theme="orange"] .btn--primary,
html[data-theme="orange"] .btn--primary span,
html[data-theme="orange"] label.btn.btn--primary,
html[data-theme="orange"] label.btn.btn--primary span,
html[data-theme="orange"] .btn--primary .icon,
html[data-theme="orange"] label.btn.btn--primary .icon {
  color: var(--on-lime);
  stroke: var(--on-lime);
}

/* На «Оформлении» кнопки в покое остаются нейтральными и закрашиваются
   акцентом темы только при наведении/нажатии — тот же смысл, что и в
   .checkout-pay .btn--primary выше, но с более высокой специфичностью,
   чтобы не проигрывать общему правилу оранжевой темы (btn--primary залит
   всегда) именно на этом экране. */
html[data-theme="orange"] .checkout-pay .btn--primary,
html[data-theme="orange"] .checkout-pay .btn--ghost,
html[data-theme="orange"] .sticky-action .btn--primary,
html[data-theme="orange"] .sticky-action .btn--ghost {
  background: var(--btn-rest);
  border-color: var(--border-hi);
  color: var(--btn-rest-ink);
  box-shadow: none;
}

html[data-theme="orange"] .checkout-pay .btn--primary span,
html[data-theme="orange"] .checkout-pay .btn--ghost span,
html[data-theme="orange"] .checkout-pay .btn--primary .icon,
html[data-theme="orange"] .checkout-pay .btn--ghost .icon,
html[data-theme="orange"] .sticky-action .btn--primary span,
html[data-theme="orange"] .sticky-action .btn--ghost span,
html[data-theme="orange"] .sticky-action .btn--primary .icon,
html[data-theme="orange"] .sticky-action .btn--ghost .icon {
  color: var(--btn-rest-ink);
  stroke: var(--btn-rest-ink);
}

html[data-theme="orange"] .checkout-pay .btn--primary:hover:not(:disabled),
html[data-theme="orange"] .checkout-pay .btn--primary:active:not(:disabled),
html[data-theme="orange"] .checkout-pay .btn--ghost:hover:not(:disabled),
html[data-theme="orange"] .checkout-pay .btn--ghost:active:not(:disabled),
html[data-theme="orange"] .sticky-action .btn--primary:hover:not(:disabled),
html[data-theme="orange"] .sticky-action .btn--primary:active:not(:disabled),
html[data-theme="orange"] .sticky-action .btn--ghost:hover:not(:disabled),
html[data-theme="orange"] .sticky-action .btn--ghost:active:not(:disabled) {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
}

html[data-theme="orange"] .checkout-pay .btn--primary:hover:not(:disabled) span,
html[data-theme="orange"] .checkout-pay .btn--primary:active:not(:disabled) span,
html[data-theme="orange"] .checkout-pay .btn--primary:hover:not(:disabled) .icon,
html[data-theme="orange"] .checkout-pay .btn--primary:active:not(:disabled) .icon,
html[data-theme="orange"] .checkout-pay .btn--ghost:hover:not(:disabled) span,
html[data-theme="orange"] .checkout-pay .btn--ghost:active:not(:disabled) span,
html[data-theme="orange"] .checkout-pay .btn--ghost:hover:not(:disabled) .icon,
html[data-theme="orange"] .checkout-pay .btn--ghost:active:not(:disabled) .icon,
html[data-theme="orange"] .sticky-action .btn--primary:hover:not(:disabled) span,
html[data-theme="orange"] .sticky-action .btn--primary:active:not(:disabled) span,
html[data-theme="orange"] .sticky-action .btn--primary:hover:not(:disabled) .icon,
html[data-theme="orange"] .sticky-action .btn--primary:active:not(:disabled) .icon,
html[data-theme="orange"] .sticky-action .btn--ghost:hover:not(:disabled) span,
html[data-theme="orange"] .sticky-action .btn--ghost:active:not(:disabled) span,
html[data-theme="orange"] .sticky-action .btn--ghost:hover:not(:disabled) .icon,
html[data-theme="orange"] .sticky-action .btn--ghost:active:not(:disabled) .icon {
  color: var(--on-lime);
  stroke: var(--on-lime);
}

html[data-theme="orange"] .checkout-pay .btn.btn--loading,
html[data-theme="orange"] .checkout-pay .btn.btn--loading:disabled,
html[data-theme="orange"] .sticky-action .btn.btn--loading,
html[data-theme="orange"] .sticky-action .btn.btn--loading:disabled {
  background: var(--lime) !important;
  border-color: var(--lime) !important;
  color: var(--on-lime) !important;
}

.sticky-action .btn--primary,
.sticky-action .btn--primary span,
.sticky-action .btn--ghost,
.sticky-action .btn--ghost span,
.sticky-action .btn--edit,
.sticky-action .btn--edit span,
.offer-checkout .btn--edit,
.offer-checkout .btn--edit span,
.offer-checkout .btn--edit .icon,
.checkout-pay .btn--primary,
.checkout-pay .btn--primary span,
.checkout-pay .btn--ghost,
.checkout-pay .btn--ghost span,
.checkout-pay .btn .icon {
  color: var(--btn-rest-ink);
  stroke: var(--btn-rest-ink);
}

.btn--ghost {
  background: transparent;
  /* В покое — обычная рамка, не акцент. Иначе «Добавить водителя»
     светится салатом на оранжевой теме: --border-hi на десктопе
     брал лайм из .view, а не цвет темы. */
  border-color: var(--border);
  color: var(--text-body);
}

.btn--ghost:hover:not(:disabled),
.btn--ghost:active:not(:disabled) {
  border-color: var(--lime);
  background: rgba(var(--lime-rgb), 0.08);
  color: var(--text);
}

.btn--ghost:hover:not(:disabled) .icon,
.btn--ghost:active:not(:disabled) .icon {
  color: var(--lime);
  stroke: var(--lime);
}

.btn--edit {
  background: var(--edit-bg);
  border-color: var(--edit-border);
  color: var(--edit-text);
}

.btn--edit .icon,
.btn--edit span {
  color: var(--edit-text);
  stroke: var(--edit-text);
}

/* Компактный вариант — для действия внутри карточки, чтобы оно не выглядело
   главным на экране. */
.btn--sm {
  width: auto;
  min-height: 36px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}

.btn-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-col .btn + .btn { margin-top: 0; }

.btn--new {
  margin-bottom: 14px;
}

.btn + .btn { margin-top: 10px; }

.card__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.btn__spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--lime);
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}

.btn--primary .btn__spinner {
  border-color: var(--on-lime);
  border-top-color: transparent;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Главная кнопка всегда под рукой. Фон плотный: контент проезжает под
   ней при скролле, и полупрозрачная плашка читалась бы как баг. */
.sticky-action {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 12px 0 4px;
  background: rgba(var(--bg-rgb), 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  z-index: 8;
}

/* --------------------------------------------------------------- toggle */

.toggle {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  gap: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.toggle__opt {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.toggle__opt--active {
  background: var(--lime);
  color: var(--on-lime);
}

html[data-theme="dark"] .toggle__opt {
  color: #F4F6F0;
}

html[data-theme="dark"] .toggle__opt--active {
  color: var(--on-lime);
}

/* ----------------------------------------------------------------- rows */

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.kv:last-child { border-bottom: none; }

.kv__k {
  font-size: 13px;
  color: var(--text-muted);
  flex: 0 0 auto;
}

.kv__v {
  font-size: 14px;
  color: var(--text);
  text-align: right;
  font-weight: 500;
}

.kv__v--stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  max-width: 70%;
}

.kv__v--lime { color: var(--lime-hi); font-variant-numeric: tabular-nums; }
.kv__v--big { font-size: 20px; font-weight: 600; letter-spacing: -0.4px; }

/* --------------------------------------------------------------- offers */

.offer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s ease;
}

.offer + .offer { margin-top: 8px; }

.offer-block {
  margin: 0 0 10px;
}

.offer-block + .offer-block {
  margin-top: 0;
}

.offer-block--selected {
  margin-bottom: 18px;
  padding-bottom: 2px;
}

.offer-block .offer {
  margin: 0;
}

.offer-checkout {
  margin: 10px 0 4px;
  padding: 0 2px 6px;
}

.offer-checkout .btn {
  width: 100%;
}

.offers-checkout-host:empty,
.offers-checkout-host[hidden] {
  display: none !important;
}

.offers-checkout-host .offer-checkout {
  margin: 0;
  padding: 0;
}

.offer-products {
  display: flex;
  justify-content: flex-end;
  padding: 8px 4px 0;
}

.offer--selected {
  border-color: var(--lime);
  background: linear-gradient(160deg, rgba(var(--lime-rgb), 0.1), var(--surface) 60%);
}

.offer--error {
  cursor: default;
  border-color: rgba(var(--lime-rgb), 0.35);
  background: rgba(var(--lime-rgb), 0.06);
}

.offer--error .offer__insurer {
  color: var(--text-muted);
}

.offer__left { min-width: 0; }

.offer__insurer {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}

.offer__rank {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.offer__meta {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.offer__tag {
  color: var(--text-muted);
}

.offer__price {
  flex: 0 0 auto;
  text-align: right;
}

.offer__price b {
  display: block;
  font-size: 17px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}

.offer__price span {
  font-size: 11px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------- tabbar */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: rgba(var(--bg-rgb), 0.9);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--border);
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--tab-text);
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  transition: color 0.15s ease;
}

.tab__icon { display: grid; place-items: center; height: 22px; }

.tab__label {
  color: inherit;
  opacity: 1;
}

.tab__label--full { display: none; }
.tab__label--short { display: block; }

.tab__icon { position: relative; }

.tab__mark {
  position: absolute;
  top: -2px;
  right: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 2px var(--bg);
}

.tab--desk { display: none; }

.tab-group {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.tab-group .tab { flex: 1; width: 100%; }

.tab-sub {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(100% + 8px);
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  z-index: 30;
}

.tab-group--open .tab-sub { display: flex; }

.tab-sub__item {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}

.tab-sub__item:hover,
.tab-sub__item--active {
  background: var(--lime);
  color: var(--btn-ink);
}

html[data-theme="dark"] .tab-sub__item:hover,
html[data-theme="dark"] .tab-sub__item--active {
  background: var(--lime);
  color: var(--btn-ink);
}

.sidebar__group { display: none; }

.sidebar__nav { display: contents; }

.side-stat { display: none; }

html[data-theme="light"] .tab:not(.tab--active) {
  color: #1C2118;
}

html[data-theme="light"] .tab:not(.tab--active) .icon {
  color: #1C2118;
  stroke: #1C2118;
}

html[data-theme="dark"] .tab:not(.tab--active) {
  color: #D8DCE0;
}

html[data-theme="dark"] .tab:not(.tab--active) .icon {
  color: #D8DCE0;
  stroke: #D8DCE0;
}

.tab--active { color: var(--tab-active-text); }

.tab--active .tab__icon {
  width: 36px;
  height: 24px;
  border-radius: 10px;
  background: rgba(20, 24, 28, 0.08);
  color: inherit;
}

.tab--active .tab__icon .icon {
  color: inherit;
  stroke: currentColor;
}

html[data-theme="dark"] .tab--active .tab__icon {
  background: rgba(255, 255, 255, 0.08);
}

.tab:disabled { opacity: 0.55; cursor: not-allowed; }

/* ------------------------------------------------------- states / misc */

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty__icon { display: flex; justify-content: center; opacity: 0.45; }
.empty__text { margin-top: 12px; font-size: 14px; }

.skeleton {
  height: 82px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-hi) 50%, var(--surface) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}

.skeleton + .skeleton { margin-top: 10px; }

.calc-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px 18px;
  margin-bottom: 12px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}
.calc-progress__spin { margin-bottom: 4px; }
.calc-progress__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.calc-progress__msg {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-muted);
  max-width: 28em;
}

@keyframes shimmer {
  from { background-position: 130% 0; }
  to { background-position: -30% 0; }
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(196, 165, 116, 0.28);
  background: rgba(255, 214, 160, 0.1);
  color: var(--text-body);
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.alert--warn {
  border-color: rgba(196, 165, 116, 0.28);
  background: rgba(255, 214, 160, 0.1);
  color: var(--text-body);
}

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--radius);
  border: 1px solid rgba(var(--lime-rgb), 0.25);
  background: var(--lime-dim);
  color: var(--on-lime);
  font-size: 13px;
  font-weight: 500;
}

.progress .btn__spinner {
  border-color: var(--lime);
  border-top-color: transparent;
}

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.doclist { display: flex; flex-direction: column; gap: 8px; }

.doc {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-body);
  text-decoration: none;
  font-size: 14px;
}

.doc__row {
  display: flex;
  align-items: center;
  gap: 11px;
}

.doc__icon { color: var(--text-muted); display: flex; }
.doc__name { flex: 1; min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.doc__open { font-size: 12px; color: var(--lime-hi); flex: 0 0 auto; }

.doc__actions {
  display: flex;
  gap: 8px;
}

.doc__actions .btn,
.doc__actions .btn + .btn {
  flex: 1;
  width: auto;
  min-height: 40px;
  margin-top: 0;
}

.doc__actions .btn,
.doc__actions .btn--primary,
.doc__actions .btn--ghost {
  background: var(--btn-rest);
  border-color: var(--border-hi);
  color: var(--btn-rest-ink);
  box-shadow: none;
}

.doc__actions .btn span,
.doc__actions .btn--primary span,
.doc__actions .btn--ghost span,
.doc__actions .btn .icon,
.doc__actions .btn--primary .icon,
.doc__actions .btn--ghost .icon {
  color: var(--btn-rest-ink);
  stroke: var(--btn-rest-ink);
}

.doc__actions .btn:hover:not(:disabled),
.doc__actions .btn:active:not(:disabled),
.doc__actions .btn--primary:hover:not(:disabled),
.doc__actions .btn--primary:active:not(:disabled),
.doc__actions .btn--ghost:hover:not(:disabled),
.doc__actions .btn--ghost:active:not(:disabled) {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--btn-ink);
}

.doc-preview-wrap { margin: 4px 0 12px; }

.doc-preview {
  display: block;
  width: 100%;
  height: min(58vh, 480px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.doc-preview--img {
  height: auto;
  max-height: min(58vh, 480px);
  object-fit: contain;
}

.doc-preview--wait {
  display: grid;
  place-items: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 20px);
  z-index: 40;
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  color: var(--text);
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast--show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast--ok {
  background: var(--lime);
  color: var(--on-lime);
  border-color: var(--lime);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.alert {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.alert__text { white-space: pre-wrap; }
.alert__action { width: auto; align-self: flex-start; margin-top: 0; }

.notice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(196, 165, 116, 0.28);
  background: rgba(255, 214, 160, 0.1);
  color: var(--text-body);
}

.notice--soft {
  margin: 0 0 14px;
  border-color: var(--border);
  background: var(--bg-elevated);
}

.notice--soft .notice__icon {
  color: var(--text-muted);
}

.notice__chat {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
}

.calc-card {
  margin: 8px 0 20px;
  padding: 4px 14px 16px;
}

.calc-card .field-label:first-child {
  margin-top: 8px;
}

.calc-date-wrap {
  margin-top: 4px;
}

.calc-status {
  margin-bottom: 12px;
}

.btn--block {
  width: 100%;
}

.muted {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.notice__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notice__icon {
  color: #d4b483;
  flex: 0 0 auto;
  margin-top: 1px;
}

.notice__text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

.notice__action {
  width: auto;
  max-width: 100%;
  align-self: flex-start;
  min-height: 34px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.field-label {
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.file-chip {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-body);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-label--tight {
  margin: 10px 0 6px;
}

.field-label--icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.field-label--icon .icon {
  flex: 0 0 auto;
  opacity: 0.75;
}

html[data-theme="dark"] .field-label--icon .icon {
  color: var(--lime);
  opacity: 1;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  color-scheme: dark;
}

html[data-theme="dark"] .form-input,
html[data-theme="dark"] .upload-params__date,
html[data-theme="dark"] select.form-input {
  background-color: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .form-input::placeholder,
html[data-theme="dark"] .upload-params__date::placeholder {
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--bg-elevated);
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.3;
  min-width: 0;
  outline: none;
}

select,
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
}

.menu-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.menu-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  padding-right: 12px;
}

.menu-select__trigger .icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.menu-select--open .menu-select__trigger .icon {
  transform: rotate(180deg);
}

.menu-select__placeholder {
  color: var(--text-muted);
}

.menu-select__list {
  position: fixed;
  z-index: 520;
  box-sizing: border-box;
  overflow: auto;
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.menu-select__option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.menu-select__option:hover,
.menu-select__option:focus-visible {
  background: rgba(var(--lime-rgb), 0.12);
  outline: none;
}

.menu-select__option--active {
  color: var(--lime);
}

.form-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--bg);
}

.form-input--missing {
  border-color: var(--hot);
  background-color: rgba(var(--hot-rgb), 0.12);
  color: var(--text-body);
  box-shadow: 0 0 0 1px var(--hot);
}

.menu-select.form-input--missing {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
}

.menu-select.form-input--missing .menu-select__trigger {
  border-color: var(--hot);
  background-color: rgba(var(--hot-rgb), 0.12);
  box-shadow: 0 0 0 1px var(--hot);
}

.missing-fields-notice {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--edit-border);
  border-radius: var(--radius-sm);
  background: var(--edit-bg);
  color: var(--edit-text);
}

.missing-fields-notice p {
  margin: 4px 0;
  font-size: 12px;
  line-height: 1.35;
}

.missing-fields-notice__title {
  font-weight: 700;
}

.form-input--area {
  min-height: 88px;
  resize: vertical;
}

.addr-suggest {
  position: relative;
  width: 100%;
  min-width: 0;
}

.addr-suggest__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 80;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.addr-suggest__opt {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-body);
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.addr-suggest__opt:hover,
.addr-suggest__opt--active {
  background: rgba(var(--lime-rgb), 0.14);
  color: var(--text);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-row > * {
  flex: 1 1 140px;
  min-width: 0;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 8px;
  font-size: 14px;
}

.check-row--box {
  pointer-events: none;
  cursor: default;
}

.check-row--box input[type="checkbox"] {
  pointer-events: auto;
  cursor: pointer;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 0;
}

.check-row--box span {
  pointer-events: none;
}

.card--flat {
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.accordion__item {
  border-bottom: 1px solid var(--border);
}

.accordion__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  background: none;
  border: none;
  color: var(--text-body);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.accordion__chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.18s ease;
}

.accordion__item--open .accordion__chevron {
  transform: rotate(180deg);
}

.accordion__body {
  display: none;
  padding-bottom: 14px;
}

.accordion__item--open .accordion__body {
  display: block;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.48);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.dyn-sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dyn-sheet__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  font-size: 14px;
}

.dyn-sheet__label {
  color: var(--text-muted);
}

.dyn-sheet__value {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.dyn-sheet__note {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-body);
}

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: min(88vh, 720px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  animation: sheet-up 0.22s ease-out;
}

@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: var(--border-hi);
  margin: 6px auto 10px;
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.sheet__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.sheet__close {
  border: none;
  background: var(--bg-elevated);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.sheet__lead {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.burn-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.burn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.burn-row__open {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}

.burn-row__name {
  font-size: 14px;
  font-weight: 600;
}

.burn-row__days {
  font-size: 12px;
  color: var(--hot, #C23B22);
}

.burn-row__hide {
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.burn-row__hide:hover {
  color: var(--text);
}

.report__meta {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  white-space: pre-wrap;
}

.report__comment {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  resize: vertical;
  outline: none;
}

.theme-toggle {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.theme-opt {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.theme-opt--active {
  border-color: var(--border-hi);
  background: rgba(var(--bg-rgb), 0.45);
  color: var(--text);
}

.theme-opt--active .icon {
  color: inherit;
  stroke: currentColor;
}

/* Иконка выбранной темы: салат / белый / фирменный оранжевый. */
.theme-opt--active.theme-opt--light .icon {
  color: #C6F031;
  stroke: #C6F031;
}

.theme-opt--active.theme-opt--dark {
  background: #1a1a1a;
  border-color: #2a2a2a;
  color: #f5f5f5;
}

.theme-opt--active.theme-opt--dark .icon {
  color: #ffffff;
  stroke: #ffffff;
}

.theme-opt--active.theme-opt--orange .icon {
  color: #E87830;
  stroke: #E87830;
}

html[data-theme="orange"] .theme-opt--active.theme-opt--orange {
  border-color: rgba(232, 120, 48, 0.45);
  background: rgba(232, 120, 48, 0.12);
}

.settings-help {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-body);
  font-weight: 400;
}

.settings-help:last-child { margin-bottom: 0; }

.settings-footer {
  margin: 28px 0 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.terms-hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.terms-hint--sravni {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--lime-rgb), 0.35);
  background: rgba(var(--lime-rgb), 0.08);
  color: var(--edit-text);
}

.form-error {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--danger);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 4px;
}

.switch-row__label {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-body);
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  padding: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hi);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch--on {
  background: var(--lime);
  border-color: var(--lime);
}

.switch__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch--on .switch__knob {
  transform: translateX(18px);
  background: var(--on-lime);
}

.reveal {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin: 0;
  transition: max-height 0.22s ease, opacity 0.18s ease, margin 0.18s ease;
}

.reveal--open {
  max-height: 160px;
  opacity: 1;
  margin-top: 4px;
}

.add-driver-host {
  margin-top: 4px;
}

.driver-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.driver-card__head-text {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.driver-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-card__badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--lime-dim);
  color: var(--lime-hi);
  font-size: 11px;
  font-weight: 600;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn--danger {
  color: var(--danger);
}

[data-theme="light"] .tabbar {
  background: #ffffff;
  border-top-color: rgba(124, 185, 40, 0.22);
}

[data-theme="light"] .kv__v--lime,
[data-theme="light"] .doc__open {
  color: #5A9A18;
}

[data-theme="light"] .notice {
  background: #F3FBD8;
  border-color: rgba(124, 185, 40, 0.35);
}

[data-theme="light"] .notice__icon {
  color: #5A9A18;
}

[data-theme="light"] .header {
  border-bottom-color: rgba(124, 185, 40, 0.18);
}

[data-theme="light"] .card:hover,
[data-theme="light"] .client-card:hover {
  border-color: rgba(198, 240, 49, 0.55);
}

/* Desktop CRM: светлый сайдбар в light, глубокий графит в dark. */
@media (min-width: 1024px) {
  :root,
  html[data-theme="light"] {
    --header-h: 68px;
    --tabbar-h: 0px;
    --desk-nav: 248px;
    --sidebar: #F4F5F7;
    --workspace: #D5D8DE;
  }

  html[data-theme="dark"] {
    --header-h: 68px;
    --tabbar-h: 0px;
    --desk-nav: 248px;
    --sidebar: #0C0E0D;
    --workspace: #101210;
  }

  html[data-theme="orange"] {
    --header-h: 68px;
    --tabbar-h: 0px;
    --desk-nav: 248px;
    --sidebar: #FFF4E8;
    --workspace: #FAF6F0;
  }

  html,
  body {
    min-height: 100vh;
    background: var(--workspace) !important;
    color: #243024 !important;
    color-scheme: light;
  }

  html[data-theme="dark"],
  html[data-theme="dark"] body {
    color: #E8EDE4 !important;
    color-scheme: dark;
  }

  html[data-theme="orange"],
  html[data-theme="orange"] body {
    color: #3D2E22 !important;
    color-scheme: light;
  }

  body {
    display: grid;
    grid-template-columns: var(--desk-nav) minmax(0, 1fr);
    grid-template-rows: var(--header-h) minmax(0, 1fr);
    min-height: 100vh;
  }

  .aurora {
    grid-column: 2;
    grid-row: 1 / -1;
    background:
      radial-gradient(55% 80% at 8% 0%, rgba(var(--lime-rgb), 0.16), transparent 70%),
      radial-gradient(40% 60% at 96% 8%, rgba(139, 197, 61, 0.08), transparent 72%);
  }

  .header {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom-color: rgba(20, 40, 16, 0.08);
    color: #142016;
  }

  .header__brand { display: none; }

  .header__search,
  .header__profile {
    display: flex;
  }

  .header__search {
    background: #fff;
    border-color: rgba(20, 40, 16, 0.1);
    color: #142016;
  }

  .header__search-input {
    color: #142016;
    caret-color: #142016;
  }

  .header__search-input::placeholder {
    color: #5A6158;
  }

  html[data-theme="dark"] .header {
    background: rgba(12, 14, 13, 0.92);
    border-bottom-color: rgba(226, 240, 204, 0.08);
    color: #E8EDE4;
  }

  html[data-theme="dark"] .header__search {
    background: #1A1F1B;
    border-color: rgba(226, 240, 204, 0.12);
    color: #E8EDE4;
  }

  html[data-theme="dark"] .header__search-input,
  html[data-theme="dark"] .header__search-input::placeholder {
    color: #E8EDE4;
    caret-color: #E8EDE4;
  }

  html[data-theme="dark"] .header__search-input::placeholder {
    color: rgba(232, 237, 228, 0.5);
  }

  .sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 18px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(20, 24, 28, 0.08);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border-radius: 12px;
  }

  .sidebar__brand .header__name { color: #111411; }
  .sidebar__brand .header__sub { color: #5A6158; }

  html[data-theme="dark"] .sidebar__brand {
    border-bottom-color: rgba(226, 240, 204, 0.1);
  }

  html[data-theme="dark"] .sidebar__brand .header__name { color: #F3F6F0; }
  html[data-theme="dark"] .sidebar__brand .header__sub { color: rgba(243, 246, 240, 0.55); }

  .tabbar {
    grid-column: 1;
    grid-row: 1 / -1;
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    bottom: auto;
    height: 100vh;
    width: var(--desk-nav);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    padding: 22px 14px 20px;
    overflow: hidden;
    border-top: none;
    border-right: 1px solid rgba(20, 24, 28, 0.08);
    background: var(--sidebar);
    color: #1C2118;
  }

  .sidebar__nav {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  html[data-theme="dark"] .tabbar {
    border-right-color: rgba(226, 240, 204, 0.08);
    color: #E8F0DC;
  }

  .tab {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1C2118;
    transition: background 0.2s ease;
  }

  .tab .icon {
    color: currentColor;
    stroke: currentColor;
  }

  .tab:hover:not(:disabled) {
    color: var(--btn-ink);
    background: var(--lime);
    transform: none;
  }

  .tab--active {
    background: var(--lime);
    color: var(--btn-ink);
    box-shadow: none;
  }

  .tab--active .icon {
    color: var(--btn-ink);
    stroke: var(--btn-ink);
  }

  .tab-group {
    flex: 0 0 auto;
  }

  .tab-sub {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    margin: 4px 0 8px 12px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .tab-group--open .tab-sub { display: flex; }

  html[data-theme="dark"] .tab {
    color: rgba(232, 240, 220, 0.78);
  }

  html[data-theme="dark"] .tab:hover:not(:disabled) {
    color: var(--btn-ink);
    background: var(--lime);
  }

  html[data-theme="dark"] .tab--active {
    background: var(--lime);
    color: var(--btn-ink);
  }

  html[data-theme="dark"] .tab--active .icon {
    color: var(--btn-ink);
    stroke: var(--btn-ink);
  }

  .tab--active .tab__icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: transparent;
  }

  .tab__label--full { display: block; }
  .tab__label--short { display: none; }
  .tab--desk { display: flex; }

  .sidebar__group {
    display: block;
    margin: 16px 8px 4px;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(226, 240, 204, 0.38);
  }

  .tab__mark {
    box-shadow: 0 0 0 2px var(--sidebar);
  }

  .side-stat {
    display: block;
    flex: 0 0 auto;
    margin-top: auto;
    padding: 12px 10px 11px;
    border-radius: 20px;
    background: rgba(18, 20, 18, 0.36);
    border: 1px solid rgba(226, 240, 204, 0.14);
    box-shadow:
      0 12px 32px rgba(0, 0, 0, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    color: #F3F6F0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .side-stat:hover,
  .side-stat:focus-within {
    border-color: rgba(var(--lime-rgb), 0.5);
    box-shadow:
      0 0 22px rgba(var(--lime-rgb), 0.2),
      0 12px 32px rgba(0, 0, 0, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.07);
  }

  html[data-theme="light"] .side-stat {
    background: rgba(226, 228, 232, 0.72);
    border: 1px solid rgba(20, 24, 28, 0.1);
    box-shadow:
      0 10px 28px rgba(20, 24, 28, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.7);
    color: #243024;
  }

  html[data-theme="light"] .side-stat:hover,
  html[data-theme="light"] .side-stat:focus-within {
    border-color: rgba(var(--lime-rgb), 0.55);
    box-shadow:
      0 0 18px rgba(var(--lime-rgb), 0.18),
      0 10px 28px rgba(20, 24, 28, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }

  .side-stat__label {
    margin: 0 2px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(243, 246, 240, 0.48);
  }

  html[data-theme="light"] .side-stat__label {
    color: rgba(20, 24, 28, 0.42);
  }

  .side-stat__bars {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .batt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 4px 2px 2px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .batt:hover,
  .batt:focus-visible {
    background: rgba(var(--lime-rgb), 0.08);
    border-color: rgba(var(--lime-rgb), 0.55);
    box-shadow: 0 0 16px rgba(var(--lime-rgb), 0.28);
  }

  .batt__title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 14px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: rgba(243, 246, 240, 0.62);
  }

  html[data-theme="light"] .batt__title {
    color: rgba(20, 24, 28, 0.48);
  }

  .batt__title .icon {
    width: 11px;
    height: 11px;
    color: inherit;
    stroke: currentColor;
  }

  .batt__cell {
    position: relative;
    width: 26px;
    height: 74px;
    border-radius: 9px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(226, 240, 204, 0.14);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  }

  html[data-theme="light"] .batt__cell {
    background: rgba(20, 24, 28, 0.045);
    border-color: rgba(20, 24, 28, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  }

  .batt__cell::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 50%;
    width: 10px;
    height: 3px;
    transform: translateX(-50%);
    border-radius: 99px;
    background: rgba(243, 246, 240, 0.28);
    z-index: 1;
  }

  .batt__fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 0;
    overflow: hidden;
    transition: height 3.4s cubic-bezier(0.33, 0, 0.2, 1);
  }

  .batt__fill--run {
    height: var(--batt-to, 0%);
  }

  .batt__wave {
    position: absolute;
    left: -8%;
    right: -8%;
    top: -28%;
    height: 48%;
    border-radius: 50%;
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.42),
      rgba(255, 255, 255, 0)
    );
    animation: batt-liquid 4.2s ease-in-out infinite;
    pointer-events: none;
  }

  @keyframes batt-liquid {
    0% { transform: translateY(0) scaleX(1); opacity: 0.22; }
    40% { transform: translateY(12px) scaleX(1.08); opacity: 0.55; }
    70% { transform: translateY(20px) scaleX(0.96); opacity: 0.4; }
    100% { transform: translateY(0) scaleX(1); opacity: 0.22; }
  }

  .batt--lime .batt__fill {
    background: linear-gradient(180deg, var(--lime-hi), var(--lime) 55%, #8BC20A);
    box-shadow: 0 0 14px rgba(var(--lime-rgb), 0.45);
  }

  .batt--ice .batt__fill {
    background: linear-gradient(180deg, var(--ice-hi), var(--ice));
    box-shadow: 0 0 12px rgba(var(--ice-rgb), 0.38);
  }

  .batt--hot .batt__fill {
    background: linear-gradient(180deg, var(--hot-hi), var(--hot));
    box-shadow: 0 0 12px rgba(var(--hot-rgb), 0.4);
  }

  .batt--lime .batt__pct { color: var(--lime); }

  html[data-theme="light"] .batt--lime .batt__fill {
    background: linear-gradient(180deg, #6FAD16, #4F8A0A 55%, #356308);
    box-shadow: 0 0 12px rgba(63, 110, 8, 0.35);
  }

  html[data-theme="light"] .batt--lime .batt__pct {
    color: #3F6E08;
  }
  .batt--ice .batt__pct { color: var(--ice-hi); }
  .batt--hot .batt__pct { color: var(--hot-hi); }

  .batt__pct {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
  }

  .batt__hint {
    font-size: 8px;
    line-height: 1.25;
    text-align: center;
    color: rgba(243, 246, 240, 0.42);
  }

  html[data-theme="light"] .batt__hint {
    color: rgba(20, 24, 28, 0.4);
  }

  html[data-theme="light"] .batt:hover,
  html[data-theme="light"] .batt:focus-visible {
    background: rgba(var(--lime-rgb), 0.12);
    border-color: rgba(var(--lime-rgb), 0.5);
    box-shadow: 0 0 14px rgba(var(--lime-rgb), 0.2);
  }

  .view {
    --bg: #D5D8DE;
    --bg-rgb: 213, 216, 222;
    --surface: #ffffff;
    --surface-hi: #ffffff;
    --text: #142016;
    --text-body: #2A3128;
    --text-muted: #5A6158;
    --border: rgba(20, 24, 28, 0.08);
    /* Акцентная рамка — из токена темы, а не копией салата: этот блок не
       привязан к теме, и оранжевая получала салатовую рамку на «Добавить
       водителя» и всех прочих .btn--ghost. */
    --border-hi: rgba(var(--lime-rgb), 0.4);
    --btn-rest: #ffffff;
    --btn-rest-ink: #111411;
    grid-column: 2;
    grid-row: 2;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 28px 32px 48px;
    min-height: calc(100vh - var(--header-h));
    background: var(--workspace);
    color: #2A3128;
  }

  html[data-theme="dark"] .view {
    --bg: #101210;
    --bg-rgb: 16, 18, 16;
    --surface: #1A1F1B;
    --surface-hi: #222822;
    --text: #E8EDE4;
    --text-body: #E8EDE4;
    --text-muted: rgba(232, 237, 228, 0.58);
    --border: rgba(226, 240, 204, 0.1);
    --btn-rest: #111411;
    --btn-rest-ink: #E8EDE4;
    color: #E8EDE4;
  }

  html[data-theme="orange"] .view {
    --bg: #FAF6F0;
    --bg-rgb: 250, 246, 240;
    --surface: #ffffff;
    --surface-hi: #FFF4E8;
    --text: #2A1C12;
    --text-body: #3D2E22;
    --text-muted: #8A7464;
    --border: rgba(60, 40, 20, 0.1);
    --border-hi: rgba(var(--lime-rgb), 0.4);
    --btn-rest: #ffffff;
    --btn-rest-ink: #2A1C12;
    color: #3D2E22;
  }

  .search { display: none; }

  .card,
  .dropzone,
  .notice,
  .calc-card {
    box-shadow: 0 10px 28px rgba(20, 40, 16, 0.05);
  }

  .card--tap:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--lime-rgb), 0.4);
    box-shadow: 0 16px 32px rgba(20, 40, 16, 0.08);
  }

  .btn--primary {
    box-shadow: 0 8px 20px rgba(var(--lime-rgb), 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  }

  .btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(var(--lime-rgb), 0.34);
  }

  .sticky-action .btn--primary,
  .sticky-action .btn--ghost,
  .sticky-action .btn--edit {
    box-shadow: none;
    color: var(--btn-rest-ink);
  }

  .sticky-action .btn--primary:hover:not(:disabled) {
    box-shadow: none;
    color: var(--btn-ink);
  }

  .checkout-warn-card__actions .btn,
  .checkout-warn-card__actions .btn--primary,
  .checkout-warn-card__actions .btn--ghost {
    background: var(--btn-rest);
    border-color: var(--border-hi);
    box-shadow: none;
    color: var(--btn-rest-ink);
  }

  .checkout-warn-card__actions .btn:hover:not(:disabled),
  .checkout-warn-card__actions .btn--primary:hover:not(:disabled),
  .checkout-warn-card__actions .btn--ghost:hover:not(:disabled) {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--btn-ink);
  }

  .doc__actions .btn,
  .doc__actions .btn--primary,
  .doc__actions .btn--ghost {
    background: var(--btn-rest);
    border-color: var(--border-hi);
    box-shadow: none;
    color: var(--btn-rest-ink);
  }

  .doc__actions .btn:hover:not(:disabled),
  .doc__actions .btn--primary:hover:not(:disabled),
  .doc__actions .btn--ghost:hover:not(:disabled) {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--btn-ink);
  }

  @keyframes workspace-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }

  .screen-title {
    font-size: 26px;
    margin: 0 0 16px;
  }

  .client-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .client-list--table,
  .client-list--cal {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
  }

  .offers-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 20px;
    align-items: start;
    width: 100%;
    margin-top: 8px;
  }

  .offers-col {
    min-width: 0;
  }

  .offers-col .section-label {
    margin-top: 0;
  }

  .offer {
    padding: 14px 16px;
  }

  .offer-checkout .btn {
    width: auto;
    min-width: 180px;
  }

  .offers-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .form-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
  }

  .form-stack .form-row,
  .form-stack .form-input--area,
  .form-stack .check-row,
  .form-stack .addr-suggest {
    grid-column: 1 / -1;
  }

  .checkout-review .form-stack,
  .person-fields,
  .review-card__body .form-stack,
  .drivers-section {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
  }

  .person-fields .form-row,
  .review-card__body .form-row {
    grid-column: auto;
  }

  .params-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
  }

  .params-col,
  .params-col.form-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .sheet-backdrop {
    align-items: center;
  }

  .sheet {
    max-width: min(720px, calc(100vw - 80px));
    border-radius: 22px;
    border-bottom: 1px solid var(--border);
    padding: 12px 22px 22px;
  }

  .sticky-action {
    position: static;
    margin-top: 24px;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .calc-progress__msg {
    max-width: 40em;
  }
}

@media (min-width: 1440px) {
  .view {
    padding: 32px 40px 56px;
  }

  .client-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .client-list--table,
  .client-list--cal {
    grid-template-columns: none;
  }
}

/* --------------------------------------------------------------- dashboard / kv / chat */

.bento {
  display: grid;
  gap: 14px;
  margin: 4px 0 8px;
}

.bento__kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bento__kpis > .card + .card,
.admin-kpis > .card + .card,
.profile-layout > .card + .card {
  margin-top: 0;
}

.bento__kpis > .skeleton,
.bento__kpis > .skeleton + .skeleton {
  margin-top: 0;
  min-height: 104px;
}

.bento__recent { display: grid; gap: 10px; }

.avatar-video {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  aspect-ratio: 4 / 5;
  border-radius: 22px;
  background: #121614;
  box-shadow: 0 18px 40px rgba(18, 22, 20, 0.18);
}

.avatar-video__media {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
  border-radius: inherit;
}

.avatar-video__shade {
  position: absolute;
  inset: auto 0 0;
  height: 46%;
  background: linear-gradient(180deg, transparent, rgba(12, 16, 12, 0.72));
  pointer-events: none;
}

.avatar-video__meta {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #F3F6F0;
  pointer-events: none;
}

.avatar-video__meta span {
  font-size: 12px;
  opacity: 0.78;
}

.avatar-video__controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 8px;
}

.avatar-video__btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(243, 246, 240, 0.92);
  color: #142016;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.avatar-video__btn:hover { background: #fff; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 20px;
}

.kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 0;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.kpi:hover {
  border-color: rgba(var(--lime-rgb), 0.4);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(var(--lime-rgb), 0.08);
}

.kpi--dragging { opacity: 0.55; }
.kpi--over { border-color: var(--lime); }

.kpi__icon {
  color: var(--lime);
  margin-bottom: 2px;
}

.kpi__value {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.kpi__label {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.25;
}

.kpi-wrap {
  position: relative;
  min-width: 0;
}

.kpi-wrap .kpi {
  width: 100%;
  height: 100%;
}

.kpi__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 999px;
  background: rgba(var(--bg-rgb), 0.72);
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.kpi-wrap:hover .kpi__remove,
.kpi-wrap:focus-within .kpi__remove,
.kpi__remove:focus {
  opacity: 1;
  pointer-events: auto;
}

.kpi__remove:hover {
  color: var(--text);
  background: var(--surface-hi);
}

.kpi--add {
  align-items: center;
  justify-content: center;
  min-height: 104px;
  border-style: dashed;
  background: transparent;
  order: 21;
}

.kpi--add .kpi__plus,
.kpi--add .icon {
  width: 40px;
  height: 40px;
  margin: 0;
  color: #8B9088;
  stroke: #8B9088;
  stroke-width: 1.45;
}

html[data-theme="dark"] .kpi--add .kpi__plus,
html[data-theme="dark"] .kpi--add .icon {
  color: #9AA094;
  stroke: #9AA094;
}

.kpi--widget {
  min-height: 132px;
  cursor: grab;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kpi--widget:hover,
.kpi--widget:focus-within {
  border-color: rgba(var(--lime-rgb), 0.45);
  box-shadow: 0 0 18px rgba(var(--lime-rgb), 0.18);
}

.kpi--widget .kpi__label {
  margin-bottom: 6px;
}

.kpi--widget .side-stat__bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.kpi--widget .batt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 4px 2px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.kpi--widget .batt:hover,
.kpi--widget .batt:focus-visible {
  background: rgba(var(--lime-rgb), 0.08);
  border-color: rgba(var(--lime-rgb), 0.55);
  box-shadow: 0 0 14px rgba(var(--lime-rgb), 0.22);
}

.kpi--widget .batt__title {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi--widget .batt__cell {
  position: relative;
  width: 18px;
  height: 42px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(var(--bg-rgb), 0.45);
  border: 1px solid var(--border);
}

.kpi--widget .batt__fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  overflow: hidden;
  transition: height 3.4s cubic-bezier(0.33, 0, 0.2, 1);
}

.kpi--widget .batt__fill--run { height: var(--batt-to, 0%); }

.kpi--widget .batt--lime .batt__fill {
  background: linear-gradient(180deg, var(--lime-hi), var(--lime));
}

.kpi--widget .batt--ice .batt__fill {
  background: linear-gradient(180deg, var(--ice-hi), var(--ice));
}

.kpi--widget .batt--hot .batt__fill {
  background: linear-gradient(180deg, var(--hot-hi), var(--hot));
}

.kpi--widget .batt--lime .batt__pct { color: var(--lime); }
.kpi--widget .batt--ice .batt__pct { color: var(--ice); }
.kpi--widget .batt--hot .batt__pct { color: var(--hot); }

.kpi--widget .batt__pct {
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.kpi--widget .batt__hint { display: none; }

.kpi--widget .batt--bare {
  gap: 4px;
  padding: 4px 2px;
}

.kpi--widget .batt__mark {
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.kpi--widget .batt__mark .icon {
  width: 14px;
  height: 14px;
}

.dash-add-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px 12px;
}

.dash-add-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.dash-add-item:hover {
  background: var(--lime);
  color: var(--btn-ink);
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.profile-layout > .card + .card,
.profile-aside > .card + .card {
  margin-top: 0;
}

.profile-main {
  padding: 16px;
  min-width: 0;
}

.profile-main__top {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.profile-main__fold {
  margin-left: auto;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 10px;
}

.profile-main__fold .icon {
  transition: transform 0.18s ease;
  transform: rotate(-90deg);
}

.profile-main__fold.is-open .icon {
  transform: rotate(0deg);
}

.profile-main__body {
  display: grid;
  gap: 10px;
  padding-top: 16px;
}

.profile-main.is-collapsed .profile-main__body {
  display: none;
}

.profile-block__title {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}

.profile-block__title:first-child {
  margin-top: 0;
}

.profile-aside {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.profile-theme {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.profile-theme .theme-toggle {
  margin: 0;
}

.profile-aside .profile-logout {
  display: none;
}

.profile-logout-mobile {
  width: 100%;
}

@media (min-width: 1024px) {
  .profile-logout-mobile {
    display: none;
  }
}

@media (max-width: 720px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

.profile-contacts__col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-about__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px;
}

.profile-card__who { min-width: 0; }

.profile-card__facts {
  min-width: 0;
  display: grid;
  gap: 6px;
  flex: 1;
}

.profile-card__fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.profile-card__fact-label {
  color: var(--text-muted);
  font-weight: 600;
}

.profile-card__fact-value {
  color: var(--text);
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .profile-card__fact {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.profile-acc { padding: 0; overflow: hidden; }

.profile-acc__btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}

.profile-acc__chevron {
  display: grid;
  place-items: center;
  transition: transform 0.18s ease;
}

.profile-acc__btn--open .profile-acc__chevron {
  transform: rotate(180deg);
}

.profile-acc .profile-fields {
  padding: 0 14px 14px;
  gap: 8px;
}

.profile-card__role {
  margin: 2px 0 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.profile-card__avatar {
  width: 56px;
  height: 56px;
  font-size: 16px;
}

.profile-card__avatar-btn {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}

.profile-card__cam {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--on-lime);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.profile-card__mail,
.profile-card__dash {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
}

.profile-fields {
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px;
}

.profile-fields__row {
  display: grid;
  gap: 6px;
}

.profile-fields__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.profile-fields__value {
  margin: 0;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid #E4E6EA;
  background: #F4F5F7;
  color: #111411;
  font-size: 13px;
  line-height: 1.35;
}

.profile-fields__input,
.profile-fields__area {
  width: 100%;
  border: 1px solid #D5D8DE;
  border-radius: 10px;
  background: #F7F8FA;
  color: #111411;
  font: inherit;
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
}

.profile-fields__area { resize: vertical; min-height: 56px; }

.profile-fields__input::placeholder,
.profile-fields__area::placeholder {
  color: var(--text-muted);
}

.profile-fields__input:focus,
.profile-fields__area:focus {
  border-color: rgba(var(--lime-rgb), 0.7);
  background: #fff;
}

html[data-theme="dark"] .profile-fields__input,
html[data-theme="dark"] .profile-fields__area,
html[data-theme="dark"] .profile-fields__value {
  background: #F4F5F7;
  color: #111411;
  border-color: #D5D8DE;
}

.kv-product {
  display: inline;
  padding: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: inherit;
  background: transparent;
}

html[data-theme="dark"] .kv-product {
  color: inherit;
  background: transparent;
}

.contacts-list { display: grid; gap: 0; padding: 6px 0; }

.contacts-list__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.contacts-list__row:hover {
  background: rgba(var(--lime-rgb), 0.08);
}

.contacts-list__row:last-child { border-bottom: 0; }

.contacts-list__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(var(--lime-rgb), 0.14);
  color: var(--lime);
}

.contacts-list__label {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.contacts-list__value {
  margin: 2px 0 0;
  font-weight: 600;
}

.kv-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.kv-cell--best {
  background: #3F6F14;
  color: #FFFFFF;
  border-radius: 8px;
}

html[data-theme="dark"] .kv-cell--best,
html[data-theme="light"] .kv-cell--best {
  background: #3F6F14;
  color: #FFFFFF;
}

.kv-cell--tie {
  background: var(--ice);
  color: #FFFFFF;
  border-radius: 8px;
}

html[data-theme="dark"] .kv-cell--tie,
html[data-theme="light"] .kv-cell--tie {
  background: var(--ice);
  color: #FFFFFF;
}

.kv-table__insurer { font-weight: 600; }

.kv-wrap { overflow-x: auto; padding: 0; }

.kv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.kv-table th,
.kv-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.kv-table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kv-table__kv { font-weight: 600; color: var(--lime); }
.kv-table__note { color: var(--text-muted); white-space: normal; }

.kv-table__row { cursor: pointer; }
.kv-table__row:hover { background: rgba(var(--lime-rgb), 0.06); }

.chat-widget {
  position: relative;
  z-index: 260;
}

.chat-fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  z-index: 260;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--lime);
  color: var(--on-lime);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(var(--lime-rgb), 0.42);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(var(--lime-rgb), 0.5);
}

.chat-fab .icon {
  color: var(--on-lime);
  stroke: var(--on-lime);
}

.chat-widget__panel {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-h) + 80px + env(safe-area-inset-bottom));
  z-index: 260;
  width: min(380px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - var(--header-h) - var(--tabbar-h) - 100px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  animation: workspace-in 0.2s ease-out;
}

.chat-widget__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}

.chat-widget__title { font-size: 15px; }
.chat-widget__sub { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }

.chat-widget__close {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.chat-widget__body { padding: 12px 14px; }

.chat-widget__input {
  width: 100%;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
}

.chat-widget__input:focus { border-color: rgba(var(--lime-rgb), 0.5); }

.chat-widget__files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(var(--lime-rgb), 0.12);
  color: var(--text);
  font-size: 12px;
}

.chat-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.chat-chip__x {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.chat-widget__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 14px;
}

.chat-widget__attach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
}

.chat-widget__send { flex: 1; margin: 0; }

@keyframes workspace-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 420px) {
  .header__who-role { display: none; }
  .header__who-name { max-width: 112px; }
}

@media (max-width: 1023px) {
  .header {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .view {
    width: 100%;
    max-width: 100%;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .form-input,
  select,
  select.form-input,
  textarea,
  input.form-input,
  .search__input,
  .auth-form .form-input {
    font-size: 16px;
  }

  body.is-auth .view {
    padding: max(20px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(24px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }

  .auth-card {
    width: 100%;
    max-width: 420px;
    padding: 20px 16px 18px;
  }

  .legal-modal-backdrop {
    padding: 12px;
    align-items: stretch;
  }

  .legal-modal {
    max-height: min(92vh, 100%);
    border-radius: 16px;
  }

  .auth-links {
    flex-wrap: wrap;
  }

  .auth-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .avatar-video {
    min-height: 180px;
    max-height: 240px;
    aspect-ratio: 16 / 10;
  }

  .avatar-video__media {
    min-height: 180px;
  }

  .bento__kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sheet {
    max-width: 100%;
    max-height: min(92vh, 100%);
  }

  .card-docs__item {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .sticky-action .btn,
  .auth-submit,
  .btn--primary {
    min-height: 44px;
  }
}

@media (min-width: 1024px) {
  .bento {
    grid-template-columns: minmax(280px, 0.95fr) 1fr 1fr;
    grid-template-rows: minmax(360px, auto);
    align-items: stretch;
  }

  .bento__avatar {
    grid-column: 1;
    grid-row: 1;
    min-height: 360px;
    height: 100%;
    aspect-ratio: auto;
  }

  .avatar-video__media { min-height: 360px; }

  .bento__kpis {
    grid-column: 2 / span 2;
    grid-row: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    align-self: stretch;
  }

  .dash-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .chat-fab {
    right: 28px;
    bottom: 28px;
  }

  .chat-widget__panel {
    right: 28px;
    bottom: 96px;
  }
}

.tab--logout { display: none; }

html:has(body.is-auth),
body.is-auth,
html[data-theme="dark"] body.is-auth,
html[data-theme="light"] body.is-auth {
  display: block !important;
  background: var(--bg) !important;
}

body.is-auth .header,
body.is-auth .tabbar,
body.is-auth .chat-widget,
body.is-auth .chat-fab,
body.is-auth .aurora {
  display: none !important;
}

body.is-auth .view {
  display: grid;
  place-items: center;
  padding: 24px 16px;
  min-height: 100vh;
  width: 100%;
  max-width: none;
  margin: 0;
  background: transparent !important;
}

.auth-screen {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
}

.auth-screen--enter::before {
  content: '';
  position: absolute;
  width: min(520px, 90vw);
  height: min(520px, 90vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--lime-rgb), 0.2) 0%, transparent 68%);
  pointer-events: none;
  animation: introHalo 2.4s ease-out both;
}

.auth-screen--enter .auth-card {
  animation: introRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 22px 22px 20px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 4px;
  padding-top: 2px;
}

.auth-brand__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand__logo {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.auth-brand__logo .logo-img {
  width: 28px;
  height: 28px;
  display: block;
}

.auth-brand__title {
  margin: 0;
  display: flex;
  align-items: center;
  height: 40px;
  line-height: 1;
}

.auth-kicker {
  margin: 0 0 -6px 4px;
  line-height: 1;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  font-style: italic;
  transform: rotate(-6deg);
  transform-origin: left bottom;
  animation: authKickerLand 1.2s cubic-bezier(0.22, 0.82, 0.28, 1) both;
}

@keyframes authKickerLand {
  0% {
    transform: translateY(-34px) rotate(-6deg);
  }
  48% {
    transform: translateY(8px) rotate(-6deg) scaleY(0.78) scaleX(1.14);
  }
  68% {
    transform: translateY(-8px) rotate(-6deg) scaleY(1.08) scaleX(0.94);
  }
  84% {
    transform: translateY(2px) rotate(-6deg) scaleY(0.96) scaleX(1.04);
  }
  100% {
    transform: translateY(0) rotate(-6deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-kicker {
    animation: none;
  }
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.auth-field { display: flex; flex-direction: column; }

.auth-submit { width: 100%; margin-top: 8px; justify-content: center; }

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.auth-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--lime);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.auth-agrees {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.auth-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.auth-agree__box {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--lime);
  cursor: pointer;
}

.auth-agree__text {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-agree__text label {
  cursor: pointer;
}

.auth-agree-link {
  display: block;
  flex: 1;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  font-weight: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.auth-agree-link:hover {
  color: var(--lime);
}

.legal-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgba(var(--bg-rgb), 0.62);
}

.legal-modal {
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.legal-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
}

.legal-modal__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}

.legal-modal__close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: -6px -6px 0 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.legal-modal__close:hover {
  color: var(--text-body);
  background: rgba(var(--bg-rgb), 0.45);
}

.legal-modal__body {
  overflow: auto;
  padding: 0 18px 20px;
}

.legal-doc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.5;
}

.legal-doc__place,
.legal-doc__lead {
  margin: 0;
  color: var(--text-muted);
}

.legal-doc__place { font-style: italic; }

.legal-doc__h {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.legal-doc__p,
.legal-doc__list {
  margin: 0;
}

.legal-doc__list {
  padding-left: 18px;
}

.legal-doc__list li + li {
  margin-top: 8px;
}

.auth-legal {
  margin: 16px 0 0;
  text-align: center;
}

.auth-legal-link {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.auth-legal-link:hover,
.auth-legal-link:focus,
.auth-legal-link:focus-visible {
  color: var(--text-body);
  text-decoration: none;
  outline: none;
}

.privacy-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.privacy-actions .btn,
.privacy-actions .auth-submit {
  width: 100%;
  margin-top: 0;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

.kv-footnote {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
  font-style: italic;
  color: var(--text-muted);
}

.auth-card--wide {
  width: min(560px, 100%);
}

.privacy-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 18px;
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.45;
}

.privacy-body p { margin: 0; }

.admin-host { display: flex; flex-direction: column; gap: 14px; }

.admin-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-kpi {
  min-height: 104px;
  height: 100%;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.admin-kpi .kpi__value {
  font-size: 28px;
}

.admin-user + .admin-user {
  border-top: 1px solid var(--border);
}

.admin-user__head {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-user-detail {
  padding: 0 0 12px;
}

@media (max-width: 900px) {
  .admin-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.integ-card .auth-field { margin-top: 10px; }

.integ-list,
.integ-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 960px;
  align-items: stretch;
  justify-items: stretch;
}

.integ-card {
  margin: 0 !important;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  align-self: stretch;
  box-sizing: border-box;
  transform: none;
}

.integ-card > .btn {
  margin-top: auto;
}

.integ-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.integ-card__head .card__title {
  margin: 0;
  font-size: 15px;
}

.integ-card__icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(var(--bg-rgb), 0.55);
  color: var(--text);
  border: 1px solid var(--border);
}

html[data-theme="orange"] .integ-card__icon {
  background: rgba(var(--lime-rgb), 0.14);
  color: var(--lime);
  border-color: rgba(var(--lime-rgb), 0.3);
}

@media (max-width: 900px) {
  .integ-list,
  .integ-row {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
}

.profile-logout {
  margin-top: 24px;
}

@media (min-width: 1024px) {
  .tab--logout {
    display: flex;
    margin-top: auto;
    flex: 0 0 auto;
  }

  html[data-theme="light"] .tab--logout {
    color: #5A4038;
  }

  html[data-theme="dark"] .tab--logout {
    color: #E8C8C0;
  }
}

/* --------------------------------------------------------------- КАСКО */

.product-switch {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: 168px;
}

.header .product-switch {
  margin-right: 8px;
  order: 0;
}

.product-switch--dash {
  margin-top: 12px;
  width: 100%;
  max-width: 320px;
}

.product-switch--dash .product-switch__opt {
  padding: 10px 14px;
  font-size: 13px;
}

.screen-head .product-switch--dash {
  display: flex;
}

.product-switch__opt {
  flex: 1 1 0;
  border: 0;
  border-radius: 9px;
  padding: 8px 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.product-switch__opt--on {
  background: var(--lime);
  color: var(--btn-ink);
}

html[data-theme="dark"] .product-switch {
  border-color: rgba(226, 240, 204, 0.14);
  background: rgba(18, 20, 18, 0.55);
}

html[data-theme="dark"] .product-switch__opt:not(.product-switch__opt--on) {
  color: #E8EDE4;
}

.kasko-fields { gap: 10px; }

.kasko-notes {
  min-height: 72px;
  resize: vertical;
}

.kasko-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 16px;
}

.kasko-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(var(--lime-rgb), 0.12);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.kasko-offer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kasko-offer .offer-block__title,
.offer-block.kasko-offer > .offer-block__title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.kasko-offer .offer {
  cursor: default;
}

.kasko-upload {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

@media (min-width: 1024px) {
  .product-switch { display: none !important; }
}

@media (max-width: 1023px) {
  .product-switch { display: none !important; }

  .tabbar {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
  }

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

  .tabbar > .sidebar__brand,
  .tabbar > .tab--logout {
    display: none;
  }

  .tabbar > .sidebar__nav {
    display: flex;
    flex-direction: row;
    flex: 1 0 auto;
    min-width: 100%;
  }

  .tabbar .tab,
  .tabbar .tab-group {
    flex: 0 0 auto;
    min-width: 68px;
    width: auto;
  }

  .tab__label--short {
    font-size: 9px;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ---- Notion / Apple: dash, badges, subs, profile ---- */

/* Дашборд: одна колонка — заголовок и сетка KPI с общим левым краем (= «Д»). */
.dash,
.dash--clean {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-sizing: border-box;
}

.dash--clean .dash__title,
.dash--clean .screen-title {
  margin: 0;
  padding: 0;
  text-align: left;
  width: 100%;
  max-width: none;
}

.dash--clean .bento__kpis--compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  align-items: stretch;
  box-sizing: border-box;
}

.bento--dash {
  display: contents;
}

.bento__kpis--compact > .kpi,
.bento__kpis--compact > .kpi-wrap,
.bento__kpis--compact > .kpi--add,
.bento__kpis--compact > .kpi--widget,
.bento__kpis--compact > .kpi--widget-slot {
  min-height: 78px;
  height: auto;
  margin: 0;
  box-sizing: border-box;
  transform: none;
}

.bento__kpis--compact > .kpi-wrap {
  display: flex;
  min-height: 78px;
}

.bento__kpis--compact > .kpi-wrap > .kpi {
  flex: 1;
  min-height: 78px;
}

.bento__kpis--compact .kpi--add {
  min-height: 78px;
  justify-content: center;
  align-items: center;
  padding: 10px 12px;
}

.bento__kpis--compact .kpi--widget,
.bento__kpis--compact .kpi--widget-slot {
  grid-column: 1 / -1;
  min-height: 88px;
  padding: 10px 12px;
}

.bento__kpis--compact .kpi {
  border-color: var(--border);
}

.bento__kpis--compact .kpi:hover {
  border-color: var(--border-hi);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  transform: none;
}

html[data-theme="orange"] .bento__kpis--compact .kpi:hover {
  border-color: rgba(var(--lime-rgb), 0.45);
  box-shadow: 0 6px 16px rgba(232, 120, 48, 0.1);
  transform: none;
}

.btn--sm {
  padding: 8px 12px;
  font-size: 12px;
  gap: 6px;
}

.btn--plan {
  width: 100%;
  margin-top: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

.btn--plan:hover,
.btn--plan:focus-visible {
  border-color: var(--text-muted);
  background: rgba(var(--bg-rgb), 0.4);
  color: var(--text);
  outline: none;
  box-shadow: none;
}

.btn--plan-on,
.btn--plan-on:hover,
.btn--plan-on:focus-visible {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
  outline: none;
  box-shadow: none;
}

html[data-theme="dark"] .btn--plan:hover,
html[data-theme="dark"] .btn--plan:focus-visible {
  border-color: rgba(var(--lime-rgb), 0.55);
  background: rgba(var(--lime-rgb), 0.14);
  color: var(--lime);
}

html[data-theme="dark"] .btn--plan-on,
html[data-theme="dark"] .btn--plan-on:hover,
html[data-theme="dark"] .btn--plan-on:focus-visible {
  background: var(--lime);
  color: var(--on-lime);
  border-color: var(--lime);
}

html[data-theme="dark"] .subs__card--on {
  border-color: rgba(var(--lime-rgb), 0.55);
  box-shadow: 0 8px 22px rgba(var(--lime-rgb), 0.12);
}

html[data-theme="dark"] .subs__period-btn--on {
  background: rgba(var(--lime-rgb), 0.16);
  border-color: rgba(var(--lime-rgb), 0.4);
  color: var(--lime);
}

html[data-theme="dark"] .chip--active {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
}

/* Светлая тема: нейтральный серый active/hover, без салата. */
html[data-theme="light"] .chip--active {
  background: #E4E6EA;
  border-color: #C8CCD2;
  color: #1C2118;
}

@media (min-width: 1024px) {
  html[data-theme="light"] .tab:hover:not(:disabled),
  html[data-theme="light"] .tab--active {
    background: #E4E6EA;
    color: #1C2118;
  }

  html[data-theme="light"] .tab:hover:not(:disabled) .icon,
  html[data-theme="light"] .tab--active .icon {
    color: #1C2118;
    stroke: #1C2118;
  }

  html[data-theme="light"] .tab-sub__item:hover,
  html[data-theme="light"] .tab-sub__item--active {
    background: #E4E6EA;
    color: #1C2118;
  }
}

html[data-theme="light"] .btn--plan:hover,
html[data-theme="light"] .btn--plan:focus-visible {
  border-color: #C8CCD2;
  background: #ECEEF1;
  color: #1C2118;
}

html[data-theme="light"] .btn--plan-on,
html[data-theme="light"] .btn--plan-on:hover,
html[data-theme="light"] .btn--plan-on:focus-visible {
  background: #2A3128;
  color: #ffffff;
  border-color: #2A3128;
}

html[data-theme="light"] .subs__card--on {
  border-color: #C8CCD2;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
}

.clients-export {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.clients-export:empty { display: none; }

.clients-export__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 2px;
}

.date-field {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  min-width: 148px;
  max-width: 178px;
}

.date-field .clients-export__date {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  padding-right: 34px;
}

.date-field__toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.date-field__toggle:hover,
.date-field__toggle:focus-visible {
  color: var(--text);
  background: rgba(var(--lime-rgb), 0.14);
  outline: none;
}

html[data-theme="light"] .date-field__toggle:hover,
html[data-theme="light"] .date-field__toggle:focus-visible {
  background: #ECEEF1;
  color: #1C2118;
}

.date-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  width: 268px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--border-hi);
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  color: var(--text);
}

html[data-theme="light"] .date-pop {
  box-shadow: 0 12px 28px rgba(20, 24, 28, 0.12);
}

.date-pop__nav {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.date-pop__title {
  text-align: center;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.date-pop__nav-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

.date-pop__nav-btn:hover,
.date-pop__nav-btn:focus-visible {
  border-color: rgba(var(--lime-rgb), 0.5);
  background: rgba(var(--lime-rgb), 0.12);
  outline: none;
}

html[data-theme="light"] .date-pop__nav-btn:hover,
html[data-theme="light"] .date-pop__nav-btn:focus-visible {
  border-color: #C8CCD2;
  background: #ECEEF1;
}

.date-pop__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.date-pop__dow {
  display: grid;
  place-items: center;
  height: 24px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.date-pop__day {
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  padding: 0;
}

.date-pop__day--pad {
  visibility: hidden;
  pointer-events: none;
}

.date-pop__day:hover:not(.date-pop__day--on),
.date-pop__day:focus-visible:not(.date-pop__day--on) {
  background: rgba(var(--lime-rgb), 0.14);
  outline: none;
}

html[data-theme="light"] .date-pop__day:hover:not(.date-pop__day--on),
html[data-theme="light"] .date-pop__day:focus-visible:not(.date-pop__day--on) {
  background: #ECEEF1;
}

.date-pop__day--on {
  background: var(--lime);
  color: var(--on-lime);
  font-weight: 650;
}

html[data-theme="light"] .date-pop__day--on {
  background: #E4E6EA;
  color: #1C2118;
  border: 1px solid #C8CCD2;
}

.date-pop__day--today:not(.date-pop__day--on) {
  box-shadow: inset 0 0 0 1px rgba(var(--lime-rgb), 0.55);
  color: var(--lime-hi);
}

html[data-theme="light"] .date-pop__day--today:not(.date-pop__day--on) {
  box-shadow: inset 0 0 0 1px #C8CCD2;
  color: #1C2118;
}

.date-pop__today {
  margin-top: 8px;
  width: 100%;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--lime);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.date-pop__today:hover,
.date-pop__today:focus-visible {
  background: rgba(var(--lime-rgb), 0.14);
  outline: none;
}

html[data-theme="light"] .date-pop__today {
  color: #1C2118;
}

html[data-theme="light"] .date-pop__today:hover,
html[data-theme="light"] .date-pop__today:focus-visible {
  background: #ECEEF1;
}

.clients-export__date {
  width: auto;
  min-width: 140px;
  max-width: 168px;
  padding: 8px 10px;
  font-size: 13px;
  accent-color: var(--lime);
  caret-color: var(--lime);
}

.clients-export__date:focus,
.clients-export__date:focus-visible {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 2px rgba(var(--lime-rgb), 0.28);
}

.clients-export__date::selection {
  background: rgba(var(--lime-rgb), 0.35);
  color: var(--text);
}

html[data-theme="light"] .clients-export__date {
  accent-color: #6B7168;
  caret-color: #2A3128;
}

html[data-theme="light"] .clients-export__date:focus,
html[data-theme="light"] .clients-export__date:focus-visible {
  border-color: #9AA0A6;
  box-shadow: 0 0 0 2px rgba(20, 24, 28, 0.12);
}

html[data-theme="light"] .clients-export__date::selection {
  background: rgba(20, 24, 28, 0.14);
  color: #142016;
}

html[data-theme="orange"] .clients-export__date {
  accent-color: var(--lime);
  caret-color: var(--lime);
}

html[data-theme="orange"] .clients-export__date:focus,
html[data-theme="orange"] .clients-export__date:focus-visible {
  border-color: var(--lime);
  box-shadow: 0 0 0 2px rgba(var(--lime-rgb), 0.28);
}

html[data-theme="orange"] .clients-export__date::selection {
  background: rgba(var(--lime-rgb), 0.28);
  color: var(--text);
}

.clients-export__dash {
  color: var(--text-muted);
  font-size: 13px;
}

.clients-export__btn {
  min-width: 108px;
  padding-left: 14px;
  padding-right: 14px;
  border-color: rgba(20, 24, 28, 0.55);
  background: var(--btn-rest);
  color: var(--btn-rest-ink);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.clients-export__btn .icon {
  color: inherit;
  stroke: currentColor;
}

html[data-theme="dark"] .clients-export__btn {
  border-color: rgba(226, 240, 204, 0.28);
}

html[data-theme="orange"] .clients-export__btn {
  border-color: rgba(42, 28, 18, 0.55);
}

.clients-export__btn:hover:not(:disabled),
.clients-export__btn:focus-visible {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--on-lime);
  outline: none;
}

html[data-theme="light"] .clients-export__btn:hover:not(:disabled),
html[data-theme="light"] .clients-export__btn:focus-visible {
  border-color: #C8CCD2;
  background: #E4E6EA;
  color: #1C2118;
}

html[data-theme="dark"] .clients-export__btn:hover:not(:disabled),
html[data-theme="dark"] .clients-export__btn:focus-visible {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--on-lime);
}

html[data-theme="orange"] .clients-export__btn:hover:not(:disabled),
html[data-theme="orange"] .clients-export__btn:focus-visible {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--on-lime);
}

.clients-head {
  margin-bottom: 4px;
}

.integ-card .form-input:focus,
.integ-card .form-input:focus-visible {
  border-color: var(--text-muted);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
  outline: none;
}

html[data-theme="dark"] .integ-card .form-input:focus,
html[data-theme="dark"] .integ-card .form-input:focus-visible {
  border-color: var(--border-hi);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

html[data-theme="orange"] .integ-card .form-input:focus,
html[data-theme="orange"] .integ-card .form-input:focus-visible {
  border-color: var(--lime);
  box-shadow: 0 0 0 2px rgba(var(--lime-rgb), 0.22);
}

.integ-list,
.integ-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 960px;
  align-items: stretch;
  justify-items: stretch;
}

.integ-card {
  margin: 0 !important;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  align-self: stretch;
  box-sizing: border-box;
  transform: none;
}

.integ-card > .btn {
  margin-top: auto;
}

.integ-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  min-height: 32px;
}

.integ-card__head .card__title {
  margin: 0;
  font-size: 15px;
}

.integ-card__icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(var(--bg-rgb), 0.55);
  color: var(--text);
  border: 1px solid var(--border);
}

html[data-theme="orange"] .integ-card__icon {
  background: rgba(var(--lime-rgb), 0.14);
  color: var(--lime);
  border-color: rgba(var(--lime-rgb), 0.3);
}

@media (max-width: 900px) {
  .integ-list,
  .integ-row {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
}

.badge--product {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge--osago {
  background: rgba(var(--bg-rgb), 0.55);
  color: var(--text);
  border: 1px solid var(--border);
}

html[data-theme="orange"] .badge--osago {
  background: rgba(var(--lime-rgb), 0.16);
  border-color: rgba(var(--lime-rgb), 0.35);
}

.badge--kasko {
  background: rgba(232, 120, 48, 0.16);
  color: #C45A18;
  border: 1px solid rgba(232, 120, 48, 0.35);
}

html[data-theme="dark"] .badge--kasko {
  color: #FFB078;
}

.client-row__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.profile-layout--stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 240px));
  gap: 12px;
  max-width: 504px;
  align-items: start;
  transition: max-width 0.28s ease;
}

.profile-main--stack,
.profile-theme {
  width: 100%;
  max-width: 240px;
  min-height: 92px;
  box-sizing: border-box;
  padding: 12px 14px;
  overflow: hidden;
  transition: max-width 0.28s ease, height 0.28s ease;
}

.profile-main--stack.is-collapsed {
  height: 92px;
  min-height: 92px;
}

.profile-theme {
  height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.profile-theme .profile-block__title { margin: 0; }

.profile-theme .theme-toggle {
  margin: 0;
  gap: 4px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-theme .theme-opt {
  padding: 8px 4px;
  font-size: 11px;
  border-radius: 8px;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
}

.profile-theme .theme-opt span {
  font-size: 10px;
  line-height: 1.1;
}

.profile-theme .theme-opt--active {
  border-color: var(--border-hi);
  background: rgba(var(--bg-rgb), 0.45);
  color: var(--text);
}

.profile-theme .theme-opt--active.theme-opt--light .icon {
  color: #C6F031;
  stroke: #C6F031;
}

.profile-theme .theme-opt--active.theme-opt--dark {
  background: #1a1a1a;
  border-color: #2a2a2a;
  color: #f5f5f5;
}

.profile-theme .theme-opt--active.theme-opt--dark .icon {
  color: #ffffff;
  stroke: #ffffff;
}

.profile-theme .theme-opt--active.theme-opt--orange .icon {
  color: #E87830;
  stroke: #E87830;
}

html[data-theme="orange"] .profile-theme .theme-opt--active.theme-opt--orange {
  border-color: rgba(232, 120, 48, 0.45);
  background: rgba(232, 120, 48, 0.12);
}

html[data-theme="orange"] .profile-theme .theme-opt--active {
  border-color: var(--border-hi);
  background: rgba(var(--bg-rgb), 0.45);
}

.profile-main--stack .profile-main__top {
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.profile-main--stack .profile-card__who {
  min-width: 0;
  flex: 1;
}

.profile-main--stack .card__title {
  font-size: 14px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-main--stack .profile-card__role {
  margin: 2px 0 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-main--stack .profile-main__body {
  display: grid;
  gap: 10px;
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  overflow: hidden;
  transition: max-height 0.32s ease, opacity 0.22s ease, padding 0.28s ease;
}

.profile-main--stack.is-open .profile-main__body {
  max-height: 720px;
  opacity: 1;
  padding-top: 12px;
}

.profile-main--stack.is-collapsed .profile-main__body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
}

.profile-layout--stack.is-profile-open {
  grid-template-columns: minmax(0, 1fr);
  max-width: 480px;
}

.profile-layout--stack.is-profile-open .profile-main--stack,
.profile-layout--stack.is-profile-open .profile-theme,
.profile-layout--stack.is-profile-open .profile-logout-mobile {
  max-width: none;
  width: 100%;
  height: auto;
  min-height: 0;
}

.profile-layout--stack.is-profile-open .profile-theme {
  justify-content: flex-start;
  padding-top: 14px;
  padding-bottom: 14px;
}

.profile-layout--stack.is-profile-open .profile-theme .theme-toggle {
  grid-template-columns: 1fr;
}

.profile-layout--stack.is-profile-open .profile-theme .theme-opt {
  flex-direction: row;
  justify-content: flex-start;
  padding: 10px 12px;
  font-size: 13px;
}

.profile-layout--stack.is-profile-open .profile-theme .theme-opt span {
  font-size: 13px;
}

.profile-card__fact--id .profile-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.profile-fields__row--region {
  display: grid;
  gap: 6px;
}

.profile-logout-mobile {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 240px;
}

.contacts-grid {
  display: grid;
  gap: 10px;
  max-width: 360px;
}

.contacts-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.contacts-card:hover {
  border-color: var(--border-hi);
  background: rgba(var(--bg-rgb), 0.35);
}

html[data-theme="orange"] .contacts-card:hover {
  border-color: rgba(var(--lime-rgb), 0.4);
  background: rgba(var(--lime-rgb), 0.08);
}

.contacts-card__icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(var(--bg-rgb), 0.55);
  color: var(--text);
  border: 1px solid var(--border);
}

html[data-theme="orange"] .contacts-card__icon {
  background: rgba(var(--lime-rgb), 0.14);
  color: var(--lime);
  border-color: rgba(var(--lime-rgb), 0.3);
}

.contacts-card__label {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.contacts-card__value {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.subs {
  display: grid;
  gap: 14px;
  max-width: 960px;
}

.subs__period {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  max-width: 320px;
}

.subs__period-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.subs__period-btn--on {
  background: rgba(var(--bg-rgb), 0.55);
  color: var(--text);
  border: 1px solid var(--border);
}

html[data-theme="orange"] .subs__period-btn--on {
  background: rgba(var(--lime-rgb), 0.16);
  border-color: rgba(var(--lime-rgb), 0.35);
}

.subs__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  justify-items: stretch;
}

.subs__card {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 10px;
  margin: 0 !important;
  padding: 14px;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  align-content: stretch;
  box-sizing: border-box;
  transform: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  border-color: var(--border);
  box-shadow: none;
}

.subs__card .card__title {
  margin: 0;
  font-size: 15px;
}

.subs__card--on {
  margin: 0 !important;
  padding: 14px;
  transform: none !important;
  border-color: var(--border-hi);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
}

html[data-theme="orange"] .subs__card--on {
  border-color: rgba(var(--lime-rgb), 0.5);
  box-shadow: 0 8px 22px rgba(232, 120, 48, 0.12);
}

html[data-theme="dark"] .subs__card--on {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.subs__price { text-align: left; }

.subs__price strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.subs__price span {
  font-size: 11px;
  color: var(--text-muted);
}

.subs__blurb {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  min-height: 2.7em;
}

.subs__perks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  align-content: start;
}

.subs__perks li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--text-body);
  line-height: 1.35;
}

.subs__perks .icon {
  margin-top: 2px;
  color: var(--text-muted);
  flex: 0 0 auto;
}

html[data-theme="orange"] .subs__perks .icon {
  color: var(--lime);
}

.subs__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(var(--bg-rgb), 0.55);
  border: 1px solid var(--border);
}

.referral {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.referral__card {
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

.referral__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.referral .btn:focus,
.referral .btn:focus-visible,
.referral .btn--ghost:focus,
.referral .btn--ghost:focus-visible {
  outline: none;
  border-color: var(--border-hi);
  box-shadow: none;
}

html[data-theme="orange"] .referral .btn:hover,
html[data-theme="orange"] .referral .btn:focus-visible,
html[data-theme="orange"] .referral .btn--ghost:hover,
html[data-theme="orange"] .referral .btn--ghost:focus-visible {
  border-color: var(--lime);
  color: var(--lime);
  box-shadow: none;
  outline: none;
}

html[data-theme="orange"] .btn:hover:not(:disabled),
html[data-theme="orange"] .btn--ghost:hover:not(:disabled) {
  border-color: var(--lime);
}

html[data-theme="orange"] .btn:focus-visible,
html[data-theme="orange"] .btn--ghost:focus-visible,
html[data-theme="orange"] a:focus-visible,
html[data-theme="orange"] .card--tap:focus-visible {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 2px rgba(var(--lime-rgb), 0.28);
}

html[data-theme="orange"] :focus-visible {
  outline-color: var(--lime);
}

@media (min-width: 1024px) {
  html[data-theme="orange"] {
    --sidebar: #FFF8F2;
    --workspace: #FAF6F0;
  }

  html[data-theme="orange"] .header {
    background: rgba(255, 248, 242, 0.9);
    color: #2A1C12;
  }

  .bento--dash,
  .bento__kpis--compact,
  .dash--clean {
    max-width: 420px;
  }
}

@media (max-width: 900px) {
  .subs__row {
    grid-template-columns: 1fr;
    max-width: 360px;
    align-items: stretch;
  }

  .subs__card {
    min-height: 0;
  }

  .subs__blurb {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .dash--clean,
  .bento--dash,
  .bento__kpis--compact {
    max-width: none;
  }

  .profile-layout--stack {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .profile-main--stack,
  .profile-theme,
  .profile-logout-mobile {
    max-width: none;
  }

  .profile-main--stack.is-collapsed,
  .profile-theme {
    height: auto;
    min-height: 88px;
  }

  .contacts-grid,
  .referral {
    max-width: none;
  }

  .screen-head {
    flex-wrap: wrap;
    gap: 10px;
  }
}

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