:root {
  --lav: #d9cffa;
  --lav-2: #efeafd;
  --ink: #2a2140;
  --muted: #6c6580;
  --purple: #5b3fb5;
  --purple-d: #45308c;
  --paper: #fbf8f2;
  --card: #ffffff;
  --line: #e6e0ee;
  --green: #4f7a4a;
  --heart: #d9476b;
  --brown: #8a5a3c;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(42, 33, 64, .06), 0 6px 20px rgba(42, 33, 64, .06);
  --display: "Fraunces", Georgia, serif;
  --body: "DM Sans", system-ui, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--body); color: var(--ink); line-height: 1.5;
  background: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(91, 63, 181, .08) 1px, transparent 0);
  background-size: 22px 22px;
}
a { color: var(--purple); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.shell { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--card); box-shadow: 0 0 0 1px var(--line); display: flex; flex-direction: column; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--lav); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-icon { width: 30px; height: 30px; color: var(--purple-d); }
.brand strong { display: block; font-family: var(--display); font-size: 1.2rem; line-height: 1.1; }
.brand small { display: block; font-family: var(--hand); font-size: 1rem; color: var(--purple-d); line-height: 1; }
.toplinks { display: flex; gap: 4px; }
.toplinks a { text-decoration: none; color: var(--ink); font-weight: 500; font-size: .9rem; padding: 6px 10px; border-radius: 999px; }
.toplinks a.on, .toplinks a:hover { background: rgba(255, 255, 255, .7); }

main { flex: 1; outline: none; padding-bottom: 96px; }
.pad { padding: 18px 16px 8px; }
h1 { font-family: var(--display); font-size: 1.9rem; line-height: 1.15; margin: 0 0 4px; }
h2 { font-family: var(--display); font-size: 1.25rem; margin: 0 0 10px; }
h2.sub { margin-top: 26px; }
.muted { color: var(--muted); margin: 0 0 14px; }
.small { font-size: .85rem; }
.hand { font-family: var(--hand); font-size: 1.5rem; color: var(--purple); margin: 0; line-height: 1; }
.back { display: inline-block; margin-bottom: 6px; text-decoration: none; font-weight: 500; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }

/* map */
.mapwrap { border-radius: var(--radius); overflow: hidden; border: 2px solid var(--ink); background: #f3efe6; }
.mapwrap.small { margin-bottom: 18px; }
.map { width: 100%; height: auto; display: block; touch-action: manipulation; }
.mapwrap.pick .map { cursor: crosshair; }
.map .ground { fill: #f5f1e8; }
.map .st { stroke: #fff; stroke-width: 16; }
.map .st + .stl { }
.map line.st { stroke-linecap: square; filter: drop-shadow(0 0 0 #d8cfbd); }
.map .stl { font: 500 11px var(--body); fill: #8b8170; letter-spacing: .02em; }
.map .park { fill: #cfe3c6; stroke: #9cbf92; stroke-width: 1.5; }
.map .parkl { font: 600 15px var(--hand); fill: var(--green); }
.map .pin { cursor: pointer; outline: none; }
.map .pin path { fill: var(--purple); stroke: #fff; stroke-width: 2.5; transition: transform .15s; transform-origin: 0 0; }
.map .pin text { font: 700 12px var(--body); fill: #fff; pointer-events: none; }
.map .pin:hover path, .map .pin:focus-visible path { transform: scale(1.15); fill: var(--purple-d); }
.map .pin.sel path { fill: var(--heart); transform: scale(1.2); }
.map .pin.draft path { fill: var(--green); }

.mini-list { display: grid; gap: 10px; }
.mini { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.mini:hover { border-color: var(--purple); }
.mini b { display: block; font-size: .95rem; }
.mini small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); }
.photo.thumb { width: 64px; height: 64px; flex: none; border-radius: 10px; }
.photo.thumb span { font-size: 0; }

/* photos */
.photo { position: relative; overflow: hidden; background: #eee; aspect-ratio: 4 / 3; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.placeholder {
  background:
    radial-gradient(ellipse at 30% 20%, hsl(var(--h) 70% 85% / .9), transparent 60%),
    linear-gradient(160deg, hsl(var(--h) 55% 72%), hsl(calc(var(--h) + 30) 45% 48%));
  display: flex; align-items: flex-end;
}
.photo.placeholder span { display: inline-flex; align-items: center; gap: 6px; margin: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .85); font-size: .8rem; font-weight: 500; }
.photo.placeholder .i { width: 14px; height: 14px; }

/* post */
.post { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 18px; background: var(--card); box-shadow: var(--shadow); }
.post > header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.post > header div { flex: 1; min-width: 0; }
.post > header strong { display: block; font-size: .95rem; }
.post time { color: var(--muted); font-size: .85rem; }
.ploc { display: inline-flex; align-items: center; gap: 3px; font-size: .82rem; color: var(--muted); text-decoration: none; }
a.ploc:hover { color: var(--purple); }
.ploc .i { width: 13px; height: 13px; color: var(--purple); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--lav); color: var(--purple-d); display: grid; place-items: center; font-weight: 700; flex: none; }
.photos { display: grid; gap: 3px; }
.photos.n2 { grid-template-columns: 1fr 1fr; }
.photos.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.photos.n3 .photo:first-child { grid-row: span 2; aspect-ratio: auto; }
.photos.n2 .photo { aspect-ratio: 1; }
.actions { display: flex; gap: 6px; padding: 10px 10px 0; }
.actions button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: .88rem; }
.actions .i { width: 17px; height: 17px; color: var(--muted); }
.agree.on { border-color: var(--heart); background: #fdeef2; color: var(--heart); }
.agree.on .i { color: var(--heart); }
.agree:active .i { transform: scale(1.3); }
.cbtn .i { color: var(--purple); }
.caption { margin: 10px 14px 6px; }
.comments { list-style: none; margin: 0; padding: 0 14px; font-size: .9rem; }
.comments li { padding: 4px 0; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.comments li.eng { background: #eef5ec; border-radius: 10px; padding: 6px 10px; margin: 4px 0; }
.comments li.eng b { color: var(--green); }
.comments .i { width: 15px; height: 15px; color: var(--green); align-self: center; }
.cform { display: flex; gap: 6px; padding: 10px 14px 14px; }
.cform input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; background: var(--paper); }
.cform button { border: 0; background: none; color: var(--purple); font-weight: 700; cursor: pointer; }
.post.preview { box-shadow: none; margin: 0; }

.i { display: inline-flex; width: 20px; height: 20px; }
.i svg { width: 100%; height: 100%; }

/* buttons, forms */
.btn { display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 999px; background: var(--purple); color: #fff; padding: 11px 22px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--purple-d); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: var(--lav-2); color: var(--purple-d); }
.btn.wide { width: 100%; margin-top: 4px; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; margin: 20px auto 0; display: block; font-size: .85rem; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }

.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--card); }
.field { display: grid; gap: 6px; font-weight: 500; font-size: .92rem; margin-bottom: 14px; }
.field input, .field select, textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--paper); font-weight: 400; }
textarea { resize: vertical; }
.field input:focus, .field select:focus, textarea:focus { border-color: var(--purple); outline: none; }
.or { font-family: var(--hand); font-size: 1.3rem; text-align: center; color: var(--muted); margin: 4px 0 8px; }
.chosen { display: flex; align-items: center; gap: 6px; font-weight: 700; margin: 12px 0 0; color: var(--purple-d); }

.steps { list-style: none; padding: 0; margin: 10px 0 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: .78rem; }
.steps li { text-align: center; padding: 6px 2px; border-radius: 999px; background: var(--lav-2); color: var(--muted); font-weight: 500; }
.steps li.on { background: var(--purple); color: #fff; }
.steps li.done { background: var(--lav); color: var(--purple-d); }
.navrow { display: flex; justify-content: space-between; margin-top: 16px; }

.pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.picker { display: grid; place-items: center; gap: 6px; padding: 22px 10px; border: 2px dashed var(--lav); border-radius: var(--radius); cursor: pointer; font-weight: 500; text-align: center; }
.picker:hover, .picker:focus-within { border-color: var(--purple); background: var(--lav-2); }
.picker .i { width: 34px; height: 34px; color: var(--purple); }
.picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.previews { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.pv { position: relative; }
.pv .photo { border-radius: 10px; aspect-ratio: 1; }
.pv .photo span { font-size: 0; }
.pv button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; line-height: 1; }

/* notifications */
.notifs { list-style: none; padding: 0; margin: 0; }
.notifs li { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.notifs li span:not(.i) { flex: 1; }
.notifs li.unread span:not(.i) { font-weight: 700; }
.notifs time { color: var(--muted); font-size: .85rem; }
.notifs .i { width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: var(--lav-2); color: var(--purple); flex: none; }
.notifs .n-heart { color: var(--heart); background: #fdeef2; }
.notifs .n-engineer { color: var(--green); background: #eef5ec; }

/* profile */
.profile .bigavatar { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; font-size: 2rem; font-weight: 700; font-family: var(--display); color: var(--purple-d); background: conic-gradient(var(--lav), #c3e0f2, var(--lav)); }

/* featured carousel */
.carousel { position: relative; border-radius: var(--radius); overflow: hidden; background: #f4efe6; border: 1px solid #e5dccb; }
.slide { margin: 0; display: none; }
.slide.on { display: block; animation: fade .5s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.photo.hero { aspect-ratio: 16 / 9; }
.slide figcaption { padding: 16px 16px 44px; }
.slide figcaption b { display: block; font-family: var(--display); font-size: 1.25rem; margin-top: 6px; }
.slide figcaption p { margin: 4px 0 8px; }
.slide figcaption small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); margin-right: 12px; }
.slide figcaption small .i { width: 15px; height: 15px; color: var(--heart); }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brown); background: #fff; border: 1px solid #e5dccb; padding: 2px 10px; border-radius: 999px; }
.dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: #d6cbb8; cursor: pointer; padding: 0; }
.dots button.on { background: var(--brown); width: 26px; border-radius: 999px; }

/* process page */
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose h2 { margin-top: 28px; }
.prose figure { margin: 18px 0; }
.prose figure img { border-radius: 12px; border: 1px solid var(--line); }
.prose figcaption { font-family: var(--hand); font-size: 1.2rem; color: var(--muted); text-align: center; margin-top: 6px; }

/* bottom tab bar */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; background: #fff; border-top: 2px solid var(--ink); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { position: relative; display: grid; justify-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 500; padding: 4px 0; }
.tabbar .ic { width: 24px; height: 24px; display: block; }
.tabbar .ic svg { width: 100%; height: 100%; }
.tabbar a.on { color: var(--purple); }
.tabbar a.add { align-self: center; }
.tabbar .plus { width: 54px; height: 54px; margin-top: -26px; border-radius: 50%; background: var(--purple); color: #fff; font-size: 2rem; line-height: 50px; text-align: center; border: 3px solid var(--ink); box-shadow: 0 4px 12px rgba(91, 63, 181, .35); }
.tabbar a.add:hover .plus, .tabbar a.add.on .plus { background: var(--purple-d); }
#badge { position: absolute; top: 0; right: calc(50% - 20px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--heart); color: #fff; font-size: .7rem; line-height: 18px; text-align: center; }

#toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 500; opacity: 0; pointer-events: none; transition: .25s; z-index: 30; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 600px) {
  .shell { margin: 24px auto; min-height: calc(100vh - 48px); border-radius: 24px; overflow: hidden; }
  .tabbar { bottom: 24px; border-radius: 0 0 24px 24px; }
  main { padding-bottom: 110px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
