:root {
  --bg: #f6f7fb;
  --fg: #16171c;
  --muted: rgba(22, 23, 28, 0.72);

  --bg-dark: #0f1014;
  --fg-dark: #eef0f6;
  --muted-dark: rgba(238, 240, 246, 0.74);

  --radius: 18px;
  --pad: 18px;
  --gap: 18px;

  --border: rgba(0, 0, 0, 0.08);
  --border-dark: rgba(255, 255, 255, 0.10);

  --card-bg: rgba(255, 255, 255, 0.78);
  --card-bg-dark: rgba(18, 18, 20, 0.76);

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-dark: 0 12px 36px rgba(0, 0, 0, 0.40);

  --btn-bg: rgba(255, 255, 255, 0.68);
  --btn-bg-dark: rgba(24, 24, 28, 0.72);

  --accent-violet: #7c3aed;
  --accent-gold: #fbbf24;
  --accent-cyan: #22d3ee;

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
}

/* ========================================
   2. RESET / BASE
======================================== */

* { box-sizing: border-box; }

html,
body {
  height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  color: var(--fg);
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(124, 58, 237, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 20%, rgba(251, 191, 36, 0.16), transparent 55%),
    var(--bg);
}

body.theme-dark {
  color: var(--fg-dark);
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(124, 58, 237, 0.20), transparent 60%),
    radial-gradient(900px 500px at 100% 20%, rgba(251, 191, 36, 0.10), transparent 55%),
    var(--bg-dark);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ========================================
   3. TYPOGRAPHY
======================================== */

.section-title {
  margin: 0 0 8px;
}

.section-intro {
  margin: 0;
  opacity: 0.84;
}

/* ========================================
   4. APP SHELL
======================================== */

.main-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px 34px;
}

/* Landing header */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 4px 18px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: 38px;
  height: 38px;
  display: block;
  object-fit: contain;
}

.main-header h1 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.2px;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: inherit;
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

body.theme-dark .theme-toggle {
  border-color: var(--border-dark);
  background: var(--btn-bg-dark);
  box-shadow: var(--shadow-dark);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

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

.app-logo {
  width: 38px;
  height: 38px;
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}

.app-title {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.app-main {
  flex: 1;
  width: 100%;
}

.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 16px 34px;
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.link-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

/* ========================================
   5. BUTTON SYSTEM
======================================== */

.btn,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: inherit;
  cursor: pointer;
  font-weight: 700;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 120ms ease;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
}

.btn:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
}

body.theme-dark .btn,
body.theme-dark .btn-secondary {
  border-color: var(--border-dark);
  background: var(--btn-bg-dark);
  color: var(--fg-dark);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.btn.primary {
  background: linear-gradient(135deg, rgba(255, 204, 51, 0.98), rgba(255, 153, 51, 0.96));
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #1b140b;
  font-weight: 900;
  box-shadow: none;
}

body.theme-dark .btn.primary,
body.theme-dark .auth-form .btn.primary,
body.theme-dark #create-birthday-btn {
  background: linear-gradient(135deg, rgba(255, 204, 51, 0.98), rgba(255, 153, 51, 0.96));
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #1b140b;
  box-shadow: none;
}

.btn.primary:hover {
  background: linear-gradient(135deg, #ffd15b, #f5b13b);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 700;
}

body.theme-dark .btn-ghost {
  border-color: var(--border-dark);
  color: var(--fg-dark);
}

.btn-block {
  width: 100%;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

/* ========================================
   6. CARD SYSTEM
======================================== */

.card {
  position: relative;
  min-width: 0;
  padding: 18px 18px 18px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}

body.theme-dark .card {
  border-color: var(--border-dark);
  background: var(--card-bg-dark);
  box-shadow: var(--shadow-dark);
}

.card::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(124, 58, 237, 0.95),
    rgba(251, 191, 36, 0.92)
  );
  opacity: 0.62;
  pointer-events: none;
}

