.brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.brand-logo { width: 40px; height: 40px; border-radius: 8px; }
.brand-name {
  font-weight: 700; font-size: 20px; letter-spacing: 0.3px;
  color: #eaf;
  background: linear-gradient(90deg, #6f8, #8cd);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.splash {
  position: fixed; inset: 0; z-index: 5000;
  background: linear-gradient(180deg, #22aa66 0%, #0f5030 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.35s ease;
}
.splash.hidden { opacity: 0; pointer-events: none; }
.splash-card {
  text-align: center; color: #fff;
  padding: 24px; max-width: 280px;
}
.splash-logo {
  width: 140px; height: 140px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
  animation: splash-pop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1.2);
}
.splash-title {
  font-size: 38px; font-weight: 800; letter-spacing: 0.5px;
  margin-top: 16px; text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.splash-sub {
  margin-top: 6px; opacity: 0.82; font-size: 14px;
}
@keyframes splash-pop {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

*,*::before,*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overscroll-behavior: none; }
body {
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #f5f5f5; background: #0a0a0a;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; }

#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
#map { flex: 1; min-height: 0; background: #111; }

.tabbar {
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: #111; border-top: 1px solid #222;
}
.tabbar button {
  background: none; border: 0; padding: 10px 6px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 64px; font-size: 22px;
}
.tabbar button span { font-size: 11px; opacity: 0.8; }
.tabbar button.active { color: #6cf; }

.overlay {
  position: fixed; inset: 0 0 124px 0; background: rgba(10,10,10,0.96);
  overflow-y: auto; padding: 16px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 500;
}
.overlay.hidden { display: none; }

input:not([type=checkbox]):not([type=radio]):not([type=color]),
textarea, select, button.btn {
  min-height: 48px; padding: 12px; font-size: 17px;
  background: #1a1a1a; color: #f5f5f5; border: 1px solid #333; border-radius: 8px;
  width: 100%;
}
input:not([type=checkbox]):not([type=radio]):not([type=color]):focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(31, 143, 95, 0.28);
  border-color: var(--pf-green);
}
input[type=checkbox], input[type=radio] {
  width: 22px; height: 22px; accent-color: #2a6;
}
input[type=color] {
  width: 48px; height: 40px; padding: 0; border: 1px solid #333; border-radius: 8px;
  background: #1a1a1a;
}
textarea { min-height: 96px; resize: vertical; }
button.btn { background: #234; border-color: #456; cursor: pointer; }
button.btn.primary { background: #2a6; border-color: #3c8; }
button.btn.danger { background: #822; border-color: #a44; }
button.btn.compact-btn {
  width: auto;
  min-height: 38px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 800;
}

.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
label { display: block; margin: 12px 0 4px; font-size: 14px; opacity: 0.8; }

.fab {
  position: fixed; right: 16px; bottom: calc(110px + env(safe-area-inset-bottom));
  width: 64px; height: 64px; border-radius: 16px;
  background: #2a6; color: #fff; font-size: 32px; border: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5); z-index: 400;
}
.fab.fab-secondary {
  bottom: calc(186px + env(safe-area-inset-bottom));
  right: 16px;
  width: 64px; height: 64px; font-size: 28px;
  background: linear-gradient(135deg, #22aa66, #0f5030);
  border: 3px solid rgba(255,255,255,0.4);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  border-radius: 50%;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fab.fab-tertiary {
  bottom: calc(262px + env(safe-area-inset-bottom));
  right: 16px;
  width: 64px; height: 64px; font-size: 36px;
  background: linear-gradient(135deg, #6b7c93, #4a5568);
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
  border-radius: 16px;
}

.fab:active {
  transform: scale(0.95);
}
.fab.fab-secondary:active {
  background: linear-gradient(135deg, #0f5030, #0a3020);
}
.fab.fab-tertiary:active {
  background: linear-gradient(135deg, #4a5568, #2d3748);
}


.gps-badge {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(8px + env(safe-area-inset-top, 0));
  padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: #111a; border: 1px solid #333; color: #f5f5f5;
  z-index: 450; cursor: pointer;
}
.gps-badge.excellent { border-color: #2fbf71; color: #caffdf; }
.gps-badge.ok   { border-color: #3c8; color: #afd; }
.gps-badge.warn { border-color: #f93; color: #fc9; }
.gps-badge.bad  { border-color: #c33; color: #f99; }

.quick-add-wrap {
  position: fixed; right: 12px;
  top: calc(14px + env(safe-area-inset-top, 0));
  z-index: 450;
  padding: 6px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.quick-add {
  display: flex; flex-direction: column; gap: 10px;
  /* 3.5 × 68 + 3 × 10 = 268px; shows 3 full buttons and the top of a 4th */
  max-height: min(268px, calc(100dvh - 340px - env(safe-area-inset-bottom)));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.quick-add::-webkit-scrollbar { display: none; }
.quick-add-btn {
  width: 68px; height: 68px; border-radius: 14px;
  font-size: 30px; color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  padding: 0; min-height: 68px; flex-shrink: 0;
}
.quick-add-btn:active { transform: scale(0.92); }

/* Top + bottom fades — only shown when there's more above/below the visible area */
.quick-add-wrap::before,
.quick-add-wrap::after {
  content: ''; position: absolute; left: 6px; right: 6px;
  height: 44px; pointer-events: none;
  opacity: 0; transition: opacity 0.15s ease;
}
.quick-add-wrap::before {
  top: 6px; border-radius: 14px 14px 0 0;
  background: transparent;
}
.quick-add-wrap::after {
  bottom: 6px; border-radius: 0 0 14px 14px;
  background: transparent;
}
.quick-add-wrap.has-more-up::before   { opacity: 1; }
.quick-add-wrap.has-more-down::after  { opacity: 1; }

.quick-add-hint {
  position: absolute; left: 0; right: 0;
  text-align: center; font-size: 18px; line-height: 1;
  color: rgba(255, 255, 255, 0.95);
  pointer-events: none; opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
}
.quick-add-hint-up   { top: 4px;    animation: qa-bounce-up   1.4s ease-in-out infinite; }
.quick-add-hint-down { bottom: 4px; animation: qa-bounce-down 1.4s ease-in-out infinite; }
.quick-add-wrap.has-more-up   .quick-add-hint-up   { opacity: 1; }
.quick-add-wrap.has-more-down .quick-add-hint-down { opacity: 1; }
/* True alpha fade on the half-visible 4th button when the column overflows */
.quick-add-wrap.has-more-down .quick-add {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
}
.quick-add-wrap.has-more-up .quick-add {
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 72%, transparent 100%);
          mask-image: linear-gradient(to top, #000 0%, #000 72%, transparent 100%);
}
.quick-add-wrap.has-more-up.has-more-down .quick-add {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%);
}
@keyframes qa-bounce-down {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}
@keyframes qa-bounce-up {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(160px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.88); color: #fff; padding: 10px 18px;
  border-radius: 20px; font-size: 15px; font-weight: 500; z-index: 1000;
  pointer-events: none; opacity: 0; transition: opacity 0.18s ease;
}
.toast.visible { opacity: 1; }

.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 16px; z-index: 1000; overflow-y: auto;
}
.modal {
  width: 100%; max-width: 500px; background: #111; border: 1px solid #333; border-radius: 12px;
  padding: 16px; margin-top: env(safe-area-inset-top, 0);
}
.photo-list img { max-height: 160px; object-fit: cover; }

.task-pin .pin-bubble {
  width: 30px; height: 30px; line-height: 26px; text-align: center;
  border-radius: 50%; color: #fff; font-size: 16px;
  border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  transform: translateY(-5px);
  position: relative;
  z-index: 1;
}
.task-pin .pin-check {
  position: absolute; right: -5px; top: -5px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #00b846; color: #fff;
  font-size: 12px; font-weight: 900; line-height: 14px;
  border: 2px solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 15;
}
.task-pin .pin-priority {
  position: absolute; left: -8px; top: -8px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #ff0000 !important; color: #fff !important;
  font-size: 13px; font-weight: 900; line-height: 16px;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 15;
}
.task-pin .pin-due {
  position: absolute; right: -7px; bottom: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--pf-amber); color: #fff;
  font-size: 13px; font-weight: 900; line-height: 16px;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 15;
}
.task-pin.task-pin-done .pin-bubble { box-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.task-pin.pin-move-ready::after,
.task-pin.pin-moving::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -62%);
  z-index: 0;
}
.task-pin.pin-move-ready::after {
  border: 4px solid rgba(31, 143, 95, 0.82);
  background: rgba(31, 143, 95, 0.16);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.34), 0 8px 22px rgba(20,31,26,0.22);
  animation: pin-ready-ring 820ms ease-in-out infinite;
}
.task-pin.pin-moving::after {
  border: 4px solid rgba(32, 120, 184, 0.82);
  background: rgba(32, 120, 184, 0.16);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.34), 0 8px 22px rgba(20,31,26,0.24);
}
.task-pin.pin-move-ready .pin-bubble {
  animation: pin-ready-jiggle 420ms ease-in-out 0s 2;
  box-shadow: 0 0 0 5px rgba(31,143,95,0.28), 0 6px 16px rgba(20,31,26,0.35);
}
.task-pin.pin-moving .pin-bubble {
  box-shadow: 0 0 0 6px rgba(32,120,184,0.26), 0 8px 18px rgba(20,31,26,0.38);
}
@keyframes pin-ready-jiggle {
  0%, 100% { transform: translateY(-5px) rotate(0deg) scale(1); }
  25% { transform: translateY(-7px) rotate(-4deg) scale(1.06); }
  50% { transform: translateY(-5px) rotate(4deg) scale(1.06); }
  75% { transform: translateY(-7px) rotate(-3deg) scale(1.04); }
}
@keyframes pin-ready-ring {
  0%, 100% { transform: translate(-50%, -62%) scale(0.96); opacity: 0.86; }
  50% { transform: translate(-50%, -62%) scale(1.06); opacity: 1; }
}
.preview-pin .pin-bubble { border-style: dashed; }
.leaflet-popup-content-wrapper { background: #111; color: #f5f5f5; }
.leaflet-popup-tip { background: #111; }
.leaflet-popup-content a { color: #6cf; }

.popup-photos {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px;
}
.popup-thumb {
  width: 100%; max-height: 140px; object-fit: cover;
  border-radius: 6px; cursor: pointer;
}
.popup-photos:has(img + img) .popup-thumb {
  width: calc(50% - 2px); max-height: 90px;
}
.popup-photo-container {
  position: relative;
}
.popup-photo-hint {
  font-size: 11px; color: #999; text-align: center;
  margin-top: 3px; opacity: 0.8; font-style: italic;
}

.pin-popup { min-width: 220px; }
.popup-title {
  font-size: 22px; font-weight: 700; line-height: 1.1;
  max-width: 180px; word-break: break-word;
  margin-right: 8px;
}
.popup-category-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; gap: 12px;
}
.popup-cat {
  font-size: 21px; opacity: 0.85;
  border: 1px solid #444; border-radius: 12px;
  padding: 4px 10px; background: rgba(255,255,255,0.05);
}
.popup-priority {
  font-size: 16px; font-weight: 600;
  padding: 3px 8px; border-radius: 8px;
  background: rgba(0,0,0,0.3);
}
.popup-priority-high {
  color: #ff4444; border: 1px solid #ff4444;
}
.popup-priority-med {
  color: #ffaa00; border: 1px solid #ffaa00;
}
.popup-priority-low {
  color: #888; border: 1px solid #666;
}
.popup-notes {
  font-size: 19px; line-height: 1.4; margin-top: 8px;
  white-space: pre-wrap; word-wrap: break-word;
}
.popup-info {
  font-size: 12px; opacity: 0.75; margin-top: 10px;
  padding-top: 6px; border-top: 1px solid #333;
}
.popup-info-done { color: #afe6c4; opacity: 0.95; }
.popup-actions {
  display: flex; gap: 6px; margin-top: 10px;
}
.popup-actions .btn { flex: 1; }
.popup-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; font-size: 14px;
}
.popup-link {
  color: #6cf; text-decoration: underline;
  padding: 6px 2px; cursor: pointer;
}
.popup-edit { text-align: right; opacity: 0.9; }

.lightbox-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0, 0, 0, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top, 0) 12px env(safe-area-inset-bottom, 12px);
  touch-action: pan-y;
}
.lightbox-img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 4px;
}
.lightbox-counter {
  position: absolute; top: auto; left: 50%;
  bottom: calc(58px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%);
  color: #fff; font-weight: 500; font-size: 14px;
  background: rgba(0,0,0,0.6); padding: 4px 10px; border-radius: 999px;
}
.lightbox-close {
  position: absolute; top: calc(12px + env(safe-area-inset-top, 0)); left: 50%;
  transform: translateX(-50%);
  width: 44px; height: 44px; min-height: 44px; padding: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 26px; line-height: 1;
  background: rgba(15,23,42,0.62); border: 1px solid rgba(255,255,255,0.28);
  display: grid; place-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.lightbox-nav {
  position: absolute;
  bottom: calc(14px + env(safe-area-inset-bottom, 0));
  width: 44px; height: 44px; min-height: 44px; padding: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 34px; line-height: 1;
  background: rgba(15,23,42,0.52); border: 1px solid rgba(255,255,255,0.24);
  display: grid; place-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.lightbox-prev { left: calc(50% - 90px); }
.lightbox-next { right: calc(50% - 90px); }
.lightbox-swipe-hint {
  position: absolute;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 6px 12px;
  color: #fff;
  background: rgba(15,23,42,0.54);
  border: 1px solid rgba(255,255,255,0.22);
  font-size: 13px;
  font-weight: 800;
}

.task-list { margin-top: 8px; }
.task-row {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 6px; align-items: center;
  padding: 10px 8px; border-bottom: 1px solid #222;
}
.task-row-actions { display: flex; gap: 4px; }
.task-row .bullet {
  width: 32px; height: 32px; border-radius: 50%; text-align: center; line-height: 30px;
  border: 2px solid #fff;
}
.task-row .title { font-weight: 500; }
.task-row .meta  { font-size: 12px; opacity: 0.7; }
.task-row .row-btn {
  width: 44px; min-width: 44px; min-height: 44px; padding: 6px;
  font-size: 18px; text-align: center;
}
.task-row.task-done .title { text-decoration: line-through; opacity: 0.6; }
.task-row.task-done .bullet { opacity: 0.55; }
.task-row.task-cleared { opacity: 0.6; background: #0f1f1a; }
.task-row .row-btn.row-btn-danger { background: #822; border-color: #a44; }
.filter-box { padding: 8px 0; border-bottom: 1px solid #222; margin-bottom: 12px; }

.big { font-size: 28px; font-weight: 600; }
.muted { opacity: 0.7; font-size: 14px; }

.session-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  padding: 8px; border-bottom: 1px solid #222; align-items: center;
}

.cat-list { margin-top: 8px; }
.cat-list-dragging {
  touch-action: none;
  user-select: none;
}
.cat-row {
  display: grid;
  grid-template-columns: 4px 44px minmax(0, 1fr) 46px 46px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #222;
  touch-action: manipulation;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}
.cat-row-dragging {
  opacity: 0.88;
  transform: scale(1.01);
  z-index: 1;
}
.cat-stripe { align-self: stretch; border-radius: 2px; min-height: 32px; }
.cat-emoji  { display: grid; place-items: center; text-align: center; }
.category-pin-icon {
  --pin-size: 30px;
  --pin-border-width: 2px;
  width: var(--pin-size);
  height: var(--pin-size);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: var(--pin-border-width) solid var(--pin-border, #888);
  border-radius: 50%;
  background: var(--pin-fill, #888);
  box-shadow: 0 2px 4px rgba(0,0,0,0.28);
  color: #fff;
  font-size: 16px;
  line-height: 1;
}
.category-pin-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cat-pin-preview {
  --pin-size: 30px;
}
.cat-name   { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.cat-icon {
  min-height: 40px; min-width: 40px; width: auto;
  padding: 6px; font-size: 18px; text-align: center;
}
.cat-drag-handle {
  cursor: grab;
  touch-action: none;
  color: var(--pf-muted);
}
.cat-drag-handle:active {
  cursor: grabbing;
}
.cat-drag-handle span {
  display: block;
  transform: scaleX(1.18);
  font-size: 22px;
  line-height: 1;
}
.cat-icon-preview {
  display: block; width: 96px; height: 96px; object-fit: cover;
  border-radius: 12px; border: 1px solid #333; margin-top: 8px;
}

.place-banner {
  position: fixed; top: env(safe-area-inset-top, 0); left: 0; right: 0; z-index: 1100;
  background: rgba(10,10,10,0.95); padding: 12px; border-bottom: 1px solid #333;
}

.review-grid { display: grid; gap: 12px; grid-template-columns: 1fr; margin-top: 12px; padding-bottom: 80px; }
@media (min-width: 640px) { .review-grid { grid-template-columns: 1fr 1fr; } }
.review-row {
  display: grid; grid-template-columns: 100px 1fr; gap: 10px; align-items: start;
  padding: 8px; background: #151515; border-radius: 8px;
}
.review-row img { max-height: 120px; object-fit: cover; width: 100%; }

/* Dedicated import panel — lives above the tab overlay AND Leaflet controls (z-index 1000) */
.import-panel {
  position: fixed; inset: 0;
  background: rgba(10,10,10,0.98);
  overflow-y: auto; padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top, 0));
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
  z-index: 2000;
  -webkit-overflow-scrolling: touch;
}
.import-panel.hidden { display: none; }
.import-footer {
  position: fixed; left: 0; right: 0;
  bottom: env(safe-area-inset-bottom, 0);
  display: flex; gap: 8px; padding: 12px 16px;
  background: rgba(10,10,10,0.96);
  border-top: 1px solid #222;
  z-index: 2001;
}
.import-footer button { flex: 1; }

/* Hide Leaflet attribution bar */
.leaflet-control-attribution {
  display: none !important;
}

/* Custom dropdown with image support */
.custom-dropdown {
  position: relative;
  display: block;
  width: 100%;
}

.custom-dropdown-button {
  width: 100%;
  padding: 12px 16px;
  background: #333;
  color: #f5f5f5;
  border: 1px solid #555;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.custom-dropdown-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}
.custom-dropdown-caret {
  margin-left: auto;
}

.custom-dropdown-button:hover {
  background: #444;
}

.custom-dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #333;
  border: 1px solid #555;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}

.custom-dropdown-options.hidden {
  display: none;
}

.custom-dropdown-option {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 16px;
  color: #f5f5f5;
  gap: 8px;
}

.custom-dropdown-option:hover {
  background: #444;
}

.custom-dropdown-add {
  font-weight: 600;
  color: #6cf;
  border-top: 1px solid #555;
}

/* GPS accuracy warning styles */
.gps-accuracy-warning {
  background: rgba(255, 107, 107, 0.15);
  border: 1px solid #ff6b6b;
  border-radius: 6px;
  padding: 8px;
  margin: 8px 0;
  font-size: 13px;
  color: #ff6b6b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gps-accuracy-info {
  background: rgba(108, 108, 255, 0.15);
  border: 1px solid #6c6cff;
  border-radius: 6px;
  padding: 8px;
  margin: 8px 0;
  font-size: 12px;
  color: #9999ff;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Bottom bar - unified attribution + tabbar container */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
}

/* Geo Due attribution bar - integrated as top of bottom-bar */
.geo-due-attribution {
  background: linear-gradient(90deg, #22aa66, #0f5030);
  color: white;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1.1;
  height: 22px;
  flex-shrink: 0;
}

.geo-due-attribution-icon {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Pinfield Look 2 shell */
:root {
  --pf-ink: #18211b;
  --pf-muted: #66746b;
  --pf-surface: rgba(255, 255, 255, 0.94);
  --pf-surface-strong: #ffffff;
  --pf-line: rgba(24, 33, 27, 0.12);
  --pf-green: #1f8f5f;
  --pf-blue: #2078b8;
  --pf-amber: #d98621;
  --pf-red: #c84d43;
  --pf-shadow: 0 10px 30px rgba(35, 48, 39, 0.18);
}

body {
  color: var(--pf-ink);
  background: #f7faf6;
}

.splash {
  background:
    linear-gradient(180deg, rgba(247, 250, 246, 0.92), rgba(229, 240, 231, 0.96)),
    radial-gradient(circle at 20% 12%, rgba(31, 143, 95, 0.18), transparent 34%),
    #f7faf6;
}
.splash-card { color: var(--pf-ink); }
.splash-title {
  color: var(--pf-ink);
  text-shadow: none;
  letter-spacing: 0;
}
.splash-sub { color: var(--pf-muted); opacity: 1; }
.splash-logo { filter: drop-shadow(0 10px 22px rgba(31, 143, 95, 0.22)); }

.map-topbar {
  position: fixed;
  z-index: 460;
  top: calc(12px + env(safe-area-inset-top, 0));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  pointer-events: none;
}
.place-switcher,
.icon-btn,
.offline-pill {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: var(--pf-surface);
  color: var(--pf-ink);
  box-shadow: var(--pf-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.place-switcher {
  position: fixed;
  left: 12px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: auto;
  min-height: 54px;
  padding: 8px 34px 8px 14px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.place-switcher::after {
  content: "⌄";
  position: absolute;
  right: 12px;
  top: 18px;
  color: var(--pf-muted);
}
.place-kicker {
  font-size: 11px;
  line-height: 1.1;
  color: var(--pf-muted);
  font-weight: 700;
  text-transform: uppercase;
}
.place-name {
  font-size: 18px;
  line-height: 1.15;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-actions {
  position: fixed;
  right: 21px;
  top: calc(12px + env(safe-area-inset-top, 0));
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-size: 24px;
  padding: 0;
}
#map-search-button {
  position: relative;
  display: grid;
  place-items: center;
  font-size: 0;
  font-weight: 900;
  color: var(--pf-ink);
}
#map-search-button svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.compass-button {
  position: fixed;
  z-index: 462;
  left: 21px;
  top: calc(12px + env(safe-area-inset-top, 0));
  min-width: 104px;
  height: 48px;
  padding: 6px 12px 6px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--pf-ink);
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--pf-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  appearance: none;
}
.compass-button.compass-active {
  border-color: rgba(31, 143, 95, 0.38);
}
.compass-button.compass-unavailable {
  opacity: 0.72;
}
.compass-mark {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(235, 246, 240, 0.96), rgba(255, 255, 255, 0.96));
  border: 2px solid rgba(31, 143, 95, 0.22);
}
.compass-mark::before {
  content: "N";
  position: absolute;
  top: 2px;
  font-size: 8px;
  line-height: 1;
  font-weight: 900;
  color: var(--pf-green);
}
.compass-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px solid rgba(24, 33, 27, 0.12);
}
.compass-needle {
  position: absolute;
  width: 4px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--pf-green) 0 48%, var(--pf-red) 52% 100%);
  transform-origin: 50% 50%;
  transition: transform 180ms ease;
}
.compass-needle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--pf-ink);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92);
}
.compass-value {
  min-width: 48px;
  font-size: 15px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-align: left;
  color: var(--pf-green);
}
.compass-button.compass-unavailable .compass-value {
  color: var(--pf-muted);
}
.offline-pill {
  min-height: 34px;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--pf-green);
}

.bottom-bar {
  background: var(--pf-surface-strong);
  border-top: 1px solid var(--pf-line);
  box-shadow: 0 -8px 24px rgba(20, 31, 26, 0.08);
}
.bottom-place-switcher {
  position: absolute;
  left: 12px;
  right: auto;
  bottom: calc(100% - 1px);
  z-index: 2;
  width: auto;
  max-width: min(250px, calc(100vw - 152px));
  min-height: 42px;
  padding: 6px 28px 6px 10px;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -4px 14px rgba(20,31,26,0.08);
}
.bottom-place-switcher::after {
  right: 10px;
  top: 13px;
}
.bottom-place-switcher .place-kicker {
  font-size: 10px;
}
.bottom-place-switcher .place-name {
  font-size: 16px;
}
body:not([data-active-tab="map"]):not([data-active-tab="tasks"]) .bottom-place-switcher,
body:not([data-active-tab="map"]):not([data-active-tab="tasks"]) #location-menu {
  display: none !important;
}
.geo-due-attribution { display: none; }
.tabbar {
  background: var(--pf-surface-strong);
  border-top: 0;
}
.tabbar button {
  color: var(--pf-muted);
  min-height: 68px;
  font-size: 22px;
  font-weight: 800;
}
.tab-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: currentColor;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}
.emoji-symbol {
  filter: grayscale(1) sepia(0.22) saturate(0.9) hue-rotate(84deg) contrast(0.95);
}
.tabbar button.active .tab-icon {
  background: #eef7f2;
}
.tabbar button span {
  font-size: 11px;
  opacity: 1;
  font-weight: 800;
}
.tabbar button .tab-icon {
  font-size: 24px;
}
.tabbar button .tab-icon + span {
  font-size: 11px;
}
.tabbar button.active { color: var(--pf-green); }

.map-summary {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 410;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.86);
  background: rgba(255,255,255,0.74);
  box-shadow: var(--pf-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.map-summary div {
  padding: 10px;
  background: rgba(255,255,255,0.76);
}
.map-summary strong {
  display: block;
  font-size: 20px;
  line-height: 1;
  color: var(--pf-ink);
}
.map-summary span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--pf-muted);
  font-weight: 800;
}

.fab {
  right: 16px;
  bottom: calc(162px + env(safe-area-inset-bottom));
  border-radius: 8px;
  background: var(--pf-green);
  box-shadow: var(--pf-shadow);
}
.fab.fab-secondary {
  bottom: calc(236px + env(safe-area-inset-bottom));
  background: var(--pf-surface-strong);
  border: 1px solid rgba(255,255,255,0.86);
}
.fab.fab-tertiary {
  bottom: calc(310px + env(safe-area-inset-bottom));
  background: var(--pf-blue);
  border: 1px solid rgba(255,255,255,0.7);
}

.quick-add-wrap {
  right: 12px;
  top: calc(82px + env(safe-area-inset-top, 0));
  display: grid;
  gap: 8px;
  border-radius: 8px;
  padding: 5px;
  background: rgba(255,255,255,0.78);
  border-color: rgba(255,255,255,0.92);
  box-shadow: 0 10px 24px rgba(20, 31, 26, 0.14);
}
.quick-add-btn {
  width: 58px;
  height: 58px;
  min-height: 58px;
  border-radius: 8px;
  border-color: var(--cat-color, var(--pf-green));
  border-color: color-mix(in srgb, var(--cat-color, var(--pf-green)) 52%, rgba(24, 33, 27, 0.1));
  box-shadow: 0 4px 12px rgba(20, 31, 26, 0.1);
}
.gps-badge {
  top: calc(12px + env(safe-area-inset-top, 0));
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.92);
  color: var(--pf-ink);
  border-color: rgba(255,255,255,0.82);
  box-shadow: 0 4px 16px rgba(20, 31, 26, 0.12);
  appearance: none;
  border-width: 1px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
}
.gps-badge.excellent { color: var(--pf-green); border-color: rgba(31,143,95,0.45); }
.gps-badge.ok { color: var(--pf-green); border-color: rgba(31,143,95,0.35); }
.gps-badge.warn { color: var(--pf-amber); border-color: rgba(217,134,33,0.35); }
.gps-badge.bad { color: var(--pf-red); border-color: rgba(200,77,67,0.35); }

.overlay {
  inset: 0 0 72px 0;
  background: #f7faf6;
  color: var(--pf-ink);
  padding: calc(20px + env(safe-area-inset-top, 0)) 16px 24px;
}
.overlay h1 {
  margin: 0 0 18px;
  font-size: 34px;
  letter-spacing: 0;
}
.muted { color: var(--pf-muted); }

input:not([type=checkbox]):not([type=radio]):not([type=color]),
textarea,
select,
button.btn {
  background: var(--pf-surface-strong);
  color: var(--pf-ink);
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  box-shadow: none;
}
button.btn {
  background: #eef4f0;
  border-color: #d8e3dc;
}
button.btn.primary {
  background: var(--pf-green);
  border-color: var(--pf-green);
  color: #fff;
}
button.btn.danger {
  background: #fff1ef;
  border-color: rgba(200,77,67,0.3);
  color: var(--pf-red);
}

.modal-bg {
  background: rgba(24,33,27,0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.modal {
  background: #fff;
  color: var(--pf-ink);
  border-color: rgba(255,255,255,0.9);
  border-radius: 8px;
  box-shadow: var(--pf-shadow);
}
.toast {
  background: rgba(255,255,255,0.96);
  color: var(--pf-ink);
  border: 1px solid rgba(255,255,255,0.86);
  box-shadow: var(--pf-shadow);
  border-radius: 999px;
}

.place-card,
.tool-card,
.task-row,
.filter-box,
.cat-row {
  background: #fff;
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(20,31,26,0.06);
}
.place-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 10px;
  align-items: center;
}
.place-card-map {
  height: 72px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(31,143,95,0.32), rgba(32,120,184,0.18)),
    repeating-linear-gradient(35deg, #d7eadb 0 12px, #eef6ec 12px 24px);
  display: flex;
  align-items: end;
  padding: 8px;
  color: var(--pf-ink);
  font-size: 12px;
  font-weight: 800;
}
.place-card-title {
  font-size: 18px;
  font-weight: 900;
}
.tool-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  margin-bottom: 10px;
}
.tool-card h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.tool-card p { margin: 0; }
.tool-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef7f2;
  font-size: 24px;
}
.coming-soon {
  align-self: start;
  border-radius: 999px;
  background: #fff3e3;
  color: var(--pf-amber);
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 900;
}

.custom-dropdown-button,
.custom-dropdown-options {
  background: #fff;
  color: var(--pf-ink);
  border-color: var(--pf-line);
}
.custom-dropdown-option { color: var(--pf-ink); }
.custom-dropdown-option:hover { background: #eef4f0; }
.custom-dropdown-add {
  color: var(--pf-green);
  border-top-color: var(--pf-line);
}
.editor-compact-control,
.editor-photo-button {
  width: min(46%, 220px);
}
.category-map-row {
  align-items: end;
  margin-top: 8px;
}
.category-map-row .editor-compact-control,
.category-map-row .editor-place-select {
  width: 100%;
}
.editor-split-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  width: min(100%, 460px);
}
.schedule-panel {
  width: min(100%, 460px);
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  background: #f8fbf9;
}
.schedule-title {
  display: block;
  margin-bottom: 10px;
}
.schedule-panel .editor-field label {
  margin-top: 0;
}
.schedule-panel .editor-field + .editor-field label {
  margin-top: 12px;
}
.schedule-panel .editor-field {
  min-width: 0;
}
.schedule-date-row,
.repeat-row {
  width: 100%;
}
.schedule-date-row {
  grid-template-columns: minmax(0, 1fr) minmax(96px, 0.68fr);
  gap: 10px;
  align-items: end;
}
.schedule-date-row .editor-field + .editor-field label {
  margin-top: 0;
}
.schedule-panel input[type="date"],
.schedule-panel input[type="time"],
.schedule-panel select {
  min-width: 0;
  min-height: 40px;
  padding: 7px 9px;
  font-size: 14px;
}
.schedule-reminder-field {
  margin-top: 12px;
}
@media (max-width: 620px) {
  .schedule-date-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .schedule-date-row .editor-compact-input {
    width: calc(100% - 16px);
    justify-self: start;
  }
}
.editor-compact-input {
  width: 100%;
}
.editor-repeat-toggle {
  margin: 10px 0 0;
}
.field-label-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
}
.label-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--pf-green);
  font-weight: 900;
  font-size: 17px;
  line-height: 1;
  flex: 0 0 22px;
}
.bell-icon,
.repeat-icon {
  font-size: 18px;
}
.bell-icon {
  width: 20px;
  height: 20px;
}
.bell-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.bell-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.repeat-icon {
  width: 24px;
  height: 24px;
}
.repeat-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}
.repeat-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.repeat-interval-input {
  text-align: center;
}
.schedule-help {
  margin: 8px 0 0;
  font-size: 12px;
}
.task-reminder-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 5000;
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(31, 143, 95, 0.35);
  border-radius: 8px;
  background: #fff;
  color: var(--pf-ink);
  box-shadow: 0 10px 30px rgba(20, 31, 26, 0.2);
}
.task-reminder-toast span {
  color: var(--pf-muted);
  font-size: 13px;
}
.task-reminder-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--pf-muted);
  font-size: 22px;
}
.task-reminder-open {
  margin-top: 4px;
}
.editor-field label {
  margin-top: 12px;
}
.editor-compact-select {
  width: 100%;
}
.editor-place-select {
  width: min(100%, 66.666%);
}
.editor-file-input {
  display: none;
}
.editor-photo-button {
  min-height: 44px;
  margin-bottom: 8px;
}
.gps-accuracy-warning {
  background: #fff3e3;
  border-color: rgba(217,134,33,0.4);
  color: var(--pf-amber);
}
.gps-accuracy-info {
  background: #eef6fb;
  border-color: rgba(32,120,184,0.35);
  color: var(--pf-blue);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #fff;
  color: var(--pf-ink);
}
.leaflet-popup-content a { color: var(--pf-blue); }

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.panel-header h1 { margin-bottom: 0; }
.eyebrow {
  color: var(--pf-green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}
.panel-action {
  width: auto;
  min-width: 58px;
  min-height: 40px;
  padding: 8px 14px;
}
button.btn.place-add-action {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  justify-self: end;
  align-self: end;
  background: #eef7f2;
  color: var(--pf-green);
  border-color: rgba(31,143,95,0.24);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}
button.btn.place-add-action:active {
  transform: scale(0.96);
}

.tasks-place-bar {
  display: flex;
  align-items: flex-start;
  margin-bottom: 14px;
}
.tasks-place-switcher {
  min-width: 0;
}

.work-command {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #e9f0eb;
  border: 1px solid #d9e4dd;
}
.seg-btn {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.seg-btn.active {
  color: var(--pf-ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(20,31,26,0.08);
}
.work-search {
  min-height: 44px !important;
}
.work-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}
.task-bulk-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.mini-action.danger {
  color: var(--pf-red);
  border-color: rgba(220, 38, 38, 0.22);
  background: #fff7f6;
}
.property-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--pf-line);
  font-size: 13px;
  font-weight: 900;
}
.compact-select {
  min-height: 40px !important;
  font-size: 14px !important;
  padding: 8px 10px !important;
  width: 100%;
}
.work-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.work-stats div {
  background: #fff;
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  padding: 10px;
}
.work-stats strong {
  display: block;
  font-size: 20px;
  line-height: 1;
}
.work-stats span {
  color: var(--pf-muted);
  font-size: 11px;
  font-weight: 900;
}
.empty-state {
  border: 1px dashed rgba(31,143,95,0.32);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}
