:root {
  color-scheme: light;
  --bg: #eaf8fb;
  --surface: #ffffff;
  --surface-soft: #e9f8fb;
  --surface-strong: rgba(255, 255, 255, 0.9);
  --ink: #0d1b2a;
  --muted: #58707c;
  --line: rgba(113, 190, 205, 0.32);
  --accent: #06b6d4;
  --accent-dark: #0784a0;
  --emerald: #10b981;
  --visited: #334155;
  --rose: #ec4899;
  --blue: #0ea5e9;
  --shadow: 0 18px 50px rgba(8, 47, 73, 0.18);
  --soft-shadow: 0 10px 28px rgba(8, 47, 73, 0.12);
  --edge: clamp(10px, 3.2vw, 18px);
  --group-width: clamp(128px, 36vw, 156px);
  --top-gap: 8px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button,
a,
.rail-card,
.group-option,
.result-button,
.wanted-chip {
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

button:active,
a:active,
.rail-card:active,
.group-option:active,
.result-button:active,
.wanted-chip:active {
  transform: scale(0.985);
}

.app {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
  touch-action: manipulation;
}

.map-stage,
.map-board,
.leaflet-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  touch-action: pan-x pan-y pinch-zoom;
}

.map-board {
  background: #d8eef3;
  filter: saturate(1.08) contrast(1.02);
}

.leaflet-control-attribution,
.leaflet-control-zoom {
  display: none;
}

.top-dock {
  position: fixed;
  top: calc(var(--top-gap) + var(--safe-top));
  left: var(--edge);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.group-select-button,
.group-menu,
.mode-switch,
.search-dock,
.rail-toolbar,
.inline-sort-menu,
.spot-card,
.sort-menu,
.tabbar,
.view-panel,
.add-sheet,
.detail-sheet,
.auth-card {
  border: 1px solid rgba(186, 230, 253, 0.74);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.25);
}

.top-dock,
.search-dock,
.group-menu,
.sort-menu,
.tabbar,
.view-panel,
.add-sheet,
.detail-sheet,
.auth-screen {
  touch-action: manipulation;
}

.spot-dock,
.spot-rail,
.region-rail,
.wanted-list {
  touch-action: pan-x;
}

.view-panel,
.add-sheet,
.detail-sheet,
.group-menu {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.group-select-button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 7px;
  width: var(--group-width);
  min-width: 0;
  height: 40px;
  border: 0;
  padding: 6px 8px;
  border-radius: 15px;
  color: var(--ink);
  text-align: left;
  font-weight: 850;
  pointer-events: auto;
}

.group-select-button span {
  min-width: 0;
}

#currentGroupName {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 11px;
  background: var(--member-color, var(--accent));
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.08));
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38), 0 8px 18px rgba(14, 165, 233, 0.18);
}

.group-chevron {
  color: var(--muted);
  font-size: 9px;
}

.group-menu {
  position: fixed;
  top: calc(56px + var(--safe-top));
  left: var(--edge);
  z-index: 1300;
  display: none;
  width: min(320px, calc(100vw - (var(--edge) * 2)));
  max-height: min(420px, calc(100dvh - 156px));
  overflow: auto;
  border-radius: 18px;
  padding: 8px;
}

.app.group-menu-open .group-menu {
  display: grid;
  gap: 8px;
}

.group-list {
  display: grid;
  gap: 6px;
}

.group-option,
.group-create-shortcut {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.group-option {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.group-option strong,
.group-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.group-option.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14), rgba(16, 185, 129, 0.1));
}

.group-status {
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.1);
  color: var(--muted);
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 850;
}

.group-create-shortcut {
  display: grid;
  place-items: center;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
  text-align: center;
  font-weight: 900;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 0;
  height: 44px;
  padding: 4px;
  border-radius: 15px;
  pointer-events: auto;
}