.card h2 {
  margin: 0 0 10px 0;
  font-size: 1.05rem;
}

.card h3 {
  margin: 14px 0 8px 0;
  font-size: 0.98rem;
}

.card h4 {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
}

.card p {
  margin: 0;
  line-height: 1.55;
}

.card ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.card li {
  margin: 6px 0;
}

.card-media,
.image-wrapper,
.hero-media,
.post-template {
  width: 100%;
  margin: 0 0 14px 0;
  border-radius: calc(var(--radius) - 6px);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.06);
}

.post-card-image {
  margin-bottom: 12px;
  border-radius: 16px;
  overflow: hidden;
}

.card-media img,
.post-card-image img,
.image-wrapper img,
.hero-image,
.history-image,
.celebrity-image,
.post-template img {
  width: 100%;
  height: auto;
  display: block;
}

.post-card-image img {
  object-fit: cover;
}

.post-card {
  display: grid;
  gap: 12px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.post-template {
  aspect-ratio: auto;
  background: rgba(255, 255, 255, 0.03);
}

.post-template img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.post-content {
  padding: 0 14px 14px;
}

.post-title {
  font-weight: 800;
  margin-bottom: 4px;
}

.post-meta {
  opacity: 0.8;
  margin-bottom: 4px;
}

.post-message {
  opacity: 0.92;
  margin-bottom: 8px;
}

.post-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.meta-time {
  opacity: 0.72;
  font-size: 0.92rem;
}

.post-stats {
  margin-top: 10px;
  opacity: 0.8;
}

.open-post-btn {
  margin-top: 2px;
}

/* ========================================
   6.1 CARD ANATOMY / VARIANTS
======================================== */

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  min-width: 0;
}

.card-header > * {
  min-width: 0;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  min-width: 0;
}

.card-title {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.1px;
}

.card-subtitle {
  margin: 2px 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.88;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  font-size: 0.92rem;
  opacity: 0.78;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.card-kicker {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.35);
}

body.theme-dark .card-kicker {
  border-color: var(--border-dark);
  background: rgba(255, 255, 255, 0.04);
}

/* Size modifiers */

.card-sm {
  padding: 14px 14px 14px 22px;
}

.card-lg {
  padding: 22px 22px 22px 30px;
}

.card-sm .card-title {
  font-size: 0.98rem;
}

.card-lg .card-title {
  font-size: 1.14rem;
}

/* Structural variants */

.card--hero .card-title {
  font-size: clamp(1.18rem, 2vw, 1.4rem);
  line-height: 1.16;
}

.card--hero .card-subtitle {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 60ch;
}

.card--feature .card-body {
  gap: 14px;
}

.card--community .card-footer,
.card--interactive .card-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

body.theme-dark .card--community .card-footer,
body.theme-dark .card--interactive .card-footer {
  border-top-color: var(--border-dark);
}

.card--compact .card-body {
  gap: 8px;
}

.card--compact .card-footer {
  margin-top: 10px;
}

.card--info .card-meta {
  opacity: 0.84;
}

/* Accent variants */

.card--violet::before {
  background: linear-gradient(
    180deg,
    rgba(124, 58, 237, 0.98),
    rgba(168, 85, 247, 0.92)
  );
  opacity: 0.72;
}

.card--gold::before {
  background: linear-gradient(
    180deg,
    rgba(251, 191, 36, 0.98),
    rgba(245, 158, 11, 0.92)
  );
  opacity: 0.74;
}

.card--cyan::before {
  background: linear-gradient(
    180deg,
    rgba(34, 211, 238, 0.98),
    rgba(6, 182, 212, 0.92)
  );
  opacity: 0.72;
}

.card--soft .card-title,
.card--soft .card-subtitle {
  letter-spacing: 0;
}

@media (max-width: 640px) {
  .card-header {
    gap: 10px;
    margin-bottom: 10px;
  }

  .card-footer {
    margin-top: 12px;
  }

  .card-lg {
    padding: 18px 18px 18px 24px;
  }
}

