/* discover-v1 — self-contained per prototype principle. */

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input { font: inherit; color: inherit; background: none; border: 0; outline: 0; }

/* ============ APP SHELL ============ */
.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 680px) 320px;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

/* ============ SIDEBAR ============ */
.sidebar { position: sticky; top: 24px; height: calc(100vh - 48px); display: flex; flex-direction: column; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 14px; font-size: 32px; font-weight: 800; margin-bottom: 36px; color: var(--text); }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.sidebar nav { display: flex; flex-direction: column; gap: 8px; }
.sidebar nav a {
  padding: 14px 18px; color: var(--text-soft); border-radius: 999px; font-weight: 600; font-size: 16px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.sidebar nav a.active, .sidebar nav a:hover { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.sidebar-foot { display: flex; flex-direction: column; gap: 10px; }
.user-pill {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s, transform 0.05s;
}
.user-pill:hover { border-color: var(--primary); transform: translateY(-1px); }
.user-pill:active { transform: translateY(0); }
.up-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white; font-weight: 800; font-size: 13px;
  background: linear-gradient(135deg, var(--primary), var(--ai));
  flex-shrink: 0; overflow: hidden;
}
.up-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-info { min-width: 0; flex: 1; }
.up-info b {
  display: block; font-size: 13px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.up-info small {
  display: block; font-size: 11px; color: var(--text-soft); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.new-post { border-radius: 999px; background: var(--cta-bg); color: var(--cta-text); font-weight: 700; padding: 14px 22px; font-size: 16px; }

/* ============ MAIN ============ */
.main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 44px;
}
.topbar h1 { font-size: 28px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.topbar-brand { display: none; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; }
.topbar-brand img { width: 24px; height: 24px; object-fit: contain; }

/* topbar actions */
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.wallet-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700; font-size: 13px;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.wallet-chip:hover { background: var(--surface); border-color: var(--primary); transform: translateY(-1px); }
.wallet-chip .ic { display: inline-flex; align-items: center; line-height: 1; }
.wallet-chip .ic svg { display: block; }

/* OnAir button — live indicator with pulsing red dot */
.onair-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 800; font-size: 13px;
  letter-spacing: 0.02em;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.onair-btn:hover { background: var(--error); border-color: var(--error); color: white; }
.onair-btn .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--error);
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55);
  animation: onair-pulse 1.6s ease-in-out infinite;
}
.onair-btn:hover .dot { background: white; box-shadow: 0 0 0 0 rgba(255,255,255,0.55); }
@keyframes onair-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }

/* ============ SEARCH BAR ============ */
.search-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
  display: flex; align-items: center; gap: 10px;
  color: var(--text-soft);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-box svg { width: 18px; height: 18px; flex-shrink: 0; }
.search-box input { flex: 1; color: var(--text); font-size: 14px; }
.search-box input::placeholder { color: var(--text-muted); }

/* ============ SECTION ============ */
.section { padding: 20px 22px; }
.section h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.section h2 .ai-tag {
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}
.section h2 .lede {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: auto;
}

/* ============ TAG GRID ============ */
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 132px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.tag-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s, transform 0.15s, color 0.15s, border-color 0.15s;
  border: 1px solid transparent;
}

.tag-chip.trend {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.tag-chip.trend:hover { background: var(--primary); color: white; transform: translateY(-1px); }
.tag-chip.trend .count {
  background: var(--surface);
  color: var(--text-soft);
  font-weight: 600;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s, color 0.15s;
}
.tag-chip.trend:hover .count { background: rgba(255,255,255,0.22); color: white; }

.tag-chip.your {
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--line);
}
.tag-chip.your:hover { background: var(--surface); border-color: var(--primary); color: var(--primary-dark); transform: translateY(-1px); }
.tag-chip.your .time {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
}
.tag-chip.your:hover .time { color: var(--primary); }

