:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --panel: #ffffff;
  --surface: #f5f7fa;
  --nz: #168a6a;
  --casino: #7d4bc2;
  --favourite: #d39a12;
  --location: #e85d3d;
  --route: #f06b42;
  --shadow: 0 14px 36px rgba(23, 32, 51, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  background: var(--surface);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
}

.topbar {
  display: grid;
  gap: 12px;
  padding: 14px 12px 10px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(216, 222, 232, 0.82);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.brand > div {
  min-width: 0;
  flex: 1 1 auto;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid #1f2937;
  border-radius: 8px;
  background: #ffcc4d;
  color: #1f2937;
  font-weight: 850;
}

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

h1 {
  font-size: 1.42rem;
  line-height: 1.05;
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.top-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  min-width: 0;
}

.icon-text-button,
.segment,
.filter-chip,
.radius-chip,
.close-button,
.favourite-button,
.rating-button,
.directions-button,
.secondary-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.icon-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 42px;
  padding: 0 9px;
  font-size: 0.92rem;
  font-weight: 800;
  white-space: nowrap;
}

.icon-text-button:not(.ghost) {
  border-color: #1f2937;
  background: #1f2937;
  color: #ffffff;
}

.icon-text-button.ghost[aria-pressed="true"] {
  border-color: rgba(211, 154, 18, 0.72);
  background: #fff5d7;
  color: #73500b;
}

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

.map-panel {
  position: sticky;
  top: 0;
  z-index: 2;
  min-width: 0;
  min-height: 48vh;
  background: #dcecf3;
}

#venueMap {
  width: 100%;
  height: min(58vh, 560px);
  min-height: 390px;
}

.map-status {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 450;
  max-width: calc(100% - 20px);
  border: 1px solid rgba(23, 32, 51, 0.16);
  border-radius: var(--radius);
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #526071;
  font-size: 0.75rem;
  font-weight: 800;
}

.control-panel {
  position: relative;
  z-index: 3;
  display: grid;
  min-width: 0;
  margin-top: -10px;
  border: 1px solid rgba(216, 222, 232, 0.88);
  border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
}

.search-row {
  display: grid;
  gap: 8px;
  padding: 14px 14px 8px;
}

.search-label,
.status-kicker {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

#searchInput {
  width: 100%;
  height: 45px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

#searchInput:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(36, 119, 216, 0.28);
  outline-offset: 2px;
}

.segmented-control,
.chip-row,
.radius-row,
.utility-row,
.report-missing-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  padding: 8px 14px;
}

.mobile-filter-toggle-row,
.mobile-bottom-nav {
  display: none;
}

.view-mode-control {
  padding-top: 0;
}

.utility-row {
  align-items: center;
  justify-content: space-between;
}

.segment,
.filter-chip,
.radius-chip {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 34px;
  padding: 0 11px;
  color: #3e4a5e;
  font-size: 0.86rem;
  font-weight: 800;
}

.segment.is-active,
.radius-chip.is-active {
  border-color: rgba(36, 119, 216, 0.68);
  background: #e8f2ff;
  color: #164f93;
}

.filter-chip[aria-pressed="true"] {
  border-color: rgba(240, 107, 66, 0.6);
  background: #fff0e7;
  color: #9b3d22;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  font-size: 0.86rem;
  font-weight: 800;
}

.toggle-control input {
  position: absolute;
  opacity: 0;
}

.toggle-control span {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background 160ms ease;
}

.toggle-control span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ffffff;
  content: "";
  transition: transform 160ms ease;
}

.toggle-control input:checked + span {
  background: var(--nz);
}

.toggle-control input:checked + span::after {
  transform: translateX(16px);
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.sort-control select {
  min-width: 120px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
}

.status-card {
  display: grid;
  gap: 5px;
  margin: 8px 14px;
  padding: 12px;
  border: 1px solid #f4d89b;
  border-radius: var(--radius);
  background: #fff9ea;
}

.status-card strong {
  font-size: 1rem;
}

.status-card span:last-child {
  color: #73500b;
  font-size: 0.86rem;
  line-height: 1.35;
}

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  padding: 6px 14px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 999px;
}

.dot.nz {
  background: var(--nz);
}

.dot.casino {
  background: var(--casino);
}

.dot.favourite {
  background: var(--favourite);
}

.dot.location {
  background: var(--location);
}

.support-card {
  display: grid;
  gap: 8px;
  margin: 0 14px 14px;
  padding: 12px;
  border: 1px solid #cfe2f7;
  border-radius: var(--radius);
  background: #f7fbff;
}

.support-card strong {
  font-size: 0.98rem;
}

