/* ===== Design System Variables ===== */
:root {
  /* Brand Colors */
  --color-primary: #007AFF;
  --color-primary-dark: #0055CC;
  --color-primary-light: rgba(0, 122, 255, 0.12);
  --color-tab-active: #007AFF;

  /* Backgrounds */
  --color-bg: #F2F2F7;
  --color-bg-soft: #F8F9FF;
  --color-bg-card: #FFFFFF;
  --color-bg-elevated: rgba(118, 118, 128, 0.12);
  --color-bg-overlay: rgba(0, 0, 0, 0.45);

  /* Text */
  --color-text: #000000;
  --color-text-secondary: #3C3C43;
  --color-text-muted: rgba(60, 60, 67, 0.6);

  /* System Colors */
  --color-accent: #34C759;
  --color-accent-light: rgba(52, 199, 89, 0.14);
  --color-danger: #FF3B30;
  --color-danger-light: rgba(255, 59, 48, 0.10);
  --color-warning: #FF9500;

  /* Borders */
  --color-border: rgba(60, 60, 67, 0.2);
  --color-border-light: rgba(60, 60, 67, 0.10);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;

  /* Border Radius */
  --radius: 13px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.06);
  --shadow-primary: 0 4px 16px rgba(0, 122, 255, 0.32);

  /* Transitions */
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}
.hidden { display: none !important; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: none; }
button { font-family: var(--font-sans); cursor: pointer; }
input, select, textarea { font-family: var(--font-sans); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), opacity var(--transition), box-shadow var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.96); opacity: 0.8; }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.28);
}
.btn-primary:hover { opacity: 1; background: var(--color-primary-dark); box-shadow: var(--shadow-primary); }

.btn-secondary {
  background: var(--color-bg-elevated);
  color: var(--color-text);
  box-shadow: none;
}
.btn-secondary:hover { background: rgba(60, 60, 67, 0.16); opacity: 1; }

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.25);
}
.btn-danger:hover { background: #D93025; opacity: 1; }
.btn-block { width: 100%; }

/* ===== Screens ===== */
.screen { min-height: 100vh; }
.screen.hidden { display: none !important; }

/* ===== Setup Box ===== */
.setup-box {
  max-width: 480px;
  margin: 80px auto;
  padding: 32px;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--color-border-light);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.setup-box code {
  background: var(--color-bg-elevated);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.85rem;
}

/* ===== Auth Screen ===== */
#auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px 60px;
  background: linear-gradient(160deg, #E8F0FF 0%, #F2F2F7 40%, #EDF4FF 100%);
  position: relative;
  overflow: hidden;
}

/* Decorative background circles */
#auth-screen::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -80px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(0, 122, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
#auth-screen::after {
  content: "";
  position: absolute;
  bottom: -100px;
  left: -60px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(52, 199, 89, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.auth-header .logo-icon {
  width: 84px;
  height: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 22px;
  background: linear-gradient(145deg, #4DA3FF 0%, #007AFF 45%, #0040CC 100%);
  color: #fff;
  font-weight: 800;
  font-size: 2rem;
  box-shadow:
    0 12px 32px rgba(0, 122, 255, 0.38),
    0 4px 12px rgba(0, 122, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  letter-spacing: -0.02em;
}

.auth-header h1 {
  margin: 0 0 6px;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-text);
  line-height: 1.2;
}

.tagline {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 400;
}

.auth-main {
  width: 100%;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 0.5px rgba(255, 255, 255, 0.9) inset;
  overflow: hidden;
  border: 0.5px solid rgba(255, 255, 255, 0.7);
  position: relative;
  z-index: 1;
}

.auth-tabs {
  display: flex;
  padding: 12px 12px 0;
  background: transparent;
  gap: 0;
}

.auth-tab {
  flex: 1;
  padding: 9px 12px;
  background: rgba(118, 118, 128, 0.12);
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: -0.01em;
}
.auth-tab:first-child { border-radius: var(--radius-xs) 0 0 var(--radius-xs); }
.auth-tab:last-child { border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
.auth-tab.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
}

.auth-form-wrap { padding: 16px 16px 0; }

#auth-error {
  padding: 11px 14px;
  margin: 4px 16px 0;
  background: var(--color-danger-light);
  border: 1px solid rgba(255, 59, 48, 0.2);
  border-radius: var(--radius-xs);
  color: #C0392B;
  font-size: 13px;
  line-height: 1.4;
}

.auth-form input {
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 10px;
  background: rgba(118, 118, 128, 0.10);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 16px;
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.auth-form input:focus {
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}
.auth-form input::placeholder { color: var(--color-text-muted); }
.auth-form.hidden { display: none !important; }

.auth-form .btn-primary {
  margin-top: 4px;
  margin-bottom: 4px;
  padding: 14px 20px;
  font-size: 16px;
  border-radius: var(--radius-sm);
}

.auth-social {
  padding: 12px 16px 0;
}

.auth-note {
  padding: 12px 16px 16px;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 11.5px;
  line-height: 1.55;
  text-align: center;
  border-top: 0.5px solid rgba(60, 60, 67, 0.12);
  margin-top: 8px;
}

/* ===== App Screen Layout ===== */
#app-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--color-bg);
  overflow: hidden;
}

/* ===== App Navigation Bar ===== */
.app-header {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 0.5px solid var(--color-border-light);
  flex-shrink: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  position: relative;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

.app-header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.app-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
}

.page-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.app-logo {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  color: var(--color-text);
  letter-spacing: -0.015em;
}

.service-status {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--color-accent-light);
  color: #1B7A35;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-transform: uppercase;
}

.open-in-app {
  padding: 5px 11px;
  font-size: 12px;
  color: var(--color-primary);
  text-decoration: none;
  border: 1.5px solid rgba(0, 122, 255, 0.4);
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 600;
  transition: all var(--transition);
  letter-spacing: -0.01em;
}
.open-in-app:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  text-decoration: none;
}

