:root {
  --bg: #0f1720;
  --bg-soft: #16212d;
  --card: #1b2836;
  --card-2: #213243;
  --line: #2b3d4f;
  --text: #e8eef4;
  --muted: #8da3b8;
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --danger: #f87171;
  --green: #34d399;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #16303a 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Навигация ── */
.nav {
  display: flex; align-items: center;
  gap: 8px 14px; padding: 14px 18px; max-width: 880px; margin: 0 auto; flex-wrap: wrap;
}
.brand { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-right: auto; white-space: nowrap; }
.brand span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-account { display: flex; align-items: center; gap: 8px; }
.nav-link { color: var(--muted); font-size: 14px; padding: 6px 10px; border-radius: 10px; }
.nav-link:hover { color: var(--text); background: var(--bg-soft); }
.nav-link.muted { opacity: 0.7; }
.nav-user { display: flex; align-items: center; gap: 9px; background: var(--card); padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--line); }
.nav-user:hover { border-color: var(--accent); }
.nav-user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.nav-name { font-size: 13px; font-weight: 600; }
.nav-bal { font-size: 12px; color: var(--muted); }
.nav-bal.neg { color: var(--danger); }
.nav-bal.pos { color: var(--green); }

.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--card-2); font-weight: 700; }
.avatar-ph { color: var(--accent); }
.avatar-lg { width: 64px; height: 64px; font-size: 26px; }

/* ── Контейнер ── */
.container { max-width: 880px; margin: 0 auto; padding: 8px 18px 80px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0 40px; }

/* ── Flash ── */
.flash { max-width: 844px; margin: 4px auto; padding: 11px 16px; border-radius: 12px; font-size: 14px; }
.flash-ok { background: rgba(45, 212, 191, 0.12); color: var(--accent); border: 1px solid rgba(45, 212, 191, 0.3); }
.flash-err { background: rgba(248, 113, 113, 0.12); color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.3); }

/* ── Hero ── */
.hero { padding: 18px 4px 22px; }
.hero h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -0.03em; }
.hero .sub { margin: 0; color: var(--muted); max-width: 520px; }

/* ── Сетка карточек ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

.trip-card { display: flex; flex-direction: column; gap: 8px; transition: transform 0.12s ease, border-color 0.12s ease; }
.trip-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.trip-dates { display: flex; align-items: baseline; gap: 8px; }
.date-range { font-weight: 700; font-size: 18px; }
.date-range.big { font-size: 24px; }
.date-dow { font-size: 12px; color: var(--muted); text-transform: lowercase; }
.trip-card h3 { margin: 0; font-size: 17px; }
.trip-desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trip-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 10px; }
.price { font-weight: 700; }
.price .per { font-weight: 400; color: var(--muted); font-size: 12px; }
.seats { font-size: 13px; color: var(--green); background: rgba(52, 211, 153, 0.12); padding: 3px 9px; border-radius: 999px; }
.seats.low { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }
.seats.full { color: var(--muted); background: var(--bg-soft); }

.empty { color: var(--muted); padding: 24px; text-align: center; background: var(--bg-soft); border-radius: var(--radius); border: 1px dashed var(--line); }
.empty a { color: var(--accent); }

/* ── Деталь сплава ── */
.back { color: var(--muted); font-size: 14px; display: inline-block; margin: 6px 0 14px; }
.back:hover { color: var(--text); }
.trip-detail-head { display: flex; align-items: center; gap: 12px; }
.trip-detail h1 { margin: 8px 0; font-size: 28px; letter-spacing: -0.02em; }
.lead { color: var(--muted); font-size: 15px; max-width: 560px; }
.badge { font-size: 12px; color: var(--accent); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; text-transform: lowercase; }
.facts { display: flex; gap: 12px; margin: 18px 0; flex-wrap: wrap; }
.fact { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.fact-k { font-size: 12px; color: var(--muted); }
.fact-v { font-size: 18px; font-weight: 700; }
.fact-v.neg { color: var(--danger); }

/* ── Формы ── */
.book-form { max-width: 460px; margin-top: 10px; }
.book-form h3 { margin: 0 0 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; color: var(--muted); }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 11px; padding: 11px 13px; font-size: 15px; font-family: inherit; width: 100%; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.check input { width: auto; }
.total-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.total-row strong { font-size: 22px; color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 4px 0; }
.cta-box { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--muted); }

