:root {
    --paper: #faf8f1;
    --ink: #20294c;
    --muted: #5c6578;
    --line: #e8e2d7;
    --white: #fffefa;
    --mint: #e1f0da;
    --peach: #ffe1d1;
    --coral: #f69578;
    --sun: #ffeab0;
    --lavender: #eee6fa;
    --green: #356451;
    --radius: 25px;
    --shadow: 0 10px 35px rgb(42 37 63 / 5%);
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background: var(--paper);
    font: 600 1rem/1.5 Nunito, "Trebuchet MS", system-ui, sans-serif;
}
[hidden] { display: none !important; }
img { max-width: 100%; vertical-align: middle; }
a { color: #304c74; text-underline-offset: .2em; }
a:hover { color: #243c59; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid #206fa1; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.13; letter-spacing: -.035em; font-weight: 1000; }
h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2.3rem); }
h3 { font-size: 1.26rem; }
small { font-size: .82rem; }
.shell { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }
.main-content { flex: 1; padding-block: 30px 64px; }
.muted { color: var(--muted); }
.multiline { white-space: pre-line; overflow-wrap: anywhere; }
.spaced { margin-top: 16px; }
.peach { background: var(--peach); }
.sun { background: var(--sun); }
.mint { background: var(--mint); }
.lavender { background: var(--lavender); }

