:root {
  --bg: #f7f4ea;
  --paper: #fffdf7;
  --ink: #1f2d23;
  --muted: #5f6f64;
  --accent: #0d8b5f;
  --accent-soft: #c7f4df;
  --danger: #ef5b44;
  --line: #d5dccf;
  --shadow: 0 18px 40px rgba(36, 52, 42, 0.14);
  --surface: color-mix(in srgb, var(--paper), white 35%);
  --field-bg: #fffef9;
  --field-border: #b8c2b7;
  --map-bg: #ffffff;
  --badge-bg: rgba(255, 255, 255, 0.9);
  --badge-border: #cfdac8;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Lexend", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, #ffe2b8 0 11%, transparent 11.4%),
    radial-gradient(circle at 84% 26%, #d8f5e4 0 13%, transparent 13.4%),
    linear-gradient(160deg, #f7f4ea 0%, #eef3e7 48%, #e9f0e3 100%);
  min-height: 100vh;
}

body[data-theme="dark"] {
  --bg: #111913;
  --paper: #18241d;
  --ink: #ebf5ee;
  --muted: #b8cabd;
  --accent: #52d89b;
  --accent-soft: #294d3c;
  --danger: #ff7a64;
  --line: #304238;
  --shadow: 0 18px 40px rgba(5, 10, 7, 0.45);
  --surface: color-mix(in srgb, var(--paper), #1c2a21 35%);
  --field-bg: #1f2c24;
  --field-border: #4f6458;
  --map-bg: #121b15;
  --badge-bg: rgba(17, 28, 22, 0.92);
  --badge-border: #415647;
  background:
    radial-gradient(circle at 12% 8%, #3f311b 0 11%, transparent 11.4%),
    radial-gradient(circle at 84% 26%, #1f4231 0 13%, transparent 13.4%),
    linear-gradient(160deg, #101812 0%, #111913 48%, #0d1510 100%);
}

body[data-theme="contrast"] {
  --bg: #000000;
  --paper: #000000;
  --ink: #ffffff;
  --muted: #ffffff;
  --accent: #00ffff;
  --accent-soft: #101010;
  --danger: #ffff00;
  --line: #ffffff;
  --shadow: none;
  --surface: #000000;
  --field-bg: #000000;
  --field-border: #ffffff;
  --map-bg: #000000;
  --badge-bg: #000000;
  --badge-border: #ffffff;
  background: #000000;
}

body[data-theme="contrast"] .hero-shape {
  display: none;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 2.2rem 1rem 1.4rem;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
  padding-right: clamp(180px, 30vw, 360px);
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.brand-strip {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}

.brand-strip a,
.modal-brand-strip a {
  display: inline-flex;
  text-decoration: none;
}

.hero-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.language-select {
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.86rem;
  padding: 0.44rem 0.56rem;
}

.language-select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent), white 45%);
  outline-offset: 2px;
}

.brand-logo {
  height: clamp(70px, 7.5vw, 92px);
  width: auto;
  padding: 0.34rem 0.45rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--badge-bg);
  box-shadow: 0 4px 10px rgba(27, 44, 35, 0.1);
}

.brand-logo-bevegan {
  height: clamp(84px, 8.8vw, 110px);
}

.brand-logo-vsf {
  position: absolute;
  top: 0;
  right: 0.35rem;
  z-index: 3;
  width: clamp(170px, 24vw, 270px);
  height: auto;
  padding: 0.5rem 0.62rem;
  border-radius: 16px;
}

body[data-theme="dark"] .brand-logo,
body[data-theme="dark"] .modal-brand-logo {
  background: rgba(255, 255, 255, 0.96);
  border-color: #dbe7de;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.34);
  filter: brightness(1.04) contrast(1.12);
}

body[data-theme="contrast"] .brand-logo,
body[data-theme="contrast"] .modal-brand-logo {
  background: #ffffff;
  border-color: #ffffff;
  filter: contrast(1.2);
}

.theme-toggle {
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.86rem;
  padding: 0.46rem 0.68rem;
  cursor: pointer;
}

.theme-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent), white 45%);
  outline-offset: 2px;
}

