:root {
  --bg: #f2f5f0;
  --panel: #ffffff;
  --panel-soft: #f8faf7;
  --ink: #17211b;
  --muted: #66746a;
  --line: #dce5de;
  --line-strong: #c5d2c8;
  --green: #244f24;
  --green-strong: #183c1b;
  --green-soft: #e7f0e6;
  --blue: #2f6f96;
  --blue-soft: #e7f0f6;
  --amber: #a56a1d;
  --amber-soft: #fbf0df;
  --danger: #b2463f;
  --danger-soft: #f8e7e5;
  --sidebar: #142532;
  --sidebar-2: #1c3342;
  --radius: 8px;
  --shadow: 0 18px 45px rgba(24, 43, 31, .12);
  --shadow-soft: 0 10px 25px rgba(24, 43, 31, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,0) 260px),
    var(--bg);
  letter-spacing: 0;
}

body.admin-page {
  background: #eef2ef;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
strong, p, td, th, input, textarea, .place-card { overflow-wrap: anywhere; }

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    #244f24
    url("/assets/img/brand/edemgulyat-brand-icon.png")
    center / cover no-repeat;
  color: transparent;
  font-size: 0;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(24, 60, 27, .18);
  overflow: hidden;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

nav {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}

nav a:hover {
  color: var(--green);
  background: var(--green-soft);
}

.user-panel {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-panel span {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto 56px;
}

.page-shell {
  display: grid;
  gap: 24px;
  padding-top: 24px;
}

.page-shell > * {
  min-width: 0;
}

.map-page-shell {
  width: min(1480px, calc(100% - 32px));
  display: grid;
  gap: 20px;
  padding-top: 24px;
}

.page-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.page-hero h1 {
  max-width: 780px;
}

.page-hero p {
  max-width: 780px;
  margin-bottom: 0;
}

.page-section {
  margin-top: 12px;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 12px;
  font-size: 31px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 7px;
  font-size: 22px;
  line-height: 1.16;
}

h3 {
  margin-bottom: 9px;
  font-size: 16px;
  line-height: 1.2;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cad7ce;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 107, 61, .14);
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--green);
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

button, .button-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 15px;
  color: #fff;
  background: var(--green);
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .button-link:hover {
  background: var(--green-strong);
}

button.ghost {
  color: var(--green);
  border-color: var(--line-strong);
  background: #fff;
}

button.ghost:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.button-link.ghost-link {
  color: var(--green);
  border-color: var(--line-strong);
  background: #fff;
}

.button-link.ghost-link:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

button.compact {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 13px;
}

button:disabled {
  opacity: .55;
  cursor: default;
}

fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  flex: 0 0 100%;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

fieldset label {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--panel-soft);
  font-size: 13px;
  font-weight: 800;
}

fieldset input, .filter-check input, .admin-filters input {
  width: auto;
  min-height: 0;
  accent-color: var(--green);
}

.planner-hero {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(360px, 1fr) minmax(280px, 330px);
  gap: 18px;
  align-items: start;
  min-height: 0;
  padding: 24px 0 18px;
}

.planner-card,
.route-results-panel,
.weekend-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.planner-card {
  overflow: hidden;
}

.planner-copy {
  padding: 22px 20px 8px;
}

.planner-copy p:last-child {
  margin-bottom: 0;
  font-size: 14px;
}

.planner-panel {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}

.planner-time-row,
.conditional-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.conditional-fields {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
}

.conditional-fields[hidden] {
  display: none;
}

.field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: end;
}

.route-results-panel {
  min-height: 540px;
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 0 16px;
}

.route-results-panel .section-head,
.admin-audit .section-head {
  margin: 0 0 14px;
}

.section-head p {
  margin-bottom: 0;
  font-size: 14px;
}

.result-actions,
.actions,
.auth-actions,
.trip-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-items: stretch;
  gap: 14px;
  margin-bottom: 34px;
}

.planner-result-list {
  grid-template-columns: 1fr;
  max-height: none;
  overflow: visible;
  padding-right: 0;
  margin-bottom: 0;
}

.planner-option-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.planner-option-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.planner-option-head h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.planner-option-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.soft-badge {
  background: #eef4f1;
  color: var(--muted);
}

.planner-option-place {
  min-height: 0;
}

.planner-time-plan {
  display: grid;
  gap: 8px;
  border: 1px solid #d9e6dd;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fbf8;
}

.planner-time-plan h4 {
  margin: 0;
  font-size: 14px;
}