.mode-switch button,
.tabbar button {
  min-width: 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.mode-switch button.active,
.tabbar button.active {
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
}

.search-dock {
  position: fixed;
  top: calc(var(--top-gap) + var(--safe-top));
  right: var(--edge);
  left: calc(var(--edge) + var(--group-width) + 8px);
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(56px, 17vw, 72px);
  gap: 8px;
  padding: 4px;
  border-radius: 16px;
}

.app.search-active .search-dock {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.search-dock input,
.search-dock button {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.search-dock input {
  padding: 0 7px;
  font-size: 16px;
}

.search-dock button {
  background: rgba(6, 182, 212, 0.09);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 850;
}

.search-dock .clear-filter-button {
  display: none;
  place-items: center;
  border-radius: 11px;
  background: rgba(13, 27, 42, 0.08);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.app.search-active .search-dock .clear-filter-button {
  display: grid;
}

.app.search-active #locateButton {
  display: none;
}

#locateButton.active {
  background: rgba(14, 165, 233, 0.18);
  color: #0369a1;
}

#locateButton:disabled {
  cursor: progress;
  opacity: 0.68;
}

.user-location-wrap {
  background: transparent;
  border: 0;
}

.user-location-marker {
  position: relative;
  width: 34px;
  height: 34px;
}

.user-location-marker::before {
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.22);
  content: "";
  animation: user-location-pulse 1.8s ease-out infinite;
}

.user-location-marker span {
  position: absolute;
  inset: 9px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #0ea5e9;
  box-shadow: 0 6px 18px rgba(3, 105, 161, 0.34);
}

@keyframes user-location-pulse {
  0% {
    opacity: 0.9;
    transform: scale(0.7);
  }
  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}

.spot-dock {
  position: fixed;
  right: 10px;
  bottom: calc(78px + var(--safe-bottom));
  left: 10px;
  z-index: 1000;
}

.app.sort-menu-open .spot-dock {
  bottom: calc(78px + var(--safe-bottom));
}

.member-legend,
.member-strip {
  display: flex;
  align-items: center;
}

.member-legend span,
.member-strip span {
  margin-left: -7px;
}

.member-legend span:first-child,
.member-strip span:first-child {
  margin-left: 0;
}

.legend-avatar,
.person-avatar {
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: var(--member-color, var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  box-shadow: var(--soft-shadow);
}

.legend-avatar {
  width: 30px;
  height: 30px;
}

.person-avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.sort-menu {
  position: fixed;
  right: 18px;
  bottom: calc(80px + var(--safe-bottom));
  left: 18px;
  z-index: 1015;
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: max-content;
  max-width: calc(100vw - 36px);
  gap: 6px;
  overflow-x: auto;
  margin: 0 auto;
  border-radius: 999px;
  padding: 4px;
  scrollbar-width: none;
}

.app.sort-menu-open .sort-menu {
  display: none;
}

.sort-menu::-webkit-scrollbar,
.spot-rail::-webkit-scrollbar,
.region-rail::-webkit-scrollbar {
  display: none;
}

.sort-menu button {
  flex: 0 0 auto;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.sort-menu button.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
}

.rail-shell {
  display: grid;
  gap: 7px;
}

.rail-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  max-width: calc(100vw - 20px);
  margin: 0 auto;
  border-radius: 999px;
  padding: 4px 6px;
}

.rail-toolbar button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.rail-toolbar .rail-clear-search {
  max-width: min(128px, 34vw);
  overflow: hidden;
  background: rgba(13, 27, 42, 0.08);
  color: var(--muted);
  text-overflow: ellipsis;
}

.rail-toolbar button {
  background: transparent;
  color: var(--muted);
}

.rail-toolbar .rail-sort-button {
  flex: 0 0 auto;
  background: rgba(6, 182, 212, 0.08);
}

.rail-toolbar button.active,
.rail-sort-button[aria-expanded="true"] {
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
}

.inline-sort-menu {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: max-content;
  max-width: calc(100vw - 28px);
  gap: 5px;
  overflow-x: auto;
  margin: 0 auto;
  border-radius: 999px;
  padding: 4px;
  scrollbar-width: none;
}

.app.sort-menu-open .inline-sort-menu {
  display: grid;
}

.inline-sort-menu::-webkit-scrollbar {
  display: none;
}

.inline-sort-menu button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.inline-sort-menu button.active {
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
}

