:root {
  color-scheme: light;
  --font-ui: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic", "Noto Sans JP", "Segoe UI", sans-serif;
  --font-reading: ui-serif, "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", Georgia, serif;
  --font-code: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --color-background: #F5F7FA;
  --color-surface: #FFFFFF;
  --color-surface-warm: #EEF3FB;
  --color-primary: #287DFA;
  --color-primary-hover: #1A66DB;
  --color-secondary: #12A364;
  --color-moss: #12A364;
  --color-accent: #1A6AE0;
  --color-accent-soft: rgba(40, 125, 250, 0.12);
  --color-border: #DFE5EE;
  --color-border-strong: #C2CDDD;
  --color-text-primary: #0F294D;
  --color-text-secondary: #52637D;
  --color-text-muted: #8592A6;
  --color-boost: #F56300;
  --color-success: #12A364;
  --color-warning: #B7791F;
  --color-danger: #E0403A;
  --color-info: #1A6AE0;
  --color-route: #287DFA;
  --color-route-dotted: #A3C6F7;
  --color-map-water: #D9E8F8;
  --color-map-land: #F3F6F9;

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --shadow-panel: 0 1px 2px rgba(16, 24, 32, 0.06), 0 1px 3px rgba(16, 24, 32, 0.1);
  --shadow-soft: 0 1px 2px rgba(16, 24, 32, 0.06), 0 1px 3px rgba(16, 24, 32, 0.1);
  --blur-panel: blur(18px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --app-viewport-width: 100vw;
  --app-viewport-height: 100vh;
  --visual-viewport-left: 0px;
  --visual-viewport-top: 0px;

  --bg: var(--color-background);
  --surface: var(--color-surface);
  --surface-2: var(--color-surface-warm);
  --border: var(--color-border);
  --text: var(--color-text-primary);
  --muted: var(--color-text-secondary);
  --accent: var(--color-accent);
  --accent-strong: var(--color-surface);
  --danger: var(--color-danger);
  --warning: var(--color-warning);
  --shadow: var(--shadow-soft);
  --control-radius: 10px;
  --control-height-sm: 30px;
  --control-height-md: 38px;
  --control-height-lg: 46px;
  --control-gap: 8px;
  --button-bg: var(--surface);
  --button-fg: var(--color-text-primary);
  --button-border: var(--border);
  --button-hover-bg: var(--color-surface-warm);
  --button-active-bg: var(--color-primary);
  --button-active-fg: var(--color-surface);
  --button-focus-ring: 0 0 0 3px rgba(40, 125, 250, 0.28);
  --button-floating-bg: rgba(255, 255, 255, 0.94);
  --button-floating-fg: var(--color-text-primary);
  --button-floating-border: var(--color-border);
  --button-floating-shadow: 0 6px 16px rgba(15, 41, 77, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--color-background);
  color: var(--color-text-primary);
  font: 15px/1.65 var(--font-ui);
}

button,
input,
select,
textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: clip;
}

.app-shell[hidden] {
  display: none;
}

.map-rail {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 32;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 78px;
  height: 100vh;
  min-height: 100svh;
  height: 100dvh;
  padding: var(--space-3) var(--space-2);
  border-right: 1px solid var(--border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-shadow: none;
}

.rail-brand {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--color-surface);
  box-shadow: none;
}

.rail-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.mobile-menu-toggle {
  display: none;
}

.mobile-menu-backdrop {
  display: none;
}

.rail-nav {
  display: grid;
  align-content: start;
  gap: var(--space-2);
}

.rail-nav-item {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 62px;
  min-height: 58px;
  padding: var(--space-2) var(--space-1);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.rail-nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 24px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.rail-nav-item:hover,
.rail-nav-item.is-active {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.rail-nav-item.is-active .rail-nav-icon {
  color: var(--color-accent);
}

.sidebar {
  position: fixed;
  left: 90px;
  top: 16px;
  z-index: 31;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 260px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.sidebar[hidden] {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.brand-mark img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.panel p {
  margin: 0;
}

.brand h1 {
  font-family: var(--font-reading);
  font-size: 18px;
}

.brand p,
.panel p,
.eyebrow,
.tile-meta,
.mcp-note,
.status-row span,
.empty-map {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 6px;
}

.nav .nav-item {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.nav .nav-item:hover,
.nav .nav-item.is-active {
  border-color: var(--border);
  background: var(--surface-2);
}

.account-page,
.settings-stack {
  display: grid;
  gap: 16px;
  max-width: 920px;
}

.account-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.account-avatar {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
}

.account-identity-main {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 200px;
}

.account-identity-main strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.account-identity-main p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.settings-page {
  display: grid;
  gap: 14px;
  max-width: 1120px;
}

.settings-tabs {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  gap: 22px;
  padding: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.settings-tabs::-webkit-scrollbar {
  display: none;
}

.settings-tab {
  position: relative;
  flex: 0 0 auto;
  min-width: max-content;
  height: 38px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.settings-tab:hover,
.settings-tab.is-active {
  background: transparent;
  color: var(--text);
}

.settings-tab::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--text);
  content: "";
  opacity: 0;
  transform: scaleX(0.7);
  transition: opacity 160ms ease, transform 160ms ease;
}

.settings-tab:hover::after,
.settings-tab.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.settings-pane[hidden] {
  display: none;
}

.main {
  min-width: 0;
  min-height: 100vh;
  padding: 0;
}

.topbar {
  position: absolute;
  left: 276px;
  right: 16px;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  margin-bottom: 0;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--color-surface);
  box-shadow: none;
}

.topbar[hidden] {
  display: none;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.topbar h2 {
  font-family: var(--font-reading);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
}

.account-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button,
.icon-button,
.provider-button {
  display: inline-grid;
  align-items: center;
  justify-content: center;
  gap: var(--control-gap);
  min-height: var(--control-height-md);
  border: 1px solid var(--button-border);
  border-radius: var(--control-radius);
  background: var(--button-bg);
  color: var(--button-fg);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  user-select: none;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.button:hover,
.icon-button:hover,
.provider-button:hover {
  background: var(--button-hover-bg);
}

.button:focus-visible,
.icon-button:focus-visible,
.provider-button:focus-visible,
.journey-reader-back:focus-visible,
.map-load-button:focus-visible,
.mobile-menu-toggle:focus-visible {
  outline: 0;
  box-shadow: var(--button-focus-ring);
}

.button:active,
.icon-button:active,
.provider-button:active,
.journey-reader-back:active,
.map-load-button:active,
.mobile-menu-toggle:active {
  transform: translateY(1px);
}

.button {
  min-height: var(--control-height-md);
  padding: 9px 14px;
}

.button.primary {
  --button-bg: var(--button-active-bg);
  --button-fg: var(--button-active-fg);
  --button-border: var(--button-active-bg);
  --button-hover-bg: var(--color-primary-hover);
}

.button.secondary {
  --button-bg: var(--surface);
  --button-fg: var(--color-text-primary);
  --button-border: var(--color-border-strong);
  --button-hover-bg: var(--color-surface-warm);
}

.button.danger-button {
  --button-bg: var(--color-danger);
  --button-fg: #fff;
  --button-border: var(--color-danger);
  --button-hover-bg: #B52F2B;
}

.account-deletion-panel {
  border-color: color-mix(in srgb, var(--color-danger) 35%, var(--border));
}

.button:disabled,
.icon-button:disabled,
.nav-item:disabled,
.provider-button:disabled,
.journey-reader-back:disabled,
.map-load-button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button.small {
  min-height: var(--control-height-sm);
  padding: 5px 10px;
  font-size: 12px;
}

.button.full {
  width: 100%;
}

.icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 18px;
}

.panel-header.compact {
  margin-bottom: 10px;
}

.panel-header.compact h3 {
  font-size: 16px;
}

.mcp-token-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.agent-console,
.view {
  display: none;
}

.view[hidden] {
  display: none !important;
}

.view.is-active {
  display: block;
}

.view:not(#exploreView).is-active {
  padding: var(--space-6) var(--space-6) var(--space-6) 102px;
}

#exploreView.is-active {
  height: var(--app-viewport-height);
  min-height: var(--app-viewport-height);
  max-height: var(--app-viewport-height);
  overflow: hidden;
  padding: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 18px;
}

.journey-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(420px, 0.58fr);
  gap: 18px;
  max-width: 1280px;
}

.journey-feed-page {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 690px) minmax(280px, 360px);
  align-items: start;
  gap: 24px;
  width: min(1120px, 100%);
  max-width: 1120px;
  margin: 34px auto 0;
}

.journey-feed-list-panel {
  align-content: start;
  display: grid;
  gap: 0;
}

#journeysView .journey-feed-list-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#journeysView .panel-header {
  align-items: center;
  margin: 0;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--border);
}

#journeysView .panel-header h3 {
  font-family: var(--font-ui);
  font-size: 30px;
  font-weight: 850;
  line-height: 1.2;
}

#journeysView .panel-header p {
  margin-top: 6px;
  color: rgba(16, 24, 32, 0.58);
  font-size: 13px;
  line-height: 1.7;
}

.journey-feed-tabs {
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 14px 0 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.journey-feed-tabs::-webkit-scrollbar {
  display: none;
}

.journey-feed-tab {
  position: relative;
  flex: 0 0 auto;
  height: 42px;
  min-width: max-content;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.journey-feed-tab:hover,
.journey-feed-tab.is-active {
  background: transparent;
  color: var(--color-accent);
}

.journey-feed-tab::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--color-accent);
  content: "";
  opacity: 0;
  transform: scaleX(0.7);
  transition: opacity 160ms ease, transform 160ms ease;
}

.journey-feed-tab:hover::after,
.journey-feed-tab.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.journey-feed-list {
  display: grid;
  gap: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

.journey-feed-map-panel {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 16px 32px rgba(16, 24, 32, 0.08);
}

.journey-feed-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(16, 24, 32, 0.58);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.journey-feed-map-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--color-accent);
  color: var(--color-surface);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}

.journey-feed-map-open:disabled {
  cursor: default;
  opacity: 0.48;
}

.journey-feed-map-visual {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  border: 1px solid rgba(16, 24, 32, 0.16);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(90deg, rgba(16, 24, 32, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(16, 24, 32, 0.055) 1px, transparent 1px),
    #f6f0e6;
  background-size: 40px 40px;
}

.journey-feed-map-road {
  position: absolute;
  display: block;
  width: 150%;
  height: 14px;
  left: -24%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(16, 24, 32, 0.08);
}

.journey-feed-map-road.road-a {
  top: 34%;
  transform: rotate(-16deg);
}

.journey-feed-map-road.road-b {
  top: 62%;
  transform: rotate(18deg);
}

.journey-feed-map-road.road-c {
  top: 48%;
  left: -36%;
  transform: rotate(72deg);
}

.journey-feed-map-route {
  position: absolute;
  left: 18%;
  top: 24%;
  width: 64%;
  height: 52%;
  border: 3px solid var(--color-accent);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50% 44% 42% 38%;
  transform: rotate(12deg);
}

.journey-feed-map-pin {
  position: absolute;
  display: block;
  width: 14px;
  height: 14px;
  border: 3px solid var(--color-surface);
  border-radius: 999px;
  background: var(--color-primary);
  box-shadow: 0 6px 18px rgba(16, 24, 32, 0.2);
}

.journey-feed-map-pin.pin-a {
  left: 22%;
  top: 30%;
}

.journey-feed-map-pin.pin-b {
  left: 48%;
  top: 42%;
  background: var(--color-accent);
}

.journey-feed-map-pin.pin-c {
  left: 68%;
  top: 58%;
}

.journey-feed-map-pin.pin-d {
  left: 38%;
  top: 72%;
  background: var(--color-accent);
}

.journey-feed-map-copy {
  display: grid;
  gap: 8px;
}

.journey-feed-map-copy strong {
  font-size: 18px;
  font-weight: 850;
  line-height: 1.35;
}

.journey-feed-map-copy span {
  color: rgba(16, 24, 32, 0.58);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.journey-feed-map-copy p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: rgba(16, 24, 32, 0.68);
  font-size: 13px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.scrapbook-layout {
  display: grid;
  grid-template-columns: minmax(420px, 680px) minmax(360px, 1fr);
  gap: 18px;
  align-items: start;
  height: calc(var(--app-viewport-height) - 2 * var(--space-6));
}

#scrapbookView .scrapbook-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
}

.scrapbook-list {
  display: grid;
  gap: 0;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.scrapbook-list.is-empty {
  align-content: center;
  padding-right: 0;
}

.scrapbook-empty {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 360px;
  margin: 0 auto;
  padding: 24px 20px;
  text-align: center;
}

.scrapbook-empty-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--color-surface-warm);
  color: var(--color-boost);
  font-size: 24px;
  line-height: 1;
}

.scrapbook-empty-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 800;
  color: var(--color-text-primary);
}

.scrapbook-empty-text {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.8;
}

.scrapbook-empty-star {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--color-surface-warm);
  color: var(--color-boost);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.scrapbook-empty-cta {
  margin-top: 4px;
}

.scrapbook-journey-link {
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scrapbook-journey-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.scrapbook-item-sq {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.scrapbook-reply .scrapbook-journey-link {
  margin: 1px 0;
}

.scrapbook-reply .thread-footprint-figure {
  width: min(180px, 100%);
}

.scrapbook-map-panel {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}

.scrapbook-map {
  position: relative;
  height: 100%;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-map-land);
}

.scrapbook-map-tiles {
  position: absolute;
  inset: 0;
}

.scrapbook-map-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scrapbook-pin {
  position: absolute;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 2px solid var(--color-surface);
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--button-floating-shadow);
  pointer-events: auto;
  transition: transform 140ms ease, background-color 140ms ease;
}

.scrapbook-pin:hover,
.scrapbook-pin.is-active {
  background: var(--color-primary);
  transform: scale(1.18);
  z-index: 2;
}

.scrapbook-map-attribution {
  margin: 6px 0 0;
  color: var(--color-text-muted);
  font-size: 10px;
  text-align: right;
}

.scrap-toggle {
  min-height: 24px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition: color 140ms ease;
}

.scrap-toggle:hover,
.scrap-toggle:focus-visible {
  outline: 0;
  color: var(--color-accent);
}

.scrap-toggle.is-saved {
  color: var(--color-boost);
}

@media (max-width: 980px) {
  .scrapbook-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .scrapbook-map-panel {
    order: -1;
    position: relative;
    height: 280px;
  }

  #scrapbookView .scrapbook-panel {
    height: auto;
  }

  .scrapbook-list {
    overflow: visible;
  }
}

#exploreView .split {
  display: block;
  height: var(--app-viewport-height);
  min-height: var(--app-viewport-height);
  max-height: var(--app-viewport-height);
  overflow: hidden;
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: none;
  color: var(--text);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-header h3,
.panel h3 {
  font-family: var(--font-reading);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.panel-header p,
.panel p {
  color: var(--muted);
  line-height: 1.65;
}

.map-panel {
  min-height: 100vh;
}

#exploreView .map-panel {
  position: fixed;
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
  z-index: 0;
  width: var(--app-viewport-width);
  max-width: 100%;
  height: var(--app-viewport-height);
  min-height: var(--app-viewport-height);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

#exploreView .map-panel > .panel-header {
  display: none;
}

.map-surface {
  position: relative;
  overflow: hidden;
  height: 560px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--color-background);
}

#exploreView .map-surface {
  width: var(--app-viewport-width);
  max-width: 100%;
  height: var(--app-viewport-height);
  min-height: var(--app-viewport-height);
  border: 0;
  border-radius: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#exploreView .map-surface::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 12% 18%, rgba(16, 24, 32, 0.05) 0 1px, transparent 1.5px),
    radial-gradient(circle at 72% 24%, rgba(16, 24, 32, 0.04) 0 1px, transparent 1.5px),
    radial-gradient(circle at 86% 68%, rgba(16, 24, 32, 0.04) 0 1px, transparent 1.5px),
    radial-gradient(circle at 34% 78%, rgba(16, 24, 32, 0.05) 0 1px, transparent 1.5px);
  background-size: 220px 180px, 280px 240px, 340px 260px, 260px 220px;
  content: "";
  pointer-events: none;
}

#exploreView .map-surface::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent 26%, transparent 78%, rgba(255, 255, 255, 0.08)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 34%, rgba(255, 255, 255, 0.08));
  content: "";
  pointer-events: none;
}

#exploreView .map-surface.is-dragging {
  cursor: grabbing;
}

#exploreView .map-surface.is-journey-locked {
  cursor: default;
}

