.thumb-layout {
  --app-width: 960px;
  --edge: 24px;
  --surface: #05070b;
  --safe-top: calc(16px + env(safe-area-inset-top, 0px));
  --safe-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  --card-gap: 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--surface);
}

.thumb-layout :is(.app-header, main, .thumb-controls) {
  width: 100%;
  max-width: var(--app-width);
  margin: 0 auto;
  padding-inline: max(var(--edge), env(safe-area-inset-left, 0px)) max(var(--edge), env(safe-area-inset-right, 0px));
}

.thumb-layout .app-header {
  height: auto;
  gap: 10px;
  padding-top: var(--safe-top);
  padding-bottom: 12px;
}

.app-header .brand-lockup {
  display: grid;
  gap: 3px;
}

.app-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 27px;
  color: #a6d8ff;
  font-style: italic;
  letter-spacing: 0;
}

.app-header .brand img {
  flex: none;
  border-radius: 6px;
  margin-inline-end: 3px;
}

.app-header .brand span {
  margin-left: 0;
  font-size: inherit;
  color: #cec0ff;
  letter-spacing: 0;
}

.app-header .brand-tagline {
  color: #adb2bb;
  font-size: 12px;
  white-space: normal;
}

.TopHeaderAdSlot {
  width: min(180px, 42%);
  margin-left: auto;
}

.ad-slot :is(a, div) {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid #302f37;
  border-radius: 8px;
  background: #111216;
}

.ad-slot img {
  display: block;
  width: 100%;
  height: 42px;
  object-fit: contain;
}

.AdSlot img {
  height: 76px;
}

.ad-marker {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 4px;
  border-radius: 3px;
  background: #08090b;
  color: #f0f1f5;
  font-size: 9px;
}

.footer-community .friends-chat {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  gap: 8px;
  color: #d0c7ff;
}

.friends-chat img {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.ad-settings + .ad-settings {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.ad-settings h3,
.ad-settings .source-meta {
  margin: 0;
}

.thumb-layout main {
  container-type: size;
  overflow: auto;
  overscroll-behavior: contain;
  padding-block: 5px 16px;
}

.thumb-layout main:focus-visible {
  outline-offset: -3px;
}

.thumb-layout #content {
  min-height: 100cqh;
}

.thumb-layout .page-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.thumb-layout .list {
  gap: var(--card-gap);
}

.thumb-layout .place {
  --card-height: clamp(54px, calc((100cqh - 12px) / 5.7 - var(--card-gap)), 112px);
  min-height: 72px;
  min-height: var(--card-height);
  background: #0b0d10;
  border-color: #24272d;
  padding-block: 8px;
}

.thumb-layout .place:focus-within,
.thumb-layout .place:hover {
  border-color: #5c6270;
}

.thumb-layout .place h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}

.thumb-layout .place .open::after {
  position: absolute;
  inset: 0;
  content: "";
}

.thumb-layout .map-button {
  z-index: 1;
  min-height: 42px;
  background: #101216;
}

.thumb-layout .results-head {
  gap: 8px;
}

.thumb-layout .footer-admin {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 8px;
}

.visitor-badge {
  padding: 3px 7px;
  border: 1px solid #343c49;
  border-radius: 99px;
  color: #b5bdca;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.visitor-toggle { display: flex; align-items: center; gap: 9px; min-height: 40px; cursor: pointer; }
.visitor-toggle input { width: auto; min-height: 0; accent-color: #bcabea; }

.thumb-layout .footer-admin #adminButton {
  min-height: 40px;
  font-size: 11px;
  color: #f0f1f4;
  opacity: .35;
}

.thumb-layout .footer-admin #adminButton:is(:hover, :focus-visible, :active) {
  opacity: 1;
}

.thumb-dock {
  position: relative;
  z-index: 4;
  border-top: 1px solid #26282f;
  background: var(--surface);
  padding-block: 10px var(--safe-bottom);
}

.thumb-controls {
  display: grid;
  gap: 9px;
}

.thumb-shortcuts,
#discoveryTools,
.scroll-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.thumb-shortcuts {
  container-type: inline-size;
  justify-content: space-between;
}