.spot-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(16px, calc((100vw - 300px) / 2));
  padding: 0 max(16px, calc((100vw - 300px) / 2));
  scrollbar-width: none;
}

.rail-card {
  flex: 0 0 min(300px, calc(100vw - 42px));
  scroll-snap-align: center;
  border: 1px solid rgba(6, 182, 212, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--soft-shadow);
  padding: 10px;
  cursor: pointer;
}

.rail-card.active {
  border-color: rgba(6, 182, 212, 0.62);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12), var(--soft-shadow);
}

.app.map-overview .rail-card.active {
  border-color: rgba(6, 182, 212, 0.18);
  box-shadow: var(--soft-shadow);
}

.rail-card.visited {
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.96), rgba(236, 254, 255, 0.92));
}

.rail-card h2,
.rail-card p {
  margin: 0;
}

.rail-card h2 {
  overflow: hidden;
  margin-top: 6px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.24;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-card p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 17px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.rail-card-top,
.list-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.status-pill,
.distance-pill,
.list-card-head span {
  display: inline-grid;
  place-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.status-pill {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.rail-card.visited .status-pill {
  background: rgba(51, 65, 85, 0.12);
  color: var(--visited);
}

.distance-pill,
.list-card-head span {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-dark);
}

.people-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 7px;
}

.people-row span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.meta-row span {
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.08);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-meta {
  display: flex;
  margin-top: 7px;
}

.compact-meta span {
  max-width: 92px;
}

.rail-card-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}

.rail-card-footer > span {
  width: max-content;
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.08);
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-card-actions {
  display: grid;
  grid-template-columns: repeat(2, 58px);
  gap: 6px;
}

.rail-card-actions a,
.rail-card-actions button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(6, 182, 212, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.rail-card-actions a.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
}

.spot-address {
  overflow: hidden;
  margin-top: 10px !important;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.compact-actions {
  grid-template-columns: 1.2fr 0.8fr 0.8fr 0.8fr;
  gap: 5px;
  margin-top: 9px;
}

.compact-actions a,
.compact-actions button {
  min-height: 36px;
  padding: 0 6px;
  font-size: 11px;
  white-space: nowrap;
}

.action-grid a,
.action-grid button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(6, 182, 212, 0.18);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
}

.action-grid a.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
}

.spot-actions .maps-link {
  font-weight: 950;
}

.empty-rail-card {
  min-height: 132px;
}

.empty-rail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.empty-rail-card button,
.empty-rail-card a {
  display: grid;
  place-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.empty-rail-card a {
  border: 1px solid rgba(6, 182, 212, 0.18);
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent-dark);
}

.add-button {
  position: fixed;
  right: 18px;
  bottom: calc(238px + var(--safe-bottom));
  z-index: 1010;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 16px 32px rgba(35, 101, 83, 0.36);
  font-size: 34px;
  line-height: 1;
}

.tabbar {
  position: fixed;
  right: 14px;
  bottom: calc(12px + var(--safe-bottom));
  left: 14px;
  z-index: 1020;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 60px;
  align-items: center;
  gap: 4px;
  min-height: 58px;
  padding: 5px;
  border-radius: 26px;
}

.tabbar button {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 20px;
  font-size: 12px;
  letter-spacing: 0;
}

.tabbar button.active {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-dark);
}

.tabbar button.active::after {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
}

.tabbar .tab-add {
  justify-self: center;
  width: 52px;
  min-height: 52px;
  border-radius: 19px;
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(6, 182, 212, 0.28);
}

.tabbar .tab-add::after {
  display: none;
}

.view-panel,
.add-sheet,
.detail-sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1200;
  display: none;
  overflow: auto;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 24px 24px 0 0;
  padding: 10px 16px calc(18px + var(--safe-bottom));
}

.view-panel {
  height: min(82dvh, 720px);
  max-height: min(82dvh, 720px);
}

.app[data-view="list"].panel-open .view-panel,
.app[data-view="memories"].panel-open .view-panel {
  top: 0;
  height: auto;
  max-height: none;
  border-radius: 22px 22px 0 0;
  padding-top: calc(12px + var(--safe-top));
}