.support-card p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

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

.support-actions a,
.quick-exit-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(36, 119, 216, 0.24);
  border-radius: var(--radius);
  padding: 0 10px;
  background: #ffffff;
  color: #164f93;
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
}

.quick-exit-button {
  width: 100%;
  min-height: 40px;
  border-color: #b42318;
  background: #b42318;
  color: #ffffff;
}

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

.reminder-grid .sort-control {
  justify-content: space-between;
}

.reminder-grid input,
.reminder-grid select {
  width: 98px;
  min-width: 0;
}

.venue-list-panel {
  min-height: 0;
  border-top: 1px solid var(--line);
}

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
}

.panel-heading h2 {
  font-size: 1rem;
}

.panel-heading span {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

.venue-list {
  display: grid;
  gap: 10px;
  max-height: 52vh;
  overflow: auto;
  padding: 0 14px 18px;
  scrollbar-color: #b8c0cc transparent;
}

.venue-card {
  display: grid;
  gap: 9px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #ffffff;
  text-align: left;
}

.venue-card.is-selected {
  border-color: rgba(240, 107, 66, 0.68);
  box-shadow: 0 0 0 3px rgba(240, 107, 66, 0.14);
}

.list-more-row {
  display: grid;
  place-items: center;
  padding: 4px 0 2px;
}

.list-more-row .secondary-button {
  width: 100%;
  justify-content: center;
}

.card-main-button {
  all: unset;
  display: grid;
  min-width: 0;
  gap: 4px;
  cursor: pointer;
}

.card-main-button:focus-visible {
  border-radius: 4px;
  outline: 3px solid rgba(36, 119, 216, 0.28);
  outline-offset: 2px;
}

.venue-card-header,
.detail-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.venue-card h3,
.detail-panel h2 {
  min-width: 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.18;
}

.meta-line,
.hours-line,
.detail-meta,
.licensed-name,
.source-line {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.licensed-name {
  margin-top: 3px;
}

.hours-line {
  color: #344054;
  font-weight: 760;
}

.card-tags,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-save-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tag {
  border: 1px solid #d7e1ea;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f8fbfd;
  color: #45536b;
  font-size: 0.73rem;
  font-weight: 820;
}

.distance-pill {
  border-color: rgba(36, 119, 216, 0.26);
  background: #eaf4ff;
  color: #164f93;
}

.machine-pill {
  border-color: rgba(22, 138, 106, 0.25);
  background: #eaf8f3;
  color: #0f684e;
}

.open-pill {
  border-color: rgba(22, 138, 106, 0.25);
  background: #eaf8f3;
  color: #0f684e;
}

.closed-pill {
  border-color: rgba(102, 112, 133, 0.25);
  background: #f2f4f7;
  color: #475467;
}

.unknown-pill {
  border-color: rgba(211, 154, 18, 0.28);
  background: #fff8e8;
  color: #73500b;
}

.verified-location-pill {
  border-color: rgba(36, 119, 216, 0.26);
  background: #eaf4ff;
  color: #164f93;
}

.verified-hours-pill {
  border-color: rgba(22, 138, 106, 0.25);
  background: #f0faf6;
  color: #0f684e;
}

.late-pill {
  border-color: rgba(125, 75, 194, 0.24);
  background: #f4efff;
  color: #5c3299;
}

.favourite-button {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #6a7281;
  font-size: 1.16rem;
  line-height: 1;
}

.favourite-button.is-active {
  border-color: rgba(211, 154, 18, 0.62);
  background: #fff4d1;
  color: #94690a;
}

.save-action-button.is-active {
  border-color: rgba(211, 154, 18, 0.62);
  background: #fff4d1;
  color: #73500b;
}

.rating-controls {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rating-controls.is-compact {
  margin-top: 2px;
}

.rating-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  color: #45536b;
  font-size: 0.86rem;
  font-weight: 800;
}

.rating-button strong {
  min-width: 1ch;
}

.like-button.is-active {
  border-color: rgba(22, 138, 106, 0.42);
  background: #eaf8f3;
  color: #0f684e;
}

.dislike-button.is-active {
  border-color: rgba(232, 93, 61, 0.42);
  background: #fff0ec;
  color: #a23b25;
}

.venue-pin {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: var(--nz);
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.26);
}

.venue-pin::after {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  content: "";
}

.venue-pin.casino {
  background: var(--casino);
}

.venue-pin.favourite {
  background: var(--favourite);
}

.venue-pin.nearest,
.venue-pin.selected {
  border-color: var(--route);
  transform: scale(1.18);
}

.venue-pin.nearest::after {
  width: auto;
  height: auto;
  background: transparent;
  color: #ffffff;
  content: "*";
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.user-location-marker {
  display: block;
  width: 22px;
  height: 22px;
  border: 4px solid #ffffff;
  border-radius: 999px;
  background: var(--location);
  box-shadow:
    0 0 0 8px rgba(232, 93, 61, 0.18),
    0 8px 18px rgba(23, 32, 51, 0.24);
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(22, 138, 106, 0.18);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(22, 138, 106, 0.9);
  color: #ffffff;
  font-weight: 850;
}

.detail-panel {
  position: fixed;
  z-index: 1000;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: none;
  max-height: min(68vh, 590px);
  overflow: auto;
  border: 1px solid rgba(216, 222, 232, 0.88);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.detail-panel.is-open {
  display: block;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
}

.detail-panel h2 {
  padding-right: 42px;
  font-size: 1.15rem;
}

.detail-body {
  display: grid;
  gap: 13px;
}

.detail-meta {
  margin-top: 6px;
}

.detail-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #f8fbfd;
}

.detail-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.detail-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 0.92rem;
}

.hours-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfcfe;
}

