:root {
  --paper: #f6f1e7;
  --paper-deep: #ebe2d1;
  --surface: rgba(255, 253, 247, 0.94);
  --ink: #282821;
  --muted: #68665b;
  --line: #d8cfbf;
  --accent: #d85d42;
  --accent-deep: #a94331;
  --sage: #758b76;
  --sage-light: #dce4d7;
  --sun: #edb852;
  --blue: #668997;
  --danger: #a24437;
  --shadow: 0 18px 50px rgba(59, 51, 38, 0.12);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { background: #ddd4c5; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 15%, rgba(216, 93, 66, .08), transparent 26%),
    radial-gradient(circle at 85% 70%, rgba(117, 139, 118, .12), transparent 30%),
    #ddd4c5;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .24;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a, [role="button"] { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }

#app {
  position: relative;
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 80px rgba(48, 42, 32, .18);
}

.app-shell { min-height: 100dvh; padding-bottom: 92px; }
.screen { min-height: calc(100dvh - 84px); animation: pageIn .42s cubic-bezier(.2,.8,.2,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.boot-shell {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
}
.boot-mark {
  width: 70px; height: 70px; display: grid; place-items: center;
  border: 1px solid var(--ink); border-radius: 50%;
  font: 32px var(--serif); color: var(--ink); transform: rotate(-4deg);
}
.boot-line { width: 160px; height: 4px; margin: 28px 0 16px; border-radius: 99px; background: var(--paper-deep); overflow: hidden; }
.boot-line::after { content: ""; display: block; width: 48%; height: 100%; background: var(--accent); animation: loading 1.1s infinite alternate ease-in-out; }
@keyframes loading { to { transform: translateX(108px); } }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 68px; padding: max(12px, env(safe-area-inset-top)) 18px 10px;
  background: linear-gradient(to bottom, rgba(246,241,231,.98) 70%, rgba(246,241,231,.84));
  backdrop-filter: blur(16px);
}
.topbar-title { min-width: 0; }
.eyebrow { margin: 0 0 2px; color: var(--accent-deep); font-size: 10px; font-weight: 750; letter-spacing: .2em; text-transform: uppercase; }
.topbar h1 { margin: 0; overflow: hidden; font: 600 clamp(20px,6vw,26px)/1.15 var(--serif); white-space: nowrap; text-overflow: ellipsis; }
.project-switch { max-width: 260px; min-height: 34px; display: flex; align-items: center; gap: 4px; padding: 0; border: 0; color: var(--ink); background: transparent; font: 600 clamp(20px,6vw,26px)/1.15 var(--serif); text-align: left; }
.project-switch span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.project-switch svg { width: 17px; flex: 0 0 17px; transform: rotate(-90deg); }
.header-actions { display: flex; gap: 7px; }
.icon-btn, .back-btn, .avatar-btn {
  width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: rgba(255,253,247,.78);
}
.icon-btn:hover, .back-btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.icon-btn svg, .back-btn svg, .nav-icon svg { width: 21px; height: 21px; stroke-width: 1.7; }
.avatar-btn { overflow: hidden; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); padding: 0; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.notification-dot { position: relative; }
.notification-dot::after { content: ""; position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--paper); }

.page { padding: 12px 18px 28px; }
.hero { padding: 12px 18px 24px; }
.hero h2 { margin: 0 0 8px; max-width: 360px; font: 600 clamp(34px,10vw,52px)/.98 var(--serif); letter-spacing: -.045em; }
.hero h2 em { color: var(--accent); font-style: normal; }
.hero p { color: var(--muted); line-height: 1.7; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 25px 0 13px; }
.section-head h2, .section-head h3 { margin: 0; font: 600 22px/1.2 var(--serif); }
.section-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.text-btn { min-height: 44px; border: 0; background: transparent; color: var(--accent-deep); font-weight: 700; padding: 8px 0 8px 12px; }

.project-stack { display: grid; gap: 14px; }
.project-card {
  position: relative; min-height: 245px; overflow: hidden;
  border: 0; border-radius: 7px 34px 7px 7px; text-align: left; color: white; background: #413d34; box-shadow: var(--shadow);
}
.project-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.75) contrast(.92); transition: transform .8s ease; }
.project-card:hover > img { transform: scale(1.035); }
.project-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg,rgba(20,20,17,.04),rgba(20,20,17,.84)); }
.project-card-content { position: absolute; z-index: 1; inset: auto 20px 18px; }
.project-card h3 { margin: 4px 0 9px; font: 600 29px var(--serif); }
.project-card p { margin: 0; color: rgba(255,255,255,.76); font-size: 12px; }
.project-card-badge { display: inline-flex; min-height: 29px; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid rgba(255,255,255,.45); border-radius: 99px; font-size: 11px; backdrop-filter: blur(8px); }
.project-card-empty { min-height: 200px; display: grid; place-items: center; border: 1px dashed var(--line); background: rgba(255,253,247,.48); color: var(--muted); }
.project-card-empty > div { position: relative; z-index: 1; padding: 22px; }