.app[data-view="list"].panel-open .view-panel .panel-handle,
.app[data-view="memories"].panel-open .view-panel .panel-handle {
  display: none;
}

.add-sheet {
  max-height: min(88dvh, 760px);
}

.detail-sheet {
  max-height: min(76dvh, 620px);
}

.app.panel-open .view-panel,
.app.sheet-open .add-sheet,
.app.detail-open .detail-sheet {
  display: block;
}

.app.panel-open .spot-dock,
.app.panel-open .add-button,
.app.panel-open .top-dock,
.app.panel-open .search-dock,
.app.panel-open .tabbar,
.app.panel-open .sort-menu,
.app.sheet-open .spot-dock,
.app.sheet-open .add-button,
.app.sheet-open .tabbar,
.app.sheet-open .sort-menu,
.app.detail-open .spot-dock,
.app.detail-open .add-button,
.app.detail-open .top-dock,
.app.detail-open .search-dock,
.app.detail-open .tabbar,
.app.detail-open .sort-menu {
  visibility: hidden;
}

.app.panel-open .group-menu,
.app.sheet-open .group-menu,
.app.auth-open .top-dock,
.app.auth-open .search-dock,
.app.auth-open .group-menu,
.app.auth-open .spot-dock,
.app.auth-open .tabbar,
.app.auth-open .sort-menu {
  display: none;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  background: rgba(8, 47, 73, 0.28);
}

.app.panel-open .scrim,
.app.sheet-open .scrim,
.app.detail-open .scrim {
  display: block;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: calc(286px + var(--safe-bottom));
  left: 18px;
  z-index: 1400;
  display: grid;
  place-items: center;
  min-height: 40px;
  border-radius: 999px;
  background: rgba(13, 27, 42, 0.88);
  color: #fff;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  visibility: hidden;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.toast.has-action {
  grid-auto-flow: column;
  grid-template-columns: auto auto;
  gap: 12px;
  width: max-content;
  max-width: calc(100vw - 36px);
  margin: 0 auto;
  pointer-events: auto;
}

.toast-action {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
  place-items: center;
  padding: calc(24px + var(--safe-top)) 18px calc(24px + var(--safe-bottom));
  background: radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.22), transparent 34%), rgba(237, 249, 251, 0.78);
  backdrop-filter: blur(10px);
}

.app.auth-open .auth-screen {
  display: grid;
}

.auth-card {
  width: min(390px, 100%);
  border-radius: 24px;
  padding: 18px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-brand p,
.auth-brand h1,
.auth-error {
  margin: 0;
}

.auth-brand p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.auth-brand h1 {
  font-size: 24px;
}

.auth-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
  font-size: 19px;
  font-weight: 950;
}

.google-button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.google-button span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #ecfeff;
  color: var(--blue);
  font-weight: 950;
}

.auth-form {
  margin-top: 14px;
}

.auth-error {
  min-height: 18px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-error[data-tone="info"] {
  color: var(--accent-dark);
}

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

.field-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.panel-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: var(--line);
}

.view-panel header,
.add-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.view-panel h1,
.add-sheet h1,
.add-sheet p {
  margin: 0;
}

.view-panel h1,
.add-sheet h1 {
  font-size: 22px;
}

.view-panel h1 {
  font-size: 20px;
}

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

.view-panel header button {
  width: 32px;
  height: 32px;
  border-radius: 11px;
}

.add-sheet header p,
.hint {
  color: var(--muted);
  font-size: 13px;
}

.view-panel header button,
.add-sheet header button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.view-panel header button {
  width: 32px;
  height: 32px;
  border-radius: 11px;
}

.import-button,
.save-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  font-weight: 900;
}

.import-button {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(16, 185, 129, 0.12));
  color: var(--accent-dark);
}

.save-button {
  margin-top: 4px;
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
}

form,
label {
  display: grid;
  gap: 7px;
}

form {
  gap: 12px;
  margin-top: 14px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.wanted-picker {
  display: grid;
  gap: 8px;
}

.wanted-picker p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.wanted-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.wanted-list::-webkit-scrollbar {
  display: none;
}

.wanted-chip {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  grid-auto-flow: column;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 6px 12px 6px 7px;
  font-size: 13px;
  font-weight: 900;
}

.wanted-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wanted-chip span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--member-color, var(--accent));
  color: #fff;
  font-size: 11px;
}