/* ── Кнопки ── */
.btn { cursor: pointer; border: none; border-radius: 11px; padding: 12px 18px; font-size: 15px; font-weight: 600; font-family: inherit; }
.btn-primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #06222b; width: 100%; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-ghost.danger:hover { color: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ── Профиль ── */
.profile-head { display: flex; align-items: center; gap: 16px; margin: 14px 0 18px; }
.profile-head h1 { margin: 0; font-size: 24px; }
.balance-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.balance-card.neg { border-color: rgba(248, 113, 113, 0.4); }
.balance-card.pos { border-color: rgba(52, 211, 153, 0.4); }
.balance-label { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.balance-amount { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; }
.balance-card.neg .balance-amount { color: var(--danger); }
.balance-card.pos .balance-amount { color: var(--green); }
.balance-note { font-size: 13px; color: var(--muted); }

.section-title { font-size: 18px; margin: 26px 0 12px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 13px 16px; }
.row-muted { opacity: 0.55; }
.row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-main strong { font-size: 15px; }
.row-side { display: flex; align-items: center; gap: 10px; }
.amount { font-weight: 700; }
.amount.neg { color: var(--danger); }
.amount.pos { color: var(--green); }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.neg { color: var(--danger); }
.pos { color: var(--green); }

.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.tag-green { background: rgba(52, 211, 153, 0.14); color: var(--green); }
.chat-badge { display: inline-block; vertical-align: middle; font-size: 12px; font-weight: 700; color: #fb923c; background: rgba(251, 146, 60, 0.14); border: 1px solid rgba(251, 146, 60, 0.4); padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tag-grey { background: var(--bg-soft); color: var(--muted); }

/* ── Админка ── */
.admin-block { margin: 22px 0; }
.admin-block h2 { font-size: 18px; margin: 0 0 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 0; }
.admin-trip { margin-bottom: 12px; }
.admin-trip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-trip-head strong { margin-right: 8px; }
.admin-trip-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-trip-actions form { display: inline; }
.bookings-mini { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.bm-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.bm-row form { display: inline; }
.bm-name { flex: 1; min-width: 0; }
.bm-amount { white-space: nowrap; }
.btn-paid { background: rgba(52, 211, 153, 0.16); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.4); }
.btn-paid:hover { background: rgba(52, 211, 153, 0.24); }
.narrow { max-width: 420px; margin: 30px auto; }

/* ── Анонсы ── */
.announce { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 18px; }
.ann { display: flex; gap: 12px; background: linear-gradient(100deg, rgba(45,212,191,0.1), rgba(56,189,248,0.06)); border: 1px solid rgba(45,212,191,0.28); border-radius: var(--radius); padding: 14px 16px; }
.ann-pin { font-size: 18px; line-height: 1.3; }
.ann-body { min-width: 0; }
.ann-body h3 { margin: 0 0 4px; font-size: 16px; }
.ann-body p { margin: 0; color: var(--text); white-space: pre-wrap; line-height: 1.5; word-break: break-word; }

/* ── Календарь (компактный) ── */
.cal { margin: 8px 0 26px; padding: 16px; }
.cal-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 14px; }
.cal-label { margin: 0; font-size: 19px; text-transform: capitalize; min-width: 170px; text-align: center; }
.cal-nav { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; font-size: 22px; line-height: 1; color: var(--text); }
.cal-nav:hover { border-color: var(--accent); color: var(--accent); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 5px; }
.cal-weekdays span { text-align: center; font-size: 11px; color: var(--muted); }
.cal-grid-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cd { height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 9px; font-size: 14px; font-weight: 500; background: var(--bg-soft); color: var(--muted); border: 1px solid transparent; font-family: inherit; }
.cd.out { opacity: 0.3; }
.cd.we { background: #182533; }
.cd.today { border-color: var(--accent); color: var(--accent); font-weight: 700; }
button.cd.can-add { cursor: pointer; }
button.cd.can-add:hover { background: var(--card-2); border-color: var(--accent); color: var(--text); }
/* дни сплавов — подкрашены, кликабельны */
.cd.trip { color: #06222b; font-weight: 700; }
.cd.trip.free { background: var(--accent); }
.cd.trip.low { background: #fbbf24; }
.cd.trip.full { background: var(--card-2); color: var(--muted); border-color: var(--line); }
.cd.trip:hover { filter: brightness(1.1); }
/* скругление только по краям диапазона, середина «склеена» */
.cd.trip:not(.st) { border-top-left-radius: 2px; border-bottom-left-radius: 2px; }
.cd.trip:not(.en) { border-top-right-radius: 2px; border-bottom-right-radius: 2px; }
.cal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.cal-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.cal-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.dot.free { background: var(--accent); } .dot.low { background: #fbbf24; } .dot.full { background: var(--card-2); border: 1px solid var(--line); }
.cal-tip { font-size: 12px; color: var(--muted); }
.cal-loading { opacity: 0.5; transition: opacity 0.1s; }

/* ── Карта плота ── */
.map-head h1 { margin: 6px 0 2px; }
.map-head { margin-bottom: 12px; }
.raft-map { height: 440px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); z-index: 0; }
.leaflet-popup-content { color: #06222b; }
.map-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 4px; }
.ms { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.ms-k { font-size: 12px; color: var(--muted); }
.ms-v { font-size: 19px; font-weight: 700; }
.rp-form { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 8px; }
.rp-form-2 { display: grid; grid-template-columns: repeat(2, 1fr) auto; gap: 8px; }
.rp-form-2 select, .rp-form-2 button { grid-column: span 1; }
.rp-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-actions form { display: inline; }
.edit-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px; background: var(--card); border: 1px solid var(--accent); border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 14px; max-width: min(680px, calc(100% - 20px)); }
.edit-bar > span { white-space: nowrap; flex-basis: 100%; text-align: center; }
.edit-bar input { width: auto; flex: 1 1 110px; min-width: 80px; padding: 7px 10px; font-size: 13px; border-radius: 10px; }
.edit-bar input[type="date"] { flex: 0 1 150px; }
.btn-icon { width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; font-size: 16px; line-height: 1; flex: none; }
.coord-readout { margin: 10px 0 4px; padding: 10px 14px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.coord-readout b { color: var(--text); font-variant-numeric: tabular-nums; }
.cr-bad { color: var(--danger); }

/* ── О плоте ── */
.info-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.info-block { margin-bottom: 14px; }
.info-block h2 { font-size: 18px; margin: 0 0 10px; }
.info-body { white-space: pre-wrap; line-height: 1.55; word-break: break-word; }
.info-edit { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.info-edit summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.drink-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.drink-grid .field { margin-bottom: 0; }
.drink-out { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); line-height: 1.7; }
.drink-out b { color: var(--accent); font-variant-numeric: tabular-nums; }
.row-claimed { opacity: 0.7; }
.claimed-by { color: var(--green); font-size: 12px; }
@media (max-width: 560px) { .drink-grid { grid-template-columns: 1fr 1fr; } }

/* маркеры на карте + легенда */
.mkr-wrap { background: none !important; border: none !important; }
.mkr { position: relative; display: inline-block; font-size: 24px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.7)); }
.mkr.now { filter: drop-shadow(0 0 6px rgba(56,189,248,0.9)); }
.mkr.past { filter: grayscale(1) brightness(1.15) drop-shadow(0 1px 2px rgba(0,0,0,0.7)); opacity: 0.9; }
.mkr.future { filter: grayscale(0.55); opacity: 0.95; }
.mkr.pick { filter: drop-shadow(0 0 5px rgba(56,189,248,0.9)); }
.mkr.pick.bad { filter: drop-shadow(0 0 5px rgba(248,113,113,0.95)) saturate(1.4); }
.mkr .q { position: absolute; top: -7px; right: -9px; font-size: 12px; font-style: normal; font-weight: 800; color: #06222b; background: #fbbf24; border-radius: 50%; width: 16px; height: 16px; display: grid; place-items: center; }
.legend { padding: 14px 16px; }
.legend h2 { font-size: 15px; margin: 0 0 10px; }
.legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; font-size: 13px; color: var(--muted); }
.legend-grid > span { display: inline-flex; align-items: center; gap: 8px; }
.legend-grid .mkr { font-size: 19px; }
.river-progress { padding: 16px; margin-bottom: 12px; }
.rp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 15px; margin-bottom: 8px; }
.rp-pct { font-weight: 800; font-size: 18px; color: var(--accent); }
.rp-bar { height: 12px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.rp-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; transition: width 0.4s ease; }
.rp-bottom { margin-top: 8px; font-size: 13px; }
.legs { padding: 14px 16px; margin-top: 12px; }
.legs h2 { font-size: 15px; margin: 0 0 10px; }
.leg { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.leg:last-child { border-bottom: none; }
@media (max-width: 560px) { .rp-form-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .raft-map { height: 340px; }
  .rp-form { grid-template-columns: 1fr 1fr; }
  .map-stats { grid-template-columns: 1fr; }
}

/* ── Пополнение кошелька ── */
.topup { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.topup-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.topup-info strong { font-size: 15px; }

/* ── Бронь с участниками ── */
.bk { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 13px 16px; }
.bk-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bk-mates { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.mates { display: flex; flex-wrap: wrap; gap: 8px; }
.mate { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px 3px 3px; font-size: 13px; }
.mate-av { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--card-2); font-size: 12px; font-weight: 700; }
.mate-ph { color: var(--accent); }

/* ── Диалог создания сплава ── */
dialog.mk { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: var(--radius); padding: 0; max-width: 440px; width: calc(100% - 32px); box-shadow: var(--shadow); }
dialog.mk::backdrop { background: rgba(6, 12, 18, 0.6); backdrop-filter: blur(2px); }
.mk-form { padding: 20px; }
.mk-form h3 { margin: 0 0 16px; }
.mk-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mk-actions { display: flex; gap: 10px; margin-top: 8px; }
.mk-actions .btn { flex: 1; }

/* ── Пагинация ── */
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 22px 0 6px; }
.pg-arrow { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; font-size: 20px; color: var(--text); background: var(--card); }
.pg-arrow:hover { border-color: var(--accent); color: var(--accent); }
.pg-arrow.disabled { opacity: 0.3; pointer-events: none; }
.pg-info { font-size: 14px; color: var(--muted); }

.book-form.booked { border-color: rgba(52, 211, 153, 0.4); }
.book-form.booked h3 { color: var(--green); margin-top: 0; }

/* ── Вход через Telegram ── */
.btn-tg { display: inline-flex; align-items: center; gap: 7px; background: linear-gradient(90deg, #2aabee, #229ed9); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.btn-tg:hover { filter: brightness(1.07); }
.btn-tg svg { flex: none; }
.tglogin { text-align: center; }
.tg-icon { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2aabee, #229ed9); }
.tglogin h1 { font-size: 22px; margin: 0 0 8px; }
.tglogin .muted { margin: 0 0 18px; }
.btn-lg { display: inline-block; padding: 14px 22px; font-size: 16px; width: 100%; }
.tg-wait { margin: 16px 0 6px; color: var(--muted); font-size: 14px; opacity: 0; transition: opacity 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tg-wait.show { opacity: 1; }
.tg-denied { margin: 14px 0 4px; padding: 12px 14px; border-radius: 12px; font-size: 14px; background: rgba(248,113,113,0.12); color: var(--danger); border: 1px solid rgba(248,113,113,0.3); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .hero h1 { font-size: 24px; }
  .hero { padding: 12px 4px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: 1; }
  /* на телефоне прячем имя, но баланс оставляем (если он есть) */
  .nav-name { display: none; }
  .nav-user-meta:not(.has-bal) { display: none; }
  .nav-user { padding: 4px; gap: 6px; }
  .nav-user-meta.has-bal { padding-right: 6px; }
  .nav-bal { font-size: 13px; font-weight: 600; }
  /* шапка: ряд 1 — лого + аккаунт по краям, ряд 2 — ссылки разделов на всю ширину */
  .nav { padding: 12px 14px; gap: 8px 8px; }
  .nav-account { margin-left: auto; }
  .nav-links { order: 3; flex-basis: 100%; justify-content: space-between; gap: 4px; }
  .nav-links .nav-link { flex: 1; text-align: center; padding: 8px 6px; background: var(--bg-soft); }
  .nav-link { font-size: 13px; }
  .container { padding: 8px 12px 70px; }
  .cal { padding: 12px; }
  .cal-grid-days, .cal-weekdays { gap: 4px; }
  .cd { height: 40px; font-size: 13px; border-radius: 8px; }
  .cal-label { font-size: 17px; min-width: 140px; }
  .mk-row { grid-template-columns: 1fr 1fr; }
}
