/* ————————————————————————————————————————————
   PRIVY · the map app
   ———————————————————————————————————————————— */

html, body { height: 100%; overflow: hidden; }
body { display: flex; flex-direction: column; }

/* ————— top bar ————— */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 20px;
  background: var(--porcelain);
  flex: 0 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--pine);
  flex: 0 0 auto;
}
.brand-mark { color: var(--tile); display: grid; place-items: center; }
.brand-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -.01em;
  font-variation-settings: "opsz" 60;
  margin: 0;
  white-space: nowrap;
}

.searchbox {
  position: relative;
  flex: 1 1 auto;
  max-width: 540px;
  display: flex;
  align-items: center;
}
.searchbox-icon {
  position: absolute;
  left: 15px;
  color: var(--pine-soft);
  opacity: .65;
  pointer-events: none;
}
.searchbox input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--pine);
  background: #FFFDF7;
  border: 2px solid var(--pine);
  border-radius: 999px;
  padding: 11px 40px 11px 42px;
  outline: none;
  transition: box-shadow .15s ease;
}
.searchbox input:focus { box-shadow: 0 3px 0 var(--pine); }
.searchbox input::placeholder { color: #8B937F; }
.searchbox-clear {
  position: absolute;
  right: 10px;
  border: 0;
  background: var(--porcelain-deep);
  color: var(--pine);
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #FFFDF7;
  border: 2px solid var(--pine);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  z-index: 1200;
  max-height: 420px;
  overflow-y: auto;
}
.search-group {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brass);
  padding: 10px 16px 4px;
}
.search-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--pine);
  padding: 9px 16px;
  cursor: pointer;
}
.search-item strong { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item .sub { color: #5E6756; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item .dist {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--tile-green);
  white-space: nowrap;
}
.search-item:hover, .search-item.hl { background: var(--tile-wash); }
.search-empty { padding: 14px 16px; font-size: 14px; color: #5E6756; }
.search-add {
  border-top: 1.5px dashed var(--porcelain-dim) !important;
  color: var(--tile);
  align-items: center;
}
.search-add strong { font-weight: 700; }
.search-add-icon { font-size: 15px; }
.search-add:hover, .search-add.hl { background: var(--tile-wash); }

.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: 0 0 auto; }

/* logged-out: a prominent "Join" invite next to a quieter "Sign in" */
.auth-cta { display: flex; align-items: center; gap: 8px; }
.auth-signin { border-color: transparent; background: transparent; padding-left: 12px; padding-right: 12px; }
.auth-signin:hover { box-shadow: none; background: var(--porcelain-deep); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--pine);
  background: var(--porcelain);
  border-radius: 999px;
  padding: 5px 14px 5px 6px;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--pine);
  cursor: pointer;
  font-family: var(--font-body);
}
.user-chip:hover { background: var(--porcelain-deep); }
.user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--tile);
  color: var(--porcelain);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
}
.user-menu {
  position: absolute;
  top: 54px;
  right: 20px;
  background: #FFFDF7;
  border: 2px solid var(--pine);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  z-index: 1300;
  min-width: 170px;
  overflow: hidden;
}
.user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 16px;
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--pine);
  cursor: pointer;
}
.user-menu button:hover { background: var(--terra-wash); color: var(--terra); }
.user-menu .menu-note { padding: 10px 16px 6px; font-size: 12px; color: #5E6756; border-bottom: 1px solid var(--porcelain-deep); }
.menu-stats {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 16px 10px;
  border-bottom: 1px solid var(--porcelain-deep);
}
.menu-stat { font-size: 12.5px; color: var(--pine-soft); display: flex; align-items: baseline; gap: 7px; }
.menu-stat b { color: var(--pine); }
.menu-stat-icon { width: 16px; text-align: center; }
.menu-stat-empty { color: #5E6756; font-style: italic; }
.menu-stats-loading { color: var(--porcelain-dim); }
.user-menu button.menu-danger { color: var(--terra); border-top: 1px solid var(--porcelain-deep); }

/* delete-account confirmation */
.delete-facts { list-style: none; padding: 0; margin: 2px 0 18px; display: flex; flex-direction: column; gap: 11px; }
.delete-facts li { display: flex; gap: 10px; font-size: 14px; line-height: 1.5; color: #22352E; }
.delete-facts li b { color: var(--pine); }
.delete-fact-icon { flex: 0 0 auto; font-size: 16px; line-height: 1.4; }
.delete-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.btn-danger { background: var(--terra); color: #fff; }
.btn-danger:hover { background: #9A4225; }
.btn-danger:disabled { opacity: .6; cursor: default; }

/* ————— layout ————— */

.app-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.panel {
  position: relative;
  width: 408px;
  flex: 0 0 auto;
  background: var(--porcelain);
  border-right: 2px solid var(--pine);
  overflow: hidden;
}

.panel-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--porcelain);
}
.slide-view {
  z-index: 5;
  animation: slideIn .22s cubic-bezier(.2,.8,.3,1);
  overflow-y: auto;
}
@keyframes slideIn {
  from { transform: translateX(26px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 16px 10px;
  flex: 0 0 auto;
}
.chip {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--pine);
  background: var(--porcelain-deep);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.chip:hover { border-color: var(--pine); }
.chip.active { background: var(--pine); color: var(--porcelain); }

.list-head {
  padding: 2px 20px 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #5E6756;
  text-transform: uppercase;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sort-toggle {
  display: flex;
  gap: 2px;
  background: var(--porcelain-deep);
  border-radius: 999px;
  padding: 3px;
}
.sort-toggle button {
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--pine-soft);
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.sort-toggle button.active { background: var(--pine); color: var(--porcelain); }

/* ————— result cards ————— */

.list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 2px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  background: #FFFDF7;
  border: 2px solid var(--porcelain-dim);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.card:hover { border-color: var(--pine); transform: translateY(-1px); box-shadow: var(--shadow-card); }
.card.selected { border-color: var(--tile); box-shadow: 0 0 0 2px var(--tile-wash), var(--shadow-card); }

.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card-name {
  font-family: var(--font-display);
  font-weight: 640;
  font-variation-settings: "opsz" 30;
  font-size: 17.5px;
  line-height: 1.2;
  margin: 0;
}
.card-dist { font-size: 12.5px; font-weight: 700; color: var(--brass); white-space: nowrap; }
.card-fav { color: var(--brass-bright); margin-right: 5px; font-size: 13px; }
.btn-fav-on { background: var(--brass-wash); border-color: var(--brass); color: #6F5314; }
.card-addr {
  font-size: 13px;
  color: #5E6756;
  margin: 3px 0 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-updated { font-size: 12px; color: #6E7663; white-space: nowrap; }


/* loading skeletons — shown until the first list render */
.skel-card {
  background: #FFFDF7;
  border: 2px solid var(--porcelain-dim);
  border-radius: var(--radius);
  padding: 16px;
}
.skel {
  background: linear-gradient(90deg, var(--porcelain-deep) 25%, var(--porcelain) 50%, var(--porcelain-deep) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-title { height: 17px; width: 65%; margin-bottom: 9px; }
.skel-sub { height: 12px; width: 45%; margin-bottom: 12px; }
.skel-tags { height: 20px; width: 80%; }

/* founder callout — shown when the map is far from any known privy */
.founder {
  border: 2px dashed var(--tile);
  border-radius: var(--radius);
  background: var(--tile-wash);
  padding: 18px 18px 16px;
  text-align: center;
}
.founder-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--tile);
  margin: 0 0 6px;
}
.founder-sub {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--pine-soft);
  margin: 0 0 12px;
}

/* empty state */
.empty {
  text-align: center;
  padding: 52px 30px;
  color: #5E6756;
}
.empty .empty-mark {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--porcelain-dim);
  border: 3px solid var(--porcelain-dim);
  border-radius: 50%;
  width: 74px; height: 74px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}
.empty p { margin: 4px 0; font-size: 14.5px; }
.empty .btn { margin-top: 14px; }

/* ————— detail view ————— */

.detail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 0;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--pine-soft);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}
.back-btn:hover { background: var(--porcelain-deep); }

.detail-body { padding: 6px 22px 28px; }

.detail-name {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 50;
  font-weight: 700;
  font-size: 27px;
  line-height: 1.12;
  margin: 8px 0 6px;
  letter-spacing: -.01em;
}
.detail-address { font-size: 14px; color: #5E6756; margin: 0 0 12px; }
.dir-link {
  color: var(--tile);
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.dir-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.detail-hours {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brass);
  margin: -8px 0 12px;
}

/* roll rating */
.roll-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 12px 0 0;
}
.rolls { display: flex; gap: 2px; }
.roll {
  border: 0;
  background: none;
  font-size: 19px;
  line-height: 1;
  padding: 4px 5px;
  border-radius: 9px;
  cursor: pointer;
  filter: grayscale(1);
  opacity: .3;
  transition: all .12s ease;
}
.roll.filled {
  filter: none;
  opacity: 1;
  background: var(--tile-wash);
  box-shadow: inset 0 0 0 1.5px var(--tile);
}
.roll:hover { transform: scale(1.15) rotate(-8deg); filter: none; opacity: 1; }
.roll-meta { font-size: 13px; color: #5E6756; }
.roll-meta b { color: var(--pine); font-size: 14px; }

/* the code block — keypad styling */
.code-block {
  margin: 16px 0;
  padding: 16px 18px;
  background: var(--pine);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.code-block::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: repeating-conic-gradient(var(--brass-bright) 0% 25%, transparent 0% 50%);
  background-size: 12px 12px;
  opacity: .9;
}
.code-copy {
  position: absolute;
  top: 14px; right: 14px;
  border: 1.5px solid var(--brass-bright);
  background: transparent;
  color: var(--brass-bright);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 5px 11px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.code-copy:hover { background: var(--brass-bright); color: var(--pine); }

.code-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brass-bright);
  margin: 2px 0 10px;
}
.keycaps { display: flex; gap: 7px; flex-wrap: wrap; }
.keycap {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--pine);
  background: var(--porcelain);
  border-radius: 8px;
  min-width: 40px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  box-shadow: 0 3px 0 #0A1F19, inset 0 -2px 0 rgba(18,49,40,.18);
}
.code-hint { font-size: 12.5px; color: #A8BFB2; margin: 10px 0 0; }

/* entry callout for key / ask / open */
.entry-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 2px dashed var(--brass);
  background: var(--brass-wash);
  font-size: 14.5px;
  line-height: 1.45;
}
.entry-callout.open-callout { border-color: var(--tile); background: var(--tile-wash); }
.entry-callout .callout-icon { font-size: 20px; line-height: 1.2; }
.entry-callout strong { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }

.detail-notes { font-size: 14.5px; line-height: 1.55; color: var(--pine-soft); margin: 14px 0; }

/* photo strip */
.photo-strip {
  display: flex;
  gap: 8px;
  margin: 14px 0 4px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.photo-thumb {
  flex: 0 0 auto;
  width: 86px; height: 86px;
  border: 2px solid var(--porcelain-dim);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--porcelain-deep);
  transition: border-color .12s ease, transform .12s ease;
}
.photo-thumb:hover { border-color: var(--tile); transform: translateY(-2px); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-add {
  flex: 0 0 auto;
  width: 86px; height: 86px;
  border: 2px dashed var(--porcelain-dim);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: #6E7663;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  padding: 6px;
  transition: border-color .12s ease, color .12s ease;
}
.photo-add:hover { border-color: var(--brass); color: var(--brass); }
.photo-add-icon { font-size: 20px; }

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(18, 49, 40, .82);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px;
  animation: fadeIn .18s ease;
  cursor: zoom-out;
}
@keyframes fadeIn { from { opacity: 0; } }
.lightbox img {
  max-width: min(92vw, 900px);
  max-height: 78vh;
  border-radius: 14px;
  border: 3px solid var(--porcelain);
  box-shadow: var(--shadow-pop);
}
.lightbox-meta {
  color: var(--porcelain);
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: default;
}
.lightbox-del {
  border: 1.5px solid var(--terra);
  background: none;
  color: #F0A88F;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
}
.lightbox-del:hover { background: var(--terra); color: var(--porcelain); }

.stale-banner {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--terra-wash);
  border: 2px solid var(--terra);
  color: #94411F;
  font-size: 13.5px;
  line-height: 1.45;
}
.stale-banner span { font-size: 17px; line-height: 1.2; }
.stale-banner strong { color: #94411F; }

.btn-flag { border-color: var(--terra); color: var(--terra); }
.btn-flag:hover { box-shadow: 0 3px 0 var(--terra); background: var(--terra-wash); }

.detail-actions { display: flex; gap: 9px; margin: 18px 0 0; flex-wrap: wrap; }
.detail-actions .btn { font-size: 14px; padding: 9px 16px; }

.detail-actions-minor { display: flex; gap: 7px; margin: 10px 0 6px; flex-wrap: wrap; }
.mini-btn {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--pine-soft);
  background: none;
  border: 1.5px solid var(--porcelain-dim);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.mini-btn:hover { border-color: var(--pine); color: var(--pine); background: #FFFDF7; }
.mini-btn-on { border-color: var(--brass); color: #6F5314; background: var(--brass-wash); }

.meta-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px solid var(--porcelain-deep);
  font-size: 13px;
  color: #5E6756;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.meta-block b { color: var(--pine-soft); font-weight: 700; }
.verify-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--tile-wash);
  color: var(--tile);
  font-weight: 800;
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 11px;
  width: fit-content;
}

.history { margin-top: 16px; }
.history summary {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--pine-soft);
  cursor: pointer;
  padding: 6px 0;
}
.history-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  font-size: 13.5px;
  color: var(--pine-soft);
  border-bottom: 1px dashed var(--porcelain-dim);
}
.history-item .when { color: #6E7663; margin-left: auto; white-space: nowrap; font-size: 12.5px; }
.history-item .who { font-weight: 700; }

/* ————— form view ————— */

.form-body { padding: 6px 22px 30px; display: flex; flex-direction: column; gap: 16px; }
.form-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  margin: 8px 0 0;
}
.form-sub { font-size: 13.5px; color: #5E6756; margin: -8px 0 0; }

.seg {
  display: flex;
  background: var(--porcelain-deep);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
.seg-btn {
  flex: 1;
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--pine-soft);
  padding: 8px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s ease;
  white-space: nowrap;
}
.seg-btn.active { background: var(--pine); color: var(--porcelain); }

.checkrow { display: flex; flex-direction: column; gap: 10px; }
.checkrow label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--pine);
  cursor: pointer;
}
.checkrow input[type="checkbox"] {
  appearance: none;
  width: 22px; height: 22px;
  border: 2px solid var(--pine);
  border-radius: 6px;
  background: #FFFDF7;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.checkrow input[type="checkbox"]:checked { background: var(--tile); border-color: var(--tile); }
.checkrow input[type="checkbox"]:checked::after {
  content: "✓";
  color: var(--porcelain);
  font-size: 14px;
  font-weight: 800;
}

.code-input input {
  font-family: var(--font-mono);
  font-size: 20px;
  letter-spacing: .3em;
}

.form-error { color: var(--terra); font-size: 13.5px; font-weight: 600; margin: 0; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.btn-full { width: 100%; justify-content: center; }

.pin-note {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--tile-wash);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tile);
}

/* ————— profile view ————— */

.profile-body { padding: 10px 22px 30px; display: flex; flex-direction: column; gap: 18px; }

.profile-id { display: flex; align-items: center; gap: 14px; }
.profile-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--tile);
  color: var(--porcelain);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  text-transform: uppercase;
  flex: 0 0 auto;
}
.profile-name { font-family: var(--font-display); font-weight: 700; font-size: 25px; margin: 0; line-height: 1.1; }
.profile-since { font-size: 13px; color: #5E6756; margin: 3px 0 0; }

/* headline: what the community gave back */
.profile-headline {
  display: flex; align-items: center; gap: 14px;
  background: var(--tile-wash);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.ph-num { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; color: var(--tile); flex: 0 0 auto; }
.ph-label { font-size: 13.5px; font-weight: 600; color: var(--pine-soft); line-height: 1.4; }

.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pstat {
  background: #FFFDF7;
  border: 2px solid var(--porcelain-dim);
  border-radius: var(--radius-sm);
  padding: 11px 8px;
  text-align: center;
}
.pstat b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--pine); }
.pstat span { font-size: 11.5px; font-weight: 600; color: #5E6756; }

.profile-h {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--pine-soft);
  margin: 4px 0 -6px;
  display: flex; align-items: center; gap: 8px;
}
.profile-h-count {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--porcelain-deep);
  color: var(--pine);
  border-radius: 999px;
  padding: 1px 8px;
  letter-spacing: 0;
}