.empty-state p { margin-bottom: 0; }
.task-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  padding: 10px;
}
.task-row .bullet {
  --pin-size: 42px;
  --pin-border-width: 3px;
  font-size: 22px;
}
.task-row .title {
  color: var(--pf-ink);
  font-size: 16px;
  font-weight: 900;
  min-width: 0;
}
.task-row .meta {
  margin-top: 3px;
  color: var(--pf-muted);
  font-size: 12px;
  line-height: 1.3;
}
.schedule-line {
  margin-top: 3px;
  color: var(--pf-green);
  font-size: 12px;
  font-weight: 900;
}
.task-past-due .schedule-line {
  color: var(--pf-red);
}
.task-past-due {
  border-color: rgba(200,77,67,0.42);
}
.task-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.priority-chip {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 900;
  background: #eef4f0;
  color: var(--pf-muted);
}
.priority-high { background: #fff1ef; color: var(--pf-red); }
.priority-med { background: #fff3e3; color: var(--pf-amber); }
.priority-low { background: #eef6fb; color: var(--pf-blue); }
.task-row-actions {
  display: flex;
  gap: 6px;
}
.icon-row-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--pf-line);
  background: #fff;
  color: var(--pf-green);
  font-weight: 900;
}
.icon-row-btn.danger {
  color: var(--pf-red);
}

.property-hero {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--pf-line);
  border-radius: 8px;
}
.property-map-tile,
.place-row-map {
  border-radius: 8px;
}
.property-map-tile {
  position: relative;
  aspect-ratio: 1;
  min-height: 0;
}
.place-map-visual {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(255,255,255,0.78) 0 6px, transparent 7px),
    linear-gradient(135deg, rgba(31,143,95,0.34), rgba(32,120,184,0.22)),
    repeating-linear-gradient(45deg, #d7eadb 0 10px, #eef6ec 10px 20px);
}
.place-map-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.place-static-map-layer {
  position: absolute;
  inset: 0;
}
.place-map-tile-img {
  position: absolute;
  max-width: none;
  object-fit: cover;
}
.place-map-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.32) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.55;
}
.place-map-route {
  position: absolute;
  inset: 12% 10%;
  border-left: 4px solid rgba(255,255,255,0.58);
  border-bottom: 4px solid rgba(255,255,255,0.46);
  border-radius: 46% 30% 50% 36%;
  transform: rotate(-8deg);
}
.place-map-initial {
  position: absolute;
  right: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  color: var(--pf-green);
  font-size: 11px;
  font-weight: 900;
}
.place-map-pin {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50% 50% 50% 0;
  background: var(--pf-green);
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow: 0 2px 5px rgba(20,31,26,0.16);
  transform: translate(-50%, -70%) rotate(-45deg);
}
.place-map-pin.done {
  background: var(--pf-blue);
}
.boundary-chip {
  position: absolute;
  left: 8px;
  bottom: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  color: var(--pf-green);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 900;
}
.property-hero-body h2 {
  margin: 2px 0 2px;
  font-size: 22px;
}
.property-hero-body p { margin: 0 0 12px; }
.property-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.property-stats div {
  border-radius: 8px;
  background: #f4f8f5;
  padding: 8px;
}
.property-stats strong {
  display: block;
  line-height: 1;
}
.property-stats span {
  color: var(--pf-muted);
  font-size: 10px;
  font-weight: 900;
}
.places-list,
.settings-section {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.settings-section h2 {
  margin: 10px 0 2px;
  font-size: 18px;
}
.place-row,
.settings-row {
  width: 100%;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--pf-line);
  background: #fff;
  color: var(--pf-ink);
  text-align: left;
}
.place-row.active {
  border-color: rgba(31,143,95,0.76);
  border-width: 2px;
  box-shadow: 0 8px 26px rgba(31, 143, 95, 0.13);
}
.place-row-map {
  width: 54px;
  height: 54px;
  align-self: center;
}
.place-row-main strong,
.place-row-main span {
  display: block;
}
.place-row-main span {
  color: var(--pf-muted);
  margin-top: 2px;
  font-size: 12px;
}
.place-row-go {
  border-radius: 999px;
  background: #eef7f2;
  color: var(--pf-green);
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 900;
}
.active-view-pill {
  border-radius: 999px;
  background: #e8f5ee;
  color: var(--pf-green);
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}
.settings-row {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 52px;
  font-weight: 800;
}
.settings-row.danger { color: var(--pf-red); }
.auth-modal {
  max-width: 430px;
}
.auth-required-bg {
  align-items: center;
}
.auth-required-bg .auth-modal {
  margin-top: 0;
}
.auth-form {
  gap: 8px;
}
.auth-brand {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 4px;
}
.auth-logo {
  width: 58px;
  height: 58px;
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(31, 143, 95, 0.16);
}
.auth-brand span {
  display: block;
  color: var(--pf-green);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.auth-brand h2 {
  margin: 0;
  font-size: 31px;
  line-height: 1.05;
}
.auth-mode-title {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}
.auth-form input {
  width: 100%;
}
.auth-actions {
  margin-top: 10px;
}
.auth-error {
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 800;
}
.account-card {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  background: #fff;
}
.account-card strong,
.account-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.account-card span {
  color: var(--pf-muted);
  font-size: 13px;
}
.people-list,
.assignee-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  background: #fff;
}
.people-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.people-invite-status {
  margin: 0;
  padding: 10px;
  border: 1px dashed rgba(31, 143, 95, 0.35);
  border-radius: 8px;
  background: #f1fbf6;
  overflow-wrap: anywhere;
}
.invite-link-copy {
  display: grid;
  gap: 4px;
}
.invite-link-text {
  color: var(--pf-ink);
  font-size: 13px;
}
.invite-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.people-invite-status.error {
  border-color: rgba(220, 38, 38, 0.28);
  background: #fef2f2;
  color: #991b1b;
  font-weight: 800;
}
.share-mode-modal {
  max-width: 430px;
}
.share-mode-options {
  display: grid;
  gap: 8px;
  margin: 8px 0 14px;
}
.share-mode-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  background: #fff;
}
.share-mode-option input {
  width: auto;
  min-height: auto;
  margin-top: 2px;
}
.share-mode-option strong,
.share-mode-option small {
  display: block;
}
.share-mode-option small {
  margin-top: 3px;
  color: var(--pf-muted);
  font-size: 12px;
  line-height: 1.35;
}
.people-row,
.assignee-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
}
.assignee-option {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.assignee-option input {
  width: auto;
  min-height: auto;
}
.people-row small,
.assignee-option small {
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 800;
}
.people-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.people-row-actions .mini-action {
  min-height: 32px;
  padding: 6px 9px;
}
.assignee-summary {
  font-weight: 800;
}
.assignee-list {
  display: grid;
  gap: 4px;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--pf-line);
}
.guidance-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
}
.guidance-actions .toggle-row {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}
.guidance-actions .show-tips-action {
  flex: 0 0 auto;
  min-height: 50px;
  border-radius: 8px !important;
  background: #fff;
  color: var(--pf-green);
  border-color: var(--pf-line);
  padding: 10px 12px;
  font-size: 14px;
  white-space: nowrap;
}
.guidance-actions + .muted {
  margin-top: 6px;
}
.settings-section > .toggle-row + .muted,
.settings-section > .guidance-actions + .muted {
  margin-top: 4px;
}
.settings-section > .muted {
  margin-bottom: 8px;
}
.storage-line {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--pf-line);
}

