/* ===================================================================
   НЕИЗВЕСТНАЯ МОТО РОССИЯ — визуальный язык.

   Идея: не «ещё одно спортивное приложение», а полевой дневник
   экспедиции. Бумага, типографская краска, охра дорожных знаков,
   круглые печати-штампы как в загранпаспорте. Ачивка здесь — не
   иконка в интерфейсе, а печать, которую поставили на границе региона.
   =================================================================== */

:root {
  /* Бумага и краска */
  --paper:      #F2EADB;
  --paper-2:    #FBF6EC;
  --paper-3:    #E8DCC6;
  --ink:        #221D17;
  --ink-soft:   #4A4137;
  --muted:      #7A6E5F;
  --line:       #D6C7AC;
  --line-soft:  #E6DAC3;

  /* Акценты */
  --ochre:      #C2611F;   /* охра дорожного знака — главный акцент */
  --ochre-deep: #9B4A12;
  --forest:     #2E4739;   /* тайга — второй акцент */
  --rust:       #9E3B2E;   /* опасность, сложность */
  --brass:      #A8842C;   /* печати и награды */
  --sky:        #3A6072;

  --radius: 4px;
  --radius-lg: 10px;
  --shadow: 0 2px 0 rgba(34,29,23,.06), 0 10px 30px rgba(34,29,23,.10);
  --shadow-sm: 0 1px 0 rgba(34,29,23,.08);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  /* Тонкая «зернистость» бумаги: два почти невидимых слоя вместо картинки */
  background-image:
    radial-gradient(circle at 15% 20%, rgba(194,97,31,.05), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(46,71,57,.05), transparent 40%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0 0 .45em; line-height: 1.15; }
h1 { font-size: 32px; letter-spacing: -.01em; }
h2 { font-size: 23px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* Надпись «как на штампе»: разрядка, капитель */
.stamped {
  font-family: var(--sans); font-weight: 700; font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}

/* ============================ ШАПКА ============================= */
.top {
  position: sticky; top: 0; z-index: 900;
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px; height: 62px;
  background: rgba(242,234,219,.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  /* двойная линия — типографский приём старых карт */
  box-shadow: 0 2px 0 -1px var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--ochre); color: var(--ochre);
  display: grid; place-items: center; font-size: 17px;
  transform: rotate(-8deg);
}
.brand-text { font-family: var(--serif); font-size: 15px; line-height: 1.05; }
.brand-text b { display: block; font-size: 17px; letter-spacing: .02em; }
.brand-text span { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.nav { display: flex; gap: 2px; flex: 1; }
.nav a {
  padding: 8px 12px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; color: var(--ink-soft); white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.nav a:hover { background: rgba(194,97,31,.07); }
.nav a.active { color: var(--ochre-deep); border-bottom-color: var(--ochre); }

.top-right { display: flex; align-items: center; gap: 8px; }
.burger { display: none; background: none; border: 0; font-size: 22px; color: var(--ink); cursor: pointer; }

.lang-switch { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lang-switch button {
  border: 0; background: transparent; padding: 5px 9px; cursor: pointer;
  font: 700 11px/1 var(--sans); letter-spacing: .08em; color: var(--muted);
}
.lang-switch button.on { background: var(--ink); color: var(--paper-2); }

.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper-2);
  font-size: 13px; font-weight: 600;
}
.user-chip:hover { border-color: var(--ochre); }

.avatar {
  border-radius: 50%; object-fit: cover; display: grid; place-items: center;
  background: var(--forest); color: var(--paper-2);
  font-family: var(--serif); font-weight: 600; flex-shrink: 0;
}

/* ============================ КНОПКИ ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--paper-2); color: var(--ink); font: 600 14px/1 var(--sans);
  cursor: pointer; transition: transform .08s, box-shadow .12s, background .12s;
  box-shadow: 2px 2px 0 var(--ink);
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--ochre); border-color: var(--ochre-deep); color: #fff;
               box-shadow: 2px 2px 0 var(--ochre-deep); }
.btn-primary:hover { box-shadow: 3px 3px 0 var(--ochre-deep); }
.btn-dark { background: var(--forest); border-color: #1F3126; color: var(--paper-2);
            box-shadow: 2px 2px 0 #1F3126; }
.btn-ghost { background: transparent; border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: var(--ink); box-shadow: none; transform: none;
                   background: rgba(34,29,23,.04); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; box-shadow: 1.5px 1.5px 0 currentColor; }
.btn-sm.btn-ghost { box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ========================== РАСКЛАДКА =========================== */
.page { max-width: 1180px; margin: 0 auto; padding: 26px 20px 90px; }
.page-narrow { max-width: 720px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.between { justify-content: space-between; align-items: center; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.loader { padding: 70px; text-align: center; color: var(--muted); font-family: var(--serif); font-style: italic; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }

/* Карточка — «наклеенная на страницу» */
.card {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: box-shadow .15s, transform .12s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-body { padding: 15px 17px; }

/* Заголовок раздела с линейкой, как в старом атласе */
.section-head {
  display: flex; align-items: baseline; gap: 14px; margin: 30px 0 16px;
}
.section-head h2 { margin: 0; white-space: nowrap; }
.section-head::after {
  content: ''; flex: 1; height: 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-soft);
  transform: translateY(-3px);
}

/* ============================ ПЕЧАТИ ============================ */
/* Ачивка = печать в паспорте. Круг, пунктир, лёгкий поворот. */
.stamp {
  position: relative; width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  border: 2px solid var(--brass); color: var(--brass);
  background: radial-gradient(circle, rgba(168,132,44,.07), transparent 70%);
  transform: rotate(-6deg); flex-shrink: 0;
}
.stamp::before {
  content: ''; position: absolute; inset: 5px; border-radius: 50%;
  border: 1px dashed currentColor; opacity: .55;
}
.stamp .ico { font-size: 27px; line-height: 1; }
.stamp .lab {
  font: 700 7.5px/1.15 var(--sans); letter-spacing: .1em;
  text-transform: uppercase; margin-top: 3px; max-width: 74px;
}
.stamp.t1 { --c: #8A7B62; border-color: #8A7B62; color: #8A7B62; }
.stamp.t2 { border-color: #7C8C93; color: #5E7079; }
.stamp.t3 { border-color: var(--brass); color: var(--brass); }
.stamp.t4 { border-color: var(--rust); color: var(--rust);
            box-shadow: 0 0 0 4px rgba(158,59,46,.08); }
.stamp.locked { border-color: var(--line); color: #B9AB93; background: none; transform: none; }
.stamp.locked::before { opacity: .3; }
.stamp.sm { width: 64px; height: 64px; }
.stamp.sm .ico { font-size: 19px; }
.stamp.sm .lab { font-size: 6px; max-width: 50px; }

/* ============================ БЕЙДЖИ ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--paper-2); font: 600 11.5px/1.5 var(--sans); color: var(--ink-soft);
}
.badge-ochre { border-color: var(--ochre); color: var(--ochre-deep); background: rgba(194,97,31,.07); }
.badge-forest{ border-color: var(--forest); color: var(--forest); background: rgba(46,71,57,.06); }
.badge-rust  { border-color: var(--rust); color: var(--rust); background: rgba(158,59,46,.06); }
.badge-brass { border-color: var(--brass); color: #7C6220; background: rgba(168,132,44,.08); }
.d1 { border-color:#5B7A5E; color:#3E5A41; } .d2 { border-color:#7E8A4E; color:#5C6636; }
.d3 { border-color:var(--brass); color:#7C6220; } .d4 { border-color:#B96A2A; color:#93500F; }
.d5 { border-color:var(--rust); color:var(--rust); }

/* Клубный шеврон — главный статусный элемент */
.club-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px 2px 3px; border: 1px solid var(--forest); border-radius: 999px;
  background: rgba(46,71,57,.07); font: 700 11px/1.7 var(--sans);
  color: var(--forest); letter-spacing: .04em;
}
.club-chip .em {
  width: 18px; height: 18px; border-radius: 50%; background: var(--forest);
  color: var(--paper-2); display: grid; place-items: center; font-size: 9px;
}
.club-chip .tick { color: var(--ochre); font-size: 12px; }

/* ============================ ЛЕНТА ============================= */
.feed { max-width: 640px; margin: 0 auto; }

.stories { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 16px; }
.story-dot { text-align: center; width: 76px; flex-shrink: 0; cursor: pointer; }
.story-ring {
  width: 68px; height: 68px; border-radius: 50%; padding: 3px; margin: 0 auto 6px;
  background: conic-gradient(var(--ochre), var(--brass), var(--forest), var(--ochre));
}
.story-ring.seen { background: var(--line); }
.story-ring > * { width: 100%; height: 100%; border: 2px solid var(--paper); font-size: 22px; }
.story-dot .nm { font-size: 11px; color: var(--ink-soft); overflow: hidden;
                 text-overflow: ellipsis; white-space: nowrap; }

.post {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.post-head { display: flex; align-items: center; gap: 11px; padding: 13px 15px; }
.post-head .who { flex: 1; min-width: 0; }
.post-head .nick { font-weight: 700; font-size: 14px; }
.post-media { display: block; width: 100%; background: var(--paper-3); }
.post-media img { display: block; width: 100%; max-height: 620px; object-fit: cover; }
.post-body { padding: 13px 15px 15px; }
.post-actions { display: flex; gap: 6px; align-items: center; padding: 8px 10px;
                border-top: 1px solid var(--line-soft); }
.icon-btn {
  border: 0; background: none; cursor: pointer; font-size: 15px; color: var(--ink-soft);
  padding: 6px 10px; border-radius: var(--radius); display: inline-flex; align-items: center; gap: 6px;
  font: 600 13px/1 var(--sans);
}
.icon-btn:hover { background: rgba(34,29,23,.05); }
.icon-btn.on { color: var(--rust); }

/* Плашка «почему этот пост наверху» — алгоритм не должен быть тайной */
.reach-note {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px;
  border: 1px dashed var(--line); border-radius: 3px;
  font: 600 10.5px/1.7 var(--mono); color: var(--muted);
}

/* ========================== ПАСПОРТ ============================= */
.passport {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.passport::before {
  content: ''; position: absolute; inset: 10px; border: 1px solid var(--line-soft);
  border-radius: 6px; pointer-events: none;
}
.passport-head { display: flex; justify-content: space-between; align-items: flex-start;
                 gap: 20px; position: relative; }
.passport-no { font: 600 11px/1 var(--mono); color: var(--muted); letter-spacing: .1em; }

.region-grid {
  display: grid; gap: 7px; margin-top: 18px;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}
.region-cell {
  border: 1px solid var(--line); border-radius: 3px; padding: 7px 8px;
  background: var(--paper); min-height: 58px; position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
}
.region-cell .rn { font-size: 10.5px; line-height: 1.25; color: var(--muted); }
.region-cell .rc { font: 700 10px/1 var(--mono); color: #B9AB93; letter-spacing: .06em; }
.region-cell.taken {
  background: rgba(194,97,31,.09); border-color: var(--ochre);
}
.region-cell.taken .rn { color: var(--ochre-deep); font-weight: 600; }
.region-cell.taken::after {
  content: '✔'; position: absolute; right: 6px; top: 5px;
  color: var(--ochre); font-size: 13px; transform: rotate(-12deg);
}

/* ============================ КАРТА ============================= */
.map-wrap { position: relative; height: calc(100vh - 62px); }
/* Растягиваем карту на весь экран ТОЛЬКО на странице карты. Раньше правило
   было глобальным и выдёргивало из потока любую карту в карточке маршрута,
   профиля или паспорта — она перекрывала всю страницу. */
.map-wrap > #map { position: absolute; inset: 0; }
#map { height: 100%; width: 100%; background: var(--paper-3); }
.map-panel {
  position: absolute; z-index: 500; top: 14px; left: 14px; width: 330px;
  max-height: calc(100% - 28px); overflow: auto;
  background: rgba(251,246,236,.97); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.map-legend {
  position: absolute; z-index: 500; bottom: 20px; left: 14px;
  background: rgba(251,246,236,.96); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 13px; font-size: 11.5px;
}
.leaflet-container { background: #E4D9C2; font: inherit; }
.leaflet-tile { filter: sepia(.25) saturate(.85) contrast(.95) brightness(1.02); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--paper-2); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.leaflet-popup-content { margin: 13px 15px; min-width: 200px; }
.leaflet-bar a { background: var(--paper-2); color: var(--ink); border-color: var(--line); }
.leaflet-bar a:hover { background: var(--paper-3); }
.poi-pin {
  display: grid; place-items: center; width: 30px; height: 30px; font-size: 15px;
  background: var(--paper-2); border: 2px solid var(--ochre);
  border-radius: 50% 50% 50% 6px; transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(34,29,23,.3);
}
.poi-pin > span { transform: rotate(45deg); }
.poi-pin.partner { border-color: var(--brass); background: #FFF6DF; }

/* ============================ ФОРМЫ ============================= */
label { display: block; margin: 14px 0 5px; font: 700 11px/1 var(--sans);
        letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--paper-2); color: var(--ink);
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--ochre); box-shadow: 0 0 0 3px rgba(194,97,31,.13);
}
textarea { min-height: 96px; resize: vertical; }
.field-row { display: flex; gap: 12px; } .field-row > * { flex: 1; }

/* =========================== ТАБЛИЦЫ ============================ */
table.rating { width: 100%; border-collapse: collapse; }
table.rating th {
  font: 700 10.5px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); text-align: left; padding: 10px; border-bottom: 2px solid var(--line);
}
table.rating td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); }
table.rating tr:hover td { background: rgba(194,97,31,.05); }
.rank { font: 700 17px/1 var(--serif); width: 46px; color: var(--muted); }
.rank-1 { color: var(--brass); } .rank-2 { color: #7C8C93; } .rank-3 { color: var(--ochre); }

/* ====================== МОДАЛКА И ТОСТЫ ========================= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000; background: rgba(34,29,23,.55);
  display: grid; place-items: center; padding: 18px; backdrop-filter: blur(3px);
}
/* display:grid перебивает атрибут hidden, поэтому гасим явно —
   иначе пустая модалка висит поверх страницы при загрузке */
.modal-backdrop[hidden] { display: none; }
.modal {
  position: relative; width: min(560px,100%); max-height: 88vh; overflow: auto;
  background: var(--paper-2); border: 1px solid var(--ink); border-radius: var(--radius);
  padding: 28px; box-shadow: 6px 6px 0 rgba(34,29,23,.18);
}
.modal-wide { width: min(880px,100%); }
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: 0;
               font-size: 19px; color: var(--muted); cursor: pointer; }
.toasts { position: fixed; z-index: 1100; right: 20px; bottom: 20px; display: grid; gap: 10px; }
.toast {
  padding: 13px 17px; border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--paper-2); box-shadow: 4px 4px 0 rgba(34,29,23,.2); max-width: 360px;
  animation: slidein .2s ease;
}
.toast.ok  { border-left: 5px solid var(--forest); }
.toast.err { border-left: 5px solid var(--rust); }
.toast.ach { border-left: 5px solid var(--brass); background: #FFFBF0; }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } }

/* ========================= FAB «Я ЗДЕСЬ» ======================== */
.checkin-fab {
  position: fixed; z-index: 800; right: 22px; bottom: 22px;
  display: flex; align-items: center; gap: 9px; padding: 15px 22px;
  border: 2px solid var(--ochre-deep); border-radius: 999px;
  background: var(--ochre); color: #fff; font: 700 14px/1 var(--sans);
  box-shadow: 4px 4px 0 var(--ochre-deep); cursor: pointer;
}
.checkin-fab:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--ochre-deep); }

/* =========================== ОБЛОЖКА =========================== */
.hero {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--forest); color: #fff; margin-bottom: 26px;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%;
            object-fit: cover; opacity: .52; }
.hero-in { position: relative; padding: 46px 40px; max-width: 680px; }
.hero h1 { color: #fff; font-size: 40px; text-shadow: 0 2px 14px rgba(0,0,0,.4); }
.hero p { color: rgba(255,255,255,.92); font-size: 16px; text-shadow: 0 1px 8px rgba(0,0,0,.45); }

.stats-row { display: flex; gap: 26px; flex-wrap: wrap; }
.stat b { display: block; font: 600 25px/1.1 var(--serif); color: var(--ochre-deep); }
.stat span { font: 600 10.5px/1 var(--sans); letter-spacing: .1em;
             text-transform: uppercase; color: var(--muted); }
.hero .stat b { color: #fff; } .hero .stat span { color: rgba(255,255,255,.8); }

.progress { height: 6px; background: var(--paper-3); border-radius: 3px;
            overflow: hidden; margin-top: 7px; }
.progress > i { display: block; height: 100%; background: var(--ochre); }

.feed-item { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.feed-item:last-child { border: 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  border: 0; background: none; padding: 9px 15px; cursor: pointer;
  font: 600 13.5px/1 var(--sans); color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.on { color: var(--ochre-deep); border-bottom-color: var(--ochre); }

@media (max-width: 900px) {
  .nav { display: none; position: absolute; top: 62px; left: 0; right: 0;
         flex-direction: column; background: var(--paper-2);
         border-bottom: 1px solid var(--line); padding: 8px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .burger { display: block; }
  .map-panel { width: auto; left: 10px; right: 10px; max-height: 46%; }
  .checkin-fab span { display: none; } .checkin-fab { padding: 16px; }
  .page { padding: 18px 14px 90px; }
  .hero-in { padding: 30px 22px; } .hero h1 { font-size: 29px; }
  .brand-text b { font-size: 15px; }
}

/* ===================== БАЙКЕРСКИЙ СЛОЙ 2026 ====================
   Кожа и асфальт остаются на полях, а контент лежит на светлой
   «дорожной карте». Так стилистика не ухудшает читаемость. */
body {
  background-color: #171614;
  background-image:
    linear-gradient(rgba(20,19,17,.24), rgba(20,19,17,.5)),
    url('/img/biker-road-texture.jpg');
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
}

#app { min-height: calc(100vh - 62px); }
.page {
  position: relative;
  background: rgba(242,234,219,.965);
  border-inline: 1px solid rgba(201,174,132,.48);
  box-shadow: 0 0 70px rgba(0,0,0,.38);
}

.top {
  color: #f4ead8;
  background:
    linear-gradient(90deg, rgba(194,97,31,.13), transparent 28%),
    rgba(25,24,21,.96);
  border-bottom: 1px solid #6f4b31;
  box-shadow: 0 3px 0 #111, 0 12px 28px rgba(0,0,0,.25);
}
.top::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px;
  background: repeating-linear-gradient(90deg, #a94f1b 0 9px, transparent 9px 16px);
  opacity: .7;
}
.brand-mark {
  width: 42px; height: 42px; border: 2px solid #d67932; color: #efdbc0;
  background: radial-gradient(circle, #453122, #1b1916 72%);
  box-shadow: inset 0 0 0 3px #171614, 0 0 0 1px #9d734d;
}
.brand-mark svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-text b { color: #fff6e8; letter-spacing: .045em; }
.brand-text span, .top .muted { color: #bdae9b; }
.nav a { color: #d5c8b5; border-radius: 2px; text-transform: uppercase; letter-spacing: .045em; font-size: 12px; }
.nav a:hover { color: white; background: rgba(194,97,31,.17); }
.nav a.active { color: #ffad6f; border-bottom-color: #d56a27; }
.lang-switch { border-color: #665a4c; }
.lang-switch button { color: #bdae9b; }
.lang-switch button.on { background: #c2611f; color: white; }
.burger { color: #f3e7d4; }
.user-chip { color: #f5ead8; background: #2b2925; border-color: #655848; }

/* Фото и сгенерированные эмблемы становятся круглыми нашивками. */
.avatar-patch {
  width: calc(var(--avatar-size) + 6px); height: calc(var(--avatar-size) + 6px);
  padding: 3px; display: inline-grid; place-items: center; flex: 0 0 auto;
  border-radius: 50%; vertical-align: middle;
  background: repeating-conic-gradient(#d2b181 0 7deg, #644b32 7deg 14deg);
  box-shadow: 0 0 0 2px #231f1a, 0 2px 5px rgba(0,0,0,.25);
  transform: rotate(-1.5deg);
}
.avatar-patch .avatar {
  border: 2px solid #f2eadb; background: #2c352e;
  object-position: center 28%; filter: saturate(.88) contrast(1.04);
}
.story-ring .avatar-patch { width: 100%; height: 100%; padding: 2px; }
.story-ring .avatar { width: 100% !important; height: 100% !important; }
.club-colors {
  display: block; flex: 0 0 auto; object-fit: cover; border-radius: 8px 14px 8px 14px;
  border: 2px solid #241f1a; outline: 2px dashed #a8865d; outline-offset: 2px;
  box-shadow: 0 4px 9px rgba(28,21,15,.24); transform: rotate(-2deg);
}
.club-colors-lg { border-width: 3px; outline-offset: 3px; }

.card, .post, .passport, .modal {
  background-color: #fbf5e9;
  background-image: linear-gradient(100deg, rgba(151,111,64,.025), transparent 30%, rgba(151,111,64,.035));
  border-color: #cbb997;
  box-shadow: 0 2px 0 #aa8a5d, 0 12px 30px rgba(24,18,12,.12);
}
.card { position: relative; }
.card::after {
  content: ''; position: absolute; inset: 5px; border: 1px dashed rgba(119,86,48,.18);
  pointer-events: none; border-radius: 2px;
}
.card:hover { transform: translateY(-3px) rotate(-.15deg); box-shadow: 0 4px 0 #a85a27, 0 18px 34px rgba(24,18,12,.18); }

.section-head h2::before { content: '◆'; margin-right: 9px; color: var(--ochre); font-size: .64em; vertical-align: .15em; }
.badge { border-radius: 999px; border-width: 1.5px; font-weight: 700; letter-spacing: .025em; }
.club-chip { border-radius: 4px 12px 4px 12px; border-width: 2px; box-shadow: inset 0 0 0 2px #f1e7d6; text-transform: uppercase; }

.hero {
  min-height: 390px; border: 4px solid #2b2520; border-radius: 6px 16px 6px 16px;
  box-shadow: 0 0 0 2px #bb8759, 0 18px 38px rgba(0,0,0,.25);
}
.hero::before { content: ''; position: absolute; inset: 10px; z-index: 1; border: 1px dashed rgba(255,231,200,.55); pointer-events: none; }
.hero::after { content: 'RIDE • EXPLORE • REMEMBER'; position: absolute; z-index: 2; right: 22px; bottom: 18px; color: rgba(255,255,255,.68); font: 700 10px/1 var(--mono); letter-spacing: .18em; }
.hero img { opacity: .64; filter: saturate(.72) contrast(1.12) sepia(.12); }
.hero-in { z-index: 2; padding: 54px 48px; }
.hero h1 { font-weight: 700; letter-spacing: .01em; }
.post-media img { filter: saturate(.86) contrast(1.04); }
.post-media { border-block: 1px solid #b99b76; }

.stamp { border-width: 3px; box-shadow: 0 1px 0 rgba(255,255,255,.7), inset 0 0 12px rgba(120,72,25,.06); }
.checkin-fab { border-radius: 7px 18px 7px 18px; text-transform: uppercase; letter-spacing: .06em; }
.poi-pin {
  border-radius: 50% 50% 50% 8px;
  background: #29251f; border: 2px solid #d56b27; color: #fff;
  box-shadow: 0 0 0 2px rgba(244,232,211,.9), 0 5px 10px rgba(0,0,0,.34);
}
.leaflet-control-layers, .leaflet-popup-content-wrapper {
  border-radius: 4px 12px 4px 12px; border: 1px solid #94704a;
  box-shadow: 0 8px 24px rgba(0,0,0,.24);
}
input, select, textarea {
  border-color: #bba37f; background-color: rgba(255,250,240,.92);
  box-shadow: inset 0 1px 2px rgba(61,42,21,.08);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(194,97,31,.2); outline-offset: 1px;
  border-color: var(--ochre); box-shadow: inset 0 1px 2px rgba(61,42,21,.08), 0 0 0 3px rgba(194,97,31,.08);
}
::selection { color: white; background: var(--ochre-deep); }
* { scrollbar-color: #8b5d37 #ded0b9; scrollbar-width: thin; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .card:hover, .btn:hover, .checkin-fab:hover { transform: none; }
}

@media (max-width: 900px) {
  body { background-attachment: scroll; background-size: auto 100vh; }
  .nav { background: #211f1b; border-bottom-color: #60462f; }
  .nav a { padding: 12px; }
  .page { border-inline: 0; }
  .hero { min-height: 350px; }
  .hero-in { padding: 38px 25px 54px; }
  .hero::after { left: 25px; right: auto; }
}


/* ===== Колонки рейтингов на главной =====  /* boards-rail (Cowork) */
.home-grid { display: grid; grid-template-columns: 250px minmax(0,1fr) 250px; gap: 22px; align-items: start; }
.home-grid .feed { max-width: 640px; }
.rail { position: sticky; top: 74px; max-height: calc(100vh - 92px); overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 13px; padding-right: 3px; }
.rail::-webkit-scrollbar { width: 8px; }
.rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.rail-head { font-family: var(--serif); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); padding: 2px 2px 0; }
.board { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 10px 7px; box-shadow: var(--shadow-sm); }
.board-h { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.board-h h4 { font-size: 12.5px; font-weight: 700; color: var(--ink); margin: 0; line-height: 1.12; }
.board-unit { font-size: 10px; color: var(--muted); text-transform: lowercase; white-space: nowrap; margin-left: auto; }
.board-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.brow { display: flex; align-items: center; gap: 7px; padding: 3px 4px; border-radius: 3px;
  font-size: 12.5px; transition: background .6s ease; }
.brow-rank { width: 15px; text-align: right; color: var(--muted); font-weight: 700;
  font-variant-numeric: tabular-nums; flex: none; }
.brow .avatar-patch { flex: none; }
.brow-logo { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; border: 1px solid var(--line);
  display: grid; place-items: center; background: var(--paper); flex: none; }
.brow-logo img { width: 100%; height: 100%; object-fit: cover; }
.brow-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink-soft); font-weight: 600; }
.brow-name:hover { color: var(--ochre-deep); }
.brow-val { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.brow-delta { flex: none; font-size: 10px; font-weight: 700; line-height: 1; }
.brow-delta.up { color: var(--forest); } .brow-delta.new { color: var(--ochre); } .brow-delta.down { color: var(--muted); }
.brow-up { animation: browRaise 1.8s ease; }
@keyframes browRaise { 0% { background: rgba(194,97,31,.22); } 100% { background: transparent; } }
@media (max-width: 1080px) { .home-grid { display: block; } .rail { display: none; } }

/* МОТОСТРАНА: главная страница дорожного сообщества. */
.brand-text b { font-size: 20px; letter-spacing: .025em; white-space: nowrap; }
.brand-text b .brand-accent { display: inline; font: inherit; color: #ef9852; letter-spacing: inherit; }
.moto-home { padding-top: 28px; }
.moto-hero { position: relative; overflow: hidden; isolation: isolate; background: #191e1b; color: #fff8eb; border-radius: 4px; }
.moto-hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 56%; z-index: -2; }
.moto-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg,rgba(12,22,20,.94),rgba(12,22,20,.72) 43%,rgba(12,22,20,.12)),linear-gradient(0deg,rgba(12,22,20,.7),transparent 45%); }
.moto-hero-content { padding: 52px 52px 38px; max-width: 740px; }
.moto-eyebrow { display: block; color: #efba87; font: 700 10px/1.6 var(--mono); letter-spacing: .16em; margin-bottom: 24px; }
.moto-hero h1 { font-family: var(--sans); font-weight: 850; font-size: clamp(36px,4.7vw,66px); line-height: 1.02; letter-spacing: -.045em; margin: 0 0 24px; }
.moto-hero h1 em { color: #eda15e; font-style: normal; }
.moto-hero-content > p { max-width: 440px; color: #e1e0d4; font-size: 16px; line-height: 1.65; }
.moto-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 16px; }
.moto-hero-actions .btn { min-height: 46px; padding: 11px 22px; border-radius: 3px; }
.moto-map-button { background: rgba(14,25,22,.4); color: #fff8eb; border-color: #a4a99a; }
.moto-map-button:hover { background: #26372e; color: white; }
.moto-passport-link { display: inline-block; font-size: 12px; color: #e1d5bc; text-decoration: underline; text-underline-offset: 4px; }
.moto-photo-caption { position: absolute; right: 26px; bottom: 124px; font: 600 10px/1.6 var(--mono); letter-spacing: .13em; color: #fff6df; }
.moto-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 22px 52px; border-top: 1px solid #ffffff30; background: rgba(13,22,19,.65); }
.moto-stats > div { padding-left: 26px; border-left: 1px solid #ffffff30; }
.moto-stats > div:first-child { padding-left: 0; border-left: 0; }
.moto-stats b { display: block; font: 700 29px/1.1 var(--sans); font-variant-numeric: tabular-nums; }
.moto-stats small { color: #bcbea9; font-size: 17px; font-weight: 400; }
.moto-stats span { display: block; margin-top: 6px; color: #d0d1c3; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }
.moto-explore { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin: 22px 0 36px; }
.moto-explore-card { display: flex; align-items: stretch; min-width: 0; background: #fbf6ec; border: 1px solid #d6c7ac; border-radius: 4px; overflow: hidden; transition: border-color .15s; }
.moto-explore-card:hover { border-color: var(--ochre); }
.moto-explore-card img { width: 30%; max-width: 112px; object-fit: cover; }
.moto-explore-card > div { padding: 14px 15px; }
.moto-section-number { font: 700 10px/1 var(--mono); color: var(--ochre-deep); }
.moto-explore-card h2 { margin: 6px 0; font-size: 19px; }
.moto-explore-card p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.home-feed-heading { margin-bottom: 18px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.home-feed-heading h2 { margin: 8px 0; font-size: 31px; }
.home-feed-heading p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.home-feed-toolbar { gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.moto-home .home-grid .feed { width: 100%; min-width: 0; }
.moto-home .rail-head { color: var(--ink-soft); padding-bottom: 10px; border-bottom: 2px solid var(--ochre); }
.moto-home .board { padding: 13px 12px; }
.moto-home .board-h { margin-bottom: 12px; }
.moto-home .post { box-shadow: 0 2px 8px rgba(24,18,12,.07); }
.moto-home a:focus-visible, .moto-home button:focus-visible { outline: 3px solid #e19144; outline-offset: 4px; }
@media (max-width: 1080px) {
  .moto-explore-card img { display: none; }
  .moto-photo-caption { display: none; }
}
@media (max-width: 600px) {
  .moto-home { padding-top: 14px; }
  .moto-hero-content { padding: 30px 22px; }
  .moto-hero::before { background: linear-gradient(90deg,rgba(12,22,20,.91),rgba(12,22,20,.55)); }
  .moto-eyebrow { font-size: 9px; letter-spacing: .08em; margin-bottom: 20px; }
  .moto-hero-content > p { font-size: 14px; }
  .moto-hero-actions { flex-direction: column; align-items: stretch; }
  .moto-hero-actions .btn { justify-content: center; text-align: center; }
  .moto-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px 14px; padding: 24px 22px; }
  .moto-stats > div { padding-left: 14px; }
  .moto-stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .moto-stats b { font-size: 26px; }
  .moto-explore { grid-template-columns: 1fr; gap: 10px; margin-bottom: 28px; }
  .moto-explore-card img { display: block; width: 86px; }
  .moto-explore-card > div { padding: 10px 14px; }
  .moto-explore-card h2 { font-size: 18px; margin: 4px 0; }
  .home-feed-toolbar .tabs { flex-wrap: wrap; }
  .brand-text b { font-size: 17px; }
}