h1 {
  margin: 0.3rem 0 0.6rem;
  line-height: 1.1;
  font-size: clamp(1.7rem, 2.4vw + 1.1rem, 3.1rem);
}

.subtitle {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
}

.visitor-counter {
  margin: 0.62rem 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.26rem 0.52rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.view-tabs {
  margin-top: 0.8rem;
  display: inline-flex;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem;
  background: var(--badge-bg);
}

.view-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  border-radius: 999px;
  padding: 0.35rem 0.72rem;
  cursor: pointer;
}

.view-tab.is-active {
  background: color-mix(in srgb, var(--accent-soft), white 25%);
  color: var(--ink);
}

.powered-logo {
  width: 90px;
  height: auto;
  display: block;
}

.hero-shape {
  position: absolute;
  filter: blur(20px);
  opacity: 0.6;
  z-index: 1;
}

.hero-shape-1 {
  width: 260px;
  height: 260px;
  top: -120px;
  left: -70px;
  background: #ffca80;
  border-radius: 34% 66% 57% 43% / 40% 41% 59% 60%;
}

.hero-shape-2 {
  width: 320px;
  height: 320px;
  top: -170px;
  right: -80px;
  background: #9be8c0;
  border-radius: 52% 48% 57% 43% / 39% 45% 55% 61%;
}

.layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.6rem 1rem 1.25rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 330px minmax(0, 1fr) 320px;
  align-items: start;
}

.agenda-view {
  max-width: 980px;
  margin: 0 auto;
  padding: 0.6rem 1rem 1.25rem;
}

.agenda-panel {
  padding: 1rem;
}

.agenda-panel h2 {
  margin: 0 0 0.5rem;
}

.agenda-panel p {
  margin: 0 0 0.85rem;
  color: var(--muted);
}

.agenda-list {
  margin: 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.45rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.search-panel,
.details-panel {
  padding: 1rem;
}

.label {
  display: block;
  font-size: 0.84rem;
  margin-bottom: 0.42rem;
  color: var(--muted);
}

.search-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
}

#org-search {
  width: 100%;
  font-size: 0.96rem;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  padding: 0.58rem 0.7rem;
  color: var(--ink);
  background: var(--field-bg);
}

#category-filter {
  width: 100%;
  margin-top: 0.42rem;
  font-size: 0.95rem;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  padding: 0.56rem 0.68rem;
  color: var(--ink);
  background: var(--field-bg);
}

#org-search:focus,
#category-filter:focus {
  outline: 2px solid color-mix(in srgb, var(--accent), white 55%);
  border-color: var(--accent);
}

.category-label {
  margin-top: 0.72rem;
}

.map-legend {
  margin-top: 0.58rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem 0.56rem;
  align-items: center;
}

.map-legend-title {
  margin: 0;
  width: 100%;
  font-size: 0.78rem;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.legend-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-block;
}

#clear-search {
  border: 0;
  border-radius: 10px;
  padding: 0.58rem 0.82rem;
  font-weight: 600;
  color: #173327;
  background: var(--accent-soft);
  cursor: pointer;
}

.results {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  max-height: calc((3.2rem * 6) + (0.4rem * 5));
  overflow: auto;
  display: grid;
  gap: 0.4rem;
}

.result-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.58rem 0.68rem;
  background: var(--field-bg);
  color: var(--ink);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.result-item:hover,
.result-item:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 5px 10px rgba(13, 139, 95, 0.18);
  outline: none;
}

.result-item.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft), white 40%);
}

.result-name {
  display: block;
  font-weight: 600;
}

.result-id {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.map-panel {
  padding: 0.8rem;
}

.map-frame {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--map-bg);
}

.map-powered {
  position: absolute;
  left: 0.72rem;
  bottom: 0.72rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  padding: 0.2rem 0.36rem;
  border-radius: 10px;
  border: 1px solid var(--badge-border);
  background: var(--badge-bg);
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 700;
  backdrop-filter: blur(2px);
  max-width: min(42vw, 210px);
}