.toast {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: min(calc(100vw - 24px), 420px);
  padding: 10px 12px;
  border-radius: 8px;
}
.toast-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef7f2;
}
.toast-copy strong,
.toast-copy small {
  display: block;
}
.toast-copy small {
  color: var(--pf-muted);
  margin-top: 1px;
}
.toast-undo {
  border: 0;
  background: transparent;
  color: var(--pf-blue);
  font-weight: 900;
}

/* Pinfield popup redesign */
.leaflet-popup-content {
  margin: 12px;
}
.pinfield-task-popup.leaflet-popup {
  margin-bottom: 22px !important;
  z-index: 650;
}
.pinfield-task-popup .leaflet-popup-content-wrapper {
  border-radius: 10px;
}
.pinfield-task-popup .leaflet-popup-content {
  width: min(264px, calc(100vw - 148px)) !important;
}
.pinfield-task-popup .leaflet-popup-tip-container {
  display: none;
}
.pin-popup {
  min-width: 0;
  color: var(--pf-ink);
}
.popup-top {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
}
.popup-photos {
  display: block;
  margin: 0;
}
.popup-photo-container {
  display: block;
}
.popup-thumb-button {
  position: relative;
  width: 104px;
  height: 104px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  display: block;
  overflow: hidden;
  touch-action: pan-y;
}
.popup-thumb {
  width: 104px;
  height: 104px;
  max-height: none;
  object-fit: cover;
  border-radius: 8px;
}
.popup-photos:has(img + img) .popup-thumb {
  width: 64px;
  height: 64px;
  max-height: none;
}
.popup-photo-count {
  position: absolute;
  right: 6px;
  bottom: 6px;
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}
.popup-photo-empty {
  width: 104px;
  height: 104px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef4f0;
  color: var(--pf-muted);
  font-weight: 800;
  font-size: 12px;
}
.popup-photo-hint {
  margin-top: 5px;
  text-align: left;
  color: var(--pf-muted);
  font-size: 12px;
  font-style: normal;
}
.popup-summary {
  display: grid;
  gap: 8px;
  align-content: start;
}
.popup-status {
  width: fit-content;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 900;
}
.popup-status.done {
  background: #eef7f2;
  color: var(--pf-green);
}
.popup-status.open {
  background: #eef6fb;
  color: var(--pf-blue);
}
.popup-summary-row {
  display: grid;
  gap: 2px;
}
.popup-summary-row span {
  color: var(--pf-muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.popup-summary-row strong {
  font-size: 14px;
}
.popup-move-hint {
  margin-top: 2px;
  border-radius: 8px;
  background: #fff3e3;
  color: var(--pf-amber);
  padding: 8px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}
.startup-tip-shell {
  position: fixed;
  inset: 0;
  z-index: 2800;
  display: grid;
  place-items: center;
  padding: 18px;
  pointer-events: auto;
}
.startup-tip {
  position: relative;
  width: min(292px, calc(100vw - 36px));
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(16, 36, 28, 0.18);
  background: rgba(255,255,255,0.98);
  color: var(--pf-ink);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.startup-tip-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--pf-muted);
  font-size: 20px;
  line-height: 1;
}
.startup-tip-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 28px;
}
.startup-tip-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(42, 116, 75, 0.2);
  border-radius: 50%;
  background: #eef8f1;
  color: var(--pf-green);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}