/* ========================================
   7. FORM SYSTEM
======================================== */

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-weight: 700;
  line-height: 1.3;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input,
.select,
.textarea,
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  font: inherit;
}

body.theme-dark .input,
body.theme-dark .select,
body.theme-dark .textarea,
body.theme-dark .field input,
body.theme-dark .field textarea,
body.theme-dark .field select {
  border-color: var(--border-dark);
  background: rgba(0, 0, 0, 0.22);
  color: var(--fg-dark);
}

.textarea,
.field textarea {
  resize: vertical;
  min-height: 120px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.field-help {
  opacity: 0.82;
  font-size: 0.94rem;
}

/* ========================================
   8. LANDING PAGE
======================================== */

.landing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.landing-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* Hero */
.hero-card {
  padding-top: 14px;
  overflow: hidden;
}

.hero-body {
  padding: 0;
}

.hero-title {
  margin: 0 0 8px 0;
  font-size: 1.18rem;
  line-height: 1.18;
}

.hero-subtitle {
  margin: 0;
  opacity: 0.92;
  line-height: 1.5;
  max-width: 58ch;
}

/* Intro */
.intro-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  opacity: 0.82;
}

body.theme-dark .intro-footer {
  border-top-color: var(--border-dark);
}

/* History / celebrity images created by JS */
.image-wrapper {
  border-radius: calc(var(--radius) - 6px);
  overflow: hidden;
  margin: 10px 0 12px;
  background: rgba(0, 0, 0, 0.06);
  position: relative;
}

.history-image,
.celebrity-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Birthday preview */
.preview-list,
.birthday-preview-list {
  display: grid;
  gap: 14px;
}

.birthday-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.birthday-preview-actions button,
.birthday-preview-view-btn,
#birthday-preview-toggle-btn,
#birthday-preview-create-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: inherit;
  cursor: pointer;
  font-weight: 700;
}

body.theme-dark .birthday-preview-actions button,
body.theme-dark .birthday-preview-view-btn,
body.theme-dark #birthday-preview-toggle-btn,
body.theme-dark #birthday-preview-create-btn {
  border-color: var(--border-dark);
  background: var(--btn-bg-dark);
  color: var(--fg-dark);
}

.new-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 204, 51, 0.22);
  border: 1px solid rgba(255, 204, 51, 0.35);
}

/* ========================================
   8.5 FOOTER
======================================== */

.main-footer {
  margin-top: 28px;
  padding: 22px 20px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.theme-dark .main-footer {
  border-color: var(--border-dark);
  background: var(--card-bg-dark);
  box-shadow: var(--shadow-dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.footer-col {
  min-width: 0;
}

.footer-brand-title {
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.2;
  font-weight: 800;
}

.footer-col h3 {
  margin: 0 0 10px;
  font-size: 0.98rem;
  line-height: 1.25;
}

.footer-tagline {
  margin: 0 0 10px;
  font-weight: 700;
  opacity: 0.94;
}

.footer-description {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

body.theme-dark .footer-description {
  color: var(--muted-dark);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li + li {
  margin-top: 8px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease, opacity 160ms ease;
}

.footer-links a:hover {
  opacity: 0.85;
}

body.theme-dark .footer-links a {
  color: var(--muted-dark);
}

.footer-links a:hover {
  color: inherit;
}

.footer-bottom {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

body.theme-dark .footer-bottom {
  border-top-color: var(--border-dark);
}

.footer-bottom p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

body.theme-dark .footer-bottom p {
  color: var(--muted-dark);
}

.footer-bottom {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

/* ========================================
   9. CREATE PAGE
======================================== */

.create-shell {
  padding-top: 10px;
}

.create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.create-editor,
.create-preview {
  min-width: 0;
}

.create-preview-sticky {
  position: sticky;
  top: 92px;
}

.template-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.template-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.template-rail::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 36px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.25));
}

.template-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.template-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.template-track > * {
  flex: 0 0 auto;
}

.template-rail .template-track::-webkit-scrollbar {
  height: 8px;
}

.template-rail .template-track::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 140, 0.28);
  border-radius: 999px;
}

.template-status {
  opacity: 0.85;
  margin: 0;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 110px;
  max-width: 110px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02)
  );
  cursor: pointer;
  scroll-snap-align: start;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.template-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 200, 0, 0.6);
}