.planner-timetable {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.planner-warnings {
  margin: 0;
}

.planner-option-actions {
  margin-top: 0;
}

.planner-result-list .place-card {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  align-items: start;
}

.planner-result-list .place-card img,
.planner-result-list .place-card .place-card-placeholder {
  height: auto;
  align-self: start;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  object-position: center;
}

.page-card-grid {
  margin-top: 16px;
}

.place-card {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(24, 43, 31, .07);
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.place-card:hover,
.place-card:focus-visible {
  transform: translateY(-1px);
  border-color: #b8d4bd;
  box-shadow: 0 10px 26px rgba(24, 43, 31, .11);
}

.place-card img,
.place-card .place-card-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  display: block;
  object-fit: cover;
  background: #dbe6df;
}

.photo-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
  background: #dbe6df;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  color: #31523d;
  background:
    linear-gradient(135deg, rgba(235, 243, 238, .96), rgba(246, 248, 244, .96)),
    radial-gradient(circle at 50% 35%, rgba(34, 103, 58, .14), transparent 36%);
}

.photo-placeholder strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.photo-placeholder span,
.photo-placeholder p {
  max-width: 520px;
  margin: 0;
  color: #496054;
  font-size: 14px;
  font-weight: 760;
}

.place-card .body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px;
}

.place-card h3 {
  margin: 0;
}

.place-card p {
  margin: 0;
  font-size: 13px;
}

.place-card .place-hook {
  color: #41594a;
  font-weight: 760;
}

.place-card button {
  width: 100%;
  margin-top: 4px;
}

.place-card .button-link {
  width: 100%;
  margin-top: auto;
}

.compact-place-card .body {
  justify-content: center;
}

.card-reason {
  color: #496054;
  font-weight: 750;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  color: #31523d;
  background: #e9f1ec;
  font-size: 12px;
  font-weight: 850;
}

.weekend-preview {
  overflow: hidden;
}

.weekend-preview > img,
.weekend-photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: #dbe6df;
}

.weekend-photo-mosaic {
  width: 100%;
  height: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  overflow: hidden;
  padding: 10px;
  background: #dbe6df;
  container-type: inline-size;
}

.weekend-photo-tile {
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  display: block;
  flex: 0 0 auto;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: transparent;
}

.weekend-photo-tile img {
  width: auto;
  max-width: 100%;
  height: clamp(140px, 30cqw, 220px);
  aspect-ratio: auto;
  display: block;
  object-fit: contain;
  object-position: center;
  transition: transform .18s ease;
}

.weekend-photo-tile:hover img,
.weekend-photo-tile:focus-visible img {
  transform: none;
}

.weekend-photo-tile:focus-visible {
  outline: 3px solid rgba(34, 103, 58, .28);
  outline-offset: -3px;
}

.weekend-preview-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.preview-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.preview-title-row h2 {
  margin: 0;
}

.rating-pill {
  align-self: start;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.preview-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.preview-facts div,
.fact {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--panel-soft);
}

.preview-facts dt,
.fact span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.preview-facts dd,
.fact strong {
  display: block;
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.quick-links {
  display: grid;
  gap: 8px;
}

.user-plans,
.user-preferences,
.collections,
.map-section,
.catalog {
  scroll-margin-top: 84px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(280px, .65fr) minmax(280px, 1fr);
  gap: 14px;
  margin-bottom: 34px;
}

.profile-panel,
.trip-plan-card,
.collection-card {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.profile-panel h3,
.trip-plan-card h3,
.collection-card h3 {
  margin: 0;
}

.inline-state {
  min-width: 220px;
  margin: 0;
  text-align: right;
  font-weight: 750;
}

.start-points-list,
.trip-plan-list,
.stack {
  display: grid;
  gap: 8px;
}

.trip-plan-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 34px;
}

.trip-plan-list > .state,
.places-grid > .state {
  grid-column: 1 / -1;
}

.trip-plan-card p,
.collection-card p {
  margin-bottom: 0;
}

.trip-plan-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trip-plan-preview span,
.filter-check {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: #31523d;
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 850;
}

.danger-action {
  color: var(--danger) !important;
  border-color: rgba(178, 70, 63, .4) !important;
}

.start-point-item {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--panel-soft);
  text-align: left;
}

.start-point-item strong {
  font-size: 15px;
}

.start-point-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  align-items: stretch;
  gap: 12px;
  margin-bottom: 34px;
}

.scenario-card {
  min-height: 190px;
  grid-template-rows: auto 1fr auto;
}