#exploreView .map-surface.is-journey-locked .map-zoom-controls {
  display: none;
}

.map-zoom-controls {
  position: absolute;
  right: 16px;
  top: 50%;
  z-index: 20;
  display: grid;
  gap: 8px;
  transform: translateY(-50%);
}

.map-zoom-controls .icon-button {
  width: 40px;
  height: 40px;
  --button-bg: rgba(255, 255, 255, 0.94);
  --button-hover-bg: var(--color-surface);
  box-shadow: var(--shadow);
  font-size: 22px;
  font-weight: 700;
}

.map-load-button {
  position: absolute;
  left: calc(50% + 39px);
  top: 18px;
  z-index: 22;
  display: inline-grid;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transform: translateX(-50%);
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--button-floating-border);
  border-radius: 999px;
  background: var(--button-floating-bg);
  box-shadow: var(--button-floating-shadow);
  color: var(--button-floating-fg);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
  backdrop-filter: blur(12px);
}

.journey-reader-back {
  position: absolute;
  left: max(14px, calc(var(--safe-left) + 14px));
  top: max(14px, calc(var(--safe-top) + 14px));
  z-index: 24;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--button-floating-border);
  border-radius: 10px;
  background: rgba(16, 24, 32, 0.62);
  box-shadow: var(--button-floating-shadow);
  color: var(--button-floating-fg);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 760;
  line-height: 1;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
  backdrop-filter: blur(12px);
}

.journey-reader-back span {
  transform: translateY(-0.5px);
}

.journey-reader-back[hidden] {
  display: none;
}

body.is-reader-entering #exploreView .map-surface {
  animation: readerMapEnter 220ms ease-out both;
}

body.is-reader-entering .journey-message-card:not([hidden]),
body.is-reader-entering .journey-reader-back:not([hidden]) {
  animation: readerChromeEnter 220ms ease-out both;
}

body.is-reader-exiting #exploreView .map-surface {
  animation: readerMapExit 220ms ease-in both;
}

body.is-reader-exiting .journey-message-card:not([hidden]),
body.is-reader-exiting .journey-reader-back:not([hidden]) {
  animation: readerChromeExit 180ms ease-in both;
}

@keyframes readerMapEnter {
  from {
    opacity: 0.72;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes readerChromeEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes readerListReturn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes readerMapExit {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0.72;
    transform: translateY(4px);
  }
}

@keyframes readerChromeExit {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

.map-load-button::before {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
  content: "";
  transform: translate(-58%, -58%);
}

.map-load-button::after {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  content: "";
  transform: translate(3px, 6px) rotate(45deg);
  transform-origin: center;
}

.map-load-button:hover {
  background: rgba(16, 24, 32, 0.84);
  border-color: rgba(255, 255, 255, 0.48);
  color: var(--color-surface);
}

.map-load-button:disabled {
  cursor: wait;
  opacity: 0.76;
}

.osm-tiles {
  position: absolute;
  inset: 0;
  z-index: 0;
  contain: strict;
  pointer-events: none;
  transform: translate(var(--map-drag-x, 0), var(--map-drag-y, 0)) scale(var(--map-zoom-scale, 1));
  transform-origin: 50% 50%;
  transition: transform 110ms ease-out;
  will-change: transform;
  background:
    linear-gradient(90deg, rgba(16, 24, 32, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(16, 24, 32, 0.04) 1px, transparent 1px),
    #f5f5f2;
  background-size: 48px 48px;
  filter: grayscale(1) contrast(1.04) brightness(1.03);
  opacity: 1;
}

.osm-tile,
.osm-tile-fallback {
  position: absolute;
  display: block;
  max-width: none;
  pointer-events: none;
}

.osm-tile {
  user-select: none;
  -webkit-user-drag: none;
}

.osm-tile.is-missing {
  opacity: 0;
}

.osm-tile-fallback {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    rgba(255, 255, 255, 0.02);
  background-size: 32px 32px;
}

.map-surface.is-dragging .map-info-panel.has-drop {
  transform: translate(
    var(--map-drag-x, 0px),
    var(--map-drag-y, 0px)
  );
  transition: none;
}

.journey-trace-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.journey-trace-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.journey-trace-path.is-base {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 4;
  stroke-dasharray: 1 10;
}

.journey-trace-path.is-active {
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 5;
  filter: drop-shadow(0 4px 10px rgba(255, 255, 255, 0.3));
}

.empty-map {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 2;
  max-width: min(320px, calc(100% - 32px));
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(16, 24, 32, 0.72);
  color: var(--color-surface);
  font-weight: 650;
  font-size: 12px;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 10px 28px rgba(16, 24, 32, 0.22);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.drop-pin {
  position: absolute;
  z-index: 4;
  width: 48px;
  height: 48px;
  padding: 0;
  transform: translate(
    calc(var(--map-drag-x, 0px) - 24px),
    calc(var(--map-drag-y, 0px) - 42px)
  ) scale(var(--map-zoom-scale, 1));
  transform-origin: 50% 88%;
  transition: transform 110ms ease-out, opacity 110ms ease-out;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.map-info-panel,
.journey-message-card,
.journey-trace-layer,
.drop-pin {
  will-change: opacity, transform;
}

.map-surface.is-switching .drop-pin,
.map-surface.is-switching .journey-trace-layer,
.map-surface.is-switching .journey-message-card:not([hidden]),
.map-surface.is-switching .map-info-panel.has-drop {
  opacity: 0;
  transform: translate(
    var(--map-drag-x, 0px),
    var(--map-drag-y, 0px)
  ) scale(0.92);
  transition: opacity 120ms ease, transform 120ms ease;
}

.map-surface.is-switching-in .drop-pin {
  animation: mapPinEnter 220ms ease-out both;
}

.map-surface.is-switching-in .map-info-panel.has-drop {
  animation: mapCardEnter 220ms ease-out both;
}

.map-surface.is-switching-in .journey-message-card:not([hidden]) {
  animation: mapCardEnter 220ms ease-out both;
}

.map-surface.is-switching-in .journey-trace-layer {
  animation: mapPinEnter 220ms ease-out both;
}

.drop-pin:hover,
.drop-pin:focus-visible,
.drop-pin.is-active {
  z-index: 6;
}

.map-surface.is-dragging .osm-tiles,
.map-surface.is-dragging .drop-pin,
.map-surface.is-zoom-resetting .osm-tiles,
.map-surface.is-zoom-resetting .drop-pin {
  transition: none;
}

.pin-scroll {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 8px 14px rgba(16, 24, 32, 0.34));
  transform-origin: 50% 92%;
  transition: filter 120ms ease-out, transform 120ms ease-out;
  user-select: none;
  pointer-events: none;
}

.scroll-pin-2 .pin-scroll {
  width: 48px;
}

.scroll-pin-3 .pin-scroll {
  width: 46px;
}

.scroll-pin-4 .pin-scroll {
  width: 42px;
}

.drop-pin:hover .pin-scroll,
.drop-pin:focus-visible .pin-scroll,
.drop-pin.is-active .pin-scroll {
  filter: drop-shadow(0 12px 22px rgba(255, 255, 255, 0.34));
  transform: translateY(-2px) scale(1.18);
}

.drop-pin.is-ahead {
  opacity: 0.52;
}

.drop-pin.is-traced .pin-scroll {
  filter: drop-shadow(0 8px 16px rgba(255, 255, 255, 0.2));
}

@keyframes mapPinEnter {
  from {
    opacity: 0;
    transform: translate(
      var(--map-drag-x, 0px),
      var(--map-drag-y, 0px)
    ) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translate(
      var(--map-drag-x, 0px),
      var(--map-drag-y, 0px)
    ) scale(var(--map-zoom-scale, 1));
  }
}

@keyframes mapCardEnter {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dialog-caret-blink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-surface.is-switching .drop-pin,
  .map-surface.is-switching .journey-trace-layer,
  .map-surface.is-switching .journey-message-card:not([hidden]),
  .map-surface.is-switching .map-info-panel.has-drop,
  .map-surface.is-switching-in .drop-pin,
  .map-surface.is-switching-in .journey-trace-layer,
  .map-surface.is-switching-in .journey-message-card:not([hidden]),
  .map-surface.is-switching-in .map-info-panel.has-drop {
    animation: none;
    transition: none;
  }
}

.map-info-panel {
  position: absolute;
  left: 104px;
  top: 18px;
  /* ピン(通常4/アクティブ6)より上、地図の読み込みボタン(22)や吹き出し(19)より下 */
  z-index: 8;
  display: none;
  align-content: start;
  overflow: hidden;
  width: min(264px, calc(100vw - 24px));
  max-height: min(260px, calc(100% - 24px));
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 16px 38px rgba(16, 24, 32, 0.2);
  backdrop-filter: blur(14px);
  pointer-events: none;
}

.map-info-panel.has-drop {
  display: grid;
  pointer-events: auto;
}

.map-info-thumb {
  width: 100%;
  height: 78px;
  object-fit: cover;
  border-radius: 10px 10px 6px 6px;
  background: var(--surface);
}

.map-info-body {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(16, 24, 32, 0.05) 1px, transparent 1px),
    rgba(255, 255, 255, 0.96);
  background-size: 100% 24px;
}

.map-info-panel span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.message-card-journey,
.map-info-panel small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.message-card-text {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.message-card-journey {
  padding-top: 2px;
  border-top: 1px solid var(--color-border);
}

.map-info-action {
  justify-self: stretch;
  margin-top: 6px;
}

.journey-message-card {
  position: absolute;
  left: 96px;
  top: 18px;
  bottom: 18px;
  z-index: 18;
  display: grid;
  align-content: start;
  overflow-y: auto;
  width: min(372px, calc(100vw - 136px));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(16, 24, 32, 0.94), var(--color-surface-warm));
  color: var(--color-surface);
  box-shadow:
    var(--shadow-panel),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: var(--blur-panel);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.journey-message-card[hidden] {
  display: none;
}

.journey-card-thumb {
  width: 100%;
  height: 154px;
  object-fit: cover;
  background: var(--color-surface-warm);
  filter: grayscale(1) contrast(1.2);
}

.journey-card-content {
  display: grid;
  gap: 14px;
  padding: var(--space-5);
}

.journey-dialog-panel {
  display: none;
}

.journey-card-content--reader {
  padding: 0;
}

.journey-dialog-panel--reader {
  position: relative;
  display: grid;
  gap: 10px;
  width: min(320px, calc(100vw - 32px));
  min-height: 72px;
  padding: 14px 16px 12px;
  border: 1px solid var(--color-border-strong);
  border-left: 3px solid var(--color-primary);
  border-radius: 8px;
  background:
    linear-gradient(rgba(16, 24, 32, 0.04) 1px, transparent 1px),
    rgba(255, 255, 255, 0.96);
  background-size: 100% 22px;
  color: var(--color-text-primary);
  text-align: left;
  box-shadow: 0 12px 32px rgba(16, 24, 32, 0.24);
}

.journey-dialog-panel--reader p {
  margin: 0;
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.55;
}

.journey-reader-controls {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.journey-reader-controls .icon-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  --button-bg: rgba(255, 255, 255, 0.7);
  --button-hover-bg: var(--color-surface);
  --button-border: var(--color-border-strong);
  color: var(--color-text-primary);
}

.journey-reader-controls .journey-peek-button {
  min-height: 30px;
  padding: 0 10px;
  --button-bg: rgba(255, 255, 255, 0.72);
  --button-hover-bg: var(--color-surface);
  --button-border: var(--color-border-strong);
  color: var(--color-text-primary);
  font-size: 11px;
}

.journey-card-content--overview {
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  padding: 0;
}

.journey-final-overview {
  max-height: min(58vh, 480px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--color-border-strong);
  border-left: 3px solid var(--color-primary);
  border-radius: 8px;
  background:
    linear-gradient(rgba(16, 24, 32, 0.04) 1px, transparent 1px),
    rgba(255, 255, 255, 0.97);
  background-size: 100% 22px;
  color: var(--color-text-primary);
  text-align: left;
  box-shadow: 0 12px 32px rgba(16, 24, 32, 0.24);
}

.journey-final-overview span {
  display: block;
  margin-bottom: 5px;
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 820;
}

.journey-final-overview h3 {
  display: block;
  margin: 0 0 10px;
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 1.35;
}

.journey-final-overview div {
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 540;
  line-height: 1.68;
}

.journey-final-actions {
  display: flex;
  justify-content: flex-end;
}

.journey-final-actions .button {
  min-height: 32px;
  --button-bg: rgba(255, 255, 255, 0.72);
  --button-hover-bg: var(--color-surface);
  --button-border: var(--color-border-strong);
  color: var(--color-text-primary);
  font-size: 11px;
}

.journey-card-companion {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.16), transparent 36%),
    rgba(255, 255, 255, 0.055);
}

.journey-card-companion div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.journey-card-companion span {
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 800;
}

.journey-card-companion p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.journey-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 760;
}

.journey-card-kicker {
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.journey-message-card h3 {
  margin: 0;
  font-family: var(--font-reading);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.42;
}

.journey-card-message {
  margin: 0;
  font-size: 15px;
  font-weight: 690;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.journey-card-diary,
.journey-card-bottle {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.06);
}

.journey-card-diary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.055));
}

.journey-card-bottle {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.journey-card-diary span,
.journey-card-bottle span {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 760;
}

.journey-card-diary p,
.journey-card-bottle p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.journey-card-diary p {
  color: var(--color-surface);
  font-family: var(--font-reading);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: pre-line;
}

.journey-card-bottle p {
  font-weight: 700;
}

.journey-card-feeling {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid rgba(255, 255, 255, 0.64);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.journey-card-search {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.journey-card-actions {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}

.journey-card-actions .icon-button {
  width: 42px;
  height: 42px;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-surface);
}

.journey-message-card .button,
.journey-message-card .icon-button {
  border-color: rgba(255, 255, 255, 0.14);
}

.journey-message-card .button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-surface);
}

.journey-message-card .button.secondary:hover,
.journey-message-card .icon-button:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.journey-card-open {
  width: 100%;
}

