/* Shared page styles. Keep rule order: later rules refine the original layout. */

* {
  box-sizing: border-box;
}
html {
  background: #dbe3d5;
}
body {
  --bg: #f5f7f0;
  --panel: #ffffff;
  --ink: #172c20;
  --muted: #7b897a;
  --line: #e2e8dc;
  --soft: #edf2e7;
  --accent: #b5f344;
  --strong: #183424;
  --onaccent: #15250f;
  margin: 0;
  font:
    14px/1.5 "Segoe UI",
    Arial,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  height: 100dvh;
  overflow: hidden;
}
body.dark {
  --bg: #101912;
  --panel: #18251b;
  --ink: #eff6e9;
  --muted: #91a28c;
  --line: #2c3d2d;
  --soft: #223326;
  --accent: #b5f344;
  --strong: #b5f344;
  --onaccent: #15250f;
  color-scheme: dark;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: transparent;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #76be22;
  outline-offset: 3px;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #9cdb3a;
  outline-offset: 1px;
}
header {
  height: 76px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: relative;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--ink);
  text-decoration: none;
}
.brandaccent {
  font-weight: 400;
}
.logo {
  display: grid;
  place-items: center;
  height: 36px;
  width: 36px;
  border-radius: 12px;
  background: var(--accent);
  color: #172c20;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -3px;
  padding-right: 3px;
}
/* Группировка кнопок в шапке */
.headeractions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ha-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ha-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
}
.primary,
.quiet,
.iconbutton {
  border-radius: 11px;
  padding: 11px 17px;
}
.primary {
  background: var(--accent);
  color: var(--onaccent);
  font-weight: 650;
}
.primary:disabled {
  opacity: 0.45;
  cursor: wait;
}
.quiet {
  background: var(--soft);
  font-size: 12px;
}
.iconbutton {
  background: var(--soft);
  width: 41px;
  height: 41px;
  padding: 0;
  font-size: 21px;
}
.dropdown {
  position: absolute;
  right: 25px;
  top: 66px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 17px;
  width: 255px;
  padding: 8px;
  box-shadow: 0 16px 50px #0003;
}
.dropdown button {
  width: 100%;
  text-align: left;
  padding: 13px 12px;
  border-radius: 10px;
  font-size: 19px;
}
.dropdown button:hover {
  background: var(--soft);
}
.dropdown span {
  font-size: 15px;
  font-weight: 650;
  margin-left: 12px;
}
.dropdown small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-left: 31px;
}
main {
  height: calc(100dvh - 76px);
  display: flex;
  position: relative;
}
aside {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  transition: margin-left 0.3s ease;
  display: flex;
}
.sidebarContent {
  width: 350px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: opacity 0.2s;
}
aside.collapsed {
  margin-left: -350px;
}
aside.collapsed .sidebarContent {
  opacity: 0;
  pointer-events: none;
}
.collapseBtn {
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 54px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: none;
  border-radius: 0 8px 8px 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  z-index: 20;
  color: var(--muted);
  cursor: pointer;
}
aside.collapsed .collapseBtn {
  right: -36px;
  width: 36px;
  border-left: 1px solid var(--line);
  border-radius: 8px;
}
.sidehead {
  padding: 24px 20px 0;
}
.titleline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
h1 {
  font-size: 24px;
  letter-spacing: -0.7px;
  margin: 0;
}
.city {
  font-size: 10px;
  color: var(--muted);
}
.searchwrap {
  border-radius: 11px;
  background: var(--soft);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 7px;
}
.searchwrap span {
  font-size: 22px;
  color: var(--muted);
}
.searchwrap input {
  width: 100%;
  padding: 12px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 12px;
}
.filters {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}
.filters select {
  min-width: 0;
  width: 44%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  padding: 7px 5px;
  font-size: 10px;
}
.filters button {
  font-size: 19px;
  color: var(--muted);
}
/* Вкладки */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--soft);
  border-radius: 12px;
  padding: 4px;
  margin-top: 14px;
}
.tabs button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  transition: all 0.2s;
  text-align: center;
  border: none;
  background: transparent;
  cursor: pointer;
}
.tabs button:hover {
  color: var(--ink);
}
.tabs button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 4px #0001;
  font-weight: 800;
}
body.dark .tabs button.active {
  background: #303030;
  color: #fff;
}
.collectionlist {
  flex: 1;
  overflow: auto;
  padding: 9px 10px;
}
.collectionrow {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}
.collection {
  display: flex;
  width: 100%;
  text-align: left;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
}
.collection:hover,
.collection.on {
  background: var(--soft);
}
.tile {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--ink);
  flex-shrink: 0;
  font-size: 18px;
  overflow: hidden;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.on .tile {
  background: var(--accent);
  color: var(--onaccent);
}
.coltext {
  flex: 1;
  min-width: 0;
}
.coltext strong {
  display: block;
  font-size: 12px;
  font-weight: 650;
}
.coltext small {
  font-size: 10px;
  color: var(--muted);
}
.switch {
  width: 25px;
  height: 15px;
  border-radius: 20px;
  background: var(--line);
  position: relative;
  flex-shrink: 0;
}
.switch:after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--panel);
}
.on .switch {
  background: var(--accent);
}
.on .switch:after {
  left: 13px;
  background: #183424;
}
.rowactions {
  padding: 0 10px 6px 50px;
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  align-items: center;
}
.rowactions button {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s;
}
.rowactions button:hover {
  background: var(--soft);
  color: var(--ink);
}
.rowactions button svg {
  width: 14px;
  height: 14px;
}
.rowactions .trash-btn {
  margin-left: auto;
  color: #e95e63;
}
.sidefooter {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}
.sidefooter button {
  margin-left: auto;
  font-size: 10px;
}
.liveDot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.maparea {
  flex: 1;
  position: relative;
  min-width: 0;
  background: var(--soft);
}
#canvas {
  position: absolute;
  inset: 0;
}
.maptop {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.maptop > * {
  pointer-events: auto;
}
.location {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 11px;
}
.mode {
  display: flex;
  align-items: center;
  background: var(--panel);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  gap: 2px;
}
.mode button {
  border-radius: 8px;
  font-size: 11px;
  padding: 7px 12px;
  font-weight: 700;
}
.mode button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--onaccent);
}
.mode #zoomIn,
.mode #zoomOut {
  padding: 0 12px;
  font-size: 16px;
  min-height: 28px;
  min-width: 32px;
  display: grid;
  place-items: center;
}
.mode .divider {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 6px;
}
.pin {
  padding: 0;
  width: 32px;
  height: 39px;
  border-radius: 16px 16px 16px 4px;
  background: var(--accent);
  color: #102110;
  border: 3px solid #173624;
  box-shadow: 0 3px 12px #0003;
  font-size: 16px;
  display: grid;
  place-items: center;
}
.pin.picking {
  background: #fff;
  border-color: #80d329;
  width: 38px;
  height: 44px;
}
.detail {
  position: absolute;
  top: 78px;
  right: 20px;
  width: 325px;
  max-height: calc(100% - 110px);
  overflow: auto;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 14px 45px #0003;
  border: 1px solid var(--line);
}
.detail img {
  width: 100%;
  height: 165px;
  object-fit: cover;
}
.detail .body {
  padding: 20px;
}
.detail h2 {
  font-size: 23px;
  margin: 0 30px 9px 0;
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.detail p {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
}
.detail h3 {
  font-size: 14px;
  margin: 23px 0 10px;
}
.close {
  position: absolute;
  right: 10px;
  top: 10px;
  background: var(--soft);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 19px;
  z-index: 2;
}
.tag,
.fact {
  display: inline-block;
  padding: 4px 8px;
  background: var(--soft);
  font-size: 10px;
  border-radius: 7px;
  margin: 3px 4px 0 0;
}
.detail .primary {
  width: 100%;
  margin-top: 15px;
  font-size: 12px;
}
.detail .editrow {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.editrow button {
  flex: 1;
  font-size: 10px;
  padding: 8px;
  background: var(--soft);
  border-radius: 7px;
  min-width: 100px;
}
.voting {
  display: flex;
  gap: 6px;
}
.voting button {
  font-size: 10px;
  padding: 8px 10px;
  background: var(--soft);
  border-radius: 7px;
}
.detail textarea {
  width: 100%;
  min-height: 65px;
}
.detail .quiet {
  padding: 8px 12px;
}
.muted {
  color: var(--muted);
  font-size: 11px;
}
.emptylist {
  padding: 20px 12px;
  color: var(--muted);
  font-size: 12px;
}
.modalback {
  position: fixed;
  inset: 0;
  background: #06130b80;
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
}
dialog {
  display: block;
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  width: 440px;
  max-width: 100%;
  max-height: 88dvh;
  overflow: auto;
  color: var(--ink);
  background: var(--panel);
}
dialog h2 {
  font-size: 25px;
  margin: 0 25px 8px 0;
  letter-spacing: -0.7px;
}
dialog p {
  font-size: 12px;
  color: var(--muted);
}
label {
  display: block;
  font-size: 12px;
  margin: 14px 0 5px;
}
label > input,
label > textarea,
label > select {
  display: block;
  margin-top: 7px;
}
input,
textarea,
select {
  color: var(--ink);
}
dialog input,
dialog textarea,
dialog select,
.detail textarea {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 9px;
  padding: 11px;
  width: 100%;
  font-size: 12px;
}
textarea {
  resize: vertical;
}
dialog textarea {
  min-height: 75px;
}
dialog .primary {
  width: 100%;
  margin-top: 20px;
}
dialog .textbutton {
  color: var(--muted);
  font-size: 12px;
  padding: 13px;
  width: 100%;
}
.required {
  color: #e95e63;
}
.locationfield {
  background: var(--soft);
  border-radius: 12px;
  padding: 12px;
  margin-top: 16px;
  font-size: 11px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.locationfield button {
  margin-left: auto;
  text-decoration: underline;
  font-size: 10px;
  flex-shrink: 0;
}
.formerror {
  color: #e95e63 !important;
}
.picker {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  max-width: calc(100% - 90px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 17px;
  box-shadow: 0 8px 40px #0002;
}
.picker strong {
  font-size: 14px;
}
.picker p {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 13px;
}
.picker > div {
  display: flex;
  gap: 7px;
}
.picker .primary {
  flex: 1;
  font-size: 11px;
  padding: 10px;
}
.picker .quiet {
  padding: 10px;
}
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  max-width: 90%;
  width: max-content;
  padding: 13px 20px;
  background: var(--accent);
  color: var(--onaccent);
  font-size: 12px;
  border-radius: 13px;
  box-shadow: 0 5px 25px #0003;
}
.maperror {
  position: absolute;
  left: 20px;
  top: 80px;
  background: var(--panel);
  padding: 12px;
  border-radius: 10px;
  max-width: 290px;
  font-size: 12px;
  box-shadow: 0 3px 20px #0002;
}
.hidden {
  display: none !important;
}
.handle {
  display: none;
}
.maplibregl-ctrl-attrib {
  display: none !important;
}
.authTabs {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}
.authTabs button {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
}
.authTabs .chosen {
  border-color: var(--accent);
  color: var(--ink);
}
.noresults {
  position: absolute;
  top: 78px;
  left: 20px;
  background: var(--panel);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 11px;
}
@media (max-width: 760px) {
  header {
    height: 64px;
    padding: 0 14px;
  }
  .brand {
    font-size: 20px;
    gap: 7px;
  }
  .logo {
    width: 29px;
    height: 29px;
    font-size: 21px;
    border-radius: 9px;
  }
  .headeractions {
    display: block;
  }
  .ha-group {
    display: contents;
  }
  .ha-divider {
    display: none;
  }
  .headeractions .primary {
    font-size: 11px;
    padding: 9px 11px;
  }
  .headeractions .quiet {
    padding: 8px;
    max-width: 75px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
  }
  .iconbutton {
    width: 31px;
    height: 33px;
    font-size: 19px;
  }
  main {
    height: calc(100dvh - 64px);
  }
  aside {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    min-width: 100%;
    height: 42%;
    border-radius: 22px 22px 0 0;
    border-top: 1px solid var(--line);
    border-right: 0;
    transition: height 0.25s;
    z-index: 10;
    margin-left: 0 !important;
  }
  aside.collapsed {
    margin-left: 0 !important;
  }
  .sidebarContent {
    width: 100%;
    border-right: none;
    border-radius: 22px 22px 0 0;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .collapseBtn {
    display: none;
  }
  .handle {
    display: block;
    flex-shrink: 0;
    width: 42px;
    height: 5px;
    background: var(--line);
    padding: 0;
    border-radius: 4px;
    margin: 10px auto 6px;
  }
  .sidehead {
    padding: 0 16px;
  }
  .titleline {
    margin-bottom: 8px;
  }
  h1 {
    font-size: 20px;
  }
  .searchwrap input {
    padding: 8px 0;
  }
  .searchwrap span {
    font-size: 18px;
  }
  .filters {
    margin-top: 7px;
  }
  .filters select {
    padding: 5px;
    font-size: 9px;
  }
  .tabs {
    margin-top: 3px;
    gap: 25px;
  }
  .tabs button {
    padding: 8px 0 7px;
    font-size: 11px;
  }
  .collectionlist {
    padding: 4px 8px;
  }
  .collection {
    padding: 6px 8px;
    gap: 9px;
  }
  .tile {
    height: 25px;
    width: 25px;
    border-radius: 7px;
    font-size: 15px;
  }
  .coltext strong {
    font-size: 11px;
  }
  .coltext small {
    font-size: 9px;
  }
  .collectionrow {
    padding: 2px 0;
  }
  .rowactions {
    font-size: 9px;
    padding: 0 8px 4px 42px;
  }
  .sidefooter {
    padding: 9px 16px;
    font-size: 9px;
  }
  .maparea {
    width: 100%;
    height: 58%;
    flex: none;
  }
  .maptop {
    top: 12px;
    left: 13px;
    right: 13px;
  }
  .location {
    font-size: 10px;
    padding: 7px 10px;
  }
  .mode {
    padding: 3px;
  }
  .mode button {
    padding: 6px 10px;
    font-size: 10px;
  }
  .detail {
    position: fixed;
    top: 72px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100dvh - 90px);
    z-index: 30;
  }
  .detail img {
    height: 170px;
  }
  .detail .body {
    padding: 20px;
  }
  .dropdown {
    top: 56px;
    right: 12px;
    width: 235px;
  }
  .picker {
    bottom: 32px;
    max-width: calc(100% - 70px);
    padding: 12px;
    width: 320px;
  }
  .picker strong {
    font-size: 12px;
  }
  .picker p {
    font-size: 10px;
  }
  .picker .primary {
    font-size: 10px;
  }
  .picker .quiet {
    font-size: 10px;
  }
  .modalback {
    padding: 12px;
  }
  dialog {
    max-height: 91dvh;
    padding: 24px;
  }
  .toast {
    bottom: 44%;
    font-size: 11px;
  }
  .maperror {
    top: 65px;
    left: 13px;
    font-size: 11px;
    max-width: 245px;
  }
  .noresults {
    top: 65px;
    left: 13px;
  }
  .maparea.selecting {
    height: 100%;
    z-index: 15;
  }
  body:has(.maparea.selecting) aside {
    display: none;
  }
}
/* Accent exploration, more direct creation controls and larger touch targets. */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--scroll-accent, #b5f344) 35%, #52614f) transparent;
}
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--scroll-accent, #b5f344) 35%, #52614f);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-accent, #b5f344);
}
body {
  --accent-soft: #b5f34424;
  --soft: #edf1e9;
}
body.dark {
  --bg: #101714;
  --panel: #19221d;
  --soft: #242f27;
  --line: #344038;
  --ink: #f0f4ee;
  --muted: #a0aea0;
}
button:focus-visible,
a:focus-visible {
  outline-color: var(--accent);
}
input:focus,
textarea:focus,
select:focus {
  outline-color: var(--accent);
}
.primary {
  min-height: 44px;
}
.secondary {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 16px;
  min-height: 44px;
  font-weight: 650;
  font-size: 12px;
}
.palette {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-right: 28px;
}
.palettelabel {
  font-size: 10px;
  color: var(--muted);
  margin-right: 7px;
}
.palette button {
  width: 32px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  position: relative;
}
.palette button:before {
  content: "";
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--swatch);
  border: 1px solid #172c2030;
}
.palette button[aria-pressed="true"] {
  background: var(--soft);
  outline: 1px solid var(--line);
}
.palette button[aria-pressed="true"]:after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #172c20;
  font-size: 12px;
  font-weight: 800;
}
.on .collection .tile {
  background: var(--accent);
}
.collection.on {
  background: var(--accent-soft);
}
.maptop {
  justify-content: flex-end;
}
.freshfilter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  margin: 13px 0 4px;
  min-height: 32px;
  cursor: pointer;
}
.freshfilter input {
  appearance: none;
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--muted);
  border-radius: 5px;
  margin: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: var(--panel);
}
.freshfilter input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.freshfilter input:checked:after {
  content: "✓";
  color: #15250f;
  font-size: 12px;
  font-weight: bold;
}
.freshfilter small {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  background: var(--soft);
  padding: 3px 7px;
  border-radius: 5px;
}
.freshbadge {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 5px 9px;
  margin-top: 15px;
  background: var(--soft);
  font-weight: 650;
}
.freshbadge.current {
  background: var(--accent-soft);
}
.freshbadge.current:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.freshbadge.expired {
  color: var(--muted);
}
.detail .freshdate {
  margin: 7px 0 12px;
  font-size: 10px;
}
.pin.stale {
  background: var(--panel);
  color: var(--muted);
  border-color: var(--muted);
}
.backcity {
  position: absolute;
  top: 20px;
  left: 20px;
  border-radius: 12px;
  padding: 11px 15px;
  min-height: 44px;
  background: var(--accent);
  color: var(--onaccent);
  font-size: 11px;
  font-weight: 650;
  box-shadow: 0 4px 20px #0002;
}
.backcity:hover {
  filter: brightness(1.08);
}
.addressResults {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}
.addressResults button {
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 13px;
  background: var(--soft);
  min-height: 65px;
}
.addressResults button:hover {
  border-color: var(--accent);
}
.addressResults b,
.addressResults span,
.addressResults small {
  display: block;
}
.addressResults b {
  font-size: 13px;
}
.addressResults span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.addressResults small {
  font-size: 10px;
  margin-top: 7px;
}
.addressswitch {
  display: block;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--soft);
  border-radius: 8px;
  font-size: 11px;
  min-height: 40px;
}
.uploadfield {
  margin-top: 15px;
}
.fieldtitle {
  display: block;
  font-size: 12px;
  margin-bottom: 7px;
}
.uploadbutton {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  background: var(--soft);
  border: 1px dashed var(--muted);
  border-radius: 11px;
  min-height: 48px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  margin: 0;
}
.uploadbutton:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.visuallyhidden {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none;
}
.uploadfield:focus-within .uploadbutton {
  outline: 2px solid var(--accent);
}
.photoPreview {
  margin-top: 10px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--soft);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  padding: 8px;
}
.photoPreview .photoThumb {
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  background: var(--soft);
}
.photoPreview .photoThumb img {
  width: 100%;
  height: 86px;
  object-fit: cover;
  display: block;
}
.photoPreview .photoThumb button {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 28px;
  height: 28px;
  font-size: 17px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 2px 10px #0003;
  line-height: 1;
  display: grid;
  place-items: center;
}
.picker .primary,
.picker .quiet {
  min-height: 44px;
}
.noresults {
  top: 76px;
}
.titleline .city {
  display: none;
}
@media (max-width: 760px) {
  header {
    height: 120px;
    padding: 0 14px;
    display: flex;
    align-items: flex-start;
  }
  .brand {
    margin-top: 18px;
    font-size: 22px;
  }
  .headeractions {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }
  .headeractions > * {
    pointer-events: auto;
  }
  .headeractions .iconbutton {
    position: absolute;
    right: 86px;
    top: 9px;
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
  .headeractions .userAvatar {
    position: absolute;
    right: 12px;
    top: 9px;
  }
  .headeractions #addPlace {
    position: absolute;
    right: 12px;
    bottom: 8px;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 12px;
  }
  .headeractions #addCollection {
    position: absolute;
    right: 100px;
    bottom: 8px;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 12px;
  }
  .palette {
    position: absolute;
    left: 9px;
    bottom: 8px;
    gap: 0;
    margin: 0;
  }
  .palette button {
    width: 31px;
    height: 44px;
  }
  .palette button:before {
    width: 19px;
    height: 19px;
  }
  .palettelabel {
    display: none;
  }
  main {
    height: calc(100dvh - 120px);
  }
  .handle {
    height: 22px;
    width: 60px;
    margin: 2px auto 1px;
    background: none;
    position: relative;
  }
  .handle:after {
    content: "";
    display: block;
    width: 42px;
    height: 5px;
    border-radius: 5px;
    background: var(--line);
    position: absolute;
    left: 9px;
    top: 9px;
  }
  .sidehead {
    padding: 0 15px;
  }
  .titleline {
    margin-bottom: 6px;
  }
  .searchwrap input {
    min-height: 44px;
    font-size: 12px;
  }
  .filters {
    gap: 7px;
    margin-top: 7px;
  }
  .filters select {
    min-height: 40px;
    font-size: 11px;
    width: 44%;
    padding: 8px 5px;
  }
  .filters button {
    width: 36px;
    min-height: 40px;
  }
  .freshfilter {
    min-height: 38px;
    margin: 3px 0 0;
    font-size: 11px;
  }
  .freshfilter input {
    width: 20px;
    height: 20px;
  }
  .tabs {
    margin-top: 0;
    gap: 24px;
  }
  .tabs button {
    min-height: 42px;
    padding: 10px 0;
    font-size: 12px;
  }
  .collection {
    min-height: 58px;
    padding: 7px 8px;
    gap: 10px;
  }
  .coltext strong {
    font-size: 12px;
  }
  .coltext small {
    font-size: 10px;
  }
  .tile {
    width: 25px;
    height: 25px;
  }
  .rowactions {
    gap: 15px;
    padding-bottom: 3px;
  }
  .rowactions button {
    min-height: 36px;
    font-size: 10px;
  }
  .sidefooter {
    min-height: 41px;
    padding: 5px 14px;
  }
  .sidefooter button {
    min-height: 32px;
  }
  .mode button {
    min-width: 44px;
    min-height: 40px;
    font-size: 12px;
    padding: 8px;
  }
  .mode {
    padding: 3px;
  }
  .backcity {
    left: 12px;
    top: 13px;
    font-size: 10px;
    max-width: 200px;
    min-height: 44px;
    padding: 9px 12px;
  }
  .detail .close,
  dialog .close {
    width: 40px;
    height: 40px;
    font-size: 23px;
  }
  .detail h2 {
    margin-right: 35px;
  }
  .detail .editrow button,
  .voting button {
    min-height: 44px;
    font-size: 11px;
  }
  .detail .quiet {
    min-height: 44px;
  }
  .detail .primary,
  dialog .primary,
  dialog .textbutton {
    min-height: 48px;
    font-size: 13px;
  }
  dialog input,
  dialog select {
    min-height: 46px;
    font-size: 14px;
  }
  .uploadbutton {
    min-height: 50px;
    font-size: 13px;
  }
  .locationfield button {
    min-height: 40px;
    font-size: 11px;
  }
  .pin {
    width: 36px;
    height: 42px;
    font-size: 18px;
  }
  .maparea {
    height: 54%;
  }
  aside {
    height: 46%;
  }
  aside.expanded {
    height: 86%;
  }
  .maparea.selecting {
    height: 100%;
  }
  .picker {
    max-width: calc(100% - 25px);
    bottom: 30px;
    width: 350px;
  }
  .picker .quiet,
  .picker .primary {
    min-height: 44px;
    font-size: 12px;
  }
  .addressswitch {
    font-size: 12px;
    min-height: 44px;
  }
  .picker #confirmPick:disabled {
    display: none;
  }
  .picker #cancelPick {
    flex: 1;
  }
  .toast {
    bottom: 48%;
  }
  .freshfilter small {
    font-size: 10px;
  }
  .sidehead h1 {
    font-size: 20px;
  }
  .maperror {
    top: 74px;
  }
  .noresults {
    top: 74px;
    max-width: 250px;
  }
  .photoPreview button {
    width: 44px;
    height: 44px;
  }
}
@media (max-width: 365px) {
  .headeractions #addCollection {
    right: 89px;
    padding: 10px 8px;
  }
  .headeractions #addPlace {
    padding: 10px 8px;
  }
  .palette button {
    width: 27px;
  }
  .brand {
    font-size: 20px;
  }
}

.userAvatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  border: 2px solid var(--line);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}
.userAvatar:hover {
  border-color: var(--accent);
}
.userAvatar.logged-in {
  background: var(--accent);
  color: var(--onaccent);
  border-color: var(--accent);
}
@media (max-width: 760px) {
  .headeractions .userAvatar {
    width: 44px;
    height: 44px;
    position: absolute;
    right: 12px;
    top: 9px;
  }
}
.header-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 4px;
}
@media (max-width: 760px) {
  .header-divider {
    display: none;
  }
}

.sidehead {
  position: relative;
}
.filterToggle {
  width: 36px;
  min-height: 40px;
  font-size: 23px;
  color: var(--muted);
  display: none;
  position: relative;
}
.filterToggle[aria-expanded="true"] {
  color: var(--ink);
  background: var(--accent-soft);
  border-radius: 8px;
}
@media (max-width: 760px) {
  .filterToggle {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    min-height: 44px;
  }
  .searchwrap {
    padding-right: 3px;
  }
  .filterPanel {
    display: none;
    position: absolute;
    top: 88px;
    left: 14px;
    right: 14px;
    padding: 13px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 13px;
    z-index: 20;
    box-shadow: 0 10px 35px #0003;
  }
  .filterPanel.open {
    display: block;
  }
  .filterPanel .filters {
    margin-top: 0;
  }
  .filterPanel .freshfilter {
    margin-top: 8px;
    min-height: 44px;
  }
  .tabs {
    gap: 25px;
  }
  .collectionlist {
    padding-top: 2px;
  }
  .collectionrow {
    padding: 0;
  }
  .rowactions {
    padding-top: 0;
    padding-bottom: 0;
  }
  .rowactions button {
    min-height: 30px;
  }
  .collection {
    min-height: 52px;
  }
  .sidefooter {
    min-height: 37px;
  }
}
.searchAddress {
  display: block;
  text-align: left;
  font-size: 11px;
  padding: 9px 7px;
  color: var(--ink);
  background: var(--accent-soft);
  border-radius: 8px;
  margin-top: 6px;
  min-height: 40px;
  width: 100%;
}
.filterToggle.hasFilters {
  background: var(--accent-soft);
  border-radius: 8px;
  color: var(--ink);
}
.filterToggle.hasFilters:after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  top: 5px;
  right: 6px;
  margin: 0;
}
@media (max-width: 760px) {
  .searchAddress {
    font-size: 11px;
    min-height: 44px;
  }
}
.tagPicker {
  position: relative;
  margin-top: 14px;
}
.tagPicker > input {
  margin-top: 7px;
}
.selectedTags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.selectedTag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 5px 3px 10px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.selectedTag button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  min-width: 27px;
  min-height: 28px;
  font-size: 19px;
  border-radius: 6px;
}
.selectedTag button:hover {
  background: var(--soft);
}
.tagCount {
  font-size: 10px;
  color: var(--muted);
  float: right;
}
.tagOptions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 5;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px;
  background: var(--panel);
  box-shadow: 0 8px 24px #0003;
  max-height: 230px;
  overflow: auto;
  margin-top: 4px;
}
.tagOptions button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  min-height: 50px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.tagOptions button small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}
.tagOptions button.highlighted,
.tagOptions button:hover {
  background: var(--accent-soft);
}
.tagOptions button b {
  font-weight: 650;
}
.tagEmpty {
  padding: 13px 10px;
  font-size: 11px;
  color: var(--muted);
}
#tagHint {
  display: block;
  margin-top: 6px;
  font-size: 10px;
}
@media (max-width: 760px) {
  .tagOptions button {
    min-height: 56px;
    font-size: 14px;
  }
  .selectedTag {
    font-size: 13px;
  }
  .selectedTag button {
    min-width: 36px;
    min-height: 36px;
  }
  .tagOptions {
    max-height: 220px;
  }
  .tagPicker > input {
    font-size: 14px;
  }
}
.pin.dragarmed {
  cursor: grab;
  outline: 5px solid var(--accent-soft);
  box-shadow:
    0 0 0 2px var(--accent),
    0 5px 20px #0004;
}
.pin.dragging {
  cursor: grabbing;
  outline-width: 8px;
}
.pin[title] {
  user-select: none;
  -webkit-user-select: none;
}
#dragPositionForm .textbutton {
  min-height: 44px;
}
.globalResults {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 124px;
  z-index: 25;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 12px 36px #0004;
  border-radius: 13px;
  padding: 5px;
  max-height: 420px;
  overflow: auto;
}
.globalResults button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px;
  border-radius: 9px;
  min-height: 65px;
}
.globalResults button b {
  display: block;
  font-size: 12px;
}
.globalResults button span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.globalResults button small {
  display: block;
  font-size: 10px;
  margin-top: 5px;
}
.globalResults button.highlighted,
.globalResults button:hover {
  background: var(--accent-soft);
}
.globalSearchMessage {
  padding: 15px 11px;
  color: var(--muted);
  font-size: 12px;
}
.globalSearchCredit {
  padding: 8px 10px;
  font-size: 9px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.globalPin {
  pointer-events: none;
}
.globalResults[aria-busy="true"] {
  opacity: 0.7;
}
@media (max-width: 760px) {
  .globalResults {
    left: 14px;
    right: 14px;
    top: 88px;
    max-height: 290px;
  }
  .globalResults button {
    min-height: 72px;
    padding: 12px;
  }
  .globalResults button b {
    font-size: 13px;
  }
  .globalResults button span {
    font-size: 11px;
  }
}
.openCastLink {
  height: 36px;
  width: 36px;
  display: grid;
  place-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 20px;
}
.viewSwitch {
  display: flex;
  gap: 4px;
  background: var(--soft);
  border-radius: 10px;
  padding: 4px;
  margin-top: 13px;
}
.viewSwitch button {
  flex: 1;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}
.viewSwitch button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 6px #0001;
}
.castIdentity {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 1px;
}
.tile.castTile,
.collection.on .tile.castTile {
  color: var(--cast);
  background: color-mix(in srgb, var(--cast) 15%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--cast) 55%, transparent);
}
.collection.on {
  border-left: 3px solid transparent;
}
.collection:has(.castTile) {
  border-left: 3px solid color-mix(in srgb, var(--cast) 50%, transparent);
}
.rowactions button:disabled {
  cursor: default;
  opacity: 0.6;
}
.pin:not(.stale) {
  background: var(--pin-cast, var(--accent));
}
.pin.stale {
  border-color: var(--pin-cast, var(--muted));
}
.castLabel {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 9px;
  color: var(--muted);
  margin: 3px 4px 0 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.castLabel i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.placeRowCasts {
  display: flex;
  flex-wrap: wrap;
}
.placesSummary {
  font-size: 10px;
  color: var(--muted);
  padding: 10px;
}
.placeRowWrapper {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}
.placeRowWrapper .placeRow {
  border-bottom: none;
  flex: 1;
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 10px;
  border-radius: 9px;
}
.placeRowWrapper .placeRow:hover {
  background: var(--soft);
}
.placeRowTitle {
  display: block;
  font-size: 13px;
  font-weight: 650;
}
.placeRowAddress {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0;
}
.togglePlaceBtn {
  width: 44px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--muted);
  flex-shrink: 0;
  border-left: 1px solid var(--line);
  transition: all 0.2s;
}
.togglePlaceBtn:hover {
  background: var(--soft);
  color: var(--ink);
}
.togglePlaceBtn.is-hidden {
  color: #e95e63;
  opacity: 0.8;
}
.filterToggle {
  display: block;
  width: 38px;
  flex-shrink: 0;
}
.filterPanel {
  display: none;
  position: absolute;
  top: 124px;
  left: 20px;
  right: 20px;
  padding: 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  z-index: 24;
  box-shadow: 0 10px 35px #0003;
}
.filterPanel.open {
  display: block;
}
.filterPanel .filters {
  margin-top: 0;
}
.filterPanel .freshfilter {
  margin-top: 8px;
}
.maplibregl-popup-content {
  background: var(--panel);
  color: var(--ink);
  padding: 15px 40px 15px 15px;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 6px 25px #0003;
}
.maplibregl-popup-close-button {
  width: 36px;
  height: 36px;
  color: var(--muted);
  font-size: 22px;
  border-radius: 10px;
  right: 2px;
  top: 2px;
}
.maplibregl-popup-close-button:hover {
  background: var(--soft);
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
  border-top-color: var(--panel);
}
.maplibregl-popup-anchor-top .maplibregl-popup-tip {
  border-bottom-color: var(--panel);
}
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: var(--panel);
}
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: var(--panel);
}
.mapClickAction .primary {
  min-height: 44px;
  font-size: 12px;
  padding: 10px 12px;
  white-space: nowrap;
}
.titleline h1 {
  font-size: 22px;
}
dialog input[type="color"] {
  padding: 6px;
  height: 46px;
  cursor: pointer;
}
#placesList {
  padding-top: 3px;
}
@media (max-width: 760px) {
  .viewSwitch {
    margin-top: 9px;
  }
  .viewSwitch button {
    min-height: 40px;
    font-size: 12px;
  }
  .filterPanel {
    top: 94px;
    left: 14px;
    right: 14px;
  }
  .openCastLink {
    width: 40px;
    height: 40px;
  }
  .titleline {
    margin-bottom: 4px;
  }
  .titleline h1 {
    font-size: 20px;
  }
  .filterToggle {
    width: 44px;
  }
  .placesSummary {
    padding: 8px 10px;
  }
  .placeRow {
    padding: 13px 10px;
    min-height: 88px;
  }
  .castIdentity {
    font-size: 9px;
  }
  .castLabel {
    font-size: 10px;
  }
  .maplibregl-popup-close-button {
    width: 38px;
    height: 38px;
  }
  .mapClickAction .primary {
    font-size: 12px;
    min-height: 46px;
  }
  .globalResults {
    top: 94px;
  }
}

