/* mm ❤ pp の恋爱记录 — romantic themes via data-theme */
:root, [data-theme="rose"] {
  --cream: #fbf7f2;
  --cream-2: #f3ebe3;
  --blush: #f3d6d8;
  --blush-deep: #e8b4b8;
  --rose: #c97b84;
  --rose-gold: #b76e79;
  --rose-gold-light: #d4a5a5;
  --ink: #4a3f3f;
  --ink-soft: #7a6a6a;
  --muted: #9a8a8a;
  --ok: #7a9e7e;
  --warn: #c4a35a;
  --danger: #c45c5c;
  --glass: rgba(255, 252, 248, 0.72);
  --glass-border: rgba(183, 110, 121, 0.18);
  --shadow: 0 12px 40px rgba(183, 110, 121, 0.12);
  --shadow-sm: 0 4px 16px rgba(74, 63, 63, 0.06);
  --accent-grad: linear-gradient(135deg, #d4a5a5, #b76e79 55%, #a45d68);
  --hero-grad: linear-gradient(145deg, rgba(255,252,248,0.92), rgba(243,214,216,0.5));
  --hero-grad-alt: linear-gradient(145deg, rgba(255,252,248,0.95), rgba(232,180,184,0.42));
  --bg-glow-1: rgba(243, 214, 216, 0.55);
  --bg-glow-2: rgba(212, 165, 165, 0.35);
  --bg-glow-3: rgba(243, 235, 227, 0.9);
  --nav-active: linear-gradient(135deg, rgba(243,214,216,0.75), rgba(232,180,184,0.5));
  --btn-soft-bg: rgba(243, 214, 216, 0.65);
  --input-border: rgba(183, 110, 121, 0.22);
  --focus-ring: rgba(183, 110, 121, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Georgia", serif;
  --sidebar-w: 260px;
  --topbar-bg: rgba(251, 247, 242, 0.88);
  --days-number: linear-gradient(135deg, #c97b84, #b76e79 40%, #8f4e57);
}

/* 玫瑰之恋 — deeper / richer romantic rose pink */
[data-theme="rose-love"] {
  --cream: #fbf2f4;
  --cream-2: #f5e0e6;
  --blush: #f0c4cf;
  --blush-deep: #e09aab;
  --rose: #c45d75;
  --rose-gold: #a83d58;
  --rose-gold-light: #d4899a;
  --ink: #4a3038;
  --ink-soft: #7a5560;
  --muted: #9a7882;
  --ok: #7a9e7e;
  --warn: #c4a35a;
  --danger: #c45c5c;
  --glass: rgba(255, 248, 250, 0.78);
  --glass-border: rgba(168, 61, 88, 0.2);
  --shadow: 0 12px 40px rgba(168, 61, 88, 0.14);
  --shadow-sm: 0 4px 16px rgba(74, 48, 56, 0.07);
  --accent-grad: linear-gradient(135deg, #d4899a, #a83d58 55%, #8f2f48);
  --hero-grad: linear-gradient(145deg, rgba(255,248,250,0.94), rgba(240,196,207,0.55));
  --hero-grad-alt: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(224,154,171,0.45));
  --bg-glow-1: rgba(240, 196, 207, 0.58);
  --bg-glow-2: rgba(212, 137, 154, 0.38);
  --bg-glow-3: rgba(245, 224, 230, 0.92);
  --nav-active: linear-gradient(135deg, rgba(240,196,207,0.82), rgba(224,154,171,0.52));
  --btn-soft-bg: rgba(240, 196, 207, 0.68);
  --input-border: rgba(168, 61, 88, 0.24);
  --focus-ring: rgba(168, 61, 88, 0.14);
  --topbar-bg: rgba(251, 242, 244, 0.9);
  --days-number: linear-gradient(135deg, #c45d75, #a83d58 40%, #7a2840);
}

/* 日落桃 — warm peach / coral sunset */
[data-theme="sunset"] {
  --cream: #fff5ef;
  --cream-2: #ffe8dc;
  --blush: #ffd4c2;
  --blush-deep: #f5b39a;
  --rose: #e8896c;
  --rose-gold: #d46a4c;
  --rose-gold-light: #f0a888;
  --ink: #4a3832;
  --ink-soft: #7a5f56;
  --muted: #9a8278;
  --ok: #7a9e7e;
  --warn: #c4a35a;
  --danger: #c45c5c;
  --glass: rgba(255, 250, 246, 0.76);
  --glass-border: rgba(212, 106, 76, 0.18);
  --shadow: 0 12px 40px rgba(212, 106, 76, 0.12);
  --shadow-sm: 0 4px 16px rgba(74, 56, 50, 0.06);
  --accent-grad: linear-gradient(135deg, #f0a888, #d46a4c 55%, #c45a3a);
  --hero-grad: linear-gradient(145deg, rgba(255,250,246,0.92), rgba(255,212,194,0.55));
  --hero-grad-alt: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(245,179,154,0.42));
  --bg-glow-1: rgba(255, 212, 194, 0.55);
  --bg-glow-2: rgba(240, 168, 136, 0.35);
  --bg-glow-3: rgba(255, 232, 220, 0.9);
  --nav-active: linear-gradient(135deg, rgba(255,212,194,0.8), rgba(245,179,154,0.5));
  --btn-soft-bg: rgba(255, 212, 194, 0.65);
  --input-border: rgba(212, 106, 76, 0.22);
  --focus-ring: rgba(212, 106, 76, 0.14);
  --topbar-bg: rgba(255, 245, 239, 0.9);
  --days-number: linear-gradient(135deg, #e8896c, #d46a4c 40%, #b84f35);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

/* Background ambience */
body.page-login,
body.page-app {
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, var(--bg-glow-2), transparent 55%),
    radial-gradient(800px 500px at 50% 100%, var(--bg-glow-3), transparent 50%),
    var(--cream);
  min-height: 100%;
  transition: background 0.35s ease;
}

.glass-card, .glass-panel {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

/* Login */
.login-scene {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
}
.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(201, 123, 132, 0.12), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(183, 110, 121, 0.1), transparent 40%);
}
.login-card {
  width: min(440px, 100%);
  padding: 28px 32px 28px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,0.4) inset;
}
.brand { text-align: center; margin-bottom: 28px; }
.brand-heart {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-grad);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--rose-gold) 28%, transparent);
}
.brand-heart.sm { width: 40px; height: 40px; font-size: 16px; margin: 0; }
.brand-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  margin: 0 0 6px;
  background: linear-gradient(120deg, var(--rose-gold), #8f4e57);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.login-form { display: grid; gap: 14px; }
.login-hint { text-align: center; margin: 18px 0 0; }
.remember-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; color: var(--ink-soft);
}

