@import url('/design-tokens.css');
/* Material primitives. Compiled Tailwind utilities can sit alongside these. */
:root {
  color-scheme: light;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --shadow: 0 3px 8px #402b1920, 0 1px 2px #402b1914;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 7rem; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--linen) url('/textures/linen-cream.png') repeat;
  background-size: 128px 128px;
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: .18em; }
a:hover { text-decoration-color: var(--muted); }
button, input, select, textarea, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid #2d604f; outline-offset: 4px; }
[hidden] { display: none !important; }
::selection { background: #dbc79e; color: #2b2018; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 400; font-family: var(--serif); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 400; font-family: var(--serif); }
h3 { font-size: 1.05rem; }
small { font-size: .8rem; }
hr { height: 1px; margin: 1.5rem 0; border: 0; background: var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 30; top: 8px; left: 8px; padding: 12px 16px; border-radius: 6px; background: var(--paper); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.muted, .hint { color: var(--muted); }
.hint { font-size: .86rem; line-height: 1.5; }
.serif { font-family: var(--serif); font-weight: 400; }
.italic { font-style: italic; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: .5rem; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.grow { flex: 1; min-width: 0; }
.text-center { text-align: center; }
.wrap-anywhere { overflow-wrap: anywhere; }
.section-gap { margin-top: 24px; }
.app-header, .mobile-nav {
  color: var(--cream);
  background: linear-gradient(#ffffff09, #00000024), url('/textures/leather-brown.png') repeat;
  background-size: auto, 128px 128px;
  box-shadow: 0 3px 6px #39231230;
}
.app-header { position: relative; z-index: 10; border-top: 1px solid #947052; border-bottom: 7px solid #4c3220; }
.app-header::before, .app-header::after { content: ''; position: absolute; left: 8px; right: 8px; height: 1px; border-top: 2px dashed #e4c99c; filter: drop-shadow(0 1px 0 #2d1d16); pointer-events: none; }
.app-header::before { top: 6px; }
.app-header::after { bottom: 4px; }
.header-inner { max-width: 1360px; min-height: 76px; padding: 12px 28px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.brand { max-width: 305px; color: var(--cream); font: italic 1.3rem/1.16 var(--serif); text-align: center; text-decoration: none; text-shadow: 0 1px 1px #382417; }
.brand span { display: block; }
.brand:hover { color: #fffaf0; }
.desktop-nav, .header-actions { display: flex; align-items: center; gap: 10px; }
.desktop-nav { margin-left: auto; }
.header-actions { margin-left: auto; }
.button, .nav-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.1rem;
  border: 1px solid #b29a75;
  border-radius: 8px;
  color: #5b422e;
  background: linear-gradient(#fffcf3, #e4d5b5);
  box-shadow: inset 0 1px 0 #ffffffab, 0 2px 3px #39271738;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: transform var(--motion-press) cubic-bezier(.23, 1, .32, 1);
}
.button:hover, .nav-link:hover { filter: brightness(1.045); text-decoration: none; }
.button:active, .nav-link:active { transform: translateY(1px) scale(.98); box-shadow: inset 0 2px 3px #3927172e; }
.button:focus-visible, .nav-link:focus-visible { transition: none; }
.button-leather, .desktop-nav .nav-link { color: var(--cream); border-color: #3b2517; border-top-color: #cfb997; background: linear-gradient(#785337, #4c321f); box-shadow: inset 0 1px 0 #cbb89840, 0 2px 2px #2f1c1b45; }
.button-leather:focus-visible, .desktop-nav :focus-visible, .mobile-nav :focus-visible { outline-color: #f8eac9; }
.desktop-nav .nav-link { min-width: 84px; padding: .9rem 1.1rem; }
.nav-link[aria-current='page'] { color: #f4cc8a; background: linear-gradient(#362217, #523521); box-shadow: inset 0 2px 5px #24180a50; }
.button[aria-pressed='true'], .button-liked { color: var(--red); background: #e8ddc1; box-shadow: inset 0 2px 4px #533b2a38, inset 0 1px 0 #79604624; }
.button-danger { color: var(--red); }
.button-full { width: 100%; }
.button-small { min-height: 36px; padding: .45rem .75rem; font-size: .84rem; }
.button-plain { border-color: transparent; box-shadow: none; background: none; text-decoration: underline; text-underline-offset: .18em; }
.button-icon { width: 44px; padding: .65rem; }
.button svg, .nav-link svg { width: 20px; height: 20px; flex: none; stroke: currentColor; }
.private-badge { border: 1px solid #d8c0965a; color: #f0dfbd; padding: .3rem .55rem; border-radius: 4px; font-size: .74rem; white-space: nowrap; }
.linen-edge { position: relative; }
.linen-edge::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 8px; background: #fcf6e2; clip-path: polygon(0 0, 100% 0, 100% 40%, 98% 100%, 96% 45%, 94% 100%, 92% 45%, 90% 100%, 88% 45%, 86% 100%, 84% 45%, 82% 100%, 80% 45%, 78% 100%, 76% 45%, 74% 100%, 72% 45%, 70% 100%, 68% 45%, 66% 100%, 64% 45%, 62% 100%, 60% 45%, 58% 100%, 56% 45%, 54% 100%, 52% 45%, 50% 100%, 48% 45%, 46% 100%, 44% 45%, 42% 100%, 40% 45%, 38% 100%, 36% 45%, 34% 100%, 32% 45%, 30% 100%, 28% 45%, 26% 100%, 24% 45%, 22% 100%, 20% 45%, 18% 100%, 16% 45%, 14% 100%, 12% 45%, 10% 100%, 8% 45%, 6% 100%, 4% 45%, 2% 100%, 0 45%); pointer-events: none; }
.main-shell { max-width: 1220px; margin: 0 auto; padding: 38px var(--space-28) 60px; }
.page-layout { display: grid; grid-template-columns: minmax(0, 680px) minmax(250px, 1fr); align-items: start; gap: 30px; }
.feed-layout { max-width: 680px; margin-inline: auto; }
.main-column { min-width: 0; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading p { margin-top: .6rem; }
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 24px; min-width: 0; }
.feed-list { display: flex; flex-direction: column; gap: var(--space-28); }
.paper-card, .section-card, .post-card, .stat-card, .person-card {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: linear-gradient(#faf6eced, #faf6eced), url('/textures/paper-cream.png') repeat;
  background-size: auto, 128px 128px;
  box-shadow: var(--shadow);
}
.paper-card, .section-card { padding: 26px; }
.paper-card > * + *, .section-card > * + * { margin-top: 1rem; }
.paper-card.stack > * + *, .section-card.stack > * + * { margin-top: 0; }
.stack > .stat-grid, .stack > .page-heading { margin-top: 0; margin-bottom: 0; }
.paper-card > .cluster, .section-card > .cluster { margin-top: 1.2rem; }
.stitched { position: relative; padding-top: 33px; }
.stitched::before { content: ''; position: absolute; top: 12px; left: 12px; right: 12px; border-top: 2px dashed #765c3e; }
.post-card { padding: 20px; }
.post-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.avatar { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; overflow: hidden; border: 2px solid #fff8ee; border-radius: 7px; box-shadow: 0 2px 3px #3927172b; color: #fff8e8; background: linear-gradient(#cb7c46, #97492f); font: bold 1.55rem/1 var(--serif); text-decoration: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-large { width: 80px; height: 80px; font-size: 3rem; }
.avatar-blue { background: linear-gradient(#6287a8, #3f6183); }
.avatar-green { background: linear-gradient(#73865f, #465b38); }
.person-info { min-width: 0; flex: 1; }
.person-name { display: block; font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.person-name:hover { text-decoration: underline; }
.person-info .muted { display: block; font-size: .86rem; }
.post-time { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.photo-mat { padding: 10px; background: #fffaf0; box-shadow: 0 3px 7px #402b1938; }
.photo-image { width: 100%; aspect-ratio: 1; object-fit: cover; background: #e8ddc6; }
.post-actions { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; }
.post-actions form { margin: 0; }
.post-actions > :last-child { margin-left: auto; }
.post-actions > :only-child { margin-left: 0; }
.post-caption { font: italic 1.25rem/1.4 var(--serif); overflow-wrap: anywhere; white-space: pre-wrap; }
.post-meta { font-size: .84rem; color: var(--muted); margin: 12px 0; }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding: 0; list-style: none; }
.comment { font-size: .92rem; overflow-wrap: anywhere; }
.comment-author { font-weight: 650; margin-right: .35rem; text-decoration: none; }
.comment-actions { display: inline-flex; gap: .5rem; margin-left: .5rem; }
.comment-actions .button { min-height: 28px; padding: .1rem .3rem; font-size: .75rem; }
.comment-form { display: flex; align-items: start; gap: 8px; margin-top: 16px; }
.comment-form textarea, .comment-form input { flex: 1; min-width: 0; }
.post-menu { position: relative; margin-left: auto; }
.post-menu summary { list-style: none; }
.post-menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 2; min-width: 180px; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; box-shadow: var(--shadow); }
.menu-panel .button { width: 100%; justify-content: flex-start; }
.caught-up { padding: 36px 20px; text-align: center; border-top: 2px dashed #b39b78; color: var(--muted); }
.caught-up h2 { margin-bottom: .5rem; color: var(--ink); }
.empty-state { padding: 42px 24px; text-align: center; }
.empty-state > * + * { margin-top: 1rem; }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 1.5rem; color: #8d7351; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field > label, .field-label { font-weight: 650; font-size: .93rem; }
.form-field > label .hint { display: block; font-weight: 400; margin-top: 2px; }
input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']), textarea, select {
  width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid #b29b77; border-radius: 7px; color: var(--ink);
  background: linear-gradient(#e7decd, #f8f1e6); box-shadow: inset 0 2px 3px #432d1c15;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { min-height: 110px; resize: vertical; }
input[type='file'] { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 10px; color: var(--muted); background: #faf5e7; }
input[type='file']::file-selector-button { border: 1px solid #ac9572; border-radius: 5px; padding: 8px 10px; margin-right: 12px; color: #60442e; background: linear-gradient(#fffcf3, #e4d5b5); font-weight: 600; cursor: pointer; }
input[type='checkbox'], input[type='radio'] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--leather); }
input[type='range'] { accent-color: var(--leather); min-height: 30px; width: 100%; }
input[readonly] { color: var(--muted); }
.checkbox-field { display: flex; align-items: start; gap: 10px; }
.checkbox-field label { flex: 1; }
.checkbox-field .hint { display: block; margin-top: .25rem; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 1.5rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-error { color: var(--red); font-size: .84rem; }
.notice { padding: 14px 18px; border: 1px solid #b3b891; border-radius: 5px; background: #f0f0da; color: #3f5233; margin-bottom: 22px; font-size: .92rem; overflow-wrap: anywhere; }
.notice-error { color: #803829; background: #f7e9df; border-color: #c9a58c; }
.notice-info { background: #f7eed9; color: #694c30; border-color: #c5b08a; }
.notice:empty { display: none; }
.auth-shell { max-width: 600px; margin: 20px auto 0; }
.auth-card { padding: 38px; }
.auth-card > h1, .auth-card > .auth-intro { text-align: center; }
.auth-intro { color: var(--muted); line-height: 1.65; }
.auth-card > * + * { margin-top: 22px; }
.auth-card form { display: flex; flex-direction: column; gap: 20px; }
.auth-card form .form-actions { margin-top: 0; }
.auth-footer { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 24px; }
.code-input { font: 1.6rem/1.4 ui-monospace, monospace; letter-spacing: .32em; text-align: center; }
.envelope { width: 160px; height: 118px; position: relative; margin: 0 auto 30px; border: 1px solid #bda781; background: #faf5e9; box-shadow: 0 5px 10px #37261826; overflow: hidden; }
.envelope::before { content: ''; position: absolute; width: 116px; height: 116px; left: 21px; top: -68px; border: 1px solid #bda781; background: linear-gradient(135deg, #fcf8ed, #e1d2b5); transform: rotate(45deg); }
.envelope::after { content: 'admit one friend'; position: absolute; left: 0; right: 0; bottom: 17px; color: #856c4c; text-align: center; font: .68rem/1.4 ui-monospace, monospace; letter-spacing: .04em; }
.landing { max-width: 1080px; margin: 18px auto; }
.landing-layout { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 40px; }
.landing h1 { font-size: clamp(2.65rem, 6vw, 4.6rem); line-height: 1.12; }
.landing-copy { color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.landing-note { transform: rotate(1deg); padding: 40px 34px; }
.landing-note h2 { line-height: 1.35; }
.landing-note p { color: var(--muted); }
.landing-links { margin-top: 28px; }
.features-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-direction: column; gap: 1rem; }
.features-list li { display: flex; gap: .65rem; }
.features-list li::before { content: '✓'; color: var(--green); font-weight: 600; }
.app-footer { max-width: 1220px; margin: auto; padding: 0 28px 30px; display: flex; align-items: center; justify-content: flex-end; gap: 20px; color: var(--muted); font-size: .8rem; }
.app-footer a { margin-left: .8rem; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.stat-card { padding: 20px; }
.stat-value { font: 2.5rem/1.1 var(--serif); display: block; margin-bottom: .4rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.stat-value-points { font-size: 1.8rem; }
.stat-label { font-size: .8rem; color: var(--muted); }
.progress-label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 8px; font-size: .86rem; }
progress { display: block; width: 100%; height: 12px; border: 1px solid #b6a17d; border-radius: 10px; overflow: hidden; background: #e7dcc5; accent-color: #7d5838; }
progress::-webkit-progress-bar { background: #e7dcc5; box-shadow: inset 0 1px 3px #48311c25; }
progress::-webkit-progress-value { background: linear-gradient(#98734c, #654228); }
progress::-moz-progress-bar { background: linear-gradient(#98734c, #654228); }
.invite-list, .people-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.invite-row, .person-row { padding: 18px 0; border-bottom: 1px dashed var(--line); }
.invite-row:last-child, .person-row:last-child { border-bottom: 0; }
.invite-row > * + * { margin-top: 10px; }
.invite-link { display: flex; gap: 8px; }
.invite-link input { min-width: 0; flex: 1; font-size: .8rem; }
.invite-link .button { flex: none; }
.invite-status { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.badge { display: inline-flex; padding: .2rem .55rem; border: 1px solid #c6b48d; border-radius: 4px; color: #6b553b; background: #ede2cb; font-size: .76rem; line-height: 1.5; }
.badge-success { background: #e3e8d3; border-color: #a5b391; color: #45583a; }
.badge-error { background: #f0dfd4; border-color: #c6a08c; color: #8c4330; }
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.person-card { padding: 20px; }
.person-card .person-head { display: flex; gap: 12px; align-items: center; }
.person-card > * + * { margin-top: 16px; }
.person-row { display: flex; align-items: center; gap: 12px; }
.person-row .person-info { min-width: 0; }
.person-row .person-actions { display: flex; flex-wrap: wrap; gap: 6px; flex: none; }
.search-form { display: flex; align-items: center; gap: 8px; }
.search-form input { min-width: 0; }
.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 26px; }
.profile-header h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.profile-bio { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 1rem; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.photo-grid .photo-mat { padding: 6px; transition: transform .15s; }
@media (hover: hover) and (pointer: fine) { .photo-grid a:hover .photo-mat { transform: rotate(-1deg); } }
.photo-grid a:focus-visible .photo-mat { transition: none; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.tab-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px dashed var(--line); }
.tab-list a[aria-current='page'] { box-shadow: inset 0 2px 3px #543b2520; background: #e4d5b5; }
.upload-preview { position: relative; width: min(100%, 510px); min-width: 0; max-width: 100%; margin: auto; }
.upload-preview .photo-image { object-position: var(--crop-x, 50%) var(--crop-y, 50%); }
.upload-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-width: 0; min-height: 0; aspect-ratio: 1; gap: 16px; border: 2px dashed #bca783; background: #ebe2ce99; color: var(--muted); text-align: center; padding: clamp(16px, 4vw, 26px); }
.upload-placeholder svg { width: 58px; height: 58px; stroke: #8b7453; }
.upload-file-label { display: block; cursor: pointer; }
.crop-controls { padding: 16px; border: 1px solid var(--line); border-radius: 4px; background: #efe5d1; }
.crop-controls .field-grid { gap: 20px; }
.upload-progress { margin: 0; }
.upload-progress progress { margin-top: 8px; }
.referral-tree { margin: 0; padding: 0; list-style: none; }
.referral-tree ul { margin: 10px 0 0 10px; padding-left: 20px; border-left: 1px dashed var(--line); list-style: none; }
.referral-tree li { padding: 10px 0; }
.tree-person { display: flex; align-items: center; gap: 10px; }
.tree-person .avatar { width: 32px; height: 32px; font-size: 1.1rem; }
.tree-person .badge { margin-left: auto; }
.formula { display: block; padding: 16px; background: #ebe1ca; border-radius: 4px; color: #59432e; font: .9rem/1.7 ui-monospace, monospace; overflow-wrap: anywhere; }
.table-wrap { max-width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.data-table th { text-align: left; color: var(--muted); font-size: .76rem; font-weight: 600; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid #d5c5a7; vertical-align: top; }
.data-table th:first-child, .data-table td:first-child { padding-left: 0; }
.data-table th:last-child, .data-table td:last-child { padding-right: 0; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table form { display: inline; }
.account-danger { border-color: #c59d80; }
.install-panel .button { margin-top: 12px; }
.mobile-nav { display: none; }
.toast { position: fixed; z-index: 40; bottom: 30px; left: 50%; max-width: calc(100% - 32px); padding: 12px 20px; color: #fff6e2; border: 1px solid #b49369; border-radius: 7px; background: #493421; box-shadow: 0 4px 15px #241a1440; text-align: center; transform: translateX(-50%); }
.policy-copy { max-width: 760px; }
.policy-copy p, .policy-copy ul { margin-top: 1rem; }
.policy-copy h2 { margin-top: 2rem; }
.policy-copy ul { padding-left: 1.5rem; }
@media (min-width: 1100px) {
  .app-header { position: sticky; top: 0; }
  .sidebar { top: 108px; }
}
@media (max-width: 1099px) {
  .header-inner { gap: 18px; padding: 12px 22px; }
  .brand { max-width: 260px; font-size: 1.35rem; }
  .desktop-nav { gap: 7px; }
  .desktop-nav .nav-link { min-width: 65px; padding: .8rem .8rem; }
  .header-actions .button { font-size: .84rem; padding: .7rem .8rem; }
  .page-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; }
  .paper-card, .section-card { padding: 22px; }
}
@media (max-width: 800px) {
  .app-header { border-bottom-width: 5px; }
  .header-inner { min-height: 72px; padding: 12px 18px; gap: 14px; }
  .brand { max-width: 290px; text-align: left; font-size: 1.25rem; }
  .desktop-nav { display: none; }
  .header-actions { gap: 7px; }
  .header-post { display: none; }
  .main-shell { max-width: 680px; padding: 28px 18px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .page-layout { display: flex; flex-direction: column; gap: 28px; }
  .main-column { width: 100%; }
  .sidebar { position: static; width: 100%; }
  .sidebar .desktop-only { display: none; }
  .mobile-nav { display: grid; position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; gap: 0; padding: 8px 8px calc(7px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #382214; box-shadow: 0 -2px 5px #39231230; }
  .mobile-nav::before { content: ''; position: absolute; top: 4px; left: 7px; right: 7px; border-top: 1px dashed #dbc49b; }
  .mobile-nav .nav-link { position: relative; flex-direction: column; gap: 3px; padding: 5px 2px 3px; min-height: 54px; border: 0; border-radius: 0; color: #edd4ac; background: transparent; box-shadow: none; font-size: .68rem; font-weight: 400; line-height: 1.2; transition: color .12s ease; }
  .mobile-nav .nav-icon { display: grid; place-items: center; width: 32px; height: 30px; border-radius: 4px; }
  .mobile-nav .nav-link svg { width: 20px; height: 20px; }
  .mobile-nav .nav-link:hover { color: #fff4d9; filter: none; }
  .mobile-nav .nav-link:active { transform: translateY(1px); box-shadow: none; }
  .mobile-nav .nav-link[aria-current='page'] { color: #f4cc8a; background: transparent; box-shadow: none; }
  .mobile-nav .nav-link[aria-current='page'] .nav-icon { background: #38241473; box-shadow: inset 0 1px 3px #25160c50, 0 1px 0 #dec7a126; }
  .mobile-nav .nav-link-photo { justify-self: center; width: 56px; min-height: 44px; padding: 0; margin-top: -2px; border: 1px solid #b29b75; border-top-color: #fffaf0; border-radius: 7px; color: #59422b; background: linear-gradient(#fffaf0, #e0d1b0); box-shadow: inset 0 1px 0 #ffffffb3, 0 2px 3px #24170b50; }
  .mobile-nav .nav-link-photo .nav-icon { width: 28px; height: 28px; }
  .mobile-nav .nav-link-photo svg { width: 26px; height: 26px; }
  .mobile-nav .nav-link-photo:hover { color: #59422b; }
  .mobile-nav .nav-link-photo:active, .mobile-nav .nav-link-photo[aria-current='page'] { color: #59422b; background: linear-gradient(#e5d7ba, #f4ead4); box-shadow: inset 0 2px 4px #4e351930; }
  .mobile-nav .nav-link-photo[aria-current='page'] .nav-icon { background: transparent; box-shadow: none; }
  .mobile-nav .nav-link:focus-visible { outline-color: #fff3d8; transition: none; }
  .app-footer { display: none; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .landing-layout { grid-template-columns: 1fr; gap: 30px; }
  .landing h1 { font-size: 3rem; }
  .landing-note { transform: rotate(.6deg); padding: 28px; }
  .auth-shell { margin-top: 10px; }
  .auth-card { padding: 30px; }
}
@media (max-width: 480px) {
  body { font-size: 15px; }
  .header-inner { min-height: 72px; gap: 10px; padding: 12px 16px; }
  .brand { max-width: 235px; font-size: 1.15rem; }
  .header-actions .button { padding: .6rem .65rem; font-size: .8rem; min-height: 44px; }
  .header-actions .private-badge { display: none; }
  .main-shell { padding: 25px 14px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .page-heading { align-items: start; gap: 12px; margin-bottom: 20px; }
  .page-heading h1 { font-size: 2rem; }
  .page-heading > .button { flex: none; }
  .feed-list { gap: 22px; }
  .post-card { padding: 16px; }
  .post-header { gap: 10px; margin-bottom: 14px; }
  .photo-mat { padding: 7px; }
  .post-actions { gap: 8px; margin: 16px 0 12px; }
  .post-actions .button { padding: .65rem .8rem; font-size: .88rem; }
  .post-actions .button-icon { width: 44px; padding: .65rem; }
  .post-caption { font-size: 1.18rem; }
  .paper-card, .section-card { padding: 20px; }
  .stitched { padding-top: 30px; }
  .stat-grid { gap: 8px; }
  .stat-grid:has(.stat-value-points) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid:has(.stat-value-points) .stat-card:has(.stat-value-points) { grid-column: 1 / -1; grid-row: 2; }
  .stat-card { padding: 14px 10px; }
  .stat-value { font-size: 2rem; }
  .stat-value-points { font-size: 1.45rem; }
  .stat-label { font-size: .73rem; }
  .people-grid { grid-template-columns: 1fr; }
  .person-row { flex-wrap: wrap; }
  .person-row .person-actions { margin-left: 56px; }
  .person-row .person-actions:empty { display: none; }
  .field-grid { grid-template-columns: 1fr; }
  .crop-controls .field-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .profile-header { gap: 14px; }
  .avatar-large { width: 65px; height: 65px; font-size: 2.5rem; }
  .photo-grid { gap: 8px; }
  .photo-grid .photo-mat { padding: 4px; }
  .auth-card { padding: 27px 22px; }
  .auth-card h1 { font-size: 2.15rem; }
  .auth-card > * + * { margin-top: 22px; }
  .auth-shell .envelope { margin-bottom: 26px; }
  .landing h1 { font-size: 2.7rem; }
  .landing-note { padding: 26px; }
  .invite-link { flex-wrap: wrap; }
  .invite-link input { flex-basis: calc(100% - 75px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