.maplegend {
  position: absolute;
  bottom: 35px;
  left: 15px;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 7px 11px;
  border-radius: 10px;
  box-shadow: 0 2px 12px #0001;
  font-size: 10px;
  color: var(--muted);
  pointer-events: none;
}
.maplegend span {
  display: flex;
  gap: 5px;
  align-items: center;
}
.maplegend i {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 3px;
}
.legendpark {
  background: #b1cea3;
}
.legendwater {
  background: #a2d3ed;
}
.mapNaturalDark .legendpark {
  background: #477351;
}
.mapNaturalDark .legendwater {
  background: #397498;
}
.selecting .maplegend {
  display: none;
}
@media (max-width: 760px) {
  .maplegend {
    left: 12px;
    bottom: 34px;
    padding: 6px 8px;
    font-size: 9px;
    gap: 9px;
  }
} /* Desktop workspace: useful tools in the header and legible map details. */
@media (min-width: 761px) {
  header {
    height: 88px;
    gap: 22px;
    padding: 0 24px;
  }
  .brand {
    font-size: 25px;
    flex-shrink: 0;
  }
  .desktopSearchSlot {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: none;
  }
  .desktopSearchSlot .searchwrap {
    padding: 0 14px;
  }
  .desktopSearchSlot .searchwrap input {
    min-height: 48px;
    font-size: 15px;
  }
  .desktopSearchSlot .globalResults {
    top: 54px;
    left: 0;
    right: 0;
    max-height: 490px;
  }
  .desktopSearchSlot .globalResults button b {
    font-size: 14px;
  }
  .desktopSearchSlot .globalResults button span {
    font-size: 12px;
  }
  .desktopSearchSlot .globalResults button small {
    font-size: 11px;
  }
  .palette {
    margin: 0;
    gap: 1px;
  }
  .palette button {
    width: 30px;
    height: 42px;
  }
  .palettelabel {
    display: none;
  }
  .headeractions {
    gap: 7px;
    flex-shrink: 0;
  }
  .headeractions .primary,
  .headeractions .secondary {
    font-size: 13px;
  }
  .iconbutton {
    width: 42px;
    height: 44px;
  }
  main {
    height: calc(100dvh - 88px);
  }
  .sidebarContent {
    width: 380px;
  }
  .sidehead {
    padding: 22px 20px 0;
  }
  .titleline {
    gap: 8px;
    justify-content: flex-start;
    margin-bottom: 12px;
  }
  .titleline h1 {
    font-size: 24px;
    flex: 1;
  }
  .titleline .filterToggle {
    display: block;
    width: 40px;
    min-height: 40px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .openCastLink {
    width: 40px;
    height: 40px;
  }
  .filterPanel {
    top: 75px;
  }
  .viewSwitch {
    margin-top: 0;
  }
  .viewSwitch button {
    min-height: 41px;
    font-size: 14px;
  }
  .tabs button {
    min-height: 36px;
    font-size: 13px;
  }
  .collection {
    padding: 11px 10px;
    min-height: 75px;
  }
  .coltext strong {
    font-size: 14px;
  }
  .coltext small {
    font-size: 12px;
  }
  .castIdentity {
    font-size: 11px;
  }
  .tile {
    width: 31px;
    height: 31px;
    font-size: 19px;
  }
  .rowactions {
    gap: 15px;
    padding-left: 54px;
  }
  .rowactions button {
    font-size: 11px;
    min-height: 31px;
  }
  .placeRowTitle {
    font-size: 15px;
  }
  .placeRowAddress {
    font-size: 13px;
  }
  .castLabel {
    font-size: 11px;
    padding: 4px 7px;
  }
  .placesSummary {
    font-size: 12px;
  }
  .sidefooter {
    font-size: 12px;
    min-height: 48px;
  }
  .sidefooter button {
    font-size: 11px;
  }
  .detail {
    width: 360px;
  }
  .detail h2 {
    font-size: 25px;
  }
  .detail p {
    font-size: 14px;
    line-height: 1.6;
  }
  .detail .fact,
  .detail .tag {
    font-size: 12px;
  }
  .detail .voting button {
    font-size: 12px;
    min-height: 41px;
  }
  .detail .primary {
    font-size: 14px;
    min-height: 46px;
  }
  .detail h3 {
    font-size: 16px;
  }
  .detail textarea {
    font-size: 14px;
  }
  .detail .editrow button {
    font-size: 12px;
    min-height: 40px;
  }
  .detail .freshdate {
    font-size: 12px;
  }
  .freshbadge {
    font-size: 12px;
  }
  .muted {
    font-size: 12px;
  }
  .desktopMapActions {
    display: flex;
    align-items: center;
    gap: 14px;
    pointer-events: auto;
  }
  .desktopMapActions button {
    padding: 10px 14px;
    min-height: 43px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 13px;
  }
  .desktopMapActions span {
    font-size: 12px;
    padding: 6px 10px;
    color: var(--muted);
    background: var(--panel);
    border-radius: 8px;
  }
  .maptop {
    justify-content: space-between;
    gap: 15px;
  }
  .mode button {
    font-size: 13px;
    padding: 9px 14px;
  }
  .maplegend {
    font-size: 11px;
  }
  .backcity {
    top: 76px;
    font-size: 12px;
  }
  .noresults {
    top: 130px;
  }
  .maperror {
    top: 130px;
  }
  .globalResults button {
    min-height: 77px;
  }
  body.dark {
    --muted: #b4c0b8;
    --line: #43534a;
  }
  dialog {
    width: 490px;
  }
  dialog input,
  dialog textarea,
  dialog select {
    font-size: 14px;
    min-height: 44px;
  }
  label {
    font-size: 13px;
  }
  .freshfilter {
    font-size: 13px;
  }
  .filters select {
    font-size: 12px;
    min-height: 39px;
  }
}
.addressLoadStatus {
  font-size: 12px !important;
  min-height: 18px;
  color: var(--muted);
  margin: 7px 0 5px !important;
}
.castColorPicker {
  border: 0;
  padding: 0;
  margin: 20px 0 10px;
}
.castColorPicker legend {
  font-size: 13px;
  margin-bottom: 12px;
}
.castColorPicker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.castColorPicker label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 8px 4px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 11px;
  min-width: 46px;
}
.castColorPicker label input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  opacity: 0;
  padding: 0 !important;
  overflow: hidden;
}
.castColorPicker label > span {
  display: block;
  width: 29px;
  height: 29px;
  background: var(--swatch);
  border: 2px solid #14251c30;
  border-radius: 50%;
}
.castColorPicker label small {
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted);
}
.castColorPicker label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.castColorPicker label:has(input:checked) > span:after {
  content: "✓";
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 16px;
  color: #14251c;
  font-weight: 800;
}
.castColorPicker label:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.castColorPicker label:hover {
  background: var(--soft);
}
.castColorPicker.iconPicker label > span {
  background: none !important;
  border: none !important;
  font-size: 22px;
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
}
.castColorPicker.iconPicker label:has(input:checked) > span:after {
  content: "" !important;
  display: none !important;
}
.detail button:disabled {
  opacity: 0.55;
  cursor: default;
}
.pin.dragarmed:after {
  content: "Перетащите";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 3px 15px #0003;
}
.pin.dragging:after {
  content: "Отпустите, чтобы сохранить";
}
@media (min-width: 761px) and (max-width: 1320px) {
  header {
    height: 130px;
    flex-wrap: wrap;
    align-content: center;
    gap: 10px 17px;
  }
  .brand {
    order: 0;
  }
  .desktopSearchSlot {
    order: 1;
    max-width: none;
    flex: 1;
  }
  .headeractions {
    order: 2;
  }
  .palette {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 10px;
  }
  .palette button {
    height: 29px;
    width: 34px;
  }
  .palette button:before {
    width: 20px;
    height: 20px;
  }
  .palettelabel {
    display: inline;
    font-size: 11px;
  }
  main {
    height: calc(100dvh - 130px);
  }
  .desktopMapActions span {
    display: none;
  }
  .sidebarContent {
    width: 350px;
  }
  aside.collapsed {
    margin-left: -350px;
  }
  .coltext strong {
    font-size: 13px;
  }
  .headeractions .primary,
  .headeractions .secondary {
    padding: 10px 12px;
  }
  .brand {
    font-size: 22px;
  }
}