.skip-link { position: fixed; z-index: 2000; left: 1rem; top: 1rem; transform: translateY(-200%); padding: 12px 18px; background: white; }
.skip-link:focus { transform: none; }
.site-header { position: relative; z-index: 1050; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { text-decoration: none; display: inline-flex; align-items: center; flex: 0 0 auto; gap: 8px; color: var(--ink); font-size: 1.76rem; line-height: 1; font-weight: 1000; letter-spacing: -.065em; }
.brand i { color: #b54536; font-style: normal; }
.brand img { border-radius: 15px; }
.desktop-nav { display: flex; align-items: center; gap: 5px; }
.desktop-nav a { text-decoration: none; color: var(--muted); font-weight: 850; padding: 9px 13px; border-radius: 999px; white-space: nowrap; font-size: .9rem; }
.desktop-nav a.active, .desktop-nav a:hover { color: var(--ink); background: #eee9df; }
.header-actions { display: flex; gap: 9px; align-items: center; }
.header-profile { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.round-link { appearance: none; display: inline-grid; position: relative; place-items: center; width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--ink); text-decoration: none; cursor: pointer; flex: none; }
.notification-dot { position: absolute; width: 9px; height: 9px; background: #b54536; border-radius: 50%; top: 6px; right: 5px; border: 1px solid white; }
.mobile-menu, .bottom-nav { display: none; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; top: 61px; right: 16px; display: grid; gap: 4px; min-width: 220px; padding: 10px; border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); background: var(--white); }
.menu-panel a { padding: 11px; border-radius: 10px; text-decoration: none; }
.menu-panel a:hover { background: var(--mint); }
.ui-icon { display: inline-grid; place-items: center; line-height: 1; font-size: 1.1em; vertical-align: -.08em; }
.ui-icon .bi, .icons-loaded .ui-icon > span { display: none; }
.icons-loaded .ui-icon .bi { display: inline-block; }
.pill {
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    border: 1px solid transparent; text-decoration: none; color: var(--ink); border-radius: 999px;
    min-height: 46px; padding: 9px 17px; background: var(--white); font-weight: 900; text-align: center;
    line-height: 1.23; cursor: pointer; transition: background .18s, transform .18s;
}
.pill:hover { color: var(--ink); transform: translateY(-1px); }
.pill:disabled { opacity: .63; cursor: wait; transform: none; }
.pill-primary { background: var(--coral); border-color: #e38267; box-shadow: 0 3px 0 #ce7056; }
.pill-primary:hover { background: #ffab92; }
.pill-white, .pill-ghost { background: var(--white); border-color: var(--line); }
.pill-ghost:hover, .pill-white:hover { background: #f0ece3; }
.pill-mint { background: var(--mint); border-color: #c9dfc2; }
.pill-mint:hover { background: #cce8c3; }
.pill-danger { background: #fae0df; border-color: #ecb9b5; color: #8a2a32; }
.pill-danger:hover { background: #f7cfcb; color: #7d1e2c; }
.inline-form { display: inline-flex; margin: 0; }
.actions, .text-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.text-links { gap: 9px 18px; }

.hero {
    display: grid; grid-template-columns: 1fr 1.05fr; align-items: center; gap: 12px;
    min-height: 438px; padding: clamp(30px, 4.5vw, 55px); background: #e3f2dc; border: 1px solid #d5e8ce;
    border-radius: clamp(24px, 4vw, 38px); position: relative; isolation: isolate; overflow: hidden;
}
.hero-copy { position: relative; z-index: 1; }
.hero-label { display: inline-flex; align-items: center; gap: 7px; background: #f6fbf1; color: #355b48; border-radius: 999px; padding: 7px 12px; font-weight: 900; font-size: .82rem; }
.hero h1 { margin: 17px 0 16px; font-size: clamp(2.75rem, 5.6vw, 5.1rem); line-height: .98; letter-spacing: -.066em; }
.hero h1 em { color: #a83f35; font-style: normal; }
.hero p { max-width: 365px; color: #41574e; font-size: clamp(1rem, 1.5vw, 1.13rem); font-weight: 700; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 16px; }
.hero-actions .pill { min-height: 49px; padding-inline: 19px; }
.find-link { display: inline-flex; align-items: center; gap: 7px; color: #36584b; font-weight: 900; font-size: .93rem; }
.hero-art { align-self: stretch; display: grid; align-items: center; justify-items: center; margin: -22px -27px -19px -30px; }
.hero-art img { width: 100%; height: auto; max-height: 420px; object-fit: contain; }
.stats-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.stat-item { display: flex; align-items: center; justify-content: center; gap: 13px; min-width: 0; padding: 16px 12px; }
.stats-strip .stat-item + .stat-item { border-left: 1px solid var(--line); }
.stat-icon { display: inline-grid; place-items: center; width: 47px; height: 47px; border-radius: 15px; font-size: 1.45rem; flex: none; }
.stat-item strong, .stat-item small { display: block; }
.stat-item strong { font-size: clamp(1.45rem, 3vw, 2.05rem); font-weight: 1000; line-height: 1; }
.stat-item small { margin-top: 4px; font-weight: 900; color: var(--muted); }
.feature-section { margin-top: clamp(27px, 5vw, 48px); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.section-heading p, .page-heading p { margin-top: 6px; color: var(--muted); }
.section-heading .pill { flex: none; }
.empty-card { display: flex; align-items: center; gap: 18px; padding: 19px 25px; border-radius: var(--radius); background: #f5ecfb; border: 1px solid #e7daf1; }
.empty-card strong, .empty-card a { display: block; }
.empty-card strong { font-size: 1.06rem; font-weight: 1000; }
.empty-card a { font-weight: 900; }
.empty-stone { display: grid; place-items: center; flex: 0 0 56px; width: 56px; height: 45px; color: #473456; font-size: 1.6rem; background: #cbb2ea; border: 2px solid #9d77c6; border-radius: 60% 48% 50% 44% / 65% 61% 44% 42%; transform: rotate(-10deg); box-shadow: inset -5px -6px 0 #b99bde; }
.steps-grid, .stone-grid, .dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step-card { border: 1px solid rgb(28 36 64 / 8%); border-radius: var(--radius); padding: 20px; }
.step-card > span { display: block; font-size: 1.8rem; margin-bottom: 7px; }
.step-card p { margin-top: 6px; color: #4c5063; }
.text-link { font-weight: 900; flex: none; }

.panel, .stone-card {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: clamp(16px, 3vw, 25px); min-width: 0;
}
.page-heading { margin-bottom: 20px; }
.page-heading > a, .page-heading > form { margin-top: 13px; }
.form-width { max-width: 680px; margin-inline: auto; }
.form-stack { display: grid; gap: 16px; }
.form-stack > .pill { justify-self: start; }
.form-columns, .filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.filter-grid { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); align-items: end; margin-bottom: 16px; }
.field { display: grid; gap: 5px; margin: 0; min-width: 0; }
.field > span, .field > legend, fieldset > legend { font-size: .93rem; font-weight: 950; }
.field small { color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; background: #fbfaf6; border: 1px solid #d4cfc3; padding: 9px 12px; border-radius: 12px; color: var(--ink); }
.field textarea { resize: vertical; }
.field-error, .field small.field-error { color: #9c302e; font-weight: 900; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: #518565; }
input[type=checkbox] { width: 18px; height: 18px; flex: none; margin-top: 3px; }
fieldset { min-width: 0; }
summary { cursor: pointer; font-weight: 900; }
.notice { border-radius: 14px; padding: 12px 16px; margin: 0 0 16px; border: 1px solid #c4dce7; background: #e5f1fb; color: #294e63; font-weight: 850; }
.notice-success { background: var(--mint); border-color: #c3dbb9; color: #214c30; }
.notice-error { background: #fae3df; border-color: #eac1bc; color: #8b2a2e; }
.empty { text-align: center; color: var(--muted); }
.article-panel, .error-panel { max-width: 800px; margin-inline: auto; }
.article-panel :is(h1, h2, h3, h4, p), .error-panel :is(h1, p) { margin-bottom: 14px; }
.article-panel h3 { margin-top: 20px; }
.article-panel li + li { margin-top: 6px; }
.pagination-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.photo-field { display: grid; gap: 12px; }
.photo-label { display: flex; justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 12px; background: #f9f2e2; border: 1px dashed #bca471; border-radius: 16px; padding: 12px 14px; cursor: pointer; }
.photo-label input { display: block; flex-basis: 100%; width: 100%; min-width: 0; }
.photo-label input::file-selector-button { border: 1px solid #ddd0b2; border-radius: 999px; background: #fffefa; color: var(--ink); padding: 7px 12px; margin-right: 8px; cursor: pointer; }
.photo-label small, .photo-label strong { display: block; }
.photo-icon { border-radius: 12px; width: 42px; height: 42px; background: #ffe4a4; display: grid; place-items: center; }
.photo-preview { max-height: 230px; width: auto; object-fit: contain; border-radius: 15px; justify-self: start; }

.avatar { display: inline-grid; vertical-align: middle; place-items: center; flex: 0 0 auto; width: 54px; height: 54px; font-size: 1.7rem; border-radius: 50%; }
.avatar-sm { width: 29px; height: 29px; font-size: 1rem; }
.avatar-lg { width: 44px; height: 44px; font-size: 1.4rem; }
.avatar-xl { width: clamp(66px, 10vw, 98px); height: clamp(66px, 10vw, 98px); font-size: clamp(2rem, 5vw, 3.5rem); }
.avatar-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-picker label { position: relative; cursor: pointer; }
.avatar-picker input { position: absolute; opacity: 0; }
.avatar-picker label > span { display: block; padding: 3px; border: 2px solid transparent; border-radius: 50%; }
.avatar-picker input:checked + span { border-color: #3b765c; }
.avatar-picker input:focus-visible + span { outline: 3px solid #206fa1; }
.oauth-actions:not(:empty) { margin-top: 12px; }
.profile-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.profile-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: clamp(17px, 4vw, 30px); border-radius: var(--radius); background: var(--lavender); }
.profile-hero h1 { overflow-wrap: anywhere; }
.profile-hero p { margin-top: 8px; }
.profile-hero progress { display: block; margin: 8px 0 2px; width: min(270px, 100%); accent-color: #508463; }
.profile-score { border-radius: 999px; padding: 8px 15px; background: var(--sun); font-weight: 1000; margin-left: auto; }
.profile-actions { margin-top: 15px; }
.activity-list { padding-block: 12px; }
.activity-list > p { padding: 7px 0; }
.activity-row { display: flex; align-items: center; gap: 13px; padding: 10px 0; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.activity-row + .activity-row { border-top: 1px solid var(--line); }
.activity-row img { object-fit: cover; border-radius: 13px; flex: 0 0 auto; }
.activity-row strong, .activity-row small { display: block; }
.activity-row small { color: var(--muted); }
.activity-row > :last-child:not(:nth-child(2)) { margin-left: auto; }
.note-row { width: 100%; }
.note-unread strong { color: #755928; }
.prefs { width: 100%; border-collapse: collapse; }
.prefs :is(th,td) { padding: 8px 5px; border-bottom: 1px solid var(--line); }
.prefs :is(th,td):not(:first-child) { text-align: center; }
.prefs th[scope=row] { font-weight: 600; }
.celebration { background: #fdf1c9; color: #594618; }
.confetti { position: fixed; inset: 0; z-index: 2000; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -12px; left: var(--x); width: 8px; height: 13px; border-radius: 2px; animation: confetti-fall 1.8s var(--delay) ease-in both; }
@keyframes confetti-fall { to { transform: translate(var(--drift), 102vh) rotate(530deg); opacity: .35; } }

.stone-card { padding: 0; overflow: hidden; }
.stone-card-link { display: block; color: var(--ink); text-decoration: none; height: 100%; }
.stone-card-link:focus-visible { outline-offset: -3px; }
.stone-card-link:hover strong { text-decoration: underline; }
.stone-thumb, .detail-image { position: relative; display: grid; place-items: center; min-height: 140px; aspect-ratio: 1.85; background: color-mix(in srgb, var(--stone-color) 42%, white); overflow: hidden; }
.pebble-thumb { display: grid; place-items: center; height: 70px; width: 88px; border-radius: 58% 45% 56% 45% / 68% 58% 43% 45%; background: var(--stone-color); box-shadow: inset -8px -9px 0 rgb(24 27 47 / 14%), 0 7px 0 rgb(24 27 47 / 11%); transform: rotate(-9deg); font-size: 2.1rem; }
.stone-thumb img, .detail-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stone-thumb .badge-diff { position: absolute; bottom: 8px; left: 8px; }
.stone-card-body { display: grid; justify-items: start; gap: 5px; padding: 12px 14px 15px; }
.stone-card-body strong { font-size: 1.13rem; font-weight: 1000; overflow-wrap: anywhere; }
.stone-card-body .muted { font-size: .84rem; }
.badge-diff, .badge-status { display: inline-block; padding: 4px 10px; border-radius: 999px; line-height: 1.25; font-weight: 900; font-size: .79rem; color: var(--ink); background: #eee9ea; }
.diff-easy, .status-hidden, .status-rehidden, .status-confirmed, .status-found { background: #e6f3d8; }
.diff-medium, .status-pending { background: #fff1b7; }
.diff-hard, .status-missing, .status-rejected { background: #f9ded1; }
.stone-detail { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); gap: 17px; align-items: start; }
.detail-image { min-height: 330px; aspect-ratio: 1.1; border-radius: var(--radius); }
.detail-image img { object-fit: contain; }
.detail-image .pebble-thumb { transform: scale(1.65) rotate(-9deg); }
.detail-copy { display: grid; gap: 13px; justify-items: start; }
.detail-copy h1 { overflow-wrap: anywhere; }
.byline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.hint-box { width: 100%; padding: 13px 15px; border-radius: 14px; background: #fff1c6; }
.hint-box p { overflow-wrap: anywhere; }
.compare-photos figure { margin: 0; min-width: 0; }
.compare-photos figcaption { font-weight: 900; margin-bottom: 6px; }
.compare-photos img { width: 100%; aspect-ratio: 1.25; object-fit: contain; border-radius: 13px; background: #f7f2e7; }
.mod-photo { display: grid; gap: 7px; align-self: start; }
.mod-photo img { width: 100%; max-width: 165px; border-radius: 13px; object-fit: cover; }

.map-controls { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: end; }
.map-controls > [data-gps] { grid-column: 1 / -1; justify-self: start; }
.map-toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-block: 12px; }
.map-toolbar > [data-location-status] { flex: 1; color: var(--muted); font-size: .9rem; }
.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--line); background: var(--white); border-radius: 999px; }
.segmented button { border: 0; background: transparent; color: var(--ink); padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.segmented button[aria-pressed=true] { background: var(--mint); font-weight: 950; }
.map-stage { position: relative; }
.map-canvas { min-height: clamp(340px, 57vh, 600px); isolation: isolate; background: #e4ebdd; border: 1px solid #c8d8c7; border-radius: 20px; overflow: hidden; z-index: 0; }
.map-picker { min-height: 270px; height: 32vh; }
.location-feedback:empty { display: none; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 6px; color: var(--muted); font-size: .9rem; font-weight: 850; }
.map-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.map-user-marker { pointer-events: none; }
.map-user-dot, .map-hiding-dot { display: inline-block; flex: none; width: 18px; height: 18px; border-radius: 50%; }
.map-user-dot { background: #236bc4; border: 3px solid #fff; box-shadow: 0 0 0 2px #236bc4; pointer-events: none; }
.map-hiding-dot { background: #ff947d; border: 2px solid #314463; }
.map-canvas[data-tile-error]::after { content: attr(data-tile-error); position: absolute; top: 10px; right: 10px; border-radius: 8px; padding: 4px 8px; background: var(--white); color: var(--muted); z-index: 800; font: .84rem Nunito, sans-serif; pointer-events: none; }
.map-pin { display: grid; place-items: center; width: 38px; height: 37px; color: var(--ink); font-size: 1.15rem; border: 2px solid #314463; border-radius: 52% 46% 49% 46%; background: var(--pin-color); box-shadow: 0 3px 0 #314463; }
.map-sheet { position: absolute; z-index: 1001; bottom: 14px; left: 14px; width: min(420px, calc(100% - 28px)); padding: 15px; }
.close-sheet { position: absolute; right: 9px; top: 9px; width: 35px; height: 35px; font-size: 1.23rem; }
.map-sheet .map-result { border: 0; padding: 0 33px 0 0; }
.map-feedback { margin: 9px 0; color: var(--muted); }
.map-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.map-result { display: flex; align-items: start; gap: 11px; min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 17px; background: var(--white); }
.map-result img { width: clamp(56px, 15vw, 88px); height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.map-result-title { font-weight: 1000; color: var(--ink); overflow-wrap: anywhere; }
.map-result p { color: var(--muted); font-size: .83rem; margin: 3px 0; }
.map-result .pill { margin-top: 6px; font-size: .85rem; min-height: 39px; }

.admin-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 17px; align-items: start; }
.admin-menu { padding: 15px; }
.admin-menu h2 { font-size: 1.25rem; margin-bottom: 10px; }
.admin-menu nav { display: grid; gap: 2px; }
.admin-menu a { display: block; padding: 7px 9px; text-decoration: none; font-weight: 850; border-radius: 10px; color: var(--ink); }
.admin-menu a[aria-current=page], .admin-menu a:hover { background: var(--mint); }
.dashboard-card { text-decoration: none; color: var(--ink); justify-content: flex-start; }
.admin-record { overflow-wrap: anywhere; padding: 12px 0; }
.admin-record + .admin-record { border-top: 1px solid var(--line); }
.admin-record p { margin-top: 6px; }
.admin-record > :is(a, small) { display: block; margin-top: 5px; }
.site-footer { border-top: 1px solid var(--line); background: #f1eee5; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 13px 20px; align-items: center; padding-block: 22px; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 8px 17px; }
.footer-inner nav a { color: var(--muted); text-decoration: none; font-size: .86rem; font-weight: 850; }
.footer-inner nav a:hover { text-decoration: underline; }

@media (max-width: 1040px) {
    .desktop-nav { gap: 0; }
    .desktop-nav a { padding-inline: 8px; }
    .header-profile { max-width: 130px; }
    .shell { width: calc(100% - 42px); }
    .hero { min-height: 385px; }
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 830px) {
    .desktop-nav, .header-hide, .header-profile { display: none; }
    .mobile-menu { display: block; }
    .header-inner { min-height: 65px; }
    .main-content { padding-block: 19px 37px; }
    body { padding-bottom: calc(65px + env(safe-area-inset-bottom)); }
    .bottom-nav {
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
        position: fixed; inset: auto 0 0; z-index: 1100; min-height: calc(60px + env(safe-area-inset-bottom));
        padding: 5px 5px max(5px, env(safe-area-inset-bottom));
        background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -3px 20px rgb(23 27 52 / 5%);
    }
    .bottom-nav a { display: grid; gap: 2px; justify-items: center; align-content: center; border-radius: 12px; min-height: 49px; color: #50566b; text-decoration: none; font-size: clamp(.64rem, 2.8vw, .79rem); font-weight: 900; }
    .bottom-nav a.active { color: var(--green); background: #eaf4e4; }
    .bottom-icon { position: relative; line-height: 1; font-size: 1.1rem; padding: 3px 8px; border-radius: 9px; }
    .bottom-hide .bottom-icon { background: var(--peach); color: #813b36; }
    .bottom-icon .notification-dot { top: 0; right: 1px; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-menu nav { display: flex; gap: 4px; flex-wrap: wrap; }
    .admin-menu a { background: #f7f3ea; padding: 7px 10px; font-size: .88rem; }
}
@media (max-width: 620px) {
    .shell { width: calc(100% - 28px); }
    .brand { font-size: 1.55rem; }
    .hero { grid-template-columns: 1fr; gap: 0; padding: 23px 20px 0; }
    .hero h1 { font-size: clamp(2.4rem, 10.8vw, 4.2rem); }
    .hero p { max-width: 420px; }
    .hero-actions { margin-top: 17px; margin-bottom: 11px; gap: 9px; }
    .hero-actions .pill { min-height: 44px; padding-inline: 12px; font-size: .88rem; }
    .hero-art { margin: 0 -18px -4px; }
    .hero-art img { max-height: 220px; }
    .stats-strip { margin-top: 13px; }
    .stat-item { flex-direction: column; text-align: center; gap: 5px; padding: 10px 4px; }
    .stat-icon { width: 36px; height: 36px; border-radius: 12px; font-size: 1.18rem; }
    .stat-item small { font-size: .72rem; line-height: 1.15; }
    .section-heading { gap: 8px; }
    .section-heading .pill { min-height: 38px; font-size: .82rem; padding-inline: 11px; }
    .section-heading p { font-size: .89rem; }
    .empty-card { padding: 13px; gap: 12px; }
    .steps-grid, .stone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .step-card { padding: 13px; border-radius: 16px; }
    .steps-grid .step-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .step-card p { font-size: .89rem; }
    .stone-thumb { min-height: 95px; }
    .stone-card { border-radius: 15px; }
    .stone-card-body { padding: 9px; }
    .stone-card-body strong { font-size: .97rem; }
    .stone-card-body .muted { font-size: .73rem; }
    .stone-detail, .map-results { grid-template-columns: 1fr; }
    .detail-image { min-height: 205px; aspect-ratio: 1.55; }
    .map-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .map-controls [data-city] { min-width: 0; }
    .map-toolbar > [data-location-status] { order: 1; flex-basis: 100%; }
    .map-stage .map-canvas { min-height: 390px; }
    .note-row { flex-wrap: wrap; }
    .note-row > div { flex: 1; }
    .note-row .pill { min-height: 36px; font-size: .83rem; }
    .activity-row { gap: 8px; }
    .activity-row .badge-status { max-width: 114px; }
    .profile-score { margin-left: 0; }
    .footer-inner { padding-block: 17px; }
}
@media (max-width: 360px) {
    .hero { padding-inline: 13px; }
    .hero-actions .pill { gap: .32rem; padding-inline: 8px; }
    .bottom-nav a { font-size: .62rem; }
    .form-columns { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }


.stage-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.stage-heading > .pill, .stage-heading > .profile-score { margin: 0; }
.profile-tabs, .profile-choices { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 15px; }
.profile-tabs .pill, .profile-choices .pill { min-height: 40px; padding-inline: 13px; }
.playing-profile { display: flex; align-items: center; gap: 9px; color: var(--green); font-weight: 900; }
.family-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.family-card { display: grid; justify-items: start; gap: 8px; }
.family-card h2 { font-size: 1.35rem; overflow-wrap: anywhere; }
.family-active { border-color: #98bc8d; background: #f7fcf2; }
.badge-card { display: flex; align-items: flex-start; gap: 12px; }
.badge-card h3 { font-size: 1.15rem; overflow-wrap: anywhere; }
.badge-card p { color: var(--muted); margin: 4px 0 8px; }
.badge-earned { border-color: #e3c571; background: #fffbeb; }
.badge-progress { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px; }
.badge-progress progress { width: min(94px, 100%); accent-color: #6d9677; }
.reward-progress > p { color: var(--muted); margin: 7px 0 0; }
.reward-progress > progress { width: min(320px, 100%); accent-color: #6d9677; }
.level-track { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.level-track > div { display: grid; align-content: start; justify-items: center; gap: 4px; min-width: 0; padding: 10px 4px; border-radius: 13px; background: #f4f0fa; text-align: center; }
.level-track > .level-achieved { background: #e3f2da; }
.level-track > div > span { font-size: 1.5rem; }
.level-track strong { overflow-wrap: anywhere; font-size: .87rem; line-height: 1.25; }
.level-track small { color: var(--muted); font-size: .75rem; }
.passport-hero { background: #e4f0db; }
.passport-hero > .pill { margin-left: auto; }
.passport-hero h1 { margin-bottom: 8px; }
.passport-hero .stat-icon { width: 76px; height: 76px; font-size: 2.15rem; }
.passport-icon { border-radius: 20px; object-fit: cover; flex: none; }
.journey-timeline, .ranking-list { list-style: none; margin: 0; padding: 0; }
.journey-timeline li { display: flex; position: relative; align-items: flex-start; gap: 14px; padding: 6px 0 20px; }
.journey-timeline li:not(:last-child)::before { content: ''; position: absolute; width: 2px; left: 19px; top: 33px; bottom: -10px; background: #e6dfef; }
.timeline-dot { z-index: 1; display: grid; place-items: center; background: var(--sun); width: 40px; height: 40px; border-radius: 50%; flex: none; }
.timeline-rehide { background: var(--mint); }
.timeline-found { background: var(--lavender); }
.journey-timeline h3 { margin-top: 2px; }
.journey-timeline p { color: var(--muted); margin: 4px 0; }
.journey-timeline p.journey-note { padding: 7px 10px; background: #fbf3e1; border-radius: 8px; color: var(--ink); }
.journey-choice { padding: 13px; }
.ranking-panel > .muted { margin-top: 9px; }
.ranking-list { margin-top: 14px; }
.ranking-list > li { display: flex; align-items: center; gap: 11px; padding: 9px 0; overflow-wrap: anywhere; }
.ranking-list > li + li { border-top: 1px solid var(--line); }
.rank-number { display: grid; place-items: center; font-weight: 1000; min-width: 36px; min-height: 36px; border-radius: 14px; background: var(--lavender); }
.ranking-list > li:first-child .rank-number { background: var(--sun); }
.rank-score { margin-left: auto; flex: none; font-weight: 1000; padding: 3px 9px; border-radius: 999px; background: var(--mint); }
@media (max-width: 850px) {
    .family-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .level-track { grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); }
}
@media (max-width: 540px) {
    .stage-heading .pill { font-size: .86rem; min-height: 40px; }
    .profile-tabs .pill, .profile-choices .pill { font-size: .84rem; padding-inline: 9px; min-height: 38px; }
    .badge-card { grid-column: 1 / -1; }
    .family-card .actions { gap: 5px; }
    .family-card .pill { font-size: .83rem; min-height: 36px; padding-inline: 9px; }
    .passport-hero > .pill { margin-left: 0; }
    .passport-icon { width: 65px; height: 65px; }
    .prefs th { font-size: .78rem; }
}
