/* Verstaskartta: one stylesheet for phone, tablet (700px+) and desktop (1100px+). */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/bricolage-grotesque.woff') format('woff');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F6F3FB;
  --card: #FFFFFF;
  --ink: #2A2438;
  --muted: #4E4560;
  --muted-2: #5E5670;
  --line: #EEE9F5;
  --accent: #C2412D;
  --link: #B23A27;
  --link-hover: #8C2C1D;
  --focus: #2B4F96;
  --map: #DCEAF7;
  --map-dot: #B9D2EC;
  --map-ink: #2D4A6A;
  --tile-dot: rgba(255,255,255,.55);
  --map-note-bg: rgba(255,255,255,.75);
  --mint: #D2EFDD;
  --mint-ink: #23603D;
  --lavender: #E4DAF8;
  --lavender-ink: #523A86;
  --pink: #F8D6DE;
  --surface: #FFFFFF;
  --on-ink: #FFFFFF;
  --facts-bg: rgba(255,255,255,.6);
  --btn-dark-hover: #3B3350;
  --btn-primary-hover: #A93623;
  --shadow: rgba(42,36,56,.08);
  --pin-shadow: rgba(42,36,56,.35);
  --lanes: rgba(42,36,56,.07);
  --ease-out: cubic-bezier(.2,.7,.2,1);
  --gutter: 16px;
  --radius-xl: 24px;
  --radius-l: 22px;
  --radius-m: 16px;
  --font: 'Bricolage Grotesque', 'Segoe UI', Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.015em; line-height: 1.1; }
p { margin: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--on-ink); padding: 10px 14px; border-radius: 10px; z-index: 1000; }
.skip-link:focus { top: 8px; color: var(--on-ink); }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
main { flex: 1 0 auto; }

/* Header */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: flex; align-items: center; min-height: 44px; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -0.01em; }
.logo:hover { color: var(--ink); }
.logo-tag { display: inline-flex; align-items: center; width: 28px; height: 22px; padding-left: 5px; border-radius: 4px 11px 11px 4px; background: var(--accent); }
.logo-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--bg); transition: transform .35s cubic-bezier(.3,1.5,.5,1); }
.logo:hover .logo-tag::before { transform: translateX(7px); }
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; font-size: 15px; text-decoration: none; }
.site-nav .nav-plain { color: var(--ink); display: none; }
.site-nav .nav-plain:hover { color: var(--link); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; margin-right: -8px; border: 0; border-radius: 50%;
  background: none; color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { background: var(--line); }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-toggle .icon-sun, :root[data-theme='dark'] .theme-toggle .icon-moon { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-sun { display: block; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: var(--radius-m);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .12s ease, background-color .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--btn-primary-hover); color: #fff; }
.btn-dark { background: var(--ink); color: var(--on-ink); }
.btn-dark:hover { background: var(--btn-dark-hover); color: var(--on-ink); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--bg); color: var(--ink); }
.btn-block { display: flex; width: 100%; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; padding: 8px 0; }
.back-link { font-size: 15px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding-right: 8px; }

/* Blocks */
.block { border-radius: var(--radius-xl); padding: 24px 20px; }
.block-white { background: var(--card); }
.section { margin-top: 28px; }
.section-title { font-size: 22px; margin: 0 4px 12px; }
.lead { font-size: 17px; color: var(--muted); }

/* Hero (front page) */
.hero { margin-top: 4px; display: flex; flex-direction: column; gap: 14px; }
.hero h1 { font-size: 40px; line-height: 1.02; letter-spacing: -0.02em; }
.hero-icons { display: flex; gap: 8px; }
.icon-dot { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; }
.icon-dot svg { width: 22px; height: 22px; }
.search { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; width: 100%; max-width: 720px; }
.search label { font-weight: 700; font-size: 15px; }
.search-row { display: flex; gap: 8px; }
.search input {
  flex: 1 1 auto; min-width: 0; height: 52px; padding: 0 16px;
  border: 2px solid var(--ink); border-radius: var(--radius-m);
  font: inherit; background: var(--surface); color: var(--ink);
}
.search .btn { min-height: 52px; }
.search-message { font-size: 15px; color: var(--muted); min-height: 0; }
.locate-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0;
  background: none; border: 0; font: inherit; font-weight: 700; color: var(--link);
  cursor: pointer; align-self: flex-start;
}
.locate-btn:hover { color: var(--link-hover); }
.search-message a { font-weight: 700; }
.search-message:empty { display: none; }