body.dark {
  --bg: #111111;
  --panel: #1a1a1a;
  --ink: #f4f4f4;
  --muted: #b7b7b7;
  --line: #414141;
  --soft: #282828;
  --strong: #ededed;
  color-scheme: dark;
}
body.dark .logo {
  color: #151515;
}
body.dark .searchwrap,
body.dark .viewSwitch {
  background: #262626;
}
body.dark .castLabel,
body.dark .tag {
  border-color: #424242;
}
body.dark .maplegend {
  background: #1a1a1a;
}
body.dark .legendpark {
  background: #353535;
}
body.dark .legendwater {
  background: #727272;
}
body.dark .selectedTag,
body.dark .castColorPicker label:has(input:checked) {
  border-color: #555555;
}
body.dark .pin {
  border-color: #151515;
}
body.dark dialog {
  box-shadow: 0 16px 65px #0009;
}
body.dark .mode button:not([aria-pressed="true"]) {
  color: #ededed;
}
body.dark .desktopMapActions span {
  color: #d0d0d0;
}
body.dark .switch {
  background: #454545;
}
body.dark .on .switch {
  background: var(--accent);
}
body.dark .on .switch:after {
  background: #171717;
}
.tagFilterBar {
  min-height: 54px;
  padding: 7px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 19;
  flex-wrap: wrap;
}
.tagFilterTitle {
  font-size: 13px;
  font-weight: 650;
}
.tagFilterSearch {
  position: relative;
  width: 230px;
  min-width: 160px;
}
.tagFilterSearch > input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--soft);
  color: var(--ink);
  padding: 9px 12px;
  font-size: 13px;
  min-height: 38px;
}
.tagFilterOptions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  z-index: 30;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 8px 30px #0004;
  max-height: 330px;
  overflow: auto;
}
.tagFilterOptions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  width: 100%;
  text-align: left;
  min-height: 42px;
  padding: 9px;
  border-radius: 8px;
  font-size: 13px;
}
.tagFilterOptions button small {
  color: var(--muted);
  font-size: 10px;
}
.tagFilterOptions button.highlighted,
.tagFilterOptions button:hover {
  background: var(--accent-soft);
}
.tagFilterChips {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.tagFilterChips button {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px;
  min-height: 35px;
}
.tagFilterChips button span {
  margin-left: 8px;
  font-size: 17px;
}
.tagFilterBar > small {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}
.tagFilterBar > button {
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  min-height: 38px;
}
.addressAutocompleteLabel {
  position: relative;
}
.addressAutocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  z-index: 8;
  background: var(--panel);
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 8px 24px #0004;
  max-height: 270px;
  overflow: auto;
}
.addressAutocomplete button {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 59px;
  padding: 10px;
  border-radius: 7px;
  font-size: 13px;
}
.addressAutocomplete button b {
  display: block;
  font-weight: 650;
}
.addressAutocomplete button span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.addressAutocomplete button.highlighted,
.addressAutocomplete button:hover {
  background: var(--accent-soft);
}
@media (min-width: 761px) {
  body.dark {
    --muted: #bebebe;
    --line: #414141;
  }
  main {
    height: calc(100dvh - 142px);
  }
}
@media (min-width: 761px) and (max-width: 1320px) {
  main {
    height: calc(100dvh - 184px);
  }
  .tagFilterBar > small {
    display: none;
  }
}
@media (max-width: 760px) {
  .tagFilterBar {
    padding: 7px 14px;
    gap: 7px;
  }
  .tagFilterBar > small {
    display: none;
  }
}

