/* ==========================================================================
   ぬいマップ — v3 "soft paper" theme
   Rounder, airier, closer to the first visual version: pill buttons, 20–28px
   cards, soft shadows and warm gradients, while keeping the serif headlines
   and paper texture that give the site its character.
   ========================================================================== */

:root {
  --paper: #fbf6ec;
  --paper-deep: #f3e9d9;
  --card: #fffdf8;
  --white: #fffdf8;
  --ink: #2a211b;
  --ink-soft: #44382e;
  --muted: #7d6c5c;
  --line: #ecdfcd;
  --line-strong: #d9c7ae;
  --rose: #b25a49;
  --rose-dark: #8a3f33;
  --rose-light: #f6e5da;
  --olive: #6a715a;
  --serif: "Wawa Serif", "Noto Serif CJK SC", "Songti SC", SimSun, serif;
  --sans: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --fast: 160ms;
  --normal: 280ms;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --pill: 999px;
  --shadow-soft: 0 10px 34px rgba(88, 60, 38, .08);
  --shadow-card: 0 14px 40px rgba(88, 60, 38, .1);
}

html { -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 12% -4%, rgba(242, 219, 197, .55) 0, transparent 42%),
    radial-gradient(ellipse at 92% 2%, rgba(232, 226, 202, .5) 0, transparent 38%),
    url("/assets/paper.png");
  background-repeat: no-repeat, no-repeat, repeat;
  color: var(--ink);
  font: 14px/1.72 var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--rose-light); color: var(--ink); }

:focus-visible { outline: 2px solid var(--rose-dark); outline-offset: 3px; }

dialog:focus { outline: none; }

h1, h2, h3 { color: var(--ink); letter-spacing: .01em; }

a { color: inherit; }

.shell { width: calc(100% - 64px); max-width: 1180px; }

/* ---------------------------------------------------------------- header */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 246, 236, .86);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid rgba(217, 199, 174, .6);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 72px;
}

.header-actions { justify-self: end; }

/* floating pill tab bar */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 2px;
  width: min(92vw, 430px);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, .92);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 20px 46px rgba(60, 40, 24, .18);
}