/* ===== Tab Bar ===== */
.app-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  justify-content: space-around;
  min-height: 50px;
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
  background: rgba(249, 249, 251, 0.95);
  border-top: 0.5px solid var(--color-border-light);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.app-nav-btn {
  flex: 1;
  min-width: 0;
  padding: 3px 4px;
  background: transparent;
  border: none;
  color: rgba(60, 60, 67, 0.5);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.01em;
}
.app-nav-btn.active { color: var(--color-primary); }
.app-nav-btn:active { opacity: 0.7; }

.tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}
.tab-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-width var(--transition);
}
.app-nav-btn.active .tab-icon svg { stroke-width: 2.25; }

/* ===== Pages ===== */
.page {
  display: none;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  padding-bottom: calc(50px + env(safe-area-inset-bottom));
}
.page.active { display: flex; }

/* ===== Map Page ===== */
#page-map { padding: 0; position: relative; }

#map {
  flex: 1;
  width: 100%;
  min-height: 300px;
  background: #E8EDF2;
  z-index: 1;
}

.home-ad-banner {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  z-index: 55;
  min-height: 48px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  color: var(--color-text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.94);
  border: 0.5px solid rgba(60, 60, 67, 0.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.home-ad-banner:hover {
  color: var(--color-text);
  text-decoration: none;
}

.home-ad-label {
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 122, 255, 0.12);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
}

.home-ad-copy {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.home-ad-cta {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* Map pin markers */
.map-pin-marker { width: 28px; height: 34px; position: relative; }
.map-pin-marker span {
  position: absolute;
  left: 4px;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50% 50% 50% 0;
  background: var(--color-primary);
  border: 2.5px solid #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  transform: rotate(-45deg);
}
.map-pin-marker span::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.map-pin-marker.has-trash span { background: var(--color-accent); }

/* ===== Home Spot Panel ===== */
.home-spot-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.09), 0 -1px 4px rgba(0, 0, 0, 0.05);
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-spot-drag {
  width: 34px;
  height: 4px;
  background: rgba(60, 60, 67, 0.18);
  border-radius: 2px;
  margin: 9px auto 10px;
}

.home-spot-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 8px;
}

.home-spot-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  flex: none;
  letter-spacing: -0.01em;
}

.home-spot-title-row .segment-control {
  flex: 1;
  max-width: 140px;
}