.profile-spots { display: flex; flex-direction: column; gap: 7px; }
.pspot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left;
  background: #FFFDF7;
  border: 2px solid var(--porcelain-dim);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color .12s ease, transform .12s ease;
}
.pspot:hover { border-color: var(--pine); transform: translateY(-1px); }
.pspot-name { font-weight: 700; font-size: 14.5px; color: var(--pine); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pspot-nums { display: flex; gap: 9px; flex: 0 0 auto; }
.pspot-num { font-size: 12.5px; font-weight: 700; color: var(--tile); white-space: nowrap; }
.profile-empty { font-size: 13.5px; color: #5E6756; font-style: italic; margin: 0; }

.profile-pw { display: flex; flex-direction: column; gap: 12px; }
.form-ok { color: var(--tile); font-size: 13px; font-weight: 600; margin: 0; }

.profile-account {
  display: flex; gap: 10px;
  margin-top: 4px; padding-top: 16px;
  border-top: 2px solid var(--porcelain-deep);
}
.profile-account .btn { flex: 1; justify-content: center; }

/* ————— map ————— */

.map-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
#map { position: absolute; inset: 0; background: #E8E4D8; }
#map.placing { cursor: crosshair; }

/* leaflet chrome */
.leaflet-control-zoom { border: 2px solid var(--pine) !important; border-radius: 10px !important; overflow: hidden; box-shadow: var(--shadow-card) !important; }
.leaflet-control-zoom a {
  background: var(--porcelain) !important;
  color: var(--pine) !important;
  font-weight: 700;
  border-bottom: 1px solid var(--porcelain-dim) !important;
}
.leaflet-control-zoom a:hover { background: var(--porcelain-deep) !important; }
.leaflet-control-attribution {
  background: rgba(246, 241, 229, .85) !important;
  color: #5E6756 !important;
  font-family: var(--font-body) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--tile) !important; }

/* custom pins */
.pin { filter: drop-shadow(0 3px 3px rgba(18,49,40,.35)); transition: transform .15s cubic-bezier(.2,.8,.3,1); transform-origin: 50% 100%; }
.pin-inner {
  width: 34px; height: 34px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--tile);
  border: 2.5px solid var(--porcelain);
  display: grid;
  place-items: center;
}
.pin-customers .pin-inner { background: var(--brass); }
.pin-glyph {
  transform: rotate(45deg);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12.5px;
  color: var(--porcelain);
  letter-spacing: 0;
}
.pin-badge {
  position: absolute;
  right: -5px; top: -7px;
  width: 16px; height: 16px;
  background: var(--porcelain);
  border: 2px solid var(--pine);
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.pin-badge svg { display: block; }
.pin-badge-shaky {
  background: var(--terra);
  border-color: var(--porcelain);
  color: var(--porcelain);
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
}
.pin.pin-selected { transform: scale(1.3); z-index: 1000 !important; }
.pin.pin-dim { opacity: .25; filter: none; }

.pin-temp .pin-inner { background: var(--terra); animation: pinDrop .3s cubic-bezier(.2,.8,.3,1); }
@keyframes pinDrop { from { transform: rotate(-45deg) scale(.4); } to { transform: rotate(-45deg) scale(1); } }

.pin-tip {
  background: var(--pine) !important;
  color: var(--porcelain) !important;
  border: 0 !important;
  border-radius: 8px !important;
  font-family: var(--font-body) !important;
  font-weight: 700 !important;
  font-size: 12.5px !important;
  padding: 5px 10px !important;
  box-shadow: var(--shadow-card) !important;
}
.pin-tip::before { display: none; }

.me-dot {
  width: 16px; height: 16px;
  background: #2C6FB0;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(44,111,176,.35), 0 2px 6px rgba(0,0,0,.3);
}

/* map overlays */
.place-finder {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(440px, calc(100% - 28px));
  background: var(--porcelain);
  border: 2px solid var(--pine);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  padding: 10px;
  animation: bannerRise .35s cubic-bezier(.2,.8,.3,1);
}
.place-finder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFDF7;
  border: 2px solid var(--porcelain-dim);
  border-radius: 999px;
  padding: 0 8px 0 12px;
  transition: border-color .12s ease;
}
.place-finder-row:focus-within { border-color: var(--tile); }
.place-finder-icon { color: var(--pine-soft); opacity: .65; flex: 0 0 auto; }
.place-finder-row input {
  flex: 1;
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--pine);
  padding: 10px 4px;
  outline: none;
}
.place-results {
  margin-top: 8px;
  background: #FFFDF7;
  border: 1.5px solid var(--porcelain-dim);
  border-radius: 12px;
  overflow: hidden;
  max-height: 240px;
  overflow-y: auto;
}
.place-finder-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pine-soft);
  margin: 9px 2px 2px;
}
.place-finder-hint .map-hint-cancel { color: var(--terra); }