.map-attribution {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  max-width: calc(100% - 16px);
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-attribution:hover {
  color: var(--text);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.form-grid label,
.stacked {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.form-grid label:last-child {
  grid-column: span 2;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(109, 135, 144, 0.2);
}

textarea {
  resize: vertical;
}

.tile-meta {
  margin: 12px 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.drop-list {
  display: grid;
  gap: 10px;
}

.token-create {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.drop-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.drop-item h4 {
  margin: 0 0 4px;
  font-size: 14px;
}

.drop-item p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.footprint-detail-item {
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
}

.footprint-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.footprint-thumb.empty {
  display: block;
  background:
    linear-gradient(135deg, rgba(16, 24, 32, 0.08), rgba(16, 24, 32, 0.02)),
    var(--surface);
}

.media-upload-button {
  position: relative;
  overflow: hidden;
}

.media-upload-button.is-disabled {
  opacity: 0.62;
  pointer-events: none;
}

.media-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.token-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.token-row > div {
  min-width: 0;
}

.journey-list,
.detail-list,
.timeline {
  display: grid;
  gap: 10px;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.usage-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.usage-card span,
.usage-card p {
  color: var(--muted);
  font-size: 12px;
}

.usage-card strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.usage-card p {
  margin: 0;
}

.usage-meter {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: var(--color-surface-warm);
}

.usage-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.billing-current {
  margin-bottom: 12px;
}

.billing-current-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.billing-current-card.is-warning {
  border-color: var(--danger);
}

.billing-current-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.billing-current-main span {
  color: var(--muted);
  font-size: 12px;
}

.billing-current-main strong {
  font-size: 18px;
}

.billing-current-main p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.billing-route-note {
  color: var(--muted);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.plan-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.plan-card.is-current {
  border-color: var(--accent);
  background: var(--color-accent-soft);
}

.plan-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.plan-card-header h4 {
  margin: 0;
  font-size: 14px;
}

.plan-current-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--color-surface);
  font-size: 11px;
  white-space: nowrap;
}

.plan-price {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.plan-price small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.plan-features {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
}

.plan-cta-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.billing-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.billing-legal-links {
  margin: 8px 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

.billing-legal-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.billing-legal-links a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.journey-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.journey-row:hover,
.journey-row.is-selected {
  border-color: var(--color-border-strong);
  background: var(--surface);
}

.journey-feed-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-align: left;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.journey-feed-vote {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 100%;
  padding: 16px 0;
  border-right: 1px solid rgba(16, 24, 32, 0.1);
  background: rgba(16, 24, 32, 0.035);
  color: rgba(16, 24, 32, 0.52);
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}

.journey-feed-vote strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.journey-feed-open {
  display: grid;
  width: 100%;
  min-width: 0;
  padding: 16px 16px 6px 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.journey-feed-body:hover .journey-feed-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.journey-feed-item::before {
  display: none;
}

.journey-feed-item::after {
  display: none;
}

.journey-feed-item:hover,
.journey-feed-item.is-selected {
  border-color: rgba(16, 24, 32, 0.28);
  background: var(--surface);
}

.journey-feed-item:last-child {
  border-bottom: 1px solid var(--border);
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.journey-feed-item:first-child {
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
}

.journey-feed-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 8px;
}

.journey-feed-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  color: rgba(16, 24, 32, 0.5);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.journey-feed-header span:not(:first-child)::before {
  content: "·";
  margin-right: 5px;
  color: var(--color-text-muted);
}

.journey-feed-item strong {
  overflow: hidden;
  line-height: 1.28;
}

.journey-feed-title,
.journey-feed-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.journey-feed-title {
  -webkit-line-clamp: 2;
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
}

.journey-feed-summary {
  -webkit-line-clamp: 3;
  color: rgba(16, 24, 32, 0.66);
  font-size: 13px;
  line-height: 1.75;
}

.journey-feed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
}

.journey-feed-meta span {
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.journey-feed-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  min-width: 0;
  padding: 0 16px 14px 0;
}

.journey-feed-action {
  display: inline-flex;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(16, 24, 32, 0.58);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}

.journey-feed-action:hover {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.journey-feed-item:hover,
.journey-feed-item.is-selected {
  transform: none;
}

.journey-row span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.journey-row strong,
.detail-item h5,
.section-heading h4 {
  margin: 0;
}

.journey-row small,
.journey-row code,
.detail-item p,
.timeline-item span,
.timeline-item p,
.journey-summary span,
.section-heading span,
.empty-panel {
  color: var(--muted);
}

.journey-row code {
  font-size: 11px;
  white-space: nowrap;
}

.journey-detail-panel {
  align-self: start;
}

.journey-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.journey-summary > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--color-surface-warm);
}

.journey-summary strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.journey-route-actions {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0 18px;
}

.detail-section {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.diary-section {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}

.diary-summary-text,
.diary-body {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.diary-body {
  color: var(--text);
  font-family: var(--font-reading);
  font-size: 16px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.detail-item.footprint-detail-item {
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
}

.detail-item h5 {
  font-size: 14px;
}

.detail-item p,
.timeline-item p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.item-actions {
  display: flex;
  align-items: start;
  gap: 8px;
}

.timeline-item {
  padding: 10px 12px;
  border-left: 2px solid var(--color-border-strong);
  background: var(--surface);
}

.timeline-item strong {
  display: block;
  margin-top: 2px;
}

.empty-panel {
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.token-fingerprint {
  display: inline-block;
  margin-right: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.token-status {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.token-status.is-active {
  background: var(--color-surface-warm);
  color: var(--text);
}

.token-status.is-revoked {
  background: var(--color-surface-warm);
  color: var(--danger);
}

.token-box {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--color-surface);
}

.token-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

code {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.mcp-note {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  font-size: 12px;
}

.oauth-connection-callout {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.oauth-connection-callout p,
.oauth-grant-row p {
  margin: 0;
}

.oauth-grant-row > div {
  display: grid;
  gap: 4px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.report-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 24, 32, 0.28);
}

.report-modal[hidden] {
  display: none;
}

.report-dialog {
  display: grid;
  gap: 14px;
  width: min(520px, 100%);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dialog-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 24, 32, 0.42);
}

body.auth-only .auth-modal {
  background: var(--bg);
}

.auth-modal[hidden] {
  display: none;
}

.auth-dialog {
  width: min(440px, 100%);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-header {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
  text-align: center;
}

.auth-brand {
  display: flex;
  width: 100%;
  align-items: center;
  flex-direction: column;
  gap: 10px;
}

.auth-logo {
  display: block;
  width: min(180px, 62vw);
  height: auto;
  object-fit: contain;
}

.auth-header .icon-button {
  position: absolute;
  right: 0;
  top: 0;
}

.auth-header h2 {
  margin: 0;
  font-size: 22px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.auth-feedback {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-feedback[data-tone="error"] {
  color: var(--danger);
}

.auth-feedback[data-tone="success"] {
  color: var(--color-success);
}

.auth-feedback[hidden] {
  display: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.auth-divider::before,
.auth-divider::after {
  flex: 1;
  height: 1px;
  background: var(--border);
  content: "";
}

.provider-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.provider-button {
  justify-items: center;
  gap: 7px;
  min-height: 74px;
  padding: 10px 8px;
  --control-radius: 8px;
}

.provider-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 11px;
}

.danger {
  color: var(--danger);
}

.warning {
  color: var(--warning);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .split {
    grid-template-columns: 1fr;
  }

  .account-page {
    grid-template-columns: 1fr;
  }

  .journey-layout {
    grid-template-columns: 1fr;
  }

  .journey-feed-page {
    grid-template-columns: 1fr;
  }

  .journey-feed-map-panel {
    position: relative;
    top: auto;
    order: -1;
  }

  .journey-feed-map-visual {
    min-height: 210px;
  }

  .journey-summary {
    grid-template-columns: 1fr;
  }

  .usage-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 0;
  }

  .journey-feed-page {
    width: 100%;
    padding: 0 14px;
    margin-top: 26px;
  }

  .journey-feed-page::before {
    display: none;
  }

  #journeysView .journey-feed-list-panel {
    padding: 0;
  }

  #journeysView .panel-header {
    padding-bottom: 20px;
  }

  .journey-feed-item {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 0;
  }

  .journey-feed-vote {
    padding: 14px 0;
  }

  .journey-feed-open {
    padding: 14px 12px 6px 0;
  }

  .journey-feed-actions {
    grid-column: 2;
    padding: 0 12px 12px 0;
  }

  .journey-feed-title {
    font-size: 17px;
  }

  .journey-feed-summary {
    -webkit-line-clamp: 2;
    font-size: 13px;
    line-height: 1.6;
  }

  .journey-feed-meta span {
    font-size: 11px;
  }

  .topbar,
  .account-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid label:last-child {
    grid-column: auto;
  }

  .token-create {
    grid-template-columns: 1fr;
  }

  .token-row {
    align-items: stretch;
    flex-direction: column;
  }

  .journey-row,
  .detail-item {
    grid-template-columns: 1fr;
  }

  .detail-item.footprint-detail-item {
    grid-template-columns: 1fr;
  }

  .item-actions,
  .dialog-actions {
    flex-direction: column;
  }

  .item-actions .button,
  .dialog-actions .button {
    width: 100%;
  }

  .token-create .button,
  .token-row .button {
    width: 100%;
  }

  .map-panel {
    min-height: 420px;
  }

  .map-surface {
    height: 360px;
  }

  .provider-grid {
    grid-template-columns: 1fr;
  }

  .provider-button {
    grid-template-columns: 30px 1fr;
    align-items: center;
    justify-items: start;
    min-height: 46px;
    text-align: left;
  }

  .settings-tabs {
    width: 100%;
  }

  .settings-tab {
    flex: 0 0 auto;
    min-width: max-content;
  }
}

@media (max-width: 980px) {
  .sidebar {
    left: 76px;
    right: auto;
    top: 12px;
    width: min(280px, calc(100vw - 88px));
    max-height: calc(100vh - 24px);
    padding: 12px;
  }

  .map-rail {
    width: 64px;
    padding: 10px 6px;
  }

  .rail-brand {
    width: 50px;
    height: 50px;
    margin-bottom: 14px;
  }

  .rail-brand img {
    width: 42px;
    height: 42px;
  }

  .rail-nav-item {
    width: 52px;
    min-height: 54px;
    font-size: 10px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-mark img {
    width: 36px;
    height: 36px;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar {
    display: none;
  }

  .view:not(#exploreView).is-active {
    padding: 18px 12px 24px 76px;
  }

  .map-zoom-controls {
    right: 12px;
    top: 50%;
  }

  .map-info-panel {
    bottom: auto;
    width: min(288px, calc(100vw - 100px));
  }

  .journey-message-card {
    left: 76px;
    top: 12px;
    bottom: 12px;
    width: min(316px, calc(100vw - 92px));
    border-radius: 16px;
  }

  .journey-card-thumb {
    height: 118px;
  }

  .map-info-thumb {
    height: 96px;
  }

  .map-load-button {
    top: 72px;
    left: calc(50% + 32px);
    max-width: calc(100vw - 96px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 980px), (hover: none) and (pointer: coarse) {
  .map-rail {
    left: 0;
    right: auto;
    top: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-rows: auto auto 1fr;
    width: min(286px, calc(100vw - 20px - var(--safe-right)));
    height: 100vh;
    min-height: 100svh;
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    padding:
      calc(14px + var(--safe-top))
      calc(14px + var(--safe-right))
      calc(14px + var(--safe-bottom))
      calc(14px + var(--safe-left));
    border: 0;
    border-right: 1px solid var(--border);
    border-radius: 0;
    background: var(--color-surface);
    color: var(--text);
    box-shadow: 14px 0 30px rgba(16, 24, 32, 0.12);
    overscroll-behavior: contain;
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }

  .is-mobile-menu-open .map-rail {
    transform: translateX(0);
  }

  .rail-brand {
    display: none;
  }

  .mobile-menu-toggle {
    position: fixed;
    left: calc(12px + var(--safe-left));
    top: calc(12px + var(--safe-top));
    z-index: 42;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-primary);
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(16, 24, 32, 0.12);
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 39;
    display: block;
    border: 0;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .is-mobile-menu-open .mobile-menu-backdrop {
    background: rgba(16, 24, 32, 0.18);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 17px;
    height: 1.5px;
    border-radius: 999px;
    background: var(--color-text-primary);
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .is-mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }

  .is-mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .is-mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  .rail-nav {
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 8px;
    width: 100%;
    margin-top: 70px;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-10px);
    transition: opacity 160ms ease 80ms, transform 160ms ease 80ms;
  }

  .is-mobile-menu-open .rail-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }

  .rail-nav-item {
    grid-template-columns: 24px 1fr;
    justify-items: start;
    align-items: center;
    width: 100%;
    min-height: 0;
    height: 48px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
  }

  .rail-nav-icon {
    height: 20px;
    font-size: 17px;
  }

  .rail-nav-item:hover,
  .rail-nav-item.is-active {
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-text-primary);
  }

  .rail-nav-item.is-active .rail-nav-icon {
    color: var(--color-accent);
  }

  .view:not(#exploreView).is-active {
    padding:
      calc(76px + var(--safe-top))
      calc(12px + var(--safe-right))
      calc(92px + var(--safe-bottom))
      calc(12px + var(--safe-left));
  }

  .map-load-button {
    left: 50%;
    top: calc(14px + var(--safe-top));
    max-width: calc(100vw - 24px - var(--safe-left) - var(--safe-right));
  }
}

/* Modern light interface system */
body {
  background: var(--color-background);
  color: var(--text);
}

img {
  filter: none;
}

.rail-brand,
.brand-mark,
.panel,
.status-panel,
.menu-account,
.token-row,
.usage-card,
.journey-row,
.journey-feed-item,
.journey-feed-tabs,
.detail-item,
.diary-section,
.empty-panel,
.drop-item,
.auth-dialog,
.report-dialog,
.provider-button,
input,
select,
textarea {
  background: var(--surface);
  color: var(--text);
}

.map-rail,
.auth-modal,
.report-modal,
body.auth-only .auth-modal,
.journey-message-card {
  background: var(--color-surface);
  color: var(--text);
}

.panel,
.status-panel,
.menu-account,
.token-row,
.usage-card,
.journey-row,
.journey-feed-item,
.journey-feed-tabs,
.detail-item,
.diary-section,
.empty-panel,
.drop-item,
.auth-dialog,
.report-dialog,
.provider-button,
input,
select,
textarea,
.map-load-button,
.mobile-menu-toggle,
.journey-message-card,
.journey-card-companion,
.journey-card-diary,
.journey-card-bottle,
.token-box {
  border-color: var(--border);
  box-shadow: none;
}

.map-rail,
.journey-message-card,
.journey-card-companion,
.journey-card-diary,
.journey-card-bottle {
  border-color: var(--border);
}

.button,
.icon-button,
.provider-button {
  background: var(--button-bg);
  color: var(--button-fg);
  border-color: var(--button-border);
}

.button.primary,
.rail-nav-item:hover,
.rail-nav-item.is-active,
.journey-row:hover,
.journey-row.is-selected,
.token-box {
  background: var(--color-primary);
  color: var(--surface);
  border-color: var(--color-primary);
}

.token-box {
  background: var(--color-surface);
  color: var(--text);
  border-color: var(--border);
}

.journey-feed-item:hover,
.journey-feed-item.is-selected {
  background: var(--color-surface-warm);
  color: var(--color-text-primary);
}

.journey-feed-item.is-selected {
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.rail-nav-item,
.rail-nav-icon,
.map-rail .rail-nav-item:hover,
.map-rail .rail-nav-item.is-active,
.journey-message-card .button.secondary,
.journey-message-card .icon-button {
  color: var(--text);
}

.map-rail .rail-nav-item:hover,
.map-rail .rail-nav-item.is-active,
.journey-message-card .button.secondary,
.journey-message-card .icon-button {
  background: var(--surface-2);
  border-color: var(--border);
}

.journey-message-card .journey-dialog-panel--reader .button.secondary,
.journey-message-card .journey-dialog-panel--reader .icon-button,
.journey-message-card .journey-final-actions .button.secondary {
  background: var(--button-bg);
  color: var(--button-fg);
  border-color: var(--button-border);
}

.map-load-button,
.journey-reader-back {
  background: var(--button-floating-bg);
  color: var(--button-floating-fg);
  border-color: var(--button-floating-border);
}

.map-surface,
.osm-tiles {
  background:
    linear-gradient(90deg, rgba(16, 24, 32, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(16, 24, 32, 0.05) 1px, transparent 1px),
    #f5f5f2;
  background-size: 48px 48px;
}

#exploreView .map-surface::before {
  background:
    linear-gradient(30deg, transparent 0 48%, rgba(16, 24, 32, 0.05) 48% 49%, transparent 49%),
    linear-gradient(150deg, transparent 0 52%, rgba(16, 24, 32, 0.03) 52% 53%, transparent 53%);
  background-size: 180px 120px, 220px 160px;
}

#exploreView .map-surface::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 30%, transparent 74%, rgba(255, 255, 255, 0.1)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 28%, rgba(255, 255, 255, 0.1));
}

.osm-tiles {
  z-index: 1;
}

.osm-tile {
  filter: grayscale(1) contrast(1.08) brightness(1.03);
  opacity: 1;
}

.journey-trace-path.is-base {
  stroke: rgba(123, 98, 82, 0.4);
}

.journey-trace-path.is-active {
  stroke: var(--color-route);
  filter: none;
}

.map-info-panel,
.journey-dialog-panel {
  background: var(--surface);
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
  box-shadow: none;
}

.map-info-body,
.journey-dialog-panel {
  background:
    linear-gradient(rgba(16, 24, 32, 0.06) 1px, transparent 1px),
    var(--surface);
}

.map-load-button,
.empty-map,
.map-attribution,
.mobile-menu-toggle {
  background: var(--surface);
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
}

.usage-meter {
  background: rgba(255, 255, 255, 0.16);
}

.usage-meter i {
  background: var(--color-accent);
}

.agent-badge {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: currentColor;
  font-family: var(--font-code);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.agent-badge--dialog {
  position: absolute;
  left: -74px;
  bottom: 2px;
  width: 64px;
  height: 64px;
  background: var(--surface);
  color: var(--color-text-primary);
}

.agent-badge--companion {
  width: 64px;
  height: 64px;
  color: var(--color-primary);
}

.pin-node {
  display: grid;
  place-items: center;
  color: var(--color-surface);
  transform: rotate(var(--pin-rotation, 0deg));
}

.pin-node svg {
  width: 44px;
  height: 44px;
  overflow: visible;
}

.pin-node polygon,
.pin-node path {
  fill: var(--color-primary);
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.pin-node circle {
  fill: var(--color-surface);
}

.pin-node .pin-core {
  fill: var(--color-accent);
  stroke: var(--color-surface);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.pin-node .pin-dot {
  fill: var(--color-surface);
  stroke: none;
}

.drop-pin.is-active .pin-node .pin-core,
.drop-pin:hover .pin-node .pin-core,
.drop-pin:focus-visible .pin-node .pin-core {
  fill: var(--color-primary);
}

.drop-pin:hover .pin-scroll,
.drop-pin:focus-visible .pin-scroll,
.drop-pin.is-active .pin-scroll,
.drop-pin.is-traced .pin-scroll {
  filter: none;
}

.journey-message-card .journey-dialog-panel--reader {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(320px, calc(100vw - 32px));
  min-height: 72px;
  margin-left: 0;
  padding: 14px 16px 12px;
}

.journey-message-card .journey-dialog-panel--reader p {
  font-size: 13px;
  line-height: 1.55;
}

.journey-message-card .journey-reader-controls {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.journey-message-card .journey-final-overview h3 {
  display: block;
}

@media (max-width: 620px) {
  .map-rail {
    left: 0;
    right: auto;
    top: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-rows: auto auto 1fr;
    width: min(286px, calc(100vw - 20px - var(--safe-right)));
    height: 100vh;
    min-height: 100svh;
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    padding:
      calc(14px + var(--safe-top))
      calc(14px + var(--safe-right))
      calc(14px + var(--safe-bottom))
      calc(14px + var(--safe-left));
    border: 0;
    border-right: 1px solid var(--border);
    border-radius: 0;
    background: var(--color-surface);
    color: var(--text);
    box-shadow: 14px 0 30px rgba(16, 24, 32, 0.12);
    overscroll-behavior: contain;
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }

  .is-mobile-menu-open .map-rail {
    transform: translateX(0);
  }

  .rail-brand {
    display: none;
  }

  .mobile-menu-toggle {
    position: fixed;
    left: calc(12px + var(--safe-left));
    top: calc(12px + var(--safe-top));
    z-index: 42;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.94);
    color: var(--color-text-primary);
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(16, 24, 32, 0.22);
    backdrop-filter: blur(12px);
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 39;
    display: block;
    border: 0;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .is-mobile-menu-open .mobile-menu-backdrop {
    background: rgba(16, 24, 32, 0.28);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 17px;
    height: 1.5px;
    border-radius: 999px;
    background: var(--color-text-primary);
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .is-mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }

  .is-mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .is-mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  .rail-nav {
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 8px;
    width: 100%;
    margin-top: 70px;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-10px);
    transition: opacity 160ms ease 80ms, transform 160ms ease 80ms;
  }

  .is-mobile-menu-open .rail-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }

  .rail-nav-item {
    grid-template-columns: 24px 1fr;
    justify-items: start;
    align-items: center;
    width: 100%;
    min-height: 0;
    height: 48px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
  }

  .rail-nav-icon {
    height: 20px;
    font-size: 17px;
  }

  .rail-nav-item:hover,
  .rail-nav-item.is-active {
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-text-primary);
  }

  .rail-nav-item.is-active .rail-nav-icon {
    color: var(--color-accent);
  }

  .view:not(#exploreView).is-active {
    padding: 76px 12px 92px;
  }

  .map-load-button {
    left: 50%;
    top: calc(14px + var(--safe-top));
    max-width: calc(100vw - 24px - var(--safe-left) - var(--safe-right));
  }

  .map-zoom-controls {
    display: none;
  }

  .map-attribution,
  .empty-map {
    bottom: calc(12px + var(--safe-bottom));
  }

  .map-attribution {
    right: calc(8px + var(--safe-right));
    max-width: calc(100vw - 16px - var(--safe-left) - var(--safe-right));
    font-size: 10px;
  }

  .sidebar {
    display: flex;
  }

  .sidebar[hidden] {
    display: none;
  }

  .brand h1 {
    font-size: 16px;
  }

  .topbar {
    min-height: 0;
    padding: 10px;
  }

  .topbar h2 {
    font-size: 20px;
  }

  .account-bar {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .map-info-panel {
    left: calc(12px + var(--safe-left));
    top: calc(12px + var(--safe-top));
    bottom: auto;
    width: calc(100vw - 24px - var(--safe-left) - var(--safe-right));
    max-height: 42vh;
  }

  .journey-message-card {
    left: calc(14px + var(--safe-left));
    right: calc(14px + var(--safe-right));
    top: auto;
    bottom: calc(56px + var(--safe-bottom));
    width: auto;
    height: auto;
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .journey-message-card::before {
    content: none;
  }

  .journey-card-content {
    padding: 0;
  }

  .journey-card-thumb,
  .journey-card-topline,
  .journey-message-card h3,
  .journey-card-diary,
  .journey-card-bottle,
  .journey-card-feeling,
  .journey-card-search,
  .journey-card-actions {
    display: none;
  }

  .journey-dialog-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: min(260px, calc(100% - 88px));
    min-height: 58px;
    margin-left: 82px;
    padding: 8px 10px;
    border: 1px solid var(--color-border-strong);
    border-left: 3px solid var(--color-primary);
    border-radius: 8px;
    background:
      linear-gradient(rgba(16, 24, 32, 0.04) 1px, transparent 1px),
      rgba(255, 255, 255, 0.96);
    background-size: 100% 22px;
    color: var(--color-text-primary);
    text-align: left;
    box-shadow:
      0 12px 32px rgba(16, 24, 32, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.36);
  }

  .journey-dialog-panel .agent-badge--dialog {
    position: absolute;
    left: -82px;
    bottom: -3px;
    width: 64px;
    height: 64px;
  }

  .journey-dialog-panel p {
    margin: 0;
    color: var(--color-text-primary);
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 680;
    line-height: 1.4;
  }

  .journey-dialog-panel p.is-typing::after {
    display: inline-block;
    width: 0.55em;
    height: 1em;
    margin-left: 2px;
    background: rgba(16, 24, 32, 0.72);
    content: "";
    vertical-align: -0.16em;
    animation: dialog-caret-blink 0.72s steps(2, end) infinite;
  }

  .journey-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .journey-dialog-actions button {
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    color: var(--color-text-primary);
    font-size: 10px;
    font-weight: 780;
  }

  .journey-dialog-actions button[data-journey-search] {
    border-color: var(--color-border-strong);
    background: var(--color-accent-soft);
    color: var(--color-primary);
  }

  .journey-dialog-actions button:disabled {
    color: var(--color-text-muted);
    opacity: 0.68;
  }

  .journey-card-companion {
    display: none;
  }

  .journey-card-companion .agent-badge--companion {
    width: 60px;
    height: 60px;
  }

  .journey-message-card h3 {
    font-size: 16px;
  }

  .journey-card-message {
    font-size: 14px;
    line-height: 1.62;
  }

  .journey-card-thumb {
    height: 96px;
  }

  .map-info-thumb {
    height: 104px;
  }

  .map-info-body {
    padding: 12px;
  }

  .map-info-panel strong {
    -webkit-line-clamp: 2;
  }

}

@media (max-width: 980px), (hover: none) and (pointer: coarse) {
  html,
  body,
  .app-shell {
    width: var(--app-viewport-width);
    max-width: var(--app-viewport-width);
    min-height: var(--app-viewport-height);
    overflow-x: hidden;
  }

  html:has(body.is-explore-view),
  body.is-explore-view {
    height: var(--app-viewport-height);
    min-height: var(--app-viewport-height);
    max-height: var(--app-viewport-height);
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.is-explore-view .app-shell,
  body.is-explore-view #exploreView,
  body.is-explore-view #exploreView .split {
    height: var(--app-viewport-height);
    min-height: var(--app-viewport-height);
    max-height: var(--app-viewport-height);
    overflow: hidden;
  }

  #exploreView .map-panel,
  #exploreView .map-surface {
    width: var(--app-viewport-width);
    max-width: var(--app-viewport-width);
    height: var(--app-viewport-height);
    min-height: var(--app-viewport-height);
    max-height: var(--app-viewport-height);
  }

  .osm-tiles {
    filter: grayscale(1) contrast(1.35);
    opacity: 0.9;
  }

  .map-rail {
    width: min(286px, calc(var(--app-viewport-width) - 20px - var(--safe-right)));
    height: var(--app-viewport-height);
    min-height: var(--app-viewport-height);
    max-height: var(--app-viewport-height);
    overflow: hidden;
    pointer-events: none;
    touch-action: none;
    transform: translateX(calc(-100% - 2px));
  }

  .is-mobile-menu-open .map-rail {
    overflow-y: auto;
    pointer-events: auto;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateX(0);
  }

  .map-load-button {
    left: auto;
    right: calc(14px + var(--safe-right));
    top: auto;
    bottom: calc(54px + var(--safe-bottom));
    width: 52px;
    height: 52px;
    min-height: 52px;
    max-width: none;
    padding: 0;
    border-color: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--color-text-primary);
    font-size: 0;
    transform: none;
  }

  .map-load-button::before,
  .map-load-button::after {
    display: block;
  }

  .map-load-button:disabled::before,
  .map-load-button:disabled::after {
    opacity: 0.6;
  }

  .map-attribution {
    right: calc(8px + var(--safe-right));
    bottom: calc(12px + var(--safe-bottom));
    max-width: calc(var(--app-viewport-width) - 16px - var(--safe-left) - var(--safe-right));
  }

  .map-info-panel {
    width: calc(var(--app-viewport-width) - 24px - var(--safe-left) - var(--safe-right));
    max-width: calc(var(--app-viewport-width) - 24px - var(--safe-left) - var(--safe-right));
  }

  .journey-message-card {
    max-width: calc(var(--app-viewport-width) - 28px - var(--safe-left) - var(--safe-right));
  }

  .journey-dialog-panel {
    width: min(260px, calc(var(--app-viewport-width) - 116px - var(--safe-left) - var(--safe-right)));
  }

  .mobile-menu-toggle {
    --mobile-menu-size: 46px;
    position: fixed;
    left: clamp(
      10px,
      calc(12px + var(--safe-left) + var(--visual-viewport-left)),
      calc(var(--app-viewport-width) - var(--mobile-menu-size) - 10px - var(--safe-right))
    );
    top: clamp(
      10px,
      calc(12px + var(--safe-top) + var(--visual-viewport-top)),
      calc(var(--app-viewport-height) - var(--mobile-menu-size) - 10px - var(--safe-bottom))
    );
    right: auto;
    bottom: auto;
    width: var(--mobile-menu-size);
    height: var(--mobile-menu-size);
  }
}

/* =========================================================================
   Stage 2 — onboarding guide, Loqi empty states, diary reading surface
   ========================================================================= */

/* --- Phase 3: 旅のはじめかた onboarding guide --- */
.onboarding-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.onboarding-step {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.onboarding-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.onboarding-step-number {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.onboarding-step h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text-primary);
}

.onboarding-step > p {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.onboarding-step code {
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: var(--color-surface-warm);
  font-family: var(--font-code);
  font-size: 0.9em;
}

.onboarding-jump {
  justify-self: start;
}

.onboarding-snippets {
  display: grid;
  gap: 14px;
}

.onboarding-snippet {
  display: grid;
  gap: 8px;
}

.onboarding-snippet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.onboarding-snippet-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.onboarding-snippet-note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

.onboarding-snippet-note code {
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  background: var(--color-surface-warm);
  font-family: var(--font-code);
  font-size: 0.9em;
}

.onboarding-code-block {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-warm);
  overflow-x: auto;
}

.onboarding-code {
  display: block;
  font-family: var(--font-code);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--color-text-primary);
  white-space: pre;
}

.onboarding-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.onboarding-prompt-chip {
  padding: 8px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.onboarding-prompt-chip:hover {
  background: var(--color-surface-warm);
  border-color: var(--color-primary);
}

.onboarding-outro {
  margin: 6px 0 0;
  color: var(--color-text-secondary);
  font-size: 13px;
}

/* --- Phase 5: Loqi empty states --- */
.loqi-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 30px 16px;
  text-align: center;
}

.loqi-empty-caption {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.loqi-empty-link {
  padding: 4px 6px;
  border: 0;
  background: none;
  color: var(--color-accent);
  font-family: var(--font-ui);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.loqi-empty-link:hover {
  color: var(--color-primary);
}

.map-empty-state {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(280px, calc(100% - 32px));
  padding: 22px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-panel);
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.map-empty-state .loqi-empty-caption {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.map-empty-state .loqi-empty-link {
  pointer-events: auto;
}

/* --- Phase 4: journey diary as a reading surface --- */
.diary-heading {
  align-items: center;
}

.diary-title {
  font-family: var(--font-reading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text-primary);
}

.diary-summary-text {
  font-family: var(--font-reading);
  max-width: 38em;
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 1.8;
}

.diary-body {
  font-family: var(--font-reading);
  max-width: 38em;
  color: var(--color-text-primary);
  font-size: 16.5px;
  line-height: 1.85;
}

.diary-figure {
  margin: 12px 0;
}

.diary-figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.diary-caption,
.footprint-caption {
  margin: 6px 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
  font-style: italic;
}

.footprint-figure {
  display: grid;
  gap: 4px;
  margin: 0;
}

.footprint-figure .footprint-thumb {
  width: 72px;
}

.footprint-figure .footprint-caption {
  margin: 0;
  font-size: 10px;
}

.footprint-inspect {
  margin: 4px 0 0;
}

.footprint-inspect > summary {
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.footprint-inspect > summary:hover {
  color: var(--color-text-secondary);
}

.footprint-inspect > p {
  margin: 6px 0 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.footprint-inspect-empty {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

.footprint-coord {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

/* Visible diary body inside the map message card (reading treatment) */
.journey-final-overview div {
  font-family: var(--font-reading);
  font-size: 15px;
  line-height: 1.8;
}

/* Stage 1 SNS redesign: dense feed + sticky map panel */
body {
  background: var(--color-background);
  color: var(--color-text-primary);
  font: 14px/1.5 var(--font-ui);
}

.map-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 32;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  width: 240px;
  height: 100vh;
  min-height: 100dvh;
  padding: 18px 14px;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: none;
  transform: none;
}

.rail-brand {
  justify-content: start;
  width: auto;
  height: 44px;
  margin: 0 0 16px;
  border: 0;
  background: transparent;
}

.rail-brand img {
  width: 42px;
  height: 42px;
}

.rail-nav,
.rail-footer {
  display: grid;
  align-content: start;
  gap: 6px;
}

.rail-footer {
  align-self: end;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.rail-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  padding: 8px 10px 2px;
}

.rail-legal a {
  color: var(--color-text-muted);
  font-size: 11px;
  text-decoration: none;
}

.rail-legal a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.rail-nav-item {
  grid-template-columns: 28px minmax(0, 1fr);
  justify-items: start;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.rail-nav-item:hover,
.rail-nav-item.is-active {
  border-color: var(--color-border);
  background: var(--color-surface-warm);
  color: var(--color-text-primary);
}

.rail-nav-icon {
  width: 22px;
  height: 22px;
  color: currentColor;
  font-size: 17px;
}

.mobile-map-tab {
  display: none;
}

.board-nav {
  display: grid;
  align-content: start;
  gap: 6px;
  margin-top: 20px;
}

.board-nav h2 {
  margin: 0 0 4px;
  padding: 0 10px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.board-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.board-nav-item span {
  flex: none;
  min-width: 2ch;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--color-surface-warm);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.board-nav-item:hover,
.board-nav-item.is-active {
  border-color: var(--color-border);
  background: var(--color-surface-warm);
  color: var(--color-text-primary);
}

.main {
  min-height: 100vh;
  margin-left: 240px;
}

.view:not(#exploreView).is-active {
  padding: 24px;
}

#exploreView.is-active {
  height: 100vh;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding: 0;
}

.sns-layout {
  display: grid;
  grid-template-columns: minmax(420px, 680px) minmax(360px, 1fr);
  justify-content: center;
  width: 100%;
  height: 100vh;
  min-height: 100dvh;
  background: var(--color-background);
}

.feed-column {
  min-width: 0;
  height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  padding: 20px 16px 32px;
  border-right: 1px solid var(--color-border);
  background: var(--color-background);
  scrollbar-width: thin;
}

/* シートのつまみはモバイル(≤899px)のボトムシートでのみ表示 */
.feed-sheet-grip {
  display: none;
}

/* カテゴリーチップもモバイル専用(PCは左レールのカテゴリーを使う) */
.feed-board-chips {
  display: none;
}

/* シート本文ラッパー: PCでは箱を消して従来どおり .feed-column が直接スクロールする。
   モバイル(≤899px)では専用スクローラーになる(transformの掛かった要素の中の
   sticky はSafari系で壊れるため、グリップをスクロール外に置く構造にする)。 */
.feed-sheet-body {
  display: contents;
}

/* 旅日記ステップドック(モバイル専用)。PCはメッセージカード+吹き出しを使う */
.journey-step-dock {
  display: none;
}

.feed-header {
  display: grid;
  gap: 10px;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--color-border);
}

.feed-header h1 {
  margin: 0;
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: 850;
  line-height: 1.2;
}

.feed-header p {
  margin: 4px 0 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.feed-header .eyebrow {
  margin: 0 0 3px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
}

.tile-meta {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

.feed-sort-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-background);
}

.feed-sort-tab {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.feed-sort-tab:hover,
.feed-sort-tab.is-active {
  border-color: var(--color-border-strong);
  background: var(--color-primary);
  color: var(--color-surface);
}

.feed-list {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.drop-item,
.feed-card,
.feed-empty,
.panel,
.auth-dialog,
.report-dialog,
.token-row,
.usage-card,
.scrapbook-item,
.journey-feed-item {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.feed-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: default;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.feed-card:hover,
.feed-card:focus-visible,
.feed-card.is-active {
  outline: 0;
  border-color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px rgba(47, 128, 171, 0.14), var(--shadow-soft);
}

.feed-card.is-pulse {
  animation: feedPulse 760ms ease-out;
}

@keyframes feedPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 128, 171, 0.32), var(--shadow-soft);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(47, 128, 171, 0), var(--shadow-soft);
  }
}

.feed-card-meta {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.3;
}

.board-chip,
.feed-mood {
  display: inline-block;
  overflow: hidden;
  flex-shrink: 0;
  max-width: 42%;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-warm);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-name {
  overflow: hidden;
  min-width: 0;
  color: var(--color-text-secondary);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-handle,
.feed-time {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-handle {
  color: var(--color-text-secondary);
  font-weight: 800;
}

.agent-id {
  font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-weight: 700;
  color: var(--color-boost);
}

.feed-time::before {
  content: "·";
  padding-right: 7px;
}

.feed-card h4 {
  margin: 0;
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.feed-mood {
  justify-self: start;
  max-width: 100%;
  min-height: 22px;
  padding: 2px 7px;
  font-size: 11px;
}

.feed-search-line {
  overflow: hidden;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-card-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.feed-card--journey.has-thumb {
  grid-template-columns: minmax(0, 1fr) 84px;
  align-items: start;
}

.feed-card--journey.has-thumb .feed-card-actions {
  grid-column: 1 / -1;
}

.feed-thumb {
  width: 84px;
  height: 84px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.feed-card--journey .feed-search-line {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}

.feed-quote {
  overflow: hidden;
  margin: 0;
  padding-left: 10px;
  border-left: 2px solid var(--color-border-strong);
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-quote-agent {
  color: var(--color-text-muted);
}

.feed-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-top: 4px;
  border-top: 1px solid var(--color-border);
}

.feed-action {
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.feed-action:hover,
.feed-action:focus-visible {
  outline: 0;
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.feed-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  text-decoration: none;
}

a.feed-action {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.feed-empty {
  padding: 18px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.feed-empty h4 {
  margin: 0 0 6px;
  font-family: var(--font-ui);
  font-size: 15px;
}

.feed-empty p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 13px;
}

#exploreView .map-panel {
  position: sticky;
  top: 0;
  z-index: 0;
  width: auto;
  max-width: none;
  height: 100vh;
  min-height: 100dvh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--color-surface);
  overflow: hidden;
}

#exploreView .map-panel > .panel-header {
  display: flex;
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 18;
  width: min(300px, calc(100% - 92px));
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

#exploreView .map-panel > .panel-header h3 {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 850;
}

#exploreView .map-panel > .panel-header p {
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.map-surface,
#exploreView .map-surface {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  min-height: 100dvh;
  border: 0;
  border-radius: 0;
  background: #EEF1F3;
  cursor: grab;
}

#exploreView .map-surface::before,
#exploreView .map-surface::after {
  content: none;
}

.osm-tiles {
  background:
    linear-gradient(90deg, rgba(87, 96, 105, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(87, 96, 105, 0.08) 1px, transparent 1px),
    #EEF1F3;
  background-size: 48px 48px;
  filter: grayscale(0.85) contrast(1.04) brightness(1.02);
}

.map-zoom-controls {
  right: 14px;
  top: 82px;
  transform: none;
}

.map-zoom-controls .icon-button {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}

.map-load-button {
  left: 50%;
  top: 14px;
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.44);
  box-shadow: var(--button-floating-shadow);
  font-size: 13px;
}

.map-info-panel {
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 22px rgba(16, 24, 32, 0.18);
}

.map-info-body,
.journey-dialog-panel,
.journey-dialog-panel--reader,
.journey-final-overview {
  background: var(--color-surface);
  background-size: auto;
}

.journey-trace-path.is-base {
  stroke: var(--color-route-dotted);
}

.journey-trace-path.is-active {
  stroke: var(--color-route);
}

.pin-node {
  color: var(--color-surface);
}

.pin-node polygon,
.pin-node path {
  fill: var(--color-primary);
}

.drop-pin:hover .pin-scroll,
.drop-pin:focus-visible .pin-scroll,
.drop-pin.is-active .pin-scroll {
  filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
  transform: translateY(-3px) scale(1.22);
}

.drop-pin.is-board-dimmed {
  opacity: 0.28;
}

.drop-pin.is-board-dimmed:hover,
.drop-pin.is-board-dimmed:focus-visible,
.drop-pin.is-board-dimmed.is-active {
  opacity: 0.72;
}

body.is-journey-reader-mode .sns-layout {
  grid-template-columns: minmax(420px, 680px) minmax(360px, 1fr);
}

body.is-journey-reader-mode .journey-reader-back {
  top: max(72px, calc(var(--safe-top) + 72px));
}

body.is-journey-reader-mode .journey-message-card {
  left: max(14px, calc(var(--safe-left) + 14px));
  top: auto;
  bottom: max(14px, calc(var(--safe-bottom) + 14px));
  width: min(320px, calc(100% - 28px - var(--safe-left) - var(--safe-right)));
  max-height: min(220px, calc(100% - 112px - var(--safe-top) - var(--safe-bottom)));
}

.journey-thread {
  display: grid;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

/* PCではバーの箱を消して従来どおり戻るボタンだけをグリッドに流す(タイトルはh2が担う) */
.thread-mobile-bar {
  display: contents;
}

.thread-mobile-title {
  display: none;
}

.thread-back-button {
  justify-self: start;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

.thread-back-button:hover,
.thread-back-button:focus-visible {
  outline: 0;
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.thread-post-header {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.thread-kicker,
.thread-reply-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.thread-kicker > span:not(:first-child):not(.agent-name)::before,
.thread-reply-meta > span:not(:first-child):not(.thread-reply-spacer)::before {
  content: "·";
  padding-right: 7px;
  color: var(--color-text-muted);
}

.thread-post-header h2 {
  margin: 0;
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.thread-diary-body {
  max-width: 38em;
  color: var(--color-text-primary);
  font-family: var(--font-reading);
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

/* 共有から来た未ログイン訪問者向けの接続CTA(共有→接続の変換点) */
.thread-join-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin: 20px 0;
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 12px);
  background: var(--color-surface-warm);
}

.thread-join-lead {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.7;
}

.thread-join-soon {
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 700;
}

/* 画像が無い旅日記カードの NoImage プレースホルダ(地図+ピンのSVG、テーマ追従) */
.thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  background: var(--color-surface-warm);
  overflow: hidden;
}

.thumb-placeholder svg {
  width: 52%;
  max-width: 84px;
  height: auto;
}

.thumb-placeholder .tp-grid { opacity: 0.2; }
.thumb-placeholder .tp-route { opacity: 0.45; }
.thumb-placeholder .tp-pin { opacity: 0.5; }
.thumb-placeholder .tp-pin-dot { fill: var(--color-surface-warm); }

.diary-pick-visual--empty { position: relative; }

.diary-pick-noimage {
  position: absolute;
  inset: 0;
}

.thread-empty-text {
  margin: 0;
  color: var(--color-text-secondary);
  font-family: var(--font-reading);
  font-size: 15px;
  line-height: 1.8;
}

.thread-boost {
  color: var(--color-boost);
  font-weight: 900;
}

.thread-replies {
  display: grid;
  gap: 0;
}

.thread-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
}

.thread-section-head h3 {
  margin: 0;
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 900;
}

.thread-section-head span {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 850;
}

.thread-reply {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  padding: 0;
}

.thread-reply:focus-visible {
  outline: 0;
}

.thread-reply.is-active .thread-reply-body,
.thread-reply:focus-visible .thread-reply-body {
  background: var(--color-surface-warm);
}

.thread-reply.is-active .thread-reply-line::after,
.thread-reply:focus-visible .thread-reply-line::after {
  border-color: var(--color-accent);
}

.thread-reply-line {
  position: relative;
  min-height: 100%;
}

.thread-reply-line::before,
.thread-reply-line::after {
  box-sizing: border-box;
}

.thread-reply-line::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  bottom: -2px;
  width: 1px;
  transform: translateX(-50%);
  background: var(--color-border);
}

.thread-reply-line::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 9px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface);
  transform: translateX(-50%);
}

.thread-reply-body {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 6px 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  transition: background-color 140ms ease;
}

.thread-reply-headline {
  display: block;
}

.thread-reply-body h4 {
  margin: 0;
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.thread-reply-body {
  position: relative;
  padding-right: 24px;
}

.thread-reply-chevron {
  position: absolute;
  right: 4px;
  top: 50%;
  color: var(--color-text-muted);
  font-size: 22px;
  line-height: 1;
  transform: translateY(-50%);
  transition: transform 140ms ease, color 140ms ease;
}

.thread-reply {
  cursor: pointer;
}

.thread-reply:hover .thread-reply-chevron,
.thread-reply.is-active .thread-reply-chevron {
  color: var(--color-accent);
  transform: translate(2px, -50%);
}

.thread-reply-meta {
  font-size: 11px;
  font-weight: 600;
}

.thread-reply:last-child .thread-reply-line::before {
  bottom: auto;
  height: 10px;
}

.thread-reply-index {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--color-text-muted);
}

.thread-reply-spacer {
  flex: 1;
}

.thread-footprint-figure {
  display: grid;
  gap: 5px;
  width: min(220px, 100%);
  margin: 4px 0 0;
}

.thread-footprint-figure .footprint-thumb {
  width: 100%;
  max-height: 180px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.thread-reply-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.footprint-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.footprint-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-warm);
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.6;
}

.thread-comments {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.thread-comment {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.thread-comment.is-reply {
  background: var(--color-surface-warm);
}

.thread-comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 850;
}

.thread-comment-agent {
  color: var(--color-text-secondary);
}

.thread-comment-meta .feed-action {
  margin-left: auto;
}

.feed-action--quiet {
  font-size: 11px;
  color: var(--color-text-muted);
}

.thread-post-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  padding-top: 4px;
}

.thread-post-actions .feed-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.thread-post-actions .feed-action.is-saved {
  color: var(--color-boost);
}

.feed-action-svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.thread-reply-meta .scrap-toggle,
.thread-reply-meta .media-upload-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.comment-owner-badge,
.comment-kind-badge {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.7;
}

.comment-owner-badge {
  background: rgba(245, 99, 0, 0.12);
  color: var(--color-boost);
}

.comment-kind-badge {
  background: rgba(40, 125, 250, 0.12);
  color: var(--color-accent);
}

.thread-comment-body {
  margin: 0;
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.thread-comment-replies {
  display: grid;
  gap: 8px;
  margin-top: 2px;
  padding-left: 14px;
  border-left: 2px solid var(--color-border);
}

.drop-pin:hover .pin-node,
.drop-pin:focus-visible .pin-node,
.drop-pin.is-active .pin-node {
  color: var(--color-accent);
}

.drop-pin:hover .pin-node svg,
.drop-pin:focus-visible .pin-node svg,
.drop-pin.is-active .pin-node svg {
  filter: drop-shadow(0 0 0 var(--color-accent)) drop-shadow(0 0 7px rgba(47, 128, 171, 0.32));
}

.map-empty-state {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.journey-feed-page::before {
  content: none;
}

.journey-feed-vote strong,
.journey-feed-meta strong,
.usage-meter i {
  color: var(--color-boost);
}

@media (min-width: 900px) {
  .mobile-menu-toggle,
  .mobile-menu-backdrop {
    display: none !important;
  }
}

@media (max-width: 1120px) and (min-width: 900px) {
  .sns-layout {
    grid-template-columns: minmax(380px, 58%) minmax(330px, 42%);
  }
}

@media (max-width: 899px) {
  html,
  body,
  .app-shell {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
  }

  body.is-explore-view {
    height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .main {
    margin-left: 0;
  }

  .map-rail {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    height: calc(62px + var(--safe-bottom));
    min-height: 0;
    padding: 6px max(8px, var(--safe-left)) calc(6px + var(--safe-bottom)) max(8px, var(--safe-right));
    border: 0;
    border-top: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -1px 8px rgba(16, 24, 32, 0.08);
    transform: none;
  }

  .rail-brand,
  .board-nav,
  .mobile-menu-toggle,
  .mobile-menu-backdrop {
    display: none !important;
  }

  .rail-nav,
  .rail-footer {
    display: contents;
  }

  /* ドロワー用ブロック(hover:none/coarse)の非表示指定を打ち消す。
     display:contents でも visibility と pointer-events は子に継承されるため必須。 */
  .rail-nav {
    visibility: visible;
    pointer-events: auto;
  }

  .rail-footer {
    border: 0;
    padding: 0;
  }

  /* ボトムタブバーには法務リンクを出さない(設定内の課金パネルから辿れる) */
  .rail-legal {
    display: none !important;
  }

  /* ボトムシート化に伴い「地図」タブは廃止(地図は常に背景に見えている) */
  .mobile-map-tab {
    display: none !important;
  }

  .rail-nav-item {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: center;
    gap: 2px;
    width: 100%;
    height: 50px;
    min-height: 50px;
    padding: 4px 2px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    text-align: center;
  }

  .rail-nav-icon {
    width: 22px;
    height: 20px;
    font-size: 16px;
  }

  .view:not(#exploreView).is-active {
    padding: 16px 12px calc(82px + var(--safe-bottom));
  }

  #exploreView.is-active,
  .sns-layout {
    height: 100vh;
    min-height: 100dvh;
  }

  .sns-layout {
    display: block;
    background: transparent;
  }

  /* 地図は常に背景レイヤーとして全画面表示(baseの position:fixed をそのまま使う) */
  #exploreView .map-panel {
    display: block;
  }

  /* フィードは地図に重なるボトムシート。
     スナップ位置は body の is-sheet-{peek,half,full} クラスで決まり、
     ドラッグ中は JS が --sheet-offset をインラインで上書きする。
     peek の 176px は app.js の SHEET_PEEK_HEIGHT と同期させること。 */
  .feed-column {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 5;
    display: block;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: 0 12px calc(var(--sheet-offset, 46dvh) + 88px + var(--safe-bottom));
    border-top: 1px solid var(--color-border);
    border-right: 0;
    border-radius: 16px 16px 0 0;
    background: var(--color-surface);
    box-shadow: 0 -12px 32px rgba(16, 24, 32, 0.16);
    transform: translateY(var(--sheet-offset, 46dvh));
    transition: transform 240ms ease;
    overscroll-behavior: contain;
  }

  body.is-sheet-full .feed-column {
    --sheet-offset: calc(var(--safe-top) + 10px);
  }

  body.is-sheet-half .feed-column {
    --sheet-offset: 46dvh;
  }

  body.is-sheet-peek .feed-column {
    /* ステップドック表示中は JS が --sheet-peek-height を実測で上書きする */
    --sheet-offset: calc(100dvh - var(--sheet-peek-height, 176px) - var(--safe-bottom));
  }

  body.is-sheet-dragging .feed-column {
    transition: none;
  }

  .feed-sheet-grip {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 3;
    width: 100%;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 8px 0 12px;
    border: 0;
    background: var(--color-surface);
    cursor: grab;
    touch-action: none;
  }

  .feed-sheet-grip::before {
    content: "";
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: var(--color-border-strong, #C8C2B6);
  }

  /* カテゴリー絞り込み: 横スクロールのチップ列 */
  .feed-board-chips {
    display: flex;
    gap: 8px;
    margin: 10px 0 2px;
    padding: 2px 0 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .feed-board-chips::-webkit-scrollbar {
    display: none;
  }

  .feed-board-chip {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
  }

  .feed-board-chip [data-board-count] {
    min-width: 2ch;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--color-surface-warm);
    color: var(--color-text-secondary);
    font-size: 11px;
    text-align: center;
  }

  .feed-board-chip.is-active {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: #FFFFFF;
  }

  .feed-board-chip.is-active [data-board-count] {
    background: rgba(255, 255, 255, 0.24);
    color: #FFFFFF;
  }

  /* --- 旅日記詳細(リーダーモード)のモバイル調整 --- */
  /* 詳細ではカテゴリー絞り込みは出さない(フィード一覧に戻れば復帰) */
  body.is-journey-reader-mode .feed-board-chips {
    display: none;
  }

  /* 戻る+タイトルはグリップ直下に固定してスクロールから外す
     (スクローラーは .feed-sheet-body。transformが無いので sticky が安定して効く) */
  body.is-journey-reader-mode .thread-mobile-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 2;
    align-items: center;
    gap: 10px;
    margin: -16px -16px 0;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
    border-radius: 12px 12px 0 0;
    background: var(--color-surface);
  }

  body.is-journey-reader-mode .thread-mobile-bar .thread-back-button {
    flex: none;
  }

  body.is-journey-reader-mode .thread-mobile-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 14px;
    font-weight: 800;
  }

  /* 大タイトルはピン留めバーが担うので流れる方は出さない */
  body.is-journey-reader-mode .thread-post-header h2 {
    display: none;
  }

  #exploreView .map-panel > .panel-header {
    display: none;
  }

  .feed-header h1 {
    font-size: 22px;
  }

  .feed-card {
    padding: 12px;
  }

  .board-chip {
    max-width: 50%;
  }

  .map-load-button {
    top: 12px;
    left: 50%;
    right: auto;
    bottom: auto;
    width: auto;
    height: 36px;
    min-height: 36px;
    max-width: calc(100vw - 24px);
    padding: 0 14px;
    font-size: 13px;
    transform: translateX(-50%);
  }

  .map-load-button::before,
  .map-load-button::after {
    display: none;
  }

  .map-zoom-controls {
    display: grid;
    top: 58px;
    right: 12px;
  }

  /* peek状態のシート(176px)に隠れない位置へ */
  .map-attribution,
  .empty-map {
    bottom: calc(184px + var(--safe-bottom));
  }
}

/* =====================================================================
   Refinement layer (2026-07-04)
   洗練パス: 左ナビ/タブ/フィードカード/地図フローティングUI の統一と
   シグネチャ「旅の点線」。トークン値の変更は :root 側で実施済み。
   ===================================================================== */

/* --- 左ナビ: 静かな行 + アクセントインジケータ --- */
.board-nav-item {
  position: relative;
  min-height: 34px;
  padding: 6px 10px 6px 14px;
  border: 0;
  font-weight: 600;
}

.board-nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 999px;
  background: var(--color-accent);
  transform: translateY(-50%);
  transition: height 160ms ease;
}

.board-nav-item:hover {
  border: 0;
  background: var(--color-surface-warm);
}

.board-nav-item.is-active {
  border: 0;
  background: var(--color-accent-soft);
  color: var(--color-text-primary);
  font-weight: 700;
}

.board-nav-item.is-active::before {
  height: 16px;
}

.board-nav-item span {
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* --- フィード見出しの律動 --- */
.feed-header .eyebrow {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feed-header h1 {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

/* --- ソートタブ: 黒ピル → 下線セグメント --- */
.feed-sort-tabs {
  gap: 2px;
  padding: 0;
}

.feed-sort-tab {
  position: relative;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  background: transparent;
  color: var(--color-text-muted);
  font-weight: 700;
}

.feed-sort-tab::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background-color 160ms ease;
}

.feed-sort-tab:hover {
  border: 0;
  background: var(--color-surface-warm);
  color: var(--color-text-primary);
}

.feed-sort-tab.is-active {
  border: 0;
  background: transparent;
  color: var(--color-text-primary);
}

.feed-sort-tab.is-active::after {
  background: var(--color-accent);
}

/* --- シグネチャ: 旅の点線(フィードがルートになる) --- */
.feed-list {
  position: relative;
  padding-left: 22px;
}

.feed-list::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 0;
  border-left: 2px dotted var(--color-route-dotted);
}

.feed-list:not(:has(.feed-card))::before {
  display: none;
}

.feed-list:not(:has(.feed-card)) {
  padding-left: 0;
}

.feed-card {
  position: relative;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.feed-list .feed-card::before {
  content: "";
  box-sizing: border-box;
  position: absolute;
  left: -19px;
  top: 24px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--color-route-dotted);
  border-radius: 50%;
  background: var(--color-surface);
  transition: border-color 160ms ease, transform 160ms ease;
}

.feed-list .feed-card:hover::before,
.feed-list .feed-card.is-active::before {
  border-color: var(--color-accent);
  transform: scale(1.2);
}

.feed-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: 0 4px 14px rgba(15, 41, 77, 0.08);
}

.feed-card.is-active {
  border-color: var(--color-accent);
}

/* --- フィードカードの内部階層 --- */
.feed-card h4 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: 0;
}

.board-chip {
  border: 0;
  background: var(--color-surface-warm);
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.agent-handle {
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 650;
}

.feed-time {
  color: var(--color-text-muted);
  font-size: 12px;
}

.feed-search-line {
  color: var(--color-text-muted);
  font-size: 12px;
}

.feed-card-actions {
  gap: 2px;
}

.feed-action {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  transition: background-color 140ms ease, color 140ms ease;
}

.feed-action:hover:not(:disabled) {
  background: var(--color-surface-warm);
  color: var(--color-text-primary);
}

/* --- 地図フローティングUIの統一(12pxグリッド) --- */
#exploreView .map-panel > .panel-header {
  left: 12px;
  top: 12px;
  width: auto;
  max-width: calc(100% - 220px);
  min-height: 36px;
  padding: 0 14px;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--button-floating-bg);
  box-shadow: var(--button-floating-shadow);
}

#exploreView .map-panel > .panel-header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

#exploreView .map-panel > .panel-header h3 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

#mapToolbarCount {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

body.is-journey-reader-mode #exploreView .map-panel > .panel-header {
  display: none;
}

.map-load-button,
.map-load-button::before,
.map-load-button::after {
  animation: none;
}

.map-load-button {
  left: auto;
  right: 12px;
  top: 12px;
  transform: none;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  box-shadow: var(--button-floating-shadow);
  font-size: 12px;
  font-weight: 750;
}

.map-load-button:hover {
  background: #2C5F74;
}

.map-zoom-controls {
  top: 60px;
  right: 12px;
  transform: none;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--button-floating-bg);
  box-shadow: var(--button-floating-shadow);
}

.map-zoom-controls .icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-primary);
  box-shadow: none;
}

.map-zoom-controls .icon-button:hover {
  background: var(--color-surface-warm);
}

.map-zoom-controls .icon-button + .icon-button {
  border-top: 1px solid var(--color-border);
}

.journey-reader-back {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  background: var(--button-floating-bg);
  color: var(--color-text-primary);
  box-shadow: var(--button-floating-shadow);
}

.journey-reader-back:hover {
  background: var(--color-surface-warm);
}

.map-attribution {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--color-text-muted);
  font-size: 10px;
}

/* --- 地図のローディング --- */
.empty-map {
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 650;
}

@media (prefers-reduced-motion: reduce) {
  .board-nav-item::before,
  .feed-sort-tab::after,
  .feed-list .feed-card::before,
  .feed-card,
  .feed-action {
    transition: none;
  }
}

/* --- レール項目をカテゴリー行と同じ言語に統一 --- */
.rail-nav-item {
  border: 0;
}

.rail-nav-item:hover {
  border: 0;
  background: var(--color-surface-warm);
}

.rail-nav-item.is-active {
  border: 0;
  background: var(--color-accent-soft);
  color: var(--color-text-primary);
}

/* --- フィード側の空状態(地図には何も重ねない) --- */
.feed-list .loqi-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 56px 16px;
  text-align: center;
}

.feed-list .loqi-empty-caption {
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 650;
}

/* --- 旅日記カード(地図面): ライト統一 + PC/モバイルのモード別配置 --- */
.journey-message-card {
  left: 12px;
  top: 12px;
  bottom: 12px;
  width: min(360px, calc(100% - 24px));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-shadow: var(--button-floating-shadow);
  backdrop-filter: none;
  scrollbar-color: var(--color-border-strong) transparent;
}

.journey-message-card h3 {
  color: var(--color-text-primary);
}

.journey-card-companion,
.journey-card-diary,
.journey-card-bottle {
  border-color: var(--color-border);
  background: var(--color-surface-warm);
}

.journey-card-diary p {
  color: var(--color-text-primary);
}

.journey-card-feeling {
  border-left-color: var(--color-accent);
  background: var(--color-surface-warm);
  color: var(--color-text-secondary);
}

.journey-card-search {
  background: var(--color-surface-warm);
  color: var(--color-text-muted);
}

.journey-message-card .button,
.journey-message-card .icon-button {
  border-color: var(--color-border);
}

.journey-message-card .button.secondary,
.journey-message-card .icon-button {
  background: transparent;
  color: var(--color-text-primary);
}

.journey-message-card .button.secondary:hover,
.journey-message-card .icon-button:hover {
  background: var(--color-surface-warm);
  color: var(--color-text-primary);
}

.journey-card-actions .icon-button {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
}

.journey-card-actions .icon-button:hover {
  background: var(--color-surface-warm);
}

/* PC リーダーモード: スレッドが主役なので、地図脇の小さな随伴カードに */
body.is-journey-reader-mode .journey-message-card {
  left: 12px;
  right: auto;
  top: auto;
  bottom: 12px;
  width: min(340px, calc(100% - 24px));
  max-height: min(320px, calc(100% - 120px));
}

/* モバイル: 地図タブでは下部シート化(タブバーは map-surface の外なので bottom:0 で干渉しない) */
@media (max-width: 980px) {
  .journey-message-card {
    left: 12px;
    top: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
  }

  body.is-journey-reader-mode .journey-message-card {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: min(60%, 440px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }
}

.journey-message-card .journey-dialog-panel--reader {
  width: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* --- PC リーダーモード: 最終ステップの「旅のまとめ」は地図側に出さない(スレッドが全文を持つ) --- */
@media (min-width: 981px) {
  body.is-journey-reader-mode .journey-message-card:has(.journey-card-content--overview) {
    display: none;
  }
}

/* --- モバイルのまとめシート: 二重枠を解消しシート内に収める --- */
.journey-message-card .journey-card-content--overview {
  display: grid;
  gap: 10px;
  width: auto;
  padding: 14px 16px calc(14px + var(--safe-bottom));
}

.journey-message-card .journey-final-overview {
  width: auto;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.journey-message-card .journey-final-actions {
  display: flex;
  justify-content: flex-start;
}

/* --- PC リーダーモード: 地図上のナビは出さない(戻りはフィードの「フィードへ戻る」に一本化) --- */
@media (min-width: 981px) {
  body.is-journey-reader-mode .journey-reader-back,
  body.is-journey-reader-mode .map-load-button {
    display: none;
  }
}

/* --- PC リーダーモード: カードの代わりにピン上の吹き出しで自動進行 --- */
.journey-map-bubble {
  display: none;
  position: absolute;
  z-index: 19;
  max-width: 280px;
  min-width: 180px;
  padding: 10px 14px 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: var(--button-floating-shadow);
  transform: translate(-50%, calc(-100% - 18px));
  cursor: pointer;
}

.journey-map-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  transform: translateX(-50%) rotate(45deg);
}

.journey-map-bubble.is-below {
  transform: translate(-50%, 22px);
}

.journey-map-bubble.is-below::after {
  bottom: auto;
  top: -7px;
  border: 0;
  border-top: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
}

.journey-map-bubble .bubble-step {
  display: block;
  margin-bottom: 4px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.journey-map-bubble p {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

.journey-map-bubble .bubble-label {
  display: block;
  margin-bottom: 3px;
  color: var(--color-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.journey-map-bubble .bubble-query {
  color: var(--color-text-primary);
}

.journey-map-bubble .bubble-search {
  margin-top: 10px;
  width: 100%;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  transition: background-color 140ms ease;
}

.journey-map-bubble .bubble-search:hover,
.journey-map-bubble .bubble-search:focus-visible {
  outline: 0;
  background: var(--color-primary);
}

.journey-map-bubble:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@media (min-width: 981px) {
  body.is-journey-reader-mode .journey-message-card {
    display: none;
  }

  body.is-journey-reader-mode .journey-map-bubble:not([hidden]) {
    display: block;
  }
}

@media (max-width: 899px) {
  body.is-journey-reader-mode .journey-map-bubble:not([hidden]) {
    display: block;
    width: min(236px, calc(100% - 24px));
    min-width: 0;
    max-width: 236px;
    padding: 9px 12px 11px;
  }

  body.is-journey-reader-mode .journey-map-bubble .bubble-query {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.is-journey-reader-mode .journey-map-bubble .bubble-search {
    min-height: 44px;
  }
}

.journey-map-bubble.is-in {
  animation: bubble-in 220ms ease-out both;
}

.journey-map-bubble.is-below.is-in {
  animation: bubble-in-below 220ms ease-out both;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-100% - 10px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 18px));
  }
}

@keyframes bubble-in-below {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 22px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .journey-map-bubble.is-in,
  .journey-map-bubble.is-below.is-in {
    animation: none;
  }
}

/* --- リーダーモード中はエリアフィード用のUI(並び替え・エリア件数)を出さない --- */
body.is-journey-reader-mode .feed-sort-tabs,
body.is-journey-reader-mode #exploreView .tile-meta {
  display: none;
}

/* --- フィード側の読み込みバー(「近く」タブ専用)と旅日記カードの統計 --- */
.feed-load-bar {
  display: grid;
}

.feed-load-area {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  transition: background-color 140ms ease;
}

.feed-load-area:hover:not(:disabled) {
  background: #2C5F74;
}

.feed-load-area:disabled {
  background: var(--color-surface-warm);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.feed-stat {
  align-self: center;
  padding: 0 8px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.feed-stat--boost {
  color: var(--color-boost);
}

/* PC では地図側の読み込みボタンは出さない(読み込みは左パネルから) */
@media (min-width: 981px) {
  .map-load-button {
    display: none;
  }
}

/* アプリ内WebViewではGoogleログイン(OAuthが拒否される)を隠し、メールログインのみ見せる */
.is-embedded-webview .auth-divider,
.is-embedded-webview .provider-grid,
.is-embedded-webview .auth-provider-note {
  display: none;
}

/* プレローンチ・ゲート(2026-07-13): prod 本番審査中は新規登録と課金を閉じる。
   新規登録停止時はログインのみ残し、Google(初回で自動登録)も塞ぐ。 */
.is-signup-disabled .auth-mode-tabs,
.is-signup-disabled .auth-divider,
.is-signup-disabled .provider-grid,
.is-signup-disabled .auth-provider-note {
  display: none;
}

.is-billing-disabled [data-billing-plan],
.is-billing-disabled [data-billing-portal] {
  display: none;
}

/* =====================================================================
   モバイル体験リファインメント(2026-07-05)
   モバイルはモバイルの体験として磨く。PC(≥900px)には影響させない。
   下部ナビ64px+ラインアイコン / コンパクトヘッダー / シートの手触り /
   地図フローティングUI / 詳細の読み心地。シグネチャは「点線の旅路」。
   ===================================================================== */

/* SVGアイコンはモバイルタブバー専用。PCレールは従来の字形のまま */
.rail-nav-svg {
  display: none;
}

@media (max-width: 899px) {
  /* --- ボトムナビ: 高さ64px+safe-area、線幅1.8pxのラインアイコン --- */
  .map-rail {
    height: calc(64px + var(--safe-bottom));
    padding: 5px max(10px, var(--safe-left)) calc(5px + var(--safe-bottom)) max(10px, var(--safe-right));
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    /* 旧ドロワー用ブロック(coarse pointer)が pointer-events:none を残すため必ず戻す。
       これが無いとタブバーのタップがシートに素通りして遷移が死ぬ */
    pointer-events: auto;
    touch-action: manipulation;
  }

  .rail-nav-icon {
    display: none;
  }

  .rail-nav-svg {
    display: block;
    width: 23px;
    height: 23px;
  }

  .map-rail .rail-nav-item {
    height: 54px;
    min-height: 54px;
    gap: 3px;
    border: 0;
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 650;
  }

  .map-rail .rail-nav-item:hover {
    background: transparent;
    color: var(--color-text-muted);
  }

  .map-rail .rail-nav-item.is-active,
  .map-rail .rail-nav-item.is-active:hover {
    background: transparent;
    color: var(--color-accent);
  }

  /* --- フィードヘッダー圧縮: タイトル+件数の1行(peekで文脈が見える) --- */
  .feed-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 0 2px 10px;
    border-bottom: 0;
  }

  .feed-header > div {
    display: contents;
  }

  .feed-header .eyebrow,
  .feed-header > div > p {
    display: none;
  }

  .feed-header h1 {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 17px;
    line-height: 1.35;
  }

  .feed-header .tile-meta {
    flex: none;
    color: var(--color-text-muted);
    font-size: 12px;
  }

  /* --- シートの手触り: ネイティブ風スプリングカーブ --- */
  /* グリップは sticky ではなくシートの固定ヘッダーにする。
     transformの掛かったスクローラー内の sticky はSafari/WebViewで
     スクロールに追従せず消えるため、スクロールは .feed-sheet-body に分離。 */
  .feed-column {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
  }

  .feed-sheet-grip {
    position: static;
    flex: none;
  }

  .feed-sheet-body {
    display: block;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 12px calc(var(--sheet-offset, 46dvh) + 88px + var(--safe-bottom));
  }

  /* --- 地図フローティングUI: ノッチ下の可読性と小物の品 --- */
  #exploreView .map-panel::before {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 2;
    height: calc(var(--safe-top) + 14px);
    background: linear-gradient(180deg, rgba(247, 246, 243, 0.9), rgba(247, 246, 243, 0));
    pointer-events: none;
  }

  .map-load-button {
    top: calc(12px + var(--safe-top));
  }

  .map-zoom-controls {
    top: calc(58px + var(--safe-top));
  }

  .map-attribution {
    padding: 3px 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--color-text-muted);
    font-size: 10px;
  }

  /* --- 詳細(リーダー): 読み物としての品 --- */
  body.is-journey-reader-mode .thread-mobile-bar {
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  .thread-diary-body {
    font-size: 17px;
    line-height: 1.85;
  }

  /* シグネチャ「点線の旅路」: 足跡スレッドのコネクタを点線ルートに */
  .thread-reply {
    grid-template-columns: 16px minmax(0, 1fr);
  }

  .thread-reply-line::before {
    width: 0;
    border-left: 2px dotted var(--color-route-dotted);
    background: transparent;
  }

  .thread-reply-line::after {
    border-color: var(--color-route-dotted);
  }

  .thread-reply.is-active .thread-reply-line::after,
  .thread-reply:focus-visible .thread-reply-line::after {
    border-color: var(--color-accent);
  }

  /* --- 押下フィードバック(hoverが無い環境の応答) --- */
  .feed-card:active,
  .journey-feed-item:active,
  .thread-reply:active .thread-reply-body {
    background: var(--color-surface-warm);
  }
}

/* 押下時の微細なモーションは reduced-motion を尊重する */
@media (max-width: 899px) and (prefers-reduced-motion: no-preference) {
  .feed-board-chip,
  .feed-sort-tab,
  .rail-nav-item,
  .feed-sheet-grip::before {
    transition: transform 130ms ease, background-color 130ms ease, color 130ms ease;
  }

  .feed-board-chip:active,
  .feed-sort-tab:active {
    transform: scale(0.96);
  }

  .rail-nav-item:active {
    transform: translateY(1px);
  }

  .feed-sheet-grip:active::before {
    transform: scaleX(1.3);
  }
}

@media (max-width: 899px) and (prefers-reduced-motion: reduce) {
  .feed-column {
    transition: none;
  }
}

/* =====================================================================
   旅日記ステップドック(2026-07-05)
   モバイルの各ステップ/旅のまとめは、地図下部のカード(旧仕様)ではなく
   シート上部の固定ゾーンに置く。タイピング演出は使わない(DESIGN §1)。
   ===================================================================== */
@media (max-width: 899px) {
  .journey-step-dock:not([hidden]) {
    display: grid;
    flex: none;
    gap: 6px;
    padding: 2px 16px 14px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
  }

  .journey-step-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 34px;
  }

  .journey-step-count {
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
  }

  .journey-step-nav {
    display: flex;
    gap: 8px;
  }

  .journey-step-nav .icon-button {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .journey-step-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  .journey-step-text {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 13px;
    line-height: 1.7;
    overflow-wrap: anywhere;
  }

  .journey-step-detail {
    justify-self: start;
    min-height: 32px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--color-accent);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
  }

  /* リーダーモード中はフィード見出し(みんなの足跡)を出さない(スレッドが主役) */
  body.is-journey-reader-mode .feed-header {
    display: none;
  }

  /* 戻る動線はドックの←に一本化。地図の←とスレッド内バーは出さない */
  body.is-journey-reader-mode .journey-reader-back {
    display: none;
  }

  body.is-journey-reader-mode .thread-mobile-bar {
    display: none;
  }

  /* ドック1行目: ← + 旅タイトル(旅のヘッダー) */
  .journey-dock-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
  }

  .journey-dock-back {
    flex: none;
    width: 36px;
    height: 36px;
    font-size: 17px;
  }

  .journey-dock-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 15px;
    font-weight: 800;
  }

  /* 読書状態(full/half)ではドックをコンパクトに(本文はスレッド側で読む)。
     場所名・ひとこと・「詳しく見る」は peek=地図モードでだけ出す */
  .journey-step-dock .journey-step-title,
  .journey-step-dock .journey-step-text,
  .journey-step-dock .journey-step-detail {
    display: none;
  }

  body.is-sheet-peek .journey-step-dock .journey-step-title,
  body.is-sheet-peek .journey-step-dock .journey-step-text,
  body.is-sheet-peek .journey-step-dock .journey-step-detail {
    display: block;
  }

  /* 実況ストリーム: 現在のステップの吹き出しを静かに強調する */
  body.is-journey-reader-mode .thread-reply.is-active .thread-reply-body {
    background: var(--color-accent-soft);
  }

  /* --- スクラップブック(保存)のモバイル調整 --- */
  .scrapbook-layout {
    gap: 14px;
  }

  .scrapbook-map-panel {
    height: 240px;
  }

  /* min-height:320px が 280pxパネルからはみ出してタイトルに食い込むのを防ぐ */
  .scrapbook-map {
    min-height: 0;
  }

  /* 保存が空のときは、当てのない地図を出さない(空状態の案内だけ見せる) */
  .scrapbook-layout:has(.scrapbook-list.is-empty) .scrapbook-map-panel {
    display: none;
  }

  #scrapbookView .scrapbook-panel {
    padding: 16px;
  }

  /* 追従スクロールの着地点に少し余白(バーは廃止済み、ドックはスクロール外) */
  .thread-reply {
    scroll-margin-top: 12px;
  }

  /* 道中のステップ(peek)ではスレッド本文を完全に隠す。
     ドラッグ中は戻して、引き上げれば中身が見える手応えを保つ */
  body.is-journey-step-dock .feed-sheet-body {
    transition: opacity 200ms ease;
  }

  body.is-journey-step-dock.is-sheet-peek:not(.is-sheet-dragging) .feed-sheet-body {
    opacity: 0;
    pointer-events: none;
  }

  /* まとめのタイトル帯は明朝(本文は下のスレッドで読む) */
  .journey-step-dock--overview .journey-step-title {
    font-family: var(--font-reading);
    font-size: 18px;
  }

  .journey-step-dock--overview .journey-step-text {
    max-height: 34vh;
    overflow-y: auto;
    color: var(--color-text-primary);
    font-family: var(--font-reading);
    font-size: 15px;
    line-height: 1.8;
    overscroll-behavior: contain;
  }
}

/* =====================================================================
   認証画面リニューアル(2026-07-05)
   サービスの価値が先に伝わるログイン/新規登録。PC=2カラム、モバイル=縦積み。
   ===================================================================== */
.auth-dialog {
  display: grid;
  position: relative;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 36px;
  width: min(880px, 100%);
  padding: 40px;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.auth-intro {
  display: grid;
  gap: 20px;
  align-content: start;
}

.auth-logo {
  display: block;
  width: 132px;
  height: auto;
}

.auth-tagline {
  font-family: var(--font-reading);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.auth-points {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-points li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.auth-point-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-surface-warm);
  font-size: 17px;
}

.auth-points strong {
  display: block;
  font-size: 14px;
  font-weight: 750;
}

.auth-points p {
  margin: 2px 0 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.auth-pane {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.auth-mode-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--color-surface-warm);
}

.auth-mode-tab {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: background-color 140ms ease, color 140ms ease;
}

.auth-mode-tab.is-active {
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-soft);
}

.auth-mode-tab:disabled {
  cursor: wait;
  opacity: 0.6;
}

.auth-reset-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.auth-reset-button {
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.auth-reset-button:hover:not(:disabled) {
  color: var(--color-primary-hover);
  text-decoration-color: currentColor;
}

.auth-reset-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.auth-terms {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.auth-terms a {
  color: var(--color-accent);
}

.auth-provider-note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 899px) {
  .auth-modal {
    place-items: start center;
    overflow-y: auto;
    padding: calc(20px + var(--safe-top)) 16px calc(28px + var(--safe-bottom));
  }

  .auth-dialog {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 26px 20px;
  }

  .auth-logo {
    width: 110px;
  }

  .auth-reset-button {
    min-height: 44px;
  }

  .auth-tagline {
    font-size: 21px;
  }

  .auth-points {
    gap: 12px;
  }

  .auth-points p {
    font-size: 12px;
  }

  .auth-pane {
    padding: 16px;
  }
}

/* --- ログイン画面の背景ジオラマ: 地図の上で旅が生きている --- */
.auth-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-scene-tiles {
  position: absolute;
  inset: 0;
}

.auth-scene-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  filter: grayscale(1) contrast(1.2);
  opacity: 0.85;
}

/* 文字が読める程度に紙の色をかぶせる(中央ほど濃く) */
.auth-scene-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(40, 125, 250, 0.32) 0%, rgba(40, 125, 250, 0.12) 45%, rgba(245, 247, 250, 0.1) 100%),
    radial-gradient(ellipse at 50% 45%, rgba(245, 247, 250, 0.82) 0%, rgba(245, 247, 250, 0.45) 55%, rgba(245, 247, 250, 0.25) 100%);
}

.auth-scene-route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#authRoutePath {
  stroke: var(--color-route-dotted);
  stroke-width: 2.5px;
  stroke-dasharray: 1 8;
  stroke-linecap: round;
  animation: authRouteFlow 60s linear infinite;
}

@keyframes authRouteFlow {
  to { stroke-dashoffset: -180; }
}

/* ランタンの小さな灯りがルートを進む */
.auth-scene-light {
  fill: var(--color-boost);
  filter: drop-shadow(0 0 6px rgba(245, 99, 0, 0.65));
}

.auth-scene-pin {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2.5px solid #FFFFFF;
  border-radius: 999px;
  background: var(--color-accent);
  box-shadow: 0 2px 8px rgba(16, 24, 32, 0.28);
}

/* 実物の .feed-card をそのまま置く(ダミーは内容だけ) */
.auth-scene-card {
  position: absolute;
  width: 260px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 26px rgba(16, 24, 32, 0.14);
  animation: authBubbleFloat 9s ease-in-out infinite;
}

.auth-scene-card--mid {
  animation-delay: -3s;
}

.auth-scene-card--far {
  animation-delay: -6s;
}

/* 装飾なのでアクション行は押せる見た目のまま反応しない(scene全体がpointer-events:none) */
.auth-scene-card .feed-action {
  cursor: default;
}

@keyframes authBubbleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ダイアログはジオラマの上に浮かぶ磨りガラスの紙 */
.auth-modal {
  z-index: 70;
}

body.auth-only .auth-modal {
  background: transparent;
}

.auth-dialog {
  z-index: 1;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 44px rgba(16, 24, 32, 0.12);
}

.auth-pane {
  background: rgba(255, 255, 255, 0.85);
}

@media (max-width: 899px) {
  /* モバイルはダイアログが画面を覆うので、カードは上の隙間に1枚だけ(コンパクトに) */
  .auth-modal {
    padding-top: calc(100px + var(--safe-top));
  }

  .auth-scene-card--mid,
  .auth-scene-card--far {
    display: none;
  }

  .auth-scene-card {
    left: auto !important;
    right: 12px;
    top: calc(var(--safe-top) + 12px) !important;
    width: 240px;
  }

  .auth-scene-card .feed-search-line,
  .auth-scene-card .feed-card-actions {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #authRoutePath,
  .auth-scene-card {
    animation: none;
  }

  .auth-scene-light {
    display: none;
  }
}

/* =====================================================================
   Trip.com風トラベルテーマ(2026-07-12, ADR 0009)
   トークン差し替え(ブルー #287DFA / オレンジ #F56300)を前提に、
   旅行サイトらしいシグネチャ要素をここで上書きする。
   ===================================================================== */

/* --- ヒーローバンド: フィード見出しを青グラデの帯に --- */
.feed-header {
  padding: 18px 20px;
  border: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #287DFA 0%, #2E9CFF 60%, #45B5FF 100%);
  box-shadow: 0 8px 20px rgba(40, 125, 250, 0.25);
}

.feed-header .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.feed-header h1 {
  color: #FFFFFF;
}

.feed-header p {
  color: rgba(255, 255, 255, 0.85);
}

.feed-header .tile-meta,
.feed-header #tileMeta {
  width: max-content;
  max-width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

/* --- ソートタブ: 下線 → セグメントピル --- */
.feed-sort-tabs {
  width: max-content;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--color-surface-warm);
}

.feed-sort-tab {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 16px;
}

.feed-sort-tab::after {
  display: none;
}

.feed-sort-tab:hover {
  background: rgba(255, 255, 255, 0.75);
}

.feed-sort-tab.is-active {
  background: var(--color-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(40, 125, 250, 0.35);
}

.feed-sort-tab.is-active:hover {
  background: var(--color-primary-hover);
  color: #FFFFFF;
}

/* --- カテゴリーチップ: 白ピル+選択でブルー --- */
.feed-board-chip,
.board-nav-item {
  border-radius: 999px;
}

.feed-board-chip.is-active,
.board-nav-item.is-active {
  border-color: var(--color-primary);
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.board-nav-item.is-active::before {
  background: var(--color-primary);
}

/* カード内カテゴリーチップもブルーの淡色に */
.board-chip {
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

/* --- フィードカード: 角丸大きめ+ホバーで浮く(旅行サイトのカード) --- */
.feed-card,
.drop-item {
  border-radius: var(--radius-lg);
}

.feed-card {
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.feed-card:hover {
  border-color: var(--color-border);
  box-shadow: 0 8px 22px rgba(15, 41, 77, 0.12);
  transform: translateY(-2px);
}

.feed-card.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 8px 22px rgba(40, 125, 250, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  .feed-card:hover {
    transform: none;
  }
}

/* フィード左の点線ルートとドットはブルー系トークンが継承する(上書き不要) */

/* --- 地図の読み込みボタン: ブルーの主役ピル --- */
.map-load-button {
  --button-floating-bg: var(--color-primary);
  --button-floating-fg: #FFFFFF;
  --button-floating-border: var(--color-primary);
  --button-floating-shadow: 0 8px 20px rgba(40, 125, 250, 0.4);
  border-radius: 999px;
  font-weight: 700;
}

.map-load-button:hover:not(:disabled) {
  --button-floating-bg: var(--color-primary-hover);
  --button-floating-border: var(--color-primary-hover);
}

/* --- 左レール/モバイルタブ: 選択状態をブルーに --- */
.rail-nav-item.is-active {
  border-color: transparent;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.rail-nav-item.is-active .rail-nav-icon {
  color: var(--color-accent);
}

/* --- 旅日記フィード/設定タブも同じピル文法に --- */
.journey-feed-tab.is-active,
.settings-tab.is-active,
.auth-mode-tab.is-active {
  border-color: var(--color-primary);
  color: var(--color-accent);
}

/* --- 認証ダイアログ: 白カード+ブルーの主ボタン(トークン継承)。
       ジオラマのピン・ルートはブルー系トークンが継承する --- */
.auth-dialog {
  box-shadow: 0 18px 44px rgba(15, 41, 77, 0.16);
}

/* =====================================================================
   旅行サイト型レイアウト Phase 1/2(2026-07-12, docs/WEB_TRAVEL_LAYOUT.md)
   ヒーロー検索 / カテゴリータイル / エリアカルーセル / 旅日記ピックアップ
   ===================================================================== */

/* --- ヒーロー検索バー(青帯の中の白ピル+boost色ボタン) --- */
.hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 6px 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--color-surface);
  box-shadow: 0 4px 14px rgba(15, 41, 77, 0.18);
}

.hero-search-icon {
  color: var(--color-primary);
  font-size: 15px;
}

.hero-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.hero-search-input::placeholder {
  color: var(--color-text-muted);
  font-weight: 500;
}

.hero-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.hero-search-button {
  flex: none;
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--color-boost);
  color: #FFFFFF;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.hero-search-button:hover {
  filter: brightness(1.06);
}

.hero-search-input:focus-visible,
.hero-search-button:focus-visible,
.hero-suggest:focus-visible {
  outline: 0;
  box-shadow: var(--button-focus-ring);
}

.hero-suggests {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hero-suggest {
  border: 0;
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}

.hero-suggest:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* --- カテゴリー: アイコンタイル行(PC でも表示する) --- */
.feed-board-chips.category-tiles {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 2px;
  border: 0;
  background: transparent;
  scrollbar-width: none;
}

.feed-board-chips.category-tiles::-webkit-scrollbar {
  display: none;
}

.feed-board-chip.category-tile {
  flex: 1 0 74px;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 0;
  padding: 8px 4px 6px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.category-tile-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--color-surface-warm);
  font-size: 19px;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.feed-board-chip.category-tile:hover .category-tile-icon {
  transform: translateY(-2px);
}

.feed-board-chip.category-tile.is-active {
  background: transparent;
  color: var(--color-accent);
}

.feed-board-chip.category-tile.is-active .category-tile-icon {
  background: var(--color-accent-soft);
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.category-tile-count {
  color: var(--color-text-muted);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .feed-board-chip.category-tile:hover .category-tile-icon {
    transform: none;
  }
}

/* --- ホームハイライト(エリアカルーセル+旅日記ピックアップ) --- */
.home-highlights {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

/* グリッド子の min-width:auto でカルーセルが列幅を突き破らないようにする */
.home-highlight-section {
  min-width: 0;
}

.area-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 2px 0;
}

.area-section-head h2 {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 16px;
  font-weight: 750;
}

.area-section-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.area-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.area-carousel::-webkit-scrollbar {
  display: none;
}

.area-card {
  flex: 0 0 168px;
  scroll-snap-align: start;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.area-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(15, 41, 77, 0.12);
}

.area-card:focus-visible {
  outline: 0;
  box-shadow: var(--button-focus-ring);
}

.area-card-visual {
  display: block;
  position: relative;
  height: 92px;
  background-color: var(--color-map-water);
  background-size: cover;
  background-position: center;
}

.area-card-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 41, 77, 0) 45%, rgba(15, 41, 77, 0.34) 100%);
}

.area-card-pin {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin: -7px;
  border: 3px solid var(--color-surface);
  border-radius: 999px;
  background: var(--color-primary);
  box-shadow: 0 2px 8px rgba(15, 41, 77, 0.35);
}

.area-card-body {
  display: grid;
  gap: 2px;
  padding: 9px 12px 11px;
}

.area-card-body strong {
  color: var(--color-text-primary);
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.area-card-stats {
  display: flex;
  gap: 8px;
  color: var(--color-boost);
  font-size: 11.5px;
  font-weight: 750;
}

.area-carousel-attribution {
  margin: -4px 2px 0;
  color: var(--color-text-muted);
  font-size: 10px;
  text-align: right;
}

/* --- 旅日記ピックアップ(画像つき大カード) --- */
.diary-pick-card {
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.diary-pick-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(15, 41, 77, 0.12);
}

.diary-pick-card:focus-visible {
  outline: 0;
  box-shadow: var(--button-focus-ring);
}

.diary-pick-visual {
  display: block;
  position: relative;
  height: 124px;
  background-color: var(--color-surface-warm);
  background-size: cover;
  background-position: center;
}

.diary-pick-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 41, 77, 0) 35%, rgba(15, 41, 77, 0.42) 100%);
}

.diary-pick-visual .board-chip {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 1;
  background: rgba(255, 255, 255, 0.92);
}

.diary-pick-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  z-index: 1;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.88;
}

.diary-pick-body {
  display: grid;
  gap: 6px;
  padding: 12px 14px 14px;
}

.diary-pick-title {
  color: var(--color-text-primary);
  font-family: var(--font-reading);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.5;
}

.diary-pick-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.diary-pick-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.diary-pick-reaction {
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(245, 99, 0, 0.1);
  color: var(--color-boost);
  font-size: 11.5px;
  font-weight: 750;
}

@media (prefers-reduced-motion: reduce) {
  .area-card:hover,
  .diary-pick-card:hover {
    transform: none;
  }
}

/* --- モバイル: シート内で新セクションが flex 縮小しない保護 --- */
@media (max-width: 899px) {
  .feed-header,
  .feed-board-chips.category-tiles,
  .home-highlights,
  .area-carousel,
  .area-card,
  .diary-pick-card {
    flex-shrink: 0;
  }

  .feed-board-chip.category-tile {
    flex: 0 0 72px;
  }

  /* 既存の .feed-header > div { display: contents }(圧縮ヘッダー用)から
     検索バーとサジェスト行を除外し、自身の箱を取り戻す */
  .feed-header > .hero-search {
    display: flex;
  }

  .feed-header > .hero-suggests {
    display: flex;
  }

  /* 圧縮ヘッダー(タイトル+件数の1行)を保ちつつ、検索とチップは折り返して全幅の行にする */
  .feed-header {
    flex-wrap: wrap;
    row-gap: 10px;
    padding: 14px 14px 12px;
  }

  .feed-header .tile-meta {
    order: 1;
    margin-left: auto;
  }

  .hero-search {
    order: 2;
    flex: 1 1 100%;
    min-height: 44px;
    padding-left: 14px;
  }

  .hero-suggests {
    order: 3;
    flex: 1 1 100%;
  }

  .hero-search-button {
    min-height: 32px;
    padding: 0 14px;
  }
}

/* =====================================================================
   旅行ポータル骨格(2026-07-12 フル転換)
   トップナビ+全幅ヒーロー+中央1カラムのホーム。地図は exploreView に分離。
   ===================================================================== */

/* --- トップナビ(デスクトップ)。モバイルは従来のボトムタブが主役 --- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 36;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.topnav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-primary);
  font-size: 16px;
  font-weight: 800;
}

.topnav-logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.topnav-links {
  display: flex;
  gap: 4px;
  margin-left: 6px;
}

.topnav-spacer {
  flex: 1;
}

.topnav-link {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
}

.topnav-link:hover {
  background: var(--color-surface-warm);
  color: var(--color-text-primary);
}

.topnav-link.is-active {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.topnav-link:focus-visible {
  outline: 0;
  box-shadow: var(--button-focus-ring);
}

/* 匿名ハンドル(ID:xxxxx)→ 旅アーカイブへのリンク(ADR 0010) */
.agent-id-link {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.agent-id-link:hover,
.agent-id-link:focus-visible {
  color: var(--color-accent);
  text-decoration: underline;
}

.archive-section .archive-meta {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

/* 保存タブ上段: 保存した旅日記(ADR 0010 の再訪導線) */
#scrapbookView .scrapbook-journeys-section {
  margin: 0 0 20px;
}

#scrapbookView .scrapbook-journeys-section .empty-panel {
  padding: 22px 18px;
}

/* 画像ライトボックス: サムネイルクリックで原本を拡大表示 */
.footprint-thumb {
  cursor: zoom-in;
}

body.is-lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 41, 77, 0.82);
  cursor: zoom-out;
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox-img {
  max-width: min(92vw, 2048px);
  max-height: 88vh;
  border-radius: var(--radius-md);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  background: var(--color-surface);
}

.image-lightbox-close {
  position: absolute;
  top: calc(14px + var(--safe-top, 0px));
  right: calc(14px + var(--safe-right, 0px));
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text-primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* 未ログイン時のログイン CTA(モバイルでは nav-item が隠れてもこれだけ残す) */
.topnav-signin {
  background: var(--color-primary);
  color: #FFFFFF;
}

.topnav-signin:hover {
  background: var(--color-primary-hover);
  color: #FFFFFF;
}

.topnav-signin[hidden] {
  display: none;
}

.topnav-link[hidden] {
  display: none;
}

/* --- デスクトップ: 左レールを廃してトップナビへ --- */
@media (min-width: 900px) {
  .map-rail {
    display: none;
  }

  .main {
    margin-left: 0;
  }

  /* exploreView(地図)はトップナビの下に収める */
  #exploreView.is-active,
  .sns-layout {
    height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
    max-height: calc(100dvh - 56px);
  }

  .feed-column {
    height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
  }
}

/* --- モバイル: トップナビはロゴバーのみ。タブは 4 分割(ホーム/地図/保存/設定) --- */
@media (max-width: 899px) {
  .topnav {
    height: 48px;
    padding: 0 14px;
  }

  .topnav-links,
  .topnav .nav-item {
    display: none;
  }

  /* タブ数は可視タブで等分する(未ログイン時は「保存」を隠すため 3 分割になる)。
     デスクトップ縦レール由来の grid-template-rows の影響を受けないよう flex にする */
  .map-rail {
    display: flex;
    align-items: stretch;
  }

  .map-rail .nav-item {
    flex: 1 1 0;
    min-width: 0;
  }

  /* ボトムシート時代に隠していた「地図」タブを復活させる */
  .map-rail .mobile-map-tab {
    display: grid !important;
  }

  /* 未ログイン時に隠すタブ(rail-nav-item の display 指定より優先させる) */
  .map-rail .nav-item[hidden] {
    display: none !important;
  }

  /* 地図ビューではロゴバーを消して全画面地図(従来のシートUX)を維持 */
  body.is-explore-view .topnav {
    display: none;
  }

  #exploreView.is-active,
  .sns-layout,
  .feed-column {
    height: 100dvh;
    max-height: none;
  }
}

/* --- ホーム(ポータル) --- */
#homeView.is-active {
  padding: 0 0 60px;
}

@media (max-width: 899px) {
  #homeView.is-active {
    padding-bottom: calc(90px + var(--safe-bottom));
  }
}

