* { box-sizing: border-box; }
:root {
  --bg: #eef3f8;
  --surface: rgba(255,255,255,.96);
  --surface-strong: rgba(255,255,255,.985);
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-soft: #dbeafe;
  --danger-soft: #fee2e2;
  --warning-soft: #fef3c7;
  --success-soft: #dcfce7;
  --shadow: 0 14px 36px rgba(15,23,42,.14);
}
html, body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(180deg, #edf4ff 0%, #f8fbff 38%, #eef3f8 100%);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  overscroll-behavior-y: none;
}
body {
  display: block;
  padding: 0;
  overflow: hidden;
}
.phone-shell {
  width: 100vw;
  max-width: none;
  min-height: 100dvh;
  overflow: hidden;
}
.map-stage {
  position: relative;
  min-height: 100dvh;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
.admin-link-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 20;
  border: 0;
  padding: 4px 2px;
  background: transparent;
  color: rgba(15,23,42,.72);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255,255,255,.55);
}
.admin-link-btn:hover {
  color: rgba(15,23,42,.92);
}
.icon-btn, .ghost-btn, .map-tool-btn, .close-btn, .drawer-nav-btn, .filter-fab {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
}
.icon-btn {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,.95);
  box-shadow: var(--shadow);
  font-size: 20px;
}
.ghost-btn {
  height: 42px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
  background: rgba(15,23,42,.08);
  color: #0f172a;
}
.ghost-btn.primary-lite {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
}
.compact-btn { min-width: 58px; }
.map-toolbar-floating {
  position: absolute;
  left: 54px;
  right: auto;
  top: 10px;
  z-index: 18;
}
.mall-switcher {
  display: flex;
  align-items: center;
  min-height: 36px;
  max-width: 154px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 20px rgba(15,23,42,.08);
}
.mall-switcher select {
  width: 100%;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  outline: none;
}
.map-side-filters {
  position: absolute;
  left: 12px;
  right: auto;
  top: 58px;
  z-index: 18;
  display: grid;
  gap: 6px;
}
.map-top-left-tools {
  position: absolute;
  left: 12px;
  top: 58px;
  z-index: 18;
}
.filter-fab {
  width: 38px;
  min-height: 38px;
  padding: 6px 3px;
  display: grid;
  place-items: center;
  gap: 1px;
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  color: #334155;
  box-shadow: 0 8px 18px rgba(15,23,42,.10);
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.filter-fab:active { transform: scale(.97); }
.filter-fab.active {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
}
.filter-fab-icon {
  font-size: 12px;
  line-height: 1;
}
.filter-fab-text {
  font-size: 8px;
  font-weight: 800;
  line-height: 1.05;
}
.map-zoom-controls {
  position: absolute;
  right: 12px;
  left: auto;
  top: 58px;
  z-index: 18;
  display: grid;
  gap: 6px;
}
.map-tool-btn {
  width: 34px;
  height: 34px;
  background: rgba(15,23,42,.76);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 8px 18px rgba(15,23,42,.16);
}
.map-tool-btn.subtle {
  background: rgba(255,255,255,.92);
  color: #0f172a;
}
.map-canvas {
  position: relative;
  min-height: 100dvh;
  height: 100dvh;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
  border: 0;
  touch-action: none;
  cursor: grab;
}
.map-canvas.is-dragging {
  cursor: grabbing;
}
.map-canvas.is-dragging,
.map-canvas.is-dragging * {
  user-select: none;
}
.map-scene {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
  --pin-scale: .74;
  --label-scale: .70;
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148,163,184,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.18) 1px, transparent 1px);
  background-size: 28px 28px;
}
.map-center-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}
.floorplan-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.floorplan-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(15,23,42,.08));
  pointer-events: none;
}
.map-empty-tip {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 220px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 8px 18px rgba(15,23,42,.08);
}
.map-pin {
  position: absolute;
  transform: translate(-50%, -100%) rotate(-45deg) scale(var(--pin-scale));
  transform-origin: center bottom;
  width: 20px;
  height: 20px;
  border-radius: 50% 50% 50% 0;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 10px 20px rgba(15,23,42,.18);
}
.map-pin.active {
  transform: translate(-50%, -100%) rotate(-45deg) scale(calc(var(--pin-scale) * 1.2));
  box-shadow: 0 12px 24px rgba(15,23,42,.24);
  z-index: 3;
}
.map-pin::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: rgba(255,255,255,.95);
  border-radius: 50%;
}
.map-pin.occupied { background: #22c55e; }
.map-pin.vacant { background: #f59e0b; }
.map-pin.expiring { background: #ef4444; }
.pin-label {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transform: translate(-50%, 0) scale(var(--label-scale));
  transform-origin: center top;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.82);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.pin-label-text {
  overflow: hidden;
  text-overflow: ellipsis;
}
.pin-label.active {
  transform: translate(-50%, 0) scale(calc(var(--label-scale) * 1.12));
  background: rgba(15,23,42,.92);
  box-shadow: 0 10px 18px rgba(15,23,42,.18);
  z-index: 3;
  pointer-events: auto;
}
.pin-detail-btn {
  border: 0;
  background: rgba(255,255,255,.16);
  color: #fff;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.pin-detail-btn:active { transform: scale(.98); }
.drawer {
  position: absolute;
  inset: auto 10px 10px 10px;
  z-index: 70;
  display: block;
  opacity: 1;
  pointer-events: auto;
}
.drawer-backdrop { display: none; }
.drawer-sheet {
  position: relative;
  width: 100%;
  height: min(var(--drawer-mid-height, 56vh), calc(100dvh - 20px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(255,255,255,.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 -14px 40px rgba(15,23,42,.18);
  transform: translateY(0);
  transition: height .24s ease, transform .24s ease, box-shadow .24s ease;
}
.drawer.level-low .drawer-sheet {
  height: 58px;
}
.drawer.level-mid .drawer-sheet {
  height: min(var(--drawer-mid-height, 56vh), calc(100dvh - 20px));
}
.drawer.level-high .drawer-sheet {
  height: min(var(--drawer-max-height, 56vh), calc(100dvh - 20px));
}
.drawer-grab {
  display: none;
}
.sheet-topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 16px 14px 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(226,232,240,.96);
  touch-action: none;
  isolation: isolate;
}
.sheet-topbar::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: rgba(148,163,184,.75);
}
.sheet-topbar-copy {
  min-width: 0;
  text-align: center;
}
.sheet-summary-title {
  margin-top: 0;
  font-size: 17px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-contact-btn {
  justify-self: start;
  border: 1px solid rgba(191,219,254,.95);
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  height: 30px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
}
.sheet-contact-btn:disabled {
  opacity: .45;
}
.close-btn {
  width: auto;
  height: auto;
  padding: 2px 0 0;
  background: transparent;
  color: #0f172a;
  font-size: 14px;
  line-height: 1;
  border-radius: 0;
}
.sheet-toggle-btn {
  min-width: 18px;
  justify-self: end;
}
.drawer-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 14px 18px;
  background: #fff;
}
.drawer-content { padding: 0 0 4px; }
.drawer-hero-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
  margin-bottom: 12px;
  isolation: isolate;
  --hero-rotation: 0deg;
}
.drawer-hero-backdrop,
.drawer-hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: center;
}
.drawer-hero-backdrop {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: blur(24px) saturate(1.08);
  transform: scale(1.16);
  opacity: 0;
  transition: opacity .2s ease;
}
.drawer-hero {
  z-index: 1;
  object-fit: cover;
  image-orientation: from-image;
}
.drawer-hero-shell.is-portrait .drawer-hero-backdrop {
  opacity: .88;
}
.drawer-hero-shell.is-portrait .drawer-hero {
  object-fit: contain;
}
.drawer-hero-shell.needs-rotation .drawer-hero-backdrop {
  transform: rotate(var(--hero-rotation)) scale(1.18);
}
.drawer-hero-shell.needs-rotation .drawer-hero {
  transform: rotate(var(--hero-rotation));
}
.drawer-title {
  font-size: 20px;
  font-weight: 800;
  margin-top: 8px;
}
.drawer-subtitle {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.55;
  font-size: 13px;
}
.status-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  margin-top: 2px;
  min-width: 0;
}
.status-summary-pill,
.status-expiry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.94) 0%, rgba(255,255,255,.82) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
  white-space: nowrap;
}
.status-summary-pill .status-summary-label {
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.status-strip.occupied .status-summary-pill,
.status-strip.occupied .status-expiry {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}
.status-strip.expiring .status-summary-pill,
.status-strip.expiring .status-expiry {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
}
.status-expiry-time {
  color: #7c2d12;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.status-strip.occupied .status-summary-label,
.status-strip.occupied .status-expiry-time {
  color: #1e3a8a;
}
.status-strip.expiring .status-summary-label,
.status-strip.expiring .status-expiry-time {
  color: #9f1239;
}
.status-expiry-time.is-expired {
  color: #b91c1c;
}
.status-expiry-date {
  color: rgba(15,23,42,.62);
  font-size: 12px;
  white-space: nowrap;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.detail-card {
  background: #f8fafc;
  border-radius: 16px;
  padding: 11px;
  min-width: 0;
}
.detail-k { font-size: 11px; color: var(--muted); }
.detail-v { margin-top: 5px; font-size: 13px; font-weight: 800; color: #0f172a; line-height: 1.4; word-break: break-word; }
.notes-card {
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 16px;
  padding: 12px;
  line-height: 1.65;
  font-size: 12px;
}
.sheet-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(226,232,240,.9);
}
.sheet-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.sheet-section-title {
  font-size: 14px;
  font-weight: 800;
}
.sheet-section-meta {
  color: var(--muted);
  font-size: 12px;
}
.slot-list,
.reminder-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.slot-card,
.reminder-card {
  background: rgba(248,250,252,.98);
  border-radius: 18px;
  padding: 13px;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
  min-width: 0;
}
.slot-card { cursor: pointer; }
.slot-top,
.reminder-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.slot-title-wrap,
.reminder-title-wrap {
  min-width: 0;
  flex: 1 1 auto;
}
.slot-name, .reminder-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}
.slot-meta, .reminder-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.slot-status, .status-pill {
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 auto;
}
.slot-status.occupied, .status-pill.occupied { background: var(--success-soft); color: #166534; }
.slot-status.vacant, .status-pill.vacant { background: var(--warning-soft); color: #92400e; }
.slot-status.expiring, .status-pill.expiring { background: var(--danger-soft); color: #991b1b; }
.slot-bottom,
.reminder-bottom {
  margin-top: 12px;
  display: grid;
  gap: 7px;
}
.slot-bottom.refined,
.reminder-bottom.refined {
  color: #334155;
  font-size: 12px;
}
.slot-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.slot-line-dimension {
  gap: 6px;
}
.slot-line-label {
  color: #64748b;
  font-size: 11px;
  letter-spacing: .02em;
}
.slot-line-value {
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  min-width: 0;
  word-break: break-word;
}
.slot-line-dimension .slot-line-label {
  flex: 0 0 auto;
}
.slot-line-dimension .slot-line-value {
  white-space: nowrap;
  word-break: normal;
  font-size: 11px;
  letter-spacing: -.01em;
}
.reminder-days {
  font-size: 13px;
  font-weight: 800;
  color: #dc2626;
  white-space: nowrap;
}
@media (max-width: 620px) {
  .slot-list,
  .reminder-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 420px) {
  .slot-list,
  .reminder-list {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .slot-card,
  .reminder-card {
    padding: 12px;
  }
  .slot-status,
  .status-pill {
    padding: 6px 9px;
    font-size: 10px;
  }
  .slot-name,
  .reminder-name {
    font-size: 14px;
  }
  .slot-meta,
  .reminder-meta,
  .slot-line-value,
  .slot-bottom.refined,
  .reminder-bottom.refined {
    font-size: 11px;
  }
  .slot-line-label {
    font-size: 10px;
  }
  .reminder-days {
    font-size: 12px;
  }
}
.empty {
  color: var(--muted);
  text-align: center;
  padding: 18px 0;
  font-size: 14px;
}
.error {
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 18px;
  padding: 14px;
  line-height: 1.7;
}
@media (max-width: 380px) {
  .map-stage { padding: 8px; }
  .admin-link-btn { top: 12px; left: 12px; }
  .map-toolbar-floating { left: 48px; right: auto; top: 8px; }
  .mall-switcher { max-width: 138px; min-height: 34px; padding: 0 10px; }
  .map-side-filters { left: 8px; right: auto; top: 54px; }
  .map-zoom-controls { right: 8px; left: auto; top: 54px; }
  .drawer { inset: auto 8px 8px 8px; }
  .drawer-sheet { border-radius: 24px; }
  .sheet-topbar { grid-template-columns: auto 1fr auto; gap: 8px; padding: 16px 10px 12px; }
  .sheet-contact-btn { padding: 0 10px; font-size: 10px; }
  .drawer-scroll { padding: 0 10px 16px; }
}
