/* Faetime — single global stylesheet. Day/night via data-theme on <html>. */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;1,400&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* Day: black text for legibility, light glass */
:root,
html[data-theme="day"] {
  --bg: #f0ede8;
  --bg-soft: #e8e4de;
  --text: #0d0d0d;
  --text-muted: #444;
  --accent: #5c4a3a;
  --accent-soft: #8b7355;
  --border: rgba(0, 0, 0, 0.08);
  --card: #fffefc;
  --shadow: rgba(0, 0, 0, 0.06);
  --glass: rgba(255, 252, 248, 0.52);
  --glass-strong: rgba(255, 252, 248, 0.68);
  --glass-border: rgba(0, 0, 0, 0.07);
  --radius: 24px;
  --radius-sm: 18px;
  --blur: 28px;
  --blur-strong: 36px;
}

/* Night: inverse — light text, dark glass */
html[data-theme="night"] {
  --bg: #0f0e0d;
  --bg-soft: #1a1917;
  --text: #f2efe9;
  --text-muted: #b5aea5;
  --accent: #c4a574;
  --accent-soft: #a68b5c;
  --border: rgba(255, 255, 255, 0.08);
  --card: #1e1d1b;
  --shadow: rgba(0, 0, 0, 0.4);
  --glass: rgba(20, 18, 16, 0.52);
  --glass-strong: rgba(28, 26, 24, 0.68);
  --glass-border: rgba(255, 255, 255, 0.08);
  --radius: 24px;
  --radius-sm: 18px;
  --blur: 28px;
  --blur-strong: 36px;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  background: #a8d0f0;
  -webkit-text-size-adjust: 100%;
}
html[data-theme="night"] {
  background: #050514;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100vh;
  font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  background: transparent;
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  font-size: 1.05rem;
  position: relative;
}

#faetime-sky {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
}

body .site-header,
body .landing-main,
body .login-main,
body .feed-main,
body .profile-main,
body .settings-main,
body .chat-main,
body .site-footer {
  position: relative;
  z-index: 1;
}