.home-spot-close {
  background: rgba(118, 118, 128, 0.12);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
  line-height: 1;
}
.home-spot-close:hover { background: rgba(118, 118, 128, 0.22); }

.home-spot-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 16px calc(50px + env(safe-area-inset-bottom) + 8px);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.home-spot-scroll::-webkit-scrollbar { display: none; }

.home-spot-card {
  flex-shrink: 0;
  width: 148px;
  background: var(--color-bg-card);
  border-radius: var(--radius);
  border: 0.5px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform var(--transition-spring), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.home-spot-card:active { transform: scale(0.95); box-shadow: none; }

.home-spot-card-img {
  width: 100%;
  height: 78px;
  background: var(--color-bg-elevated);
  object-fit: cover;
  flex-shrink: 0;
}

.home-spot-card-img-placeholder {
  width: 100%;
  height: 78px;
  background: linear-gradient(135deg, #EEF2FF, #E8F0FF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.home-spot-card-body { padding: 7px 9px 8px; flex: 1; overflow: hidden; }

.home-spot-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  letter-spacing: -0.01em;
}

.home-spot-card-meta {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 3px;
}

/* ===== FAB ===== */
.fab {
  position: absolute;
  right: 20px;
  bottom: calc(168px + env(safe-area-inset-bottom));
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    0 4px 16px rgba(0, 122, 255, 0.42),
    0 2px 6px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-spring), box-shadow var(--transition);
  z-index: 60;
}
.fab:hover { transform: scale(1.07); box-shadow: 0 6px 24px rgba(0, 122, 255, 0.52), 0 2px 8px rgba(0,0,0,0.12); }
.fab:active { transform: scale(0.93); box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3); }

/* ===== Feed Page ===== */
.feed-toolbar {
  padding: 10px 14px 8px;
  flex-shrink: 0;
  background: rgba(249, 249, 251, 0.96);
  border-bottom: 0.5px solid var(--color-border-light);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-search {
  width: 100%;
  padding: 9px 14px 9px 36px;
  background: rgba(118, 118, 128, 0.12);
  border: 1.5px solid transparent;
  border-radius: 10px;
  color: var(--color-text);
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(60,60,67,0.45)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px center;
  -webkit-appearance: none;
}
.feed-search:focus {
  border-color: var(--color-primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.10);
}
.feed-search::placeholder { color: var(--color-text-muted); }

.feed-category-filter {
  width: 100%;
  padding: 10px 12px;
  background: rgba(118, 118, 128, 0.12);
  border: 1.5px solid transparent;
  border-radius: 10px;
  color: var(--color-text);
  font-size: 14px;
  outline: none;
}

.feed-category-filter:focus {
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.10);
}

#feed-segment { align-self: flex-start; min-width: 180px; }