.wanted-chip:has(input:checked) {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.16), rgba(16, 185, 129, 0.14));
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  padding: 12px;
  font-size: 16px;
  outline: none;
}

select {
  padding-right: 36px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.14);
}

.save-context {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(6, 182, 212, 0.16);
  border-radius: 18px;
  background: rgba(236, 254, 255, 0.56);
  padding: 12px;
}

.save-preview {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(6, 182, 212, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  padding: 12px;
}

.preview-empty,
.preview-head,
.preview-people {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.preview-empty {
  display: grid;
}

.preview-empty strong,
.save-preview h2,
.preview-head strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-empty span,
.preview-head span,
.save-preview p,
.preview-people span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-head {
  justify-content: space-between;
}

.preview-head span {
  flex: 0 0 auto;
  font-weight: 900;
}

.save-preview h2,
.save-preview p {
  margin: 0;
}

.save-preview h2 {
  font-size: 16px;
  line-height: 1.2;
}

.preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preview-row span {
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.08);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-people span:last-child {
  flex: 1 1 auto;
}

.advanced-fields {
  display: grid;
  border: 1px solid rgba(6, 182, 212, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  padding: 0 12px;
}

.advanced-fields summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}

.advanced-fields summary::-webkit-details-marker {
  display: none;
}

.advanced-fields summary::after {
  color: var(--muted);
  content: "＋";
  font-size: 18px;
  line-height: 1;
}

.advanced-fields[open] {
  gap: 12px;
  padding-bottom: 12px;
}

.advanced-fields[open] summary::after {
  content: "−";
}

.search-row,
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.search-row {
  grid-template-columns: minmax(0, 1fr) 72px;
}

.search-row button {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  font-weight: 850;
}

.search-results {
  display: grid;
  gap: 8px;
}

.result-lead {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.result-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 11px;
  text-align: left;
}

.result-button strong,
.result-button span {
  display: block;
}

.result-button span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-button small {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-stack,
.memory-stack,
.share-stack {
  display: grid;
  gap: 12px;
}

.view-panel .list-stack,
.view-panel .memory-stack {
  gap: 9px;
}

.list-card,
.memory-card,
.share-card {
  border: 1px solid rgba(6, 182, 212, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  padding: 14px;
  box-shadow: var(--soft-shadow);
}

.view-panel .list-card,
.view-panel .memory-card {
  border-radius: 16px;
  padding: 11px;
}

.settings-grid {
  display: grid;
  gap: 12px;
}

.settings-card {
  border: 1px solid rgba(6, 182, 212, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  padding: 14px;
  box-shadow: var(--soft-shadow);
}

.hero-settings {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.13), rgba(16, 185, 129, 0.1)), rgba(255, 255, 255, 0.92);
}

.settings-card h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

.settings-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.settings-card .mode-switch {
  display: grid;
  box-shadow: none;
  backdrop-filter: none;
}

.settings-card .action-grid {
  grid-template-columns: 1fr;
}

.group-manage-card .action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sync-status {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.member-manage-list {
  display: grid;
  gap: 7px;
}

.member-manage-list div {
  display: grid;
  grid-template-columns: 24px minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  border: 1px solid rgba(6, 182, 212, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px;
}

.member-manage-list span,
.member-manage-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-manage-list span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.member-manage-list small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.compact-group-form {
  margin-top: 12px;
}

.danger-button {
  border-color: rgba(236, 72, 153, 0.28) !important;
  color: #be185d !important;
}

.danger-button:disabled {
  opacity: 0.45;
}

.memory-actions button.active,
.detail-actions button.active {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.92), rgba(6, 182, 212, 0.92));
  color: #fff;
}

.account-row,
.group-card-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.account-row .group-avatar,
.group-card-row .group-avatar {
  width: 40px;
  height: 40px;
  border-radius: 13px;
}

.member-strip {
  margin-top: 12px;
}

.account-row strong,
.account-row span,
.group-card-row strong,
.group-card-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-row span,
.group-card-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.group-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.group-form .split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.list-card h2,
.memory-card h2,
.share-card h2 {
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-panel .list-card h2,
.view-panel .memory-card h2 {
  font-size: 15px;
  line-height: 1.28;
}

.list-card-head h2 {
  min-width: 0;
}

.list-card p,
.memory-card p,
.share-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.view-panel .list-card p,
.view-panel .memory-card p {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.35;
}

.view-panel .people-row {
  margin-top: 5px;
}

.view-panel .meta-row {
  gap: 5px;
  margin-top: 6px;
}

.view-panel .meta-row span {
  padding: 3px 7px;
  font-size: 11px;
}

.saved-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(6, 182, 212, 0.16);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.16), rgba(16, 185, 129, 0.12)), rgba(255, 255, 255, 0.9);
  padding: 14px;
  box-shadow: var(--soft-shadow);
}

.saved-hero.empty {
  min-height: 170px;
  align-items: center;
}

.saved-hero.empty button {
  display: grid;
  place-items: center;
  min-width: 58px;
  min-height: 42px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
  font-size: 15px;
  font-weight: 950;
}

.saved-hero span,
.saved-hero p {
  display: block;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-hero span {
  font-size: 12px;
  font-weight: 900;
}

.saved-hero h2 {
  margin: 3px 0 2px;
  overflow: hidden;
  font-size: 21px;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-hero p {
  font-size: 13px;
}

.saved-hero strong {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--accent-dark);
  font-size: 34px;
  line-height: 1;
}

.saved-hero small {
  color: var(--muted);
  font-size: 12px;
}

.saved-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  margin-bottom: 10px;
}

.list-filter-row {
  display: grid;
  gap: 9px;
  margin-bottom: 10px;
  border: 1px solid rgba(6, 182, 212, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
}

.list-filter-row > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.list-filter-row > div > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.list-filter-row > div > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.saved-toolbar button,
.list-filter-row button,
.saved-stats span {
  border: 1px solid rgba(6, 182, 212, 0.18);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 20px rgba(8, 47, 73, 0.08);
}

.saved-toolbar button,
.list-filter-row button {
  min-height: 36px;
  border-radius: 999px;
  color: var(--muted);
  padding: 0 13px;
  font-size: 12px;
  font-weight: 900;
}

.list-filter-row button {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-filter-row button[data-list-member]:not([data-list-member="all"]) {
  border-color: color-mix(in srgb, var(--member-color, var(--accent)) 38%, rgba(6, 182, 212, 0.16));
}

.saved-toolbar button.active,
.list-filter-row button.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
}

.saved-stats span {
  display: grid;
  min-width: 0;
  border-radius: 15px;
  color: var(--muted);
  padding: 8px;
  text-align: left;
  font-size: 11px;
  font-weight: 850;
}

.saved-stats strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-list,
.saved-region {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.saved-region {
  scroll-margin-top: 12px;
}

.saved-region h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  margin: 2px 0 0;
  border-bottom: 1px solid rgba(6, 182, 212, 0.14);
  color: var(--ink);
  padding: 4px 2px 8px;
  font-size: 14px;
  font-weight: 850;
}

.saved-region h3 span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-region h3 small {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-dark);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 950;
}

.saved-card {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(6, 182, 212, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px;
  box-shadow: var(--soft-shadow);
}

.saved-card h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.saved-card .list-card-head span {
  flex: 0 0 auto;
  border: 1px solid rgba(6, 182, 212, 0.16);
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.08);
  color: var(--accent-dark);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 950;
}

.saved-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
}