.collection-card {
  min-height: 100%;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.collection-card:hover,
.collection-card:focus-visible {
  transform: translateY(-1px);
  border-color: #b8d4bd;
  box-shadow: 0 10px 26px rgba(24, 43, 31, .11);
}

.featured-scenario {
  border-color: #b8d4bd;
  background: linear-gradient(180deg, #ffffff 0%, #f3faf4 100%);
}

.collection-card-head {
  display: grid;
  gap: 10px;
}

.collection-title {
  line-height: 1.25;
}

.collection-count {
  width: max-content;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #c6dccb;
  border-radius: 999px;
  padding: 4px 9px;
  color: #214d31;
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 900;
}

.collection-description {
  color: #41594a;
}

.collection-card .button-link {
  width: 100%;
  align-self: end;
  margin-top: auto;
}

.place-card:hover .button-link,
.place-card:focus-visible .button-link,
.collection-card:hover .button-link,
.collection-card:focus-visible .button-link {
  background: var(--green-strong);
}

.collection-page-count {
  width: max-content;
  margin-top: 12px;
  border: 1px solid #c6dccb;
  border-radius: 999px;
  padding: 5px 10px;
  color: #214d31;
  background: var(--green-soft);
  font-weight: 900;
}

.compact-scenario-card {
  min-height: 0;
}

.collection-card button {
  justify-self: start;
}

.map-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto minmax(220px, .7fr);
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.map-sidebar {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.map-sidebar .map-toolbar {
  grid-template-columns: 1fr;
  margin-bottom: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.map-filters {
  min-width: 0;
  display: grid;
}

.map-route-state {
  min-height: 42px;
  display: flex;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.map-board {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 34px;
  background:
    linear-gradient(90deg, rgba(31,107,61,.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(47,111,150,.07) 1px, transparent 1px),
    #edf4ee;
  background-size: 56px 56px;
  box-shadow: var(--shadow-soft);
}

.map-board.is-yandex-map {
  background: #edf4ee;
}

.large-map-board {
  min-height: calc(100vh - 190px);
  margin-bottom: 0;
}

.map-marker {
  position: absolute;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 3px 10px rgba(14,30,23,.25);
  transform: translate(-50%, -50%);
}

.map-marker.easy,
.map-marker.легкая {
  background: var(--green);
}

.map-marker.hard,
.map-marker.сложная {
  background: var(--danger);
}

.map-popup {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: min(360px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow);
}

.map-popup h3,
.map-popup p {
  margin-bottom: 8px;
}

.filters {
  min-width: min(680px, 100%);
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.filters input,
.filters select {
  flex: 1 1 150px;
  min-width: 150px;
}

.feature-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.state {
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  border: 1px dashed #b5c4bb;
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  color: var(--muted);
  background: #fff;
}

.photo-placeholder,
.state,
.detail-empty,
#photoList .photo-preview-frame.is-missing {
  text-align: center;
}

.photo-placeholder > *,
.state > *,
.detail-empty > *,
#photoList .photo-preview-placeholder {
  text-align: center;
}

.place-dialog,
.auth-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.place-dialog {
  width: min(980px, calc(100% - 24px));
  max-height: min(860px, calc(100vh - 24px));
}

.auth-dialog {
  width: min(420px, calc(100% - 24px));
}

.place-dialog::backdrop,
.auth-dialog::backdrop {
  background: rgba(10, 18, 14, .45);
}

.auth-panel {
  margin: 0;
}

.auth-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.auth-body p {
  min-height: 22px;
  margin: 0;
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 15px 18px;
  background: var(--panel);
}

.dialog-head h2 {
  margin: 0;
  font-size: 22px;
}

.inline-head {
  position: static;
}

.place-detail {
  display: grid;
  gap: 16px;
  padding: 18px;
  min-width: 0;
  max-width: 100%;
}

.detail-page-shell .place-detail {
  padding: 0;
}

.place-detail-page {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.place-detail-page > section {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.place-detail-page .detail-section {
  border-top: 0;
}

.place-photo-section {
  display: grid;
  gap: 0;
  width: min(100%, 1040px);
  justify-self: center;
  overflow: hidden;
  padding: 0 !important;
}

.detail-media-viewer {
  display: grid;
  grid-template-columns: minmax(320px, 640px) minmax(132px, 168px);
  justify-content: center;
  align-items: start;
  gap: 12px;
  padding: 12px;
  background: #fbfdfb;
}

.detail-media-viewer.is-single {
  grid-template-columns: 1fr;
}

.detail-media-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 12px 12px;
  background: #fbfdfb;
}

.detail-photo-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 640px;
  min-height: 360px;
  height: min(62vh, 620px);
  justify-self: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dbe6df;
  cursor: zoom-in;
  overflow: hidden;
}

.detail-photo-main.is-portrait {
  max-width: 420px;
}

.detail-photo-main.is-square {
  max-width: 560px;
}

.detail-photo-main.is-landscape {
  max-width: 720px;
}

.detail-photo-media {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 8px;
  background: #dbe6df;
}

.detail-photo-zoom-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff;
  background: rgba(20, 33, 23, .72);
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  transition: opacity .16s ease;
  pointer-events: none;
}

.detail-photo-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(20, 33, 23, .16);
  border-radius: 999px;
  padding: 0;
  color: #fff;
  background: rgba(20, 33, 23, .68);
  box-shadow: 0 8px 20px rgba(20, 33, 23, .18);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.detail-photo-arrow:hover,
.detail-photo-arrow:focus-visible {
  background: rgba(36, 79, 36, .92);
}

.detail-photo-arrow-prev {
  left: 12px;
}

.detail-photo-arrow-next {
  right: 12px;
}

.detail-photo-main:hover .detail-photo-zoom-hint,
.detail-photo-main:focus-visible .detail-photo-zoom-hint {
  opacity: 1;
}

.detail-photo-placeholder {
  min-height: 220px;
  aspect-ratio: 16 / 9;
  align-content: center;
  justify-items: center;
}

.detail-photo-placeholder h2 {
  margin: 0;
  font-size: 26px;
}

.photo-upload-link {
  width: auto !important;
  min-width: min(260px, 100%);
  gap: 9px;
}

.photo-upload-plus {
  display: inline-grid;
  place-items: center;
  color: currentColor;
  font-family: Arial, sans-serif;
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
}

.detail-photo-strip {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 8px;
  max-height: min(62vh, 620px);
  overflow: auto;
  padding: 0 2px 0 0;
  background: transparent;
  scrollbar-width: thin;
}

.detail-photo-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 118px;
  aspect-ratio: 1 / 1;
  width: 100%;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 5px;
  overflow: hidden;
  background: #eef5f0;
  box-shadow: none;
}

.detail-photo-thumb-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.detail-photo-thumb:hover,
.detail-photo-thumb:focus-visible,
.detail-photo-thumb.is-active {
  border-color: var(--green);
}

.detail-photo-thumb-media {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 6px;
  background: #dbe6df;
}

.media-lightbox {
  width: min(96vw, 1180px);
  max-width: 96vw;
  max-height: 94vh;
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: #f7fbf7;
  background: #101811;
}

.media-lightbox::backdrop {
  background: rgba(9, 16, 10, .82);
}

.media-lightbox-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  height: min(94vh, 920px);
  padding: 14px;
}

.media-lightbox-head,
.media-lightbox-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.media-lightbox-counter {
  font-weight: 850;
}

.media-lightbox-close,
.media-lightbox-nav {
  width: auto;
  min-height: 40px;
  border-color: rgba(255, 255, 255, .32);
  color: #f7fbf7;
  background: rgba(255, 255, 255, .08);
}

.media-lightbox-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  border-radius: 8px;
  background: #070b08;
  overflow: hidden;
}

.media-lightbox-media {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(94vh - 170px);
  object-fit: contain;
}

.media-kind-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  border-radius: 999px;
  padding: 3px 7px;
  color: #fff;
  background: rgba(31, 44, 35, .82);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.detail-summary {
  display: grid;
  gap: 14px;
}

.detail-title-block {
  display: grid;
  gap: 8px;
}

.detail-title-block h1,
.detail-title-block p {
  margin-bottom: 0;
}

.detail-title-block .rating-pill {
  justify-self: start;
}

.place-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(280px, .55fr);
  gap: 16px;
  align-items: start;
}

