:root {
  color-scheme: light;
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-soft: #f1f3f5;
  --surface-blue: #edf2f7;
  --text: #152035;
  --navy: #243a56;
  --muted: #687994;
  --line: #e6e9ed;
  --coral: #ff4f5f;
  --coral-dark: #e94452;
  --green: #5f961e;
  --green-soft: #e5f4c9;
  --blue: #466a92;
  --amber: #b97b1d;
  --danger: #b63c49;
  --shadow: 0 8px 24px rgba(35, 48, 64, .065);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { min-width: 320px; overscroll-behavior-y: none; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button, a, label, select { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }
.tg-app { width: 100%; min-height: 100vh; max-width: 520px; margin: 0 auto; }
.ui-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tg-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: calc(88px + var(--safe-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(15px + var(--safe-top)) 18px 13px;
  border-bottom: 0;
  background: rgba(251, 251, 250, .96);
  backdrop-filter: blur(18px) saturate(150%);
}
.brand-lockup { display: flex; align-items: center; padding: 0; border: 0; background: transparent; text-align: left; }
.brand-lockup > span:last-child { min-width: 0; }
.brand-lockup strong { display: block; color: #101827; font-size: 29px; font-weight: 950; line-height: 1; letter-spacing: -.06em; }
.brand-lockup strong span { color: var(--coral); }
.brand-lockup small { display: block; margin-top: 5px; color: #5f7090; font-size: 12px; font-weight: 500; letter-spacing: 0; white-space: nowrap; }
.brand-mark { position: relative; width: 35px; height: 35px; overflow: hidden; border-radius: 12px; background: var(--navy); box-shadow: 0 8px 22px rgba(38, 56, 77, .18); }
.brand-mark::before, .brand-mark::after, .brand-mark i { content: ""; position: absolute; bottom: 7px; width: 0; height: 0; border-right: 7px solid transparent; border-bottom: 14px solid white; border-left: 7px solid transparent; transform: rotate(-8deg); }
.brand-mark::before { left: 5px; }
.brand-mark::after { right: 4px; bottom: 6px; border-right-width: 8px; border-bottom-width: 18px; border-left-width: 8px; opacity: .94; }
.brand-mark i { left: 12px; bottom: 5px; border-right-width: 5px; border-bottom-width: 10px; border-left-width: 5px; opacity: .45; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.city-chip { height: 43px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid #dfe4e9; border-radius: 16px; background: rgba(255,255,255,.72); color: #172238; font-size: 13px; font-weight: 650; }
.city-chip svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.city-chip b { max-width: 112px; overflow: hidden; font-size: inherit; text-overflow: ellipsis; white-space: nowrap; }
.city-chip i { color: var(--muted); font-style: normal; }
.avatar-button { width: 36px; height: 36px; display: grid; place-items: center; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-soft); color: var(--navy); font-size: 13px; font-weight: 850; }
.avatar-button img { width: 100%; height: 100%; object-fit: cover; }
body[data-active-view="gym"] .tg-header,
body[data-active-view="route"] .tg-header { display: none; }

.tg-main { padding: 0 17px calc(100px + var(--safe-bottom)); }
.app-view { display: none; animation: view-in .2s ease both; }
.app-view.is-active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; color: #111827; font-size: 29px; font-weight: 900; line-height: 1.06; letter-spacing: -.045em; }
h2 { margin-bottom: 0; color: #111827; font-size: 22px; font-weight: 880; line-height: 1.08; letter-spacing: -.035em; }
h3 { color: var(--navy); letter-spacing: -.025em; }
.eyebrow { display: block; margin-bottom: 7px; color: var(--coral); font-size: 9px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.feed-intro { display: flex; align-items: center; justify-content: space-between; padding: 12px 1px 13px; }
.round-arrow { width: 36px; height: 36px; display: grid; place-items: center; padding: 0 0 3px; border: 0; border-radius: 50%; background: #eef0f2; color: var(--navy); font-size: 29px; font-weight: 400; line-height: 1; }
.view-heading { padding: 20px 2px 20px; }
.view-heading > p { max-width: 500px; margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.add-heading { padding-bottom: 18px; }

.feed-search-row { display: grid; grid-template-columns: minmax(0,1fr) 48px; gap: 9px; margin-bottom: 12px; }
.search-box { position: relative; margin-bottom: 13px; }
.feed-search-row .search-box { margin-bottom: 0; }
.search-box svg { position: absolute; left: 15px; top: 50%; width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; transform: translateY(-50%); pointer-events: none; }
.search-box input { width: 100%; height: 48px; padding: 0 15px 0 44px; border: 0; border-radius: 14px; outline: 0; background: #eef0f2; color: var(--text); box-shadow: none; font-size: 13px; }
.search-box input:focus { border-color: rgba(70, 106, 146, .45); box-shadow: 0 0 0 4px rgba(70, 106, 146, .08); }
.search-filter-button { width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 14px; background: #eef0f2; color: var(--navy); }
.search-filter-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.search-filter-button.is-active { background: #dbe6f2; color: #132b49; }
.gym-search-box { margin-top: -4px; margin-bottom: 20px; }
.filter-scroller { display: flex; gap: 8px; overflow-x: auto; margin: 0 -17px; padding: 0 17px 8px; scrollbar-width: none; }
.filter-scroller::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; min-height: 39px; padding: 0 16px; border: 0; border-radius: 12px; background: #eef0f2; color: #34445e; font-size: 12px; font-weight: 650; }
.filter-chip.is-active { border-color: var(--navy); background: var(--navy); color: white; }
.section-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 22px 2px 13px; }
[data-view="feed"] > .section-title-row { display: none; }
.grade-filter-scroller { margin-top: 1px; padding-bottom: 10px; }
.compact-title-row { margin-top: 6px; }

.route-list { display: grid; gap: 10px; margin-top: 9px; }
.route-card { min-height: 168px; display: grid; grid-template-columns: 52% minmax(0, 48%); overflow: hidden; border: 1px solid #eceef0; border-radius: 17px; background: var(--surface); box-shadow: 0 5px 18px rgba(35,48,64,.045); }
.route-card-photo-open { min-width: 0; min-height: 168px; padding: 0; border: 0; background: transparent; }
.route-photo { position: relative; display: block; width: 100%; height: 100%; min-height: 168px; overflow: hidden; background: var(--surface-blue); }
.route-photo img { width: 100%; height: 100%; object-fit: cover; }
.route-photo-placeholder, .gym-card-placeholder, .gym-hero-placeholder { position: relative; display: block; width: 100%; height: 100%; background: linear-gradient(145deg, #d8e0e7, #eef1f3 52%, #ccd7df); }
.route-photo-placeholder::after, .gym-card-placeholder::after, .gym-hero-placeholder::after { content: "⌁"; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(38, 56, 77, .25); font-size: 38px; font-weight: 900; }
.route-type-badge { position: static; align-self: flex-start; max-width: 100%; padding: 5px 10px; overflow: hidden; border-radius: 999px; background: #edf3fa; color: #1c2a3d; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.route-type-badge.is-boulder { background: #e8f3e9; }
.route-media-count { position: absolute; right: 9px; bottom: 9px; display: inline-flex; align-items: center; gap: 4px; padding: 5px 7px; border-radius: 8px; background: rgba(22, 33, 48, .78); color: white; font-size: 8px; font-weight: 800; }
.route-media-count .ui-icon { width: 12px; height: 12px; }
.route-card-body { min-width: 0; display: flex; flex-direction: column; padding: 11px 11px 8px 13px; }
.route-card-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 0; border: 0; background: transparent; text-align: left; }
.route-location { overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.route-title-line { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 11px; margin-top: 11px; }
.route-title-line > span { min-width: 0; }
.route-card-grade { display: block; margin-top: 8px; color: #101827; font-size: 33px; font-weight: 950; line-height: .95; letter-spacing: -.055em; }
.route-card-gym { display: block; max-width: 100%; margin-top: 8px; overflow: hidden; color: #101827; font-size: 13px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.route-card-sector { display: block; max-width: 100%; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.route-title-line h3 { overflow: hidden; margin: 0 0 4px; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.route-title-line small { display: block; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.route-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 13px; color: var(--muted); font-size: 8px; }
.status-badge { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 8px; font-weight: 850; white-space: nowrap; }
.status-badge.verified { background: var(--green-soft); color: #477811; }
.status-badge.pending { background: #fff0d6; color: var(--amber); }
.status-badge.disputed, .status-badge.archived { background: #f8e3e5; color: var(--danger); }
.route-social-row { min-height: 30px; display: flex; align-items: center; gap: 1px; margin-top: auto; padding: 2px 0 0; border-top: 0; }
.social-action { min-width: 28px; min-height: 29px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 4px; border: 0; border-radius: 9px; background: transparent; color: #152035; font-size: 10px; font-weight: 750; }
.social-action .ui-icon { width: 18px; height: 18px; }
.social-action.is-active { color: var(--coral); background: transparent; }
.route-social-spacer { flex: 1; }
.route-skeleton { min-height: 168px; border-radius: 17px; background: linear-gradient(100deg, #ececea 20%, #f7f7f5 38%, #ececea 56%); background-size: 200% 100%; animation: skeleton 1.3s infinite linear; }
@keyframes skeleton { to { background-position-x: -200%; } }
.empty-state { display: grid; gap: 7px; place-items: center; padding: 48px 24px; border: 1px dashed #d8dcdf; border-radius: 22px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--navy); font-size: 16px; }
.empty-state span { max-width: 300px; font-size: 11px; line-height: 1.45; }

.favorite-gyms { margin-bottom: 21px; }
.favorite-gym-strip { display: flex; gap: 10px; overflow-x: auto; margin: -5px -4px 0; padding: 5px 4px 9px; scroll-padding-inline: 4px; scrollbar-width: none; }
.favorite-gym-strip::-webkit-scrollbar { display: none; }
.favorite-gym-strip button { width: 78px; flex: 0 0 78px; display: grid; gap: 7px; justify-items: center; align-content: start; padding: 0 2px; border: 0; background: transparent; }
.favorite-gym-strip span { width: 58px; height: 58px; display: grid; place-items: center; overflow: hidden; border: 2px solid white; border-radius: 50%; background: var(--surface-blue); color: var(--navy); box-shadow: 0 0 0 2px var(--coral); font-size: 13px; font-weight: 900; }
.favorite-gym-strip img { width: 100%; height: 100%; object-fit: cover; }
.favorite-gym-strip b { width: 100%; display: -webkit-box; overflow: hidden; color: var(--navy); font-size: 9px; line-height: 1.25; text-align: center; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.gym-grid, .mine-gym-list { display: grid; gap: 12px; }
.gym-card { position: relative; min-height: 144px; overflow: hidden; border: 1px solid var(--line); border-radius: 23px; background: var(--surface); box-shadow: var(--shadow); }
.gym-card-open { width: 100%; min-height: 144px; display: grid; grid-template-columns: 118px minmax(0, 1fr); padding: 0; border: 0; background: transparent; text-align: left; }
.gym-card-media { position: relative; width: 118px; min-height: 144px; overflow: hidden; background: var(--surface-blue); }
.gym-card-image { position: relative; width: 100%; height: 100%; min-height: 144px; object-fit: cover; }
.gym-card-content { min-width: 0; display: flex; flex-direction: column; padding: 17px 44px 15px 15px; }
.gym-card-place { overflow: hidden; color: var(--coral); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.gym-card h3 { margin: 8px 0 6px; overflow: hidden; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
.gym-card p { margin: 0; color: var(--muted); font-size: 10px; }
.gym-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; color: var(--muted); font-size: 9px; font-weight: 750; }
.gym-card-arrow { color: var(--navy); font-size: 17px; }
.gym-favorite { position: absolute; top: 11px; right: 11px; width: 35px; height: 35px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.94); color: var(--navy); box-shadow: 0 5px 15px rgba(35,48,64,.11); }
.gym-favorite .ui-icon { width: 18px; height: 18px; }
.gym-favorite.is-active { color: var(--coral); }
.wide-outline-button, .text-button { border: 1px solid var(--line); background: var(--surface); color: var(--navy); font-weight: 800; }
.wide-outline-button { width: 100%; min-height: 49px; margin-top: 14px; border-radius: 16px; font-size: 11px; }
.text-button { padding: 8px 11px; border-radius: 11px; font-size: 9px; }

.gym-detail-head { min-height: 54px; display: flex; align-items: center; justify-content: space-between; }
.gym-detail-actions { display: flex; gap: 8px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--navy); font-size: 20px; }
.icon-button .ui-icon { width: 19px; height: 19px; }
.icon-button.is-active { color: var(--coral); }
.gym-title-block { padding: 1px 1px 12px; }
.gym-title-block h1 { font-size: 31px; }
.gym-title-block p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.gym-title-block p span { color: var(--navy); }
.gym-hero { position: relative; height: 205px; overflow: hidden; margin: 0; border-radius: 15px; background: var(--surface-blue); }
.gym-hero > img, .gym-hero-placeholder { width: 100%; height: 100%; object-fit: cover; }
.gym-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 25%, rgba(11,23,37,.78)); }
.gym-hero-copy { position: absolute; right: 20px; bottom: 23px; left: 20px; color: white; }
.gym-hero-copy > span { font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.gym-hero-copy h1 { margin: 7px 0 5px; color: white; font-size: 37px; }
.gym-hero-copy p { margin: 0; color: rgba(255,255,255,.78); font-size: 11px; }
.gym-detail-body { padding-top: 12px; }
.gym-discipline-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: #e9ecef; }
.gym-discipline-tabs button { min-height: 40px; padding: 0 5px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 850; }
.gym-discipline-tabs button.is-active { background: white; color: var(--navy); box-shadow: 0 4px 12px rgba(35,48,64,.08); }
.single-gym-discipline { display: inline-flex; min-height: 34px; align-items: center; padding: 0 13px; border-radius: 999px; background: var(--surface-blue); color: var(--navy); font-size: 10px; font-weight: 850; }
.gym-news-button { width: 100%; min-height: 55px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-top: 10px; padding: 9px 13px; border: 1px solid #d5dce2; border-radius: 14px; background: var(--surface); color: var(--navy); text-align: left; }
.gym-news-button > .ui-icon { width: 22px; height: 22px; color: var(--blue); }
.gym-news-button span { display: grid; gap: 4px; }
.gym-news-button b { font-size: 12px; }
.gym-news-button small { color: var(--muted); font-size: 9px; }
.gym-news-button > strong { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-blue); color: var(--blue); }
.gym-news-button.is-active { border-color: #cfe5aa; background: #f7fbef; }
.gym-news-button.is-active > .ui-icon, .gym-news-button.is-active > strong { color: var(--green); }
.gym-news-button.is-active > strong { background: var(--green-soft); }
.gym-routes-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 19px 1px 11px; }
.gym-routes-heading > div { min-width: 0; display: grid; gap: 3px; }
.gym-routes-heading h2 { margin: 0; font-size: 20px; line-height: 1.12; }
.gym-routes-heading > div > span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.gym-routes-heading button { min-height: 38px; align-self: center; padding: 0 13px; border: 0; border-radius: 11px; background: var(--navy); color: white; font-size: 9px; font-weight: 850; white-space: nowrap; }
.gym-grade-filters { display: flex; gap: 7px; overflow-x: auto; margin: 0 -16px 13px; padding: 0 16px 2px; scrollbar-width: none; }
.gym-grade-filters::-webkit-scrollbar { display: none; }

.route-context-card { display: grid; gap: 12px; margin-bottom: 17px; padding: 15px; border: 1px solid #dce1e5; border-radius: 21px; background: var(--surface); box-shadow: 0 10px 28px rgba(35,48,64,.045); }
.route-form { display: grid; gap: 11px; }
.form-field { min-width: 0; display: grid; gap: 7px; }
.form-field > span, .discipline-field > span { color: var(--navy); font-size: 10px; font-weight: 850; }
.form-field i { color: var(--muted); font-size: 8px; font-style: normal; font-weight: 600; }
.form-field input, .form-field select, .form-field textarea, .grade-vote-row select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 14px; outline: 0; background: var(--surface); color: var(--text); font-size: 12px; }
.form-field input, .form-field select { height: 47px; padding: 0 13px; }
.form-field textarea { padding: 12px 13px; resize: vertical; }
.route-context-card .form-field select { background: var(--surface-soft); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: rgba(70,106,146,.45); box-shadow: 0 0 0 4px rgba(70,106,146,.07); }
.field-grid { display: grid; gap: 10px; }
.two-columns { grid-template-columns: 1fr 1fr; }
.discipline-options { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border-radius: 14px; background: var(--surface-soft); }
.discipline-options button { min-height: 40px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 850; }
.discipline-options button.is-active { background: var(--surface); color: var(--navy); box-shadow: 0 4px 12px rgba(35,48,64,.08); }
.single-discipline-note { min-height: 38px; display: flex; align-items: center; padding: 0 12px; border-radius: 12px; background: var(--surface-blue); color: var(--navy); font-size: 10px; font-weight: 800; }
.create-media-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 3px; }
.create-media-heading strong { color: var(--navy); font-size: 13px; }
.create-media-heading span { color: var(--muted); font-size: 9px; }
.create-media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-field, .video-field { position: relative; min-height: 177px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; overflow: hidden; padding: 14px; border: 1.5px dashed #c9d1d8; border-radius: 19px; background: var(--surface); text-align: center; }
.photo-field input, .video-field input { position: absolute; inset: 0; z-index: 2; opacity: 0; cursor: pointer; }
.photo-field-icon, .video-field-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 13px; background: var(--surface-blue); color: var(--blue); font-size: 20px; }
.photo-field strong, .video-field strong { color: var(--navy); font-size: 11px; }
.photo-field small, .video-field small, .media-file-name { color: var(--muted); font-size: 8px; line-height: 1.4; }
.media-file-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#photo-preview { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; object-fit: cover; }
.photo-field.has-preview #photo-preview { opacity: 1; }
.photo-field.has-preview::after { content: "Заменить фото"; position: absolute; z-index: 1; right: 8px; bottom: 8px; padding: 6px 8px; border-radius: 9px; background: rgba(22,33,48,.78); color: white; font-size: 8px; font-weight: 800; }
.video-field.has-file { border-style: solid; border-color: #bbd09a; background: #f5faec; }
.video-field.is-disabled { opacity: .55; }
.inline-suggestion { justify-self: start; margin-top: -4px; padding: 5px 2px; border: 0; background: transparent; color: var(--blue); font-size: 9px; font-weight: 800; }
.form-note { padding: 12px 13px; border-radius: 13px; background: var(--surface-blue); color: #5e6d7c; font-size: 9px; line-height: 1.5; }
.primary-button { width: 100%; min-height: 52px; padding: 0 18px; border: 0; border-radius: 16px; background: var(--coral); color: white; box-shadow: 0 12px 28px rgba(255,90,103,.2); font-weight: 900; }
.primary-button:hover { background: var(--coral-dark); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.auth-inline { padding: 17px; border: 1px solid #e5d7b8; border-radius: 18px; background: #fff9ec; }
.auth-inline p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }

.mini-stats, .profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 16px; }
.stat-card { padding: 15px 8px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); text-align: center; }
.stat-card strong { display: block; color: var(--navy); font-size: 23px; letter-spacing: -.04em; }
.stat-card small { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.mine-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 25px 2px 13px; }
.mine-section-heading .eyebrow { color: var(--muted); }
.mine-routes-heading { margin-top: 29px; }
.segmented-control { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 13px; padding: 4px; border-radius: 15px; background: #e9ecef; }
.segmented-control button { min-width: 0; min-height: 38px; padding: 0 4px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 850; }
.segmented-control button.is-active { background: white; color: var(--navy); box-shadow: 0 4px 11px rgba(35,48,64,.07); }
.gym-card.is-compact { min-height: 124px; }
.gym-card.is-compact .gym-card-open, .gym-card.is-compact .gym-card-image { min-height: 124px; }
.gym-card.is-compact .gym-card-image { height: 124px; }

.profile-hero { display: flex; align-items: center; gap: 16px; padding: 33px 2px 24px; }
.profile-avatar { width: 72px; height: 72px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border: 3px solid white; border-radius: 25px; background: var(--surface-blue); color: var(--navy); box-shadow: var(--shadow); font-size: 23px; font-weight: 900; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero h1 { margin: 0 0 7px; font-size: 28px; }
.profile-hero p { margin: 0; color: var(--muted); font-size: 11px; }
.settings-card { overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); box-shadow: var(--shadow); }
.settings-card button { width: 100%; min-height: 55px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 12px; text-align: left; }
.settings-card button:last-child { border-bottom: 0; }
.settings-card b { color: var(--muted); }
.settings-card .danger-setting span { color: var(--danger); }
.independent-note { margin-top: 14px; padding: 17px; border-radius: 18px; background: #ecefed; color: var(--navy); }
.independent-note strong { font-size: 11px; }
.independent-note p { margin: 7px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.independent-note a { color: var(--blue); }
.dev-login, .web-login { width: 100%; display: block; margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: transparent; color: var(--muted); font-size: 10px; text-align: center; text-decoration: none; }

.bottom-nav { position: fixed; left: 50%; bottom: 0; z-index: 35; width: min(100%, 520px); min-height: calc(72px + var(--safe-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px 4px var(--safe-bottom); border-top: 1px solid rgba(35,48,64,.08); background: rgba(255,255,255,.96); transform: translateX(-50%); backdrop-filter: blur(18px) saturate(160%); }
.bottom-nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; border: 0; background: transparent; color: #89919a; }
.bottom-nav button:focus { outline: 0; }
.bottom-nav .nav-icon { font-size: 20px; line-height: 1; }
.bottom-nav .nav-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav small { font-size: 9px; font-weight: 750; }
.bottom-nav button.is-active { color: var(--navy); }
.bottom-nav button.is-active::before { display: none; }
.bottom-nav .nav-add > span { width: 53px; height: 53px; display: grid; place-items: center; margin-top: -28px; border: 4px solid white; border-radius: 50%; background: var(--coral); color: white; box-shadow: 0 9px 24px rgba(255,90,103,.28); font-size: 33px; font-weight: 300; }
.bottom-nav .nav-add::before { display: none; }

.sheet-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 60; visibility: hidden; opacity: 0; background: rgba(22,33,48,.38); transition: .2s ease; backdrop-filter: blur(3px); }
.modal-backdrop { z-index: 70; }
.sheet-backdrop.is-open, .modal-backdrop.is-open { visibility: visible; opacity: 1; }
.bottom-sheet { position: fixed; left: 50%; bottom: 0; z-index: 65; width: min(100%, 760px); max-height: 94vh; overflow-y: auto; padding: 10px 16px calc(26px + var(--safe-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 29px 29px 0 0; background: var(--bg); box-shadow: 0 -22px 65px rgba(35,48,64,.18); transform: translate(-50%, 105%); transition: transform .3s cubic-bezier(.2,.75,.2,1); }
.bottom-sheet.is-open { transform: translate(-50%, 0); }
.sheet-handle { width: 41px; height: 4px; margin: 0 auto 12px; border-radius: 3px; background: #cbd0d5; }
.sheet-close, .dialog-close { position: absolute; z-index: 4; top: 16px; right: 15px; width: 35px; height: 35px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.94); color: var(--navy); font-size: 21px; }
.route-view-head { min-height: 54px; display: flex; align-items: center; justify-content: space-between; }
.route-view-back, .route-view-actions button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: #101827; font-size: 28px; }
.route-view-actions { display: flex; align-items: center; gap: 7px; }
.route-view-actions button { font-size: 16px; font-weight: 850; letter-spacing: .08em; }
.route-view-actions svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.route-detail-photo { position: relative; height: min(39vh, 310px); min-height: 260px; overflow: hidden; margin: 12px 0 10px; border-radius: 15px; background: var(--surface-blue); }
.route-detail-photo > img { width: 100%; height: 100%; object-fit: cover; }
.route-detail-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.route-detail-title-row > div { min-width: 0; }
.route-detail-title-row h2 { margin: 0; overflow: hidden; color: #101827; font-size: 29px; text-overflow: ellipsis; white-space: nowrap; }
.route-detail-grade { flex: 0 0 auto; padding: 0 2px 0 10px; color: var(--coral); font-size: 39px; font-weight: 950; line-height: .95; letter-spacing: -.055em; }
.route-detail-location { display: block; max-width: 100%; margin: 5px 0 0; padding: 0; overflow: hidden; border: 0; background: transparent; color: var(--muted); font-size: 13px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.route-status-row { display: flex; justify-content: center; min-height: 28px; margin-bottom: 9px; }
.route-status-row .status-badge { padding: 0 14px; }
.route-detail-social { min-height: 66px; display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 10px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.detail-social-action { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 7px; border: 0; border-right: 1px solid var(--line); background: transparent; color: #101827; }
.detail-social-action:last-child { border-right: 0; }
.detail-social-action .ui-icon { width: 24px; height: 24px; flex: 0 0 auto; }
.detail-social-action > span { min-width: 0; display: grid; gap: 1px; text-align: left; }
.detail-social-action b { font-size: 13px; }
.detail-social-action small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.detail-social-action.is-active { color: var(--coral); }
.route-ascent-button { width: 100%; min-height: 50px; margin-bottom: 13px; border: 0; border-radius: 13px; background: var(--coral); color: white; box-shadow: 0 9px 22px rgba(255,79,95,.18); font-size: 13px; font-weight: 850; }
.detail-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.detail-fact { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.detail-fact small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.detail-fact strong { display: block; overflow: hidden; color: var(--navy); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.detail-description { margin: 0 0 17px; color: #566372; font-size: 12px; line-height: 1.58; }
.community-panel { margin-bottom: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.community-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 11px; }
.community-panel-head strong { color: var(--navy); font-size: 11px; }
.community-panel-head small { color: var(--muted); font-size: 9px; }
.grade-vote-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.grade-vote-row select { height: 43px; padding: 0 12px; }
.grade-vote-row button, .confirm-button { min-height: 43px; padding: 0 13px; border: 0; border-radius: 12px; background: var(--navy); color: white; font-size: 10px; font-weight: 850; }
.confirm-button { width: 100%; border: 1px solid var(--line); background: var(--surface-soft); color: var(--navy); }
.confirm-button.is-done { border: 0; background: var(--green-soft); color: #477811; }
.route-materials { margin: 18px 0; }
.route-materials h3 { margin: 0 0 10px; font-size: 15px; }
.material-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
.material-photo { position: relative; min-height: 102px; overflow: hidden; border-radius: 13px; background: var(--surface-blue); }
.material-photo img { width: 100%; height: 100%; min-height: 102px; object-fit: cover; }
.material-status { position: absolute; left: 6px; bottom: 6px; padding: 4px 6px; border-radius: 7px; background: rgba(22,33,48,.82); color: white; font-size: 7px; font-weight: 800; }
.material-video-list { display: grid; gap: 8px; margin-top: 8px; }
.material-video { min-height: 78px; display: grid; grid-template-columns: 96px 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; }
.material-video img, .material-video-placeholder { width: 96px; height: 78px; object-fit: cover; background: var(--surface-blue); }
.material-video span { align-self: center; display: grid; gap: 5px; padding: 10px; }
.material-video b { font-size: 10px; }
.material-video small { color: var(--muted); font-size: 8px; }
.add-material-button { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 9px; border: 1px solid var(--coral); border-radius: 13px; background: var(--surface); color: var(--coral); font-size: 11px; font-weight: 850; }
.add-material-button .ui-icon { width: 18px; height: 18px; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-actions button { min-height: 47px; padding: 0 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--navy); font-size: 9px; font-weight: 800; }
.detail-actions .report-button { color: var(--danger); }

.dialog { position: fixed; left: 50%; top: 50%; z-index: 75; visibility: hidden; width: min(calc(100% - 28px), 500px); max-height: 88vh; overflow-y: auto; padding: 24px 18px 20px; border: 1px solid var(--line); border-radius: 25px; opacity: 0; background: var(--surface); box-shadow: 0 24px 80px rgba(35,48,64,.22); transform: translate(-50%, -46%) scale(.98); transition: .2s ease; }
.dialog.is-open { visibility: visible; opacity: 1; transform: translate(-50%, -50%) scale(1); }
.dialog h2 { margin: 0 42px 18px 0; font-size: 25px; }
.dialog form { display: grid; gap: 9px; }
.dialog-context { margin: -8px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.city-search-field { margin-bottom: 12px; }
.city-option-list, .candidate-list { display: grid; gap: 7px; max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.city-option { width: 100%; min-height: 57px; display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; }
.city-option span { display: grid; gap: 4px; }
.city-option strong { color: var(--navy); font-size: 12px; }
.city-option small { color: var(--muted); font-size: 8px; }
.city-option b { color: var(--muted); }
.city-option.is-active { border-color: #bfd79a; background: #f5faed; }
.radio-card, .check-card { display: flex; align-items: center; gap: 11px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.radio-card:has(input:checked), .check-card:has(input:checked) { border-color: rgba(255,90,103,.45); background: #fff3f4; }
.radio-card input, .check-card input { accent-color: var(--coral); }
.radio-card span, .check-card span { display: grid; gap: 3px; }
.radio-card b, .check-card b { color: var(--navy); font-size: 11px; }
.radio-card small, .check-card small { color: var(--muted); font-size: 8px; }
.discipline-proposal-field { display: grid; gap: 8px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 15px; }
.discipline-proposal-field legend { padding: 0 5px; color: var(--navy); font-size: 10px; font-weight: 850; }
.candidate-list { max-height: 46vh; margin-bottom: 12px; }
.candidate-card { width: 100%; min-height: 68px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); text-align: left; }
.candidate-card.is-selected { border-color: #bfd79a; background: #f5faed; }
.candidate-grade { min-width: 46px; padding: 8px; border-radius: 11px; background: var(--green-soft); color: #355d0c; font-weight: 950; text-align: center; }
.candidate-card > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.candidate-card strong { overflow: hidden; color: var(--navy); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.candidate-card small { color: var(--muted); font-size: 8px; }
.candidate-action { color: var(--blue); font-size: 8px; font-weight: 850; }
.upload-choice { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; border: 1px dashed #c5cfd7; border-radius: 14px; background: var(--surface-soft); }
.upload-choice > span { display: grid; gap: 4px; }
.upload-choice b { color: var(--navy); font-size: 11px; }
.upload-choice small { color: var(--muted); font-size: 8px; }
.upload-choice input { max-width: 145px; color: var(--muted); font-size: 8px; }
.upload-choice.is-disabled { opacity: .5; }
.toggle-row { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.toggle-row span { display: grid; gap: 4px; }
.toggle-row b { color: var(--navy); font-size: 11px; }
.toggle-row small { color: var(--muted); font-size: 8px; line-height: 1.35; }
.toggle-row input { width: 21px; height: 21px; accent-color: var(--coral); }
.digest-subscriptions { padding: 12px 13px; border-radius: 14px; background: var(--surface-soft); color: var(--muted); font-size: 9px; line-height: 1.5; }
.state-choice-grid { display: grid; gap: 9px; }
.state-choice-grid button { min-height: 63px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: left; }
.state-choice-grid b { color: var(--navy); font-size: 13px; }
.state-choice-grid small { color: var(--muted); font-size: 9px; }
.state-choice-grid button:first-child { border-color: rgba(255,90,103,.3); background: #fff6f6; }
.consent-dialog > p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.consent-check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 8px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); color: #586574; font-size: 10px; line-height: 1.45; }
.consent-check input { margin-top: 2px; accent-color: var(--coral); }
.consent-check a { color: var(--blue); }
.consent-later { min-height: 42px; border: 0; background: transparent; color: var(--muted); font-size: 10px; }

.moderation-heading { position: relative; padding-left: 46px; }
.back-button { position: absolute; left: 0; top: 34px; width: 37px; height: 37px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); }
.moderation-list { display: grid; gap: 12px; }
.moderation-card { padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.moderation-card h3 { margin: 0 0 5px; font-size: 16px; }
.moderation-card p { margin: 0 0 12px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.moderation-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.moderation-meta span { padding: 5px 8px; border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-size: 8px; }
.moderation-actions { display: grid; grid-template-columns: repeat(auto-fit,minmax(82px,1fr)); gap: 6px; }
.moderation-actions button { min-height: 39px; padding: 0 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); color: var(--navy); font-size: 8px; font-weight: 800; }
.moderation-actions .approve { border: 0; background: var(--green-soft); color: #477811; }
.moderation-actions .danger { color: var(--danger); }
.moderation-actions.is-two { grid-template-columns: 1fr 1fr; }
.moderation-preview { width: 100%; max-height: 220px; margin: 9px 0 12px; border-radius: 13px; object-fit: cover; background: var(--surface-blue); }

.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom)); z-index: 100; visibility: hidden; max-width: min(88%,420px); padding: 12px 16px; border-radius: 14px; opacity: 0; background: rgba(38,56,77,.96); color: white; box-shadow: 0 14px 34px rgba(35,48,64,.22); transform: translate(-50%,12px); transition: .2s ease; font-size: 10px; font-weight: 750; text-align: center; }
.toast.is-visible { visibility: visible; opacity: 1; transform: translate(-50%,0); }
.toast.is-error { background: rgba(166,48,61,.96); }
body.sheet-open, body.dialog-open { overflow: hidden; }

@media (min-width: 620px) {
  .tg-main { padding-right: 24px; padding-left: 24px; }
  .filter-scroller { margin-right: -24px; margin-left: -24px; padding-right: 24px; padding-left: 24px; }
}

@media (max-width: 619px) {
  .tg-header { padding-right: 17px; padding-left: 17px; }
  .city-chip b { max-width: 94px; }
}

@media (max-width: 370px) {
  .brand-lockup strong { font-size: 25px; }
  .brand-lockup small { font-size: 10px; }
  .city-chip { height: 40px; padding: 0 10px; }
  .city-chip b { max-width: 68px; }
  .route-card { grid-template-columns: 49% minmax(0,51%); }
  .route-card-body { padding-right: 11px; padding-left: 11px; }
  .route-card-grade { font-size: 29px; }
  .gym-card-open { grid-template-columns: 105px minmax(0,1fr); }
  .gym-card-media { width: 105px; }
  .two-columns, .create-media-grid { grid-template-columns: 1fr; }
  .detail-facts { grid-template-columns: 1fr 1fr; }
  .bottom-nav small { font-size: 8px; }
}

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