.hours-card h3 {
  font-size: 0.92rem;
}

.hours-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 12px;
  margin: 0;
  font-size: 0.86rem;
}

.hours-list dt {
  color: var(--muted);
  font-weight: 850;
}

.hours-list dd {
  margin: 0;
  color: var(--ink);
}

.hours-unavailable {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.report-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfcfe;
}

.report-card h3 {
  font-size: 0.92rem;
}

.report-card label {
  display: grid;
  gap: 5px;
}

.report-card label span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.report-card input,
.report-card select,
.report-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: #ffffff;
  color: var(--ink);
}

.report-card input[type="file"] {
  padding: 7px;
}

.report-card input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.report-card textarea {
  resize: vertical;
}

.missing-venue-form h2 {
  padding-right: 42px;
  font-size: 1.15rem;
}

.auth-form h2 {
  padding-right: 42px;
  font-size: 1.15rem;
}

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

.account-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(22, 138, 106, 0.24);
  border-radius: var(--radius);
  padding: 10px;
  background: #f0faf6;
}

.account-card[hidden],
.auth-form [hidden] {
  display: none;
}

.account-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.account-card strong {
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.account-tools {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.mini-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.mini-heading h3 {
  font-size: 0.92rem;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.mini-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.mini-list-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: #ffffff;
}

.mini-list-item span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.mini-list-item strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.mini-list-item p {
  color: var(--muted);
  font-size: 0.8rem;
}

.favourite-notes-form {
  background: #fffaf0;
}

.report-help {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.report-missing-button {
  width: 100%;
}

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

.report-status {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.82rem;
}

.holiday-hours {
  display: grid;
  gap: 5px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.holiday-hours strong {
  font-size: 0.82rem;
}

.holiday-hours span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.winnings-card {
  background: #fffdf8;
}

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

.winnings-photo {
  display: grid;
  gap: 6px;
  margin: 0;
}

.winnings-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
  background: #eef2f7;
}

.winnings-photo figcaption {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.winnings-form {
  background: #ffffff;
}

.directions-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 850;
  text-decoration: none;
}

.directions-button {
  border-color: var(--route);
  background: var(--route);
  color: #ffffff;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.empty-state {
  border: 1px dashed #b9c2cf;
  border-radius: var(--radius);
  padding: 22px 14px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 1100;
  display: none;
  max-width: min(390px, calc(100vw - 28px));
  border: 1px solid rgba(23, 32, 51, 0.2);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #172033;
  color: #ffffff;
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 760;
}

.toast.is-visible {
  display: block;
}

.admin-body {
  background: var(--surface);
}

.admin-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.admin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-report-list {
  display: grid;
  gap: 12px;
}

.admin-report-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel);
}

.admin-report-main {
  display: grid;
  gap: 12px;
}

.admin-report-main h2 {
  margin-top: 4px;
  font-size: 1.05rem;
}

.admin-report-main p,
.admin-report-main a {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.admin-report-main a {
  color: #164f93;
}

.admin-meta {
  font-size: 0.8rem;
}

.admin-proof-image {
  width: min(240px, 100%);
  max-height: 180px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
}

.admin-review-actions {
  align-items: center;
}

.admin-report-card label {
  display: grid;
  gap: 6px;
}

.admin-report-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  resize: vertical;
}

.admin-convert-slot:empty {
  display: none;
}

.admin-convert-form {
  margin-top: 4px;
}

.admin-form-grid {
  display: grid;
  gap: 10px;
}

.admin-toggle {
  justify-content: flex-start;
}

@media (min-width: 860px) {
  .app-shell {
    width: min(1480px, 100%);
    margin: 0 auto;
    padding: 18px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 12px 0 18px;
    border-bottom: 0;
    background: transparent;
  }

  .top-actions {
    width: auto;
    grid-template-columns: repeat(3, auto);
  }

  .icon-text-button {
    min-width: 124px;
    padding: 0 13px;
  }

  .workspace {
    grid-template-columns: minmax(330px, 405px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }

  .workspace.is-list-only {
    grid-template-columns: minmax(420px, 720px);
    justify-content: center;
  }

  .map-panel {
    position: sticky;
    top: 18px;
    order: 2;
    min-height: calc(100vh - 116px);
    overflow: hidden;
    border: 1px solid rgba(216, 222, 232, 0.88);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  #venueMap {
    height: calc(100vh - 116px);
    min-height: 620px;
  }

  .control-panel {
    order: 1;
    margin-top: 0;
    max-height: calc(100vh - 116px);
    overflow: auto;
    border-radius: var(--radius);
  }

  .venue-list {
    max-height: min(36vh, 390px);
  }

  .workspace.is-list-only .control-panel {
    max-height: none;
  }

  .workspace.is-list-only .venue-list {
    max-height: none;
  }

  .detail-panel {
    top: 88px;
    right: 24px;
    bottom: auto;
    left: auto;
    width: min(414px, calc(100vw - 48px));
    max-height: calc(100vh - 112px);
  }

  .admin-report-main {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .admin-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 800;
    padding: 10px 12px;
  }

  .topbar {
    overflow: hidden;
  }

  .top-actions {
    display: none;
  }

  .icon-text-button {
    gap: 5px;
    padding: 0 6px;
    font-size: 0.82rem;
  }

  .segmented-control {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .view-mode-control {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-status {
    white-space: normal;
  }

  .utility-row {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-control {
    justify-content: space-between;
  }

  .sort-control select {
    min-width: 0;
    width: 132px;
  }

  .control-panel {
    margin-top: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .search-row {
    position: sticky;
    top: 69px;
    z-index: 20;
    border-bottom: 1px solid rgba(216, 222, 232, 0.84);
    padding-bottom: 10px;
    background: rgba(255, 255, 255, 0.98);
  }

  .mobile-filter-toggle-row {
    display: block;
    padding: 8px 14px 10px;
  }

  .mobile-filters-button {
    width: 100%;
    min-height: 44px;
  }

  .mobile-filter-body {
    display: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
  }

  .control-panel.filters-open .mobile-filter-body {
    display: block;
  }

  .map-panel {
    position: relative;
    top: auto;
    min-height: 0;
  }

  #venueMap {
    height: calc(100vh - 158px);
    min-height: 420px;
  }

  .workspace:not(.is-list-only) .venue-list-panel {
    display: none;
  }

  .venue-list {
    max-height: none;
    overflow: visible;
    padding-bottom: 96px;
  }

  .venue-card {
    padding: 11px;
  }

  .rating-controls.is-compact {
    justify-content: flex-start;
  }

  .detail-panel {
    inset: 0;
    width: auto;
    max-height: none;
    border-radius: 0;
    padding: 18px 14px calc(92px + env(safe-area-inset-bottom));
  }

  .detail-actions {
    position: sticky;
    bottom: calc(-18px - env(safe-area-inset-bottom));
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0 -14px;
    border-top: 1px solid var(--line);
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
  }

  .detail-actions .directions-button {
    grid-column: 1 / -1;
  }

  .directions-button,
  .secondary-button,
  .segment,
  .filter-chip,
  .radius-chip,
  .rating-button {
    min-height: 44px;
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1200;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    border-top: 1px solid rgba(216, 222, 232, 0.96);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -10px 24px rgba(23, 32, 51, 0.12);
  }

  .mobile-nav-button {
    display: grid;
    min-width: 0;
    min-height: 52px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #526071;
    font-size: 0.7rem;
    font-weight: 850;
  }

  .mobile-nav-button span {
    font-size: 1.12rem;
    line-height: 1;
  }

  .mobile-nav-button.is-active {
    background: #eaf4ff;
    color: #164f93;
  }

  .reminder-grid {
    grid-template-columns: 1fr;
  }

  .reminder-grid input,
  .reminder-grid select {
    width: 132px;
  }
}

.workspace.is-list-only .map-panel {
  display: none;
}

.workspace.is-list-only .control-panel {
  margin-top: 0;
  border-radius: var(--radius);
}