.feed-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.feed-card {
  background: var(--color-bg-card);
  border-bottom: 0.5px solid var(--color-border-light);
  overflow: hidden;
  cursor: pointer;
  transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.feed-card:first-child { margin-top: 0; }
.feed-card:active { background: rgba(0, 0, 0, 0.03); }

.feed-card-image {
  width: 100%;
  height: 196px;
  background: linear-gradient(135deg, #EEF2FF, #E8F0FF);
  object-fit: cover;
  display: block;
}
.feed-card-placeholder {
  width: 100%;
  height: 196px;
  background: linear-gradient(135deg, #EEF2FF 0%, #E8F0FF 50%, #F0F4FF 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 122, 255, 0.3);
  font-size: 3rem;
}

.feed-card-body { padding: 13px 16px 15px; }

.feed-card-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.feed-card-category {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 8px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--color-primary-light);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.feed-card-category.cat-suntory,
.feed-card-category.cat-itoen,
.feed-card-category.cat-food { background: var(--color-accent-light); color: #1B7A35; }
.feed-card-category.cat-cocacola,
.feed-card-category.cat-asahi,
.feed-card-category.cat-cigarette { background: var(--color-danger-light); color: #C0392B; }
.feed-card-category.cat-sweets,
.feed-card-category.cat-ice { background: rgba(255, 55, 160, 0.10); color: #B02070; }

.feed-card-memo {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-card-meta {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
  align-items: center;
}

/* ===== Segmented Control ===== */
.segment-control {
  display: flex;
  background: rgba(118, 118, 128, 0.12);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.segment-btn {
  flex: 1;
  padding: 6px 10px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: -0.01em;
  -webkit-tap-highlight-color: transparent;
}
.segment-btn.active {
  background: #fff;
  color: var(--color-text);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10), 0 0.5px 1px rgba(0, 0, 0, 0.06);
}

/* ===== Ranking Page ===== */
#page-ranking {
  padding: 0;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: calc(50px + env(safe-area-inset-bottom));
}

.ranking-toolbar {
  padding: 10px 14px;
  flex-shrink: 0;
  background: rgba(249, 249, 251, 0.96);
  border-bottom: 0.5px solid var(--color-border-light);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.ranking-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px calc(20px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.ranking-top-three {
  display: grid;
  grid-template-columns: 1fr 1.12fr 1fr;
  align-items: end;
  gap: 8px;
  padding: 16px 0 12px;
}

.ranking-top-user {
  min-width: 0;
  min-height: 132px;
  padding: 12px 8px;
  border: 0.5px solid var(--color-border-light);
  border-radius: var(--radius);
  background: var(--color-bg-card);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform var(--transition-spring), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.ranking-top-user:active { transform: scale(0.96); box-shadow: none; }
.ranking-top-user:nth-child(1) {
  min-height: 152px;
  border-color: rgba(0, 122, 255, 0.22);
  background: linear-gradient(160deg, #FAFCFF, #EEF4FF);
  box-shadow: var(--shadow), 0 0 0 0.5px rgba(0, 122, 255, 0.1);
}

.ranking-medal { font-size: 1.3rem; line-height: 1; }

.ranking-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--color-primary-light);
  border: 2px solid rgba(0, 122, 255, 0.3);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
}

.ranking-top-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ranking-top-count { color: var(--color-text-muted); font-size: 11px; font-weight: 600; }

.ranking-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--color-bg-card);
  border: 0.5px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-spring), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.ranking-row:active { transform: scale(0.98); box-shadow: none; }
.ranking-row:hover { border-color: rgba(0, 122, 255, 0.2); }

.ranking-rank {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-bg-elevated);
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text-muted);
  flex: 0 0 auto;
}
.ranking-row .ranking-rank.top { color: #F0A500; }
.ranking-info { flex: 1; min-width: 0; }
.ranking-name { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.ranking-count { margin: 2px 0 0; font-size: 12px; color: var(--color-text-muted); }
.ranking-chevron { color: rgba(60, 60, 67, 0.28); font-size: 1.1rem; flex-shrink: 0; }

.ranking-recent-card {
  padding: 12px 14px;
  background: var(--color-bg-card);
  border: 0.5px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.ranking-recent-card:hover { border-color: rgba(0, 122, 255, 0.2); }
.ranking-recent-card h4 { margin: 0 0 3px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.ranking-recent-card p { margin: 0; font-size: 12px; color: var(--color-text-muted); }

/* ===== Profile Page ===== */
#page-profile {
  overflow-y: auto;
  padding: 16px 14px calc(20px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.profile-card {
  background: var(--color-bg-card);
  border: 0.5px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 26px 20px 20px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 14px;
  background: linear-gradient(145deg, #4DA3FF, #007AFF, #0040CC);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  border: none;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}
.profile-avatar.emoji-mode {
  background: var(--color-bg-elevated);
  font-size: 2.2rem;
  box-shadow: none;
  border: 2px solid var(--color-border-light);
  color: var(--color-text-muted);
}

.profile-card h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.profile-email { margin: 0 0 16px; color: var(--color-text-muted); font-size: 14px; }

.profile-rank-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: -4px 0 16px;
}

.profile-level-badge,
.profile-badge-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.profile-level-badge {
  background: rgba(0, 122, 255, 0.12);
  color: var(--color-primary);
}

.profile-badge-label {
  background: rgba(240, 165, 0, 0.14);
  color: #7A5200;
}

.profile-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 0.5px solid var(--color-border-light);
  padding-top: 16px;
  margin-top: 4px;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 0 8px;
}

.profile-follow-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 0 8px;
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity var(--transition);
  border-radius: var(--radius-xs);
}
.profile-follow-link:hover { opacity: 0.7; }

.profile-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
  letter-spacing: -0.02em;
}

.profile-stat-label {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 3px;
  font-weight: 400;
}

.profile-stat-divider {
  width: 0.5px;
  height: 30px;
  background: var(--color-border-light);
  flex-shrink: 0;
}

.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.profile-actions .btn {
  padding: 10px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.profile-section { margin-bottom: 16px; }
.profile-section h3 {
  margin: 4px 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0 2px;
}

.favorite-list {
  background: var(--color-bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 0.5px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
}
.favorite-item {
  padding: 13px 16px;
  background: var(--color-bg-card);
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  transition: background var(--transition);
  border-bottom: 0.5px solid var(--color-border-light);
}
.favorite-item:last-child { border-bottom: none; }
.favorite-item::after {
  content: "›";
  color: rgba(60, 60, 67, 0.28);
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}
.favorite-item:hover { background: rgba(0, 0, 0, 0.02); text-decoration: none; color: var(--color-text); }
.favorite-empty { color: var(--color-text-muted); font-size: 14px; padding: 20px 16px; text-align: center; }

.favorite-item-meta {
  color: var(--color-text-muted);
  font-size: 12px;
  margin-left: auto;
  padding-left: 12px;
}

/* ===== Settings Page ===== */
#page-settings {
  overflow-y: auto;
  background: var(--color-bg);
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.settings-list {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: var(--color-bg-card);
  border-radius: var(--radius);
  border: 0.5px solid var(--color-border-light);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.settings-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  background: var(--color-bg-card);
  border: none;
  border-bottom: 0.5px solid var(--color-border-light);
  color: var(--color-text);
  font-size: 15px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition);
  gap: 12px;
  letter-spacing: -0.01em;
  -webkit-tap-highlight-color: transparent;
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: rgba(0, 0, 0, 0.03); text-decoration: none; color: var(--color-text); }
.settings-item:active { background: var(--color-bg-elevated); }

.settings-item-icon { font-size: 17px; flex-shrink: 0; width: 24px; text-align: center; }
.settings-item-label { flex: 1; font-weight: 400; }

.settings-item:not(.settings-item-danger)::after {
  content: "›";
  margin-left: auto;
  color: rgba(60, 60, 67, 0.28);
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.settings-item-danger { color: var(--color-danger); font-weight: 500; }
.settings-item-danger:hover { background: rgba(255, 59, 48, 0.05); color: var(--color-danger); }

/* ===== Modals ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
@media (min-width: 600px) {
  .modal { align-items: center; padding: 20px; }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border: 0.5px solid rgba(255, 255, 255, 0.9);
  border-bottom: none;
  padding: 8px 20px 32px;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.14), 0 -2px 8px rgba(0, 0, 0, 0.06);
}
@media (min-width: 600px) {
  .modal-content {
    border-radius: var(--radius-xl);
    max-height: 90vh;
    padding: 24px;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-lg);
  }
}

.modal-content::before {
  content: "";
  display: block;
  width: 34px;
  height: 4px;
  background: rgba(60, 60, 67, 0.18);
  border-radius: 2px;
  margin: 8px auto 16px;
}
@media (min-width: 600px) { .modal-content::before { display: none; } }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  padding: 0;
  background: rgba(118, 118, 128, 0.12);
  border: none;
  border-radius: 50%;
  color: var(--color-text-muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 10;
}
.modal-close:hover { background: rgba(118, 118, 128, 0.22); }

/* ===== Pin Detail Modal ===== */
.pin-detail .pin-detail-image {
  width: 100%;
  height: 190px;
  background: linear-gradient(135deg, #EEF2FF, #E8F0FF);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.pin-detail .pin-detail-image img { width: 100%; height: 100%; object-fit: cover; }
.pin-detail-body h2 { margin: 0 0 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.pin-modal-category { margin: 0 0 10px; color: var(--color-primary); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.pin-modal-memo { margin: 0 0 14px; color: var(--color-text-muted); font-size: 14px; white-space: pre-wrap; line-height: 1.6; }

/* Pin meta tags */
.pin-modal-meta {
  margin: 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.pin-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  border: 0.5px solid var(--color-border-light);
}
.pin-meta-icon { font-size: 13px; line-height: 1; }
.pin-meta-text { font-size: 13px; font-weight: 500; letter-spacing: -0.01em; }
.pin-meta-rating { background: rgba(240, 165, 0, 0.12); color: #7A5200; border-color: rgba(240, 165, 0, 0.2); }
.pin-meta-price { background: rgba(52, 199, 89, 0.10); color: #1B7A35; border-color: rgba(52, 199, 89, 0.2); }
.pin-meta-trash { background: rgba(0, 122, 255, 0.10); color: var(--color-primary); border-color: rgba(0, 122, 255, 0.2); }
.pin-meta-payment { background: rgba(118, 118, 128, 0.10); color: var(--color-text-secondary); border-color: var(--color-border-light); }

.pin-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pin-modal-actions .btn { padding: 10px 16px; font-size: 14px; }
.pin-modal-actions .btn.is-favorite { background: rgba(240, 165, 0, 0.14); color: #8A5500; }

.pin-comments-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 0.5px solid var(--color-border-light);
}

.pin-comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pin-comments-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.pin-comments-header span {
  color: var(--color-text-muted);
  font-size: 12px;
}

.pin-comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.pin-comment-item {
  padding: 12px;
  background: rgba(118, 118, 128, 0.08);
  border: 0.5px solid var(--color-border-light);
  border-radius: var(--radius-sm);
}

.pin-comment-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.pin-comment-text {
  margin: 0;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.pin-comment-image {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  margin-top: 10px;
  border: 0.5px solid var(--color-border-light);
}

.pin-comment-form {
  display: grid;
  gap: 10px;
}

.pin-comment-form textarea {
  width: 100%;
  padding: 11px 12px;
  background: rgba(118, 118, 128, 0.10);
  border: 1.5px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--color-text);
  font-size: 14px;
  resize: vertical;
  outline: none;
}

.pin-comment-form textarea:focus {
  background: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.10);
}

.pin-comment-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.star-rating.compact {
  margin: 0;
}

.star-rating.compact button {
  font-size: 1.35rem;
  padding: 2px 4px;
}

/* ===== Add Pin Form ===== */
.add-pin-form h2 { margin: 0 0 6px; font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }
.add-pin-hint { margin: 0 0 14px; font-size: 13px; color: var(--color-text-muted); line-height: 1.4; }
.add-pin-map-picker {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #EEF2FF, #E8F0FF);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  border: 0.5px solid var(--color-border-light);
}
.add-pin-location-text { margin: 0 0 14px; font-size: 12px; color: var(--color-text-muted); }
.add-pin-form label {
  display: block;
  margin: 14px 0 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.add-pin-form input[type="text"],
.add-pin-form input[type="email"],
.add-pin-form select,
.add-pin-form textarea {
  width: 100%;
  padding: 12px 13px;
  background: rgba(118, 118, 128, 0.10);
  border: 1.5px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--color-text);
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.add-pin-form input:focus,
.add-pin-form select:focus,
.add-pin-form textarea:focus {
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.10);
}
.add-pin-form textarea { resize: vertical; min-height: 76px; }
.add-pin-form select { cursor: pointer; }

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 15px !important;
  color: var(--color-text) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  margin: 14px 0 4px !important;
  font-weight: 400 !important;
}
.checkbox-label input { width: auto; margin: 0; accent-color: var(--color-primary); transform: scale(1.1); }

.star-rating { display: flex; gap: 2px; margin: 8px 0 14px; }
.star-rating button {
  padding: 3px 6px;
  background: none;
  border: none;
  color: rgba(118, 118, 128, 0.25);
  font-size: 1.7rem;
  cursor: pointer;
  transition: color var(--transition), transform var(--transition-spring);
}
.star-rating button.active { color: #F0A500; }
.star-rating button:hover { color: #F0A500; transform: scale(1.15); }

.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.form-actions .btn { flex: 1; border-radius: var(--radius-sm); padding: 13px 16px; }

/* ===== User Profile Modal ===== */
.user-profile-modal .user-profile-header {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 0.5px solid var(--color-border-light);
  margin-bottom: 16px;
}
.user-profile-modal .user-profile-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  background: linear-gradient(145deg, #4DA3FF, #007AFF, #0040CC);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.3);
}
.user-profile-modal .user-profile-avatar.emoji-mode {
  background: var(--color-bg-elevated);
  font-size: 1.8rem;
  box-shadow: none;
  border: 2px solid var(--color-border-light);
  color: var(--color-text-muted);
}
.user-profile-modal h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }
.user-profile-meta { margin: 0 0 10px; font-size: 13px; color: var(--color-text-muted); }
.user-profile-modal #user-profile-follow-btn { margin-bottom: 8px; }
.user-profile-follow-stats { margin: 0; font-size: 13px; color: var(--color-text-muted); }
.user-profile-modal h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.user-profile-pins { max-height: 240px; overflow-y: auto; }
.user-profile-pin-item {
  padding: 10px 12px;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-xs);
  margin-bottom: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background var(--transition);
}
.user-profile-pin-item:hover { background: rgba(60, 60, 67, 0.14); }

/* ===== Follow List Modal ===== */
.follow-list-modal .follow-list-tabs {
  display: flex;
  margin-bottom: 14px;
  border-bottom: 0.5px solid var(--color-border-light);
}
.follow-tab {
  flex: 1;
  padding: 11px 12px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
  letter-spacing: -0.01em;
}
.follow-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }
.follow-list-content { max-height: 360px; overflow-y: auto; }
.follow-list-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.follow-list-user:hover { background: var(--color-bg-elevated); }
.follow-list-user-avatar {
  width: 42px;
  height: 42px;
  background: linear-gradient(145deg, #4DA3FF, #007AFF);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.follow-list-user-avatar.emoji-mode {
  background: var(--color-bg-elevated);
  font-size: 1.1rem;
  color: var(--color-text-muted);
}
.follow-list-user-name { flex: 1; margin: 0; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }

/* ===== Doc Modal ===== */
.doc-modal .doc-modal-body {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.75;
  color: var(--color-text-muted);
  margin-top: 12px;
}
.doc-modal h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }

/* ===== Empty States ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 20px;
  color: var(--color-text-muted);
  text-align: center;
}
.empty-state-icon { font-size: 2.8rem; margin-bottom: 12px; opacity: 0.6; }
.empty-state-text { font-size: 14px; line-height: 1.6; max-width: 240px; }

/* ===== Loading State ===== */
.loading-state {
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* ===== Responsive — Mobile ===== */
@media (max-width: 760px) {
  #app-screen { height: 100dvh; }
  .app-header { padding: 0 12px; }
  .app-logo { font-size: 13px; }
  .open-in-app { padding: 4px 9px; font-size: 11px; }
  .app-nav-btn { font-size: 9.5px; }
  .tab-icon svg { width: 22px; height: 22px; }
  .modal { padding: 0; }
  .modal-content { max-height: 93dvh; }
  .form-actions { flex-direction: column; }
  .feed-card-image,
  .feed-card-placeholder { height: 172px; }
  .profile-stat-value { font-size: 18px; }
  #feed-segment { min-width: 160px; }
}

@media (max-width: 480px) {
  .ranking-top-three { grid-template-columns: 1fr 1.1fr 1fr; gap: 6px; }
  .ranking-top-user { padding: 10px 6px; }
  .ranking-avatar { width: 38px; height: 38px; }
  .home-spot-card { width: 132px; }
  .home-spot-card-img,
  .home-spot-card-img-placeholder { height: 70px; }
}

/* ===== Responsive — Desktop ===== */
@media (min-width: 768px) {
  .feed-list {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  }
  .feed-card {
    border-radius: var(--radius);
    border: 0.5px solid var(--color-border-light);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .feed-card:last-child { margin-bottom: 12px; border-bottom: 0.5px solid var(--color-border-light); }
  #page-profile { padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); }
}

@media (min-width: 1024px) {
  #app-screen { max-width: 480px; margin: 0 auto; }
  .app-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .app-header { max-width: 480px; left: 50%; transform: translateX(-50%); width: 100%; }
}

/* AdSense 広告枠 */
.adsense-banner {
  width: 100%;
  min-height: 60px;
  background: var(--color-bg-secondary);
  padding: 4px 0;
  text-align: center;
}
