:root {
  --ink: #2d2118;
  --muted: #7d6d5e;
  --line: #ead8b9;
  --paper: #f4dfb8;
  --panel: #fff7e8;
  --green: #37b501;
  --gold: #d98a17;
  --orange: #ee9f25;
  --brown: #ff6c00;
  --clay: #b65f2a;
  --shadow: 0 18px 44px rgba(77, 48, 24, .2);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.is-locked {
  display: none !important;
}

.desktop-blocker {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 22px;
  background: var(--paper);
}

.desktop-blocker-card {
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: rgba(255, 250, 240, .96);
  box-shadow: var(--shadow);
}

.desktop-blocker-card h1 {
  margin: 0;
  color: var(--brown);
  font-size: 2rem;
  line-height: 1.05;
}

.desktop-blocker-card p:not(.eyebrow) {
  margin: 14px 0 0;
  color: #4d5759;
  line-height: 1.45;
}

body.is-desktop-blocked .login-screen,
body.is-desktop-blocked .app-shell {
  display: none !important;
}

.login-screen {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 22px;
  background: #f4dfb8;
}

.login-card {
  width: min(430px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: rgba(255, 250, 240, .94);
  box-shadow: var(--shadow);
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  background: white;
  object-fit: contain;
}

.brand-logo-login {
  max-width: 310px;
  margin: 0 auto 18px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(94, 58, 27, .12);
}

.login-card p {
  color: #4d5759;
  line-height: 1.45;
}

.language-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 6px;
}

.language-picker button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--brown);
  font-weight: 900;
  cursor: pointer;
}

.language-picker button.is-active {
  border-color: var(--gold);
  background: var(--gold);
  color: white;
}

.access-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.access-row input {
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.access-row button {
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--orange);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.activation-msg {
  min-height: 22px;
  margin-bottom: 0;
  color: var(--clay);
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  min-height: 100vh;
}

.map-stage {
  position: relative;
  min-height: 100vh;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #f4efe5;
}

.muted-map-tiles {
  filter: grayscale(.72) saturate(.58) contrast(.82) brightness(1.1);
}

.admin-link {
  pointer-events: auto;
}

.admin-header h1 {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  line-height: 1;
  letter-spacing: 0;
  color: #4a2a13;
  text-shadow: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  color: var(--brown);
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.panel {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  overflow: auto;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.panel-head h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
}

.intro {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.filter-list {
  display: grid;
  gap: 10px;
}

.filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.filter-copy {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.filter-copy i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dot);
}

.filter-copy span {
  min-width: 0;
  font-weight: 800;
}

.filter-copy small {
  color: var(--muted);
}

.filter-item input {
  position: absolute;
  opacity: 0;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #b8c0bd;
  transition: .2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: .2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
}

.filter-item input:checked + .switch {
  background: var(--gold);
}

.filter-item input:checked + .switch::after {
  transform: translateX(20px);
}

.place-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 26px rgba(31, 37, 40, .08);
}

.place-card.is-hidden {
  display: none;
}

.place-photo-main {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  background: #d7d0c0;
}

.place-photo-main {
  border-bottom: 1px solid var(--line);
}

.place-content {
  padding: 18px;
}

.close-card {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 8px;
  background: rgba(122, 75, 36, .86);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.place-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .84rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color), white 86%);
  color: var(--tag-color);
  font-size: .78rem;
  font-weight: 900;
}

.place-card h3 {
  margin: 12px 0 8px;
  font-size: 1.45rem;
  line-height: 1.12;
}

.story-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.story-tabs::-webkit-scrollbar {
  display: none;
}

.story-tabs button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8ea;
  color: #6e513a;
  font-weight: 900;
  cursor: pointer;
}

.story-tabs button.is-active {
  border-color: var(--brown);
  background: var(--brown);
  color: white;
}

.story-title {
  margin: 4px 0 8px;
  color: var(--brown);
  font-size: 1rem;
  line-height: 1.25;
}

.place-card p {
  margin: 0;
  color: #514337;
  line-height: 1.55;
  white-space: pre-line;
}

.vote-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.photo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-top: 14px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff4df;
  color: var(--brown);
  font-weight: 900;
  cursor: pointer;
}

.photo-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.photo-action {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--brown);
  border-radius: 8px;
  background: var(--brown);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.gallery-picto {
  position: relative;
  width: 22px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.gallery-picto::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 5px;
  height: 8px;
  border: 2px solid currentColor;
  border-right: 0;
  border-radius: 3px 0 0 3px;
}

.gallery-picto::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.photo-gallery[hidden] {
  display: none;
}

.gallery-photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #d7c39b;
  cursor: zoom-in;
  overflow: hidden;
}