body.dark .collection.on,
body.dark .selectedTag,
body.dark .tagFilterChips button,
body.dark .globalResults button.highlighted,
body.dark .globalResults button:hover,
body.dark .tagFilterOptions button.highlighted,
body.dark .addressAutocomplete button.highlighted,
body.dark .tagOptions button.highlighted {
  background: #303030;
}
body.dark .freshbadge.current {
  background: #303030;
}
body.dark .castColorPicker label:has(input:checked) {
  background: #303030;
}
body.dark .filterToggle.hasFilters {
  background: #303030;
}
@media (min-width: 761px) {
  body {
    display: flex;
    flex-direction: column;
  }
  header,
  .tagFilterBar {
    flex-shrink: 0;
  }
  main {
    flex: 1;
    min-height: 0;
    height: auto !important;
  }
}
@media (min-width: 761px) {
  header {
    height: auto;
    min-height: 88px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .desktopSearchSlot {
    display: flex;
    flex-direction: column;
    min-width: 270px;
    max-width: none;
    gap: 0;
    margin: 0 20px;
  }
  .desktopSearchSlot .searchwrap {
    padding-right: 4px;
    gap: 5px;
  }
  .desktopSearchSlot .searchwrap input {
    min-width: 0;
    flex: 1;
  }
  .desktopSearchSlot .filterToggle {
    display: grid;
    place-items: center;
    min-height: 40px;
    width: 42px;
    flex-shrink: 0;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--panel);
    font-size: 22px;
  }
  .desktopSearchSlot .filterPanel {
    top: calc(100% + 6px);
    left: auto;
    right: 0;
    width: 330px;
    max-width: calc(100vw - 30px);
  }
  .desktopSearchSlot .globalResults {
    top: calc(100% + 6px);
  }
  .desktopSearchSlot .tagFilterBar {
    min-height: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    border: 0;
    padding: 7px 0 0;
    background: transparent;
    z-index: auto;
  }
  .desktopSearchSlot .tagFilterTitle,
  .desktopSearchSlot .tagFilterSearch,
  .desktopSearchSlot #tagFilterSummary {
    display: none;
  }
  .desktopSearchSlot .tagFilterChips {
    gap: 5px;
  }
  .desktopSearchSlot .tagFilterChips button {
    font-size: 11px;
    padding: 3px 8px;
    min-height: 28px;
  }
  .desktopSearchSlot #clearTagFilter {
    font-size: 10px;
    min-height: 28px;
    padding: 3px 5px;
  }
  .desktopSearchSlot .tagFilterChips button span {
    font-size: 15px;
    margin-left: 6px;
  }
  .sidehead .titleline .openCastLink {
    margin-left: auto;
  }
  .sidehead .titleline {
    margin-bottom: 12px;
  }
  .maparea .maplibregl-canvas {
    opacity: 1;
  }
}
@media (min-width: 761px) and (max-width: 1320px) {
  header {
    min-height: 130px;
    height: auto;
  }
  .desktopSearchSlot {
    max-width: none;
    min-width: 260px;
  }
  .palette {
    margin-top: 3px;
  }
}