.memory-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(51, 65, 85, 0.14);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(51, 65, 85, 0.08)), rgba(255, 255, 255, 0.92);
  padding: 14px;
  box-shadow: var(--soft-shadow);
}

.memory-hero span,
.memory-hero p {
  display: block;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-hero span {
  font-size: 12px;
  font-weight: 900;
}

.memory-hero h2 {
  margin: 3px 0 2px;
  overflow: hidden;
  font-size: 21px;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-hero p {
  font-size: 13px;
}

.memory-hero strong {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--visited);
  font-size: 34px;
  line-height: 1;
}

.memory-hero small {
  color: var(--muted);
  font-size: 12px;
}

.memory-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.memory-stats span {
  display: grid;
  min-width: 0;
  border: 1px solid rgba(51, 65, 85, 0.13);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  padding: 8px;
  font-size: 11px;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(8, 47, 73, 0.08);
}

.memory-stats strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-list,
.memory-month {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.memory-month h3 {
  width: max-content;
  max-width: 100%;
  margin: 2px 0 0;
  border: 1px solid rgba(51, 65, 85, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 850;
}

.memory-card {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(51, 65, 85, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px;
  box-shadow: var(--soft-shadow);
}

.memory-card h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-card.expanded h2 {
  display: -webkit-box;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.memory-card .list-card-head span {
  flex: 0 0 auto;
  border: 1px solid rgba(51, 65, 85, 0.12);
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.08);
  color: var(--visited);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 950;
}

.memory-detail {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.memory-card.expanded .memory-detail {
  display: block;
  overflow: visible;
}

.again-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 7px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(6, 182, 212, 0.08));
  padding: 7px;
}

.again-row span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.again-pill,
.detail-status span.again {
  background: rgba(236, 72, 153, 0.1) !important;
  color: #be185d !important;
}

.status-pill.again {
  background: rgba(236, 72, 153, 0.12);
  color: #be185d;
}

.memory-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.memory-actions a,
.memory-actions button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 36px;
  border: 1px solid rgba(51, 65, 85, 0.13);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-size: 11px;
  font-weight: 850;
}

.memory-actions a.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
}

.memory-actions button[data-action="visit"] {
  grid-column: span 2;
}

.detail-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: start;
  gap: 12px;
}

