:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #151b26;
  --muted: #7b8698;
  --line: #e7eaf0;
  --soft: #f6f7f9;
  --brand: #141b26;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.12);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.22);
  --factory: #2563eb;
  --factory-soft: #eef4ff;
  --commercial: #f97316;
  --commercial-soft: #fff4e8;
  --shop: #10b981;
  --shop-soft: #e9fbf3;
  --land: #8b5cf6;
  --land-soft: #f4efff;
  --radius: 14px;
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB",
    system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ---------------- layout ---------------- */

.app {
  display: grid;
  grid-template-columns: 344px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  transition: grid-template-columns 0.22s ease;
}

.app.sidebar-closed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 500;
  transition: transform 0.22s ease;
}

.app.sidebar-closed .sidebar {
  transform: translateX(-100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
}

.logo {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, #1f2a3a, #0b111b);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 14px rgba(11, 17, 27, 0.24);
}

.brand-text {
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand p {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.ro-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 5px;
  background: #fff4e8;
  color: #b54708;
  font-size: 10px;
  font-weight: 600;
  vertical-align: 2px;
}

.brand-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.brand-actions .btn-primary {
  margin-left: 0;
}

.sidebar-collapse {
  display: grid;
  place-items: center;
  width: 30px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #5b6575;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.sidebar-collapse:hover {
  background: var(--soft);
  color: var(--text);
}

.sidebar-open {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  color: #3b4453;
  font-size: 17px;
  cursor: pointer;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.sidebar-open:hover {
  background: #fff;
}

.leaflet-top.leaflet-left {
  top: 62px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  background: var(--soft);
}

.btn-primary {
  margin-left: auto;
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(20, 27, 38, 0.18);
}

.btn-primary:hover {
  background: #000;
  border-color: #000;
}

.btn-sm {
  height: 38px;
  padding: 0 11px;
  font-size: 12px;
}

/* ---------------- search & filters ---------------- */

.searchbox {
  position: relative;
  margin: 0 20px 12px;
}

.searchbox svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: #9aa4b5;
  transform: translateY(-50%);
  pointer-events: none;
}

.searchbox input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.searchbox input::placeholder {
  color: #a6adba;
}

.searchbox input:focus {
  background: #fff;
  border-color: #c5ccd8;
  box-shadow: 0 0 0 3px rgba(20, 27, 38, 0.05);
}

.searchbox input::-webkit-search-cancel-button {
  cursor: pointer;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #5b6575;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  border-color: #cfd5df;
  background: var(--soft);
}

.chip i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--c);
}

.chip .count {
  color: #9aa4b5;
  font-size: 11px;
}

.chip.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.chip.is-on .count {
  color: rgba(255, 255, 255, 0.6);
}

/* ---------------- list ---------------- */

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 20px 8px;
  font-size: 11px;
  color: #5b6575;
}

.list-head .muted {
  color: #a6adba;
}

.list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 16px;
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.card:hover {
  background: var(--soft);
}

.card.is-on {
  background: #f1f4f8;
  border-color: #e1e6ee;
}

.thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background-color: var(--c-soft);
  background-size: cover;
  background-position: center;
  color: var(--c);
  font-size: 17px;
  font-weight: 700;
  overflow: hidden;
}

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.thumb.has-img {
  color: transparent;
}

.card-main {
  min-width: 0;
  padding-top: 2px;
}

.card h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .addr {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 11px;
  color: #5b6575;
}

.card .meta .sep {
  width: 1px;
  height: 9px;
  background: #dfe3ea;
}

.card .type-name {
  color: var(--c);
  font-weight: 600;
}

.empty {
  padding: 52px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}

.empty .icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: var(--soft);
  color: #b3bac6;
  font-size: 22px;
}

.empty strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: #9aa4b5;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

/* ---------------- map ---------------- */

.map-wrap {
  position: relative;
  min-width: 0;
}

#map {
  position: absolute;
  inset: 0;
  background: #e9edf1;
}

.leaflet-container {
  font-family: var(--font);
  background: #e9edf1;
}

.leaflet-control-attribution {
  padding: 2px 6px;
  border-radius: 6px 0 0 0;
  background: rgba(255, 255, 255, 0.82);
  color: #7b8698;
  font-size: 10px;
  backdrop-filter: blur(4px);
}

.leaflet-control-attribution a {
  color: #5b6575;
}

.leaflet-bottom.leaflet-right {
  margin-bottom: 14px;
  margin-right: 4px;
}