.home-hero {
  padding: 38px 20px 64px;
  background: linear-gradient(135deg, #287DFA 0%, #2E9CFF 55%, #45B5FF 100%);
}

.home-hero-inner {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.home-hero h1 {
  margin: 0 0 4px;
  color: #FFFFFF;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.home-hero p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}

.home-hero .hero-search {
  min-height: 54px;
  padding: 0 8px 0 20px;
  box-shadow: 0 10px 30px rgba(15, 41, 77, 0.25);
}

.home-hero .hero-search-button {
  min-height: 40px;
  padding: 0 24px;
}

.home-hero .hero-suggests {
  justify-content: center;
  margin-top: 12px;
}

.home-content {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* カテゴリーバー: ヒーローに半分重なる白い浮きカード */
.feed-board-chips.category-bar {
  display: flex;
  justify-content: space-between;
  margin-top: -34px;
  padding: 12px 14px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: 0 8px 24px rgba(15, 41, 77, 0.08);
}

.category-bar .feed-board-chip.category-tile {
  flex: 1 0 84px;
}

.home-section {
  margin-top: 12px;
}

.home-refresh-note {
  margin: -4px 2px 12px;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.5;
}

#homeAreas,
#homePicks {
  margin-top: 12px;
}

#homeAreas .area-section-head,
#homePicks .area-section-head,
.home-section .area-section-head {
  margin: 22px 2px 12px;
}

#homeAreas .area-section-head h2,
#homePicks .area-section-head h2,
.home-section .area-section-head h2 {
  font-size: 19px;
}

/* ホームのエリアカードはひと回り大きく、エリア名を画像に重ねる */
#homeAreas .area-card {
  flex: 0 0 216px;
}

#homeAreas .area-card-visual {
  height: 122px;
}

.area-name {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 1;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  text-shadow: 0 1px 6px rgba(15, 41, 77, 0.55);
}

/* 旅日記ピックアップ: デスクトップ2枚組 */
.pick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 899px) {
  .pick-grid {
    grid-template-columns: 1fr;
  }
}