.bottom-nav {
  position: fixed; z-index: 50; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, 520px); min-height: 74px; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 7px 10px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(89,81,67,.14); background: rgba(250,247,239,.94); backdrop-filter: blur(24px);
}
.nav-btn { min-width: 44px; min-height: 56px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 2px; font-size: 10px; }
.nav-btn.active { color: var(--ink); }
.nav-btn.active .nav-icon { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.nav-icon { width: 34px; height: 28px; border-radius: 14px; display: grid; place-items: center; transition: .2s ease; }
.add-nav .nav-icon { width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; color: white; background: var(--accent); box-shadow: 0 10px 22px rgba(216,93,66,.26); }
.add-nav span:last-child { margin-top: -3px; }

.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 18px 12px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.chip { min-height: 44px; flex: 0 0 auto; padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: rgba(255,253,247,.62); }
.chip.active { color: var(--paper); border-color: var(--ink); background: var(--ink); }

.timeline { position: relative; display: grid; gap: 19px; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 12px; bottom: 10px; border-left: 1px dashed var(--line); }
.date-divider { position: relative; z-index: 1; width: fit-content; padding: 4px 8px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); font: 11px var(--serif); }
.experience-card { position: relative; margin-left: 27px; border: 1px solid rgba(120,110,94,.18); border-radius: 4px 26px 4px 4px; overflow: hidden; background: var(--surface); box-shadow: 0 10px 34px rgba(67,58,43,.08); }
.experience-card::before { content: ""; position: absolute; z-index: 2; left: -21px; top: 21px; width: 8px; height: 8px; border: 3px solid var(--paper); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.experience-photo { position: relative; width: 100%; aspect-ratio: 4 / 2.6; overflow: hidden; background: var(--paper-deep); }
.experience-photo > img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.experience-card:hover .experience-photo > img { transform: scale(1.02); }
.category-seal { position: absolute; left: 12px; top: 12px; display: flex; align-items: center; gap: 6px; min-height: 30px; padding: 5px 10px; border-radius: 99px; background: rgba(250,247,239,.9); color: var(--ink); font-size: 11px; backdrop-filter: blur(12px); }
.category-seal svg { width: 16px; height: 16px; }
.private-seal { position: absolute; right: 12px; top: 12px; min-height: 30px; padding: 6px 10px; border-radius: 99px; color: white; background: rgba(40,40,33,.78); font-size: 11px; }
.experience-body { padding: 15px 16px 17px; }
.experience-body h3 { margin: 0 0 7px; font: 600 20px/1.2 var(--serif); }
.experience-body p { display: -webkit-box; overflow: hidden; margin: 0 0 11px; color: var(--muted); line-height: 1.65; font-size: 13px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.meta-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; color: var(--muted); font-size: 11px; }
.rating { color: var(--accent-deep); letter-spacing: .08em; }
.draft-card { border-style: dashed; opacity: .82; }

.map-wrap { position: relative; margin: 0 18px; height: min(63dvh, 570px); overflow: hidden; border: 1px solid #b9b09f; border-radius: 5px 38px 5px 5px; background: #e7e1d3; box-shadow: var(--shadow); }
.live-map { position: absolute; z-index: 1; inset: 0; opacity: 0; transition: opacity .25s ease; }
.map-wrap.live-ready .live-map { opacity: 1; }
.map-fallback { position: absolute; inset: 0; transition: opacity .2s ease; }
.map-wrap.live-ready .map-fallback { opacity: 0; pointer-events: none; }
.map-provider-choice { margin: 0 18px 10px; }
.hand-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-road { fill: none; stroke: #fffdf6; stroke-width: 12; stroke-linecap: round; }
.map-road-edge { fill: none; stroke: #cfc7b6; stroke-width: 14; stroke-linecap: round; }
.map-small-road { fill: none; stroke: #f7f3e9; stroke-width: 5; }
.map-park { fill: #cbd8c6; opacity: .85; }
.map-water { fill: #c6dbe0; opacity: .78; }
.map-label { fill: #858071; font: 10px var(--serif); letter-spacing: .06em; }
.map-pin {
  position: absolute; width: 46px; height: 46px; transform: translate(-50%, -50%);
  border: 3px solid var(--paper); border-radius: 50% 50% 50% 8px; color: white; background: var(--accent); box-shadow: 0 6px 18px rgba(60,50,40,.22); rotate: -45deg;
}
.map-pin.fun { background: var(--sage); }
.map-pin.uncategorized { background: var(--muted); }
.map-pin svg { width: 22px; height: 22px; rotate: 45deg; }
.map-pin.selected { z-index: 4; transform: translate(-50%, -50%) scale(1.18); }
.map-card { position: absolute; z-index: 6; left: 12px; right: 12px; bottom: 12px; display: grid; grid-template-columns: 78px 1fr 36px; gap: 12px; align-items: center; padding: 10px; border-radius: 4px 22px 4px 4px; color: var(--ink); background: rgba(255,253,247,.95); box-shadow: 0 14px 36px rgba(50,44,34,.2); backdrop-filter: blur(14px); }
.map-card img { width: 78px; height: 67px; object-fit: cover; border-radius: 3px 15px 3px 3px; }
.map-card h3 { margin: 0 0 5px; font: 600 15px var(--serif); }
.map-card p { margin: 0; color: var(--muted); font-size: 10px; }
.map-legend { display: flex; gap: 13px; margin: 12px 20px; color: var(--muted); font-size: 11px; }
.legend-dot { width: 9px; height: 9px; display: inline-block; margin-right: 5px; border-radius: 50%; background: var(--accent); }
.legend-dot.fun { background: var(--sage); }
.legend-dot.other { background: var(--muted); }

.search-box { position: relative; margin-bottom: 18px; }
.search-box svg { position: absolute; left: 14px; top: 16px; width: 20px; height: 20px; color: var(--muted); }
.search-box input { width: 100%; height: 52px; padding: 0 46px; border: 1px solid var(--line); border-radius: 3px 22px 3px 3px; outline: none; color: var(--ink); background: var(--surface); }
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(216,93,66,.1); }
.search-clear { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); }
.result-grid { display: grid; gap: 12px; }
.place-row { width: 100%; min-height: 104px; display: grid; grid-template-columns: 94px 1fr 32px; align-items: center; gap: 12px; padding: 8px; border: 1px solid rgba(120,110,94,.16); border-radius: 4px 20px 4px 4px; text-align: left; color: var(--ink); background: var(--surface); }
.place-row img { width: 94px; height: 86px; object-fit: cover; border-radius: 3px 15px 3px 3px; }
.place-row h3 { margin: 0 0 6px; font: 600 16px var(--serif); }
.place-row p { margin: 0 0 7px; color: var(--muted); font-size: 11px; }
.arrow { color: var(--accent); font-size: 22px; }

.cover-hero { position: relative; margin: 0 18px 20px; aspect-ratio: 4 / 3.2; overflow: hidden; border-radius: 5px 38px 5px 5px; background: var(--paper-deep); }
.cover-hero img { width: 100%; height: 100%; object-fit: cover; }
.cover-hero::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(27,25,21,.66)); }
.cover-caption { position: absolute; z-index: 2; left: 18px; right: 18px; bottom: 15px; color: white; }
.cover-caption h2 { margin: 0 0 5px; font: 600 29px var(--serif); }
.cover-caption p { margin: 0; color: rgba(255,255,255,.76); font-size: 12px; }
.detail-sheet { position: relative; z-index: 3; margin-top: 0; padding: 22px 18px 28px; border-top: 1px solid var(--line); background: var(--paper); }
.detail-copy { color: #514f46; font: 15px/1.9 var(--serif); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 18px 0; }
.detail-stat { min-height: 85px; padding: 13px; border: 1px solid var(--line); background: rgba(255,253,247,.5); }
.detail-stat span { display: block; color: var(--muted); font-size: 10px; }
.detail-stat strong { display: block; margin-top: 8px; font: 600 16px var(--serif); }
.photo-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 76%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.photo-strip img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 3px 20px 3px 3px; scroll-snap-align: start; }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.detail-delete { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 7px; margin: 12px auto 0; padding: 8px 14px; border: 0; color: var(--danger); background: transparent; font-size: 11px; font-weight: 700; }
.detail-delete svg { width: 17px; height: 17px; }
.detail-delete:hover { text-decoration: underline; text-underline-offset: 4px; }
.detail-delete:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; border-radius: 4px; }
.share-output-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 8px; }

.btn { min-height: 48px; padding: 11px 16px; border: 1px solid var(--ink); border-radius: 3px 15px 3px 3px; font-weight: 750; color: var(--paper); background: var(--ink); transition: .18s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(40,40,33,.13); }
.btn.secondary { color: var(--ink); border-color: var(--line); background: var(--surface); }
.btn.accent { border-color: var(--accent-deep); background: var(--accent-deep); }
.btn.ghost { color: var(--accent-deep); border-color: transparent; background: transparent; }
.btn.danger { color: var(--danger); border-color: #ddbbb4; background: #fff5f2; }
.btn:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.btn.full { width: 100%; }
.btn svg, .segment svg, .radio-card svg { width: 18px; height: 18px; vertical-align: middle; }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label, .field-label { font-weight: 750; font-size: 12px; }
.required::after { content: " 必填"; color: var(--accent); font-size: 9px; letter-spacing: .05em; }
.optional::after { content: " 选填"; color: var(--muted); font-size: 9px; font-weight: 500; }
.field input, .field textarea, .field select { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 3px 14px 3px 3px; outline: none; color: var(--ink); background: rgba(255,253,247,.85); font-size: 16px; }
.field textarea { min-height: 105px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(216,93,66,.09); }
.field-error { display: none; color: var(--danger); font-size: 11px; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); }
.field.invalid .field-error { display: block; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented.three { grid-template-columns: 1fr 1fr 1.15fr; }
.segment { min-height: 48px; border: 1px solid var(--line); border-radius: 3px 14px 3px 3px; color: var(--muted); background: var(--surface); }
.segment.active { color: var(--paper); border-color: var(--ink); background: var(--ink); }
.segment:disabled, .mode-card:disabled { cursor: not-allowed; opacity: .48; }
.rating-input { display: flex; gap: 3px; }
.star-btn { width: 44px; height: 44px; border: 0; background: transparent; color: #c6bda9; font-size: 27px; }
.star-btn.active { color: var(--sun); }
.rating-control { display: grid; grid-template-columns: 1fr 56px 64px; align-items: center; gap: 9px; min-height: 48px; }
.rating-control input[type="range"] { width: 100%; min-height: 44px; padding: 0; accent-color: var(--sun); }
.rating-control output { color: var(--accent-deep); font-weight: 750; font-size: 12px; text-align: center; }
.privacy-choice { display: grid; gap: 8px; }
.radio-card { min-height: 64px; display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 11px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 3px 15px 3px 3px; background: var(--surface); }
.radio-card.active { border-color: var(--sage); background: #f2f5ee; }
.radio-dot { width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 50%; box-shadow: inset 0 0 0 5px var(--surface); }
.radio-card.active .radio-dot { background: var(--sage); border-color: var(--sage); }
.radio-card strong { display: block; font-size: 12px; }
.radio-card small { color: var(--muted); }
.form-footer { position: sticky; z-index: 10; bottom: 0; display: grid; grid-template-columns: .75fr 1.25fr; gap: 9px; margin: 24px -18px -28px; padding: 12px 18px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(246,241,231,.94); backdrop-filter: blur(18px); }
.form-footer.single { grid-template-columns: 1fr; }

.upload-zone { position: relative; min-height: 126px; display: grid; place-items: center; gap: 5px; padding: 18px; border: 1px dashed #aaa18f; border-radius: 4px 22px 4px 4px; color: var(--muted); text-align: center; background: rgba(255,253,247,.52); }
.upload-zone input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.upload-zone svg { width: 30px; height: 30px; color: var(--accent); }
.upload-zone strong { color: var(--ink); font-size: 13px; }
.image-previews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.image-preview { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 3px 14px 3px 3px; background: var(--paper-deep); }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-preview .cover-label { position: absolute; left: 5px; bottom: 5px; padding: 3px 6px; border-radius: 99px; color: white; background: rgba(40,40,33,.72); font-size: 9px; }
.image-preview button { position: absolute; right: 3px; top: 3px; width: 44px; height: 44px; border: 0; border-radius: 50%; color: white; background: rgba(40,40,33,.6); }

.place-header { padding: 6px 18px 19px; }
.place-header h2 { margin: 0 0 8px; font: 600 34px/1.05 var(--serif); }
.place-address { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.external-map-link { width: fit-content; min-height: 44px; display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--accent-deep); font-size: 12px; font-weight: 700; text-underline-offset: 4px; }
.external-map-link svg { width: 17px; height: 17px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { min-height: 44px; display: inline-flex; align-items: center; padding: 6px 11px; border: 0; border-radius: 99px; color: var(--muted); background: var(--paper-deep); font-size: 10px; }
.average-score { display: flex; align-items: center; gap: 12px; margin: 15px 18px; padding: 14px; border-left: 3px solid var(--accent); background: rgba(255,253,247,.55); }
.average-score strong { font: 600 30px var(--serif); }
.average-score p { margin: 0; color: var(--muted); font-size: 11px; }

.person-list { display: grid; gap: 9px; }
.person-row { min-height: 76px; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 11px; padding: 10px 11px; border: 1px solid rgba(120,110,94,.17); border-radius: 3px 18px 3px 3px; color: var(--ink); background: var(--surface); text-decoration: none; }
.person-row img, .avatar { width: 48px; height: 48px; object-fit: cover; border-radius: 50%; background: var(--paper-deep); }
.person-row h3 { margin: 0 0 4px; font-size: 13px; }
.person-row p { margin: 0; color: var(--muted); font-size: 10px; }
.trash-row .mini-btn { display: inline-flex; align-items: center; gap: 5px; }
.trash-row .mini-btn svg { width: 15px; height: 15px; }
.trash-actions { display: grid; gap: 6px; }
.row-actions { display: flex; gap: 4px; }
.mini-btn { min-width: 44px; min-height: 44px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 3px 12px 3px 3px; color: var(--ink); background: var(--surface); font-size: 11px; }
.mini-btn.approve { color: white; border-color: var(--sage); background: var(--sage); }
.role-switch { display: flex; gap: 4px; margin-top: 8px; }
.role-switch .mini-btn { min-height: 44px; padding: 6px 9px; }
.role-switch .mini-btn.active { color: var(--paper); border-color: var(--ink); background: var(--ink); }
.status-pill { min-height: 28px; display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 99px; color: var(--muted); background: var(--paper-deep); font-size: 10px; }
.status-pill.pending { color: #8a5e17; background: #f6e5bc; }
.status-pill.approved { color: #46634a; background: var(--sage-light); }
.status-pill.denied { color: #994a40; background: #f6dcd6; }

.message-card { padding: 16px; border: 1px solid rgba(120,110,94,.17); border-radius: 3px 20px 3px 3px; background: var(--surface); }
.message-card + .message-card { margin-top: 10px; }
.message-author { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.message-author img { width: 38px; height: 38px; object-fit: cover; border-radius: 50%; }
.message-author strong { display: block; font-size: 12px; }
.message-author span { color: var(--muted); font-size: 10px; }
.message-card blockquote { margin: 0; color: #4a4941; font: 15px/1.7 var(--serif); }

.access-hero { padding: 30px 23px 22px; text-align: center; }
.access-mark { width: 92px; height: 92px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 50% 50% 50% 12px; color: var(--paper); background: var(--sage); rotate: -4deg; font: 31px var(--serif); }
.access-hero h2 { font: 600 32px/1.12 var(--serif); }
.access-hero p { color: var(--muted); line-height: 1.7; }
.access-card { margin: 0 18px; padding: 18px; border: 1px solid var(--line); border-radius: 4px 24px 4px 4px; background: var(--surface); box-shadow: var(--shadow); }
.waiting-orbit { position: relative; width: 74px; height: 74px; margin: 4px auto 24px; border: 1px dashed var(--line); border-radius: 50%; }
.waiting-orbit::after { content: ""; position: absolute; top: -5px; left: 30px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); transform-origin: 6px 42px; animation: orbit 2.4s linear infinite; }
@keyframes orbit { to { rotate: 360deg; } }

.cover-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.style-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.cover-mode-picker { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin: 22px 0; }
.mode-card { min-height: 84px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 4px 16px 4px 4px; color: var(--ink); background: var(--surface); text-align: left; }
.mode-card strong, .mode-card span { display: block; }
.mode-card strong { margin-bottom: 5px; font-size: 12px; }
.mode-card span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.mode-card.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--ink); color: var(--paper); }
.mode-card.active span { color: rgba(255,255,255,.68); }
.style-library { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 12px 0 16px; }
.style-card { overflow: hidden; padding: 0 0 10px; border: 1px solid var(--line); border-radius: 3px 16px 3px 3px; color: var(--ink); background: var(--surface); text-align: left; }
.style-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(216,93,66,.12); }
.style-card strong, .style-card small { display: block; padding: 0 8px; }
.style-card strong { margin: 9px 0 3px; font-size: 11px; }
.style-card small { color: var(--muted); font-size: 8px; line-height: 1.45; }
.style-swatch { display: block; aspect-ratio: 1.25; background: linear-gradient(135deg,#b95c45,#e5c278 58%,#34574f); }
.style-minimal-zine, .style-food-editorial { background: linear-gradient(120deg,#f1e8d5 0 62%,#23251f 62% 68%,#c35e45 68%); }
.style-warm-film, .style-scrapbook { background: linear-gradient(35deg,#74503d,#d29a64 52%,#e9d7ac); }
.style-city-poster { background: linear-gradient(150deg,#344f52 0 48%,#e1ae58 48% 62%,#b04f3c 62%); }
.style-cinema { background: linear-gradient(180deg,#151713 0 16%,#587278 16% 84%,#151713 84%); }
.cover-option { position: relative; overflow: hidden; padding: 0; border: 2px solid transparent; border-radius: 4px 22px 4px 4px; background: var(--paper-deep); }
.cover-option.active { border-color: var(--accent); }
.cover-option img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.cover-option span { display: block; min-height: 38px; padding: 10px; color: var(--ink); background: var(--surface); text-align: left; font-size: 11px; }
.generate-box { min-height: 210px; display: grid; place-items: center; align-content: center; gap: 10px; border: 1px dashed var(--line); border-radius: 4px 22px 4px 4px; color: var(--muted); text-align: center; }
.spinner { width: 40px; height: 40px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

.empty-state { min-height: 260px; display: grid; place-content: center; justify-items: center; padding: 28px; text-align: center; color: var(--muted); }
.empty-illustration { width: 90px; height: 90px; display: grid; place-items: center; margin-bottom: 15px; border: 1px dashed var(--line); border-radius: 50% 50% 50% 10px; color: var(--accent); font: 30px var(--serif); }
.empty-state h3 { margin-bottom: 7px; color: var(--ink); font: 600 20px var(--serif); }
.empty-state p { max-width: 260px; line-height: 1.65; font-size: 12px; }
.error-state .empty-illustration { color: var(--danger); border-color: #d7aba3; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; align-items: end; justify-items: center; background: rgba(32,31,27,.48); backdrop-filter: blur(5px); animation: fadeIn .2s; }
.modal { width: min(100%, 520px); max-height: 88dvh; overflow-y: auto; padding: 12px 18px max(24px,env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: var(--paper); animation: sheetUp .3s cubic-bezier(.2,.8,.2,1); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(30%); opacity: 0; } }
.modal-handle { width: 42px; height: 4px; margin: 0 auto 20px; border-radius: 99px; background: var(--line); }
.modal h2 { font: 600 25px var(--serif); }
.account-option { width: 100%; min-height: 72px; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid transparent; border-radius: 3px 18px 3px 3px; text-align: left; color: var(--ink); background: transparent; }
.account-option:hover, .account-option.active { border-color: var(--line); background: var(--surface); }
.account-option img { width: 48px; height: 48px; object-fit: cover; border-radius: 50%; }
.account-option strong { display: block; }
.account-option span { color: var(--muted); font-size: 10px; }
.check { color: var(--sage); font-size: 20px; }

.toast { position: fixed; z-index: 200; left: 50%; bottom: 96px; transform: translate(-50%, 20px); min-width: 190px; max-width: calc(100% - 40px); padding: 12px 16px; border-radius: 4px 16px 4px 4px; opacity: 0; pointer-events: none; color: white; background: #282821; box-shadow: var(--shadow); text-align: center; font-size: 12px; transition: .28s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.network-status { position: fixed; z-index: 90; top: max(8px,env(safe-area-inset-top)); left: 50%; width: min(calc(100% - 24px),496px); transform: translateX(-50%); padding: 10px 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 4px 16px 4px 4px; color: #fffaf0; background: rgba(40,40,33,.94); box-shadow: 0 10px 28px rgba(40,40,33,.2); font-size: 11px; line-height: 1.45; text-align: center; backdrop-filter: blur(16px); }
.network-status[hidden] { display: none; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.divider { height: 1px; margin: 20px 0; background: var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.auth-screen { min-height: 100dvh; display: grid; align-content: space-between; padding: max(58px,env(safe-area-inset-top)) 22px max(34px,env(safe-area-inset-bottom)); background: radial-gradient(circle at 84% 16%,rgba(216,93,66,.18),transparent 28%),linear-gradient(155deg,#f8f2e6,#e8dfcf); }
.auth-brand { padding: 18px 2px 38px; }
.auth-brand .boot-mark { margin: 0 0 34px; }
.auth-brand h1 { margin: 14px 0 16px; font: 600 clamp(38px,12vw,58px)/1.02 var(--serif); letter-spacing: -.05em; }
.auth-brand p:last-child { max-width: 340px; color: var(--muted); line-height: 1.75; }
.auth-brand.compact h1 { font-size: 38px; }
.auth-brand.compact .back-btn { margin-bottom: 36px; }
.auth-card { padding: 20px; border: 1px solid rgba(105,92,71,.15); border-radius: 6px 26px 6px 6px; background: rgba(255,253,247,.78); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.otp-input { text-align: center; letter-spacing: .55em; font-variant-numeric: tabular-nums; }
.legal-links { display: flex; justify-content: center; gap: 8px; margin: 14px 0 0; color: var(--muted); font-size: 10px; }
.legal-links a { text-underline-offset: 3px; }
.profile-page { padding-top: 6px; }
.profile-card { display: grid; justify-items: center; gap: 10px; padding: 24px 18px 20px; border-radius: 4px 28px 4px 4px; color: var(--paper); background: var(--ink); text-align: center; }
.profile-card img { width: 76px; height: 76px; border: 3px solid rgba(255,255,255,.22); border-radius: 50%; object-fit: cover; }
.profile-card h2 { margin: 0 0 5px; font: 600 26px var(--serif); }
.profile-card p { max-width: 100%; margin: 0; overflow-wrap: anywhere; color: rgba(255,255,255,.62); font-size: 11px; }
.profile-card .mini-btn { min-height: 40px; color: var(--paper); border-color: rgba(255,255,255,.28); background: transparent; }
.profile-page .section-head { align-items: center; justify-content: center; text-align: center; }
.profile-page .section-head > div { width: 100%; }
.settings-section { margin-top: 2px; }
.settings-list { overflow: hidden; gap: 0; border: 1px solid rgba(120,110,94,.17); border-radius: 4px 22px 4px 4px; background: var(--surface); }
.settings-row { min-height: 66px; grid-template-columns: 44px minmax(0,1fr) 44px; gap: 8px; padding: 10px 12px; border: 0; border-radius: 0; background: transparent; text-align: center; }
.settings-row + .settings-row { border-top: 1px solid rgba(120,110,94,.13); }
.settings-row > div { min-width: 0; }
.settings-row .avatar { width: 40px; height: 40px; justify-self: start; }
.settings-row h3 { margin: 0; font-size: 13px; }
.settings-row p { margin-top: 3px; font-size: 10px; }
.settings-row .arrow { justify-self: center; }
.settings-row.sign-out-row h3 { color: var(--danger); }
.draft-list .person-row > div { min-width: 0; text-align: center; }
.icon-avatar { display: grid; place-items: center; }
.icon-avatar svg { width: 22px; }
.avatar-editor { display: flex; align-items: center; gap: 16px; }
.avatar-editor img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; }
.place-search-panel { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 4px 18px 4px 4px; background: rgba(255,253,247,.55); }
.place-search-panel[hidden] { display: none; }
.provider-note { margin: 0; color: var(--muted); font-size: 10px; }
.place-results { display: grid; gap: 6px; }
.place-result { min-height: 58px; display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px 14px 3px 3px; color: var(--ink); background: var(--surface); text-align: left; }
.place-result strong, .place-result span, .selected-place strong, .selected-place span { display: block; }
.place-result strong, .selected-place strong { font-size: 12px; }
.place-result span, .selected-place span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.selected-place { padding: 12px; border-left: 3px solid var(--sage); background: var(--sage-light); }
.story-gallery { display: flex; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; touch-action: pan-x pan-y pinch-zoom; scrollbar-width: none; background: #d8d0c2; }
.story-gallery::-webkit-scrollbar { display: none; }
.story-gallery:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.story-gallery figure { position: relative; min-width: 100%; height: min(125vw,72dvh,690px); margin: 0; scroll-snap-align: start; scroll-snap-stop: always; background: #272721; }
.story-photo { width: 100%; height: 100%; min-height: 44px; padding: 0; border: 0; background: transparent; display: block; }
.story-gallery img { width: 100%; height: 100%; object-fit: contain; object-position: center; background: #272721; }
.story-gallery figcaption { position: absolute; right: 14px; bottom: 14px; min-width: 48px; padding: 6px 10px; border-radius: 99px; color: white; background: rgba(20,20,17,.58); text-align: center; font-size: 10px; backdrop-filter: blur(8px); }
.photo-backdrop { align-items: center; background: rgba(17,17,14,.92); }
.photo-viewer { width: min(100%,760px); height: 100%; padding: max(18px,env(safe-area-inset-top)) 16px max(18px,env(safe-area-inset-bottom)); display: grid; grid-template-rows: 48px minmax(0,1fr) 54px; color: white; overscroll-behavior: contain; }
.photo-viewer > img { width: 100%; height: 100%; object-fit: contain; object-position: center; background: #272721; touch-action: pinch-zoom; }
.photo-close { justify-self: end; width: 44px; height: 44px; border: 0; border-radius: 50%; color: white; background: rgba(255,255,255,.12); }
.photo-close svg { width: 22px; height: 22px; }
.photo-viewer-nav { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; text-align: center; }
.photo-viewer-nav button { width: 44px; height: 44px; border: 0; border-radius: 50%; color: white; background: rgba(255,255,255,.12); font-size: 28px; }
.photo-viewer-nav button:last-child { justify-self: end; }
.story-intro { padding: 10px 18px 22px; background: var(--paper); }
.story-heading { padding: 4px 0 8px; }
.story-heading h2 { margin: 8px 0 16px; font: 600 clamp(34px,10vw,48px)/1.02 var(--serif); letter-spacing: -.04em; }
.place-link { width: 100%; min-height: 62px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px 16px 3px 3px; color: var(--ink); background: var(--surface); text-align: left; }
.place-link svg { width: 22px; color: var(--accent); }
.place-link span, .place-link small { display: block; }
.place-link span { font-weight: 700; }
.place-link small { margin-top: 3px; color: var(--muted); font-weight: 400; }

@media (min-width: 760px) {
  body { padding: 24px 0; }
  #app { min-height: calc(100dvh - 48px); border-radius: 12px 42px 12px 12px; }
  .bottom-nav { bottom: 24px; border-radius: 0 0 12px 12px; }
  .modal-backdrop { align-items: center; }
  .modal { max-height: 82dvh; border-radius: 8px 32px 8px 8px; box-shadow: var(--shadow); }
}

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