.place-detail-main {
  display: grid;
  align-content: center;
}

.place-detail-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  object-fit: cover;
  background: #dbe6df;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-facts {
  margin: 0;
}

.travel-estimator-section {
  display: grid;
  gap: 12px;
}

.travel-estimator-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.travel-estimator-form label {
  display: grid;
  gap: 6px;
}

.travel-estimator-form button {
  min-width: 220px;
}

.travel-estimator-result {
  display: grid;
  gap: 8px;
}

.travel-estimator-state {
  margin: 0;
  color: #31523d;
  font-weight: 800;
}

.detail-list,
.detail-bullets {
  display: grid;
  gap: 8px;
}

.detail-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-bullets li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  color: #41594a;
  line-height: 1.5;
}

.detail-bullets li::before {
  content: "—";
  color: var(--green);
  font-weight: 900;
}

.detail-empty {
  margin-bottom: 0;
}

.detail-section h3 {
  margin: 8px 0 0;
  font-size: 16px;
}

.route-point-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.subtle-link {
  width: auto !important;
}

.detail-callout {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  border: 1px solid #d9e7dc;
  border-radius: 8px;
  padding: 12px;
  background: #f4faf5;
}

.detail-callout p {
  margin: 0;
  color: #41594a;
}

.compact-bullets {
  gap: 4px;
}

.weather-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.weather-fact {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
}

.weather-fact strong,
.weather-fact span {
  display: block;
}

.weather-fact strong {
  color: var(--muted);
  font-size: 12px;
}