/* ============ PROFILE LIST ============ */
.profile-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.profile-list li { margin: 0; }
.profile-list a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
  margin: 0 -22px;
  padding-left: 22px; padding-right: 22px;
}
.profile-list li:last-child a { border-bottom: 0; }
.profile-list a:hover { background: var(--surface-soft); }
.profile-list .meta { flex: 1; min-width: 0; }
.profile-list .meta b { display: block; font-weight: 700; font-size: 14px; }
.profile-list .meta small { display: block; color: var(--text-soft); font-size: 12px; margin-top: 2px; }
.profile-list .meta .mbti {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700; font-size: 10px;
  padding: 2px 7px; border-radius: 999px;
  letter-spacing: 0.04em;
  margin-left: 6px; vertical-align: middle;
}
.profile-list .visited {
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

/* ============ BIG SPENDER LEADERBOARD ============ */
.spender-section { padding-bottom: 14px; }
.spender-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.spender-head h2 { margin: 0; }
.spender-sub {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}
.spender-volume {
  text-align: right;
  flex-shrink: 0;
  background: var(--primary-soft);
  padding: 8px 12px;
  border-radius: 10px;
}
.spender-volume b { display: block; font-size: 16px; font-weight: 800; color: var(--primary-dark); letter-spacing: -0.01em; }
.spender-volume small { display: block; font-size: 10px; color: var(--primary-dark); opacity: 0.75; font-weight: 600; margin-top: 1px; }

.spender-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.spender-list li {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 6px;
  border-radius: 12px;
  transition: background 0.15s;
}
.spender-list li:hover { background: var(--surface-soft); }

.spender-list .avatar { width: 38px; height: 38px; font-size: 14px; }

.spender-info { min-width: 0; }
.spender-info b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}
.spender-info .mbti {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.spender-amt {
  text-align: right;
  flex-shrink: 0;
}
.spender-amt b {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.spender-amt .unit { font-size: 10px; font-weight: 600; color: var(--text-soft); margin-left: 2px; }

.spender-you {
  margin-top: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.spender-you .me-rank {
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.spender-you .me-rank .hash { font-size: 13px; opacity: 0.7; }
.spender-you .me-rank .num { font-size: 22px; }
.spender-you .me-info { flex: 1; min-width: 0; }
.spender-you .me-info b { display: block; font-size: 13px; }
.spender-you .me-info small { display: block; font-size: 11px; opacity: 0.85; margin-top: 2px; }
.spender-you .me-amt {
  background: rgba(255,255,255,0.18);
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

.spender-updated {
  margin: 10px 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
}

/* ============ TOP PUBLISHERS ============ */
.publishers-section { padding-bottom: 14px; }
.publishers-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.publishers-head h2 { margin: 0; }
.publishers-hint {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.publishers-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.publishers-list a {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 6px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}
.publishers-list a:hover { background: var(--surface-soft); }
.publishers-list .avatar { width: 38px; height: 38px; font-size: 14px; }

.publishers-list .pub-info { min-width: 0; }
.publishers-list .pub-info b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}
.publishers-list .pub-info .mbti {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.publishers-list .pub-info small {
  display: block;
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.publishers-list .pub-followers {
  text-align: right;
  flex-shrink: 0;
}
.publishers-list .pub-followers b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--primary-dark);
}
.publishers-list .pub-followers small {
  display: block;
  font-size: 10px;
  color: var(--text-soft);
  font-weight: 600;
  margin-top: 1px;
}

/* ============ NEARBY MAP SECTION ============ */
.map-section { padding-bottom: 14px; }
.map-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.map-head h2 { margin: 0; }
.map-sub {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 12px;
}
.map-sub .loc-note { color: var(--text-muted); font-size: 11px; }
.map-sub .loc-loading { color: var(--primary-dark); font-weight: 600; }
.map-count {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}

.map-frame {
  position: relative;
  width: 100%;
  height: 220px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.map-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Horizontal spots carousel */
.spots-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-padding: 0 6px;
  padding-bottom: 4px;
  cursor: grab;
  user-select: none;
}
.spots-row.dragging { cursor: grabbing; }
.spots-row::-webkit-scrollbar { display: none; }
.spots-row { scrollbar-width: none; }

.spot-card {
  flex: 0 0 auto;
  width: 168px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  scroll-snap-align: start;
  text-align: left;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.05s, box-shadow 0.2s, border-color 0.2s;
}
.spot-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.12);
}
.spot-card:active { transform: translateY(1px); }

.spot-card .spot-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.spot-card .spot-name {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: -0.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.spot-card .spot-cat {
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}
.spot-card .spot-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.spot-card .spot-dist { color: var(--text-soft); }
.spot-card .spot-reward {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

/* Permission reminder card under spots */
.loc-prompt {
  margin-top: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border: 1px dashed rgba(99, 102, 241, 0.35);
  border-radius: 14px;
}
.loc-prompt[hidden] { display: none !important; }
.loc-prompt-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.loc-prompt-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}
.loc-prompt-text { flex: 1; min-width: 0; }
.loc-prompt-text b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.005em;
}
.loc-prompt-text small {
  display: block;
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 3px;
  line-height: 1.5;
}
.loc-prompt-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  transition: background 0.15s, transform 0.05s;
}
.loc-prompt-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.loc-prompt-btn:active { transform: translateY(0); }

.loc-prompt-help {
  margin-top: 10px;
  padding: 0;
  background: none;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.loc-prompt-help-body {
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 10px;
}
.loc-prompt-help-body[hidden] { display: none !important; }
.loc-prompt-help-body ol {
  margin: 0;
  padding-left: 20px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.8;
}

/* Spot avatar gradients (themed per category) */
.spot-avatar.gCoffee { background: linear-gradient(135deg, #92400e, #b45309); }
.spot-avatar.gBread  { background: linear-gradient(135deg, #d97706, #f59e0b); }
.spot-avatar.gMusic  { background: linear-gradient(135deg, #7c3aed, #db2777); }
.spot-avatar.gBook   { background: linear-gradient(135deg, #047857, #10b981); }
.spot-avatar.gStudio { background: linear-gradient(135deg, #4f46e5, #06b6d4); }
.spot-avatar.gBar    { background: linear-gradient(135deg, #1e293b, #6366f1); }
.spot-avatar.gNoodle { background: linear-gradient(135deg, #ca8a04, #84cc16); }

/* ============ THIN SCROLLBAR (visible only while scrolling) ============ */
/* Default: track present but thumb transparent — bar reserves no extra space.
   On scroll, JS adds .is-scrolling → thumb fades in for ~800ms. */
.tag-grid,
.profile-list,
.spender-list,
.publishers-list {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.25s;
}
.tag-grid.is-scrolling,
.profile-list.is-scrolling,
.spender-list.is-scrolling,
.publishers-list.is-scrolling {
  scrollbar-color: rgba(15, 23, 42, 0.28) transparent;
}
.tag-grid::-webkit-scrollbar,
.profile-list::-webkit-scrollbar,
.spender-list::-webkit-scrollbar,
.publishers-list::-webkit-scrollbar {
  width: 4px;
  background: transparent;
}
.tag-grid::-webkit-scrollbar-thumb,
.profile-list::-webkit-scrollbar-thumb,
.spender-list::-webkit-scrollbar-thumb,
.publishers-list::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 2px;
  transition: background 0.25s;
}
.tag-grid.is-scrolling::-webkit-scrollbar-thumb,
.profile-list.is-scrolling::-webkit-scrollbar-thumb,
.spender-list.is-scrolling::-webkit-scrollbar-thumb,
.publishers-list.is-scrolling::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.28);
}

/* ============ AVATAR ============ */
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: white; font-weight: 800; flex-shrink: 0; user-select: none; }
.avatar.g1 { background: linear-gradient(135deg, var(--primary), var(--ai)); }
.avatar.g2 { background: linear-gradient(135deg, var(--ai), var(--info)); }
.avatar.g3 { background: linear-gradient(135deg, var(--success), var(--ai)); }
.avatar.g4 { background: linear-gradient(135deg, var(--accent), var(--accent-warm)); }
.avatar.g5 { background: linear-gradient(135deg, var(--primary), var(--accent)); }

/* ============ RIGHT PANEL ============ */
.right-panel { display: flex; flex-direction: column; gap: 18px; }
.right-panel .card { padding: 18px; }
.right-panel h2 { font-size: 16px; margin: 0 0 12px; font-weight: 700; }

.creators-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.creators-list li { display: flex; align-items: center; gap: 12px; }
.creators-list .meta { flex: 1; min-width: 0; }
.creators-list .meta b { display: block; font-weight: 700; font-size: 13px; }
.creators-list .meta small { color: var(--text-soft); font-size: 12px; }
.creators-list .follow {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700; font-size: 12px;
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s;
}
.creators-list .follow:hover { background: var(--surface-soft); }
.creators-list .follow.following { background: var(--text); color: white; border-color: var(--text); }

.tips-card { background: linear-gradient(180deg, var(--surface), var(--primary-soft)); }
.tips-card p { font-size: 13px; line-height: 1.6; margin: 0; color: var(--text); }
.tips-card p b { color: var(--primary-dark); font-weight: 800; }

/* ============ BACK TO TOP ============ */
.to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 50;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--text);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.32);
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s, background 0.15s;
}
.to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
@media (hover: hover) {
  .to-top:hover { background: var(--primary-dark); }
}
.to-top:active { transform: translateY(0) scale(0.94); }
@media (max-width: 720px) {
  .to-top {
    bottom: 88px; right: 16px; width: 42px; height: 42px;
    transition: opacity 0.2s, transform 0.2s, background 0.15s,
                bottom 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  body.nav-hidden .to-top { bottom: 28px; }
}

/* ============ MOBILE NAV ============ */
.mobile-nav { display: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
    padding-bottom: 96px;
    gap: 12px;
  }
  .sidebar, .right-panel { display: none; }

  .topbar {
    position: sticky; top: 0; z-index: 10;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 12px 4px; margin: 0 0 4px;
  }
  .topbar h1 { display: none; }
  .topbar-brand { display: inline-flex; }

  .mobile-nav {
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: 10px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 20;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
  }
  .mobile-nav.nav-hidden {
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
  }
  .mobile-nav a { text-align: center; font-size: 12px; color: var(--text-soft); padding: 8px 4px; }
  .mobile-nav a.active { color: var(--text); font-weight: 600; }
  .mobile-nav .compose-btn {
    width: 46px; height: 46px;
    margin: auto; padding: 0;
    border-radius: 50%;
    background: var(--cta-bg); color: var(--cta-text);
    display: grid; place-items: center; line-height: 1;
  }
}