.map-hint {
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--pine);
  color: var(--porcelain);
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: var(--shadow-pop);
  white-space: nowrap;
}
.map-hint-dot {
  width: 9px; height: 9px;
  background: var(--brass-bright);
  border-radius: 50%;
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.map-hint-cancel {
  border: 0;
  background: none;
  color: var(--brass-bright);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.geo-banner {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--porcelain);
  border: 2px solid var(--pine);
  border-radius: 999px;
  padding: 8px 10px 8px 16px;
  box-shadow: var(--shadow-pop);
  animation: bannerRise .4s cubic-bezier(.2,.8,.3,1);
  max-width: calc(100% - 28px);
}
@keyframes bannerRise { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } }
.geo-banner-icon { font-size: 17px; }
.geo-banner-text { font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.geo-banner-text em { color: var(--tile); font-style: normal; font-weight: 800; }
.geo-banner .btn { font-size: 13px; padding: 8px 14px; }
@media (max-width: 900px) {
  .geo-banner { flex-wrap: wrap; border-radius: 18px; justify-content: center; }
  .geo-banner-text { white-space: normal; text-align: center; }
}

.consent-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--porcelain);
  border: 2px solid var(--pine);
  border-radius: 18px;
  padding: 12px 14px 12px 18px;
  box-shadow: var(--shadow-pop);
  animation: consentRise .4s cubic-bezier(.2,.8,.3,1);
  max-width: min(640px, calc(100% - 28px));
}
@keyframes consentRise { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }
.consent-text { font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.consent-text a { color: var(--tile); }
.consent-actions { display: flex; gap: 8px; flex-shrink: 0; }
.consent-banner .btn { font-size: 13px; padding: 8px 14px; white-space: nowrap; }
@media (max-width: 560px) {
  .consent-banner { flex-wrap: wrap; justify-content: center; text-align: center; }
}

.map-locate {
  position: absolute;
  right: 14px; bottom: 26px;
  z-index: 1000;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px solid var(--pine);
  background: var(--porcelain);
  color: var(--pine);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-card);
  transition: transform .12s ease;
}
.map-locate:hover { transform: scale(1.07); background: #FFFDF7; }
.map-locate.locating { color: var(--tile); animation: locate-pulse 1s ease-in-out infinite; }
@keyframes locate-pulse { 50% { opacity: .45; } }

/* ————— modal ————— */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 49, 40, .55);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal {
  position: relative;
  background: var(--porcelain);
  border: 2px solid var(--pine);
  border-radius: 18px;
  width: 100%;
  max-width: 420px;
  padding: 26px 28px 28px;
  box-shadow: var(--shadow-pop);
  animation: modalIn .25s cubic-bezier(.2,.8,.3,1);
  overflow: hidden;
}
.modal-check { position: absolute; top: 0; left: 0; right: 0; }
@keyframes modalIn { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal-close {
  position: absolute;
  top: 16px; right: 14px;
  border: 0;
  background: var(--porcelain-deep);
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--pine);
  cursor: pointer;
}
.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  margin: 10px 0 6px;
}
.modal-sub { font-size: 14px; color: #5E6756; line-height: 1.5; margin: 0 0 16px; }

.tabs {
  display: flex;
  background: var(--porcelain-deep);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
}
.tab {
  flex: 1;
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--pine-soft);
  padding: 9px;
  border-radius: 999px;
  cursor: pointer;
}
.tab.active { background: var(--pine); color: var(--porcelain); }