.weather-fact span {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.weather-notes {
  margin-top: 10px;
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.trip-builder-section {
  display: grid;
  gap: 14px;
}

.trip-builder-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.trip-builder-form label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

.trip-builder-form input,
.trip-builder-form select {
  min-width: 0;
}

.trip-builder-form button {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 42px;
}

.parking-start-section .detail-list {
  align-items: stretch;
}

.parking-start-section .stack-item {
  display: flex;
  flex-direction: column;
}

.parking-start-section .route-point-actions {
  margin-top: auto;
  padding-top: 12px;
}

.trip-builder-result {
  display: grid;
  gap: 12px;
}

.trip-builder-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trip-builder-place-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.trip-builder-actions {
  margin-top: 2px;
}

.place-user-actions,
.place-contribution {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.place-user-actions .action-state {
  flex: 1 1 220px;
  margin: 0;
}

.contribution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.contribution-form {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.contribution-form h4 {
  margin: 0;
  font-size: 16px;
}

.contribution-state {
  min-height: 21px;
  margin: 0;
  font-weight: 750;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.detail-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 160px));
  justify-content: start;
  gap: 8px;
}

.gallery-media-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 120px;
  border-radius: 8px;
  padding: 8px;
  overflow: hidden;
  background: #dbe6df;
}

.gallery-media {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 180px;
  display: block;
  object-fit: contain;
  border-radius: 6px;
}

.photo-upload-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.admin-mobilebar {
  display: none;
}

.admin-shell {
  width: min(1540px, calc(100% - 24px));
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  margin: 18px auto 56px;
}

.admin-sidebar {
  position: sticky;
  top: 18px;
  min-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 14px;
  border-radius: var(--radius);
  padding: 18px;
  color: #e9f2ef;
  background:
    linear-gradient(180deg, rgba(47,111,150,.16), transparent 220px),
    var(--sidebar);
  box-shadow: var(--shadow);
}

.admin-brand {
  color: #fff;
}

.sidebar-caption {
  margin: 0;
  color: #a9bdc4;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-nav {
  display: grid;
  gap: 4px;
  align-content: start;
  color: #dce8e5;
  font-size: 14px;
}

.admin-nav a {
  justify-content: flex-start;
  min-height: 38px;
  color: inherit;
}

.admin-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .09);
}

.admin-login {
  align-self: end;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255,255,255,.06);
}

.admin-login label {
  color: #edf6f3;
}

.admin-login input {
  border-color: rgba(255,255,255,.16);
  color: #fff;
  background: rgba(255,255,255,.09);
}

.admin-login input:focus {
  border-color: #91cda6;
  box-shadow: 0 0 0 3px rgba(145, 205, 166, .18);
}

.admin-login p {
  margin: 0;
  color: #b8c8cc;
  font-size: 13px;
}

.admin-login button.ghost,
.admin-login #logoutButton {
  color: #e9f2ef;
  border-color: rgba(255,255,255,.24);
  background: transparent;
}

.admin-workspace {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.admin-workspace > *,
.dashboard,
.admin-audit,
.admin-grid,
.admin-list,
.editor,
.collection-admin-grid {
  min-width: 0;
  max-width: 100%;
}

.admin-page:not(.is-authenticated) .admin-workspace {
  display: none;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
}

.dashboard > div,
.admin-audit,
.admin-list,
.editor {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.metric {
  min-height: 94px;
  display: grid;
  gap: 8px;
  align-content: space-between;
  padding: 14px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.admin-audit {
  padding: 16px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.collection-admin-grid {
  display: grid;
  grid-template-columns: minmax(360px, .8fr) minmax(360px, 1fr);
  gap: 14px;
  align-items: start;
}

.nested-editor {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel-soft);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(430px, .92fr) minmax(480px, 1.08fr);
  gap: 16px;
  align-items: start;
}

.admin-list,
.editor {
  padding: 16px;
}

.admin-list .section-head {
  margin-top: 0;
}

.admin-page h1 {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.12;
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.admin-filters label {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 850;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #496054;
  background: #edf4ef;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

tr {
  cursor: pointer;
}

tr:hover td {
  background: #f8fbf8;
}

tr:focus-visible td {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.editor {
  display: grid;
  gap: 14px;
}

.editor h2 {
  margin-bottom: 0;
}

.editor > .actions {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(255,255,255,.95);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.editor > .actions button:nth-child(2),
.admin-audit .actions button:nth-child(2) {
  background: var(--blue);
}

.editor > .actions button:nth-child(3),
.admin-audit .actions button:nth-child(3) {
  background: var(--amber);
}

.editor > .actions button:nth-child(4) {
  background: var(--danger);
}

.editor-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.editor-panels section {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel-soft);
}

.stack-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.stack-item p {
  margin: 4px 0 0;
  font-size: 13px;
}

.stack-item button {
  min-height: 34px;
  margin: 8px 6px 0 0;
  padding: 7px 10px;
  font-size: 12px;
}

.stack-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.35;
}

.photo-thumb {
  border-radius: 8px;
  margin-bottom: 8px;
}

.status-published {
  color: var(--green);
  font-weight: 900;
}

.status-needs_review,
.status-draft {
  color: var(--amber);
  font-weight: 900;
}

.status-hidden,
.status-duplicate,
.status-archived {
  color: var(--danger);
  font-weight: 900;
}

/* Admin panel redesign based on the moderation dashboard concept. */
body.admin-page {
  background:
    radial-gradient(circle at 70% 0, rgba(31, 107, 61, .06), transparent 28rem),
    #f2f5f3;
}

.admin-shell {
  width: min(1560px, calc(100% - 28px));
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}

.admin-sidebar {
  top: 14px;
  min-height: calc(100vh - 28px);
  border: 0;
  border-radius: 8px;
  padding: 18px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0) 210px),
    linear-gradient(180deg, #102637 0%, #152d3b 100%);
  box-shadow: 0 20px 45px rgba(11, 31, 43, .18);
}

.admin-brand {
  align-items: flex-start;
  gap: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.15;
  white-space: normal;
}

.admin-brand span:last-child {
  min-width: 0;
  max-width: 150px;
}

.admin-brand .brand-mark {
  flex: 0 0 28px;
  margin-top: 1px;
}

.sidebar-caption {
  margin-top: -7px;
  padding-left: 36px;
  color: #9fb2bb;
  font-size: 11px;
  letter-spacing: 0;
}

.admin-nav {
  gap: 3px;
  margin-top: 8px;
}

.admin-nav a {
  min-height: 34px;
  justify-content: flex-start;
  border-radius: 6px;
  padding: 8px 10px;
  color: #dbe7e4;
  font-size: 13px;
  text-decoration: none;
}

.admin-nav a[href="#places"] {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

.admin-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .14);
}

.admin-login {
  border-color: rgba(255, 255, 255, .12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, .06);
}

.admin-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#dashboard {
  order: 1;
}

#places {
  order: 2;
}

.admin-audit {
  order: 3;
}

#jobsAdmin {
  order: 4;
}