.tabbar a,
.tabbar button {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 8px 4px 7px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: 600 10px/1 var(--sans);
  letter-spacing: .04em;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.tabbar a:hover,
.tabbar button:hover { color: var(--rose-dark); background: rgba(178, 90, 73, .08); }

.tabbar [aria-current] { color: var(--rose-dark); background: var(--rose-light); }

.tabbar .icon { width: 20px; height: 20px; stroke-width: 1.7; }

.tabbar .tab-publish {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  margin: -20px 2px 0;
  padding: 0;
  justify-content: center;
  gap: 1px;
  border-radius: 50%;
  background: linear-gradient(150deg, #c46c58, #9d4a3b);
  color: #fff7ee;
  box-shadow: 0 12px 26px rgba(157, 74, 59, .34);
}

.tabbar .tab-publish .icon { width: 22px; height: 22px; }

.tabbar .tab-publish span { font-size: 9px; letter-spacing: .02em; }

.tabbar .tab-publish:hover { background: linear-gradient(150deg, #cf7561, #a75041); color: #fff; }

body { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }

.brand { gap: 12px; font: 700 19px/1.1 var(--serif); letter-spacing: .03em; }

.brand small {
  margin-top: 5px;
  color: var(--rose);
  font: 700 8px/1 var(--sans);
  letter-spacing: .3em;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8e6da, #f1d8c8);
  color: var(--rose-dark);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.brand-icon .icon { width: 21px; height: 21px; stroke-width: 1.7; }

.header-inner nav { gap: 8px; }

.header-inner nav a,
.header-inner nav button {
  padding: 9px 14px;
  border-radius: var(--pill);
  font: 600 12px/1 var(--sans);
  letter-spacing: .1em;
  color: var(--muted);
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.header-inner nav .icon { display: none; }

.header-inner nav a:hover,
.header-inner nav button:hover { background: rgba(178, 90, 73, .08); color: var(--rose-dark); }

.header-inner nav [aria-current] { color: var(--ink); background: transparent; }

.header-inner nav [aria-current]::after {
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--rose);
}

.header-inner nav .nav-publish {
  padding: 9px 14px;
  color: var(--rose-dark);
}

.header-inner nav .nav-publish::after { display: none; }

.header-actions .button { min-height: 38px; }

/* ---------------------------------------------------------------- buttons */

.button {
  min-height: 42px;
  padding: 10px 20px;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: var(--card);
  color: var(--ink);
  font: 600 12px/1 var(--sans);
  letter-spacing: .06em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset;
  transition:
    background var(--fast) var(--ease), color var(--fast) var(--ease),
    border-color var(--fast) var(--ease), transform var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}

.button:hover:not(:disabled) { border-color: var(--rose-light); box-shadow: 0 8px 20px rgba(138, 63, 51, .12); }

.button:active:not(:disabled) { transform: translateY(1px); }

.button .icon { width: 1.05em; height: 1.05em; stroke-width: 1.7; }

.primary {
  background: linear-gradient(145deg, #b96351, #9d4a3b);
  border-color: transparent;
  color: #fff7ee;
  box-shadow: 0 10px 24px rgba(157, 74, 59, .22);
}

.primary:hover:not(:disabled) {
  background: linear-gradient(145deg, #c06a57, #a24c3d);
  border-color: transparent;
  color: #fffaf3;
}

.secondary { background: rgba(255, 253, 248, .8); }

.secondary:hover:not(:disabled) {
  background: #fffdf8;
  border-color: var(--rose-light);
  color: var(--rose-dark);
}

.icon-button {
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.icon-button:hover { border-color: var(--rose-light); background: #fff; transform: translateY(-1px); }

.text-button { color: var(--muted); font-size: 12px; letter-spacing: .03em; text-underline-offset: 3px; }
.text-button:hover { color: var(--rose-dark); }

/* ---------------------------------------------------------------- hero */

.intro {
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
  margin: clamp(22px, 3.4vw, 38px) 0 0;
  padding: clamp(26px, 4vw, 54px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(ellipse at 96% 8%, rgba(228, 232, 208, .7) 0, transparent 58%),
    linear-gradient(118deg, #fffaf0 16%, #f6ecdd 100%);
  box-shadow: var(--shadow-soft);
}

.intro:has(.home-feature[hidden]) { grid-template-columns: minmax(0, 1fr); }

.intro h1 {
  margin: 14px 0 18px;
  font: 700 clamp(40px, 5.2vw, 72px)/1.08 var(--serif);
  letter-spacing: .01em;
}

.intro h1 span {
  display: block;
  padding-left: clamp(0px, 4.4vw, 56px);
  color: var(--rose-dark);
}

.eyebrow {
  margin: 0;
  color: var(--olive);
  font: 600 10px/1 var(--sans);
  letter-spacing: .28em;
}

.eyebrow::after {
  content: "";
  display: inline-block;
  width: 40px;
  height: 1px;
  margin-left: 12px;
  vertical-align: 3px;
  background: var(--line-strong);
}

.intro-description { max-width: 26em; color: var(--muted); font-size: 15px; line-height: 1.8; }

.intro-actions { gap: 10px; margin-top: 22px; }

.home-feature {
  padding: 10px 10px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  transition: transform var(--normal) var(--ease), box-shadow var(--normal) var(--ease);
}

.home-feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }

.home-feature img {
  height: clamp(190px, 22vw, 280px);
  border-radius: var(--radius-md);
  object-fit: cover;
}

.home-feature-caption {
  align-items: center;
  margin-top: 4px;
  padding: 10px 8px 8px;
  border-top: 0;
}

.home-feature-caption strong { font: 700 19px/1.35 var(--serif); }
.home-feature-caption small { margin-top: 5px; color: var(--muted); font-size: 11px; letter-spacing: .1em; }

.home-feature-caption > .icon {
  width: 20px;
  height: 20px;
  color: var(--rose);
  transition: transform var(--normal) var(--ease);
}

.home-feature:hover .home-feature-caption > .icon { transform: translateX(4px); }

/* ---------------------------------------------------------------- section headings */

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title { display: flex; align-items: center; gap: 12px; }

.section-title h2 { font: 700 22px/1.25 var(--serif); letter-spacing: .02em; }

.section-title .section-icon { display: grid; }

.section-icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: linear-gradient(145deg, #f8e7db, #f2dbc9);
  color: var(--rose-dark);
  font-size: 17px;
  display: grid;
  place-items: center;
}

.story-count, .panel-head p, #locations-count {
  color: var(--muted);
  font: 600 11px/1.4 var(--sans);
  letter-spacing: .08em;
}

/* ---------------------------------------------------------------- tabs & inputs */

.region-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

.region-tabs button {
  padding: 8px 15px;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: rgba(255, 253, 248, .7);
  color: var(--muted);
  font: 600 11px/1 var(--sans);
  letter-spacing: .06em;
  transition: all var(--fast) var(--ease);
}

.region-tabs button:hover { border-color: var(--rose-light); color: var(--rose-dark); }

.region-tabs [aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fbf6ec;
  box-shadow: 0 6px 16px rgba(42, 33, 27, .18);
}

.region-tabs button .icon { width: 1em; height: 1em; }

.search,
.region-picker-select select,
input[type="search"],
input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--card);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.search { padding: 0 14px; border-radius: var(--pill); }

.search:focus-within,
select:focus,
textarea:focus,
input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(178, 90, 73, .12);
  outline: none;
}

.region-picker-select select { padding: 9px 32px 9px 14px; font-size: 12px; border-radius: var(--pill); }

/* ---------------------------------------------------------------- cards */

.story-card {
  padding: 10px 10px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 6px 18px rgba(88, 60, 38, .05);
  transition: transform var(--normal) var(--ease), box-shadow var(--normal) var(--ease), border-color var(--normal) var(--ease);
}

.story-card:hover {
  transform: translateY(-4px);
  border-color: var(--rose-light);
  box-shadow: var(--shadow-card);
}

.story-open { border-radius: var(--radius-md); }

.story-image {
  position: relative;
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--paper-deep);
}

.story-image img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 0;
  border-radius: 0;
  transition: transform 700ms var(--ease), filter 700ms var(--ease);
}

.story-card:hover .story-image img { transform: scale(1.04); }

.story-image .tag {
  border-radius: var(--pill);
  background: rgba(42, 33, 27, .68);
  color: #fff8ee;
  font: 600 9px/1 var(--sans);
  letter-spacing: .14em;
  padding: 5px 10px;
  backdrop-filter: blur(4px);
}

.story-image .featured-label {
  border-radius: var(--pill);
  background: linear-gradient(145deg, #c26854, #a2503f);
  color: #fff7ee;
  font: 700 9px/1 var(--sans);
  letter-spacing: .12em;
  padding: 5px 10px;
}

.story-body { padding: 13px 6px 0; }

.story-location,
.story-credit { color: var(--muted); font: 600 10.5px/1.5 var(--sans); letter-spacing: .08em; }

.story-location .icon { width: 12px; height: 12px; stroke-width: 1.8; }

.story-title {
  margin: 7px 0 6px;
  font: 700 19px/1.4 var(--serif);
  letter-spacing: .01em;
  transition: color var(--fast) var(--ease);
}

.story-card:hover .story-title { color: var(--rose-dark); }

.story-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.post-times { color: var(--muted); font: 500 10px/1.5 var(--sans); letter-spacing: .06em; }

.story-times { margin: 0 6px; }

.story-credit {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 6px 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.story-credit .author-link { margin-right: auto; }

.story-avatar {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--rose-light);
}

.detail-avatar {
  width: 26px;
  height: 26px;
  margin-right: 8px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: -8px;
  border: 1px solid var(--line);
}

.author-link { color: var(--ink-soft); font-weight: 600; }
.author-link:hover { color: var(--rose-dark); text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- engagement */

.engagement-bar { display: flex; justify-content: flex-start; gap: 18px; flex-wrap: wrap; }

.story-metrics { margin: 8px 6px 0; padding-bottom: 6px; }

.detail-metrics {
  margin-top: 18px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(246, 236, 222, .55);
  gap: 26px;
}

.engagement-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font: 600 10.5px/1 var(--sans);
  letter-spacing: .06em;
  transition: color var(--fast) var(--ease);
}

.engagement-caption { display: inline-flex; align-items: center; gap: 5px; }

.engagement-action:hover,
.engagement-action[aria-pressed="true"] { color: var(--rose-dark); background: none; }

.engagement-action .icon { width: 15px; height: 15px; stroke-width: 1.7; }
.engagement-count { font-variant-numeric: tabular-nums; }

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

.map-page { padding-block: clamp(20px, 3vw, 34px) 0; }

.map-frame {
  height: clamp(360px, 46vw, 560px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #e9e1d2;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.map-tiles img { filter: sepia(.1) saturate(.7) brightness(1.02) contrast(.96); }

.map-controls { gap: 8px; }

.map-controls .icon-button {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 253, 248, .94);
  border-color: var(--line);
  box-shadow: 0 6px 18px rgba(88, 60, 38, .12);
}

.map-pin { --pin-color: var(--rose); --pin-size: 28px; }

.map-pin-body::before { border: 2px solid #fffdf8; box-shadow: 0 3px 12px rgba(42, 33, 27, .24); }

.map-pin.cluster-pin { --pin-color: #4a3a2f; --pin-size: 38px; }

.map-pin-label {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--card);
  color: var(--ink);
  font: 600 10px/1.3 var(--sans);
  box-shadow: 0 6px 16px rgba(88, 60, 38, .12);
}

.map-credit, .tile-credit {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .05em;
  background: rgba(255, 253, 248, .82);
  padding: 3px 8px;
  border-radius: var(--pill);
}

/* photo pins once the map is zoomed in */
.map-pin-photo {
  display: none;
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  object-fit: cover;
  border-radius: 50%;
  z-index: 1;
}

.map-layer.show-photos .map-pin.with-photo { --pin-size: 46px; }
.map-layer.show-photos .map-pin.with-photo .map-pin-photo { display: block; }
.map-layer.show-photos .map-pin.with-photo .map-pin-body .icon { display: none; }
.map-layer.show-photos .map-pin.with-photo .map-pin-body::before { background: var(--card); border-color: #fff; }
.map-layer.show-photos .map-pin.with-photo:hover .map-pin-photo { transform: scale(1.06); }
.map-pin-photo { transition: transform var(--normal) var(--ease); }

/* ---------------------------------------------------------------- location panel */

.explore-layout { grid-template-columns: minmax(0, 1.6fr) minmax(268px, .74fr); gap: clamp(16px, 2vw, 26px); }

.location-panel {
  display: flex;
  flex-direction: column;
  height: clamp(360px, 46vw, 560px);
  min-height: 0;
  padding: 16px 16px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.panel-head { padding: 0 2px 12px; border-bottom: 1px solid var(--line); }
.panel-head .section-icon { width: 32px; height: 32px; border-radius: 11px; font-size: 15px; }
.panel-head h2 { font: 700 16px/1.3 var(--serif); }

.location-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  padding-right: 4px;
  margin-right: -4px;
}

.location-row, .mine-row {
  padding: 10px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 12px;
  gap: 12px;
  transition: background var(--fast) var(--ease), padding-left var(--fast) var(--ease);
}

.location-row:hover, .mine-row:hover { background: rgba(246, 236, 222, .55); padding-left: 10px; }

.location-row img, .mine-row img {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  object-fit: cover;
}

.location-row strong, .mine-row strong { font: 700 14px/1.4 var(--serif); }
.location-row small, .mine-row small { color: var(--muted); font-size: 11px; }

.panel-post {
  margin-top: 8px;
  padding: 12px 6px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  color: var(--rose-dark);
  font: 600 11px/1.4 var(--sans);
  letter-spacing: .06em;
}

/* ---------------------------------------------------------------- dialogs */

.dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: 0 30px 80px rgba(60, 40, 24, .26);
  animation: dialog-in 240ms var(--ease) both;
}

dialog::backdrop { background: rgba(42, 33, 27, .48); backdrop-filter: blur(4px); }

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(.99); }
  to { opacity: 1; transform: none; }
}

@keyframes sheet-in {
  from { opacity: .4; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}

.dialog h2 { font: 700 27px/1.3 var(--serif); }

.dialog h3 {
  color: var(--olive);
  font: 600 11px/1.4 var(--sans);
  letter-spacing: .16em;
}

.dialog .close { border-radius: 50%; background: var(--card); }

.detail-visual { background: #efe6d6; }
.gallery-stage img { border-radius: 0; }
.gallery-thumbnails { padding: 9px 12px; border-top: 1px solid var(--line); background: var(--card); }
.gallery-thumbnails img { border-radius: 9px; }

.image-count {
  border-radius: var(--pill);
  background: rgba(42, 33, 27, .7);
  font-size: 10px;
  letter-spacing: .08em;
}

.dialog-body { padding: 26px 28px 30px; }

/* ---------------------------------------------------------------- comments */

.comment-row {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 15px 0;
  background: none;
}

.comment-meta strong { font: 700 13px/1.4 var(--serif); }
.comment-meta time { color: var(--muted); font-size: 10px; letter-spacing: .06em; }
.comment-text { font-size: 13.5px; line-height: 1.75; }

.comment-reply-note {
  border-radius: 12px;
  background: var(--rose-light);
  font-size: 11px;
}

#comments-title { font: 700 19px/1.3 var(--serif); }

/* ---------------------------------------------------------------- profile */

.profile-page { padding-top: clamp(18px, 3vw, 30px); }

.profile-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .56fr);
  padding: clamp(22px, 3.4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(ellipse at 92% 6%, rgba(228, 232, 208, .65) 0, transparent 55%),
    linear-gradient(118deg, #fffaf0 14%, #f5ebdb 100%);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.profile-copy { padding: 0; align-items: center; gap: clamp(16px, 2.6vw, 30px); }

.profile-avatar {
  border-radius: 50%;
  background: linear-gradient(145deg, #f8e7db, #f0d5c3);
  color: var(--rose-dark);
  font: 700 30px/1 var(--serif);
}

#profile-avatar {
  border-radius: 50%;
  border: 3px solid #fffdf8;
  box-shadow: 0 6px 18px rgba(88, 60, 38, .14);
  background: var(--rose-light);
}

#profile-photo {
  width: 100%;
  height: 100%;
  max-height: 300px;
  border: 1px solid var(--line);
  border-radius: 18px;
  object-fit: cover;
  background: var(--paper-deep);
}

.profile-copy h1 { font: 700 clamp(30px, 4vw, 50px)/1.1 var(--serif); }

#profile-stats { margin-top: 10px; }

.profile-social-stats {
  margin-top: 6px;
  color: var(--muted);
  font: 600 11px/1.5 var(--sans);
  letter-spacing: .04em;
}

.profile-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

.profile-tabs {
  margin-top: 22px;
  padding: 5px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: rgba(255, 253, 248, .7);
  width: max-content;
  max-width: 100%;
}

.profile-tabs button {
  min-height: 38px;
  padding: 8px 18px;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--muted);
}

.profile-tabs button[aria-pressed="true"] {
  background: var(--ink);
  color: #fbf6ec;
  box-shadow: 0 6px 16px rgba(42, 33, 27, .18);
}

.profile-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin-bottom: 14px;
  border-radius: var(--pill);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .06em;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.profile-back:hover { background: rgba(178, 90, 73, .08); color: var(--rose-dark); }

.profile-stories { margin-top: 28px; }

/* ---------------------------------------------------------------- composer */

.off-map-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(246, 236, 222, .45);
  color: var(--ink-soft);
  font-size: 12.5px;
  letter-spacing: .02em;
  cursor: pointer;
}

.off-map-toggle input { width: 18px; height: 18px; accent-color: var(--rose); }

.off-map-toggle:has(input:checked) {
  border-style: solid;
  border-color: var(--rose);
  background: var(--rose-light);
}

/* ---------------------------------------------------------------- share */

.share-preview {
  display: block;
  width: 100%;
  margin: 6px 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

/* ---------------------------------------------------------------- footer */

.footer {
  margin-top: clamp(44px, 7vw, 88px);
  border-top: 1px solid var(--line);
  background: transparent;
}

.footer-inner { padding: 24px 0 32px; color: var(--muted); font-size: 10.5px; letter-spacing: .06em; }
.footer-brand { font: 700 13px/1 var(--serif); letter-spacing: .03em; color: var(--ink); }
.footer a:hover { color: var(--rose-dark); }

/* ---------------------------------------------------------------- collections */

.collection-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 6px 18px rgba(88, 60, 38, .05);
  transition: transform var(--normal) var(--ease), box-shadow var(--normal) var(--ease), border-color var(--normal) var(--ease);
}

.collection-card:hover { transform: translateY(-3px); border-color: var(--rose-light); box-shadow: var(--shadow-card); }

.collection-card-copy strong { font: 700 17px/1.35 var(--serif); }

/* ---------------------------------------------------------------- motion */

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

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.intro-copy > * { animation: rise-in 640ms var(--ease) both; }
.intro-copy > *:nth-child(2) { animation-delay: 70ms; }
.intro-copy > *:nth-child(3) { animation-delay: 130ms; }
.intro-copy > *:nth-child(4) { animation-delay: 190ms; }
.home-feature { animation: rise-in 760ms 120ms var(--ease) both; }

/* Pins are created after the map settles; keep them always visible. */
.story-card, .location-row { animation: fade-in 320ms var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

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

@media (max-width: 1020px) {
  .explore-layout { grid-template-columns: minmax(0, 1fr); }
  .location-panel { display: block; height: auto; max-height: none; overflow: visible; }
  .location-list { display: block; max-height: none; overflow: visible; flex: none; padding-right: 0; margin-right: 0; }
}

@media (max-width: 980px) {
  .intro { grid-template-columns: minmax(0, 1fr); gap: 26px; }

  .intro h1 span { padding-left: 0; }

  .profile-banner { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 22px; }

  .profile-copy { order: 2; }

  #profile-photo { order: 1; width: 100%; max-height: 300px; border-radius: 18px; }
}

@media (max-width: 720px) {
  body { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }

  .shell { width: auto; margin-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }

  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 64px;
    padding-block: 8px;
  }

  .tabbar {
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    max-width: 430px;
    padding: 5px;
  }

  .tabbar a,
  .tabbar button { padding: 7px 2px 6px; font-size: 9.5px; }

  .tabbar .tab-publish { flex-basis: 52px; width: 52px; height: 52px; margin-top: -16px; }

  .header-actions .button { min-height: 36px; padding: 8px 14px; }

  .intro { margin-top: 14px; padding: 22px 18px; border-radius: 24px; gap: 20px; }

  .intro h1 { font-size: clamp(34px, 9.4vw, 44px); }

  .intro-description { font-size: 14px; }

  .home-feature { display: block; padding: 8px 8px 4px; }
  .home-feature img { width: 100%; height: auto; aspect-ratio: 16 / 10; }

  .dialog::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: rgba(42, 33, 27, .16);
    transform: translateX(-50%);
  }

  .section-heading { flex-wrap: wrap; gap: 10px; }
  .section-title h2 { font-size: 19px; }
  .section-icon { width: 34px; height: 34px; border-radius: 12px; font-size: 15px; }

  .map-heading-actions { width: 100%; justify-content: space-between; }

  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }

  .place-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

  .region-picker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(98px, 30%); gap: 8px; }

  .map-frame { height: clamp(300px, 46svh, 420px); border-radius: 18px; }

  .location-row img, .mine-row img { width: 46px; height: 46px; border-radius: 11px; }

  .story-title { font-size: 17px; }
  .engagement-bar { gap: 16px; }
  .engagement-label { display: none; }
  .engagement-count { font-size: 11px; }

  /* dialogs become bottom sheets */
  .dialog {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    margin: 0;
    border: 0;
    border-radius: 24px 24px 0 0;
    overflow-y: auto;
    animation: sheet-in 280ms var(--ease) both;
  }

  .dialog .close {
    position: sticky;
    top: max(12px, env(safe-area-inset-top));
    right: auto;
    float: right;
    width: 36px;
    height: 36px;
    margin: 14px 14px -46px 0;
    background: var(--paper-deep);
    box-shadow: none;
  }

  .dialog h2 { font-size: 25px; margin-right: 0; }
  .dialog-body { padding: 20px 18px calc(26px + env(safe-area-inset-bottom)); }

  .detail-visual { background: #efe6d6; }
  .gallery-stage img { height: auto; max-height: min(54svh, 460px); object-fit: contain; }

  .profile-banner { padding: 20px; border-radius: 24px; }
  .profile-copy { flex-direction: column; align-items: flex-start; gap: 16px; }
  .profile-tabs { width: 100%; overflow-x: auto; }
  .profile-tabs button { flex: 1; padding: 8px 12px; white-space: nowrap; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 640px) {
  .intro h1 { font-size: clamp(32px, 9vw, 42px); }
  .map-page { padding-top: 16px; }
}