/* Craft tints: templates emit --lt/--li (light values from data/crafts/*.yaml) and a craft-<slug> class for dark overrides */
.tinted { --t: var(--lt); --i: var(--li); background: var(--t); color: var(--i); }

.page-head.tinted, .space-hero.tinted, .card.tinted { color: var(--ink); }

/* Craft tiles */
.craft-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.craft-tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  min-height: 92px; padding: 14px 16px; border-radius: 18px;
  font-weight: 800; font-size: 19px; text-decoration: none;
}
.craft-tile svg { width: 24px; height: 24px; opacity: .85; }
.craft-tile small { display: block; font-weight: 600; font-size: 13px; opacity: .85; }

/* Cities + owner box */
.duo { display: grid; gap: 16px; }
.city-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px; padding: 12px 18px; border-radius: 18px;
  background: var(--bg); color: var(--ink); text-decoration: none;
}
.city-row:hover { color: var(--ink); }
.city-grid { display: grid; gap: 8px; }
.city-row strong { font-size: 19px; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.pill-mint { background: var(--mint); color: var(--mint-ink); }
.pill-lavender { background: var(--lavender); color: var(--lavender-ink); font-weight: 600; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.owner-box { background: var(--pink); display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.owner-text { display: grid; gap: 8px; }
.owner-text p { margin: 0; }
.owner-box p { color: var(--muted); }

/* Page header blocks (city, craft, space) */
.page-head { margin-top: 4px; display: flex; flex-direction: column; gap: 4px; }
.page-head h1 { font-size: 40px; line-height: 1.05; letter-spacing: -0.02em; }
.page-head p { font-size: 17px; }

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 15px; text-decoration: none; transition: transform .12s ease;
}
.chip:hover { color: var(--ink); background: var(--bg); }
.chip:active { transform: scale(.97); }
.chip[aria-current='page'] { background: var(--ink); color: var(--on-ink); animation: vk-chippop .3s ease-out; }

/* City layout: list + map */
.city-layout { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.city-layout.has-map .map-box { order: 2; } /* below the cards until the wide layout puts it beside them */
.sort-note { font-size: 14px; color: var(--muted-2); margin: 0 4px 10px; }
.card-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }

/* Map */
.map-box { border-radius: 20px; overflow: hidden; background-color: var(--map); background-image: radial-gradient(var(--map-dot) 1.6px, transparent 1.6px); background-size: 14px 14px; position: relative; }
.map { height: 220px; width: 100%; }
.map-note { font-size: 13px; color: var(--map-ink); padding: 8px 14px; background: var(--map-note-bg); }
.leaflet-container { font-family: var(--font); background: var(--map); }
.leaflet-popup-content a { color: var(--link); }
.vk-pin { display: block; width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 6px var(--pin-shadow); }
.leaflet-popup-content { font-size: 15px; margin: 12px 16px; }
.leaflet-popup-content a { font-weight: 700; }

/* Space card */
.card {
  display: flex; flex-direction: column; gap: 12px; padding: 18px;
  border-radius: var(--radius-l); color: var(--ink); text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
  animation: vk-rise .4s ease-out backwards;
}
.card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 8px 18px var(--shadow); }
.card:active { transform: scale(.98); }
.card-title { font-size: 20px; line-height: 1.2; }
.card-place { display: flex; align-items: center; gap: 4px; font-size: 15px; color: var(--muted); margin-top: -4px; }
.card-place svg { flex: 0 0 auto; }
.card-gear { font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.access-tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px 5px 9px;
  border-radius: 4px 14px 14px 4px; color: #fff; font-size: 14px; font-weight: 700;
  transform-origin: 7px 50%;
}
.access-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; flex: 0 0 auto; }
.card:hover .access-tag { animation: vk-swing .8s ease-in-out; }
.craft-pill { padding: 4px 12px; border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 700; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--facts-bg); margin-top: auto; }
.facts span { display: flex; flex-direction: column; }
.facts small { font-size: 13px; color: var(--muted-2); }
.facts b { font-size: 15px; font-variant-numeric: tabular-nums; }
.facts b.unknown { font-weight: 500; color: var(--muted); }
.featured-mark { font-size: 13px; font-weight: 700; color: var(--muted); }