body[data-theme="dark"] .map-powered {
  background: rgba(255, 255, 255, 0.96);
  border-color: #dbe7de;
  color: #1c2a22;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

body[data-theme="dark"] .map-powered .powered-logo {
  filter: contrast(1.22) brightness(1.02);
}

body[data-theme="contrast"] .map-powered {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
}

.map-powered span {
  white-space: nowrap;
}

.map-powered .powered-logo {
  width: clamp(40px, 7vw, 64px);
  height: auto;
  flex: 0 1 auto;
}

@media (max-width: 760px) {
  .map-powered {
    left: 0.52rem;
    bottom: 0.52rem;
    padding: 0.14rem 0.24rem;
    gap: 0.14rem;
    font-size: 0.54rem;
    max-width: min(50vw, 155px);
  }

  .map-powered .powered-logo {
    width: clamp(28px, 9vw, 40px);
  }
}

@media (max-width: 480px) {
  .map-powered {
    left: 0.44rem;
    bottom: 0.44rem;
    padding: 0.12rem 0.2rem;
    gap: 0.12rem;
    font-size: 0.5rem;
    max-width: min(46vw, 132px);
    border-radius: 9px;
  }

  .map-powered .powered-logo {
    width: clamp(24px, 8vw, 32px);
  }
}

@media (min-width: 1400px) {
  .map-powered {
    font-size: 0.72rem;
    max-width: 230px;
  }

  .map-powered .powered-logo {
    width: clamp(52px, 5vw, 74px);
  }
}

#floorplan-image {
  width: 100%;
  height: auto;
  display: block;
  transition: filter 180ms ease;
}

body[data-theme="dark"] #floorplan-image {
  filter: invert(0.88) hue-rotate(155deg) saturate(0.58) brightness(0.78) contrast(1.14);
}

body[data-theme="contrast"] #floorplan-image {
  filter: grayscale(1) invert(1) contrast(1.7) brightness(1.08);
}

#map-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.booth-shape {
  fill: color-mix(in srgb, var(--accent), transparent 72%);
  stroke: #14573f;
  stroke-width: 0.0018;
  cursor: pointer;
  transition: fill 120ms ease;
}

.booth-shape:hover {
  fill: color-mix(in srgb, var(--accent), transparent 55%);
}

.booth-category-food {
  fill: rgba(44, 165, 95, 0.34);
  stroke: #1d7f49;
}

.booth-category-non-food {
  fill: rgba(255, 149, 64, 0.34);
  stroke: #b65e12;
}

.booth-category-desserts {
  fill: rgba(234, 101, 152, 0.34);
  stroke: #a33b67;
}

.booth-category-drinks {
  fill: rgba(76, 160, 255, 0.34);
  stroke: #2a67a8;
}

.booth-category-other,
.booth-category-uncategorized {
  fill: rgba(128, 138, 152, 0.32);
  stroke: #596372;
}

.booth-category-organizer {
  fill: rgba(115, 101, 255, 0.35);
  stroke: #4b3bc4;
}

.booth-category-facility {
  fill: rgba(46, 124, 235, 0.32);
  stroke: #2e6cbf;
}

.booth-toilet {
  fill: rgba(172, 77, 255, 0.38);
  stroke: #7a2ec1;
  stroke-width: 0.0028;
}

.booth-resting-place {
  fill: rgba(52, 122, 255, 0.34);
  stroke: #1f4aa0;
  stroke-width: 0.0026;
}

.booth-resting-place:hover {
  fill: rgba(52, 122, 255, 0.5);
}