.template-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.template-card-label {
  font-size: 0.82rem;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--fg);
  opacity: 0.9;
}

body.theme-dark .template-card-label {
  color: var(--fg-dark);
  opacity: 0.95;
}

.template-card.is-selected {
  border-color: #f4b400;
  box-shadow: 0 0 0 2px rgba(244, 180, 0, 0.35);
  transform: translateY(-2px) scale(1.03);
}

.preview-column-note {
  margin: 0 0 10px;
  opacity: 0.8;
}

.preview-card .preview-template {
  aspect-ratio: auto;
  background: rgba(255, 255, 255, 0.03);
}

.preview-card .preview-template img,
#preview-template-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* ========================================
   10. BIRTHDAY PAGE
======================================== */

#birthday-container {
  min-width: 0;
}

.birthday-post {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.birthday-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.birthday-header .post-title {
  margin: 0;
}

.birthday-header .post-meta {
  opacity: 0.8;
  font-size: 0.95rem;
}

.birthday-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.birthday-primary,
.birthday-secondary {
  min-width: 0;
}

.birthday-primary {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.birthday-secondary {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-message-section,
.comments,
.reactions-section,
.share-section,
.person-section {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
}

body.theme-dark .post-message-section,
body.theme-dark .comments,
body.theme-dark .reactions-section,
body.theme-dark .share-section,
body.theme-dark .person-section {
  border-color: var(--border-dark);
  background: rgba(255, 255, 255, 0.03);
}

.post-message-section .post-message {
  margin: 0;
  line-height: 1.75;
  font-size: 1rem;
}

.comments h3,
.reactions-section h3,
.share-section h3,
.person-section h3 {
  margin: 0 0 12px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
}

body.theme-dark .comment-item {
  border-color: var(--border-dark);
  background: rgba(255, 255, 255, 0.02);
}

.comment-item strong {
  display: inline-block;
  margin-right: 8px;
}

.comment-time {
  opacity: 0.72;
  font-size: 0.88rem;
}

.comment-item p {
  margin: 8px 0 0;
  line-height: 1.55;
}

.comment-empty,
.login-hint {
  opacity: 0.82;
}

.comment-form {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-form textarea {
  width: 100%;
  min-height: 110px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  font: inherit;
  resize: vertical;
}

body.theme-dark .comment-form textarea {
  border-color: var(--border-dark);
  background: rgba(0, 0, 0, 0.22);
  color: var(--fg-dark);
}

.comment-form button,
.share-btn,
.person-btn {
  align-self: flex-start;
}

.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reactions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.reactions button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.reactions button.active {
  border-color: #f4b400;
  box-shadow: 0 0 0 2px rgba(244, 180, 0, 0.25);
}

.reactions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.share-btn,
.person-btn,
.comment-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  color: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.share-btn:hover,
.person-btn:hover,
.comment-form button:hover {
  transform: translateY(-1px);
}

body.theme-dark .share-btn,
body.theme-dark .person-btn,
body.theme-dark .comment-form button,
body.theme-dark .reactions button {
  border-color: var(--border-dark);
  background: var(--btn-bg-dark);
  color: var(--fg-dark);
}

/* Birthday message emphasis */
.post-message-section {
  position: relative;
  padding: 22px 20px 20px;
  border-radius: 18px;
  border: 1px solid rgba(244, 180, 0, 0.22);
  background:
    linear-gradient(
      180deg,
      rgba(244, 180, 0, 0.10),
      rgba(244, 180, 0, 0.04)
    );
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
}

.post-message-section::before {
  content: "Birthday Message";
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

.post-message-section .post-message {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.85;
}

body.theme-dark .post-message-section {
  border-color: rgba(244, 180, 0, 0.26);
  background:
    linear-gradient(
      180deg,
      rgba(244, 180, 0, 0.12),
      rgba(244, 180, 0, 0.05)
    );
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

/* ========================================
   11. PERSON PAGE
======================================== */

.person-post-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.post-visibility {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid var(--border);
}

.post-visibility.is-public {
  background: rgba(34, 197, 94, 0.10);
}

.post-visibility.is-private {
  background: rgba(148, 163, 184, 0.14);
}

.post-stats-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  opacity: 0.86;
  font-size: 0.95rem;
}

.post-actions {
  display: flex;
  justify-content: flex-start;
}

.person-posts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ========================================
   12. ARCHIVE PAGE
======================================== */

.archive-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.archive-results {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.archive-pagination {
  justify-content: flex-start;
}

.state-card {
  min-width: 0;
}

.state-empty,
.state-error {
  padding: 16px 18px;
}

.archive-result-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.archive-result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.archive-result-title {
  margin: 0 0 4px;
}

.archive-result-meta {
  margin: 0;
  opacity: 0.78;
  font-size: 0.94rem;
}

.archive-result-message {
  margin: 0;
  line-height: 1.65;
}

.archive-open-btn {
  flex: 0 0 auto;
}

.archive-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.archive-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

body.theme-dark .archive-pill {
  border-color: var(--border-dark);
  background: rgba(255, 255, 255, 0.04);
}

.archive-title-link {
  text-decoration: none;
}

/* ========================================
   13. MY POSTS PAGE
======================================== */

.my-posts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.my-post-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.my-post-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.my-post-title {
  margin: 0 0 4px;
}

.my-post-meta {
  margin: 0;
  opacity: 0.75;
  font-size: 0.92rem;
}

.my-post-message {
  margin: 0;
  line-height: 1.65;
}

.my-post-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.my-post-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  opacity: 0.85;
}

/* ========================================
   14. UI COMPONENTS
======================================== */

/* Auth */
.auth-section {
  margin-top: 14px;
}

.auth-forms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.auth-forms--single {
  grid-template-columns: 1fr;
}

.auth-mode {
  width: 100%;
}

.auth-form {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.50);
}

body.theme-dark .auth-form {
  border-color: var(--border-dark);
  background: rgba(18, 18, 20, 0.40);
}

.auth-form input {
  width: 100%;
  margin: 8px 0;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.70);
  color: inherit;
}

body.theme-dark .auth-form input {
  border-color: var(--border-dark);
  background: rgba(0, 0, 0, 0.22);
  color: var(--fg-dark);
}

.auth-form .btn {
  width: 100%;
  margin-top: 6px;
}

.auth-switch {
  margin: 12px 0 0;
  font-size: 0.92rem;
  opacity: 0.88;
}

.auth-switch-btn {
  border: 0;
  background: transparent;
  color: var(--accent-violet);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

body.theme-dark .auth-switch-btn {
  color: #b794f6;
}

.auth-switch-btn:hover {
  text-decoration: underline;
}

.auth-user {
  margin-top: 10px;
}

/* Mini calendar */
#mini-calendar {
  margin-top: 10px;
  width: 100%;
}

.mini-cal {
  width: 100%;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.50);
  overflow: hidden;
}

body.theme-dark .mini-cal {
  border-color: var(--border-dark);
  background: rgba(18, 18, 20, 0.40);
}

.mini-cal-head {
  width: 100%;
  padding: 10px 12px;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
}

body.theme-dark .mini-cal-head {
  border-bottom-color: var(--border-dark);
}

.mini-cal-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.mini-cal-wd,
.mini-cal-cell {
  min-width: 0;
}

.mini-cal-weekdays .mini-cal-wd {
  padding: 8px 0;
  text-align: center;
  font-size: 0.80rem;
  opacity: 0.75;
  border-bottom: 1px solid var(--border);
}

body.theme-dark .mini-cal-weekdays .mini-cal-wd {
  border-bottom-color: var(--border-dark);
}

.mini-cal-cell {
  padding: 10px 0;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

body.theme-dark .mini-cal-cell {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.mini-cal-empty {
  opacity: 0.35;
}

.mini-cal-today {
  font-weight: 900;
  position: relative;
}

.mini-cal-today::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 6px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 204, 51, 0.85);
}

/* ========================================
   15. MOTION SYSTEM
======================================== */

@keyframes cardFadeRise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.post-card {
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.06),
    0 2px 8px rgba(15, 23, 42, 0.04);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
  overflow: hidden;
  animation: cardFadeRise 420ms ease forwards;
}

.card:hover,
.post-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.10),
    0 6px 16px rgba(15, 23, 42, 0.06);
}