.leaflet-control-zoom {
  overflow: hidden;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow) !important;
}

.leaflet-control-zoom a {
  width: 34px !important;
  height: 34px !important;
  line-height: 32px !important;
  color: #3b4453 !important;
  font-size: 16px !important;
}

.map-tools {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 900;
  display: flex;
  gap: 8px;
  align-items: center;
}

.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.segmented button {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.segmented button.is-on {
  background: var(--brand);
  color: #fff;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: #3b4453;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.icon-btn:hover {
  background: #fff;
}

.legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 900;
  display: flex;
  gap: 13px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.94);
  color: #3b4453;
  font-size: 11.5px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.legend span {
  display: inline-flex;
  align-items: center;
}

.legend i {
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 2px;
  background: var(--c);
}

/* ---------------- markers ---------------- */

.pin-wrap {
  background: transparent !important;
  border: 0 !important;
  filter: drop-shadow(0 3px 5px rgba(15, 23, 42, 0.28));
}

.pin {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 4px;
  background: var(--c);
  transform: rotate(-45deg);
  transition: transform 0.16s ease;
}

.pin span {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transform: rotate(45deg);
}

.pin-wrap:hover .pin,
.pin-wrap.is-active .pin {
  transform: rotate(-45deg) scale(1.14);
}

.pin-wrap.is-active {
  z-index: 999 !important;
}

.pin-tip {
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: #141b26;
  color: #fff;
  font-size: 11px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.pin-tip::before {
  border-top-color: #141b26;
}

/* ---------------- drawer ---------------- */

.drawer {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1150;
  display: flex;
  flex-direction: column;
  width: 468px;
  max-width: calc(100% - 32px);
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateZ(0);
  isolation: isolate;
}

@keyframes drawer-in {
  from {
    transform: translateX(14px);
  }
  to {
    transform: none;
  }
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.head-main {
  min-width: 0;
}

.eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: #9aa4b5;
  text-transform: uppercase;
}

.drawer-head h2 {
  margin: 8px 0 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.icon-close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.icon-close:hover {
  background: var(--soft);
  color: var(--text);
}

.drawer-body {
  flex: 1;
  min-height: 0;
  padding: 16px 18px 22px;
  overflow-y: auto;
  background: #fff;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  background: var(--c-soft);
  color: var(--c);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.type-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c);
}

.d-addr {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.copy-btn {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.copy-btn:hover {
  color: var(--text);
  background: var(--soft);
}

.d-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.d-actions + .d-actions {
  margin-top: 8px;
}

.d-actions .btn-primary {
  margin-left: 0;
}

.addr-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #d5dae2;
  text-underline-offset: 3px;
}

.addr-link:hover {
  color: var(--text);
  text-decoration-color: #9aa4b5;
}

.d-actions .btn {
  flex: 1;
  height: 34px;
  font-size: 12px;
}

.btn-danger {
  color: #b42318;
  border-color: #f2d4d0;
}

.btn-danger:hover {
  background: #fef3f2;
  border-color: #e9b8b2;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.g-item {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 11px;
  background: #eef1f5;
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
}

.g-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g-item.g-video {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
  background: #0b111b;
  cursor: default;
}

.gallery .g-item:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  aspect-ratio: 4 / 3;
}

.g-item.g-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b111b;
}

.g-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, rgba(11, 17, 27, 0.05), rgba(11, 17, 27, 0.55));
}

.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 16px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.kv-item {
  padding: 10px 12px;
  background: #fff;
}

.kv-item dt {
  margin: 0 0 3px;
  color: #9aa4b5;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.kv-item dd {
  margin: 0;
  color: var(--text);
  font-size: 12.5px;
  word-break: break-word;
}

.kv-item:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.kv-item .st {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.st-green {
  background: #e7f8ef;
  color: #067647;
}

.st-blue {
  background: #eaf2ff;
  color: #1d4ed8;
}

.st-gray {
  background: #f1f3f6;
  color: #5b6575;
}

.st-amber {
  background: #fff5e5;
  color: #b54708;
}

.st-purple {
  background: #f3eeff;
  color: #6d28d9;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  padding: 4px 9px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #4b5565;
  font-size: 11.5px;
}

.remarks {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--soft);
  color: #3b4453;
  font-size: 12.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.d-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: #a6adba;
  font-size: 10.5px;
}

/* ---------------- form ---------------- */

.form-body {
  padding-top: 12px;
}

