/*
  hs.css — Central stylesheet for HeirStories
  - Palette: warm earth tones (soft golds, parchment beige, muted teal)
  - Accent: deep indigo / burgundy for heritage emphasis
  - Typography: Cormorant Garamond (serif) & Inter (UI sans)

  This file is intentionally small in custom rules and leans on Bulma for
  base components; custom rules are scoped to project-specific classes.
*/

/*@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Lora:wght@400;500&display=swap');*/

/* Common CSS */
@import url("https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css");
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css");

/* Custom CSS */
:root {
   --primary-gold: #d9b56a;
   /* warm soft gold */
   --primary-beige: #f3eddc;
   /* parchment beige */
   --primary-teal: #6aa6a1;
   /* muted teal */
   --accent-deep: #3b1850;
   /* deep indigo / burgundy */
   --muted-gray: #7a7a7a;
}

/* -----------------------------
   Typography & global layout
----------------------------- */
html,
body {
   height: 100%;
}

body {
   padding-top: 3.25rem; /* offset for is-fixed-top navbar */
   scroll-behavior: smooth;
}

.initially-hidden {
  display: none !important;
}

.hero.is-primary {
   background: linear-gradient(135deg, #d8b58a, #9c7a52);
   color: #fff;
}

.logo-shadow {
   box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

/* Keep headings visually strong and heritage-minded */
h1,
h2,
h3 {
   color: var(--accent-deep);
}

/* -----------------------------
   Buttons & small component overrides
   Prefer Bulma classes where possible
   ----------------------------- */
.cta-button {
   background: var(--primary-gold);
   color: #fff;
   border-radius: 8px;
}

/* subtle card lift — Bulma provides base card */
.card {
   border-radius: 12px;
}

.card:hover {
   transform: translateY(-2px);
   box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

/* compact plan badge */
.plan-badge {
   display: inline-block;
   padding: .35rem 1rem;
   border-radius: 20px;
   font-weight: 600;
}


.plan-story,
.plan-storyteller {
   background: #e8f4fd;
   color: #1a6fa8;
}

.plan-family {
   background: var(--primary-gold);
   color: #000;
}

.plan-legacy {
   background: var(--accent-deep);
   color: #fff;
}

/* Inputs: keep a gentle, warm focus ring */
.input,
.textarea {
   border-radius: 8px;
   border: 1.5px solid #ececec;
}

.input:focus,
.textarea:focus {
   border-color: var(--primary-teal);
   box-shadow: 0 0 0 3px rgba(106, 166, 161, 0.07);
}

.toggle-container {
   display: inline-flex;
   align-items: center;
   gap: 15px;
}

.toggle-label {
   font-weight: 500;
   color: #4a4a4a;
   font-size: 0.95rem;
}

.toggle-switch {
   position: relative;
   display: inline-block;
   width: 60px;
   height: 25px;
   cursor: pointer;
}

.toggle-switch input {
   opacity: 0;
   width: 0;
   height: 0;
}

.toggle-slider {
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background-color: lightgray;
   transition: 0.3s;
   border-radius: 30px;
}

.toggle-slider:before {
   position: absolute;
   content: "";
   height: 22px;
   width: 22px;
   left: 1px;
   bottom: 1px;
   background-color: darkslategray;
   transition: 0.3s;
   border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
   background-color: #48c774;
}

.toggle-switch input:checked+.toggle-slider:before {
   transform: translateX(30px);
}

.toggle-switch input:focus+.toggle-slider {
   box-shadow: 0 0 1px #878788;
}

/* -----------------------------
   Profile / avatar / layout helpers
   ----------------------------- */
.profile-container {
   padding: 2rem 1rem;
   max-width: 1200px;
   margin: 0 auto;
}

.profile-header {
   background: #fff;
   border-radius: 16px;
   padding: 1.5rem;
   margin-bottom: 1.5rem;
   display: flex;
   gap: 1.25rem;
   align-items: center;
   box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.profile-avatar {
   position: relative;
}

.avatar-img {
   width: 120px;
   height: 120px;
   border-radius: 50%;
   object-fit: cover;
   border: 3px solid var(--accent-deep);
}

.avatar-placeholder {
   width: 120px;
   height: 120px;
   border-radius: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 2.4rem;
   color: #fff;
   font-weight: 700;
   background: linear-gradient(135deg, var(--primary-beige), var(--primary-gold));
   border: 3px solid var(--accent-deep);
}

.upload-btn {
   position: absolute;
   right: 0;
   bottom: 0;
   width: 36px;
   height: 36px;
   border-radius: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
   background: linear-gradient(135deg, var(--primary-beige), var(--primary-gold));
   color: #fff;
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.profile-info h2 {
   font-size: 1.75rem;
   margin-bottom: .25rem;
}

.profile-meta {
   display: flex;
   gap: 1.25rem;
   color: var(--muted-gray);
}

/* Collapsible profile sections */
details.card summary::-webkit-details-marker { display: none; }
details.card summary .fa-chevron-down { transition: transform 0.2s ease; }
details.card[open] summary .fa-chevron-down { transform: rotate(180deg); }

/* User lists */
.user-list {
   max-height: 300px;
   overflow: auto;
}

.user-item {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 1rem;
   border-bottom: 1px solid #f4f4f4;
}

.user-item:hover {
   background: #fbfaf8;
}


.tag {
   border-radius: 6px;
   font-weight: 600;
}

.empty-state {
   text-align: center;
   padding: 2.5rem 1rem;
   color: var(--muted-gray);
}

/* -----------------------------
   Modals, notifications, plan cards
   ----------------------------- */
.modal-card {
   border-radius: 12px;
   overflow: hidden;
}

.modal-card-head {
   background: linear-gradient(135deg, var(--primary-beige), var(--accent-deep));
   color: #fff;
}

.modal-large {
   width: 90%;
   max-width: 920px;
}

.plan-option {
   border: 2px solid #eee;
   border-radius: 12px;
   padding: 1.25rem;
   cursor: pointer;
}

.plan-option.selected {
   border-color: var(--accent-deep);
   background: rgba(59, 24, 80, 0.03);
}

.plan-price {
   font-size: 2rem;
   font-weight: 700;
   color: var(--accent-deep);
}

.plan-features li {
   padding: .45rem 0;
   display: flex;
   gap: .5rem;
   align-items: center;
}

.plan-features i {
   color: var(--primary-teal);
}


/* Force these to override Bulma color classes */
.notification {
   border-radius: 8px;
   opacity: 0;
   transition: opacity 0.4s ease, transform 0.4s ease;
   transform: translateY(-10px);
}

.notification.show {
   opacity: 1 !important;
   transform: translateY(0) !important;
}

.notification.hide {
   opacity: 0 !important;
   transform: translateY(-10px) !important;
}

.notification .delete {
   background-color: rgba(255, 255, 255, 0.7) !important;
}

.notification.is-danger .delete:hover {
   background-color: white !important;
}


.notification-badge {
  position: relative;
  display: inline-block; /* Important for proper positioning */
}

.notification-badge .badge {
  position: absolute;
  top: -1px;  /* Negative value to move it up */
  right: -3px; /* Negative value to move it to the right edge */
  min-width: 20px;
  height: 20px;
  padding: 5px 7px;
  border-radius: 50%;
  background: hsl(348, 100%, 61%);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 10; /* Ensures it appears above other elements */
}

@keyframes slideIn {
   from {
      opacity: 0;
      transform: translateY(-8px);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}



.panel-hidden {
   display: none;
}

/* -----------------------------
   Page-specific small helpers
   ----------------------------- */
#fileInput {
   display: none;
}

.plan-meta {
   margin-top: 1rem;
}

.card-header .card-header-action {
   margin: .5rem;
}

.stat-row {
   display: flex;
   justify-content: space-between;
   margin-bottom: 1rem;
}

.story-box {
   min-height: 280px;
   background: #fffdf9;
}

.story-text {
   font-size: 1.05rem;
   line-height: 1.7;
}

.small-box {
   max-width: 540px;
   margin: 1.5rem auto;
}

/* -----------------------------
   Story Timeline — Chapter items
   ----------------------------- */
.timeline-chapter-item {
   border-radius: 8px;
   margin-bottom: 0.5rem;
   padding: 0.6rem 0.75rem;
   cursor: pointer;
   transition: all 0.2s ease;
   border-left: 3px solid transparent;
   background: #fafaf7;
}

.timeline-chapter-item:hover {
   background: rgba(217, 181, 106, 0.12);
   border-left-color: var(--primary-gold);
}

.timeline-chapter-item.active {
   border-left-color: var(--primary-teal);
   background: rgba(106, 166, 161, 0.08);
   box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.timeline-chapter-btn {
   cursor: pointer;
   width: 100%;
}

/* Chapter Limit Bar
   ----------------------------- */
.chapter-limit-bar {
  margin-top: 0.75rem;
  padding: 0.5rem 0;
}
.chapter-limit-bar .progress {
  height: 0.4rem;
  border-radius: 2px;
}
.chapter-limit-bar .progress::-webkit-progress-value {
  background-color: var(--primary-gold);
}
.chapter-limit-bar .progress.is-warning::-webkit-progress-value {
  background-color: #ffdd57;
}
.chapter-limit-bar .progress.is-danger::-webkit-progress-value {
  background-color: #f14668;
}

/* Add Chapter FAB
   ----------------------------- */
.add-chapter-fab-wrap {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #e8e0cc;
}

.add-chapter-fab {
  background: transparent;
  border: 1px dashed var(--primary-gold);
  color: var(--primary-gold);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.15s, color 0.15s;
}

.add-chapter-fab:hover {
  background: rgba(217, 181, 106, 0.1);
  border-color: var(--primary-gold);
  color: var(--primary-gold);
}

.add-chapter-form {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #faf8f2;
  border: 1px solid #e8e0cc;
  border-radius: 6px;
}

.add-chapter-form .label {
  color: var(--accent-deep);
}

/* Timeline sidebar — flex column so chapter list scrolls but FAB/media stay visible */
.timeline-sidebar {
  border-right: 1px solid #f0ede6;
  padding-right: 0.5rem;
  display: flex;
  flex-direction: column;
}

#story-timeline {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Chapter header badges */
.chapter-badge {
   display: inline-block;
   padding: 0.15rem 0.6rem;
   border-radius: 12px;
   font-size: 0.7rem;
   font-weight: 600;
}

.badge-draft { background: #f5f5f5; color: #888; }
.badge-inprogress { background: #fff3cd; color: #856404; }
.badge-completed { background: #d4edda; color: #155724; }
.badge-released { background: #cce5ff; color: #004085; }

.badge-private { background: #f5f5f5; color: #888; }
.badge-collaborators { background: #e8daef; color: #6c3483; }
.badge-readers { background: #d5f5e3; color: #1e8449; }
.badge-public { background: #d6eaf8; color: #2874a6; }

/* Chapter metadata panel */
#chapter-meta-panel {
   border: 1px solid #f0ede6;
   border-radius: 8px;
   padding: 1rem;
   background: #fefdfb;
}

/* Auto-save indicator */
#autosave-indicator {
   animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
   from { opacity: 0; transform: translateY(4px); }
   to { opacity: 1; transform: translateY(0); }
}


/* Contribute / Read user list items */
.user-item.active {
   background: linear-gradient(90deg, rgba(217, 181, 106, 0.15), rgba(106, 166, 161, 0.1));
   border-left: 3px solid var(--primary-teal);
}

.user-avatar-sm {
   width: 36px;
   height: 36px;
   border-radius: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
   color: #fff;
   font-weight: 700;
   font-size: 0.8rem;
   background: linear-gradient(135deg, var(--primary-beige), var(--primary-gold));
   flex-shrink: 0;
}


/* -----------------------------
   Sidebar layout (authenticated)
   ----------------------------- */
.hs-layout {
    display: flex;
    min-height: calc(100vh - 3.25rem);
}

.hs-sidebar {
    position: fixed;
    top: 3.25rem;
    left: 0;
    bottom: 0;
    width: 220px;
    background: #fff;
    border-right: 1px solid #f0ede6;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.25s ease;
    z-index: 28;
    display: flex;
    flex-direction: column;
}

.hs-sidebar.is-collapsed {
    width: 52px;
}

.hs-sidebar-nav {
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.hs-sidebar-top {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.hs-sidebar-bottom {
    padding-bottom: 0.5rem;
}

.hs-sidebar-sep {
    border: none;
    border-top: 1px solid #f0ede6;
    margin: 0.5rem 0.75rem;
}

.hs-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    color: #4a4a4a;
    border-radius: 8px;
    margin: 0.15rem 0.5rem;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.hs-sidebar-item .icon {
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
}

.hs-sidebar-item:hover {
    background: rgba(217, 181, 106, 0.12);
    color: var(--accent-deep);
}

.hs-sidebar-item.is-active {
    background: rgba(106, 166, 161, 0.12);
    color: var(--primary-teal);
    font-weight: 600;
    border-left: 3px solid var(--primary-teal);
    padding-left: calc(1rem - 3px);
}

.hs-nav-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.hs-sidebar-label {
    transition: opacity 0.2s ease, width 0.2s ease;
    overflow: hidden;
}

.hs-sidebar.is-collapsed .hs-sidebar-label {
    opacity: 0;
    width: 0;
}

.hs-main {
    flex: 1;
    min-width: 0;
    transition: margin-left 0.25s ease;
}

/* Desktop: push content right to clear sidebar */
@media screen and (min-width: 1024px) {
    body.has-sidebar .hs-main { margin-left: 220px; }
    body.has-sidebar.sidebar-collapsed .hs-main { margin-left: 52px; }
    /* Nav links live in sidebar on desktop — hide them from the top navbar */
    body.has-sidebar #navbarStart { display: none; }
}

/* Mobile/tablet: sidebar hidden, use burger menu */
@media screen and (max-width: 1023px) {
    .hs-sidebar { display: none; }
}

/* -----------------------------
   Landing page — feature & how-it-works cards
   ----------------------------- */
.feature-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-radius: 12px;
    padding: 1.5rem;
    background: #fffdf9;
    border-top: 3px solid var(--primary-beige);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.feature-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.07);
    border-top-color: var(--primary-gold);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: var(--primary-gold);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    margin: 0 auto;
}

/* Scroll-triggered fade-in */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* -----------------------------
   Story Preview Carousel
   ----------------------------- */

/* Life-stage tab pills */
.story-stage-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.story-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: 1.5px solid var(--primary-beige);
    background: #fff;
    color: var(--muted-gray);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.story-tab:hover {
    border-color: var(--primary-gold);
    color: var(--accent-deep);
}

.story-tab.is-active {
    background: var(--primary-gold);
    border-color: var(--primary-gold);
    color: #fff;
    font-weight: 700;
}

/* Dot indicator */
.story-dots {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.story-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d0ccc5;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.story-dot.is-active {
    background: var(--primary-gold);
    transform: scale(1.3);
}

/* -----------------------------
   userStory — Memory Spark & engagement
   ----------------------------- */

/* Guided Writing Block (replaces old Memory Spark) */
.guided-writing-block {
  background: rgba(217, 181, 106, 0.08);
  border-left: 3px solid var(--primary-gold);
  border-radius: 6px;
  padding: 1rem 1.2rem;
}

.guided-writing-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-deep);
  margin-bottom: 0.25rem;
}

.guided-writing-subtext {
  font-size: 0.8rem;
  color: var(--muted-gray);
  margin-bottom: 0.75rem;
}

.guided-prompt-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.guided-prompt-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid rgba(217, 181, 106, 0.4);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.guided-prompt-card:hover {
  border-color: var(--primary-gold);
  box-shadow: 0 1px 4px rgba(217, 181, 106, 0.25);
}

.guided-prompt-text {
  font-size: 0.82rem;
  color: var(--accent-deep);
  flex: 1;
  margin-right: 0.75rem;
}

.guided-use-btn {
  flex-shrink: 0;
}

/* Example answer expandable hint */
.guided-example {
  border-top: 1px solid rgba(217, 181, 106, 0.2);
  padding-top: 0.5rem;
}

.guided-example summary {
  cursor: pointer;
  user-select: none;
}

.guided-example-body {
  background: #fffdf5;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  border: 1px dashed rgba(217, 181, 106, 0.3);
}

/* First save success state */
.first-save-success {
  background: rgba(72, 199, 142, 0.08);
  border-left: 3px solid #48c78e;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  animation: fadeInSuccess 0.3s ease;
}

@keyframes fadeInSuccess {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* AI nudge suppression for empty chapters */
.ai-toolbar.ai-nudge-suppressed .ai-buy-credits-btn,
.ai-toolbar.ai-nudge-suppressed #ai-upgrade-btn {
  display: none;
}

/* Mobile: stack prompt cards vertically */
@media (max-width: 768px) {
  .guided-prompt-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .guided-prompt-text {
    margin-right: 0;
  }
  .guided-use-btn {
    align-self: flex-end;
  }
}

/* Life-stage icon bubble in chapter sidebar */
.chapter-stage-icon {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-beige), var(--primary-gold));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--accent-deep);
  flex-shrink: 0;
}

/* Hints box gold accent */
#llm-hints-box {
  border-left: 4px solid var(--primary-gold);
}

/* ============================================================
   PRICING PAGE
   ============================================================ */

/* ── Page wrapper ── */
.pricing-page {
  background: var(--primary-beige);
  min-height: 100vh;
}

/* ── Hero ── */
.pricing-hero {
  padding: 3.5rem 1.5rem 2rem;
  background: linear-gradient(160deg, #f3eddc 0%, #fff 100%);
}

/* ── Billing toggle ── */
.pricing-toggle-label {
  font-size: 0.95rem;
  color: var(--muted-gray);
  transition: color 0.2s;
}
.pricing-toggle-label.is-active {
  color: var(--accent-deep);
  font-weight: 600;
}

.pricing-toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}
.pricing-toggle-switch input { opacity: 0; width: 0; height: 0; }
.pricing-toggle-slider {
  position: absolute; inset: 0;
  background: #ccc;
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.25s;
}
.pricing-toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
}
.pricing-toggle-switch input:checked + .pricing-toggle-slider { background: var(--primary-teal); }
.pricing-toggle-switch input:checked + .pricing-toggle-slider::before { transform: translateX(22px); }

/* ── Plan cards ── */
.pricing-card {
  background: #fff;
  border-radius: 12px;
  border: 2px solid #e8e0d0;
  padding: 2rem 1.75rem 1.75rem;
  position: relative;
  transition: box-shadow 0.2s, border-color 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.pricing-card:hover {
  box-shadow: 0 8px 32px rgba(59,24,80,0.1);
  border-color: var(--primary-gold);
}
.pricing-card--highlight {
  border-color: var(--primary-teal);
  box-shadow: 0 6px 28px rgba(106,166,161,0.18);
}
.pricing-card--current {
  border-color: var(--primary-gold);
}

/* Ribbon badge */
.pricing-card-ribbon {
  position: absolute;
  top: -1px; right: 1.25rem;
  background: var(--primary-teal);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.75rem;
  border-radius: 0 0 8px 8px;
  text-transform: uppercase;
}
.pricing-card-ribbon--current { background: var(--primary-gold); color: var(--accent-deep); }

/* Plan badge overrides */
.tag.plan-story,
.tag.plan-storyteller { background: #e8f4fd;            color: #1a6fa8;            font-weight: 700; }
.tag.plan-family      { background: var(--primary-gold); color: var(--accent-deep); font-weight: 700; }
.tag.plan-legacy      { background: var(--accent-deep);  color: #fff;               font-weight: 700; }

/* Price display */
.pricing-price { margin: 0.75rem 0; line-height: 1.2; }
.pricing-price-amount {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent-deep);
}
.pricing-price-period { font-size: 1rem; color: var(--muted-gray); }
.pricing-price-note { font-size: 0.78rem; color: var(--muted-gray); margin-top: 0.1rem; }

.pricing-card-desc { font-size: 0.88rem; min-height: 2.4rem; }
.pricing-card-bestfor { font-weight: 500; }

/* Feature list on card */
.pricing-card-features {
  list-style: none;
  margin: 1.25rem 0 1.5rem;
  padding: 0;
  flex: 1;
}
.pricing-card-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid #f0ede6;
}
.pricing-card-feature:last-child { border-bottom: none; }
.pricing-card-feature-value {
  margin-left: auto;
  font-weight: 600;
  color: var(--accent-deep);
  white-space: nowrap;
}
.pricing-feature-icon { color: var(--primary-teal); }

.pricing-card-cta { margin-top: auto; }

/* ── Value display helpers ── */
.pricing-check { color: var(--primary-teal); font-weight: 700; }
.pricing-dash  { color: #bbb; }
.pricing-unlimited { color: var(--primary-teal); font-weight: 600; font-size: 0.9em; }

/* ── Comparison table ── */
.comparison-table-container {
  max-height: 600px;
  overflow-y: auto;
}
.pricing-comparison-table {
  background: #fff;
  border-radius: 10px;
  font-size: 0.9rem;
}
.pricing-comparison-table thead th {
  background: var(--accent-deep);
  color: #fff;
  text-align: center;
  padding: 0.9rem 1rem;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}
.pricing-comparison-table thead th:first-child {
  text-align: left;
}
.pricing-comparison-table thead .tag.plan-legacy {
  background: var(--primary-gold);
  color: var(--accent-deep);
}
.pricing-table-feature-col { min-width: 200px; }
.pricing-table-category-row td {
  background: #f5f0e8;
  color: var(--accent-deep);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.55rem 1rem;
}
.pricing-comparison-table tbody tr:hover td { background: rgba(217,181,106,0.07); }

/* ── FAQ ── */
.pricing-faq { border-top: 1px solid #e8e0d0; }
.pricing-faq-item {
  border-bottom: 1px solid #e8e0d0;
  padding: 0;
}
.pricing-faq-item summary {
  padding: 1rem 0.25rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--accent-deep);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pricing-faq-item summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--primary-teal);
  transition: transform 0.2s;
}
.pricing-faq-item[open] summary::after { content: '−'; }
.pricing-faq-item p {
  padding: 0 0.25rem 1rem;
  color: #555;
  font-size: 0.93rem;
  line-height: 1.6;
}

/* ── Profile upgrade modal — compact plan cards ── */
.plan-price-amount { font-size: 1.8rem; font-weight: 700; color: var(--accent-deep); }
.plan-price-sub    { font-size: 0.9rem; color: var(--muted-gray); }

.plan-features-modal {
  list-style: none;
  margin: 0;
  padding: 0;
}
.plan-feature-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid #f0ede6;
}
.plan-feature-row:last-child { border-bottom: none; }
.plan-feature-val  { margin-left: auto; font-weight: 600; }
.plan-feature-icon { color: var(--primary-teal); font-size: 0.78rem; }

/* =============================================================================
   PUBLIC STORIES PAGE & REGISTERED READER – stories-page, story cards, reader
   ============================================================================= */

/* ── Stories page shell ─────────────────────────────────────────────────────── */
.stories-page {
  min-height: 100vh;
}

/* ── Hero ───────────────────────────────────────────────────────────────────── */
.stories-hero {
  background: linear-gradient(135deg, #2c1a4e 0%, #3b2460 50%, #1a3050 100%);
  padding: 4rem 1.5rem 3.5rem;
  color: #fff;
}
.stories-hero--compact {
  padding: 2.5rem 1.5rem 2rem;
}
.stories-hero-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.75rem;
}
.stories-hero-title { color: #fff !important; }
.stories-hero-sub   { color: rgba(255,255,255,0.8) !important; }

/* ── Search bar ─────────────────────────────────────────────────────────────── */
.stories-search-wrap {
  max-width: 520px;
  margin: 0 auto;
}
.stories-search-input { border-radius: 2rem !important; }

.stories-count {
  font-size: 0.85rem;
  text-align: center;
}

/* ── Stories card grid ──────────────────────────────────────────────────────── */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ── Story card ─────────────────────────────────────────────────────────────── */
.story-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  outline: none;
}
.story-card:hover,
.story-card:focus {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
}
.story-card:focus-visible { box-shadow: 0 0 0 3px var(--primary-teal); }

/* Left accent stripe */
.story-card-accent {
  position: absolute;
  top: 0; left: 0;
  width: 5px;
  height: 100%;
  border-radius: 12px 0 0 12px;
}

.story-card-body {
  padding: 1.25rem 1.25rem 0.75rem 1.5rem;
  flex: 1;
}

.story-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.story-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
  font-weight: 500;
}
.story-tag--period   { background: #ede9f5; color: #5a3d8a; }
.story-tag--location { background: #e6f4f0; color: #2d7a6a; }

.story-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 0.5rem;
  line-height: 1.35;
}

.story-card-brief {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem 1rem 1.5rem;
  border-top: 1px solid #f3f3f3;
  margin-top: 0.5rem;
}

.story-card-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.story-card-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.story-card-avatar-img    { width: 100%; height: 100%; object-fit: cover; }
.story-card-avatar-initials {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-size: 0.7rem; font-weight: 700; color: #fff;
}

.story-card-author-name { font-size: 0.82rem; color: #444; font-weight: 500; }
.story-card-readtime    { font-size: 0.75rem; color: #999; white-space: nowrap; }

/* ── Author groups (reading list view) ─────────────────────────────────────── */
.stories-author-groups { display: flex; flex-direction: column; gap: 2.5rem; }

.stories-author-group {}

.stories-group-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #ede9f5;
}

.stories-group-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.stories-group-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.stories-group-avatar-initials {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  background: var(--accent-deep); color: #fff;
  font-size: 1rem; font-weight: 700;
}

.stories-group-name  { font-size: 1.05rem; font-weight: 700; color: #1a1a2e; }
.stories-group-count { font-size: 0.8rem; margin-left: 0.5rem; }

.stories-group-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* ── Empty state ────────────────────────────────────────────────────────────── */
.stories-empty-state {
  text-align: center;
  padding: 4rem 1rem;
}
.stories-empty-icon  { font-size: 3.5rem; color: #d0cfe8; display: block; margin-bottom: 1rem; }
.stories-empty-title { font-size: 1.15rem; font-weight: 600; color: #444; margin-bottom: 0.5rem; }

/* ── Callout strip ──────────────────────────────────────────────────────────── */
.stories-callout {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #faf7ff;
  border: 1px solid #e5dff5;
  border-radius: 12px;
  padding: 1.5rem;
  flex-wrap: wrap;
}
.stories-callout-icon {
  font-size: 2rem;
  color: var(--accent-deep);
  flex-shrink: 0;
}
.stories-callout > div { flex: 1; min-width: 200px; }
.stories-callout-section { padding-top: 0 !important; }

/* =============================================================================
   READER OVERLAY
   ============================================================================= */

/* Prevent body scroll while reader is open */
body.reader-open { overflow: hidden; }

.reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #faf8f4;   /* warm parchment */
  display: flex;
  flex-direction: column;
  animation: readerSlideIn 0.25s ease;
}
/* Ensure the HTML `hidden` attribute can close the overlay despite display:flex */
.reader-overlay[hidden] { display: none !important; }

@keyframes readerSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Progress bar ───────────────────────────────────────────────────────────── */
.reader-progress-track {
  height: 4px;
  background: #e8e4db;
  flex-shrink: 0;
}
.reader-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-teal);
  transition: width 0.1s linear;
}

/* ── Toolbar ────────────────────────────────────────────────────────────────── */
.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #ede9e0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  flex-shrink: 0;
  min-height: 52px;
  gap: 1rem;
}

.reader-toolbar-left,
.reader-toolbar-right { flex: 1; }
.reader-toolbar-right { display: flex; justify-content: flex-end; align-items: center; gap: 0.25rem; }
.reader-toolbar-center {
  flex: 2;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: #444;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.reader-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: #555;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.reader-close-btn:hover { background: #f3f0eb; color: #222; }
.reader-close-label { font-weight: 500; }

.reader-font-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  color: #666;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
}
.reader-font-btn:hover:not(:disabled) { background: #f0ede8; color: #222; }
.reader-font-btn:disabled             { opacity: 0.35; cursor: default; }
.reader-font-sm { font-size: 0.85rem; font-weight: 600; }
.reader-font-lg { font-size: 1.2rem; font-weight: 700; }
.reader-font-divider {
  display: inline-block;
  width: 1px; height: 18px;
  background: #ddd;
  margin: 0 0.15rem;
}

/* ── Scroll area ────────────────────────────────────────────────────────────── */
.reader-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── Content wrap (centered, readable width) ────────────────────────────────── */
.reader-content-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* ── Loading state ──────────────────────────────────────────────────────────── */
.reader-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.reader-loading-inner {
  text-align: center;
  color: #aaa;
}
.reader-loading-icon {
  display: block;
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  animation: readerPulse 1.4s ease-in-out infinite;
}
@keyframes readerPulse {
  0%,100% { opacity: 0.4; } 50% { opacity: 1; }
}

/* ── Author strip ───────────────────────────────────────────────────────────── */
.reader-author-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #ede9e0;
}
.reader-author-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.reader-author-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.reader-author-avatar span {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  color: #fff; font-weight: 700; font-size: 1rem;
}
.reader-author-info   { display: flex; flex-direction: column; }
.reader-author-name   { font-weight: 700; font-size: 0.98rem; color: #222; }
.reader-author-label  { font-size: 0.78rem; color: #999; margin-top: 0.1rem; }

/* ── Chapter header ─────────────────────────────────────────────────────────── */
.reader-chapter-header { margin-bottom: 1.5rem; }

.reader-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.reader-chapter-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.reader-chapter-meta {
  font-size: 0.82rem;
  color: #999;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.reader-meta-sep { color: #ccc; }

/* ── Brief / intro block ────────────────────────────────────────────────────── */
.reader-brief {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.15rem;
  font-style: italic;
  color: #5a4a7a;
  line-height: 1.75;
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--primary-teal);
}

/* ── Ornamental divider ─────────────────────────────────────────────────────── */
.reader-divider {
  text-align: center;
  color: #c8c0b5;
  font-size: 1.2rem;
  margin: 2rem 0;
  user-select: none;
}

/* ── Body text ──────────────────────────────────────────────────────────────── */
.reader-body {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.2rem;  /* overridden by JS font-size control */
  line-height: 2;
  color: #2d2d2d;
}
.reader-body p {
  margin-bottom: 1.4em;
  text-align: justify;
}

/* ── End of chapter ─────────────────────────────────────────────────────────── */
.reader-end {
  text-align: center;
  padding-top: 3rem;
  border-top: 1px solid #ede9e0;
  margin-top: 3rem;
}
.reader-end-ornament { font-size: 1.1rem; color: #b0a898; letter-spacing: 0.3em; margin-bottom: 0.5rem; }
.reader-end-text     { font-size: 0.9rem; color: #aaa; font-style: italic; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .reader-content-wrap    { padding: 1.5rem 1rem 4rem; }
  .reader-chapter-title   { font-size: 1.65rem; }
  .reader-close-label     { display: none; }
  .reader-toolbar-center  { font-size: 0.8rem; }
  .stories-callout        { flex-direction: column; text-align: center; }
}

/* ── AI Toolbar ─────────────────────────────────────────────────────────────── */
.ai-toolbar {
  background: linear-gradient(135deg, #fffdf5 0%, #fff8e1 100%);
  border: 1px solid #f0e0a0;
  border-radius: 8px;
}

.ai-toolbar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.ai-tool-btn {
  border-color: #d4a800;
  color: #7a5c00;
  background: #fff;
  transition: background 0.15s, color 0.15s;
}
.ai-tool-btn:hover {
  background: #fff8d6;
  border-color: #b8940a;
  color: #5a4200;
}

.ai-credit-cost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d4a800;
  color: #fff;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 1.2rem;
  padding: 0 0.3rem;
  margin-left: 0.2rem;
  line-height: 1.4;
}

.ai-credits-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #fff8d6;
  border: 1px solid #d4a800;
  border-radius: 20px;
  padding: 0.1rem 0.6rem;
  color: #7a5c00;
  font-weight: 600;
  cursor: default;
}

.ai-buy-credits-btn {
  border-color: #d4a800 !important;
  color: #7a5c00 !important;
  font-weight: 600;
}
.ai-buy-credits-btn:hover {
  background: #d4a800 !important;
  color: #fff !important;
}

.ai-credit-cost--included {
  background: var(--primary-teal);
  color: #fff;
}

/* ── AI Pass Cards (pricing page) ───────────────────────────────────────────── */
.ai-pass-card {
  border: 2px solid #f0e0a0;
  border-radius: 12px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.ai-pass-card:hover {
  box-shadow: 0 6px 24px rgba(212, 168, 0, 0.18);
  transform: translateY(-3px);
}
.ai-pass-card.is-featured {
  border-color: #d4a800;
  box-shadow: 0 4px 20px rgba(212, 168, 0, 0.2);
}

.ai-pass-features {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  font-size: 0.85rem;
  color: #555;
}
.ai-pass-features li {
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ── Credit Pack Cards (pricing page) ───────────────────────────────────────── */
.credit-pack-card {
  border: 1px solid #e8e0cc;
  border-radius: 10px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.credit-pack-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.09);
  transform: translateY(-2px);
}

/* ── Index page ──────────────────────────────────────────────────────────────── */
body { background-color: #fdfaf6; color: #2e2e2e; }

.hero-eyebrow { letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }
.hero-title { color: #fff; font-size: clamp(2rem,5vw,3.5rem); line-height: 1.2; }
.hero-subtitle { color: rgba(255,255,255,0.88); max-width: 580px; margin-left: auto; margin-right: auto; }
.hero-cta { font-weight: 700; padding-left: 2rem; padding-right: 2rem; }

.hook-section { padding-bottom: 2rem; }

.step-icon-gold  { font-size: 2rem; color: var(--primary-gold); }
.step-icon-teal  { font-size: 2rem; color: var(--primary-teal); }
.step-icon-deep  { font-size: 2rem; color: var(--accent-deep); }

.feature-icon-gold { color: var(--primary-gold); font-size: 1.6rem; }
.feature-icon-teal { color: var(--primary-teal); font-size: 1.6rem; }
.feature-icon-deep { color: var(--accent-deep); font-size: 1.6rem; }
.purple-heart       { color: var(--accent-deep); }

.story-chapter-label { text-transform: uppercase; letter-spacing: 0.08em; }
.story-text-area { min-height: 5rem; }
.story-play-row { gap: 0.75rem; }

.story-image-wrap { border-radius: 12px; overflow: hidden; transition: opacity 0.5s ease; }
.story-image-fit  { object-fit: cover; width: 100%; height: 100%; }

.gen-bridge-icon    { font-size: 3rem; color: var(--primary-gold); }

.final-cta-title    { color: #fff; }
.final-cta-subtitle { color: rgba(255,255,255,0.85); }
.final-cta-btn      { background: #fff; color: var(--accent-deep); font-weight: 700; }
.final-fine-print   { color: rgba(255,255,255,0.6); }

.memorial-learn-more { color: var(--primary-teal); }
.memorial-learn-more:hover { color: var(--accent-deep); }

.memorial-interactive-box { border: 2px solid var(--primary-gold); }
.memorial-feature-list { list-style: none; padding-left: 0; }
.memorial-feature-list li { padding: 0.3rem 0; font-size: 0.9rem; }

.index-footer           { background: #2e2e2e; color: #ccc; padding: 2.5rem 1.5rem; }
.index-footer-brand     { color: #fff; font-weight: 700; font-size: 1.1rem; }
.index-footer-link      { color: #ccc; }
.index-footer-link:hover { color: #fff; }
.index-footer-copyright { color: #888; }

/* ── Shared utilities ────────────────────────────────────────────────────────── */
.icon-gold { color: var(--primary-gold); }

/* ── pricing.html ────────────────────────────────────────────────────────────── */
.pricing-badge-spacer { height: 1.5rem; }

#aiCreditsSection,
#aiPassesSection {
  display: flex;
  flex-direction: column;
}

#aiCreditsSection .columns,
#aiPassesSection .columns {
  flex: 1;
}

.pricing-ai-table {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.9rem;
}
.pricing-ai-table thead th {
  background: var(--accent-deep);
  color: #fff;
  padding: 0.9rem 1rem;
  font-weight: 600;
}
.pricing-ai-table thead th:first-child { text-align: left; }
.pricing-ai-table thead th:nth-child(2) { text-align: center; min-width: 90px; }
.pricing-ai-table tbody td { padding: 0.65rem 1rem; vertical-align: middle; }
.pricing-ai-table tbody td:nth-child(2) { text-align: center; font-weight: 600; color: var(--primary-teal); }
.pricing-ai-table tbody tr:nth-child(even) td { background: #faf7f2; }
.pricing-ai-table tbody tr:hover td { background: rgba(217,181,106,0.07); }
.price-gold                 { color: var(--primary-gold); }

/* ── userStory.html ──────────────────────────────────────────────────────────── */
.privacy-notice       { max-width: 600px; margin: 0 auto 1rem; }
.progress-wrap        { max-width: 500px; margin: 0 auto; }
.textarea-wrapper     { position: relative; }
.chapter-textarea     { min-height: 350px; resize: vertical; padding-bottom: 3rem; }
.textarea-actions     { position: absolute; bottom: 0.75rem; right: 0.75rem; display: flex; gap: 0.5rem; z-index: 2; }
.ai-result-modal-card { max-width: 700px; width: 95%; }
.ai-result-pre        { white-space: pre-wrap; font-family: inherit; font-size: 0.9rem; }
.ai-wizard-modal-card    { max-width: 600px; width: 95%; }
.location-prompt-card    { max-width: 480px; width: 90%; }
.location-prompt-card .modal-card-head   { background: var(--primary-beige); border-bottom: 2px solid var(--primary-gold); }
.location-prompt-card .modal-card-title  { color: var(--accent-deep); font-size: 1rem; }
.location-prompt-card .modal-card-body   { background: var(--primary-beige); }
.location-prompt-card .modal-card-foot   { background: var(--primary-beige); border-top: 1px solid var(--primary-gold); }

/* ── userContribute.html ─────────────────────────────────────────────────────── */
.contribute-textarea { min-height: 250px; resize: vertical; }

/* ── _navbar.html ────────────────────────────────────────────────────────────── */
.navbar-sidebar-toggle { background: none; border: none; cursor: pointer; }

/* ── Speech recognition language selector ───────────────────────────────────── */
.mic-lang-row    { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.4rem; }
.mic-lang-select { font-size: 0.72rem; padding: 0.15rem 0.3rem; border: 1px solid #ddd;
                   border-radius: 4px; background: #fff; color: #555; cursor: pointer;
                   max-width: 160px; }
.mic-lang-label  { font-size: 0.72rem; color: var(--muted-gray); white-space: nowrap; }

/* ── Site-wide footer (base.html) ────────────────────────────────────────────── */
.site-footer      { padding: 0.75rem 1.5rem; text-align: center; font-size: 0.75rem;
                    color: #aaa; border-top: 1px solid #f0f0f0; background: #fafafa; }
.site-footer-link { color: #aaa; }
.site-footer-link:hover { color: #555; }

/* ── Error pages (404 / 500) ─────────────────────────────────────────────────── */
.error-page-icon      { display: inline-block; font-size: 5rem; color: #ddd; }

/* ── Chapter photo strip ─────────────────────────────────────────────────────── */
.chapter-photo-section { border-top: 1px solid #f0f0f0; padding-top: 0.75rem; }
.chapter-photo-strip   { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.chapter-photo-thumb   { position: relative; width: 72px; height: 72px; border-radius: 6px;
                         overflow: hidden; border: 1px solid #e0e0e0; flex-shrink: 0; }
.chapter-photo-thumb img       { width: 100%; height: 100%; object-fit: cover; display: block; }
.chapter-photo-thumb .photo-del { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.55);
                                   color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px;
                                   font-size: 0.6rem; cursor: pointer; display: flex;
                                   align-items: center; justify-content: center; }
.chapter-photo-add    { display: flex; align-items: center; justify-content: center;
                        width: 72px; height: 72px; border-radius: 6px; border: 2px dashed #ccc;
                        color: #bbb; cursor: pointer; font-size: 1.2rem; flex-shrink: 0; }
.chapter-photo-add:hover { border-color: var(--primary-gold); color: var(--primary-gold); }

/* ── publicMemorial.html ─────────────────────────────────────────────────────── */
.memorial-hero        { background: linear-gradient(135deg, var(--accent-deep) 0%, #5a2870 100%);
                        padding: 3rem 1.5rem 2.5rem; color: #fff; }
.memorial-hero-inner  { display: flex; flex-wrap: wrap; align-items: center;
                        gap: 1.5rem; max-width: 860px; margin: 0 auto; }
.memorial-hero-text   { flex: 1 1 260px; }
.memorial-hero-text .title,
.memorial-hero-text .memorial-dates { color: #fff; }
.memorial-hero-text .memorial-dates { font-size: 0.95rem; opacity: 0.85; }
.memorial-hero-text .has-text-grey-dark { color: rgba(255,255,255,0.85) !important; }
.memorial-avatar-wrap  { flex-shrink: 0; }
.memorial-avatar-img   { width: 90px; height: 90px; border-radius: 50%;
                          object-fit: cover; border: 3px solid rgba(255,255,255,0.4); display: block; }
.memorial-avatar-initials { width: 90px; height: 90px; border-radius: 50%;
                             display: flex; align-items: center; justify-content: center;
                             background: rgba(255,255,255,0.15); color: #fff;
                             font-size: 2rem; font-weight: 700; }
.memorial-share-wrap  { margin-left: auto; }
.memorial-chapters    { display: flex; flex-direction: column; gap: 2rem; }
.memorial-chapter     { border-bottom: 1px solid #f0ece4; padding-bottom: 1.5rem; }
.memorial-chapter:last-child { border-bottom: none; }
.memorial-chapter-header  { margin-bottom: 0.5rem; }
.memorial-chapter-meta    { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; }
.memorial-chapter-text    { color: #444; line-height: 1.75; white-space: pre-wrap; }
.memorial-chapter-media   { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.memorial-media-item      { flex: 0 0 auto; max-width: 280px; }
.memorial-media-img       { width: 100%; border-radius: 8px; object-fit: cover;
                            max-height: 220px; display: block; }
.memorial-media-video     { width: 100%; border-radius: 8px; max-height: 280px; display: block; }
.memorial-media-caption   { margin-top: 0.25rem; text-align: center; }
@media screen and (max-width: 768px) {
  .memorial-media-item    { max-width: 100%; flex: 1 1 100%; }
  .memorial-media-img     { max-height: 300px; }
}
.memorial-cta-box     { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem;
                        background: var(--primary-beige); border-radius: 12px;
                        padding: 1.5rem 2rem; }
.memorial-cta-icon    { font-size: 2rem; color: var(--primary-gold); }

/* ── Notification bell ───────────────────────────────────────────────────────── */
.hs-notif-wrap        { position: relative; }
.hs-notif-btn         { display: flex; align-items: center; justify-content: center;
                        padding: 0 0.75rem; height: 52px; color: #555; cursor: pointer;
                        position: relative; text-decoration: none; }
.hs-notif-btn:hover   { color: var(--accent-deep); }
.hs-notif-badge       { position: absolute; top: 8px; right: 6px;
                        background: #e84b4b; color: #fff; border-radius: 99px;
                        font-size: 0.6rem; font-weight: 700; min-width: 16px; height: 16px;
                        display: flex; align-items: center; justify-content: center;
                        padding: 0 3px; }
.hs-notif-dropdown    { position: absolute; right: 0; top: 52px; width: 300px;
                        background: #fff; border: 1px solid #eee; border-radius: 8px;
                        box-shadow: 0 4px 16px rgba(0,0,0,0.1); z-index: 200; }
.hs-notif-header      { display: flex; justify-content: space-between; align-items: center;
                        padding: 0.75rem 1rem 0.5rem; border-bottom: 1px solid #f0f0f0;
                        font-size: 0.85rem; }
.hs-notif-list        { max-height: 320px; overflow-y: auto; }
.hs-notif-item        { padding: 0.65rem 1rem; border-bottom: 1px solid #f9f9f9; }
.hs-notif-item.is-unread { background: #fdf7ee; }
.hs-notif-msg         { font-size: 0.82rem; color: #333; margin: 0; }
.hs-notif-time        { font-size: 0.72rem; color: #aaa; margin: 0.2rem 0 0; }
.hs-notif-empty       { padding: 1rem; font-size: 0.82rem; color: #aaa; text-align: center; }

/* ── Onboarding banner (userStory.html) ──────────────────────────────────────── */
.onboarding-banner    { position: relative; background: var(--primary-beige);
                        border: 1px solid #e8dfc6; border-radius: 10px;
                        padding: 1.25rem 1.5rem 1rem; margin-bottom: 1.25rem; }
.onboarding-dismiss-btn { position: absolute; top: 0.75rem; right: 0.75rem; }
.onboarding-step-icon { color: var(--primary-gold); }
.onboarding-check     { display: block; margin-top: 0.25rem; font-size: 0.85rem; }

/* ── About page step icons ───────────────────────────────────────────────────── */
.about-step-icon      { color: var(--primary-gold); background: var(--primary-beige);
                        border-radius: 50%; width: 4rem; height: 4rem;
                        display: inline-flex; align-items: center; justify-content: center; }

/* ── Locked mic button (Voice Dictation — paid feature gate) ────────────────── */
#mic-btn.hs-mic-locked {
  opacity: 0.55;
  cursor: pointer;          /* pointer so the click-to-pricing handler is obvious */
  position: relative;
}
/* Tiny lock badge overlaid on the bottom-right of the button */
#mic-btn.hs-mic-locked::after {
  content: '\f023';         /* fa-lock unicode */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.55rem;
  position: absolute;
  bottom: 2px;
  right: 2px;
  color: var(--primary-gold, #c9a84c);
  background: #fff;
  border-radius: 50%;
  padding: 1px 2px;
  line-height: 1;
}

/* =============================================================================
   HELP OVERLAY
   ============================================================================= */

body.help-overlay-open { overflow: hidden; }

.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  animation: helpFadeIn 0.2s ease;
}
.help-overlay[hidden] { display: none !important; }

.help-overlay-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── Tooltip card ──────────────────────────────────────────────────────────── */
.help-tooltip {
  position: absolute;
  width: 320px;
  max-width: calc(100vw - 2rem);
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 8px 32px rgba(59, 24, 80, 0.22);
  border-left: 4px solid var(--primary-gold);
  z-index: 10002;
  transition: top 0.2s ease, left 0.2s ease;
}
.help-tooltip[hidden] { display: none !important; }

.help-tooltip-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent-deep);
}
.help-tooltip-title { font-size: 0.95rem; }

.help-tooltip-desc {
  font-size: 0.88rem;
  color: var(--muted-gray);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.help-tooltip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.help-tooltip-counter {
  font-size: 0.78rem;
  color: var(--muted-gray);
}
.help-tooltip-nav {
  display: flex;
  gap: 0.5rem;
}

.help-tooltip-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

/* ── Fallback info card (hidden elements) ──────────────────────────────────── */
.help-info-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  max-width: calc(100vw - 2rem);
  background: var(--primary-beige);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 8px 32px rgba(59, 24, 80, 0.25);
  z-index: 10002;
}
.help-info-card[hidden] { display: none !important; }

.help-info-card .help-info-icon {
  color: var(--primary-gold);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
.help-info-card .help-info-title {
  display: block;
  color: var(--accent-deep);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.help-info-card .help-info-desc {
  font-size: 0.88rem;
  color: var(--muted-gray);
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* ── Highlight ring on target element ──────────────────────────────────────── */
.help-highlight-ring {
  outline: 3px solid var(--primary-gold) !important;
  outline-offset: 4px;
  border-radius: 4px;
  position: relative;
  z-index: 10001;
}

@keyframes helpFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Admin Panel (scoped under .admin-panel)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Login page ──────────────────────────────────────────────────────────── */
.admin-login-page {
  background: linear-gradient(160deg, var(--primary-beige) 0%, var(--accent-deep) 100%);
  min-height: 100vh;
}
.admin-login-box {
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(59, 24, 80, 0.18);
}
.admin-login-logo {
  height: 40px;
  width: auto;
  max-height: none;
}
.admin-login-subtitle {
  font-size: 0.85rem;
  color: var(--muted-gray);
  margin-top: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.admin-login-btn {
  background: var(--accent-deep);
  color: var(--primary-beige);
  border: none;
  font-weight: 600;
}
.admin-login-btn:hover {
  background: var(--primary-gold);
  color: var(--accent-deep);
}
.admin-login-back-link {
  font-size: 0.85rem;
  color: var(--muted-gray);
}
.admin-login-back-link:hover {
  color: var(--accent-deep);
}

/* ── Admin navbar ────────────────────────────────────────────────────────── */
.admin-panel { padding-top: 3.25rem; }

.admin-navbar {
  background: var(--accent-deep) !important;
}
.admin-navbar .navbar-item,
.admin-navbar .navbar-burger span {
  color: var(--primary-beige);
}
.admin-nav-label {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
}
.admin-role-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Section tabs ────────────────────────────────────────────────────────── */
.admin-tabs-wrapper {
  background: var(--primary-beige);
  border-bottom: 1px solid var(--primary-gold);
  padding-top: 0.25rem;
}
.admin-section-tabs a {
  color: var(--muted-gray);
  font-size: 0.85rem;
  font-weight: 500;
}
.admin-section-tabs li.is-active a {
  color: var(--accent-deep);
  border-bottom-color: var(--accent-deep);
  font-weight: 700;
}
.admin-section-tabs a:hover {
  color: var(--accent-deep);
  border-bottom-color: var(--primary-gold);
}

/* ── Admin content area ──────────────────────────────────────────────────── */
.admin-content {
  min-height: calc(100vh - 10rem);
  background: var(--primary-beige);
}

/* ── Admin footer ────────────────────────────────────────────────────────── */
.admin-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.78rem;
  color: var(--muted-gray);
  border-top: 1px solid var(--primary-gold);
  background: var(--primary-beige);
}

/* ── Admin dashboard ──────────────────────────────────────────────────────── */
.admin-metric-card {
  border-left: 3px solid var(--primary-gold);
}
.admin-metric-card .heading {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-gray);
  margin-bottom: 0.4rem;
}
.admin-metric-value {
  color: var(--accent-deep);
}
/* Hidden panels (shared across all admin tab sections) */
.admin-activity-panel.is-hidden,
.admin-revenue-panel.is-hidden,
.admin-ai-panel.is-hidden,
.admin-detail-panel.is-hidden { display: none; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.admin-panel .table { font-size: 0.88rem; }
.admin-panel .table th {
  color: var(--accent-deep);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.admin-panel .table td { vertical-align: middle; }

/* ── Primary gold button ─────────────────────────────────────────────────── */
.admin-panel .is-primary-gold,
.admin-panel .button.is-primary-gold {
  background: var(--primary-gold);
  color: var(--accent-deep);
  border-color: var(--primary-gold);
  font-weight: 600;
}
.admin-panel .is-primary-gold:hover,
.admin-panel .button.is-primary-gold:hover {
  background: var(--accent-deep);
  color: var(--primary-beige);
  border-color: var(--accent-deep);
}

/* ── Search bars & filter rows ───────────────────────────────────────────── */
.admin-panel .field.has-addons .input {
  border-color: var(--primary-gold);
}
.admin-panel .field.has-addons .input:focus {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 2px rgba(59, 24, 80, 0.1);
}

/* ── User detail tabs ────────────────────────────────────────────────────── */
.admin-detail-tabs a {
  color: var(--muted-gray);
  font-size: 0.88rem;
  font-weight: 500;
}
.admin-detail-tabs li.is-active a {
  color: var(--accent-deep);
  border-bottom-color: var(--accent-deep);
  font-weight: 700;
}
.admin-detail-tabs a:hover {
  color: var(--accent-deep);
  border-bottom-color: var(--primary-gold);
}

/* ── Plan badge colours ──────────────────────────────────────────────────── */
.admin-panel .tag.plan-story,
.admin-panel .tag.plan-storyteller {
  background: var(--primary-teal);
  color: #fff;
}
.admin-panel .tag.plan-family {
  background: var(--primary-gold);
  color: var(--accent-deep);
}
.admin-panel .tag.plan-legacy {
  background: var(--accent-deep);
  color: var(--primary-beige);
}

/* ── Content moderation ──────────────────────────────────────────────────── */
.admin-row-flagged {
  background: rgba(255, 56, 96, 0.06) !important;
}
.admin-row-flagged td {
  border-bottom-color: rgba(255, 56, 96, 0.15);
}

/* ── Support queue cards ─────────────────────────────────────────────────── */
.admin-support-card {
  transition: border-left-color 0.2s;
  border-left: 3px solid transparent;
}
.admin-support-new {
  border-left-color: var(--primary-gold);
}
.admin-support-message {
  max-height: 120px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.02);
  padding: 0.75rem;
  border-radius: 4px;
  line-height: 1.5;
}
.admin-support-response {
  background: rgba(106, 166, 161, 0.08);
  padding: 0.75rem;
  border-radius: 4px;
  border-left: 2px solid var(--primary-teal);
}

/* ── Config page inactive product row ────────────────────────────────────── */
.admin-panel .table tr.has-text-grey-light td {
  opacity: 0.6;
}

/* ── Modal polish ────────────────────────────────────────────────────────── */
.admin-panel .modal-card-head {
  background: var(--accent-deep);
}
.admin-panel .modal-card-title {
  color: var(--primary-beige);
  font-weight: 600;
}
.admin-panel .modal-card-head .delete {
  background: rgba(255, 255, 255, 0.3);
}
.admin-panel .modal-card-foot {
  background: #faf8f3;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.admin-panel .pagination-link.is-current {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: var(--primary-beige);
}
.admin-panel .pagination-link:hover {
  border-color: var(--primary-gold);
  color: var(--accent-deep);
}

/* ── Notification container (admin) ──────────────────────────────────────── */
.admin-panel .notification {
  font-size: 0.88rem;
  padding: 0.75rem 2rem 0.75rem 1rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  min-width: 280px;
  margin-bottom: 0.5rem;
}

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.admin-panel .breadcrumb a {
  color: var(--primary-teal);
}
.admin-panel .breadcrumb li.is-active a {
  color: var(--accent-deep);
  font-weight: 600;
}

/* ── Responsive adjustments ──────────────────────────────────────────────── */
@media screen and (max-width: 768px) {
  .admin-tabs-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .admin-section-tabs ul {
    flex-wrap: nowrap;
  }
  .admin-section-tabs li {
    flex-shrink: 0;
  }
  .admin-content {
    padding: 1rem 0.75rem;
  }
  .admin-panel .columns.is-vcentered {
    gap: 0.25rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEIR DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */

.heir-account-header {
  border-left: 4px solid var(--primary-gold);
}

.heir-avatar-initials {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-deep);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
}

.heir-choice-card {
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.heir-choice-card:hover {
  border-color: var(--primary-teal);
  box-shadow: 0 2px 8px rgba(106, 166, 161, 0.2);
}

.heir-choice-card.heir-choice-active {
  border-color: var(--primary-gold);
  box-shadow: 0 2px 12px rgba(217, 181, 106, 0.3);
}

/* =============================================================================
   PAST-DUE / PAYMENT OVERDUE BANNER
   ============================================================================= */
.hs-past-due-banner {
  background: linear-gradient(90deg, #fff3cd 0%, #ffeeba 100%);
  border-bottom: 2px solid var(--primary-gold);
  padding: 0.75rem 1.25rem;
  margin-top: 52px;          /* push below fixed navbar */
  z-index: 30;
  position: relative;
}
.hs-past-due-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.9rem;
  color: #856404;
}
.hs-past-due-content .icon {
  color: #856404;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.hs-past-due-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}
/* When banner is present, push main content down so nothing hides behind it */
.hs-past-due-banner + .hs-layout { margin-top: 0; }

/* end of hs.css */