/* Fields */
.field { display: grid; gap: 6px; }
.field-label { font-size: 0.82rem; color: var(--ink-soft); font-weight: 600; letter-spacing: 0.02em; }
.field-hint { font-size: 0.75rem; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%;
  border: 1px solid var(--input-border);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  padding: 11px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus {
  border-color: var(--rose-gold-light);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.textarea { resize: vertical; min-height: 80px; }
.checkbox { width: 16px; height: 16px; accent-color: var(--rose-gold); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  transition: transform .15s, box-shadow .2s, background .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--rose-gold) 28%, transparent);
}
.btn-soft {
  background: var(--btn-soft-bg);
  color: var(--rose-gold);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid rgba(183, 110, 121, 0.2);
}
.btn-danger {
  background: rgba(196, 92, 92, 0.12);
  color: var(--danger);
}
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.5);
  font-size: 1.2rem; line-height: 1;
  color: var(--ink);
}

/* App shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 14px;
  border-radius: 0;
  border-left: none; border-top: none; border-bottom: none;
  z-index: 20;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px 18px;
}
.sidebar-title { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.sidebar-sub { font-size: 0.75rem; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; padding-right: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  border: none; background: transparent;
  padding: 10px 12px; border-radius: 12px;
  color: var(--ink-soft);
  transition: background .15s, color .15s;
}
.nav-item:hover { background: color-mix(in srgb, var(--blush) 40%, transparent); color: var(--ink); }
.nav-item.active {
  background: var(--nav-active);
  color: var(--rose-gold);
  font-weight: 650;
  box-shadow: var(--shadow-sm);
  border: 1px solid color-mix(in srgb, var(--rose-gold) 18%, transparent);
}
.nav-icon { width: 1.4em; text-align: center; opacity: 0.9; }
.nav-label { font-size: 0.9rem; }
.sidebar-footer { padding-top: 12px; border-top: 1px solid rgba(183,110,121,0.12); display: grid; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-grad);
  color: #fff; font-weight: 700; font-size: 0.9rem;
}
.user-name { font-weight: 600; font-size: 0.92rem; }

.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center; gap: 12px;
  padding: 10px 18px;
  position: sticky; top: 0; z-index: 15;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--rose-gold) 12%, transparent);
}
.topbar-brand {
  display: none; /* desktop: brand lives in sidebar */
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.98rem;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  writing-mode: horizontal-tb;
}
.topbar-spacer { flex: 1 1 auto; min-width: 8px; }
.topbar-user { font-size: 0.85rem; color: var(--ink-soft); white-space: nowrap; }