.page-stack > .card:nth-child(1) { animation-delay: 40ms; }
.page-stack > .card:nth-child(2) { animation-delay: 80ms; }
.page-stack > .card:nth-child(3) { animation-delay: 120ms; }
.page-stack > .card:nth-child(4) { animation-delay: 160ms; }
.page-stack > .card:nth-child(5) { animation-delay: 200ms; }
.page-stack > .card:nth-child(6) { animation-delay: 240ms; }

.archive-result-card,
.my-post-item,
.person-post-item {
  animation: cardFadeRise 420ms ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .post-card,
  .archive-result-card,
  .my-post-item,
  .person-post-item {
    animation: none;
  }
}

/* ========================================
   16. DARK MODE SURFACE SYSTEM
======================================== */

body.theme-dark .card,
body.theme-dark .post-card {
  position: relative;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.28),
    0 2px 10px rgba(0, 0, 0, 0.22);
}

body.theme-dark .card:hover,
body.theme-dark .post-card:hover {
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.34),
    0 6px 18px rgba(0, 0, 0, 0.26);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.05),
      rgba(255, 255, 255, 0.02)
    );
  border-color: rgba(255, 255, 255, 0.10);
}

body.theme-dark .card::before,
body.theme-dark .post-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.05),
      rgba(255, 255, 255, 0.02) 20%,
      rgba(255, 255, 255, 0.00) 40%
    );
  opacity: 0.6;
}