/* Compact point markers and tag suggestions within the form flow. */
.pin:not(.picking):not(.globalPin) {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: var(--pin-cast, var(--accent));
  box-shadow: 0 1px 7px #0006;
  touch-action: none;
  cursor: pointer;
  font-size: 0;
  overflow: visible;
}
.pin.dragarmed,
.pin.dragging {
  cursor: grabbing !important;
  outline: 4px solid var(--accent-soft);
}
.pin.dragarmed:after,
.pin.dragging:after {
  display: none !important;
}
.tagPicker .tagOptions {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  width: 100%;
  box-sizing: border-box;
  max-height: 230px;
  margin-top: 6px;
}

/* Map controls: palette bottom-left, height toggle under palette, tools bottom-right */
.palette-corner {
  position: absolute;
  width: fit-content;
  max-width: calc(100% - 32px);
  left: 16px;
  bottom: 16px;
  z-index: 4;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px 8px;
  box-shadow: 0 4px 22px #0002;
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
}
.palette-corner button {
  width: 32px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  position: relative;
}
.palette-corner button:before {
  content: "";
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--swatch);
  border: 1px solid #172c2030;
}
.palette-corner button[aria-pressed="true"] {
  background: var(--soft);
  outline: 1px solid var(--line);
}
.palette-corner button[aria-pressed="true"]:after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #172c20;
  font-size: 12px;
  font-weight: 800;
}
body.dark .palette-corner button[aria-pressed="true"]:after {
  color: #171717;
}
body.dark .palette-corner {
  background: #1a1a1a;
}