#authForm { display: flex; flex-direction: column; gap: 14px; }
.muted-inline { font-weight: 500; text-transform: none; letter-spacing: 0; color: #6E7663; }

/* Google sign-in + "or" divider */
.google-wrap { margin-bottom: 4px; }
.google-btn { display: flex; justify-content: center; min-height: 40px; }
.auth-or {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 2px 4px;
  color: #8B937F; font-size: 12px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase;
}
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1.5px; background: var(--porcelain-deep); }

/* verification modal bits */
.field-hint { font-size: 12.5px; color: #5E6756; margin: 3px 0 0; }
.link-btn {
  display: block; margin: 12px auto 0;
  border: 0; background: none; cursor: pointer;
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
  color: var(--pine-soft); text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--tile); }

/* verified badges (profile) */
.verify-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: -4px; }
.badge-verified, .badge-unverified {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; letter-spacing: .03em;
  border-radius: 999px; padding: 5px 11px;
}
.badge-verified { background: var(--tile-wash); color: var(--tile); }
.badge-unverified { background: var(--brass-wash); color: #6F5314; }

/* ————— toasts ————— */

.toasts {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--pine);
  color: var(--porcelain);
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 12px 22px;
  box-shadow: var(--shadow-pop);
  animation: toastIn .25s cubic-bezier(.2,.8,.3,1);
  max-width: min(90vw, 480px);
  text-align: center;
}
.toast.toast-error { background: var(--terra); }
.toast.toast-out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { transform: translateY(16px); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(10px); opacity: 0; } }