#collectionsAdmin {
  order: 5;
}

.dashboard {
  grid-template-columns: repeat(5, minmax(128px, 1fr));
  gap: 14px;
}

.dashboard > div.metric {
  position: relative;
  min-height: 88px;
  overflow: hidden;
  border: 1px solid #e0e8e2;
  border-radius: 8px;
  padding: 14px 15px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(28, 48, 37, .06);
}

.dashboard > div.metric::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 6px;
  opacity: .2;
}

.metric[data-tone="success"] {
  color: #1f6b3d;
  background: linear-gradient(180deg, #fff, #f6fbf7);
}

.metric[data-tone="review"] {
  color: #2f6f96;
  background: linear-gradient(180deg, #fff, #f5f9fc);
}

.metric[data-tone="warning"] {
  color: #a56a1d;
  background: linear-gradient(180deg, #fff, #fff9ed);
}

.metric[data-tone="danger"] {
  color: #b2463f;
  background: linear-gradient(180deg, #fff, #fff7f6);
}

.metric span {
  color: #69786f;
  font-size: 11px;
  font-weight: 850;
  text-transform: none;
}

.metric strong {
  color: #17211b;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0;
}

.admin-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.admin-page:not(.is-editing-place) #editor {
  display: none;
}

.admin-page:not(.is-editing-place) a[href="#editor"] {
  display: none;
}

.admin-page.is-editing-place .admin-list {
  display: none;
}

.admin-page.is-editing-place #editor {
  display: grid;
}

.admin-list,
.editor,
.admin-audit {
  border-color: #dce7df;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(28, 48, 37, .07);
}

.admin-list {
  overflow: hidden;
  padding: 0;
}

.admin-list .section-head {
  padding: 18px 18px 10px;
}

.admin-page h1 {
  font-size: 22px;
}

.admin-list .section-head p,
.admin-audit .section-head p {
  color: #66746a;
  font-size: 13px;
}

.admin-list .section-head button {
  margin-left: auto;
}

.admin-filters {
  margin: 0;
  padding: 0 18px 14px;
  gap: 8px;
}

.admin-search-row {
  padding: 0 18px 12px;
}

.admin-search-row label {
  display: grid;
  gap: 6px;
  max-width: 520px;
  color: #496054;
  font-size: 12px;
  font-weight: 850;
}

.admin-search-row input {
  min-height: 38px;
  border: 1px solid #d9e4dc;
  border-radius: 6px;
  padding: 9px 12px;
  background: #fff;
}

.admin-filters label {
  min-height: 30px;
  border-radius: 6px;
  padding: 6px 9px;
  color: #496054;
  background: #f7faf7;
  font-size: 12px;
  font-weight: 760;
}

.admin-filters input {
  width: 15px;
  height: 15px;
}

.table-wrap {
  margin: 0 18px 18px;
  border-color: #e2e9e3;
  border-radius: 8px;
  background: #fff;
}

table {
  min-width: 780px;
}

th,
td {
  padding: 11px 10px;
  font-size: 13px;
}

th {
  color: #5b6b61;
  background: #f7faf7;
  font-size: 11px;
  text-transform: none;
}

td small {
  color: #7a877f;
}

tr:hover td {
  background: #fbfdfb;
}

.admin-place-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.admin-row-id {
  color: #6f7b73;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge,
.yes-badge,
.no-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.status-badge.status-published,
.yes-badge {
  color: #1f6b3d;
  border-color: #cfe2d1;
  background: #edf7ee;
}

.status-badge.status-needs_review,
.status-badge.status-draft {
  color: #8f5d17;
  border-color: #f0d7aa;
  background: #fff4df;
}

.status-badge.status-hidden,
.status-badge.status-duplicate,
.status-badge.status-archived,
.no-badge {
  color: #a33d37;
  border-color: #efd0cd;
  background: #fff0ef;
}

.editor {
  position: static;
  top: auto;
  max-height: none;
  overflow: visible;
  gap: 12px;
  padding: 16px;
}

.editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #dfe9e2;
  padding-bottom: 12px;
}

.editor-head p {
  margin: 4px 0 0;
  color: #63756a;
  font-size: 13px;
}

.editor-head button {
  flex: 0 0 auto;
}

.editor h2 {
  margin: 0;
  font-size: 18px;
}

.editor label {
  color: #425449;
  font-size: 12px;
  font-weight: 850;
}

.editor input,
.editor select,
.editor textarea {
  min-height: 38px;
  border-color: #d9e4dc;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.editor textarea {
  min-height: 86px;
}

.editor-section {
  display: grid;
  gap: 10px;
  border: 1px solid #dfe9e2;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.editor-section h3 {
  margin: 0;
  color: #1f2c23;
  font-size: 15px;
}

.editor-section .two-col {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.related-item {
  display: grid;
  gap: 10px;
}

.related-title {
  color: #1f2c23;
  font-size: 13px;
  line-height: 1.3;
}

.related-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.related-field {
  display: grid;
  gap: 5px;
}

.related-field textarea {
  min-height: 64px;
}

.related-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-actions button {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.related-actions .danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.field-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px rgba(178, 70, 63, .12);
}

.editor > .two-col {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.editor > .actions {
  position: static;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 8px;
  padding: 10px;
  background: #f7faf7;
  box-shadow: none;
}

.editor > .actions button {
  min-height: 38px;
  padding: 9px 10px;
  font-size: 13px;
}

.editor-panels {
  grid-template-columns: 1fr;
  gap: 12px;
}

.editor-panels section {
  border-color: #dfe9e2;
  border-radius: 8px;
  padding: 13px;
  background: #fbfdfb;
}

.editor-panels section h3 {
  margin: 0;
  color: #1f2c23;
  font-size: 15px;
}

#photoList {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.photo-sort-help {
  margin: 0;
  color: #63756a;
  font-size: 12px;
  font-weight: 800;
}

#photoList .photo-item {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  gap: 8px;
  overflow: hidden;
  padding: 0;
  cursor: grab;
  transition: border-color .16s ease, box-shadow .16s ease, opacity .16s ease;
}

#photoList .photo-item.is-dragging {
  opacity: .55;
  cursor: grabbing;
}

#photoList .photo-item.is-drag-over {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(29, 112, 60, .16);
}

