/* ShareSpot: a little atlas of places to look forward to. */
:root {
  --bg: #f8faf7;
  --surface-soft: #eef4ef;
  --ink: #203d33;
  --muted: #5e7064;
  --line: #dde6df;
  --accent: #19745d;
  --accent-dark: #145e4b;
  --emerald: #35886b;
  --shadow: 0 12px 36px #203d3312;
  --soft-shadow: 0 5px 20px #203d330c;
  --demo-height: 0px;
  --app-font: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
}
body { font-family: var(--app-font); }
button, a { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: wait; opacity: .6; }
:where(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid #19745d; outline-offset: 4px; }
[hidden] { display: none !important; }
.experience-icon { display: inline-block; width: 22px; height: 22px; flex: 0 0 auto; vertical-align: middle; }
.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; }
.experience-primary, .experience-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 12px 22px; border: 1px solid transparent; border-radius: 13px; font-size: 14px; font-weight: 650; text-decoration: none; }
.experience-primary { background: var(--accent); color: white; }
.experience-primary:hover { background: var(--accent-dark); }
.experience-secondary { border-color: #d3ded6; background: white; color: var(--ink); }
.inline-text-button { border: 0; background: none; color: var(--accent-dark); padding: 10px; font-size: 13px; }

/* Keep map, saved places, and memories within reach. */
.tabbar, .tabbar.has-trip-tab { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; gap: 2px; left: 0; right: 0; bottom: 0; min-height: calc(74px + var(--safe-bottom)); border: 0; border-top: 1px solid var(--line); border-radius: 0; background: #ffffffed; padding: 8px 12px calc(8px + var(--safe-bottom)); box-shadow: none; }
.tabbar.has-trip-tab { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 52px; padding: 4px 0; border: 0; border-radius: 12px; color: #596d5f; background: transparent; font-size: 10px; font-weight: 600; }
.tabbar button.active { color: var(--accent-dark); background: #eaf3ed; box-shadow: none; }
.tabbar button.active::after { display: none; }
.tab-icon { display: block; width: 21px; height: 21px; fill: currentColor; }
.tabbar .tab-add { align-self: center; width: 52px; min-height: 52px; justify-self: center; border-radius: 15px; background: var(--accent); color: white; font-size: 24px; line-height: 1; box-shadow: none; }
.tabbar .tab-add small { display: block; font-size: 9px; font-weight: 500; }
.tabbar .tab-add > span { display: flex; }
.app[data-view="list"].panel-open .tabbar, .app[data-view="memories"].panel-open .tabbar { visibility: visible; }
.app[data-view="list"] .view-panel, .app[data-view="memories"] .view-panel { bottom: calc(74px + var(--safe-bottom)); border-radius: 0; background: var(--bg); }
.app[data-view="list"] .scrim, .app[data-view="memories"] .scrim { display: none; }
#viewTitle:focus { outline: none; }

/* A useful introduction before asking for an account. */
.welcome-brand { display: flex; align-items: center; gap: 9px; font-weight: 750; letter-spacing: -.6px; }
.app.auth-open .auth-screen { display: flex; align-items: center; justify-content: center; overflow: auto; background: var(--bg); padding: calc(24px + var(--safe-top)) 24px calc(24px + var(--safe-bottom)); backdrop-filter: none; }
.auth-screen .desktop-auth-intro, .auth-screen .auth-card { display: none; }
.welcome-card { display: grid; grid-template-columns: 1.15fr 1fr; column-gap: 80px; align-items: center; width: min(1030px, 100%); margin: auto; }
.welcome-brand { grid-column: 1 / -1; margin-bottom: 46px; font-size: 24px; }
.welcome-art { position: relative; overflow: hidden; align-self: stretch; min-height: 440px; border-radius: 130px 28px 28px 28px; background: #eaf1e7; }
.welcome-art > img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.welcome-art-note { position: absolute; bottom: 28px; left: 26px; padding: 13px 16px; font-size: 12px; background: white; color: #4e6b55; transform: rotate(-3deg); }
.welcome-copy h1 { margin: 0 0 22px; font-size: clamp(26px, 3vw, 38px); font-weight: 600; line-height: 1.8; letter-spacing: -.07em; }
.welcome-copy > p { color: var(--muted); font-size: 13px; line-height: 2.1; margin: 0 0 32px; }
.welcome-copy > button { width: 100%; margin: 0 0 11px; }
.welcome-copy .experience-secondary { background: transparent; }
.welcome-copy .experience-secondary > span { font-size: 17px; }
.welcome-copy > .welcome-login { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 3px; font-size: 10px; margin: 14px 0 0; }
.welcome-login button { border: 0; background: none; color: var(--accent-dark); font-size: 11px; padding: 9px; text-decoration: underline; text-underline-offset: 4px; }
.auth-form-open .welcome-card { display: none; }
.auth-form-open .auth-card { display: block; width: min(410px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: 0 15px 70px #183d3408; margin: auto; }
.auth-back { border: 0; color: var(--muted); background: none; font-size: 12px; padding: 0 0 20px; min-height: 40px; }
.auth-brand { margin-bottom: 25px; }
.auth-brand h1 { font-size: 25px; font-weight: 600; }
.auth-brand p { font-weight: 600; color: var(--accent-dark); margin-bottom: 3px; font-size: 12px; }
.auth-mode-toggle { border: 0; background: #f0f4ef; border-radius: 10px; padding: 4px; margin-bottom: 24px; }
.auth-mode-toggle button { font-size: 12px; font-weight: 600; border-radius: 7px; }
.auth-form label { font-size: 12px; font-weight: 500; color: var(--ink); }
.auth-form input { min-height: 48px; border: 1px solid #d8e1d9; border-radius: 10px; background: #fbfcfa; color: var(--ink); font-size: 16px; font-weight: 400; }
.password-field { position: relative; display: block; }
.password-field input { width: 100%; padding-right: 58px; }
.password-field button { position: absolute; right: 3px; top: 3px; bottom: 3px; width: 50px; border: 0; border-radius: 8px; background: transparent; color: var(--accent-dark); font-size: 11px; }
.auth-form .save-button { margin-top: 8px; min-height: 48px; font-size: 13px; border-radius: 10px; }
.auth-error { font-size: 12px; line-height: 1.8; font-weight: 400; }
.auth-error[data-tone="info"] { color: var(--muted); }
.auth-policy { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; font-size: 10px; color: var(--muted); }
.auth-policy a { color: var(--muted); text-underline-offset: 3px; }
.demo-mode { --demo-height: calc(40px + var(--safe-top)); }
.demo-banner { position: fixed; inset: 0 0 auto; z-index: 1450; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 5px 16px; color: #2c563e; background: #e6eecb; border-bottom: 1px solid #d7e0ba; font-size: 11px; }
.demo-banner small { font-size: 10px; margin-left: 8px; color: #52684a; }
.demo-banner button { min-height: 29px; border: 0; border-radius: 20px; padding: 5px 13px; background: #fff9; color: #24553d; font-size: 10px; font-weight: 600; }
.demo-banner { padding-top: calc(5px + var(--safe-top)); min-height: var(--demo-height); }
.demo-mode .top-dock { margin-top: var(--demo-height); }
.demo-mode .search-dock { margin-top: var(--demo-height); }
.demo-mode .view-panel { padding-top: calc(18px + var(--safe-top) + var(--demo-height)); }

/* Quieter surfaces, clear primary actions, and room to breathe. */
.group-select-button, .group-menu, .search-dock, .rail-toolbar, .inline-sort-menu, .rail-card, .view-panel, .add-sheet, .detail-sheet { border-color: var(--line); background: #fffffff7; box-shadow: var(--soft-shadow); }
.save-button { background: var(--accent); color: #fff; box-shadow: none; font-weight: 600; }
.save-button:hover { background: var(--accent-dark); }
.group-avatar { background-image: none; box-shadow: none; }
.rail-card { border-radius: 18px; }
.rail-card.active { border-color: #6caa88; box-shadow: 0 0 0 1px #6caa8833; }
.status-pill { background: #eaf3e7; color: #34634a; }
.rail-card h2 { font-weight: 650; }
.rail-card p { color: var(--muted); }
.rail-card-actions a.primary, .action-grid a.primary, .detail-primary-actions a.primary { background: var(--accent); color: white; box-shadow: none; }
.empty-rail-card { height: auto; min-height: 190px; }
.empty-rail-card p { display: block; overflow: visible; white-space: normal; line-height: 1.8; }
.empty-rail-actions button { color: white; background: var(--accent); }
.add-sheet, .detail-sheet { border-radius: 25px 25px 0 0; background: #fff; }
.add-sheet { max-height: calc(94dvh - var(--safe-top)); }
.add-sheet header { margin-bottom: 16px; }
.add-sheet header p { color: var(--accent); font-size: 11px; font-weight: 500; margin-bottom: 6px; }
.add-sheet header h1 { font-size: 25px; letter-spacing: -.045em; font-weight: 600; }
.add-sheet .hint { font-size: 12px; line-height: 1.85; color: var(--muted); }
#spotForm { gap: 17px; }
#spotForm label { font-size: 12px; font-weight: 600; color: #47614f; }
#spotForm input, #spotForm select, #spotForm textarea { border: 1px solid #d8e3d8; border-radius: 11px; background: #fcfdfb; font-weight: 400; font-size: 16px; min-height: 46px; color: var(--ink); }
.search-row button { background: var(--accent); color: #fff; border-radius: 10px; }
.save-preview { border-color: var(--line); background: #f5f8f1; }
.save-preview:has(.preview-empty) { display: none; }
.save-context { border-color: var(--line); background: #f6f8f2; }
.wanted-chip { border-color: var(--line); background: white; font-weight: 500; }
.wanted-chip:has(input:checked) { background: #e6f0e1; border-color: #adc6a6; }
.import-row { gap: 8px; }
.import-button { min-height: 43px; border: 1px solid var(--line); border-radius: 10px; background: #f1f5ee; color: var(--accent-dark); font-size: 11px; font-weight: 500; }
.advanced-fields { border: 1px solid var(--line); background: #fff; border-radius: 12px; }
.advanced-fields summary { padding: 13px 0; font-size: 12px; font-weight: 500; color: #5a7260; }
.save-footer { position: sticky; bottom: calc(-18px - var(--safe-bottom)); padding: 13px 0 calc(6px + var(--safe-bottom)); background: #fffffff5; border-top: 1px solid var(--line); z-index: 2; }
.save-footer .save-button { width: 100%; min-height: 49px; font-size: 14px; border-radius: 12px; }
.detail-sheet { max-height: calc(88dvh - var(--safe-top)); }
.detail-header h2 { font-weight: 650; letter-spacing: -.045em; line-height: 1.5; }
.detail-meta-grid { background: #f7f9f5; border-color: var(--line); }
.detail-memo { border-left: 3px solid #becfb5; border-radius: 0; background: #f6f8f1; line-height: 1.9; }
.detail-visit-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; border: 1px solid var(--accent); border-radius: 12px; margin: 17px 0; background: var(--accent); color: white; font-size: 13px; font-weight: 600; }
.detail-visit-button.is-visited { color: var(--accent-dark); background: #edf5e9; border-color: #d3e1cc; }
.detail-secondary { margin-top: 15px; border-top: 1px solid var(--line); }
.detail-secondary summary { padding: 15px 0; color: var(--muted); font-size: 12px; cursor: pointer; }
.saved-hero, .memory-hero { background: #eaf2e7; border-color: #dce7d5; box-shadow: none; }
.saved-stats, .memory-stats { background: transparent; border-color: var(--line); }
.saved-card, .memory-card { border-color: var(--line); background: #fff; box-shadow: none; }
.saved-actions { grid-template-columns: 1.3fr 1fr; }
.collection-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -5px 0 17px; }
.collection-intro p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.collection-query { margin: 0 0 15px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 20px; background: white; color: var(--accent-dark); font-size: 11px; }
.collection-query > span[aria-hidden] { margin-left: 10px; }
.collection-intro > button { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--accent); }
.saved-toolbar { gap: 4px; padding: 4px; border-radius: 12px; background: #eaf0e7; margin-bottom: 16px; }
.saved-toolbar button { flex: 1; border: 0; box-shadow: none; background: transparent; color: var(--muted); border-radius: 9px; font-weight: 500; font-size: 11px; }
.saved-toolbar button.active { background: white; color: var(--ink); box-shadow: 0 2px 4px #203d3308; }
.list-filter-row { border: 0; background: transparent; padding: 0 0 18px; border-bottom: 1px solid var(--line); border-radius: 0; gap: 12px; margin: 0 0 20px; }
.list-filter-row > div > span { font-weight: 500; font-size: 10px; }
.list-filter-row button { box-shadow: none; border-color: var(--line); font-weight: 500; font-size: 11px; min-height: 35px; }
.list-filter-row button.active { background: var(--accent); color: white; }
.saved-region h3, .memory-month h3 { color: var(--muted); font-size: 12px; font-weight: 500; border-color: var(--line); }
.saved-region h3 small { background: #eaf0e7; color: #5b7563; }
.saved-card { padding: 17px; border-radius: 16px; }
.saved-card .list-card-head { margin-bottom: 10px; }
.saved-card .list-card-head h3, .memory-card .list-card-head h3 { margin: 0; min-width: 0; font-size: 17px; font-weight: 600; line-height: 1.6; letter-spacing: -.035em; overflow-wrap: anywhere; }
.collection-region-heading { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 12px; font-size: 12px; font-weight: 500; color: var(--muted); }
.collection-region-heading small { padding: 4px 8px; border-radius: 15px; background: #eaf0e7; font-size: 10px; }
.saved-card h2 { white-space: normal; }
.saved-card .people-row > span:last-child, .memory-card .people-row > span:last-child { font-size: 10px; font-weight: 500; }
.saved-card .meta-row span, .memory-card .meta-row span { background: #f0f4ed; font-size: 10px; font-weight: 500; }
.saved-actions button { border-color: var(--line); font-size: 11px; min-height: 40px; font-weight: 500; box-shadow: none; }
.saved-actions button:first-child { background: #edf4e9; color: var(--accent-dark); }
.ai-share-shortcut { min-height: 43px; margin-top: 20px; font-size: 11px; font-weight: 500; background: transparent; border-color: var(--line); color: var(--accent-dark); }
.memory-hero { padding: 20px; border: 0; background: #edf2e8; border-radius: 18px; margin-bottom: 25px; }
.memory-hero h2 { font-size: 22px; font-weight: 600; letter-spacing: -.05em; margin: 8px 0; white-space: normal; overflow: visible; line-height: 1.6; }
.memory-hero p, .memory-hero span { font-size: 11px; font-weight: 400; }
.memory-hero > strong { font-size: 30px; color: var(--accent-dark); font-weight: 500; }
.memory-card { padding: 18px; border-radius: 16px; }
.memory-card .memory-detail { margin: 14px 0; padding: 12px; background: #f7f8f2; border-left: 2px solid #c8d5bc; font-size: 12px; line-height: 1.9; }
.memory-month h3 { margin-bottom: 15px; padding: 0; border: 0; background: transparent; }
.memory-actions { grid-template-columns: 1fr 1fr; margin-top: 16px; }
.memory-actions button { border-color: var(--line); box-shadow: none; min-height: 40px; font-size: 11px; font-weight: 500; }
.memory-actions button.active { background: #edf4e9; color: var(--accent-dark); }
.detail-status { display: flex; flex-wrap: wrap; }
.detail-status span { border: 0; border-radius: 6px; background: #f0f3ed; font-weight: 500; padding: 6px 10px; }
.detail-status span:first-child { background: #e6f0e1; color: #35634a; }
.detail-meta-grid { gap: 0; border: 1px solid var(--line); border-radius: 12px; background: #fafbf8; padding: 10px; }
.detail-meta-grid span { border: 0; border-radius: 0; background: transparent; line-height: 1.8; font-weight: 400; }
.detail-meta-grid strong { font-weight: 500; font-size: 10px; color: var(--muted); }
.detail-primary-actions button, .detail-primary-actions a { border-color: var(--line); box-shadow: none; }
.detail-memo { display: block; overflow: visible; font-size: 13px; padding: 13px; white-space: pre-wrap; }
.detail-people em { font-style: normal; font-weight: 400; }
.detail-again-panel { border-color: var(--line); background: #f4f7ef; }
.app.demo-mode[data-view="list"].panel-open .view-panel, .app.demo-mode[data-view="memories"].panel-open .view-panel { top: var(--demo-height); height: auto; padding-top: 20px; }
.app[data-view="list"].panel-open .view-panel, .app[data-view="memories"].panel-open .view-panel { border-radius: 0; }
.saved-card .list-card-head h2, .memory-card .list-card-head h2 { font-size: 17px; font-weight: 650; line-height: 1.6; }
.saved-card p, .memory-card p { font-size: 12px; line-height: 1.8; }
.saved-toolbar button.active { color: var(--accent-dark); background: #e5eee2; }
.view-panel header button, .add-sheet header button, .detail-header button { min-width: 40px; min-height: 40px; border-radius: 50%; }
.toast { bottom: calc(92px + var(--safe-bottom)); left: 20px; right: 20px; width: max-content; max-width: calc(100vw - 40px); margin: 0 auto; padding: 13px 18px; background: #203d33; color: #fff; border: 0; border-radius: 13px; box-shadow: 0 6px 24px #203d3322; font-size: 12px; }
.toast-action { border: 0; color: #fff; background: #456d59; font-family: inherit; font-size: 11px; font-weight: 500; }
.leaflet-control-attribution { display: block; font-size: 8px; background: #ffffffcf; }
.leaflet-bottom { bottom: calc(75px + var(--safe-bottom)); }
.map-board { filter: none; }

/* Opaque surfaces avoid blurring the moving map beneath every control. */
.group-select-button, .group-menu, .search-dock, .rail-toolbar, .inline-sort-menu,
.sort-menu, .tabbar, .tabbar.has-trip-tab, .view-panel, .view-panel header, .add-sheet, .detail-sheet,
.auth-card, .scrim { backdrop-filter: none; }
.group-select-button, .group-menu, .search-dock, .rail-toolbar, .inline-sort-menu,
.sort-menu, .tabbar { background: #fff; }
.saved-card, .memory-card { content-visibility: auto; contain-intrinsic-block-size: auto 240px; }
.user-location-marker::before { animation: none; }

@media (min-width: 1024px) {
  :root { --desktop-nav-width: 96px; }
  .tabbar, .tabbar.has-trip-tab { display: flex; flex-direction: column; inset: var(--demo-height) auto 0 0; width: var(--desktop-nav-width); border-right: 1px solid var(--line); padding: 25px 12px 20px; gap: 10px; background: #fff; min-height: 0; }
  .desktop-brand { display: grid; gap: 7px; margin-bottom: 36px; }
  .desktop-brand small { font-family: var(--app-font); font-size: 9px; font-weight: 650; letter-spacing: -.4px; color: var(--accent-dark); }
  .tabbar button { min-height: 65px; width: 100%; font-size: 11px; gap: 7px; border-radius: 14px; }
  .tabbar button.active { background: #eaf3ed; color: var(--accent-dark); box-shadow: none; }
  .tabbar .tab-add { display: flex; width: 55px; min-height: 55px; margin-top: auto; }
  .app:not(.auth-open)::before { background: #f8faf7; border-color: var(--line); box-shadow: none; }
  .app[data-view="list"] .view-panel, .app[data-view="memories"] .view-panel { bottom: 0; }
  .app.demo-mode .view-panel { top: var(--demo-height); height: calc(100dvh - var(--demo-height)); padding-top: 22px; }
  .view-panel { background: var(--bg); box-shadow: none; }
  .rail-card.active { box-shadow: inset 3px 0 0 var(--accent); }
  .add-sheet, .detail-sheet { border-radius: 22px; }
  .demo-mode .desktop-pane-caption, .demo-mode .spot-dock { margin-top: var(--demo-height); }
  .demo-mode .route-dock { margin-top: var(--demo-height); }
  .leaflet-bottom { bottom: 0; }
  .toast { left: var(--desktop-nav-width); bottom: 26px; }
}
@media (max-width: 759px) {
  .app.auth-open .auth-screen { padding: calc(22px + var(--safe-top)) 24px calc(24px + var(--safe-bottom)); }
  .welcome-card { display: flex; flex-direction: column; max-width: 440px; gap: 0; }
  .welcome-brand { align-self: flex-start; margin: 0 0 25px; font-size: 22px; }
  .welcome-brand img { width: 33px; height: 33px; }
  .welcome-art { width: 100%; min-height: 0; height: clamp(180px, 28dvh, 260px); border-radius: 70px 18px 18px 18px; margin-bottom: 24px; }
  .welcome-art > img { object-position: center 48%; }
  .welcome-art-note { bottom: 17px; left: 15px; padding: 9px 11px; font-size: 10px; }
  .welcome-copy { width: 100%; }
  .welcome-copy h1 { font-size: 27px; line-height: 1.75; margin-bottom: 13px; }
  .welcome-copy > p { font-size: 12px; margin-bottom: 23px; line-height: 1.95; }
  .welcome-copy > button { min-height: 48px; font-size: 12px; margin-bottom: 9px; }
  .welcome-copy > .welcome-login { margin-top: 8px; font-size: 9px; }
  .auth-form-open .auth-card { padding: 24px; }
  .demo-banner { gap: 10px; padding-right: 10px; padding-left: 10px; justify-content: space-between; }
  .demo-banner > span { font-size: 10px; }
  .demo-banner small { display: block; font-size: 8px; margin: 2px 0 0; }
  .demo-banner button { font-size: 9px; padding: 6px 10px; }
  .demo-mode .route-dock { margin-top: var(--demo-height); }
  .demo-mode .top-dock, .demo-mode .search-dock { margin-top: 40px; }
}
@media (max-width: 360px) {
  .welcome-copy h1 { font-size: 24px; }
}
.app.sheet-open .add-sheet, .app.detail-open .detail-sheet { animation: sheet-enter 180ms ease-out; }
@keyframes sheet-enter { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