#homePicks .diary-pick-visual {
  height: 148px;
}

/* 足跡カードグリッド(地図サムネ付き) */
.fp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1100px) {
  .fp-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 899px) {
  .fp-grid {
    grid-template-columns: 1fr;
  }
}

.fp-card {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.fp-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(15, 41, 77, 0.14);
}

.fp-visual {
  display: block;
  position: relative;
  height: 118px;
  background-color: var(--color-map-water);
  background-size: cover;
  background-position: center;
}

.fp-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 41, 77, 0) 55%, rgba(15, 41, 77, 0.26) 100%);
}

.fp-visual .board-chip {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 1;
  background: rgba(255, 255, 255, 0.94);
}

.fp-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 13px;
  height: 13px;
  margin: -7px;
  border: 3px solid var(--color-surface);
  border-radius: 999px;
  background: var(--color-primary);
  box-shadow: 0 2px 8px rgba(15, 41, 77, 0.4);
}

.fp-body {
  display: grid;
  gap: 5px;
  padding: 12px 14px 10px;
}

.fp-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 11.5px;
}

.fp-title {
  color: var(--color-text-primary);
  font-size: 14.5px;
  font-weight: 750;
  line-height: 1.45;
}

.fp-sq {
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fp-actions {
  display: flex;
  gap: 2px;
  border-top: 1px solid var(--color-border);
  padding: 6px 8px;
}

.home-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
}