#photoList .drag-hint {
  margin: -2px 8px 0;
  color: #5f7167;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

#photoList .state {
  grid-column: 1 / -1;
}

#photoList .photo-preview-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dfe8e2;
  border-radius: 6px;
  background: #dce8df;
}

#photoList .photo-preview-frame.is-missing {
  align-content: center;
  justify-items: center;
  padding: 12px;
  text-align: center;
}

#photoList .photo-preview-placeholder {
  color: #5d7066;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

#photoList .photo-thumb {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  border-radius: 0;
  margin: 0;
  object-fit: contain;
}

#photoList .photo-meta {
  display: grid;
  gap: 4px;
  padding: 0 8px;
}

#photoList .photo-meta strong,
#photoList .photo-meta p {
  margin: 0;
  overflow-wrap: anywhere;
}

#photoList .photo-meta strong {
  color: #1f2c23;
  font-size: 12px;
  line-height: 1.25;
}

#photoList .photo-item p {
  color: #607267;
  font-size: 12px;
  line-height: 1.25;
  max-height: 42px;
  overflow: hidden;
}

#photoList .photo-actions {
  display: grid;
  gap: 6px;
  padding: 0 6px 6px;
}

#photoList .photo-item button {
  width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.2;
}

#photoList .photo-item button.secondary {
  border-color: #cfe0d5;
  color: #1d703c;
  background: #eef6f0;
}