/* Smooth transitions for glass elements */
body:has(#faetime-sky) .site-header,
body:has(#faetime-sky) .compose,
body:has(#faetime-sky) .post-card,
body:has(#faetime-sky) .profile-card,
body:has(#faetime-sky) .chat-box {
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Header/footer only as glass bar when sky is present — no big content block */
body:has(#faetime-sky) .site-header {
  background: var(--glass);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
  border-color: var(--glass-border);
  border-width: 0 0 1px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}
html[data-theme="night"] body:has(#faetime-sky) .site-header {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 24px rgba(196, 165, 116, 0.04);
}

body:has(#faetime-sky) .site-footer {
  background: var(--glass);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
  border-color: var(--glass-border);
  border-width: 1px 0 0;
}

/* Main content: no block — transparent, centred column; only inner cards are glass */
body:has(#faetime-sky) main,
body:has(#faetime-sky) .landing-main,
body:has(#faetime-sky) .login-main,
body:has(#faetime-sky) .feed-main,
body:has(#faetime-sky) .profile-main,
body:has(#faetime-sky) .settings-main,
body:has(#faetime-sky) .chat-main {
  background: transparent;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
body:has(#faetime-sky) .landing-main,
body:has(#faetime-sky) .login-main {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1rem max(1.25rem, env(safe-area-inset-right));
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  border-bottom: 1px solid var(--border);
  background: var(--card);
  border-radius: 0 0 var(--radius) var(--radius);
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
/* Moon tab page */
.moon-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  max-width: 36rem;
  margin: 0 auto;
  width: 100%;
}
body:has(#faetime-sky) .moon-main {
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
html[data-theme="night"] body:has(#faetime-sky) .moon-main {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.moon-display-wrap {
  margin-bottom: 1.5rem;
}
.moon-display-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
}
.moon-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.moon-controls .header-clock-live,
#moon-live-btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.moon-controls .header-clock-live:hover,
#moon-live-btn:hover {
  color: var(--text);
  border-color: var(--accent-soft);
}
.moon-label {
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  color: var(--text);
  min-width: 8ch;
}
.moon-slider {
  width: 160px;
  height: 6px;
  accent-color: var(--accent);
  cursor: pointer;
}
.moon-astro {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text);
}
.moon-astro-loading {
  color: var(--text-muted);
  margin: 0;
}
.moon-astro-fallback {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}
.moon-astro-empty {
  display: none;
}
.moon-astro-heading {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.moon-astro-birth { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.moon-astro-phase {
  margin: 0 0 0.5rem;
  font-weight: 600;
}
.moon-astro-phase-name { color: var(--text); }
.moon-astro-illum { color: var(--text-muted); font-weight: 400; }
.moon-astro-visual {
  margin: 0.75rem 0;
  max-width: 120px;
}
.moon-astro-visual svg { width: 100%; height: auto; display: block; }
.moon-astro-zodiac { margin: 0.5rem 0; color: var(--text-muted); }
.moon-astro-zodiac strong { color: var(--accent); }
.moon-astro-special { margin: 0.5rem 0; }
.moon-astro-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  margin-right: 0.35rem;
  margin-bottom: 0.25rem;
  background: var(--glass);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--accent-soft);
}
.moon-astro-forecast { margin: 0.5rem 0; color: var(--text-muted); font-size: 0.9rem; }
.moon-astro-interp { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.moon-astro-interp-title { margin: 0 0 0.5rem; font-size: 1rem; font-weight: 600; color: var(--text); }
.moon-astro-interp-body { margin: 0; line-height: 1.6; color: var(--text-muted); }
body:has(#faetime-sky) .site-header {
  margin: 0 1.25rem;
  margin-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  border: 1px solid var(--glass-border);
  border-top: none;
}
.site-header h1 {
  margin: 0;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.site-header h1 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.site-header h1 a:hover {
  color: var(--accent);
}
html[data-theme="night"] body:has(#faetime-sky) .site-header h1 a:hover {
  text-shadow: 0 0 20px rgba(196, 165, 116, 0.3);
}
.tagline {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.landing-main {
  flex: 1;
  padding: 4rem 1.25rem;
  text-align: center;
  max-width: 36rem;
  margin: 0 auto;
  width: 100%;
}
body:has(#faetime-sky) .landing-main {
  padding: 3rem 1.25rem;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin-left: auto;
  margin-right: auto;
  max-width: 28rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
html[data-theme="night"] body:has(#faetime-sky) .landing-main {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.landing-main p {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.7;
}
.landing-main .btn {
  margin-top: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.landing-about-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(196, 165, 116, 0.4);
  transition: color 0.2s, border-color 0.2s;
}
.landing-about-link:hover {
  color: var(--accent-soft);
  border-bottom-color: rgba(196, 165, 116, 0.7);
}
.landing-about-content,
.landing-request-form {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: left;
}
.landing-about-heading {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
}
.landing-about-bio p {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.login-main {
  flex: 1;
  max-width: 26rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
  width: 100%;
}
body:has(#faetime-sky) .login-main {
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
html[data-theme="night"] body:has(#faetime-sky) .login-main {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.login-main h2 {
  margin: 0 0 0.5rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
}
.login-main p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.form label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.form input {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
}
body:has(#faetime-sky) .form input {
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-color: var(--glass-border);
}
.form input:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 2px rgba(139, 115, 85, 0.2);
}
.form input[type="date"],
.form input[type="time"] {
  min-height: 2.75rem;
  padding-right: 2.5rem;
  cursor: pointer;
  accent-color: var(--accent);
  color: var(--text);
}
.form input[type="date"]::-webkit-calendar-picker-indicator,
.form input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.25rem;
}
.form .btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
}
.form-note {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.form-note.success {
  color: #1a7c3a;
  font-weight: 500;
}
html[data-theme="night"] .form-note.success {
  color: #6dd68a;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  transition: background 0.2s, transform 0.05s;
}
.btn-primary:hover {
  background: var(--accent-soft);
}
.btn-primary:active {
  transform: scale(0.99);
}

.btn-secondary {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.btn-secondary:hover {
  background: var(--border);
}

/* Feed / home */
.feed-main {
  flex: 1;
  max-width: 36rem;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.feed-main .compose,
.feed-main .feed {
  width: 100%;
  max-width: 36rem;
}
/* Idiosyncratic nav — staggered, expressive states */
.header-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.95rem;
}
.header-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.25rem;
  white-space: nowrap;
  position: relative;
  transition: color 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    letter-spacing 0.3s ease,
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: 0.01em;
}
.header-links a::before {
  content: '';
  position: absolute;
  inset: -2px -4px;
  border-radius: 6px;
  background: transparent;
  opacity: 0;
  transition: opacity 0.25s ease, background 0.25s ease;
  z-index: -1;
}
.header-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0.15rem;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 1px;
  transform-origin: left;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.header-links a:hover {
  color: var(--accent);
  letter-spacing: 0.05em;
  transform: translateY(-1px);
}
.header-links a:hover::before {
  opacity: 1;
  background: rgba(196, 165, 116, 0.08);
}
.header-links a:hover::after {
  width: 100%;
}
.header-links a:active {
  transform: translateY(0);
  transition-duration: 0.1s;
}
.header-links a:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
  border-radius: 4px;
}
.header-links a.active {
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.03em;
}
.header-links a.active::after {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  box-shadow: 0 0 10px rgba(196, 165, 116, 0.35);
  animation: nav-active-glow 2.5s ease-in-out infinite;
}
.header-links a.active::before {
  opacity: 1;
  background: rgba(196, 165, 116, 0.06);
}
@keyframes nav-active-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(196, 165, 116, 0.35); }
  50% { box-shadow: 0 0 16px rgba(196, 165, 116, 0.5); }
}
/* Mobile: staggered link reveal */
.header-has-nav.nav-open .header-links a {
  animation: nav-link-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.header-has-nav.nav-open .header-links a:nth-child(1) { animation-delay: 0.03s; }
.header-has-nav.nav-open .header-links a:nth-child(2) { animation-delay: 0.06s; }
.header-has-nav.nav-open .header-links a:nth-child(3) { animation-delay: 0.09s; }
.header-has-nav.nav-open .header-links a:nth-child(4) { animation-delay: 0.12s; }
.header-has-nav.nav-open .header-links a:nth-child(5) { animation-delay: 0.15s; }
.header-has-nav.nav-open .header-links a:nth-child(6) { animation-delay: 0.18s; }
.header-has-nav.nav-open .header-links a:nth-child(7) { animation-delay: 0.21s; }
@keyframes nav-link-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Hamburger — playful morph */
.header-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease,
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s ease;
}
.header-nav-toggle:hover {
  background: var(--glass);
  border-color: var(--accent-soft);
  transform: scale(1.04);
  box-shadow: 0 2px 12px rgba(196, 165, 116, 0.15);
}
.header-nav-toggle:active {
  transform: scale(0.97);
}
.header-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  margin: 0 auto;
  transition: background 0.25s ease,
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.2s ease;
  transform-origin: center;
}
.header-nav-toggle:hover span {
  background: var(--accent);
}
.header-nav-toggle span:nth-child(1) {
  transform-origin: left center;
}
.header-nav-toggle span:nth-child(3) {
  transform-origin: right center;
}
.header-has-nav.nav-open .header-nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg) scaleX(1.1);
}
.header-has-nav.nav-open .header-nav-toggle span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.header-has-nav.nav-open .header-nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg) scaleX(1.1);
}
.compose {
  margin-bottom: 2rem;
}
.compose-form textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 4rem;
  background: var(--card);
  color: var(--text);
}
/* Compose as glass card when sky present */
body:has(#faetime-sky) .compose {
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
html[data-theme="night"] body:has(#faetime-sky) .compose {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
body:has(#faetime-sky) .compose-form textarea {
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-color: var(--glass-border);
}
.compose-form textarea:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 2px rgba(139, 115, 85, 0.2);
}
.compose-form .btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
}
.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px var(--shadow);
}
.post-card-reply {
  background: rgba(0, 0, 0, 0.02);
}
.post-reply-wrapper {
  margin-left: 1.75rem;
  border-left: 1px solid var(--border);
  padding-left: 1rem;
  margin-top: 0.35rem;
}
body:has(#faetime-sky) .post-card {
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
  border-color: var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}
html[data-theme="night"] body:has(#faetime-sky) .post-card {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.post-meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.post-author {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.post-author:hover {
  color: var(--accent);
}
.post-time {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.post-body {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Source Sans 3', system-ui, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}
.post-body a,
.chat-msg-body a,
.profile-bio a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(196, 165, 116, 0.4);
}
.post-body a:hover,
.chat-msg-body a:hover,
.profile-bio a:hover {
  color: var(--accent-soft);
  border-bottom-color: rgba(196, 165, 116, 0.7);
}
.post-reactions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.4rem;
  gap: 0.5rem;
}
.post-reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.post-reaction-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--glass);
}
.post-reaction-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb, 100, 100, 180), 0.15);
}
.post-reaction-count {
  font-size: 0.8rem;
  font-weight: 500;
}
.post-reply-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.1rem 0.4rem;
}
.post-reply-btn:hover {
  color: var(--accent);
}
.post-reply-form {
  margin-top: 0.5rem;
}
.post-reply-form textarea {
  width: 100%;
  resize: vertical;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
}
.post-reply-actions {
  margin-top: 0.25rem;
  display: flex;
  justify-content: flex-end;
}
.post-youtube-embed {
  margin-top: 0.5rem;
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
}
.post-youtube-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.post-link-preview {
  margin-top: 0.5rem;
}
.post-link-preview-card {
  display: flex;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
}
body:has(#faetime-sky) .post-link-preview-card {
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-color: var(--glass-border);
}
.post-link-preview-thumb {
  flex: 0 0 96px;
  max-width: 96px;
  overflow: hidden;
}
.post-link-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-link-preview-body {
  padding: 0.6rem 0.8rem 0.7rem 0;
  min-width: 0;
}
.post-link-preview-site {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}
.post-link-preview-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.post-link-preview-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  max-height: 3.3em;
  overflow: hidden;
}
.feed-loading,
.feed-empty,
.feed-error {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

/* Profile */
.profile-main {
  flex: 1;
  max-width: 32rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: 0 2px 12px var(--shadow);
}
body:has(#faetime-sky) .profile-card {
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
  border-color: var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}
html[data-theme="night"] body:has(#faetime-sky) .profile-card {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.profile-name {
  margin: 0 0 0.25rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
}
.profile-meta {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Members page: invites card at top */
.invites-card {
  margin-bottom: 1.5rem;
}
.invites-card .profile-name {
  margin-bottom: 0.5rem;
}
.invites-summary {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.invites-create-btn {
  margin-bottom: 1rem;
}
.invites-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.invite-item {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
html[data-theme="night"] .invite-item {
  background: rgba(255, 255, 255, 0.04);
}
.invite-item-status {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.invite-item-status:first-letter {
  text-transform: uppercase;
}
.invite-item-link {
  word-break: break-all;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
}
.invite-item-link:hover {
  text-decoration: underline;
}
.invite-item-empty {
  color: var(--text-muted);
  font-style: italic;
}

/* Astro / Synastry */
.astro-main .profile-card {
  margin-bottom: 1.5rem;
}
.astro-picker {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1rem;
}
.astro-picker label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}
.astro-select,
.astro-date {
  max-width: 20rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--card);
  color: var(--text);
}
.astro-loading {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}
.astro-error {
  padding: 1rem;
  color: var(--text);
  background: rgba(180, 60, 60, 0.1);
  border: 1px solid rgba(180, 60, 60, 0.3);
  border-radius: var(--radius-sm);
}
.astro-with {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.astro-headline {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
  color: var(--accent);
}
.astro-para {
  font-size: 1rem;
  line-height: 1.55;
  margin: 0 0 1rem;
  max-width: 38em;
}
.astro-strengths {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}
.astro-strengths li {
  margin-bottom: 0.3rem;
}
.astro-tension {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}
.astro-scores {
  margin-bottom: 1.5rem;
}
.astro-scores h3,
.astro-aspects h3,
.astro-ritual h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}
.astro-score-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.astro-score-label {
  flex: 0 0 10rem;
  color: var(--text-muted);
}
.astro-score-bar {
  flex: 1;
  min-width: 4rem;
  height: 0.5rem;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.astro-score-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 4px;
}
.astro-score-val {
  flex: 0 0 2rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.astro-aspects {
  margin-bottom: 1.5rem;
}
.astro-aspect-card {
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
}
html[data-theme="night"] .astro-aspect-card {
  background: rgba(255, 255, 255, 0.03);
}
.astro-aspect-supportive {
  border-left-color: rgba(60, 140, 80, 0.6);
}
.astro-aspect-challenging {
  border-left-color: rgba(180, 100, 60, 0.6);
}
.astro-aspect-mixed {
  border-left-color: var(--accent-soft);
}
.astro-aspect-card h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.astro-aspect-oneliner {
  margin: 0 0 0.35rem;
  font-weight: 500;
}
.astro-aspect-insight {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.astro-ritual {
  margin-bottom: 1rem;
}
.astro-ritual ol {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.6;
}
.astro-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.admin-flash {
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.admin-flash-success {
  background: rgba(40, 140, 80, 0.2);
  color: var(--text);
  border: 1px solid rgba(40, 140, 80, 0.4);
}
.admin-flash-warning {
  background: rgba(180, 120, 0, 0.15);
  color: var(--text);
  border: 1px solid rgba(180, 120, 0, 0.35);
}
.admin-flash-info {
  background: rgba(80, 120, 180, 0.15);
  color: var(--text);
  border: 1px solid rgba(80, 120, 180, 0.35);
}
.profile-bio {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}
.profile-birth {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1.5rem;
  font-size: 0.95rem;
}
.profile-birth dt {
  color: var(--text-muted);
  font-weight: 500;
  margin: 0;
}
.profile-birth dd {
  margin: 0;
  color: var(--text);
}
.form-section-label {
  margin: 1.25rem 0 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}
.birth-place-wrap { position: relative; }
.birth-place-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.5rem 0;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px var(--shadow);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
}
.birth-place-results li {
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
}
.birth-place-results li:hover, .birth-place-results li:focus {
  background: var(--glass);
  outline: none;
}
.birth-place-no { color: var(--text-muted); cursor: default; }

/* Settings */
.settings-main {
  flex: 1;
  max-width: 28rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.settings-main h2 {
  margin: 0 0 1.25rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
}
.settings-main .form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  background: var(--card);
  color: var(--text);
}
/* Settings: single glass card for form when sky present */
body:has(#faetime-sky) .settings-main .form {
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}
html[data-theme="night"] body:has(#faetime-sky) .settings-main .form {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
body:has(#faetime-sky) .settings-main .form textarea,
body:has(#faetime-sky) .settings-main .form input {
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-color: var(--glass-border);
}

/* Chat */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 40rem;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem 1rem;
}
.chat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
}
body:has(#faetime-sky) .chat-box {
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}
html[data-theme="night"] body:has(#faetime-sky) .chat-box {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  min-height: 8rem;
  max-height: calc(100vh - 14rem);
  display: flex;
  flex-direction: column;
}
.chat-form {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
}
/* Chat: single box contains messages + form */
body:has(#faetime-sky) .chat-form input {
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-color: var(--glass-border);
}
.chat-form input:focus {
  outline: none;
  border-color: var(--accent-soft);
}
.chat-form .btn {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
}
.chat-msg {
  padding: 0.5rem 0 0.6rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-msg:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.chat-msg-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.chat-msg-meta time {
  font-size: 0.8rem;
  opacity: 0.85;
}
.chat-msg-author {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.chat-msg-author:hover {
  color: var(--accent);
}
.chat-msg-body {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Source Sans 3', system-ui, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

.site-footer {
  padding: 1.25rem 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  text-align: center;
  border-radius: var(--radius) var(--radius) 0 0;
}
body:has(#faetime-sky) .site-footer {
  margin: 0 1.25rem;
  border: 1px solid var(--glass-border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* Avatars */
.post-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.post-avatar-empty {
  display: inline-block;
  background: var(--border);
}
.post-meta {
  gap: 0.5rem;
  align-items: center;
}
.post-delete-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  line-height: 1;
}
.post-delete-btn:hover {
  background: var(--border);
  color: var(--text);
}
.post-image {
  margin-top: 0.75rem;
}
.post-image img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  display: block;
}
.profile-avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 1rem;
}
.profile-avatar-empty {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: var(--border);
  display: block;
  margin-bottom: 1rem;
}
.settings-avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 0.75rem;
}
.settings-avatar-empty {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: var(--border);
  display: block;
  margin-bottom: 0.75rem;
}
.settings-avatar-wrap {
  margin-bottom: 0.75rem;
}
.compose-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.compose-img-label {
  cursor: pointer;
  display: flex;
  align-items: center;
}
.compose-img-btn {
  font-size: 1.3rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.compose-img-btn:hover {
  opacity: 1;
}

/* Mobile-first overrides */
@media (max-width: 768px) {
  :root,
  html[data-theme="day"],
  html[data-theme="night"] {
    --radius: 16px;
    --radius-sm: 12px;
  }
  .site-header {
    padding: 0.875rem 1rem;
  }
  body:has(#faetime-sky) .site-header {
    margin: 0 0.75rem;
  }
  .site-header h1 {
    font-size: 1.4rem;
  }
  /* Group titles so they don't reflow separately during nav toggle */
  .site-header-brand {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-width: 0;
    contain: layout;
  }
  .header-nav-toggle {
    display: flex;
    order: 10;
    margin-left: auto;
  }
  .header-has-nav .header-links {
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    gap: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.25s ease;
  }
  .header-has-nav.nav-open .header-links {
    max-height: 300px;
    opacity: 1;
    padding-top: 0.75rem;
    padding-bottom: 0.25rem;
    gap: 0.5rem 1rem;
  }
  body:has(#faetime-sky) .landing-main,
  body:has(#faetime-sky) .login-main {
    padding: 1.5rem 1rem;
    margin: 0 0.75rem;
  }
  .feed-main,
  .profile-main,
  .settings-main {
    padding: 1rem;
  }
  body:has(#faetime-sky) main,
  body:has(#faetime-sky) .moon-main,
  body:has(#faetime-sky) .feed-main,
  body:has(#faetime-sky) .profile-main,
  body:has(#faetime-sky) .settings-main,
  body:has(#faetime-sky) .chat-main {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .chat-main {
    padding: 0 1rem 1rem;
  }
  .chat-messages {
    padding: 1rem;
    max-height: calc(100vh - 12rem);
  }
  .chat-form {
    padding: 0.75rem 1rem;
  }
  .chat-form input,
  .form input {
    min-height: 44px;
  }
  .chat-form .btn,
  .form .btn {
    min-height: 44px;
  }
  body:has(#faetime-sky) .site-footer {
    margin: 0 0.75rem;
  }
}