.empty { padding: 20px; border-radius: var(--radius-l); background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.empty strong { font-size: 18px; }
.empty span { color: var(--muted-2); }

/* Access legend */
.legend { margin-top: 16px; padding: 4px 18px; border-radius: var(--radius-l); background: var(--surface); }
.legend summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.legend dl { margin: 0 0 12px; display: grid; gap: 10px; }
.legend dl > div { display: flex; flex-direction: column; gap: 4px; }
.legend dd { margin: 0; font-size: 15px; color: var(--muted); }
.prose .legend { padding: 4px 0; background: none; }
.prose .legend summary { display: none; }

/* Craft page groups */
.city-group + .city-group { margin-top: 28px; }
.city-group h2 { font-size: 24px; margin: 0 4px 12px; }
.city-group h2 a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; }
.city-group h2 a:hover { color: var(--link); }

/* Space page */
.space-layout { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.space-col { display: contents; }
.space-hero { order: 1; border-radius: var(--radius-xl); overflow: hidden; }
.space-actions { order: 2; display: flex; flex-direction: column; gap: 10px; }
.space-details { order: 3; }
.verify-note { order: 2; margin: 0; padding: 12px 16px; border-radius: var(--radius-l); background: var(--lavender); font-size: 14px; font-weight: 600; }
.space-map { order: 4; }
.space-meta { order: 5; }
.space-hero-top { padding: 14px 18px 0; }
.photo-tile {
  height: 160px; margin: 8px 18px 0; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background-image: radial-gradient(var(--tile-dot) 1.6px, transparent 1.6px); background-size: 14px 14px;
  font-size: 14px; font-weight: 700;
}
.photo-tile svg { width: 56px; height: 56px; animation: vk-spin 1.1s cubic-bezier(.2,.8,.3,1) backwards; }
.photo-empty { display: none; }
.space-photo { margin: 8px 18px 0; border-radius: 18px; overflow: hidden; }
.space-photo img { width: 100%; height: 220px; object-fit: cover; }
.space-photo figcaption { font-size: 12px; padding: 6px 2px 0; opacity: .8; }
.space-hero-body { padding: 14px 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.space-hero h1 { font-size: 34px; line-height: 1.05; letter-spacing: -0.02em; }
.space-hero .operator { font-size: 15px; opacity: .85; }
.space-hero .access-tag { font-size: 15px; padding: 6px 15px 6px 10px; animation: vk-swing .9s ease-in-out .35s backwards; }
.actions-box { display: flex; flex-direction: column; gap: 10px; }
.actions-box h2 { display: none; }
.details { margin: 0; padding: 6px 18px; border-radius: var(--radius-l); background: var(--surface); }
.details > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.details > div:last-child { border-bottom: 0; }
.details dt { color: var(--muted-2); font-size: 15px; }
.details dd { margin: 0; font-size: 15px; }
.details ul { margin: 0; padding-left: 18px; }
.details dd .line { display: block; }
.details dd .line + .line { margin-top: 4px; }
.details dd strong + .line { margin-top: 2px; }
.meta-box { padding: 18px 20px; border-radius: var(--radius-l); background: var(--lavender); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.meta-box ul { margin: 0; padding-left: 18px; word-break: break-word; }
.meta-box a { color: var(--link-hover); }

/* Prose pages */
.prose { max-width: 720px; display: flex; flex-direction: column; gap: 14px; }
.prose h1 { font-size: 36px; }
.prose h2 { font-size: 22px; margin-top: 10px; }
.prose ul { margin: 0; padding-left: 20px; }
.prose li + li { margin-top: 4px; }

/* Footer */
.site-footer { margin-top: 40px; }
.site-footer .wrap { padding-top: 20px; padding-bottom: 28px; color: var(--muted-2); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }

/* Footer links */
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--ink); text-decoration: none; }
.footer-links a:hover { color: var(--link); text-decoration: underline; }

/* Motion */
@keyframes vk-lanes { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: none; } }
@keyframes vk-chippop { 0% { transform: scale(.94); } 60% { transform: scale(1.04); } 100% { transform: none; } }
@keyframes vk-theme-in { from { opacity: 0; transform: rotate(-90deg) scale(.5); } to { opacity: 1; transform: none; } }
.theme-toggle.anim svg { animation: vk-theme-in .3s var(--ease-out); }
/* Running-track arcs from the top-right corner of header blocks */
.has-lanes { position: relative; overflow: hidden; isolation: isolate; }
.has-lanes::before {
  content: ''; position: absolute; top: 0; right: 0; z-index: -1; pointer-events: none;
  width: min(220px, 55%); height: 170px;
  background: repeating-radial-gradient(circle at 100% 0, var(--lanes) 0 2px, transparent 2px 20px);
  -webkit-mask-image: radial-gradient(circle at 100% 0, #000 30%, transparent 75%);
  mask-image: radial-gradient(circle at 100% 0, #000 30%, transparent 75%);
  transform-origin: top right;
  animation: vk-lanes 1.2s var(--ease-out) backwards;
}
.hero { --lanes: rgba(194,65,45,.14); }
/* Scroll reveal (progressive: only where scroll-driven animations exist) */
@keyframes vk-reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
  .reveal { animation: vk-reveal linear backwards; animation-timeline: view(); animation-range: entry 0% entry 70%; }
}
@keyframes vk-pop { from { opacity: 0; transform: translateY(6px) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes vk-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes vk-swing { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-5deg); } 65% { transform: rotate(3deg); } }
@keyframes vk-spin { from { transform: rotate(-120deg); } to { transform: rotate(0); } }
.hero-icons > span { animation: vk-pop .5s cubic-bezier(.2,.8,.3,1.25) backwards; }
.hero-icons > span:nth-child(2) { animation-delay: .08s; }
.hero-icons > span:nth-child(3) { animation-delay: .16s; }
.hero-icons > span:nth-child(4) { animation-delay: .24s; }
.lift { transition: transform .18s ease, box-shadow .18s ease; }
.lift:hover { transform: translateY(-2px); box-shadow: 0 8px 18px var(--shadow); }
.lift:active { transform: scale(.97); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover, .lift:hover, .btn:active, .chip:active, .card:active, .lift:active { transform: none; }
  .lift:hover, .card:hover, .card:active, .logo:hover .logo-tag::before { transform: none; }
}

/* Tablet */
@media (min-width: 700px) {
  :root { --gutter: 32px; }
  body { font-size: 17px; }
  .site-header .wrap { padding-top: 18px; padding-bottom: 18px; }
  .logo { font-size: 22px; }
  .site-nav .nav-plain { display: inline-flex; }
  .block { padding: 32px; border-radius: 28px; }
  .hero { padding: 40px; }
  .has-lanes::before { width: min(460px, 50%); height: 340px; background-image: repeating-radial-gradient(circle at 100% 0, var(--lanes) 0 2px, transparent 2px 32px); }
  .hero h1 { font-size: 56px; line-height: 1; }
  .icon-dot { width: 52px; height: 52px; }
  .icon-dot svg { width: 26px; height: 26px; }
  .craft-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .craft-tile { min-height: 110px; font-size: 20px; border-radius: 20px; }
  .section-title { font-size: 26px; }
  .city-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owner-box { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; }
  .owner-box .btn { flex: none; }
  .page-head h1 { font-size: 56px; line-height: 1; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .card { padding: 20px; border-radius: var(--radius-xl); }
  .map { height: 280px; }
  .space-hero-body h1 { font-size: 48px; }
  .space-hero { display: grid; grid-template-columns: minmax(0, 1fr) 200px; grid-template-areas: 'top top' 'body photo'; align-items: center; }
  .space-hero-top { grid-area: top; padding: 22px 32px 0; }
  .space-hero-body { grid-area: body; padding: 8px 32px 30px; }
  .photo-tile, .space-photo { grid-area: photo; margin: 0 32px 24px 0; height: 180px; }
  .photo-empty { display: flex; }
  .space-photo img { height: 180px; }
  .space-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .space-actions .btn-primary { grid-column: 1 / -1; }
  .actions-box { display: contents; }
  .details { padding: 8px 28px; }
  .details > div { grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 15px 0; }
  .details dt, .details dd { font-size: 17px; }
  .site-footer .wrap { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 32px; font-size: 15px; }
}

/* Desktop */
@media (min-width: 1100px) {
  :root { --gutter: 40px; }
  .site-header .wrap { padding-top: 22px; padding-bottom: 22px; }
  .logo { font-size: 24px; }
  .site-nav { gap: 28px; }
  .site-nav a { font-size: 17px; }
  .hero { padding: 64px 48px 52px; align-items: center; text-align: center; border-radius: 32px; }
  .hero h1 { font-size: 72px; line-height: .98; letter-spacing: -0.03em; max-width: 900px; }
  .hero .lead { font-size: 20px; max-width: 620px; }
  .hero .search { text-align: left; }
  .hero-icons { justify-content: center; }
  .icon-dot { width: 56px; height: 56px; }
  .craft-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
  .craft-tile { min-height: 130px; font-size: 22px; border-radius: 24px; padding: 18px 20px; }
  .duo { gap: 24px; }
  .city-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .page-head { flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 32px 40px; border-radius: 32px; }
  .page-head h1 { font-size: 72px; line-height: .98; letter-spacing: -0.03em; }
  .page-head .chips { margin: 0; }
  .city-layout.has-map { flex-direction: row; align-items: flex-start; gap: 24px; }
  .city-layout.has-map .city-list { flex: 1 1 auto; min-width: 0; }
  .city-layout.has-map .map-box { order: 2; flex: 0 0 400px; position: sticky; top: 24px; }
  .city-layout.has-map .map { height: 640px; }
  .city-layout:not(.has-map) .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .space-layout { flex-direction: row; align-items: flex-start; gap: 24px; }
  .space-col { display: flex; flex-direction: column; gap: 24px; }
  .space-col-main { flex: 1 1 auto; min-width: 0; }
  .space-col-side { flex: 0 0 400px; position: sticky; top: 24px; }
  .space-hero { border-radius: 32px; grid-template-columns: minmax(0, 1fr) 220px; }
  .space-hero-top { padding: 28px 40px 0; }
  .space-hero-body { padding: 8px 40px 36px; }
  .space-hero-body h1 { font-size: 64px; line-height: .98; letter-spacing: -0.03em; }
  .photo-tile, .space-photo { margin: 0 40px 32px 0; height: 220px; }
  .space-photo img { height: 220px; }
  .space-actions { display: flex; padding: 28px; border-radius: 28px; background: var(--surface); }
  .actions-box { display: flex; }
  .actions-box h2 { display: block; font-size: 22px; }
  .details { padding: 12px 36px; border-radius: 28px; }
  .details > div { grid-template-columns: 160px minmax(0, 1fr); gap: 20px; padding: 18px 0; }
  .space-map .map { height: 280px; }
}

/* Dark theme: opt-in via the header toggle (data-theme set by an inline script and theme.js) */
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #16131D;
  --card: #211D2B;
  --ink: #ECE8F4;
  --muted: #C3BBD3;
  --muted-2: #B3AAC5;
  --line: #332D40;
  --link: #F2936F;
  --link-hover: #FFB594;
  --focus: #8DB4FF;
  --map: #1F2A38;
  --map-dot: #2C3A4D;
  --map-ink: #BFD3EA;
  --map-note-bg: rgba(22,19,29,.85);
  --mint: #1E3A2D;
  --mint-ink: #CFEBDD;
  --lavender: #2B2A45;
  --lavender-ink: #E1E0F6;
  --pink: #3E2330;
  --surface: #2A2536;
  --on-ink: #16131D;
  --facts-bg: rgba(22,19,29,.45);
  --btn-dark-hover: #FFFFFF;
  --btn-primary-hover: #A93623;
  --shadow: rgba(0,0,0,.35);
  --pin-shadow: rgba(0,0,0,.5);
  --lanes: rgba(236,232,244,.08);
  --tile-dot: rgba(255,255,255,.12);
}
:root[data-theme='dark'] .hero { --lanes: rgba(194,65,45,.22); }
:root[data-theme='dark'] .tinted { --t: #2A2535; --i: var(--ink); }
:root[data-theme='dark'] .craft-auto { --t: #1E3047; --i: #CFE2F8; }
:root[data-theme='dark'] .craft-keramiikka { --t: #4A2430; --i: #F8D6DE; }
:root[data-theme='dark'] .craft-maker { --t: #2E2850; --i: #E4DAF8; }
:root[data-theme='dark'] .craft-metalli { --t: #2A2C3F; --i: #DEDFEE; }
:root[data-theme='dark'] .craft-puu { --t: #3D2A1E; --i: #FFDCC6; }
:root[data-theme='dark'] .craft-tekstiili { --t: #1E3A2D; --i: #CFEBDD; }
:root[data-theme='dark'] .access-tag { box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
:root[data-theme='dark'] .photo-tile { filter: none !important; }
:root[data-theme='dark'] .btn-outline:hover, :root[data-theme='dark'] .chip:hover { background: var(--card); }
:root[data-theme='dark'] .leaflet-tile-pane { filter: brightness(.8) contrast(1.1); }
:root[data-theme='dark'] .leaflet-popup-content-wrapper, :root[data-theme='dark'] .leaflet-popup-tip { background: var(--card); color: var(--ink); }
:root[data-theme='dark'] .leaflet-bar a { background: var(--card); color: var(--ink); border-color: var(--line); }
:root[data-theme='dark'] .leaflet-control-attribution { background: rgba(22,19,29,.8); color: var(--muted); }
:root[data-theme='dark'] .leaflet-control-attribution a { color: var(--link); }

/* Small print on text pages */
.muted-note { font-size: 14px; color: var(--muted-2); margin-top: 24px; }

/* Contact form (/lisaa-tila/) */
.contact-form { display: grid; gap: 18px; margin: 20px 0 8px; max-width: 640px; }
.contact-form .field { display: grid; gap: 6px; }
.contact-form label, .contact-form legend { font-weight: 700; font-size: 15px; }
.contact-form .optional { font-weight: 500; color: var(--muted-2); }
.contact-form .hint { margin: 0; font-size: 14px; color: var(--muted); }
.contact-form input:not([type="radio"]), .contact-form textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 2px solid var(--ink); border-radius: var(--radius-m);
  font: inherit; background: var(--surface); color: var(--ink);
}
.contact-form textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
.contact-form input:focus-visible, .contact-form textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.contact-form .choice { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
.contact-form .choice legend { margin-bottom: 6px; padding: 0; }
.contact-form .choice label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; cursor: pointer; }
.contact-form input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.contact-form .btn { justify-self: start; }
.contact-form .btn:disabled { opacity: .7; cursor: progress; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Guides (/opas/) */
.guide h3 { font-size: 18px; margin-top: 6px; }
.guide ol { margin: 0; padding-left: 22px; }
.guide ol li + li { margin-top: 4px; }
.guide-places { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 6px; }
.guide-places a { font-weight: 700; }
.guide-access { color: var(--muted); font-size: 15px; }
.table-scroll { overflow-x: auto; margin: 4px 0; }
.price-table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
.price-table caption { caption-side: bottom; text-align: left; font-size: 13px; color: var(--muted-2); padding-top: 8px; }
.price-table th { text-align: left; font-size: 13px; color: var(--muted-2); font-weight: 600; padding: 6px 10px 6px 0; border-bottom: 2px solid var(--line); }
.price-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.price-table td:first-child { min-width: 9em; }
@media (max-width: 699px) { .price-table .col-access { display: none; } }
.price-table .unknown { color: var(--muted); }
.guide-link { margin: 14px 4px 0; font-weight: 600; }
.guide-list { list-style: none; padding: 0 !important; display: grid; gap: 14px; }
.guide-list li { display: grid; gap: 2px; }
.guide-list a { font-size: 19px; font-weight: 700; }
.guide-list span { color: var(--muted); font-size: 15px; }
.missing-note { margin: 14px 4px 0; font-size: 15px; color: var(--muted); }