/* ————— responsive ————— */

@media (max-width: 900px) {
  /* fixed app shell: map on top, panel fills the rest and scrolls inside */
  .topbar { flex-wrap: wrap; row-gap: 9px; column-gap: 8px; padding: 10px 12px; }
  .searchbox { order: 3; flex-basis: 100%; max-width: none; }
  .searchbox input { padding-top: 10px; padding-bottom: 10px; }
  .search-results { max-height: 46vh; }

  .app-body { flex-direction: column-reverse; }
  .map-wrap { flex: 0 0 40vh; }
  .panel {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    border-right: 0;
    border-top: 2px solid var(--pine);
  }

  /* chips: one swipeable row — vertical space is precious on phones */
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 11px 12px 9px;
    -webkit-overflow-scrolling: touch;
  }
  .filters::-webkit-scrollbar { display: none; }

  .list { padding: 2px 12px 18px; }
  .list-head { padding: 0 16px 6px; }
  .detail-body, .form-body { padding-left: 16px; padding-right: 16px; }

  .brand-word { font-size: 20px; }
  .btn { font-size: 13.5px; padding: 9px 14px; }
  .map-hint { white-space: normal; max-width: calc(100% - 32px); text-align: center; }
  .map-locate { bottom: 18px; right: 12px; }
  .user-menu { right: 12px; }
  /* keep some map visible/clickable under the finder on small screens */
  .place-results { max-height: 132px; }
  .place-finder-hint { flex-wrap: wrap; row-gap: 2px; }
}

/* On the narrowest phones the "Join" pill carries the invite on its own — the
   modal still offers a Sign in tab — so drop the extra button to save the row. */
@media (max-width: 560px) {
  .auth-signin { display: none; }
}

/* iOS Safari zooms the whole viewport (clipping the sides) whenever a focused
   input's font-size is under 16px. Tapping "Add a privy" focuses the place
   search, so hold every text field at 16px on touch devices to stop the jump. */
@media (pointer: coarse) {
  .searchbox input,
  .place-finder-row input,
  .field input,
  .field textarea,
  .field select { font-size: 16px; }
}