.home-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.home-footer a:hover {
  color: var(--color-accent);
}

@media (prefers-reduced-motion: reduce) {
  .fp-card:hover {
    transform: none;
  }
}

/* --- ホームの「みんなの旅日記」: 並び替えピルとさらに読む(2026-07-12 タブ廃止統合) --- */
.home-journey-tabs {
  position: static;
  border-bottom: 0;
}

.area-section-head .home-journey-tabs {
  align-self: center;
}

.home-more {
  display: block;
  margin: 14px auto 0;
  min-width: 200px;
  border-radius: 999px;
}

/* --- タイルストリップ: 原寸(256px=1:1)のタイルを中央合わせで切り抜く。
       cover 拡大によるぼやけ対策(2026-07-12) --- */
.area-card-visual,
.fp-visual {
  overflow: hidden;
}

.tile-strip {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.tile-strip img {
  position: absolute;
  width: 256px;
  height: 256px;
  max-width: none;
}

/* --- 実データ検証での微修正(2026-07-12 trip-6) --- */
/* サムネ無しの旅日記カード: 暗い被せグラデをやめ、淡い空色の無地に */
.diary-pick-visual--empty {
  background: linear-gradient(160deg, var(--color-map-water) 0%, var(--color-surface-warm) 100%);
}

.diary-pick-visual--empty::after {
  background: none;
}

/* 並び替えピルの縦折れ防止 */
.feed-sort-tab {
  white-space: nowrap;
}

/* モバイルでセクション見出しとピルが窮屈なときは折り返す */
.area-section-head {
  flex-wrap: wrap;
}

.area-section-head h2 {
  white-space: nowrap;
}

/* --- 地図ビューのカテゴリー: コンパクトなピルチップ(2026-07-12 重複整理)。
       ホームのアイコンタイル(.category-bar)が主役、こちらは実用フィルタ。
       旧左レールのカテゴリーリストは削除済み。 --- */
@media (min-width: 900px) {
  #exploreView .feed-board-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0 10px;
    scrollbar-width: none;
  }

  #exploreView .feed-board-chips::-webkit-scrollbar {
    display: none;
  }

  #exploreView .feed-board-chip {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 12px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
  }

  #exploreView .feed-board-chip:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text-primary);
  }

  #exploreView .feed-board-chip.is-active {
    border-color: var(--color-primary);
    background: var(--color-accent-soft);
    color: var(--color-accent);
  }
}

/* --- カード全体クリックで地図フォーカス(2026-07-12): 押せることを示す --- */
.fp-card[data-drop-card-id],
.feed-card[data-drop-card-id] {
  cursor: pointer;
}

/* --- 旅日記(リーダー)表示中はカテゴリー絞り込みを出さない(2026-07-12)。
       並び替え・件数と同じ扱い。フィード一覧に戻れば復帰する。 --- */
body.is-journey-reader-mode #exploreView .feed-board-chips {
  display: none;
}

/* --- グリッド内の空状態は全列にスパンさせて中央に置く(2026-07-12) --- */
.pick-grid > .loqi-empty,
.pick-grid > .empty-panel {
  grid-column: 1 / -1;
}

.pick-grid > .empty-panel {
  padding: 30px 16px;
  text-align: center;
}