/* Height toggle - under palette */
.mapAppearance {
  position: absolute;
  bottom: 72px;
  left: 16px;
  z-index: 4;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 12px;
  box-shadow: 0 4px 22px #0002;
  width: auto;
  min-width: 190px;
  box-sizing: border-box;
}
.mapAppearance .heightColorToggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin: 0;
  padding: 0;
  border-top: none;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.mapAppearance .heightRamp {
  height: 8px;
  flex: 1;
  min-width: 40px;
  border-radius: 5px;
  background: linear-gradient(90deg, #647c8e, var(--accent));
  transition: opacity 0.2s;
}
.mapAppearance .heightOff .heightRamp {
  opacity: 0.25;
  filter: grayscale(1);
}
.mapAppearance .heightColorToggle input {
  appearance: none !important;
  position: relative;
  width: 32px !important;
  height: 19px !important;
  min-height: 19px !important;
  flex-shrink: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 20px;
  cursor: pointer;
}
.mapAppearance .heightColorToggle input:after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  background: var(--muted);
  transition: left 0.15s;
}
.mapAppearance .heightColorToggle input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.mapAppearance .heightColorToggle input:checked:after {
  left: 15px;
  background: #202020;
}
body.dark .mapAppearance {
  background: #1a1a1a;
}

/* Zoom tools - bottom right next to attribution */
.maptools {
  position: absolute;
  bottom: 45px;
  right: 16px;
  left: auto;
  display: flex;
  flex-direction: row;
  gap: 7px;
  z-index: 4;
}
.maptools button {
  height: 38px;
  width: 38px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 20px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 22px #0002;
}
body.dark .maptools button {
  background: #1a1a1a;
}

