@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500;1,600&display=swap');
:root
{
  --paper:#f4f1e9;
  --ink:#1e211e;
  --muted:#77796f;
  --line:#d9d5cb;
  --red:#a23c2f;
  --green:#5d6b5c;
  --white:#fffdf8;
  --mono:'DM Mono',monospace;
  --sans:'Manrope',sans-serif;
  --serif:'Playfair Display',serif
}
*
{
  box-sizing:border-box
}
html
{
  scroll-behavior:smooth
}
body
{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--sans);
  -webkit-font-smoothing:antialiased
}
a
{
  color:inherit;
  text-decoration:none
}
.topbar
{
  height:84px;
  padding:0 5.4vw;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  gap:24px
}
.brand
{
  display:flex;
  align-items:center;
  gap:11px;
  font-size:14px;
  font-weight:800;
  letter-spacing:.13em
}
.brand small
{
  display:block;
  font-size:9px;
  letter-spacing:.06em;
  color:var(--muted);
  font-weight:500;
  margin-top:4px
}
.brand-mark,.ending-mark
{
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  background:var(--red);
  color:white;
  font-family:var(--serif);
  font-size:24px
}
.topbar nav
{
  display:flex;
  gap:30px;
  font-size:12px;
  color:#55584f
}
.topbar nav a:hover,.source-link:hover
{
  color:var(--red)
}
.source-link
{
  font-size:11px;
  border-bottom:1px solid var(--line);
  padding-bottom:5px
}
.menu
{
  display:none;
  background:none;
  border:0;
  font-size:24px
}
.hero
{
  padding:76px 8vw 70px;
  display:grid;
  grid-template-columns:1.08fr .92fr;
  gap:8vw;
  min-height:650px;
  align-items:center
}
.eyebrow,.kicker,.section-no,.visual-tag,.visual-caption,.hero-meta,.intro-band span,.map-toolbar,.map-foot,.list-heading,.route-number,.duration,.ending footer,.source-link
{
  font-family:var(--mono);
  letter-spacing:.06em
}
.eyebrow
{
  font-size:10px;
  color:var(--green);
  display:flex;
  align-items:center;
  gap:10px
}
.eyebrow i,.live-dot
{
  display:inline-block;
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--red);
  box-shadow:0 0 0 4px #a23c2f18
}
.kicker
{
  font-size:10px;
  color:var(--red);
  margin:36px 0 15px
}
.hero h1
{
  font-size:clamp(42px,5vw,70px);
  line-height:1.08;
  letter-spacing:-.055em;
  margin:0;
  font-weight:700
}
.hero h1 em,.section-head h2 em,.ending h2 em
{
  font-family:var(--serif);
  font-weight:500;
  color:var(--red)
}
.lead
{
  font-size:14px;
  line-height:1.9;
  color:#606258;
  max-width:560px;
  margin:24px 0
}
.hero-actions
{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-top:28px
}
.button
{
  display:inline-flex;
  align-items:center;
  gap:26px;
  padding:15px 19px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.02em;
  border:1px solid var(--ink);
  transition:.25s
}
.button span
{
  font-size:17px
}
.button.dark
{
  background:var(--ink);
  color:var(--white)
}
.button.dark:hover
{
  background:var(--red);
  border-color:var(--red);
  transform:translateY(-2px)
}
.button.quiet
{
  border-color:var(--line)
}
.button.quiet:hover
{
  border-color:var(--red);
  color:var(--red)
}
.hero-meta
{
  display:flex;
  gap:28px;
  flex-wrap:wrap;
  margin-top:47px;
  font-size:9px;
  color:var(--muted)
}
.hero-meta b
{
  display:block;
  font-family:var(--sans);
  font-size:24px;
  color:var(--ink);
  letter-spacing:-.04em;
  margin-bottom:4px
}
.hero-visual
{
  max-width:510px;
  width:100%;
  justify-self:end
}
.visual-tag
{
  font-size:9px;
  color:var(--muted);
  margin-bottom:14px
}
.photo-stack
{
  position:relative;
  background:#e3dfd3;
  padding:16px;
  transform:rotate(1.1deg);
  box-shadow:0 20px 55px #211c141c
}
.photo-stack:after
{
  content:'';
  position:absolute;
  inset:16px;
  border:1px solid #ffffff75;
  pointer-events:none
}
.photo-stack img
{
  width:100%;
  height:380px;
  display:block;
  object-fit:cover;
  filter:grayscale(1) contrast(1.05);
  transition:filter .6s,transform .6s
}
.photo-stack:hover img
{
  filter:grayscale(.15) contrast(1.03);
  transform:scale(1.01)
}
.stack-stamp
{
  position:absolute;
  right:28px;
  bottom:29px;
  background:var(--red);
  color:white;
  font-family:var(--mono);
  font-size:10px;
  line-height:1.55;
  padding:13px;
  transform:rotate(-5deg);
  letter-spacing:.08em
}
.visual-caption
{
  display:flex;
  justify-content:space-between;
  font-size:8px;
  color:var(--muted);
  margin-top:20px
}
.intro-band
{
  padding:28px 8vw;
  background:#e9e5da;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:30px
}
.intro-band p
{
  font-family:var(--serif);
  font-size:19px;
  line-height:1.6;
  max-width:780px;
  margin:0
}
.intro-band span,.section-no
{
  font-size:9px;
  color:var(--red);
  white-space:nowrap
}
.route-section,.stories-section
{
  padding:100px 7vw
}
.section-head
{
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:40px;
  margin-bottom:38px
}
.section-head h2
{
  font-size:clamp(36px,4.2vw,57px);
  line-height:1.13;
  letter-spacing:-.045em;
  margin:17px 0 0
}
.section-head>p
{
  max-width:390px;
  font-size:12px;
  line-height:1.9;
  color:var(--muted);
  margin:0 0 5px
}
.route-layout
{
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(300px,.72fr);
  border:1px solid var(--line);
  background:var(--white);
  min-height:610px
}
.map-shell
{
  min-width:0;
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column
}
.map-toolbar,.map-foot
{
  padding:15px 18px;
  display:flex;
  justify-content:space-between;
  gap:14px;
  font-size:9px;
  color:var(--muted)
}
.map-toolbar
{
  border-bottom:1px solid var(--line);
  color:var(--ink)
}
.map-note
{
  font-family:var(--sans);
  letter-spacing:0
}
.map-toolbar .live-dot
{
  width:6px;
  height:6px;
  margin-right:8px
}
.map-foot
{
  border-top:1px solid var(--line);
  font-size:8px
}
#map
{
  height:535px;
  min-height:430px;
  background:#e6e8df;
  z-index:1
}
.route-list
{
  max-height:610px;
  overflow:auto
}
.list-heading
{
  display:flex;
  justify-content:space-between;
  padding:17px 18px;
  font-size:9px;
  color:var(--muted);
  border-bottom:1px solid var(--line)
}
.route-item
{
  display:grid;
  grid-template-columns:34px 1fr 20px;
  gap:11px;
  padding:15px 17px;
  border-bottom:1px solid #e9e5dc;
  cursor:pointer;
  transition:background .2s
}
.route-item:hover,.route-item.active
{
  background:#eee9dd
}
.route-number
{
  font-size:10px;
  color:var(--red);
  padding-top:3px
}
.route-item strong
{
  display:block;
  font-size:11px;
  line-height:1.55;
  font-weight:700
}
.route-item small
{
  display:block;
  margin-top:6px;
  font-size:9px;
  color:var(--muted)
}
.route-arrow
{
  font-size:16px;
  color:#a4a194
}
.map-caveat
{
  font-size:10px;
  line-height:1.7;
  color:var(--muted);
  margin-top:15px
}
.leaflet-popup-content-wrapper
{
  border-radius:0;
  font-family:var(--sans)
}
.leaflet-popup-content
{
  font-size:12px;
  line-height:1.5
}
.map-popup a
{
  color:var(--red);
  font-weight:700
}
.custom-pin
{
  width:30px;
  height:30px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:var(--red);
  border:2px solid #fffdf8;
  color:white;
  font:10px var(--mono);
  box-shadow:0 3px 10px #0003
}
.stories-section
{
  background:#e9e5da
}
.story-grid
{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:17px
}
.story-card
{
  background:var(--white);
  border:1px solid #d9d5cb;
  display:flex;
  flex-direction:column;
  min-width:0;
  transition:transform .25s,box-shadow .25s
}
.story-card:hover
{
  transform:translateY(-4px);
  box-shadow:0 14px 30px #30271a12
}
.story-image
{
  height:190px;
  position:relative;
  overflow:hidden;
  background:#d7d3c8
}
.story-image img
{
  width:100%;
  height:100%;
  object-fit:cover;
  filter:grayscale(1);
  transition:filter .45s,transform .6s
}
.story-card:hover .story-image img
{
  filter:grayscale(.1);
  transform:scale(1.035)
}
.story-index
{
  position:absolute;
  left:12px;
  top:12px;
  background:var(--red);
  color:white;
  padding:7px 9px;
  font:10px var(--mono)
}
.story-body
{
  padding:19px;
  display:flex;
  flex-direction:column;
  flex:1
}
.story-body h3
{
  font-size:14px;
  line-height:1.5;
  margin:0 0 10px
}
.story-body p
{
  font-size:10px;
  line-height:1.7;
  color:var(--muted);
  margin:0 0 18px
}
.audio-label
{
  font:9px var(--mono);
  color:var(--red);
  margin-top:auto;
  margin-bottom:9px
}
.story-body audio
{
  width:100%;
  height:34px;
  accent-color:var(--red)
}
.story-links
{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-top:13px;
  font-size:9px;
  color:var(--muted)
}
.story-links a:hover
{
  color:var(--red)
}
.duration
{
  font-size:9px;
  color:var(--muted);
  margin-top:8px
}
.ethics
{
  display:grid;
  grid-template-columns:60px 1fr;
  gap:30px;
  padding:75px 12vw;
  border-bottom:1px solid var(--line)
}
.ethics-mark
{
  width:52px;
  height:52px;
  background:var(--ink);
  color:white;
  display:grid;
  place-items:center;
  font-size:24px
}
.ethics h2
{
  font-size:32px;
  letter-spacing:-.04em;
  margin:14px 0
}
.ethics p
{
  max-width:850px;
  font-size:12px;
  line-height:1.9;
  color:var(--muted)
}
.ethics a
{
  display:inline-block;
  font-size:11px;
  color:var(--red);
  margin-top:8px;
  border-bottom:1px solid #a23c2f55;
  padding-bottom:4px
}
.ending
{
  padding:80px 8vw 28px;
  text-align:center
}
.ending-mark
{
  margin:0 auto 28px
}
.ending h2
{
  font-size:clamp(38px,5vw,64px);
  line-height:1.13;
  letter-spacing:-.05em;
  margin:25px 0
}
.ending p
{
  font-size:12px;
  color:var(--muted)
}
.ending footer
{
  border-top:1px solid var(--line);
  margin-top:70px;
  padding-top:18px;
  display:flex;
  justify-content:space-between;
  gap:18px;
  font-size:8px;
  color:var(--muted)
}
.ending footer a
{
  color:var(--red)
}
@media(max-width:900px)
{
  .hero
  {
    padding:60px 6vw;
    gap:5vw
  }
  .hero h1
  {
    font-size:clamp(38px,6vw,56px)
  }
  .topbar
  {
    padding:0 5vw
  }
  .topbar nav
  {
    gap:15px
  }
  .route-section,.stories-section
  {
    padding:75px 5vw
  }
  .route-layout
  {
    grid-template-columns:1fr
  }
  .map-shell
  {
    border-right:0;
    border-bottom:1px solid var(--line)
  }
  #map
  {
    height:450px
  }
  .route-list
  {
    max-height:400px
  }
  .story-grid
  {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
  .section-head
  {
    align-items:start;
    flex-direction:column;
    gap:20px
  }
}
@media(max-width:600px)
{
  .topbar
  {
    height:70px
  }
  .topbar nav
  {
    display:none;
    position:absolute;
    top:70px;
    left:0;
    right:0;
    background:var(--paper);
    padding:20px 6vw;
    z-index:20;
    flex-direction:column;
    border-bottom:1px solid var(--line)
  }
  body.nav-open .topbar nav
  {
    display:flex
  }
  .source-link
  {
    font-size:8px;
    margin-left:auto
  }
  .menu
  {
    display:block
  }
  .hero
  {
    grid-template-columns:1fr;
    padding:48px 6vw;
    gap:44px
  }
  .hero h1
  {
    font-size:43px
  }
  .hero-meta
  {
    gap:20px
  }
  .hero-visual
  {
    justify-self:stretch;
    max-width:none
  }
  .photo-stack img
  {
    height:280px
  }
  .intro-band
  {
    padding:24px 6vw;
    align-items:start;
    flex-direction:column;
    gap:12px
  }
  .intro-band p
  {
    font-size:17px
  }
  .route-section,.stories-section
  {
    padding:65px 5vw
  }
  .section-head h2
  {
    font-size:40px
  }
  .section-head>p
  {
    font-size:11px
  }
  .map-toolbar,.map-foot
  {
    flex-wrap:wrap
  }
  #map
  {
    height:390px;
    min-height:390px
  }
  .story-grid
  {
    grid-template-columns:1fr
  }
  .story-image
  {
    height:220px
  }
  .ethics
  {
    padding:55px 7vw;
    grid-template-columns:1fr;
    gap:18px
  }
  .ethics h2
  {
    font-size:29px
  }
  .ending
  {
    padding:60px 6vw 24px
  }
  .ending footer
  {
    flex-direction:column;
    align-items:center;
    margin-top:45px
  }
  .source-link
  {
    max-width:100px;
    text-align:right;
    line-height:1.5
  }
}
/* Refined route selector and selected-stop detail */
.hero h1
{
  max-width:760px
}
.route-layout
{
  grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr);
  align-items:stretch
}
.route-list
{
  max-height:535px;
  overflow-y:auto;
  scrollbar-width:thin;
  scrollbar-color:#bcb5a7 transparent
}
.route-item
{
  width:100%;
  height:72px;
  min-height:72px;
  max-height:72px;
  grid-template-columns:32px minmax(0,1fr) 18px;
  align-items:center;
  gap:10px;
  padding:9px 14px;
  text-align:left;
  background:transparent;
  border:0;
  border-bottom:1px solid #e9e5dc;
  font-family:var(--sans)
}
.route-item:last-child
{
  border-bottom:0
}
.route-item:hover,.route-item.active
{
  background:#eee9dd
}
.route-item.active
{
  box-shadow:inset 3px 0 var(--red)
}
.route-title
{
  display:block;
  min-width:0;
  overflow:hidden
}
.route-item strong
{
  font-size:10px;
  line-height:1.35;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  font-weight:700;
  max-height:2.7em
}
.route-item small
{
  font-size:8px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  margin-top:4px
}
.route-number
{
  font-size:10px
}
.route-arrow
{
  font-size:14px;
  justify-self:end
}
.stop-detail
{
  margin-top:22px;
  display:grid;
  grid-template-columns:minmax(260px,.82fr) minmax(0,1.18fr);
  min-height:360px;
  background:var(--white);
  border:1px solid var(--line);
  overflow:hidden;
  scroll-margin-top:20px
}
.detail-photo
{
  position:relative;
  min-height:360px;
  overflow:hidden;
  background:#d8d4c8
}
.detail-photo img
{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  filter:grayscale(.72) sepia(.13) contrast(1.09) brightness(.96);
  transform:scale(1.015);
  animation:photoReveal .9s ease both;
  transition:filter .5s,transform 1.2s
}
.stop-detail:hover .detail-photo img
{
  filter:grayscale(.25) sepia(.08) contrast(1.06);
  transform:scale(1.055)
}
.detail-photo:after
{
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(180deg,#1c201c00 45%,#1c201c70 100%);
  pointer-events:none
}
.detail-photo-label
{
  position:absolute;
  left:20px;
  bottom:18px;
  z-index:2;
  color:#fff;
  font:10px var(--mono);
  letter-spacing:.12em
}
.photo-grain
{
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
  opacity:.18;
  background:repeating-linear-gradient(0deg,transparent 0 4px,#ffffff22 5px,transparent 6px);
  mix-blend-mode:soft-light
}
.detail-content
{
  padding:clamp(24px,4vw,48px);
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:0
}
.detail-content h3
{
  font-size:clamp(23px,3vw,35px);
  line-height:1.18;
  letter-spacing:-.04em;
  margin:15px 0 16px;
  max-width:650px
}
.detail-description
{
  font-size:12px;
  line-height:1.9;
  color:#68695f;
  max-width:620px;
  margin:0 0 25px
}
.detail-content audio
{
  width:100%;
  height:40px;
  accent-color:var(--red)
}
.detail-actions
{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  flex-wrap:wrap;
  margin-top:17px
}
.detail-link,.detail-note
{
  font-size:10px;
  color:var(--muted)
}
.detail-link:hover,.text-button:hover
{
  color:var(--red)
}
.text-button
{
  border:0;
  background:transparent;
  color:var(--ink);
  font:600 10px var(--sans);
  cursor:pointer;
  padding:7px 0;
  border-bottom:1px solid var(--line)
}
.map-caveat
{
  max-width:900px
}
.memory-panel
{
  background:var(--white);
  border:1px solid var(--line);
  display:grid;
  grid-template-columns:.8fr 1fr;
  gap:0
}
.memory-intro
{
  padding:36px;
  background:#e0ddd2
}
.memory-symbol
{
  font-size:25px;
  color:var(--red)
}
.memory-intro h3
{
  font-size:25px;
  line-height:1.2;
  letter-spacing:-.04em;
  margin:23px 0 12px
}
.memory-intro p
{
  font-size:11px;
  line-height:1.9;
  color:#65665c;
  max-width:390px
}
.memory-form
{
  padding:34px;
  display:flex;
  flex-direction:column;
  gap:15px
}
.memory-form label
{
  display:flex;
  flex-direction:column;
  gap:7px;
  font-size:10px;
  font-weight:700
}
.memory-form input:not([type=checkbox]),.memory-form select,.memory-form textarea
{
  width:100%;
  border:1px solid var(--line);
  background:#fffdf8;
  color:var(--ink);
  font:12px var(--sans);
  padding:12px 13px;
  border-radius:0;
  outline:none
}
.memory-form input:focus,.memory-form select:focus,.memory-form textarea:focus
{
  border-color:var(--red)
}
.memory-form textarea
{
  resize:vertical;
  line-height:1.7
}
.optional
{
  font-size:9px;
  color:var(--muted);
  font-weight:400
}
.memory-form .consent
{
  display:flex;
  flex-direction:row;
  align-items:flex-start;
  gap:9px;
  font-weight:400;
  line-height:1.6;
  color:var(--muted)
}
.memory-form .consent input
{
  margin-top:2px;
  accent-color:var(--red)
}
.memory-form .button
{
  align-self:flex-start;
  cursor:pointer
}
.form-status
{
  font-size:10px;
  color:var(--green);
  min-height:14px;
  margin:0
}
.memory-list
{
  grid-column:1/-1;
  border-top:1px solid var(--line);
  padding:22px 28px
}
.memory-list-title
{
  font:9px var(--mono);
  letter-spacing:.08em;
  color:var(--red);
  margin-bottom:14px
}
.memory-empty
{
  font-size:11px;
  line-height:1.8;
  color:var(--muted)
}
.memory-card
{
  border-top:1px solid var(--line);
  padding:15px 0
}
.memory-card-meta
{
  font:10px var(--mono);
  color:var(--ink);
  display:flex;
  justify-content:space-between;
  gap:15px
}
.memory-card-meta span
{
  color:var(--muted)
}
.memory-card p
{
  font-size:12px;
  line-height:1.8;
  color:#5e6057;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  margin:10px 0 0
}
.ending h2
{
  margin-bottom:18px
}
.ending h2 em
{
  font-style:italic
}
@keyframes photoReveal
{
  from
  {
    opacity:.65;
    transform:scale(1.07);
    filter:grayscale(1) contrast(.85)
  }
  to
  {
    opacity:1;
    transform:scale(1.015);
    filter:grayscale(.72) sepia(.13) contrast(1.09) brightness(.96)
  }
}
@media(max-width:900px)
{
  .route-layout
  {
    grid-template-columns:1fr
  }
  .route-list
  {
    max-height:370px
  }
  .stop-detail
  {
    grid-template-columns:1fr 1fr
  }
  .detail-photo
  {
    min-height:330px
  }
  .memory-panel
  {
    grid-template-columns:1fr 1.1fr
  }
}
@media(max-width:600px)
{
  .route-item
  {
    height:68px;
    min-height:68px;
    max-height:68px;
    padding:8px 12px
  }
  .route-list
  {
    max-height:340px
  }
  .stop-detail
  {
    grid-template-columns:1fr
  }
  .detail-photo
  {
    min-height:245px;
    height:245px
  }
  .detail-content
  {
    padding:25px 22px
  }
  .detail-content h3
  {
    font-size:27px
  }
  .memory-panel
  {
    grid-template-columns:1fr
  }
  .memory-intro,.memory-form
  {
    padding:25px 22px
  }
  .memory-list
  {
    padding:20px 22px
  }
  .detail-actions
  {
    align-items:flex-start;
    flex-direction:column;
    gap:8px
  }
  .route-item strong
  {
    font-size:10px
  }
}
/* Галерея изображений: единая сетка, плавное переключение, источник каждого внешнего снимка */
.detail-visual-column
{
  min-width:0;
  background:var(--white);
  display:flex;
  flex-direction:column;
}
.detail-photo
{
  position:relative;
  min-height:340px;
  height:clamp(340px,34vw,480px);
  overflow:hidden;
  background:#d8d4c8;
  isolation:isolate;
}
.detail-photo img
{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  filter:contrast(1.06) saturate(1.06) brightness(1.015);
  transition:opacity .22s ease,filter .45s,transform .8s;
}
.stop-detail:hover .detail-photo img
{
  filter:contrast(1.08) saturate(1.09) brightness(1.02);
  transform:scale(1.018)
}
.gallery-arrow
{
  position:absolute;
  z-index:4;
  top:50%;
  transform:translateY(-50%);
  width:40px;
  height:40px;
  border:1px solid #ffffff80;
  background:#171915aa;
  color:white;
  font-size:28px;
  line-height:1;
  display:grid;
  place-items:center;
  cursor:pointer;
  backdrop-filter:blur(8px);
  transition:background .2s,opacity .2s
}
.gallery-arrow:hover
{
  background:var(--red)
}
.gallery-arrow:disabled
{
  opacity:.25;
  cursor:default
}
.gallery-arrow.prev
{
  left:14px
}
.gallery-arrow.next
{
  right:14px
}
.gallery-count
{
  position:absolute;
  z-index:4;
  right:16px;
  bottom:15px;
  background:#171915c9;
  color:white;
  padding:7px 10px;
  font:10px var(--mono);
  letter-spacing:.08em
}
.gallery-caption
{
  padding:12px 17px 10px;
  border-bottom:1px solid var(--line);
  display:flex;
  flex-direction:column;
  gap:4px;
  min-height:64px
}
.gallery-caption strong
{
  font-size:10px;
  line-height:1.45;
  font-weight:700
}
.gallery-caption small
{
  font-size:8px;
  line-height:1.4;
  color:var(--muted)
}
.gallery-caption a
{
  align-self:flex-start;
  font-size:9px;
  color:var(--red);
  margin-top:3px
}
.gallery-caption a[hidden]
{
  display:none
}
.gallery-thumbs
{
  display:flex;
  gap:7px;
  padding:10px 12px 13px;
  overflow-x:auto;
  scrollbar-width:thin;
  scrollbar-color:#bcb5a7 transparent;
  background:var(--white)
}
.gallery-thumb
{
  position:relative;
  flex:0 0 76px;
  width:76px;
  height:54px;
  padding:0;
  border:1px solid transparent;
  background:#ded9ce;
  overflow:hidden;
  cursor:pointer;
  opacity:.68;
  transition:opacity .2s,border-color .2s
}
.gallery-thumb.active
{
  opacity:1;
  border-color:var(--red);
  box-shadow:0 0 0 1px var(--red)
}
.gallery-thumb img
{
  width:100%;
  height:100%;
  object-fit:cover;
  filter:contrast(1.04) saturate(.9)
}
.gallery-thumb span
{
  position:absolute;
  right:3px;
  bottom:3px;
  background:#171915bd;
  color:white;
  padding:2px 4px;
  font:8px var(--mono)
}
.detail-content
{
  align-self:stretch
}
.detail-description
{
  max-width:640px
}
.detail-content audio
{
  margin-bottom:2px
}
@media(max-width:900px)
{
  .stop-detail
  {
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)
  }
  .detail-photo
  {
    height:340px;
    min-height:340px
  }
}
@media(max-width:600px)
{
  .stop-detail
  {
    grid-template-columns:1fr
  }
  .detail-photo
  {
    height:260px;
    min-height:260px
  }
  .gallery-thumb
  {
    flex-basis:70px;
    width:70px;
    height:50px
  }
  .gallery-caption
  {
    padding:11px 14px
  }
  .detail-visual-column
  {
    min-width:0
  }
}

/* Ненавязчивое управление фоновой музыкой */
.music-toggle{border:1px solid var(--line);background:transparent;color:var(--ink);border-radius:999px;padding:10px 13px;font:500 11px var(--mono);letter-spacing:.02em;cursor:pointer;display:inline-flex;align-items:center;gap:8px;white-space:nowrap}.music-toggle.is-playing{background:var(--ink);color:var(--paper);border-color:var(--ink)}.music-toggle:focus-visible{outline:2px solid var(--red);outline-offset:3px}@media(max-width:720px){.music-toggle{padding:9px 10px}.music-toggle span{display:none}}

/* Republic edition: preserve the original composition, update only its visual skin. */
:root{--paper:#211f1c;--ink:#eee6d9;--muted:#aaa092;--line:#51483f;--red:#9d4037;--green:#b2a18a;--white:#f0e7d8}
body{background:#211f1c;color:#eee6d9;background-image:radial-gradient(ellipse at 20% 10%,#57483b35,transparent 42%),linear-gradient(120deg,#171615,#292521 55%,#1c1a18)}
.topbar{background:#1b1917eF;border-color:#544a40;position:sticky;top:0;z-index:1000;backdrop-filter:blur(12px)}
.brand-mark,.ending-mark{background:#8f342e;color:#f5eadb}
.topbar nav{color:#d1c4b3}.topbar nav a:hover,.source-link:hover{color:#d17a68}
.hero h1,.section-head h2,.ending h2,.memory-intro h3,.detail-content h3{color:#f1e8db}
.hero h1 em,.section-head h2 em,.ending h2 em{color:#c17a69}
.lead,.section-head>p,.memory-intro p,.detail-description{color:#c2b7a8}
.eyebrow,.kicker,.section-no,.visual-tag,.visual-caption,.hero-meta,.intro-band span,.map-toolbar,.map-foot,.list-heading,.route-number,.duration,.ending footer{color:#b7a995}
.photo-stack{background:#443a32;box-shadow:0 20px 55px #0008}.photo-stack img,.detail-photo img{filter:saturate(.82) sepia(.13) contrast(1.04)}
.intro-band,.route-section,.stories-section{border-color:#544a40}.intro-band{background:#2a2622;color:#e9dfd1}
.map-shell,.route-list,.stop-detail,.memory-panel{background:#292521;border-color:#544a40;box-shadow:0 18px 55px #0004}
.route-item{color:#e4d8c9;border-color:#4a423a}.route-item:hover,.route-item.active{background:#49332e;border-color:#8f4b40}.route-title small,.route-arrow{color:#b4a695}
.detail-content,.gallery-caption{color:#e8dfd2}.detail-photo{background:#181715}.gallery-thumb{border-color:#65594d}.gallery-thumb.active{border-color:#bb695b}
.memory-card,.memory-empty{background:#332e29;border-color:#51463c;color:#e7ddcf}.memory-card-meta,.memory-card-meta span{color:#c5b7a5}.demo-memory{border-style:dashed;border-color:#9e6b50}
.memory-form label{color:#e3d8c9}.memory-form input,.memory-form select,.memory-form textarea{background:#211f1c;color:#f0e7d8;border-color:#62564a}.memory-form input::placeholder,.memory-form textarea::placeholder{color:#998d7e}.consent{color:#c7b9a7}
.button.dark{background:#8f342e;border-color:#8f342e;color:#fff0e2}.button.dark:hover{background:#a94c40;border-color:#a94c40}.button.quiet,.detail-link,.text-button{color:#e7d6c5;border-color:#766455}
.ending{background:#1a1816;border-color:#51483f}.ending footer{border-color:#51483f}
.music-toggle{border-color:#66594b;color:#e7ddcf}.music-toggle.is-playing{background:#8f342e;border-color:#8f342e}
.language-picker{display:flex;align-items:center;gap:7px;color:#c9bca9;font:10px var(--mono);letter-spacing:.04em}.language-picker select{background:#2b2723;color:#eee5d8;border:1px solid #756556;border-radius:20px;padding:9px 11px;font:11px var(--mono);cursor:pointer}
.coordinate-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.memory-form [hidden]{display:none!important}.memory-form input[type=file]{padding:10px}.demo-memory:after{content:'DEMO';display:block;font:10px var(--mono);color:#d08a6f;letter-spacing:.12em;margin-top:8px}
@media(max-width:900px){.topbar{padding:0 4vw}.language-picker span{display:none}}
@media(max-width:600px){.topbar{gap:8px}.language-picker select{padding:7px 8px}.coordinate-fields{grid-template-columns:1fr}}


/* Theme switch and dark-mode contrast refinements */
.theme-toggle{border:1px solid #66594b;background:transparent;color:#e7ddcf;border-radius:999px;padding:9px 12px;font:500 10px var(--mono);cursor:pointer;display:inline-flex;align-items:center;gap:7px;white-space:nowrap;transition:.2s}
.theme-toggle:hover{border-color:#c17a69;color:#fff}
.theme-icon{font-size:15px;line-height:1}
/* Keep map tiles and native audio controls inside the dark visual language. */
body:not(.light-theme) #map .leaflet-tile{filter:grayscale(.82) sepia(.2) brightness(.62) contrast(1.08)}
body:not(.light-theme) #map{background:#211f1c}
body:not(.light-theme) .leaflet-control-zoom a,body:not(.light-theme) .leaflet-popup-content-wrapper,body:not(.light-theme) .leaflet-popup-tip{background:#292521;color:#eee6d9;border-color:#51483f}
body:not(.light-theme) .detail-content audio,body:not(.light-theme) .story-body audio{color-scheme:dark;filter:invert(.86) hue-rotate(180deg) saturate(.65);border-radius:5px}
body:not(.light-theme) .memory-panel,body:not(.light-theme) .memory-intro,body:not(.light-theme) .memory-form,body:not(.light-theme) .memory-list{background:#292521;color:#eee6d9}
body:not(.light-theme) .memory-intro{border-right:1px solid #51483f}
body:not(.light-theme) .memory-intro h3,body:not(.light-theme) .memory-form label,body:not(.light-theme) .memory-form .consent{color:#eee6d9}
body:not(.light-theme) .memory-intro p,body:not(.light-theme) .memory-form .optional{color:#c2b7a8}
body:not(.light-theme) .memory-form input:not([type=checkbox]),body:not(.light-theme) .memory-form select,body:not(.light-theme) .memory-form textarea{background:#1d1b19!important;color:#f1e8db!important;border:1px solid #62564a!important}
body:not(.light-theme) .memory-form input::placeholder,body:not(.light-theme) .memory-form textarea::placeholder{color:#a99b8a}
body:not(.light-theme) .memory-form input[type=file]{color:#eee6d9}
body:not(.light-theme) .memory-form select option{background:#292521;color:#eee6d9}
body:not(.light-theme) .memory-form .form-status{color:#d2b99b}
body:not(.light-theme) .route-layout,body:not(.light-theme) .map-shell,body:not(.light-theme) .route-list{background:#292521}
body:not(.light-theme) .map-toolbar,body:not(.light-theme) .map-foot{background:#292521;color:#b7a995}
body:not(.light-theme) .route-item{background:transparent}
body:not(.light-theme) .route-item:hover,body:not(.light-theme) .route-item.active{background:#49332e}
body:not(.light-theme) .detail-content{background:#292521;color:#eee6d9}
body:not(.light-theme) .detail-description{color:#c2b7a8}
body:not(.light-theme) .gallery-caption{background:#292521;color:#e8dfd2}
body:not(.light-theme) .gallery-thumb{background:#211f1c}

/* The previous light palette remains available with one click. */
body.light-theme{--paper:#f4f1e9;--ink:#1e211e;--muted:#77796f;--line:#d9d5cb;--red:#a23c2f;--green:#5d6b5c;--white:#fffdf8;background:var(--paper);color:var(--ink);background-image:none}
body.light-theme .topbar{background:var(--paper);border-color:var(--line)}
body.light-theme .brand-mark,body.light-theme .ending-mark{background:var(--red);color:white}
body.light-theme .topbar nav{color:#55584f}
body.light-theme .hero h1,body.light-theme .section-head h2,body.light-theme .ending h2,body.light-theme .memory-intro h3,body.light-theme .detail-content h3{color:var(--ink)}
body.light-theme .hero h1 em,body.light-theme .section-head h2 em,body.light-theme .ending h2 em{color:var(--red)}
body.light-theme .lead,body.light-theme .section-head>p,body.light-theme .memory-intro p,body.light-theme .detail-description{color:#606258}
body.light-theme .eyebrow,body.light-theme .kicker,body.light-theme .section-no,body.light-theme .visual-tag,body.light-theme .visual-caption,body.light-theme .hero-meta,body.light-theme .intro-band span,body.light-theme .map-toolbar,body.light-theme .map-foot,body.light-theme .list-heading,body.light-theme .route-number,body.light-theme .duration,body.light-theme .ending footer{color:var(--muted)}
body.light-theme .intro-band{background:#e9e5da;color:var(--ink)}
body.light-theme .map-shell,body.light-theme .route-list,body.light-theme .stop-detail,body.light-theme .memory-panel,body.light-theme .memory-intro,body.light-theme .memory-form,body.light-theme .memory-list{background:var(--white);color:var(--ink);border-color:var(--line)}
body.light-theme .memory-intro{background:#e0ddd2}
body.light-theme .memory-intro h3,body.light-theme .memory-form label,body.light-theme .memory-form .consent{color:var(--ink)}
body.light-theme .memory-intro p{color:#65665c}
body.light-theme .memory-form input:not([type=checkbox]),body.light-theme .memory-form select,body.light-theme .memory-form textarea{background:#fffdf8!important;color:var(--ink)!important;border:1px solid var(--line)!important}
body.light-theme .memory-form input::placeholder,body.light-theme .memory-form textarea::placeholder{color:#88877e}
body.light-theme .map-toolbar,body.light-theme .map-foot{background:var(--white);color:var(--muted)}
body.light-theme #map .leaflet-tile{filter:none}
body.light-theme #map{background:#e6e8df}
body.light-theme .leaflet-control-zoom a,body.light-theme .leaflet-popup-content-wrapper,body.light-theme .leaflet-popup-tip{background:#fff;color:#222;border-color:#ccc}
body.light-theme .detail-content,body.light-theme .gallery-caption{background:var(--white);color:var(--ink)}
body.light-theme .detail-content audio,body.light-theme .story-body audio{color-scheme:light;filter:none}
body.light-theme .route-item{color:var(--ink);border-color:#e9e5dc}
body.light-theme .route-item:hover,body.light-theme .route-item.active{background:#eee9dd}
body.light-theme .route-title small,body.light-theme .route-arrow{color:var(--muted)}
body.light-theme .button.dark{background:var(--ink);border-color:var(--ink);color:var(--white)}
body.light-theme .button.quiet,body.light-theme .detail-link,body.light-theme .text-button{color:var(--ink);border-color:var(--line)}
body.light-theme .ending{background:#e9e5da;border-color:var(--line)}
body.light-theme .ending footer{border-color:var(--line)}
body.light-theme .music-toggle{border-color:var(--line);color:var(--ink)}
body.light-theme .music-toggle.is-playing{background:var(--ink);border-color:var(--ink);color:var(--paper)}
body.light-theme .language-picker{color:var(--muted)}
body.light-theme .language-picker select{background:var(--white);color:var(--ink);border-color:var(--line)}
body.light-theme .theme-toggle{border-color:var(--line);color:var(--ink)}
body.light-theme .theme-toggle:hover{border-color:var(--red);color:var(--red)}
@media(max-width:720px){.theme-toggle{padding:8px 9px}.theme-toggle #themeToggleLabel{display:none}}
body:not(.light-theme) .stories-section{background:#211f1c}
body.light-theme .stories-section{background:#e9e5da}

/* Final layout refinements: equal map/list height and an editorial memory archive. */
@media (min-width: 901px){
  .route-layout{height:610px;min-height:0;align-items:stretch;overflow:hidden}
  .map-shell{height:610px;min-height:0}
  #map{height:auto;min-height:0;flex:1 1 auto}
  .route-list{height:610px;max-height:none;min-height:0;overflow-y:auto;overscroll-behavior:contain}
}
.route-list{min-width:0;overflow-x:hidden}
.route-list>*{max-width:100%;box-sizing:border-box}
.memory-panel{grid-template-columns:minmax(230px,.72fr) minmax(0,1fr);align-items:stretch;overflow:hidden;border-radius:2px}
.memory-intro{position:relative;min-width:0}
.memory-form{min-width:0}
.memory-list{grid-column:1/-1;min-width:0;box-sizing:border-box;padding:26px 30px 30px;background:var(--white);border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:14px;align-content:start}
.memory-card{position:relative;min-width:0;box-sizing:border-box;padding:20px 22px 18px;border:1px solid var(--line);border-top:2px solid var(--red);background:#f7f4ec;color:var(--ink);box-shadow:0 7px 22px #211f1c0a;transition:transform .2s,box-shadow .2s}
.memory-card:hover{transform:translateY(-2px);box-shadow:0 12px 26px #211f1c12}
.memory-card-meta{align-items:flex-start;padding-bottom:12px;border-bottom:1px solid var(--line);font:10px var(--mono);letter-spacing:.025em}
.memory-card-meta strong{font-weight:600;color:var(--ink)}
.memory-card-meta span{white-space:nowrap;color:var(--muted)}
.memory-card p{font:13px/1.85 var(--sans);color:#4f5049;margin:14px 0 13px;white-space:pre-wrap;overflow-wrap:anywhere}
.memory-card-foot{display:block;font:8px var(--mono);letter-spacing:.13em;color:var(--red)}
.memory-empty{grid-column:1/-1;display:flex;align-items:center;gap:15px;min-height:88px;padding:18px 22px;border:1px dashed var(--line);background:#f7f4ec;color:var(--muted)}
.memory-empty-mark{font-size:22px;color:var(--red)}
.memory-empty p{margin:0;font-size:11px;line-height:1.8}
body:not(.light-theme) .memory-list{background:#24211e}
body:not(.light-theme) .memory-card{background:#332e29;border-color:#51463c;border-top-color:#b66a5c;color:#eee6d9}
body:not(.light-theme) .memory-card-meta{border-color:#51463c}
body:not(.light-theme) .memory-card-meta strong{color:#eee6d9}
body:not(.light-theme) .memory-card p{color:#d4c9ba}
body:not(.light-theme) .memory-card-foot,body:not(.light-theme) .memory-empty-mark{color:#cf8a78}
body:not(.light-theme) .memory-empty{background:#302b26;border-color:#62564a;color:#c2b7a8}
body.light-theme .memory-card{background:#f7f4ec;color:var(--ink)}
@media(max-width:900px){
  .route-layout{height:auto;min-height:0;overflow:visible}
  .map-shell{height:auto;min-height:0}
  #map{height:440px;min-height:340px;flex:none}
  .route-list{height:auto;max-height:390px;overflow-y:auto}
  .memory-panel{grid-template-columns:1fr 1.1fr}
}
@media(max-width:600px){
  .route-layout{display:flex;flex-direction:column}
  .map-shell{height:auto}
  #map{height:340px;min-height:300px}
  .route-list{max-height:340px;height:auto}
  .memory-panel{grid-template-columns:1fr}
  .memory-list{grid-template-columns:1fr;padding:18px}
  .memory-card{padding:17px}
}
