/* Этнический/славянский стиль. Тёплые земляные тона, орнаменты, рукописная типографика */

@import url('https://fonts.googleapis.com/css2?family=Marck+Script&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Tenor+Sans&display=swap');

:root {
  --bg-0: #f3e8d2;
  --bg-1: #e9d6b1;
  --bg-2: #d9bf8a;
  --ink: #2a1a0e;
  --ink-soft: #5b3a1f;
  --line: #8a5a2b;
  --line-soft: #b98a55;
  --paper: #f7ecd3;
  --paper-dark: #ead6a8;
  --land: #e2c890;
  --land-dark: #c9a765;
  --water: #b9c9b0;
  --water-2: #a7b99a;
  --accent-red: #a6321f;
  --accent-deep: #4a1d10;
  --gold: #b8892a;
  --forest: #3f4b2a;

  --e-healing: #4f7a3a;
  --e-power:   #a6321f;
  --e-wisdom:  #2f4c6e;
  --e-purif:   #2e7a8a;
  --e-trans:   #7a3a8a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Lora', Georgia, serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 900px at 20% -10%, #f6e9c8 0%, transparent 60%),
    radial-gradient(1000px 800px at 110% 110%, #ead3a1 0%, transparent 60%),
    repeating-linear-gradient(0deg, rgba(139, 90, 43, 0.03) 0 1px, transparent 1px 3px),
    var(--bg-0);
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.35  0 0 0 0 0.15  0 0 0 0.07 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: .55;
}
.app { position: relative; z-index: 1; }

/* ============== HEADER ============== */
header.masthead {
  padding: 22px 36px 18px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 2fr) minmax(220px, 1fr);
  gap: 24px;
  align-items: center;
  border-bottom: 2px solid var(--line);
  background: linear-gradient(180deg, rgba(247,236,211,.94), rgba(247,236,211,.55));
  position: relative;
}
header.masthead::after {
  content: "";
  position: absolute;
  left: 36px; right: 36px; bottom: -8px; height: 6px;
  background: repeating-linear-gradient(90deg,
    var(--line) 0 10px, transparent 10px 14px,
    var(--accent-red) 14px 20px, transparent 20px 24px);
  opacity: .7;
}
.mast-left .tag {
  font-family: 'Tenor Sans', serif;
  letter-spacing: .35em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--ink-soft);
}
.mast-left h1 {
  font-family: 'Marck Script', cursive;
  font-size: clamp(32px, 3.5vw, 52px);
  line-height: 0.9;
  margin: 2px 0 0;
  color: var(--accent-deep);
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.mast-left .sub {
  font-family: 'Lora', serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 13px;
  margin-top: 2px;
}

.mast-search {
  display: flex; gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  padding: 6px 8px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 4px var(--paper), 0 4px 20px rgba(80,40,10,.07);
}
.mast-search input,
.mast-search select {
  font-family: 'Lora', serif;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  padding: 10px 12px;
}
.mast-search input {
  flex: 1 1 auto;
  min-width: 0;
  border-right: 1px solid var(--line-soft);
}
.mast-search input::placeholder { color: var(--ink-soft); opacity: .7; font-style: italic; }
.mast-search select {
  cursor: pointer;
  max-width: 220px;
}

.mast-stats {
  display: flex; align-items: center; gap: 12px;
  justify-content: flex-end;
  font-family: 'Tenor Sans', serif;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--ink-soft);
}
.mast-stats > div:first-child {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1;
}
.mast-stats b {
  font-family: 'Marck Script', cursive;
  font-size: 34px;
  color: var(--accent-red);
}
.mast-stats span { font-size: 11px; margin-top: 3px; }
.only-mobile { display: none; }

/* ============== MAIN LAYOUT ============== */
main.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  padding: 20px 36px 48px;
}
main.no-sidebar { grid-template-columns: 1fr; }
main.no-sidebar aside.controls { display: none; }

aside.controls {
  padding-right: 24px;
  border-right: 1px solid var(--line-soft);
  position: sticky;
  top: 8px;
  align-self: start;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  scrollbar-width: thin;
}
aside.controls::-webkit-scrollbar { width: 8px; }
aside.controls::-webkit-scrollbar-thumb { background: var(--line-soft); border-radius: 4px; }

.panel-title {
  font-family: 'Tenor Sans', serif;
  letter-spacing: .25em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--ink-soft);
  margin: 18px 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.panel-title::before, .panel-title::after {
  content: ""; flex: 1; height: 1px; background: var(--line-soft);
}
.mt-xl { margin-top: 28px; }

.legend-intro {
  font-family: 'Lora', serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 6px 0 18px;
}