.startup-tip-title {
  min-width: 0;
}
.startup-tip-kicker {
  color: var(--pf-green);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.startup-tip strong {
  display: block;
  margin-top: 2px;
  font-size: 17px;
  line-height: 1.15;
}
.startup-tip p {
  margin: 8px 0 10px;
  color: var(--pf-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.startup-tip-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.startup-tip-actions .btn {
  width: 100%;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
}
.startup-tip-disable {
  width: 100%;
  min-height: 28px;
  margin-top: 7px;
  border: 1px solid var(--pf-line);
  border-radius: 7px;
  background: #fff;
  color: var(--pf-muted);
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
}
.popup-title {
  max-width: none;
  margin: 0 0 7px;
  color: var(--pf-ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.05;
}
.popup-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  color: var(--pf-ink);
  border: 1px solid var(--pf-line);
  border-radius: 999px;
  padding: 6px 9px;
  background: #fff;
  font-size: 14px;
  font-weight: 800;
}
.popup-cat-pin,
.dropdown-pin,
.map-filter-pin {
  --pin-size: 22px;
  --pin-border-width: 2px;
  flex: 0 0 auto;
  font-size: 13px;
}
.popup-priority {
  display: inline-flex;
  width: fit-content;
  font-size: 13px;
  font-weight: 900;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef4f0;
}
.popup-priority-high {
  color: var(--pf-red);
  border: 1px solid rgba(200,77,67,0.3);
  background: #fff1ef;
}
.popup-priority-med {
  color: var(--pf-amber);
  border: 1px solid rgba(217,134,33,0.35);
  background: #fff3e3;
}
.popup-priority-low {
  color: var(--pf-blue);
  border: 1px solid rgba(32,120,184,0.32);
  background: #eef6fb;
}
.popup-notes {
  margin-top: 10px;
  color: var(--pf-ink);
  font-size: 15px;
}
.popup-schedule {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #eef7f2;
  color: var(--pf-green);
  font-size: 13px;
  font-weight: 900;
}
.popup-schedule.past-due {
  background: #fff1ef;
  color: var(--pf-red);
}
.popup-schedule div + div {
  margin-top: 3px;
}
.popup-info {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--pf-line);
  color: var(--pf-muted);
  opacity: 1;
  font-size: 13px;
}
.popup-distance {
  margin-bottom: 6px;
}
.popup-time-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 9px;
  align-items: baseline;
}
.popup-time-grid span {
  color: var(--pf-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.popup-time-grid strong {
  color: var(--pf-muted);
  font-size: 13px;
  font-weight: 800;
}
.popup-info-done {
  color: var(--pf-green);
}
.popup-actions {
  gap: 8px;
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}
.popup-actions .btn {
  min-height: 40px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}
.popup-footer {
  margin-top: 8px;
  font-size: 14px;
}
.popup-link {
  color: var(--pf-blue);
  font-weight: 700;
}

.hidden { display: none !important; }

.location-menu,
.map-search-panel {
  position: fixed;
  z-index: 900;
  left: 12px;
  right: 12px;
  top: calc(76px + env(safe-area-inset-top, 0));
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.86);
  background: rgba(255,255,255,0.96);
  box-shadow: var(--pf-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.location-menu {
  top: auto;
  left: auto;
  right: 12px;
  bottom: calc(138px + env(safe-area-inset-bottom));
  width: min(320px, calc(100vw - 24px));
  padding: 8px;
}
.location-option,
.location-add {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pf-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 8px 10px;
  text-align: left;
  font-weight: 900;
}
.location-option.active {
  background: #eef7f2;
  color: var(--pf-green);
}
.location-option span {
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 800;
}
.location-add {
  color: var(--pf-blue);
  border-top: 1px solid var(--pf-line);
  border-radius: 0;
}
.muted-option {
  color: var(--pf-muted);
}
.map-search-panel {
  padding: 10px;
}
.search-panel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}
#map-search-input {
  min-height: 42px;
  font-size: 16px;
}
#map-search-close {
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  background: #fff;
  color: var(--pf-muted);
  font-size: 24px;
}
.map-search-results {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: var(--pf-muted);
  font-weight: 800;
}
.map-search-result {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  background: #fff;
  color: var(--pf-ink);
  padding: 6px 8px;
  text-align: left;
}
.map-search-result span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef7f2;
}
.map-search-result strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-search-result small {
  color: var(--pf-muted);
  font-weight: 800;
}