body.theme-dark .card:hover::before,
body.theme-dark .post-card:hover::before {
  opacity: 0.9;
}

body.theme-dark .card::after,
body.theme-dark .post-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35);
  opacity: 0.7;
}

/* ========================================
   16.5 EDGE LIGHT SYSTEM
======================================== */

.card,
.post-card {
  position: relative;
}

.card::after,
.post-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.18),
      rgba(255,255,255,0.05) 12%,
      rgba(255,255,255,0) 40%
    );
  opacity: 0;
  transition: opacity 180ms ease;
}

.card:hover::after,
.post-card:hover::after {
  opacity: 0.45;
}

body.theme-dark .card::after,
body.theme-dark .post-card::after {
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.06),
      rgba(255,255,255,0.03) 16%,
      rgba(255,255,255,0) 40%
    );
}

/* ========================================
   17. RESPONSIVE RULES
======================================== */

@media (max-width: 900px) {
  .landing-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: stretch;
  }

  .landing-col {
    display: contents;
  }

  .hero-card { order: 1; }
  .intro-card { order: 2; }
  #calendar-card { order: 3; }
  #history-card { order: 4; }
  #trivia-card { order: 5; }
  #celebrity-card { order: 6; }
  #quote-card { order: 7; }
  #horoscope-card { order: 8; }
  #birthday-preview-card { order: 9; }
  #community-card { order: 10; }

  .landing-grid > *,
  .landing-col > * {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    align-self: stretch;
  }

  #mini-calendar,
  .mini-cal,
  .mini-cal-head,
  .mini-cal-grid {
    width: 100%;
    max-width: 100%;
  }

  .auth-forms {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .create-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .create-preview {
    order: 2;
    max-width: 100%;
  }

  .create-editor {
    order: 1;
  }

  .create-preview-sticky {
    position: static;
    top: auto;
  }

  .birthday-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .birthday-secondary {
    order: 2;
  }

  .birthday-primary {
    order: 1;
  }

  .post-message-section {
    padding: 18px 16px 16px;
  }

  .post-message-section .post-message {
    font-size: 1rem;
    line-height: 1.75;
  }

  .archive-controls {
    grid-template-columns: 1fr;
  }
}
/* =========================================================
   DATE PAGE LAYOUT
   final: desktop two columns, mobile stacked
========================================================= */