.stack-item {
  border-color: #dfe8e2;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .planner-hero {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  }

  .weekend-preview {
    position: static;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(240px, .45fr) minmax(0, 1fr);
  }

  .weekend-preview > img,
  .weekend-photo-placeholder {
    height: 100%;
    aspect-ratio: auto;
  }

  .weekend-photo-mosaic {
    height: auto;
    aspect-ratio: auto;
    align-self: start;
  }

  .dashboard {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-sidebar {
    position: static;
  }

  .admin-grid,
  .collection-admin-grid {
    grid-template-columns: 1fr;
  }

  .editor {
    position: static;
    max-height: none;
  }
}

@media (max-width: 920px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    padding: 12px 16px;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    gap: 8px;
  }

  .user-panel {
    justify-content: space-between;
  }

  nav {
    flex-wrap: wrap;
  }

  main,
  .admin-shell {
    width: min(100% - 20px, 1180px);
  }

  .trip-builder-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-media-viewer {
    grid-template-columns: 1fr;
  }

  .detail-photo-main {
    min-height: 300px;
    height: 360px;
    max-width: 100%;
  }

  .detail-photo-arrow {
    width: 38px;
    height: 38px;
    min-height: 38px;
    font-size: 21px;
  }

  .detail-photo-arrow-prev {
    left: 8px;
  }

  .detail-photo-arrow-next {
    right: 8px;
  }

  .detail-photo-media {
    max-height: 420px;
  }

  .detail-photo-strip {
    display: flex;
    gap: 8px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 4px;
  }

  .detail-photo-thumb {
    flex: 0 0 104px;
    height: 88px;
    min-height: 0;
    aspect-ratio: auto;
  }

  .planner-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 16px;
  }

  .planner-card,
  .route-results-panel,
  .weekend-preview,
  .map-sidebar,
  .admin-sidebar {
    position: static;
  }

  .route-results-panel {
    min-height: 0;
  }

  .planner-result-list {
    max-height: none;
  }

  .planner-result-list .place-card {
    grid-template-columns: minmax(132px, 170px) minmax(0, 1fr);
  }

  .weekend-preview {
    grid-template-columns: 1fr;
  }

  .weekend-preview > img,
  .weekend-photo-placeholder {
    aspect-ratio: 16 / 9;
  }

  .weekend-photo-mosaic {
    height: auto;
    aspect-ratio: auto;
  }

  .section-head,
  .filters,
  .map-toolbar,
  .map-layout,
  .field-with-action,
  .profile-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .inline-state {
    min-width: 0;
    text-align: left;
  }

  .result-actions button {
    flex: 1 1 140px;
  }

  .map-route-state {
    min-height: 0;
  }

  .place-detail-hero,
  .two-col {
    grid-template-columns: 1fr;
  }

  .admin-mobilebar {
    display: flex;
  }

  .admin-shell {
    grid-template-columns: 1fr;
    margin-top: 12px;
  }

  .admin-sidebar {
    min-height: 0;
  }

  .admin-sidebar .admin-brand,
  .admin-sidebar .sidebar-caption,
  .admin-nav {
    display: none;
  }

  .admin-login {
    align-self: stretch;
  }

  .dashboard {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  main {
    width: min(100% - 16px, 1240px);
    margin-bottom: 40px;
  }

  h1 {
    font-size: 28px;
  }

  .planner-copy,
  .planner-panel,
  .route-results-panel,
  .weekend-preview-body,
  .admin-audit,
  .admin-list,
  .editor {
    padding: 14px;
  }

  .planner-time-row,
  .conditional-fields {
    grid-template-columns: 1fr;
  }

  .planner-option-head {
    display: grid;
  }

  .planner-option-meta {
    justify-content: flex-start;
  }

  .planner-result-list .place-card {
    grid-template-columns: 1fr;
  }

  .planner-result-list .place-card img,
  .planner-result-list .place-card .place-card-placeholder {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .places-grid,
  .collection-grid,
  .trip-plan-list {
    grid-template-columns: 1fr;
  }

  .trip-builder-form {
    grid-template-columns: 1fr;
  }

  .travel-estimator-form {
    grid-template-columns: 1fr;
  }

  .travel-estimator-form button {
    width: 100%;
    min-width: 0;
  }

  .editor-section .two-col,
  .related-fields {
    grid-template-columns: 1fr;
  }

  .preview-facts,
  .fact-grid,
  .dashboard {
    grid-template-columns: 1fr;
  }

  .detail-photo-placeholder {
    aspect-ratio: 4 / 3;
  }

  .detail-media-viewer {
    padding: 10px;
  }

  .detail-photo-main {
    min-height: 260px;
    height: 340px;
    padding: 8px;
  }

  .detail-photo-media {
    max-height: 340px;
  }

  .detail-photo-strip {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .detail-photo-thumb {
    flex-basis: 92px;
    height: 82px;
    min-height: 0;
    aspect-ratio: auto;
  }

  .photo-upload-form {
    grid-template-columns: 1fr;
  }

  .dialog-head {
    align-items: start;
    flex-direction: column;
  }
}

body.public-page .planner-hero > .planner-card,
body.public-page .planner-hero > .route-results-panel,
body.public-page .planner-hero > .weekend-preview {
  position: static !important;
  top: auto !important;
  align-self: start;
}

body.public-page .planner-result-list {
  max-height: none !important;
  overflow: visible !important;
}