.offline-pill {
  border: 1px solid rgba(255,255,255,0.86);
  cursor: pointer;
}
.fab {
  display: grid;
  place-items: center;
  color: #fff;
}
.fab-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}
.fab.fab-tertiary {
  color: var(--pf-blue);
  background: rgba(255,255,255,0.95);
}
.fab.fab-tertiary .fab-symbol {
  color: var(--pf-blue);
  border-radius: 8px;
  background: #eef6fb;
  font-size: 28px;
}
.fab.fab-secondary {
  color: var(--pf-green);
  background: rgba(255,255,255,0.95);
}
.fab:not(.fab-secondary):not(.fab-tertiary) .fab-symbol {
  color: #fff;
}
.quick-add-btn {
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.96) !important;
  color: var(--pf-ink);
}
.quick-add-symbol {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--pf-ink);
  background: transparent;
  border: 0;
  font-size: 26px;
  line-height: 1;
}
.quick-add-image {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  filter: grayscale(1) sepia(0.18) saturate(0.8) hue-rotate(84deg) contrast(0.95);
  opacity: 0.82;
  background: transparent;
}
#quick-add-wrap .fab-tertiary {
  position: static;
  width: 58px;
  height: 58px;
  min-height: 58px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(24, 33, 27, 0.1);
  background: rgba(255,255,255,0.96);
  box-shadow: 0 4px 12px rgba(20, 31, 26, 0.1);
}
#quick-add-wrap .fab-tertiary .fab-symbol {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(32,120,184,0.14);
  background: #eef6fb;
  font-size: 26px;
}