.filter-list { display: flex; flex-direction: column; gap: 8px; }
.filter-chip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  background: var(--paper);
  cursor: pointer;
  border-radius: 2px;
  transition: background .15s, border-color .15s, transform .08s;
  font-size: 14px;
  color: var(--ink);
  user-select: none;
}
.filter-chip:hover { background: var(--paper-dark); border-color: var(--line); }
.filter-chip.on {
  background: var(--ink);
  color: var(--bg-0);
  border-color: var(--ink);
}
.filter-chip.on .chip-count { color: var(--bg-1); }
.filter-chip.off { opacity: .55; }
.chip-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(0,0,0,.15);
  box-shadow: 0 0 0 3px rgba(255,255,255,.4) inset;
}
.chip-body { line-height: 1.3; }
.chip-hint { font-size: 11.5px; font-style: italic; opacity: .7; margin-top: 2px; }
.chip-count {
  font-family: 'Tenor Sans', serif;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: .08em;
}

.filter-actions {
  display: flex; gap: 10px; margin-top: 14px;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: 'Tenor Sans', serif;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 2px;
  transition: background .15s, color .15s;
}
.btn-ghost:hover { background: var(--ink); color: var(--bg-0); }

/* Ornament dividers */
.ornament {
  display: block; margin: 24px auto; height: 28px;
  color: var(--line);
  opacity: .7;
}