.detail-header span,
.detail-header h2,
.detail-address,
.detail-memo {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-header span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.detail-header h2 {
  display: -webkit-box;
  margin-top: 3px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.detail-header button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.detail-status,
.detail-meta-grid,
.sync-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 7px;
}

.detail-status span,
.detail-meta-grid span,
.sync-status span {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(6, 182, 212, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-status span:first-child {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.detail-status span.visited {
  background: rgba(51, 65, 85, 0.1);
  color: var(--visited);
}

.detail-address,
.detail-memo {
  display: -webkit-box;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.detail-again-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(236, 72, 153, 0.18);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(6, 182, 212, 0.08)), rgba(255, 255, 255, 0.9);
  padding: 11px;
}

.detail-again-panel.active {
  border-color: rgba(236, 72, 153, 0.34);
  box-shadow: 0 9px 22px rgba(236, 72, 153, 0.12);
}

.detail-again-panel strong,
.detail-again-panel span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-again-panel strong {
  color: #be185d;
  font-size: 14px;
  font-weight: 950;
}

.detail-again-panel span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.again-avatar-row {
  display: flex;
  align-items: center;
}

.again-avatar-row .person-avatar {
  margin-left: -6px;
}

.again-avatar-row .person-avatar:first-child {
  margin-left: 0;
}

.detail-memo {
  border-left: 3px solid rgba(6, 182, 212, 0.34);
  padding-left: 9px;
}

.detail-people {
  display: grid;
  gap: 7px;
}

.detail-people div {
  display: grid;
  grid-template-columns: 58px auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.detail-people strong,
.detail-meta-grid strong,
.sync-status strong {
  color: var(--ink);
}

.detail-people strong {
  font-size: 12px;
}

.detail-people span {
  display: flex;
}

.detail-people span .person-avatar {
  margin-left: -6px;
}

.detail-people span .person-avatar:first-child {
  margin-left: 0;
}

.detail-people em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-primary-actions {
  display: grid;
  grid-template-columns: 1.25fr 0.8fr 0.95fr;
  gap: 7px;
}

.detail-primary-actions a,
.detail-primary-actions button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(6, 182, 212, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.detail-primary-actions .primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--emerald));
  color: #fff;
}

.detail-meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-meta-grid span,
.sync-status span {
  display: grid;
  gap: 2px;
  white-space: normal;
}

.detail-actions {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  margin-top: 2px;
}

.detail-actions a,
.detail-actions button {
  min-height: 42px;
  font-size: 12px;
}

.region-title {
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(6, 182, 212, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 850;
}

.region-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 10px;
  scrollbar-width: none;
}

.region-rail span {
  display: grid;
  flex: 0 0 auto;
  min-width: 104px;
  border: 1px solid rgba(6, 182, 212, 0.18);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  padding: 8px;
  font-size: 11px;
  font-weight: 850;
  box-shadow: var(--soft-shadow);
}

.region-rail strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  gap: 7px;
  place-items: center;
  min-height: 180px;
  border: 1px dashed rgba(6, 182, 212, 0.34);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.empty-state strong {
  color: var(--ink);
  font-size: 17px;
}

.empty-state span {
  max-width: 280px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.map-pin {
  position: absolute;
  top: 0;
  left: 2px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 12px 12px 12px 4px;
  background: var(--pin-edge, conic-gradient(var(--accent) 0deg 360deg));
  color: #fff;
  padding: 3px;
  box-shadow: 0 9px 20px rgba(8, 47, 73, 0.22);
  transform: rotate(-45deg);
  transform-origin: 50% 50%;
}

.map-pin-wrap {
  position: relative;
  overflow: visible;
}

.pin-fill {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 9px 9px 9px 3px;
  background: radial-gradient(circle at 68% 28%, rgba(255, 255, 255, 0.52), transparent 30%), var(--pin-fill, var(--accent));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), inset 0 -8px 14px rgba(8, 47, 73, 0.12);
}

.map-pin.visited .pin-fill {
  background: radial-gradient(circle at 68% 28%, rgba(255, 255, 255, 0.42), transparent 30%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.42), rgba(15, 23, 42, 0.14)),
    var(--pin-fill, var(--visited));
}

.map-pin.visited .pin-fill::after {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.14);
  content: "";
}