/* Smooth quick-add side rail */
#quick-add-wrap.quick-add-wrap {
  position: fixed;
  left: auto;
  right: 12px;
  top: calc(304px + env(safe-area-inset-top));
  bottom: calc(234px + env(safe-area-inset-bottom));
  width: 76px;
  z-index: 455;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}
.quick-dial-shell {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-height: 0;
  gap: 7px;
  padding: 8px 7px;
  border: 1px solid rgba(255,255,255,0.88);
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--pf-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.quick-dial-label {
  display: grid;
  gap: 1px;
  width: 100%;
  text-align: center;
  color: var(--pf-ink);
}
.quick-dial-label strong {
  font-size: 10px;
  line-height: 1.05;
}
.quick-dial-label span {
  display: none;
}
.quick-add-dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 0 4px;
  scroll-snap-type: y proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-y;
}
.quick-add-dial::-webkit-scrollbar {
  display: none;
}
.quick-dial-btn {
  flex: 0 0 56px;
  width: 58px;
  height: 56px;
  min-height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.96) !important;
  color: var(--pf-ink);
  box-shadow: 0 4px 12px rgba(20, 31, 26, 0.12);
  padding: 0;
  scroll-snap-align: center;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.quick-pin-preview {
  --pin-size: 42px;
  --pin-border-width: 3px;
  font-size: 24px;
  box-shadow: 0 2px 5px rgba(20,31,26,0.22);
}
.quick-dial-btn:active {
  transform: scale(0.94);
  box-shadow: 0 2px 8px rgba(20, 31, 26, 0.14);
}
.quick-dial-empty {
  border: 2px dashed rgba(31, 143, 95, 0.36);
  background: #f6fbf8 !important;
  color: var(--pf-green);
  box-shadow: none;
  align-content: center;
  gap: 0;
}
.quick-empty-plus {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}
.quick-empty-label {
  font-size: 9px;
  line-height: 1;
  font-weight: 900;
}
.quick-add-symbol,
.quick-add-image,
#quick-add-wrap .fab-tertiary .fab-symbol {
  width: 42px;
  height: 42px;
}
.quick-add-symbol {
  font-size: 24px;
  border-radius: 50%;
}
.quick-add-image { border-radius: 50%; }
.quick-dial-btn .quick-add-symbol,
.quick-dial-btn .quick-add-image,
.quick-dial-btn .quick-pin-preview {
  filter: none;
  opacity: 1;
}
#quick-add-wrap .fab-tertiary {
  position: fixed;
  left: 12px;
  bottom: calc(158px + env(safe-area-inset-bottom));
  width: 58px;
  height: 58px;
  min-height: 58px;
  border-radius: 50%;
  color: var(--pf-blue);
}
#quick-add-wrap .fab-tertiary .fab-symbol {
  font-size: 24px;
}
.quick-camera.fab-tertiary {
  position: fixed;
  left: auto;
  right: 21px;
  top: calc(162px + env(safe-area-inset-top));
  bottom: auto;
  transform: none;
  width: 58px;
  height: 58px;
  min-height: 58px;
  border-radius: 8px;
  color: var(--pf-blue);
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.86);
}
.quick-camera.fab-tertiary .fab-symbol {
  width: 46px;
  height: 46px;
  font-size: 32px;
}
.quick-camera.fab-tertiary:active {
  transform: scale(0.95);
}
.map-filter-button {
  position: fixed;
  left: auto;
  right: 21px;
  top: auto;
  bottom: calc(166px + env(safe-area-inset-bottom));
  z-index: 456;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  min-height: 58px;
  border-radius: 8px;
  color: var(--pf-green);
  font-size: 0;
}
.map-filter-button::before {
  content: "";
  width: 28px;
  height: 24px;
  background: currentColor;
  clip-path: polygon(4% 0, 96% 0, 62% 45%, 62% 100%, 38% 100%, 38% 45%);
}
.map-filter-button.active {
  background: #eef7f2;
  border-color: rgba(31,143,95,0.42);
}
.map-filter-button.active::after {
  content: attr(data-count);
  position: absolute;
  right: 7px;
  top: 7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--pf-green);
  color: #fff;
  border: 2px solid #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