/* Theme switcher */
.theme-switch {
  display: inline-flex; flex-wrap: wrap; gap: 4px;
  padding: 3px;
  background: color-mix(in srgb, var(--blush) 35%, rgba(255,255,255,0.6));
  border: 1px solid var(--glass-border);
  border-radius: 999px;
}
.theme-btn {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 650;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .2s, color .2s, transform .15s;
}
.theme-btn:hover { color: var(--ink); background: rgba(255,255,255,0.45); }
.theme-btn.active {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--rose-gold) 28%, transparent);
}
.theme-switch-login {
  justify-content: center;
  margin: 0 auto 18px;
  width: fit-content;
}
.theme-switch-top { flex-shrink: 0; }
.main-content {
  padding: 28px 28px 80px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}
.fade-in { animation: fadeIn .48s cubic-bezier(.22,.61,.36,1); }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(14px) scale(0.992); }
  to { opacity: 1; transform: none; }
}
@keyframes softRise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes homePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}
.lift-card {
  transition: transform .28s cubic-bezier(.22,.61,.36,1), box-shadow .28s ease, border-color .28s ease;
}
.lift-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow), 0 14px 32px color-mix(in srgb, var(--rose-gold) 18%, transparent);
}
.glass-card, .item-card, .nav-item, .btn, .home-mod-tile, .heartbeat-chip, .countdown-capsule, .home-carousel-card, .unified-feed-item {
  transition: transform .26s cubic-bezier(.22,.61,.36,1), box-shadow .26s ease, background .22s ease, opacity .22s ease, border-color .22s ease;
}
.item-card:hover, .home-mod-tile:hover, .home-carousel-card:hover, .unified-feed-item:hover {
  transform: translateY(-3px);
}
.home-heroes > *, .weather-dual > *, .home-section, .unified-feed {
  animation: softRise .5s cubic-bezier(.22,.61,.36,1) both;
}
.home-heroes > *:nth-child(2) { animation-delay: .06s; }
.weather-dual > *:nth-child(2) { animation-delay: .08s; }
.brand-heart { animation: homePulse 3.6s ease-in-out infinite; }
.password-empty {
  -webkit-text-security: none !important;
  text-security: none !important;
}

.drawer, .drawer-backdrop { display: none; }

/* Page */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-title {
  font-family: var(--serif);
  font-size: 1.65rem; margin: 0 0 4px;
  letter-spacing: 0.02em;
}
.page-sub { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.module-page { display: grid; gap: 16px; }
.item-card {
  padding: 18px 18px 14px;
  transition: transform .18s ease, box-shadow .2s ease;
}
.item-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--rose-gold) 8%, transparent);
}
.item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.item-title { margin: 0; font-size: 1.08rem; font-weight: 650; }
.item-title.done { text-decoration: line-through; color: var(--muted); }
.item-snippet { margin: 8px 0; color: var(--ink-soft); white-space: pre-wrap; }
.meta-row {
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  font-size: 0.8rem; color: var(--muted); margin: 6px 0 10px;
}
.item-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(183,110,121,0.15); }
.check-title { display: flex; align-items: center; gap: 10px; flex: 1; }
.is-done { opacity: 0.78; }

.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 650; white-space: nowrap;
}
.badge-ok { background: rgba(122,158,126,0.18); color: var(--ok); }
.badge-warn { background: rgba(196,163,90,0.2); color: #9a7a30; }
.badge-soft { background: rgba(243,214,216,0.55); color: var(--rose); }
.badge-rose { background: rgba(183,110,121,0.15); color: var(--rose-gold); }
.badge-muted { background: rgba(154,138,138,0.15); color: var(--muted); }

.split-panels {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0;
}
.panel {
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(183,110,121,0.1);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.panel h4 { margin: 0 0 8px; font-size: 0.88rem; color: var(--rose); }
.panel p { margin: 0 0 6px; font-size: 0.88rem; color: var(--ink-soft); }
.panel-pp { border-top: 3px solid rgba(183,110,121,0.45); }
.panel-mm { border-top: 3px solid rgba(212,165,165,0.8); }
.shared-notes {
  background: rgba(243,214,216,0.25);
  padding: 10px 12px; border-radius: 12px;
  font-size: 0.9rem;
}

.progress-bar {
  height: 8px; border-radius: 999px;
  background: rgba(183,110,121,0.12);
  overflow: hidden; margin: 8px 0;
}
.progress-fill {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 999px;
}



.praise-card { background: linear-gradient(160deg, rgba(255,252,248,0.9), rgba(243,214,216,0.35)); }
.praise-text {
  font-family: var(--serif);
  font-size: 1.1rem; line-height: 1.7; margin: 8px 0 0;
}

.checklist { list-style: none; padding: 0; margin: 8px 0; }
.checklist li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.checklist .done { text-decoration: line-through; color: var(--muted); }

.privacy-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(243,214,216,0.3);
  border-radius: 12px;
  border: 1px dashed rgba(183,110,121,0.25);
}
.intimacy-card { border: 1px solid rgba(183,110,121,0.2); }

.predict-card { padding: 16px 18px; }
.predict-card h4 { margin: 0 0 6px; color: var(--rose); }

.letter-body {
  background: rgba(255,255,255,0.5);
  border-radius: 14px; padding: 14px 16px;
  border-left: 3px solid var(--rose-gold-light);
  margin: 8px 0;
}
.letter-text { white-space: pre-wrap; margin: 8px 0 0; line-height: 1.7; }
.letter-sealed {
  text-align: center; padding: 24px 16px;
  background: linear-gradient(160deg, rgba(243,214,216,0.4), rgba(255,255,255,0.5));
  border-radius: 14px; margin: 8px 0;
}
.sealed-icon { font-size: 2rem; margin-bottom: 6px; }

.analytics-hero {
  padding: 28px 24px; text-align: center;
  background: var(--hero-grad);
}
.days-hero-card {
  padding: 32px 24px 28px;
  position: relative;
  overflow: hidden;
}
.days-hero-card::before {
  content: '';
  position: absolute; inset: -40% auto auto -20%;
  width: 220px; height: 220px; border-radius: 50%;
  background: color-mix(in srgb, var(--blush-deep) 35%, transparent);
  pointer-events: none;
}
.hero-kicker {
  font-family: var(--serif); color: var(--rose);
  letter-spacing: 0.14em; margin: 0 0 10px;
  font-size: 0.92rem; position: relative;
}
.analytics-hero h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 1.4rem; }
.analytics-know { background: var(--hero-grad-alt); }
.analytics-love { background: var(--hero-grad); }
.analytics-know .btn, .analytics-love .btn { margin-top: 8px; }