.legend-swatch.booth-category-food { background: rgba(44, 165, 95, 0.7); border-color: #1d7f49; }
.legend-swatch.booth-category-non-food { background: rgba(255, 149, 64, 0.72); border-color: #b65e12; }
.legend-swatch.booth-category-desserts { background: rgba(234, 101, 152, 0.72); border-color: #a33b67; }
.legend-swatch.booth-category-drinks { background: rgba(76, 160, 255, 0.72); border-color: #2a67a8; }
.legend-swatch.booth-category-other,
.legend-swatch.booth-category-uncategorized { background: rgba(128, 138, 152, 0.72); border-color: #596372; }
.legend-swatch.booth-category-organizer { background: rgba(115, 101, 255, 0.72); border-color: #4b3bc4; }
.legend-swatch.booth-category-facility { background: rgba(46, 124, 235, 0.72); border-color: #2e6cbf; }
.legend-swatch.booth-toilet { background: rgba(172, 77, 255, 0.8); border-color: #7a2ec1; }
.legend-swatch.booth-resting-place { background: rgba(52, 122, 255, 0.76); border-color: #1f4aa0; }

.booth-shape.active {
  fill: color-mix(in srgb, var(--danger), transparent 30%);
  stroke: #ae2314;
  stroke-width: 0.0028;
  animation: booth-flash 1.05s ease-in-out infinite;
}

@keyframes booth-flash {
  0% {
    fill: color-mix(in srgb, var(--danger), transparent 44%);
    stroke: #8d1c10;
    stroke-width: 0.0024;
    filter: drop-shadow(0 0 0 rgba(239, 91, 68, 0));
  }

  50% {
    fill: color-mix(in srgb, #ff3f2a, transparent 16%);
    stroke: #ff2f19;
    stroke-width: 0.0034;
    filter: drop-shadow(0 0 8px rgba(239, 91, 68, 0.72));
  }

  100% {
    fill: color-mix(in srgb, var(--danger), transparent 44%);
    stroke: #8d1c10;
    stroke-width: 0.0024;
    filter: drop-shadow(0 0 0 rgba(239, 91, 68, 0));
  }
}

@media (prefers-reduced-motion: reduce) {
  .booth-shape.active {
    animation: none;
  }
}

.details-panel h2 {
  margin: 0 0 0.62rem;
  font-size: 1.2rem;
}

.booth-details p {
  margin: 0.35rem 0;
  color: var(--muted);
}

.booth-details dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(85px, 120px) 1fr;
  gap: 0.4rem 0.5rem;
}

.booth-details dt {
  font-weight: 600;
  color: #304f40;
}

.booth-details dd {
  margin: 0;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 30;
}

.modal.is-open {
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 35, 28, 0.58);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100vw - 1.2rem));
  max-height: calc(100vh - 1.2rem);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 22px 44px rgba(23, 39, 31, 0.35);
  padding: 1rem 1rem 1.2rem;
  animation: modal-pop 180ms ease-out;
}

@keyframes modal-pop {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  border: 0;
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-weight: 700;
  color: #173327;
  background: var(--accent-soft);
  cursor: pointer;
}

.modal-brand-strip {
  display: flex;
  align-items: center;
  gap: 0.46rem;
  margin: 0.2rem 0 0.46rem;
}

.modal-brand-logo {
  height: clamp(44px, 5vw, 57px);
  width: auto;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--field-bg);
  padding: 0.2rem 0.32rem;
}

.modal-kicker {
  margin: 0;
  color: #466b58;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.modal-card h2 {
  margin: 0.24rem 0 0.5rem;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  line-height: 1.12;
}

.modal-hype {
  margin: 0 0 0.75rem;
  color: #1b4f3b;
  font-weight: 600;
  background: linear-gradient(90deg, #e5f9ee 0%, #fff4e0 100%);
  border: 1px solid #cde6d6;
  border-radius: 12px;
  padding: 0.62rem 0.72rem;
}

.modal-meta {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(95px, 120px) 1fr;
  gap: 0.36rem 0.52rem;
}

.modal-meta dt {
  font-weight: 700;
  color: #2d4c3d;
}

.modal-meta dd {
  margin: 0;
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding-right: 0;
  }

  .hero-top {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .brand-strip {
    width: 100%;
    justify-content: space-between;
  }

  .brand-logo-vsf {
    position: static;
    width: clamp(140px, 23vw, 210px);
    height: auto;
    padding: 0.4rem 0.5rem;
    right: auto;
    top: auto;
  }

  .brand-logo-bevegan {
    height: clamp(74px, 12vw, 96px);
  }

  .results {
    max-height: 240px;
  }
}