.map-filter-panel {
  position: fixed;
  right: 94px;
  top: auto;
  bottom: calc(166px + env(safe-area-inset-bottom));
  z-index: 720;
  width: min(282px, calc(100vw - 118px));
  max-height: min(430px, calc(100dvh - 280px - env(safe-area-inset-bottom)));
  overflow-y: auto;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.88);
  border-radius: 8px;
  background: rgba(255,255,255,0.96);
  color: var(--pf-ink);
  box-shadow: var(--pf-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.map-filter-panel.hidden {
  display: none;
}
.map-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 8px;
}
.map-filter-head strong {
  font-size: 15px;
  font-weight: 900;
}
.map-filter-close {
  width: 30px;
  min-height: 30px;
  border: 1px solid var(--pf-line);
  border-radius: 50%;
  background: #fff;
  color: var(--pf-muted);
  font-size: 20px;
  line-height: 1;
}
.map-filter-row {
  display: grid;
  grid-template-columns: 22px 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 48px;
  margin: 0;
  padding: 7px 6px;
  border-top: 1px solid rgba(218, 228, 221, 0.72);
  color: var(--pf-ink);
  font-size: 14px;
  font-weight: 850;
  opacity: 1;
}
.map-filter-all {
  border-top: 0;
  border-radius: 8px;
  background: #eef7f2;
  color: var(--pf-green);
}
.map-filter-icon,
.map-filter-symbol {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef7f2;
  font-size: 20px;
  object-fit: cover;
}
body:not([data-active-tab="map"]) .map-filter-button,
body:not([data-active-tab="map"]) .map-filter-panel {
  display: none !important;
}
.quick-locate.fab-secondary {
  position: fixed;
  left: auto;
  right: 21px;
  top: auto;
  bottom: calc(98px + env(safe-area-inset-bottom));
  transform: none;
  width: 58px;
  height: 58px;
  min-height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pf-green);
  border: 2px solid rgba(255,255,255,0.88);
  box-shadow: var(--pf-shadow);
  color: #fff;
}
.quick-locate .locate-icon {
  width: 47px;
  height: 47px;
  overflow: visible;
}
.quick-locate .locate-pin {
  fill: #fff;
}
.quick-locate .locate-icon circle {
  fill: var(--pf-green);
}
.quick-locate .locate-rings {
  fill: none;
  stroke: rgba(255,255,255,0.76);
  stroke-width: 1.2;
  stroke-linecap: round;
}
.quick-locate.fab-secondary:active {
  transform: scale(0.95);
}
.quick-task-add.fab {
  left: auto;
  right: 21px;
  top: calc(230px + env(safe-area-inset-top));
  bottom: auto;
  transform: none;
  width: 58px;
  height: 58px;
  min-height: 58px;
  border-radius: 8px;
  z-index: 456;
}
.quick-task-add.fab:active {
  transform: scale(0.95);
}