.days-hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; position: relative; margin: 4px 0 8px;
}
.days-label {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.days-number {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 10vw, 4.6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  background: var(--days-number);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--rose-gold) 28%, transparent));
}
.days-unit {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 650;
  color: var(--rose-gold);
}
.days-meta { margin: 6px 0 0; position: relative; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.stat-card { padding: 16px; text-align: center; }
.stat-value {
  font-family: var(--serif);
  font-size: 1.6rem; font-weight: 700; color: var(--rose-gold);
}
.stat-label { font-size: 0.85rem; font-weight: 600; margin-top: 4px; }
.stat-hint { margin-top: 4px; }
.analytics-footer { text-align: center; margin-top: 8px; font-size: 0.9rem; }

.perm-matrix { display: grid; gap: 8px; margin: 10px 0; }
.perm-row {
  display: grid; grid-template-columns: 1fr 160px; gap: 10px; align-items: center;
}
.perm-mod { font-size: 0.88rem; }
.settings-card { padding: 20px; display: grid; gap: 12px; }
.form-grid { display: grid; gap: 12px; }
.form-section { margin: 8px 0 0; color: var(--rose); font-size: 0.95rem; }
.stars { color: #c4a35a; letter-spacing: 1px; }

/* Comments (collapsible) */
.comments-box {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid rgba(183,110,121,0.1);
}
.comments-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: none; padding: 4px 0;
  color: var(--ink-soft); font-weight: 700; font-size: 0.82rem;
}
.comments-toggle.has-comments { color: var(--rose-gold); }
.comments-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 6px;
  border-radius: 999px; font-size: 0.7rem; font-weight: 700;
  background: rgba(183,110,121,0.2); color: var(--rose-gold);
}
.comments-chevron { font-size: 0.75rem; opacity: 0.7; }
.comments-body { margin-top: 8px; }
.comment-item {
  background: rgba(255,255,255,0.45);
  border-radius: 10px; padding: 8px 10px; margin-bottom: 6px;
}
.comment-meta { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 2px; font-size: 0.8rem; }
.comment-text { margin: 0; font-size: 0.9rem; white-space: pre-wrap; }
.comment-composer { display: grid; gap: 8px; margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.78rem; }

/* Empty */
.empty-state {
  text-align: center; padding: 48px 20px;
  background: rgba(255,255,255,0.35);
  border: 1px dashed rgba(183,110,121,0.25);
  border-radius: var(--radius);
}
.empty-icon { font-size: 2.2rem; margin-bottom: 8px; opacity: 0.85; }
.empty-state h3 { margin: 0 0 6px; font-family: var(--serif); }
.empty-state p { margin: 0; color: var(--muted); }

.perm-denied {
  text-align: center; padding: 48px 20px; max-width: 420px; margin: 40px auto;
}

/* Modal & toast */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(74, 63, 63, 0.35);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 16px;
}
.modal {
  width: min(560px, 100%);
  max-height: min(88vh, 820px);
  overflow: hidden;
  display: flex; flex-direction: column;
  padding: 0;
}
.modal-lg { width: min(640px, 100%); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 8px;
}
.modal-title { margin: 0; font-family: var(--serif); font-size: 1.15rem; }
.modal-body { padding: 0 18px 8px; color: var(--ink-soft); }
.modal-scroll { padding: 8px 18px 12px; overflow-y: auto; flex: 1; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(183,110,121,0.1);
}

