/* ── Design tokens ─────────────────────────── */
:root {
  --bg:       #f7f4ec;
  --fg:       #1a1a1a;
  --fg-soft:  #6b6b6b;
  --fg-xsoft: #9e9b94;
  --accent:   #4a6b5c;
  --cta:      #c4622d;
  --cta-hover:#b0581f;
  --card:     #ffffff;
  --line:     #e8e5dc;
  --error:    #b03030;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --radius:   6px;
  --shadow:   0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font-family: inherit; }
a { color: inherit; }

/* ── Layout ─────────────────────────────────── */
.wrap {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ─────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 244, 236, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-header.scrolled { border-color: var(--line); }
.header-inner {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.logo-mark {
  display: inline-block;
  font-size: 20px;
  animation: blink-dot 3s ease-in-out infinite;
}
@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
.btn-cta {
  background: var(--cta);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}
.btn-cta:hover { background: var(--cta-hover); }
a.btn-cta { display: inline-flex; align-items: center; text-decoration: none; }

/* ── Locale toggle ──────────────────────────── */
.locale-toggle {
  display: flex;
  gap: 2px;
  font-size: 11px;
}
.locale-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--fg-xsoft);
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: inherit;
  transition: background 0.15s, color 0.15s;
}
.locale-btn:hover { color: var(--fg); }
.locale-btn.active {
  background: var(--line);
  color: var(--fg);
  font-weight: 500;
}

/* ── Tab strip ──────────────────────────────── */
.tab-strip {
  position: sticky;
  top: 56px;
  z-index: 90;
  background: rgba(247, 244, 236, 0.95);
  border-bottom: 1px solid var(--line);
}
.tab-strip-inner {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 0;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 14px 20px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-soft);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
  text-decoration: none;
  display: inline-block;
}
.tab-btn:hover { color: var(--fg); }
.tab-btn.active {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

/* ── Tab panels ─────────────────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Page content area ───────────────────────── */
.page-content {
  padding: 32px 0 48px;
  min-height: 60vh;
}

/* ── Footer ──────────────────────────────────── */
.site-footer {
  margin-top: 64px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
}
.footer-inner {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 20px;
}
.footer-links {
  font-size: 13px;
  color: var(--fg-soft);
  margin-bottom: 10px;
}
.footer-links a {
  color: var(--fg-soft);
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }
.footer-links .sep { margin: 0 8px; color: var(--line); }
.footer-tagline {
  font-size: 12px;
  color: var(--fg-xsoft);
}

/* ── Toast ───────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--fg);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 500;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Mobile FAB ──────────────────────────────── */
.fab {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 150;
  background: var(--cta);
  color: #fff;
  border: none;
  border-radius: 28px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(196,98,45,.35);
  transition: background 0.15s, transform 0.2s, opacity 0.2s;
}
.fab:hover { background: var(--cta-hover); }
a.fab { display: inline-flex; align-items: center; text-decoration: none; }
.fab.hidden { transform: translateY(80px); opacity: 0; pointer-events: none; }

@media (max-width: 599px) {
  .fab { display: block; }
  .btn-cta { display: none; }
  .tab-btn { padding: 14px 16px 12px; font-size: 13px; }
}

/* ── Stub card ───────────────────────────────── */
.stub-wrap { padding: 48px 0; }
.stub-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  max-width: 480px;
}
.stub-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  margin: 0 0 12px;
}
.stub-body {
  font-size: 14px;
  color: var(--fg-soft);
  line-height: 1.65;
  margin: 0 0 20px;
}
.stub-badge {
  display: inline-block;
  background: #edf3f0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 14px;
}
.btn-secondary {
  background: none;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius);
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-secondary:hover { background: var(--accent); color: #fff; }

/* ── Static page content ─────────────────────── */
.static-content {
  max-width: 680px;
  margin: 0 auto;
}
.static-content h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 24px;
}
.static-content h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  margin-top: 32px;
  margin-bottom: 12px;
}
.static-content p {
  font-size: 15px;
  color: var(--fg-soft);
  line-height: 1.7;
  margin-bottom: 16px;
}

/* ── Reduced motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Today tab ──────────────────────────────── */
.today-stat {
  text-align: center;
  padding: 8px 0;
}
.today-count {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 300;
  color: var(--fg);
  line-height: 1;
}
.today-section {
  margin: 28px 0;
}
.today-section-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 400;
  margin: 0 0 16px;
  color: var(--fg-soft);
}
.today-empty-msg {
  font-size: 14px;
  color: var(--fg-xsoft);
  padding: 12px 0;
}

/* ── Tag bar chart ──────────────────────────── */
.tag-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  text-decoration: none;
  color: var(--fg);
  transition: background 0.1s;
  border-radius: var(--radius);
  padding-left: 4px;
  padding-right: 4px;
}
.tag-bar-row:hover { background: var(--line); }
.tag-bar-label {
  width: 100px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-bar-track {
  flex: 1;
  height: 18px;
  background: var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.tag-bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 9px;
  transition: width 0.4s ease;
  min-width: 4px;
}
.tag-bar-count {
  width: 32px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--fg-soft);
  text-align: left;
}

/* ── City chips ─────────────────────────────── */
.today-cities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.city-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 13px;
  color: var(--fg);
}
.city-chip-count {
  color: var(--fg-xsoft);
  font-size: 12px;
}

/* ── Self-delete panel ─────────────────────── */
.delete-panel {
  margin-top: 16px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
}
.delete-panel-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 400;
  margin: 0 0 12px;
}
.delete-list { list-style: none; padding: 0; margin: 0; }
.delete-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.delete-item:last-child { border-bottom: none; }
.delete-item-text {
  color: var(--fg);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.delete-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  color: var(--fg-xsoft);
  font-size: 12px;
}
.delete-btn {
  background: none;
  border: 1px solid var(--error);
  color: var(--error);
  border-radius: var(--radius);
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.delete-btn:hover { background: var(--error); color: #fff; }

/* ── Explore tab ────────────────────────────── */
.explore-section {
  margin: 28px 0;
}
.explore-section-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 400;
  margin: 0 0 12px;
  color: var(--fg-soft);
}
.explore-results {
  margin-top: 16px;
}
.explore-results-label {
  font-size: 12px;
  color: var(--fg-xsoft);
  margin: 0 0 12px;
}

/* Date input */
.date-input {
  width: 100%;
  max-width: 280px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg);
  font-family: inherit;
}
.date-input:focus { outline: none; border-color: var(--accent); }

/* Tag grid */
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-pill {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 13px;
  color: var(--fg-soft);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tag-pill:hover {
  background: var(--line);
  color: var(--fg);
}
.tag-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Search input */
.search-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg);
  font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--accent); }