@media (max-width: 760px) {
  .palette-corner {
    left: 12px;
    bottom: 12px;
    padding: 5px 6px;
    border-radius: 12px;
  }
  .palette-corner button {
    width: 28px;
    height: 36px;
    padding: 0;
  }
  .palette-corner button:before {
    width: 17px;
    height: 17px;
  }

  .mapAppearance {
    left: 12px;
    bottom: 62px;
    min-width: 160px;
    padding: 7px 10px;
  }
  .mapAppearance .heightColorToggle {
    font-size: 11px;
    gap: 8px;
  }
  .mapAppearance .heightColorToggle input {
    width: 28px !important;
    height: 17px !important;
    min-height: 17px !important;
  }
  .mapAppearance .heightColorToggle input:after {
    width: 11px;
    height: 11px;
  }
  .mapAppearance .heightColorToggle input:checked:after {
    left: 13px;
  }

  .maptools {
    right: 12px;
    bottom: 40px;
    gap: 5px;
  }
  .maptools button {
    height: 36px;
    width: 36px;
    border-radius: 9px;
    font-size: 18px;
  }
}

.selecting .maptools,
.selecting .palette-corner,
.selecting .mapAppearance {
  display: none !important;
}

.privacyPicker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border: 0;
  padding: 0;
  margin: 20px 0 10px;
}
.privacyPicker legend {
  font-size: 13px;
  margin-bottom: 12px;
  padding: 0;
}
.privacyPicker label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 10px 14px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  min-width: 88px;
  background: var(--panel);
}
.privacyPicker label input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  opacity: 0;
  padding: 0 !important;
  overflow: hidden;
}
.privacyPicker label > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--soft);
  font-size: 17px;
  line-height: 1;
}
.privacyPicker label small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}
.privacyPicker label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.privacyPicker label:has(input:checked) > span {
  background: var(--accent);
  color: var(--onaccent);
}
.privacyPicker label:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.privacyPicker label:hover {
  background: var(--soft);
}
body.dark .privacyPicker label:has(input:checked) {
  background: #303030;
}

/* === Правки === */
.filterToggle {
  position: relative;
  display: grid;
  place-items: center;
}
.filterToggle svg {
  display: block;
  pointer-events: none;
}
.filterToggle.hasFilters:after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  top: 5px;
  right: 6px;
  margin: 0;
  vertical-align: baseline;
}
.tile {
  overflow: hidden;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.addressField {
  margin-top: 14px;
}
.addressField > label {
  display: block;
  font-size: 12px;
  margin: 0 0 5px;
}
.addressLine {
  display: flex;
  gap: 7px;
  align-items: stretch;
  position: relative;
}
.addressLine > input {
  flex: 1;
  min-width: 0;
  margin-top: 0 !important;
}
.addressLine > button {
  flex-shrink: 0;
}
.smallbutton {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  min-height: 44px;
}
.smallbutton:hover {
  border-color: var(--accent);
}
.autogrow {
  resize: none;
  overflow: hidden;
  min-height: 75px;
}
.photoPreview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  padding: 8px;
}
.photoPreview .photoThumb {
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  background: var(--soft);
}
.photoPreview .photoThumb img {
  width: 100%;
  height: 86px;
  max-height: none;
  object-fit: cover;
  display: block;
}
.photoPreview .photoThumb button {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 28px;
  height: 28px;
  font-size: 17px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 2px 10px #0003;
  line-height: 1;
}
.detail .detailGallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
}
.detail .detailGallery.single {
  grid-template-columns: 1fr;
}
.detail .detailGallery img {
  width: 100%;
  height: 125px;
  object-fit: cover;
  display: block;
}
.detail .detailGallery.single img {
  height: 165px;
}
.picker > .pickAddressWrap {
  display: block;
  gap: 0;
  position: relative;
  margin: 10px 0 12px;
}
.picker .pickAddressWrap input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 9px;
  padding: 11px;
  font-size: 12px;
  min-height: 44px;
}
.picker .pickActions {
  display: flex;
  gap: 7px;
}
@media (max-width: 760px) {
  .detail .detailGallery img {
    height: 110px;
  }
  .smallbutton {
    min-height: 46px;
  }
  .addressLine {
    flex-wrap: wrap;
  }
  .addressLine > button {
    min-height: 42px;
    padding: 0 10px;
    font-size: 10px;
  }
}

.castSelectGroup {
  position: relative;
  margin-top: 14px;
}
.castSelectGroup > label {
  display: block;
  font-size: 12px;
  margin: 0 0 5px;
}
.castSelectCurrent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.castSelectCurrent:hover {
  border-color: var(--accent);
}
.castSelectCurrent span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.castSelectCurrent svg {
  transition: transform 0.2s;
}
.castSelectCurrent.open svg {
  transform: rotate(180deg);
}
.castSelectMenu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 8px 24px #0004;
  padding: 5px;
  margin-top: 4px;
  max-height: 250px;
  overflow-y: auto;
}
.castSelectMenu label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  margin: 0;
  border-bottom: none;
  transition: background 0.2s;
}
.castSelectMenu label:hover {
  background: var(--accent-soft);
}

/* Исправленные стили для квадратных чекбоксов */
.castSelectMenu input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  border: 2px solid var(--muted);
  border-radius: 5px;
  margin: 0;
  padding: 0 !important;
  display: grid;
  place-items: center;
  background: var(--panel);
  flex-shrink: 0;
  transition: all 0.2s;
  cursor: pointer;
  box-sizing: border-box;
}
.castSelectMenu input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}
.castSelectMenu input[type="checkbox"]:checked:after {
  content: "";
  width: 6px;
  height: 10px;
  border: solid #15250f;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  margin-bottom: 3px;
}
.castSelectMenu label:has(input:checked) {
  background: var(--accent-soft);
}
.castSelectMenu .newCastAction {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--accent);
  cursor: pointer;
  margin-top: 5px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
}
.castSelectMenu .newCastAction:hover {
  background: var(--accent-soft);
}

/* Стили для мини-панели создания подборки */
.newCastInline {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}
.newCastInline input {
  flex: 1 !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  min-height: 44px !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
}
.newCastInline button {
  flex-shrink: 0 !important;
  width: auto !important;
  margin: 0 !important;
  min-height: 44px !important;
  padding: 0 16px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
}

/* Collection selector in the place editor. */

#placeForm select[name="c"] {
  padding: 14px;
  border: 1px solid #9bb77b;
  border-radius: 12px;
  background: #f3f8eb;
  font-weight: 600;
}
#newCastInEditor {
  width: 100%;
  padding: 13px;
  border: 1px dashed #8fae6b;
  border-radius: 12px;
  margin: 0 0 16px;
  background: #f5f9ef;
  color: #46642b;
  cursor: pointer;
}
#castContents {
  max-height: 50vh;
  overflow: auto;
}
#castContents .placeRow {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px;
  margin: 6px 0;
  border-radius: 12px;
}
#castContents .placeRow:hover {
  background: #eef5e3;
}

/* Collection creation dialog. */

.collectionCreateDialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(460px, 90vw);
  max-height: 85vh;
  overflow: auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 100px #0008;
}
.collectionCreateDialog::backdrop {
  background: #0009;
  backdrop-filter: blur(5px);
}
.collectionCreateDialog h2 {
  margin: 12px 0;
}
.collectionDialogActions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 22px;
}
.castSelectMenu label {
  min-height: 48px;
}
.castSelectCurrent:focus-visible {
  outline: 2px solid var(--accent);
}
#castContents .placeRow {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}
#castContents .placeRow:hover {
  background: var(--accent-soft);
}

/* Mobile controls stay mounted while the desktop layout is active. */
#mobileSearchDock,
.mobileNav,
.mobileZoom,
.mobileSettingsButton,
.mobileSearchClose {
  display: none;
}