.toast-host {
  position: fixed; top: 18px; right: 18px; z-index: 2000;
  display: grid; gap: 8px;
}
.toast {
  min-width: 180px; max-width: 320px;
  padding: 12px 16px; border-radius: 12px;
  background: rgba(255,252,248,0.95);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-8px);
  transition: opacity .25s, transform .25s;
  font-size: 0.9rem; font-weight: 600;
}
.toast.show { opacity: 1; transform: none; }
.toast-ok { border-left: 3px solid var(--ok); }
.toast-warn { border-left: 3px solid var(--warn); }
.toast-info { border-left: 3px solid var(--rose-gold); }


/* Nav unread — soft envelope (not cold red dot) */
.nav-icon-wrap { position: relative; display: inline-flex; width: 22px; justify-content: center; }
.nav-envelope {
  position: absolute; top: -6px; right: -10px;
  display: none;
  align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 3px;
  font-size: 0.72rem; line-height: 1;
  border-radius: 999px;
  background: linear-gradient(135deg, #f3d6d8, #e8b4b8);
  color: var(--rose-gold);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--rose-gold) 28%, transparent);
  animation: envelopePulse 2.4s ease-in-out infinite;
}
.nav-item.has-unread .nav-label { font-weight: 700; }
@keyframes envelopePulse {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-1px); opacity: 0.85; }
}

/* City combobox */
.city-combo { position: relative; }
.city-combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  max-height: 220px; overflow-y: auto;
  background: rgba(255,252,248,0.98);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 6px;
}
.city-combo-item {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none;
  padding: 8px 10px; border-radius: 8px;
  font-size: 0.9rem;
}
.city-combo-item:hover { background: rgba(243,214,216,0.45); }
.city-combo-custom { color: var(--rose); font-weight: 600; }
.city-combo-empty { padding: 8px 10px; }

.input-readonly, textarea.input-readonly {
  background: rgba(243,235,227,0.55) !important;
  color: var(--ink-soft);
  cursor: not-allowed;
}

/* Intimacy tabs & wants */
.sub-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.sub-tab {
  border: 1px solid rgba(183,110,121,0.22);
  background: rgba(255,255,255,0.55);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.88rem; font-weight: 650;
  color: var(--ink-soft);
}
.sub-tab.active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
}
.wants-columns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.wants-col { padding: 14px; }
.wants-col-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px;
}
.wants-col-head h3 { margin: 0; font-size: 1rem; color: var(--rose); }
.want-item {
  padding: 10px 0;
  border-top: 1px dashed rgba(183,110,121,0.15);
}
.want-text { margin: 0; white-space: pre-wrap; }
.notif-unread {
  border-left: 3px solid var(--rose-gold);
}

@media (max-width: 860px) {
  .wants-columns { grid-template-columns: 1fr; }
}


/* Optional photos (gifts / places) — album module not restored */
.card-photo {
  width: 100%; max-height: 220px; object-fit: cover;
  border-radius: 14px; margin: 10px 0 6px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}
.photo-field { display: grid; gap: 8px; }
.photo-preview {
  min-height: 72px;
  border-radius: 12px;
  border: 1px dashed var(--glass-border);
  background: color-mix(in srgb, var(--cream-2) 55%, rgba(255,255,255,0.5));
  display: grid; place-items: center;
  overflow: hidden;
  padding: 8px;
}
.photo-preview-img {
  max-height: 180px; width: 100%; object-fit: cover; border-radius: 10px;
}
.photo-preview-empty { padding: 16px; }
.photo-field-actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.photo-file-input { flex: 1; min-width: 160px; padding: 8px 10px; }

/* Mobile */
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 14px;
  }
  /* Row1: menu | short brand | mail | user */
  .drawer-toggle { order: 0; }
  .topbar-brand {
    display: block;
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-mail { order: 2; }
  .topbar-user { order: 3; }
  .topbar-user-name { display: none; }
  .topbar-spacer { display: none; }
  /* Row2: presence centered */
  .presence-bar-top {
    display: inline-flex !important;
    order: 4;
    flex: 1 1 100%;
    justify-content: center;
    width: 100%;
    max-width: 100%;
  }
  /* Row3: theme pills full width */
  .theme-switch-top {
    order: 5;
    flex: 1 1 100%;
    justify-content: center;
    margin-top: 2px;
    width: 100%;
  }
  .main-content { padding: 18px 14px 100px; }
  .split-panels { grid-template-columns: 1fr; }
  .perm-row { grid-template-columns: 1fr; }
  .theme-btn { font-size: 0.7rem; padding: 5px 8px; }

  .drawer-backdrop {
    display: block; position: fixed; inset: 0; z-index: 40;
    background: rgba(74,63,63,0.35);
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .drawer {
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    width: min(300px, 86vw);
    padding: 16px 12px;
    border-radius: 0 var(--radius) var(--radius) 0;
    transform: translateX(-105%);
    transition: transform .25s ease;
  }
  body.drawer-open .drawer { transform: none; }
  body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }

  .page-title { font-size: 1.35rem; }
}