.place-row {
  grid-template-columns: 54px minmax(0, 1fr) auto;
}
.place-row-actions {
  display: grid;
  gap: 6px;
}
.mini-action {
  border: 1px solid var(--pf-line);
  border-radius: 999px;
  background: #eef7f2;
  color: var(--pf-green);
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 900;
}
.mini-action.current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mini-action.danger {
  background: #fff1ef;
  color: var(--pf-red);
}
.places-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2400;
  background: rgba(24, 33, 27, 0.22);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px calc(84px + env(safe-area-inset-bottom));
}
.places-popup {
  width: min(460px, 100%);
  max-height: min(72dvh, 620px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.97);
  color: var(--pf-ink);
  box-shadow: var(--pf-shadow);
}
.places-popup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.places-popup-head h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1;
}
.places-popup-count {
  display: block;
  margin-top: 4px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 800;
}
.places-popup-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--pf-line);
  border-radius: 50%;
  background: #f7faf6;
  color: var(--pf-ink);
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
}
.places-popup-list {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
}
.places-popup-row {
  margin: 0;
  cursor: pointer;
  align-items: center;
}
.places-popup-row .place-row-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: center;
}
.places-popup-add {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
}
.location-modal {
  max-width: 420px;
}
.location-image-preview {
  width: min(100%, 320px);
  aspect-ratio: 1;
  margin: 8px auto 0;
}
.location-preview-tile {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 1px solid var(--pf-line);
}
.location-preview-map {
  overflow: hidden;
  background: #dce9df;
}
.location-image-help {
  margin: 14px 0 8px;
  color: var(--pf-muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.32;
}
.location-image-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}
.location-image-actions .mini-action {
  width: 100%;
  min-height: 46px;
  font-size: 13px;
  border-radius: 999px;
}
.location-image-actions .mini-action.selected {
  background: var(--pf-green);
  border-color: var(--pf-green);
  color: #fff;
  box-shadow: 0 8px 20px rgba(31, 143, 95, 0.16);
}
.location-name-input {
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  background: #f8fbf9;
  color: var(--pf-ink);
  font-size: 18px;
  font-weight: 700;
}
.location-name-input:focus {
  outline: 2px solid rgba(43, 145, 93, 0.22);
  border-color: rgba(43, 145, 93, 0.55);
}
.modal-error {
  margin: 8px 0 0;
  color: var(--pf-red);
  font-weight: 800;
}
.location-modal-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.assignment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.assignment-preview span {
  border-radius: 999px;
  background: #eef7f2;
  color: var(--pf-green);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 900;
}
.category-manager {
  display: grid;
  gap: 10px;
}
.category-manager-onboarding {
  padding: 12px;
  border: 1px solid rgba(31, 143, 95, 0.25);
  border-radius: 8px;
  background: #f6fbf8;
  box-shadow: inset 4px 0 0 var(--pf-green), 0 8px 22px rgba(31, 143, 95, 0.08);
}
.category-manager .cat-list {
  margin-top: 0;
}
.category-onboarding {
  padding: 14px;
  border: 1px solid rgba(245, 158, 11, 0.48);
  border-radius: 8px;
  background: #fff7ed;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.12);
}
.category-onboarding strong {
  display: block;
  margin: 0 0 5px;
  color: #9a3412;
}
.category-onboarding p {
  margin: 0;
  color: #7c2d12;
  font-weight: 750;
}
.category-title-row {
  margin-bottom: 0;
}
.category-title-row .category-add-top {
  width: auto;
  min-width: min(100%, 270px);
  min-height: 44px;
  padding: 8px 16px;
  font-size: 14px;
}
.category-title-row h2 {
  margin: 0;
}
.category-add-top {
  width: auto;
  min-height: 40px;
  padding: 8px 12px;
  white-space: nowrap;
}
.emoji-preset-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.emoji-preset {
  min-height: 42px;
  width: auto;
  padding: 6px;
  font-size: 22px;
}
.category-edit-top {
  display: grid;
  grid-template-columns: minmax(88px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}
.category-edit-top label,
.category-color-card,
.category-image-label {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  color: var(--pf-muted);
  font-size: 14px;
  font-weight: 800;
  opacity: 1;
}
.category-emoji-input,
.category-name-input {
  width: 100%;
  min-height: 50px;
  margin: 0;
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  background: #f8fbf9;
  color: var(--pf-ink);
  font-weight: 800;
}
.category-emoji-input {
  text-align: center;
  font-size: 24px;
}
.category-name-input {
  padding: 0 12px;
  font-size: 18px;
}
.category-color-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.category-color-card {
  min-width: 0;
}
.category-color-title {
  color: var(--pf-ink);
  font-size: 15px;
  line-height: 1.1;
}
.category-color-hint {
  min-height: 28px;
  color: var(--pf-muted);
  font-size: 11px;
  line-height: 1.2;
}
input.category-color-input {
  width: 100%;
  height: 58px;
  padding: 4px;
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  background: #f8fbf9;
}
.category-image-actions {
  margin-top: 10px;
  align-items: center;
}
