/* ============================================================
   «Вместе» — единая дизайн-система

   Тёплая кремово-персиковая база, рукописные акценты,
   мягкие тени. Всё локально: ни одного внешнего запроса.
   ============================================================ */

/* ---------- Шрифты ---------- */
@font-face {
  font-family: 'Playfair';
  src: url('fonts/pf-cyrillic-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Playfair';
  src: url('fonts/pf-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+2000-206F,U+2122,U+2191,U+2193,U+2212,U+2215;
}
@font-face {
  font-family: 'Playfair';
  src: url('fonts/pf-cyrillic-500-normal.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Playfair';
  src: url('fonts/pf-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+2000-206F,U+2122,U+2191,U+2193,U+2212,U+2215;
}
@font-face {
  font-family: 'Playfair';
  src: url('fonts/pf-cyrillic-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Playfair';
  src: url('fonts/pf-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+2000-206F,U+2122,U+2191,U+2193,U+2212,U+2215;
}
@font-face {
  font-family: 'Playfair';
  src: url('fonts/pf-cyrillic-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Playfair';
  src: url('fonts/pf-latin-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+2000-206F,U+2122,U+2191,U+2193,U+2212,U+2215;
}
@font-face {
  font-family: 'Playfair';
  src: url('fonts/pf-cyrillic-500-italic.woff2') format('woff2');
  font-weight: 500; font-style: italic; font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Playfair';
  src: url('fonts/pf-latin-500-italic.woff2') format('woff2');
  font-weight: 500; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+2000-206F,U+2122,U+2191,U+2193,U+2212,U+2215;
}
@font-face {
  font-family: 'Caveat';
  src: url('fonts/cv-cyrillic-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Caveat';
  src: url('fonts/cv-latin-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+2000-206F,U+2122,U+2191,U+2193,U+2212,U+2215;
}

/* ---------- Токены ---------- */
:root {
  /* Тёплая кремовая база */
  --bg:            #fdf9f4;
  --bg-warm:       #faf3ea;
  --surface:       #ffffff;
  --surface-2:     #faf5ee;
  --surface-3:     #f4ece1;

  --ink:           #2f2a24;
  --ink-2:         #6d635a;
  --ink-3:         #a2968a;
  --ink-4:         #cec4b8;

  --line:          #eee5d8;
  --line-2:        #e3d7c6;

  /* Акценты — приглушённые, тёплые */
  --coral:         #e07a5f;
  --coral-2:       #cd6549;
  --coral-soft:    #fbe7de;
  --coral-glow:    #f9d5c6;

  --rose:          #d4788f;
  --rose-soft:     #fbe4ea;

  --sage:          #7fa382;
  --sage-soft:     #e2eede;

  --ochre:         #d9a441;
  --ochre-soft:    #fbf0d5;

  --lav:           #9b8ec4;
  --lav-soft:      #ece7f8;

  --sky:           #6fa3c7;
  --sky-soft:      #e2eef7;

  --danger:        #c25a5a;
  --danger-soft:   #fae2e2;

  /* Формы */
  --r-sm:  10px;
  --r:     14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(47,42,36,.04), 0 3px 10px rgba(47,42,36,.04);
  --sh-2: 0 2px 6px rgba(47,42,36,.05), 0 12px 28px rgba(47,42,36,.07);
  --sh-3: 0 8px 24px rgba(47,42,36,.09), 0 32px 60px rgba(47,42,36,.10);
  --sh-warm: 0 8px 32px rgba(224,122,95,.12);

  --ease: cubic-bezier(.22,.61,.36,1);
  --dur: .22s;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, sans-serif;
  --serif: 'Playfair', Georgia, 'Times New Roman', serif;
  --hand: 'Caveat', 'Playfair', cursive;

  --w-page: 1120px;
  --w-narrow: 460px;
  --w-text: 680px;
}

[data-theme="dark"] {
  --bg:            #191614;
  --bg-warm:       #1e1a17;
  --surface:       #232019;
  --surface-2:     #2b261f;
  --surface-3:     #332d25;

  --ink:           #f4ede2;
  --ink-2:         #b3a695;
  --ink-3:         #7d7266;
  --ink-4:         #4a4239;

  --line:          #362f27;
  --line-2:        #453d33;

  --coral-soft:    #4a2c22;
  --coral-glow:    #5c372a;
  --rose-soft:     #46262f;
  --sage-soft:     #26352a;
  --ochre-soft:    #443619;
  --lav-soft:      #322c44;
  --sky-soft:      #22323f;
  --danger-soft:   #442525;

  --sh-1: 0 1px 2px rgba(0,0,0,.2), 0 3px 10px rgba(0,0,0,.18);
  --sh-2: 0 2px 6px rgba(0,0,0,.24), 0 12px 28px rgba(0,0,0,.28);
  --sh-3: 0 8px 24px rgba(0,0,0,.34), 0 32px 60px rgba(0,0,0,.4);
  --sh-warm: 0 8px 32px rgba(0,0,0,.35);
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--coral-glow); color: var(--ink); }

/* ---------- Типографика ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -.012em;
}
h1 { font-size: clamp(30px, 4.4vw, 50px); }
h2 { font-size: clamp(22px, 2.6vw, 30px); }
h3 { font-size: 19px; }
h4 { font-size: 16px; }

.hand {
  font-family: var(--hand);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: .004em;
}
.serif  { font-family: var(--serif); }
.italic { font-style: italic; }

.muted   { color: var(--ink-2); }
.dim     { color: var(--ink-3); }
.tiny    { font-size: 12.5px; }
.small   { font-size: 13.5px; }
.lead    { font-size: 17px; line-height: 1.62; color: var(--ink-2); }
.center  { text-align: center; }
.nowrap  { white-space: nowrap; }
.accent  { color: var(--coral); }

/* ---------- Раскладка ---------- */
.page      { max-width: var(--w-page);   margin-inline: auto; padding-inline: 20px; }
.narrow    { max-width: var(--w-narrow); margin-inline: auto; }
.textwidth { max-width: var(--w-text);   margin-inline: auto; }

.row  { display: flex; align-items: center; gap: 10px; }
.row-top { display: flex; align-items: flex-start; gap: 10px; }
.col  { display: flex; flex-direction: column; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.gap-sm { gap: 6px; }
.gap-lg { gap: 18px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 16px; }

.stack > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 26px; }

.hidden { display: none !important; }

/* ---------- Карточки ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
}
.card-lg { padding: 30px; border-radius: var(--r-lg); }
.card-soft { background: var(--surface-2); border-color: transparent; }
.card-raised { box-shadow: var(--sh-2); }
.card-hover { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--dur) var(--ease);
  border: 1px solid transparent;
  min-height: 42px;
  user-select: none;
}
.btn:active { transform: scale(.985); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #000; box-shadow: var(--sh-2); }
[data-theme="dark"] .btn-primary { background: var(--coral); color: #fff; }
[data-theme="dark"] .btn-primary:hover { background: var(--coral-2); }

.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { background: var(--coral-2); box-shadow: var(--sh-warm); }

.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-2); }

.btn-quiet { background: transparent; color: var(--ink-2); padding: 8px 12px; min-height: 36px; }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }

.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 7px 14px; font-size: 13px; min-height: 34px; }
.btn-lg { padding: 15px 30px; font-size: 16px; min-height: 50px; }
.btn-block { width: 100%; }
.btn-icon {
  padding: 0; width: 36px; height: 36px; min-height: 36px;
  border-radius: var(--r-sm); color: var(--ink-3);
}
.btn-icon:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Поля ввода ---------- */
.field { display: block; }
.field + .field { margin-top: 15px; }
.label {
  display: block;
  font-size: 13.5px; font-weight: 600;
  margin-bottom: 6px;
}
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; }
.hint-err { color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 15px;
  color: var(--ink);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  min-height: 44px;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a2968a' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.input-mono {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: .09em;
}

/* Индикатор стойкости пароля */
.meter { display: flex; gap: 4px; margin-top: 8px; }
.meter i {
  height: 4px; flex: 1; border-radius: 2px;
  background: var(--line-2);
  transition: background var(--dur) var(--ease);
}
.meter[data-score="1"] i:nth-child(1) { background: var(--danger); }
.meter[data-score="2"] i:nth-child(-n+2) { background: var(--ochre); }
.meter[data-score="3"] i:nth-child(-n+3) { background: var(--sage); }
.meter[data-score="4"] i { background: var(--sage); }

/* ---------- Чипы и метки ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--ink-2);
  white-space: nowrap;
}
.chip-coral { background: var(--coral-soft); color: var(--coral-2); }
.chip-rose  { background: var(--rose-soft);  color: var(--rose); }
.chip-sage  { background: var(--sage-soft);  color: var(--sage); }
.chip-ochre { background: var(--ochre-soft); color: #a8791f; }
.chip-lav   { background: var(--lav-soft);   color: var(--lav); }
.chip-sky   { background: var(--sky-soft);   color: var(--sky); }
.chip-danger{ background: var(--danger-soft);color: var(--danger); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.dot-live { animation: pulse 2.2s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ---------- Аватары ---------- */
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700;
  background: var(--coral-soft); color: var(--coral-2);
  border: 2px solid var(--surface);
  flex: 0 0 auto;
  text-transform: uppercase;
}
.avatar-b { background: var(--sage-soft); color: var(--sage); }
.avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.avatar-lg { width: 44px; height: 44px; font-size: 17px; }
.avatars { display: flex; }
.avatars .avatar + .avatar { margin-left: -9px; }

/* ---------- Иконка раздела ---------- */
.ico {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  background: var(--surface-3); color: var(--ink-2);
}
.ico svg { width: 18px; height: 18px; }
.ico-coral { background: var(--coral-soft); color: var(--coral-2); }
.ico-rose  { background: var(--rose-soft);  color: var(--rose); }
.ico-sage  { background: var(--sage-soft);  color: var(--sage); }
.ico-ochre { background: var(--ochre-soft); color: #a8791f; }
.ico-lav   { background: var(--lav-soft);   color: var(--lav); }
.ico-sky   { background: var(--sky-soft);   color: var(--sky); }
.ico-lg { width: 46px; height: 46px; border-radius: var(--r); }
.ico-lg svg { width: 23px; height: 23px; }

/* ---------- Чекбокс ---------- */
.check {
  width: 21px; height: 21px;
  border: 1.6px solid var(--ink-4);
  border-radius: 6px;
  flex: 0 0 auto;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--dur) var(--ease);
  background: var(--surface);
}
.check:hover { border-color: var(--sage); }
.check.on {
  background: var(--sage); border-color: var(--sage);
  color: #fff;
}
.check.on::after {
  content: '';
  width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px,-1px);
}

/* ---------- Прогресс ---------- */
.bar {
  height: 7px; border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}
.bar i {
  display: block; height: 100%; border-radius: 4px;
  background: var(--coral);
  transition: width .5s var(--ease);
}
.bar-sage i  { background: var(--sage); }
.bar-ochre i { background: var(--ochre); }
.bar-lav i   { background: var(--lav); }
.bar-sky i   { background: var(--sky); }
.bar-rose i  { background: var(--rose); }
.bar-danger i{ background: var(--danger); }

/* ---------- Пустые состояния ---------- */
.empty {
  padding: 34px 22px;
  text-align: center;
  color: var(--ink-3);
}
.empty .emoji { font-size: 32px; line-height: 1; margin-bottom: 12px; opacity: .8; }
.empty .title {
  font-family: var(--hand);
  font-size: 23px;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.empty .sub { font-size: 13.5px; max-width: 300px; margin-inline: auto; line-height: 1.55; }

/* ---------- Заметка/подсказка ---------- */
.note {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 17px;
  border-radius: var(--r);
  font-size: 13.8px;
  line-height: 1.55;
  background: var(--surface-2);
  color: var(--ink-2);
}
.note svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.note b, .note strong { color: var(--ink); font-weight: 600; }
.note-coral { background: var(--coral-soft); color: #8a4a35; }
.note-coral svg, .note-coral b { color: var(--coral-2); }
.note-sage  { background: var(--sage-soft);  color: #47603f; }
.note-sage svg, .note-sage b { color: var(--sage); }
.note-ochre { background: var(--ochre-soft); color: #7d5f16; }
.note-ochre svg, .note-ochre b { color: #a8791f; }
.note-danger{ background: var(--danger-soft);color: #8e3d3d; }
.note-danger svg, .note-danger b { color: var(--danger); }

/* ---------- Модальные окна ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(35,30,25,.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  z-index: 200;
  animation: fade .18s var(--ease);
}
.overlay.on { display: flex; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 28px;
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  box-shadow: var(--sh-3);
  animation: rise .24s var(--ease);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(.985) }
  to   { opacity: 1; transform: none }
}
.modal-wide { max-width: 620px; }
.modal h3 { margin-bottom: 6px; }
.modal .sub { color: var(--ink-2); font-size: 14px; margin-bottom: 20px; }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ---------- Уведомления ---------- */
.toasts {
  position: fixed;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 400px;
}
.toast {
  padding: 11px 18px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--sh-2);
  animation: toastIn .26s var(--ease);
  display: flex; align-items: center; gap: 9px;
  max-width: 100%;
}
.toast svg { width: 16px; height: 16px; flex: 0 0 auto; }
.toast.out { animation: toastOut .22s var(--ease) forwards; }
.toast-ok  { background: var(--sage); color: #fff; }
.toast-err { background: var(--danger); color: #fff; }
@keyframes toastIn  { from { opacity:0; transform: translateY(12px) } to { opacity:1; transform:none } }
@keyframes toastOut { to { opacity:0; transform: translateY(8px) } }

/* ---------- Загрузка ---------- */
.spin {
  width: 17px; height: 17px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg) } }

.loading-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  background: var(--bg);
  z-index: 500;
  color: var(--ink-2);
  font-size: 14px;
}
.loading-screen .hand { font-size: 30px; color: var(--coral); }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { to { background-position: -200% 0 } }

/* ---------- Разделитель ---------- */
.hr { height: 1px; background: var(--line); border: 0; margin: 22px 0; }
.divider {
  display: flex; align-items: center; gap: 14px;
  color: var(--ink-3); font-size: 12.5px;
  margin: 20px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

/* ---------- Адаптив ---------- */
@media (max-width: 860px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .page { padding-inline: 15px; }
  .card { padding: 18px; border-radius: var(--r); }
  .card-lg { padding: 22px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .modal { padding: 22px 18px; border-radius: var(--r); }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .btn { min-height: 44px; }
  .toasts { bottom: 14px; }
}

/* Безопасные зоны на телефонах с вырезом */
@supports (padding: max(0px)) {
  body { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
}

/* ---------- Печать ---------- */
@media print {
  .no-print, .toasts, .overlay { display: none !important; }
  body { background: #fff; }
}