@media (min-width: 861px) {
  .drawer-toggle { display: none !important; }
}


/* ========== Home / 我们的小窝 ========== */
.home-page { gap: 18px; }
.home-heroes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.home-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  margin-top: 4px;
}
.home-section-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.12rem;
  color: var(--rose-gold);
  letter-spacing: 0.04em;
}
.home-empty-soft {
  padding: 16px 18px;
  text-align: center;
}
.home-empty-soft p { margin: 0; }

.home-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.home-carousel::-webkit-scrollbar { height: 6px; }
.home-carousel::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--blush-deep) 55%, transparent);
  border-radius: 999px;
}
.home-carousel-card {
  flex: 0 0 min(260px, 78vw);
  scroll-snap-align: start;
  text-align: left;
  padding: 14px 14px 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  cursor: pointer;
  display: grid;
  gap: 6px;
}
.home-carousel-card.is-unread {
  border-color: color-mix(in srgb, var(--rose-gold) 35%, transparent);
  background: linear-gradient(160deg, rgba(255,252,248,0.95), color-mix(in srgb, var(--blush) 35%, transparent));
}
.home-carousel-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.home-carousel-icon { font-size: 1.15rem; }
.home-carousel-msg {
  margin: 0;
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink);
}
.home-carousel-meta {
  display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.home-carousel-preview {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.home-mod-tile {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  cursor: pointer;
  text-align: left;
  position: relative;
}
.home-mod-icon { font-size: 1.15rem; }
.home-mod-label { font-weight: 650; font-size: 0.9rem; flex: 1; min-width: 0; }
.home-star-btn {
  border: none; background: transparent;
  color: var(--muted); font-size: 1rem; line-height: 1;
  padding: 2px 4px; border-radius: 8px;
}
.home-star-btn.is-starred { color: #c4a35a; }
.home-star-btn:hover { background: color-mix(in srgb, var(--blush) 40%, transparent); }

.home-pin-row {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.home-pin-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px dashed color-mix(in srgb, var(--rose-gold) 28%, transparent);
  background: rgba(255,255,255,0.45);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
}
.home-pin-chip:hover {
  border-style: solid;
  color: var(--rose-gold);
  background: color-mix(in srgb, var(--blush) 35%, transparent);
}
.home-pin-star { color: #c4a35a; }

/* Countdown capsules */
.home-countdown-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.countdown-capsule {
  display: grid; gap: 4px;
  text-align: left;
  padding: 16px 16px 14px;
  border: 1px solid var(--glass-border);
  background: var(--hero-grad);
  cursor: pointer;
}
.countdown-capsule.is-meetup { background: var(--hero-grad-alt); }
.countdown-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--rose);
  font-family: var(--serif);
}
.countdown-title {
  font-weight: 700;
  font-size: 1.05rem;
}
.countdown-left {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--rose-gold);
}

/* 心动时刻条 */
.heartbeat-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x mandatory;
}
.heartbeat-chip {
  flex: 0 0 auto;
  max-width: 240px;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.55);
  cursor: pointer;
  text-align: left;
}
.heartbeat-icon {
  grid-row: 1 / span 2;
  font-size: 1.2rem;
  align-self: center;
}
.heartbeat-text {
  font-size: 0.88rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.heartbeat-when { grid-column: 2; }

/* Dual online presence (topbar pill group) */
.presence-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  position: relative;
  width: auto;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}
.presence-bar-top {
  flex-shrink: 0;
  gap: 4px;
  padding: 3px 6px 3px 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blush) 30%, rgba(255,255,255,0.72));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}