.map-pin.again {
  outline: 2px solid rgba(236, 72, 153, 0.48);
  outline-offset: 2px;
}

.map-pin.active {
  box-shadow: 0 0 0 5px rgba(6, 182, 212, 0.15), 0 10px 23px rgba(8, 47, 73, 0.25);
}

.map-cluster-wrap {
  overflow: visible;
}

.map-cluster {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 3px solid rgba(255, 255, 255, 0.94);
  border-radius: 19px;
  background: linear-gradient(135deg, var(--cluster-a, var(--accent)), var(--cluster-b, var(--emerald)));
  color: #fff;
  box-shadow: 0 13px 30px rgba(8, 47, 73, 0.26);
}

.map-cluster strong,
.map-cluster span {
  display: block;
  line-height: 1;
}

.map-cluster strong {
  font-size: 18px;
  font-weight: 950;
}

.map-cluster span {
  margin-top: -5px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0;
  opacity: 0.88;
}


@media (min-width: 760px) {
  .top-dock {
    right: auto;
    width: auto;
  }

  .group-select-button {
    width: 156px;
  }

  .search-dock {
    right: auto;
    left: 180px;
    width: 320px;
  }

  .spot-dock {
    right: auto;
    width: 420px;
  }

  .spot-rail {
    scroll-padding-inline: 60px;
    padding: 0 60px;
  }

  .rail-card {
    flex-basis: 300px;
  }

  .view-panel,
  .add-sheet,
  .detail-sheet {
    right: auto;
    left: 16px;
    width: 430px;
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: 24px;
    bottom: 16px;
    max-height: calc(100dvh - 32px);
  }
}

@media (max-width: 380px) {
  :root {
    --edge: 10px;
    --group-width: 132px;
  }

  .search-dock {
    grid-template-columns: minmax(0, 1fr) 58px;
  }

  .search-dock button {
    font-size: 12px;
  }

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

@media (max-width: 340px) {
  :root {
    --group-width: 108px;
  }

  #currentGroupName {
    font-size: 12px;
  }

  .spot-rail {
    scroll-padding-inline: max(16px, calc((100vw - 268px) / 2));
    padding: 0 max(16px, calc((100vw - 268px) / 2));
  }

  .rail-card {
    flex-basis: min(268px, calc(100vw - 40px));
  }
}