.hint-strip {
  margin-bottom: 14px;
  padding: 9px 12px;
  border: 1px solid #dfe8f7;
  border-radius: 10px;
  background: #f3f7ff;
  color: #34507a;
  font-size: 11.5px;
  line-height: 1.6;
}

.f-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.f-section:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.f-label {
  margin-bottom: 9px;
  color: #6b7688;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.field {
  position: relative;
  display: block;
  margin-bottom: 10px;
}

.field > span {
  display: block;
  margin-bottom: 5px;
  color: #596275;
  font-size: 11.5px;
}

.field b {
  color: #e11d48;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #a9b2c1;
  box-shadow: 0 0 0 3px rgba(20, 27, 38, 0.06);
}

.field textarea {
  min-height: 76px;
  line-height: 1.6;
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.type-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.type-picker button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #5b6575;
  font-size: 12px;
  cursor: pointer;
}

.type-picker button i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--c);
}

.type-picker button.is-on {
  border-color: var(--c);
  background: var(--c-soft);
  color: var(--c);
  font-weight: 700;
}

.addr-row {
  display: flex;
  gap: 8px;
}

.addr-row input {
  flex: 1;
  min-width: 0;
}

.addr-row .btn {
  flex: 0 0 auto;
  height: 38px;
}

.suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  max-height: 232px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.suggest button {
  display: block;
  width: 100%;
  padding: 8px 11px;
  border: 0;
  border-bottom: 1px solid #f2f4f7;
  background: #fff;
  text-align: left;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.suggest button:last-child {
  border-bottom: 0;
}

.suggest button:hover {
  background: var(--soft);
}

.suggest .sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.media-grid:empty {
  display: none;
}

.media-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  background: #eef1f5;
}

.media-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-item.media-video {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px;
  background: #111827;
  color: #fff;
  font-size: 10px;
  text-align: center;
}

.media-item.media-video .m-play {
  font-size: 16px;
}

.media-item.media-video .m-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.7;
}

.m-del {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.m-del:hover {
  background: rgba(180, 35, 24, 0.9);
}

.upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border: 1px dashed #c6ccd8;
  border-radius: 9px;
  background: #fbfcfd;
  color: #4b5565;
  font-size: 12px;
  cursor: pointer;
}

.upload-btn:hover {
  border-color: #9aa4b5;
  background: #f4f6f8;
}

.upload-btn input {
  display: none;
}

.upload-note {
  color: var(--muted);
  font-size: 10.5px;
}

.drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.drawer-foot .btn {
  min-width: 84px;
}

.is-uploading {
  opacity: 0.55;
  pointer-events: none;
}

/* ---------------- lightbox & toasts ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: grid;
  place-items: center;
  padding: 40px;
  background: rgba(8, 12, 20, 0.86);
  backdrop-filter: blur(6px);
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 9997;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 12, 20, 0.56);
  backdrop-filter: blur(4px);
}

.share-card {
  width: min(420px, 100%);
  padding: 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.share-head h3 {
  margin: 0;
  font-size: 16px;
}

.share-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.share-close:hover {
  background: var(--soft);
  color: var(--text);
}

.share-name {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 12.5px;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-actions .btn {
  width: 100%;
  height: 40px;
}

.share-actions .btn-primary {
  margin-left: 0;
}

.share-hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.toast {
  padding: 9px 16px;
  border-radius: 999px;
  background: #141b26;
  color: #fff;
  font-size: 12.5px;
  box-shadow: var(--shadow);
  animation: toast-in 0.18s ease-out;
}

.toast.is-error {
  background: #b42318;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------- scrollbars ---------------- */

.list::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar,
.suggest::-webkit-scrollbar {
  width: 8px;
}

.list::-webkit-scrollbar-thumb,
.drawer-body::-webkit-scrollbar-thumb,
.suggest::-webkit-scrollbar-thumb {
  border: 2px solid #fff;
  border-radius: 8px;
  background: #d5dae2;
}

.list::-webkit-scrollbar-thumb:hover,
.drawer-body::-webkit-scrollbar-thumb:hover {
  background: #bfc6d1;
}

/* ---------------- responsive ---------------- */

@media (max-width: 1180px) {
  .app {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .drawer {
    width: 420px;
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .drawer {
    width: calc(100% - 32px);
  }
}

@media (max-width: 820px) {
  .app,
  .app.sidebar-closed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1200;
    width: min(72vw, 320px);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  }

  .app.sidebar-closed .sidebar {
    transform: translateX(-100%);
  }

  .drawer {
    z-index: 1150;
  }

  .leaflet-top.leaflet-left {
    top: 66px;
  }
}