.presence-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--glass-border);
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.presence-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  background: color-mix(in srgb, var(--blush) 35%, #fff);
}
.presence-chip.is-self:hover { outline: 2px solid color-mix(in srgb, var(--rose-gold) 35%, transparent); }
.presence-chip.is-partner:hover { outline: 2px solid color-mix(in srgb, var(--rose) 30%, transparent); }
.presence-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #b8a8a8;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.7);
  flex-shrink: 0;
}
.presence-chip.is-online {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 28%, transparent);
  background: color-mix(in srgb, var(--ok) 10%, rgba(255,255,255,0.7));
}
.presence-chip.is-online .presence-dot {
  background: #6fbf78;
  box-shadow: 0 0 0 2px rgba(111,191,120,0.25), 0 0 10px rgba(111,191,120,0.45);
  animation: onlineGlow 2s ease-in-out infinite;
}
.presence-chip.is-offline .presence-label { opacity: 0.75; }
.presence-name { white-space: nowrap; }
.presence-label { white-space: nowrap; }
.presence-heart {
  color: var(--rose-gold);
  font-size: 0.9rem;
  opacity: 0.85;
}
.presence-heart-btn {
  border: none;
  background: transparent;
  color: var(--rose-gold);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.presence-heart-btn:hover { transform: scale(1.2); }
.presence-chat-badge {
  border: none;
  background: var(--rose-gold);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  cursor: pointer;
  flex-shrink: 0;
}
@keyframes onlineGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.login-card {
  animation: fadeIn .45s cubic-bezier(.22,.61,.36,1);
}

@media (max-width: 860px) {
  .home-heroes { grid-template-columns: 1fr; }
  .home-carousel-card { flex-basis: min(240px, 82vw); }
  .presence-label { display: none; }
}


/* Top-bar mail (messages entry) */
.topbar-mail {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.55);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--rose-gold);
  font-size: 1.15rem;
  flex-shrink: 0;
}
.topbar-mail.has-unread {
  background: color-mix(in srgb, var(--blush) 55%, rgba(255,255,255,0.6));
}
.topbar-mail-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px;
  background: var(--accent-grad);
  color: #fff; font-size: 0.65rem; font-weight: 700;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--rose-gold) 30%, transparent);
}

.embed-pane { display: grid; gap: 12px; }
.embed-actions { margin-bottom: 4px; justify-content: flex-end; }

/* Dual weather */
.weather-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.weather-card { padding: 14px 14px 10px; }
.weather-who {
  font-weight: 700; font-size: 0.92rem; color: var(--rose-gold);
  margin-bottom: 8px; font-family: var(--serif);
}
.weather-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.weather-day {
  text-align: center;
  padding: 8px 4px;
  border-radius: 12px;
  background: rgba(255,255,255,0.45);
  border: 1px solid color-mix(in srgb, var(--rose-gold) 10%, transparent);
}
.weather-day-label { font-size: 0.72rem; color: var(--muted); font-weight: 650; }
.weather-day-desc { font-size: 0.82rem; font-weight: 650; margin: 4px 0; }
.weather-day-temp { font-size: 0.78rem; color: var(--ink-soft); }
.weather-fetched { margin: 8px 0 0; }

@media (max-width: 860px) {
  .weather-dual { grid-template-columns: 1fr; }
}