/* Place list */
.place-list {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 4px;
}
.place-row {
  display: grid;
  grid-template-columns: 12px auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 2px;
  cursor: pointer;
  transition: background .12s;
}
.place-row:hover { background: var(--paper); }
.place-row .dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.15);
}
.place-thumb {
  width: 44px; height: 44px;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  flex-shrink: 0;
}
.place-meta { overflow: hidden; }
.place-name {
  font-family: 'Lora', serif;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.place-region {
  font-family: 'Tenor Sans', serif;
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--ink-soft);
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.place-more, .empty {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 12px 8px;
  text-align: center;
}

/* ============== MAP ============== */
section.map-wrap {
  position: relative;
  padding-left: 24px;
}

.map-frame {
  position: relative;
  background:
    repeating-linear-gradient(45deg, rgba(185,138,85,.06) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, #f5e8c8 0%, #ead6a8 100%);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 0 0 6px var(--paper),
    inset 0 0 0 7px var(--line-soft),
    0 8px 30px rgba(80,40,10,.12);
  padding: 14px;
  border-radius: 2px;
  overflow: hidden;
  touch-action: none;
}
.map-frame::before,
.map-frame::after {
  content: "";
  position: absolute;
  width: 52px; height: 52px;
  background-image:
    radial-gradient(circle, var(--line) 0 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, transparent 10px, var(--line-soft) 10px 11px, transparent 11px);
  pointer-events: none;
}
.map-frame::before { top: -10px; left: -10px; transform: rotate(0deg); }
.map-frame::after  { bottom: -10px; right: -10px; transform: rotate(180deg); }

.map-svg {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  cursor: grab;
}
.map-svg:active { cursor: grabbing; }

.map-shadow {
  fill: rgba(80,40,10,.22);
  transform: translate(6px, 8px);
}
.region-path {
  fill: url(#land-gradient);
  stroke: var(--line);
  stroke-width: 1.2;
  stroke-linejoin: round;
  paint-order: stroke fill;
  transition: fill .2s;
}
.region-path.alt { fill: var(--land-dark); }

.map-lake { fill: #b3c8a4; stroke: var(--line-soft); stroke-width: .6; opacity: .85; }

.river-path {
  fill: none;
  stroke: #5a8aa0;
  stroke-width: 1;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: .55;
  pointer-events: stroke;
}
.river-path:hover { opacity: 1; stroke-width: 1.8; stroke: #2e6d88; }

.grid-line { stroke: rgba(138, 90, 43, .14); stroke-width: .5; fill: none; }

.route-arc {
  fill: none;
  stroke: var(--accent-red);
  stroke-width: 1;
  stroke-dasharray: 5 4;
  opacity: .35;
  pointer-events: none;
}
.flights g path {
  pointer-events: none;
}

.map-hint {
  position: absolute;
  left: 50%; bottom: 18px;
  transform: translateX(-50%);
  font-family: 'Tenor Sans', serif;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--ink-soft);
  background: rgba(247,236,211,.85);
  padding: 4px 12px;
  border: 1px solid var(--line-soft);
  pointer-events: none;
}

/* Compass */
.compass {
  position: absolute;
  right: 34px; top: 34px;
  width: 90px; height: 90px;
  pointer-events: none;
  opacity: .85;
  z-index: 2;
}

/* Points */
.pt {
  cursor: pointer;
  transition: transform .12s;
}
.pt circle.halo { opacity: 0; transition: opacity .2s; }
.pt:hover circle.halo { opacity: .35; }
.pt:hover { filter: brightness(1.2); }
.pt.dim { opacity: .1; pointer-events: none; }

.pt circle:nth-child(2) { stroke: rgba(0,0,0,.2); stroke-width: .5; }

/* Tooltip */
.tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--ink);
  color: var(--bg-0);
  font-family: 'Lora', serif;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--gold);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  max-width: 260px;
  z-index: 50;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .12s;
}
.tooltip.show { opacity: 1; transform: translateY(0); }
.tooltip b {
  display: block;
  font-family: 'Marck Script', cursive;
  font-size: 20px;
  color: #f5d58a;
  margin-bottom: 2px;
}
.tooltip small {
  font-family: 'Tenor Sans', serif;
  letter-spacing: .15em;
  font-size: 10px;
  color: #d9bf8a;
  text-transform: uppercase;
}

/* ============== MODAL ============== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(800px 600px at 50% 30%, rgba(42,26,14,.6), rgba(42,26,14,.94));
  display: flex; align-items: center; justify-content: center;
  padding: 32px 18px;
  animation: fadein .25s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: min(820px, 100%);
  max-height: 92vh;
  overflow: auto;
  background:
    radial-gradient(600px 400px at 80% -10%, rgba(166,50,31,.08), transparent 60%),
    var(--paper);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 0 0 8px var(--paper),
    inset 0 0 0 9px var(--line-soft),
    0 20px 60px rgba(0,0,0,.4);
  font-family: 'Lora', serif;
  color: var(--ink);
  animation: rise .3s cubic-bezier(.2,.7,.2,1);
}
@keyframes rise { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-hero {
  width: 100%;
  height: 260px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.modal-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(247,236,211,.6) 100%);
  pointer-events: none;
}
.modal-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(.88) sepia(.08);
}

.modal-body { padding: 34px 48px 44px; }

.modal .close {
  position: absolute; top: 16px; right: 20px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(247,236,211,.92); border: 1px solid var(--line);
  font-family: 'Tenor Sans', serif;
  color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1;
  z-index: 2;
}
.modal .close:hover { background: var(--ink); color: var(--bg-0); }

.modal .kicker {
  font-family: 'Tenor Sans', serif;
  letter-spacing: .3em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--ink-soft);
}
.modal h2 {
  font-family: 'Marck Script', cursive;
  font-size: clamp(36px, 4.5vw, 54px);
  line-height: 1;
  margin: 8px 0 6px;
  color: var(--accent-deep);
}
.modal .region {
  font-family: 'Lora', serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 16px;
  margin-bottom: 20px;
}
.modal .meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 22px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 0;
}
.modal .meta .pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Tenor Sans', serif;
  font-size: 11px; letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 4px 10px;
  border: 1px solid var(--line-soft);
}
.modal .meta .pill .dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.modal .desc {
  font-size: 16.5px;
  line-height: 1.7;
  margin: 0 0 20px;
}
.modal .desc::first-letter {
  font-family: 'Marck Script', cursive;
  font-size: 56px;
  float: left;
  line-height: .85;
  padding: 4px 10px 0 0;
  color: var(--accent-red);
}

.legend-box {
  background:
    repeating-linear-gradient(0deg, rgba(185,138,85,.08) 0 1px, transparent 1px 4px),
    var(--paper-dark);
  border-left: 3px solid var(--accent-red);
  padding: 18px 22px;
  font-style: italic;
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.65;
  position: relative;
  margin-bottom: 18px;
}
.legend-box::before {
  content: "Предание";
  position: absolute; top: -10px; left: 16px;
  background: var(--paper);
  font-family: 'Tenor Sans', serif;
  font-style: normal;
  letter-spacing: .25em;
  font-size: 10px;
  text-transform: uppercase;
  padding: 0 8px;
  color: var(--ink-soft);
}

.wiki-block {
  margin-top: 20px;
  padding: 18px 22px;
  background: rgba(247,236,211,.6);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
}
.wiki-block .wiki-title {
  font-family: 'Tenor Sans', serif;
  letter-spacing: .25em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.wiki-block p {
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 10px;
  color: var(--ink-soft);
}
.wiki-link {
  font-family: 'Tenor Sans', serif;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent-red);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-red);
  padding-bottom: 1px;
}
.wiki-link:hover { color: var(--accent-deep); border-color: var(--accent-deep); }

.flourish {
  color: var(--line);
  opacity: .8;
  text-align: center;
  font-size: 22px;
  letter-spacing: .5em;
  margin: 22px 0 0;
}

/* ============== CHAT WIDGET ============== */
.chat-widget {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 120;
  font-family: 'Lora', serif;
}
.chat-fab {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid var(--accent-deep);
  background: radial-gradient(circle at 30% 30%, #c84a2f 0%, var(--accent-red) 55%, var(--accent-deep) 100%);
  color: #fef4d6;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(74,29,16,.4), inset 0 1px 0 rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease;
  animation: chat-pulse 3.4s ease-in-out infinite;
}
.chat-fab:hover {
  transform: scale(1.08) rotate(8deg);
  box-shadow: 0 12px 32px rgba(74,29,16,.5);
}
@keyframes chat-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(74,29,16,.4), inset 0 1px 0 rgba(255,255,255,.15); }
  50%      { box-shadow: 0 8px 30px rgba(166,50,31,.7), inset 0 1px 0 rgba(255,255,255,.15); }
}
.chat-panel {
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 48px);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 0 0 6px var(--paper),
    inset 0 0 0 7px var(--line-soft),
    0 20px 60px rgba(42,26,14,.45);
  display: flex; flex-direction: column;
  animation: chat-in .25s cubic-bezier(.2,.7,.2,1);
}
@keyframes chat-in { from { transform: translateY(16px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.chat-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(166,50,31,.14), transparent);
  display: flex; justify-content: space-between; align-items: center;
}
.chat-title {
  font-family: 'Marck Script', cursive;
  font-size: 26px;
  color: var(--accent-deep);
  line-height: 1;
}
.chat-sub {
  font-family: 'Tenor Sans', serif;
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 3px;
}
.chat-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.chat-close:hover { background: var(--ink); color: var(--bg-0); }
.chat-body {
  flex: 1; overflow-y: auto;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin;
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--line-soft); border-radius: 3px; }
.chat-msg { display: flex; max-width: 90%; }
.chat-msg.user { align-self: flex-end; justify-content: flex-end; }
.chat-msg.assistant { align-self: flex-start; justify-content: flex-start; }
.chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, var(--accent-red), var(--accent-deep));
  color: #fef4d6;
  border-bottom-right-radius: 2px;
}
.chat-msg.assistant .chat-bubble {
  background: var(--paper-dark);
  color: var(--ink);
  border: 1px solid var(--line-soft);
  border-bottom-left-radius: 2px;
}
.chat-bubble strong { font-weight: 600; color: var(--accent-deep); }
.chat-msg.user .chat-bubble strong { color: #fef4d6; }
.chat-bubble em { font-style: italic; }
.chat-bubble code {
  font-family: 'Courier New', monospace;
  background: rgba(138, 90, 43, .15);
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 13px;
}
.chat-bubble.typing {
  letter-spacing: 3px;
  animation: typing-pulse 1.1s ease-in-out infinite;
}
@keyframes typing-pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.chat-input {
  display: flex; gap: 8px;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--line-soft);
  background: rgba(247,236,211,.6);
}
.chat-input textarea {
  flex: 1;
  font-family: 'Lora', serif;
  font-size: 14px;
  resize: none;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
  max-height: 100px;
  line-height: 1.4;
}
.chat-input textarea:focus { border-color: var(--line); }
.chat-input button {
  width: 42px;
  background: var(--accent-red);
  color: #fef4d6;
  border: 1px solid var(--accent-deep);
  border-radius: 2px;
  cursor: pointer;
  font-size: 18px;
  transition: background .15s;
}
.chat-input button:disabled { background: var(--line-soft); border-color: var(--line-soft); cursor: not-allowed; }
.chat-input button:hover:not(:disabled) { background: var(--accent-deep); }