#discoveryTools {
  min-width: 0;
}

.scroll-controls {
  flex: none;
}

.thumb-shortcuts button {
  background: #101216;
  border: 1px solid #34363f;
  border-radius: 999px;
  color: #e8e9ed;
}

#discoveryTools > button {
  min-width: 0;
  min-height: 42px;
  padding: 5px 12px;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
}

#discoveryTools > button > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

#showTrending > .trending-compact {
  display: none;
}

@container (max-width: 365px) {
  #showTrending > .trending-full {
    display: none;
  }
  #showTrending > .trending-compact {
    display: block;
  }
}

.scroll-controls button {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 20px;
}

.thumb-controls button:hover {
  border-color: #907fff;
}

.thumb-layout :is(.thumb-dock, .app-header) .cms-inline-edit {
  display: none;
}

#filterHost .compact-filters {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, .85fr) minmax(0, 1.05fr) minmax(0, 1.3fr);
  width: min(100%, 440px);
  gap: 10px;
}

#filterHost .compact-filters > * {
  min-height: 42px;
}

#filterHost .select-pill {
  min-width: 0;
  max-width: none;
}

#filterHost .select-pill select {
  height: 40px;
  padding-inline: 9px 19px;
  text-overflow: ellipsis;
}

#filterHost .select-pill::after {
  top: calc(50% - 5px);
  right: 8px;
}

.thumb-dock #tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid #26282f;
  border-bottom: 0;
}

.thumb-dock #tabs button {
  min-width: 0;
  min-height: 45px;
  font-size: 14px;
  padding: 7px 2px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.thumb-layout dialog {
  --dialog-space-top: calc(12px + env(safe-area-inset-top, 0px));
  --dialog-space-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  position: fixed;
  inset: var(--dialog-space-top) env(safe-area-inset-right, 0px) var(--dialog-space-bottom) env(safe-area-inset-left, 0px);
  max-width: calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  max-height: calc(100dvh - var(--dialog-space-top) - var(--dialog-space-bottom));
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-top: 65px;
}

.modal-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid #333641;
  background: #12151c;
}

.modal-bar button,
.modal-bar #closeModal {
  float: none;
  min-height: 42px;
  padding: 6px 10px;
  font-size: 13px;
}

.modal-bar > :last-child {
  margin-left: auto;
}

.thumb-layout #modalContent,
.thumb-layout .cms-form {
  padding: 14px 20px 24px;
  overflow-wrap: anywhere;
}

.thumb-layout :is(#modalContent, .cms-form) h2:first-child {
  margin-top: 0;
}

.thumb-layout #toast {
  bottom: calc(174px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 650px) {
  .thumb-layout {
    --edge: 12px;
    --card-gap: 7px;
  }
  .app-header .brand {
    font-size: 24px;
  }
  #discoveryTools > button,
  .thumb-dock #tabs button {
    font-size: 12px;
  }
  .thumb-layout .place {
    --badge-width: 76px;
    padding-inline: 12px 9px;
  }
  .thumb-shortcuts,
  #discoveryTools,
  .scroll-controls {
    gap: 6px;
  }
  #discoveryTools > button {
    padding-inline: 8px;
  }
  .scroll-controls button {
    width: 38px;
  }
  #filterHost .compact-filters {
    gap: 8px;
  }
}

@media (max-width: 360px) {
  .thumb-layout {
    --edge: 9px;
  }
  #discoveryTools > button {
    font-size: 11px;
  }
  #filterHost .pill {
    padding-inline: 7px;
  }
  #filterHost .select-pill select {
    padding-inline: 6px 15px;
  }
  #filterHost .select-pill::after {
    right: 6px;
  }
}

@media (max-width: 650px) and (max-height: 700px) {
  .thumb-layout .place {
    height: var(--card-height);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    padding-block: 5px;
  }
  .thumb-layout .place h3 {
    -webkit-line-clamp: 1;
  }
  .thumb-layout .bottle {
    height: 23px;
  }
}

@container (max-width: 285px) {
  #discoveryTools > button {
    padding-inline: 6px;
  }
}