.photo-gallery img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: #d7c39b;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 58px 18px 22px;
  background: rgba(27, 19, 12, .9);
}

.photo-lightbox[hidden] {
  display: none;
}

.photo-lightbox img {
  display: block;
  max-width: min(100%, 980px);
  max-height: calc(100dvh - 92px);
  border-radius: 8px;
  object-fit: contain;
  background: #d7c39b;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .38);
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 8px;
  background: rgba(255, 249, 237, .95);
  color: var(--brown);
  font-weight: 900;
  cursor: pointer;
}

body.has-lightbox {
  overflow: hidden;
}

.vote-row button,
.login-row button {
  min-height: 44px;
  border: 1px solid var(--orange);
  border-radius: 8px;
  background: var(--orange);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.vote-row button:last-child {
  border-color: var(--brown);
  background: var(--brown);
}

.vote-row button.is-active {
  outline: 3px solid rgba(200, 141, 45, .36);
}

.empty-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  color: var(--muted);
}

.empty-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
}

.poi-marker {
  background: transparent;
}

.poi-marker span {
  display: block;
  width: 28px;
  height: 28px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

.poi-marker.is-viewed span {
  background: #6f766f;
  opacity: .72;
}

.location-control button {
  min-width: 108px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  background: white;
  color: var(--brown);
  font-weight: 900;
  cursor: pointer;
}

.location-control button.is-active {
  color: #165ec9;
}

.user-location-marker {
  background: transparent;
}

.user-location-marker span {
  display: block;
  width: 24px;
  height: 24px;
  border: 3px solid white;
  border-radius: 50%;
  background: #1f78ff;
  box-shadow: 0 0 0 4px rgba(31, 120, 255, .25), 0 8px 18px rgba(0, 0, 0, .28);
}

.admin-body {
  min-height: 100vh;
  background: #f2eee3;
}

.admin-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-header h1 {
  color: var(--ink);
  text-shadow: none;
}

.admin-header .admin-link {
  border-color: var(--line);
}

.login-box,
.admin-content,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 28px rgba(31, 37, 40, .08);
}

.login-box {
  padding: 22px;
}

.login-box label {
  display: block;
  margin-bottom: 8px;
  font-weight: 900;
}

.login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.login-row input {
  min-height: 44px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.muted {
  color: var(--muted);
}

.admin-content {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stats-grid div {
  padding: 16px;
  border-radius: 8px;
  background: #f6f3eb;
}

.stats-grid span {
  display: block;
  color: var(--muted);
  font-size: .88rem;
}

.stats-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 2rem;
}

.admin-section-head {
  display: grid;
  gap: 4px;
}

.admin-section-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 900;
}

.status-pill.is-used {
  background: #f5d8cf;
  color: #9f3322;
}

.status-pill.is-available {
  background: #dcebd3;
  color: #3f6f2d;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

td strong,
td small {
  display: block;
}

td small {
  margin-top: 3px;
  color: var(--muted);
}

@media (max-width: 920px) {
  .app-shell {
    display: block;
    min-height: 100dvh;
  }

  .map-stage {
    min-height: 100dvh;
  }

  .panel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: auto;
    max-height: 45dvh;
    padding: 12px;
    gap: 10px;
    border: 1px solid rgba(216, 222, 220, .94);
    border-radius: 8px;
    background: rgba(255, 250, 240, .96);
    box-shadow: var(--shadow);
  }

  .panel-head h2 {
    font-size: 1.2rem;
  }

  .intro {
    display: none;
  }

  .filter-list {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .filter-item {
    min-height: 48px;
    padding: 8px;
    gap: 8px;
  }

  .filter-copy {
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 7px;
  }

  .filter-copy i {
    width: 10px;
    height: 10px;
  }

  .filter-copy span {
    font-size: .82rem;
    line-height: 1.05;
  }

  .filter-copy small {
    display: none;
  }

  .switch {
    width: 38px;
    height: 24px;
  }

  .switch::after {
    width: 16px;
    height: 16px;
  }

  .filter-item input:checked + .switch::after {
    transform: translateX(14px);
  }

  .place-card {
    position: fixed;
    inset: 0;
    z-index: 10;
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    overflow: auto;
  }

  .place-photo-main {
    height: 32dvh;
    min-height: 230px;
  }

  .place-content {
    padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
  }

  .place-card h3 {
    font-size: 1.7rem;
  }

  .place-card p {
    font-size: 1.08rem;
  }
}

@media (max-width: 560px) {
  .admin-link {
    min-height: 38px;
    padding: 0 12px;
  }

  .panel {
    padding: 10px;
  }

  .vote-row,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .login-row {
    grid-template-columns: 1fr;
  }

  .access-row {
    grid-template-columns: 1fr;
  }
}

.admin-header{margin-bottom:24px}