.date-layout-desktop {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  gap: 16px;
  align-items: start;
  margin-top: 4px;
}

.date-desktop-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.date-layout-mobile {
  display: none;
}

.date-layout-desktop .card,
.date-layout-mobile .card {
  margin: 0;
}

#date-bottom-home-card {
  margin-top: 4px;
}

@media (max-width: 900px) {
  .date-layout-desktop {
    display: none;
  }

  .date-layout-mobile {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 4px;
  }
}

@media (max-width: 900px) {
  .date-layout-mobile > * {
    order: 0 !important;
  }

  .date-layout-mobile > .hero-card {
    order: 0 !important;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .footer-bottom {
    margin-top: 18px;
    padding-top: 12px;
  }
}

/* ========================================
   INFO PAGES (ABOUT / PRIVACY / TERMS / ETC.)
======================================== */

.info-page-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 20px;
}

.info-page-hero,
.info-page-section {
  padding: 22px 24px;
}

.info-page-eyebrow {
  margin: 0 0 8px;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

body.theme-dark .info-page-eyebrow {
  color: var(--muted-dark);
}

.info-page-hero h2 {
  margin: 0 0 10px;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  line-height: 1.12;
}

.info-page-tagline {
  margin: 0 0 14px;
  font-size: 1.02rem;
  font-weight: 700;
}

.info-page-lead {
  margin: 0 0 12px;
  max-width: 760px;
  line-height: 1.7;
  color: var(--muted);
}

body.theme-dark .info-page-lead {
  color: var(--muted-dark);
}

.info-page-lead:last-child {
  margin-bottom: 0;
}

.info-page-section h2 {
  margin: 0 0 14px;
  font-size: 1.18rem;
  line-height: 1.25;
}

.info-page-section p {
  margin: 0 0 12px;
  line-height: 1.7;
}

.info-page-section p:last-child {
  margin-bottom: 0;
}

.info-feature-grid,
.info-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.info-feature-item,
.info-link-tile {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
}

body.theme-dark .info-feature-item,
body.theme-dark .info-link-tile {
  border-color: var(--border-dark);
  background: rgba(255, 255, 255, 0.025);
}

.info-feature-item h3,
.info-link-tile h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.3;
}

.info-feature-item p,
.info-link-tile p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

body.theme-dark .info-feature-item p,
body.theme-dark .info-link-tile p {
  color: var(--muted-dark);
}

.info-link-tile {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, opacity 160ms ease, border-color 160ms ease;
}

.info-link-tile:hover {
  transform: translateY(-1px);
  opacity: 0.96;
}

.info-inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.contact-method-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
}

body.theme-dark .contact-method-card {
  border-color: var(--border-dark);
  background: rgba(255, 255, 255, 0.025);
}

.contact-label {
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

body.theme-dark .contact-label {
  color: var(--muted-dark);
}

.contact-email {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.3;
}

.contact-note {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

body.theme-dark .contact-note {
  color: var(--muted-dark);
}

.info-list {
  margin: 0;
  padding-left: 18px;
}

.info-list li + li {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .info-page-hero,
  .info-page-section {
    padding: 20px 18px;
  }

  .info-feature-grid,
  .info-link-grid {
    grid-template-columns: 1fr;
  }
}

.stack-sm {
  display: grid;
  gap: 10px;
}

.inline-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}