@media (max-width: 820px) {
  .chat-widget { right: 12px; bottom: 12px; }
  .chat-panel { width: calc(100vw - 24px); height: 70vh; }
}

/* Footer */
footer {
  text-align: center;
  padding: 30px 20px 50px;
  font-family: 'Lora', serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 1100px) {
  header.masthead { grid-template-columns: 1fr; gap: 14px; padding: 18px 20px; }
  .mast-left, .mast-stats { text-align: left; }
  .mast-stats { justify-content: flex-start; }
  main.layout { padding: 16px 20px 40px; }
}

@media (max-width: 820px) {
  main.layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  main.with-sidebar aside.controls {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 18px;
    margin-bottom: 14px;
    max-height: 60vh;
    position: static;
  }
  main.no-sidebar aside.controls { display: none; }
  main.with-sidebar section.map-wrap { padding-left: 0; }
  main.no-sidebar section.map-wrap { padding-left: 0; }
  .modal-body { padding: 26px 22px 32px; }
  .modal-hero { height: 180px; }
  .only-mobile { display: inline-flex; }
  .mast-search { width: 100%; }
  .mast-search select { max-width: 130px; font-size: 13px; }
  .mast-search input { font-size: 14px; padding: 8px 10px; }
  .compass { width: 64px; height: 64px; right: 22px; top: 22px; }
}