/* ========== Avatars ========== */
.avatar-node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--accent-grad);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--rose-gold) 22%, transparent);
  border: 2px solid rgba(255,255,255,0.85);
}
.avatar-node.has-img { background: transparent; }
.avatar-xs, .avatar-node.avatar-xs { width: 22px; height: 22px; font-size: 0.65rem; }
.avatar-sm, .avatar-node.avatar-sm { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-md, .avatar-node.avatar-md { width: 40px; height: 40px; font-size: 0.95rem; }
.avatar-lg, .avatar-node.avatar-lg { width: 64px; height: 64px; font-size: 1.4rem; }
.avatar-xl, .avatar-node.avatar-xl { width: 96px; height: 96px; font-size: 2rem; }
.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.author-chip-name { font-weight: 650; color: var(--ink); }
.meta-row-author { align-items: center; }
.comment-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.settings-account-row { display: flex; align-items: center; gap: 14px; }
.avatar-settings-preview, .avatar-editor-preview {
  display: flex; justify-content: center; margin: 8px 0 12px;
}
.avatar-editor { text-align: center; }

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.topbar-user-name { white-space: nowrap; }

/* Narrow: avatars + online dots only */
@media (max-width: 480px) {
  .presence-name,
  .presence-label { display: none; }
  .presence-chip { padding: 2px; gap: 0; }
  .presence-bar-top { padding: 3px 4px; gap: 2px; }
}

/* Envelope unread wiggle / drop */
.topbar-mail.envelope-wiggle .topbar-mail-icon,
.nav-item.has-unread .nav-envelope {
  animation: envelopeDropWiggle 1.1s ease-in-out infinite;
  display: inline-flex !important;
}
@keyframes envelopeDropWiggle {
  0% { transform: translateY(0) rotate(0deg); }
  12% { transform: translateY(3px) rotate(-12deg); }
  24% { transform: translateY(0) rotate(10deg); }
  36% { transform: translateY(2px) rotate(-8deg); }
  50% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

/* Weather dialogue bubbles */
.weather-bubbles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) {
  .weather-bubbles { grid-template-columns: 1fr; }
}
.weather-bubble {
  padding: 14px 14px 12px;
  border: 1px solid var(--glass-border);
  position: relative;
}
.weather-bubble-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.weather-bubble-who { display: grid; gap: 2px; flex: 1; min-width: 0; }
.weather-emoji { font-size: 1.35rem; }
.weather-dialogue {
  background: color-mix(in srgb, var(--blush) 28%, #fff);
  border-radius: 16px 16px 16px 6px;
  padding: 10px 12px;
  position: relative;
}
.weather-bubble.is-mine .weather-dialogue {
  border-radius: 16px 16px 6px 16px;
  background: color-mix(in srgb, var(--blush-deep) 22%, #fff);
}
.weather-dialogue::before {
  content: '';
  position: absolute;
  top: -6px; left: 18px;
  border: 6px solid transparent;
  border-bottom-color: color-mix(in srgb, var(--blush) 28%, #fff);
}
.weather-bubble.is-mine .weather-dialogue::before {
  left: auto; right: 18px;
  border-bottom-color: color-mix(in srgb, var(--blush-deep) 22%, #fff);
}
.weather-dialogue-text { margin: 0; font-size: 0.9rem; }
.weather-advice { margin: 8px 0 0; font-size: 0.88rem; line-height: 1.45; }
.weather-home { display: grid; gap: 10px; }
.weather-edit { margin-top: 10px; }
.weather-edit-minimal .field { margin-bottom: 0; }
.weather-edit-actions { display: none; }

.weather-locate-btn {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--blush) 35%, #fff);
  font-size: 0.9rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, background .18s ease;
}
.weather-locate-btn:hover {
  transform: translateY(-1px) scale(1.04);
  background: color-mix(in srgb, var(--blush-deep) 28%, #fff);
}

.weather-same-city {
  display: flex;
  justify-content: center;
  margin: 0 0 2px;
}
.weather-same-city-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--rose-gold);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--blush) 55%, #fff),
    color-mix(in srgb, var(--blush-deep) 35%, #fff),
    color-mix(in srgb, var(--blush) 55%, #fff));
  background-size: 200% 100%;
  border: 1px solid color-mix(in srgb, var(--rose-gold) 28%, transparent);
  box-shadow: var(--shadow-sm);
  animation: weatherSameCityShimmer 3.6s ease-in-out infinite;
}
@keyframes weatherSameCityShimmer {
  0%, 100% { background-position: 0% 50%; transform: translateY(0); }
  50% { background-position: 100% 50%; transform: translateY(-1px); }
}

.distance-chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  max-width: 9.5rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--blush) 28%, rgba(255,255,255,0.78));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}
.distance-chip.is-together {
  color: var(--rose-gold);
  background: color-mix(in srgb, var(--blush-deep) 22%, #fff);
  border-color: color-mix(in srgb, var(--rose-gold) 30%, transparent);
}
.distance-chip.is-hidden { display: none; }

@media (max-width: 480px) {
  .distance-chip { max-width: 6.8rem; padding: 3px 8px; font-size: 0.68rem; }
  .weather-locate-btn { width: 28px; height: 28px; font-size: 0.82rem; }
}


/* ========== Premium chat ========== */
.chat-modal {
  max-width: 480px !important;
  width: min(480px, 94vw);
  padding-bottom: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--blush) 35%, #fff), var(--glass)) !important;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--rose-gold) 8%, transparent);
}
.chat-panel { display: grid; gap: 12px; }
.chat-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 8px;
  border-bottom: 1px dashed color-mix(in srgb, var(--rose-gold) 22%, transparent);
}
.chat-panel-heart { color: var(--rose-gold); font-size: 1.1rem; }
.chat-panel-titles { display: grid; gap: 2px; min-width: 0; }
.chat-list {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 4px 12px;
  scroll-behavior: smooth;
}
.chat-empty {
  text-align: center;
  padding: 36px 12px;
}
.chat-empty-icon { font-size: 2rem; margin-bottom: 8px; }
.chat-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 92%;
}
.chat-bubble-row.is-mine {
  align-self: flex-end;
  flex-direction: row;
  margin-left: auto;
}
.chat-bubble-row.is-theirs { align-self: flex-start; }
.chat-bubble {
  padding: 10px 12px;
  border-radius: 18px;
  max-width: 100%;
  box-shadow: var(--shadow-sm);
  animation: softRise .28s ease both;
}
.chat-bubble-row.is-theirs .chat-bubble {
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 6px;
}
.chat-bubble-row.is-mine .chat-bubble {
  background: var(--accent-grad);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.chat-bubble-row.is-mine .chat-bubble-meta { color: rgba(255,255,255,0.82); }
.chat-bubble-meta {
  font-size: 0.72rem;
  margin-bottom: 4px;
  color: var(--muted);
}
.chat-bubble-text {
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  padding-top: 4px;
}
.chat-send-btn { white-space: nowrap; min-height: 42px; }
.chat-input { min-height: 42px; }

.wants-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
