/* ============================================
   REVERIE — Styles
   Aesthetic: Poetic, dreamy, slightly emo/hipster
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #f8f4ef;
  --bg-secondary: #f0ebe4;
  --bg-accent: #e8ddd4;
  --bg-card: #fffcf8;
  --text-primary: #2c2c2c;
  --text-secondary: #5a5a5a;
  --text-muted: #8a8a8a;
  --text-faint: #b0a89e;
  --accent-mauve: #9b8aa8;
  --accent-blue: #7f95b0;
  --accent-rose: #b88a8a;
  --accent-amber: #c49b6a;
  --accent-lavender: #c4b5d4;
  --border: rgba(0, 0, 0, 0.07);
  --border-light: rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-slow: 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Selection color */
::selection {
  background: var(--accent-lavender);
  color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--accent-mauve);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-rose);
}

/* ---------- Film Grain Overlay ---------- */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ---------- View System ---------- */
.view {
  display: none;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.view.active {
  opacity: 1;
}

/* Each view gets its correct display type */
#view-landing.active {
  display: block;
}

#view-onboarding.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

#view-dashboard.active,
#view-crush.active,
#view-note.active,
#view-browse.active,
#view-profile.active,
#view-settings.active,
#view-signup.active,
#view-signin.active,
#view-forgot-password.active {
  display: block;
}

.view.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

.hidden {
  display: none !important;
}

/* ---------- Navigation ---------- */
#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: rgba(248, 244, 239, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition);
  animation: slideDown 0.6s ease;
}

.nav-logo {
  font-family: 'Bodoni Moda', serif;
  font-size: 24px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-links a {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-mauve);
  transition: width var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-cta {
  background: white;
  color: #1a1a1a !important;
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 15px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  transition: all 0.3s ease;
  border: 1px solid var(--border-light);
}

.nav-cta:hover {
  background: #1a1a1a;
  color: white !important;
}

.nav-cta::after {
  display: none !important;
}

.nav-profile-btn {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.nav-profile-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.nav-dropdown {
  position: fixed;
  top: 64px;
  right: 40px;
  z-index: 101;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 0;
  min-width: 160px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.nav-dropdown a {
  display: block;
  padding: 10px 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: background 0.15s ease;
}

.nav-dropdown a:hover {
  background: rgba(0,0,0,0.03);
  color: var(--text-primary);
}

.nav-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-menu-btn span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--text-primary);
  transition: all var(--transition);
}

#mobile-menu {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(248, 244, 239, 0.95);
  backdrop-filter: blur(20px);
  padding: 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

#mobile-menu a {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 0;
}

/* Prevent background scroll when modals are open */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 36px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--accent-mauve);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent-mauve);
  color: var(--accent-mauve);
}

.btn-danger {
  background: var(--accent-rose);
  color: white;
}

.btn-danger:hover {
  opacity: 0.85;
}

.btn-sm {
  font-size: 13px;
  padding: 10px 24px;
}

.btn-back {
  position: sticky;
  top: 80px;
  z-index: 10;
  margin-bottom: 20px;
  /* Full-width tap row — click anywhere on the line, not just the text */
  display: flex;
  width: 100%;
  border: none;
  background: transparent;
  padding: 14px 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent-mauve);
  border: none;
}

/* ---------- Inputs ---------- */
.text-input {
  width: 100%;
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  outline: none;
  transition: border-color var(--transition);
  resize: none;
}

.text-input::placeholder {
  color: #a39890;
  font-style: italic;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.text-input:focus {
  border-bottom-color: var(--accent-mauve);
}

.text-input-sm {
  font-size: 16px;
  padding: 10px 0;
}

.textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  min-height: 120px;
  line-height: 1.8;
}

.textarea:focus {
  border-color: var(--accent-mauve);
  box-shadow: 0 0 0 3px rgba(155, 138, 168, 0.1);
}

.textarea-sm {
  min-height: 60px;
  font-size: 16px;
  padding: 12px 16px;
}

.select-input {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ---------- Toggle ---------- */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-accent);
  border-radius: 26px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent-mauve);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* ============================================
   LANDING PAGE
   ============================================ */
#view-landing {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.landing-bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  object-fit: cover;
  object-position: center;
}


.landing-content {
  position: absolute;
  top: 48px;
  left: 48px;
  z-index: 1;
  text-align: left;
  animation: fadeInUp 1.2s ease;
}

.landing-title {
  font-family: 'Bodoni Moda', serif;
  font-size: clamp(56px, 8vw, 100px);
  font-weight: 400;
  font-style: italic;
  color: white;
  letter-spacing: -0.03em;
  line-height: 0.9;
  margin-bottom: 12px;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.3);
}

.landing-subtitle {
  font-size: 18px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

.landing-cta {
  position: absolute;
  top: 48px;
  right: 48px;
  z-index: 1;
  animation: fadeInUp 1.8s ease;
}

.btn-cta {
  padding: 12px 28px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: #1a1a1a;
  background: white;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-cta:hover {
  background: #1a1a1a;
  color: white;
}

.btn-cta:active {
  transform: scale(0.97);
}

.landing-poem {
  position: absolute;
  top: 48px;
  left: 32%;
  z-index: 1;
  animation: fadeInUp 1.6s ease;
}

.landing-poem p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-style: italic;
  font-weight: 400;
  color: #e8c170;
  line-height: 1.5;
  text-shadow: 0 0 8px rgba(232, 193, 112, 0.6), 0 0 20px rgba(210, 160, 60, 0.3);
}

.landing-poem-author {
  font-family: 'Cormorant Garamond', serif;
  font-size: 12px;
  font-style: italic;
  color: #d4a84b;
  margin-top: 8px;
  display: block;
  letter-spacing: 0.05em;
  text-shadow: 0 0 8px rgba(212, 168, 75, 0.5), 0 0 16px rgba(210, 160, 60, 0.25);
}

.landing-footer-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.05em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}

/* ============================================
   ONBOARDING
   ============================================ */
#view-onboarding {
  min-height: 100vh;
  padding: 60px 20px;
}

.onboarding-container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.onboarding-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 60px;
}

.progress-bar {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 25%;
  background: var(--accent-mauve);
  border-radius: 2px;
  transition: width var(--transition-slow);
}

.progress-text {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.onboarding-step {
  display: none;
}

.onboarding-step.active {
  display: block;
  animation: fadeInUp 0.6s ease;
}

.step-content {
  text-align: center;
}

.step-eyebrow {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-mauve);
  margin-bottom: 12px;
}

.step-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.2;
}

.step-desc {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.input-group {
  margin-bottom: 32px;
  text-align: left;
}

.onboarding-exit-link {
  display: block;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s ease;
}

.onboarding-exit-link:hover {
  color: var(--text-muted);
}

.upload-skip-hint {
  font-size: 13px;
  color: var(--accent-rose);
  margin-top: 12px;
  animation: fadeIn 0.3s ease;
}

.step-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 24px;
}

.upload-zone:hover {
  border-color: var(--accent-mauve);
  background: rgba(155, 138, 168, 0.04);
}

.upload-zone.drag-over {
  border-color: var(--accent-mauve);
  background: rgba(155, 138, 168, 0.08);
  transform: scale(1.01);
}

.upload-icon {
  color: var(--text-faint);
  margin-bottom: 16px;
}

.upload-text {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.upload-link {
  color: var(--accent-mauve);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.upload-hint {
  font-size: 14px;
  color: var(--text-faint);
  font-style: italic;
}

.upload-preview {
  text-align: center;
  margin-bottom: 24px;
}

.upload-preview img {
  max-width: 300px;
  max-height: 300px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  object-fit: cover;
}

.btn-remove-photo {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  color: var(--accent-rose);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Step 2: Tabs */
.step2-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.step2-tab {
  flex: 1;
  padding: 14px 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.step2-tab:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

.step2-tab.active {
  color: var(--text-primary);
  border-color: var(--text-primary);
  background: rgba(0, 0, 0, 0.03);
}

.step2-tabs-or {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.step2-panel {
  display: none;
}

.step2-panel.active {
  display: block;
}

.generate-panel-desc {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Step 2: Description + optional photo */
.textarea-md {
  min-height: 100px;
  resize: vertical;
  line-height: 1.7;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 15px;
}

.textarea-md:focus {
  border-color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.01);
}

.photo-upload-optional {
  margin-top: 24px;
}

.upload-optional-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.upload-zone-compact {
  padding: 24px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.upload-zone-compact .upload-icon {
  margin-bottom: 0;
}

.upload-zone-compact .upload-text {
  margin-bottom: 0;
  font-size: 14px;
}

.upload-privacy-note {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 8px;
}

/* Portrait style picker */
.portrait-style-picker {
  margin-top: 24px;
  margin-bottom: 8px;
}

.portrait-style-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 8px;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.style-option {
  background: none;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
  text-align: center;
}

.style-option img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.style-option span {
  display: block;
  padding: 8px 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.style-option:hover {
  border-color: var(--text-secondary);
}

.style-option.active {
  border-color: var(--text-primary);
}

.style-option.active span {
  color: var(--text-primary);
  font-weight: 600;
}

/* AI Portrait */
.ai-portrait-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
  margin-bottom: 32px;
}

.portrait-result-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: lowercase;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

.ai-portrait-loading {
  text-align: center;
  padding: 60px 0;
}

.loading-pulse {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-lavender);
  margin: 0 auto 16px;
  animation: pulse 1.5s ease infinite;
}

.ai-portrait-loading p,
.comic-loading p {
  font-size: 16px;
  color: var(--text-muted);
}

.portrait-pair {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  width: 100%;
}

.portrait-choice {
  position: relative;
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 3px solid transparent;
  transition: border-color 0.3s, transform 0.2s;
  width: 100%;
  max-width: 600px;
}

.portrait-choice:hover {
  transform: scale(1.02);
}

.portrait-choice.selected {
  border-color: var(--accent-lavender);
}

.portrait-pair.has-selection .portrait-choice:not(.selected) {
  opacity: 0.35;
  transform: scale(0.97);
}

.portrait-choice img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.portrait-caption {
  font-size: 14px;
  color: var(--text-faint);
  margin-top: 12px;
}

.btn-redo {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: 10px;
  transition: color 0.2s, border-color 0.2s;
}

.btn-redo:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

/* ============================================
   DASHBOARD
   ============================================ */
#view-dashboard {
  padding: 120px 40px 80px;
}

.dashboard-container {
  max-width: 900px;
  margin: 0 auto;
}

.dashboard-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-light);
}

.dashboard-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  overflow: hidden;
  margin-bottom: 12px;
}

.dashboard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard-display-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.dashboard-bio {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  max-width: 400px;
}

.dashboard-stats {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.dashboard-stats strong {
  color: var(--text-primary);
  font-weight: 600;
}

.dashboard-bio-prompt {
  font-size: 14px;
  color: var(--accent-mauve);
  text-decoration: none;
  margin-bottom: 12px;
  transition: opacity 0.2s;
}

.dashboard-bio-prompt:hover {
  opacity: 0.7;
}

.dashboard-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dashboard-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
}

.profile-author-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.profile-author-link:hover {
  opacity: 0.7;
}

.profile-author-card {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
  border-bottom: none;
}

.dashboard-section-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 24px;
}

.section-eyebrow {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-mauve);
  margin-bottom: 8px;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.1;
}

.section-subtitle {
  font-size: 18px;
  font-weight: 300;
  color: var(--text-secondary);
}

.crush-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.crush-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  animation: fadeInScale 0.5s ease;
}

.crush-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-lavender);
}

.crush-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.crush-card-img-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 64px;
  font-style: italic;
  color: rgba(255,255,255,0.8);
}

.crush-card-body {
  padding: 20px;
}

.crush-card-name {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 500;
  font-style: italic;
  margin-bottom: 4px;
}

.crush-card-date {
  font-size: 13px;
  color: var(--text-faint);
}

.crush-card-snippet {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-new-crush {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 32px;
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: var(--text-muted);
  transition: all var(--transition);
  width: 100%;
  justify-content: center;
}

.btn-new-crush:hover {
  border-color: var(--accent-mauve);
  color: var(--accent-mauve);
}

/* ---------- Dashboard Tabs ---------- */
.dashboard-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  gap: 0;
}

.dashboard-tab {
  flex: 0 0 auto;
  padding: 12px 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.dashboard-tab:hover {
  color: var(--text-secondary);
}

.dashboard-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

.dashboard-tab-panel {
  display: none;
}

.dashboard-tab-panel.active {
  display: block;
}

/* ---------- Compose Box ---------- */
.compose-box {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 28px;
}

/* Compose block editor — seamless document feel, no inserters */
.compose-block-editor {
  margin: 0;
  min-height: 48px;
  border: none;
  padding: 0;
}

.compose-block-editor .block-text {
  margin: 0;
  padding: 0;
}

.compose-block-editor .block-text textarea {
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  outline: none;
  resize: none;
  overflow: hidden;
  display: block;
  box-sizing: border-box;
  min-height: 80px !important;
}

.compose-block-editor .block-text textarea::placeholder {
  color: #a39890;
  font-style: italic;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.compose-block-editor .block-image {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 8px 0;
  cursor: grab;
  position: relative;
}

.compose-block-editor .block-image:active {
  cursor: grabbing;
}

.compose-block-editor .block-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Compose toolbar — persistent "Add illustration" button */
.compose-toolbar {
  padding: 8px 0;
}

.compose-add-img-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-mauve);
  background: rgba(155, 138, 168, 0.06);
  border: 1px dashed var(--accent-lavender);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.compose-add-img-btn:hover {
  color: var(--accent-mauve);
  border-color: var(--accent-mauve);
  background: rgba(155, 138, 168, 0.12);
}

.compose-add-img-btn svg {
  flex-shrink: 0;
}

.compose-title-input {
  width: 100%;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-light);
  padding: 8px 0;
  outline: none;
  margin-bottom: 4px;
  transition: border-color 0.2s ease;
}

.compose-title-input::placeholder {
  color: #a39890;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.compose-title-input:focus {
  border-bottom-color: var(--accent-mauve);
}

.compose-body-input {
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
  background: transparent;
  border: none;
  padding: 8px 0 0 0;
  outline: none;
  resize: none;
  min-height: 36px;
  overflow: hidden;
}

.compose-body-input::placeholder {
  color: #a39890;
  font-style: italic;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* Compose body wrapper (for hashtag dropdown positioning) */
.compose-body-wrap {
  position: relative;
}

/* Hashtag autocomplete dropdown */
.hashtag-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 160px;
  overflow-y: auto;
}

.hashtag-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s ease;
}

.hashtag-option:hover,
.hashtag-option.active {
  background: rgba(155, 138, 168, 0.08);
  color: var(--text-primary);
}

.hashtag-option-hash {
  color: var(--accent-mauve);
  font-weight: 600;
}

/* Compose inserter (add illustration) */
.compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* ---------- Notes Feed ---------- */
.notes-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.note-feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  animation: fadeInUp 0.4s ease;
}

.note-feed-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-lavender);
  transform: translateY(-2px);
}

.note-feed-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.note-feed-date {
  font-size: 12px;
  color: var(--text-faint);
  margin-left: auto;
}

.note-draft {
  border-style: dashed;
}

.note-draft-badge {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-mauve);
  border: 1px solid var(--accent-mauve);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
}

.note-feed-title {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.note-feed-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.note-feed-image {
  margin: 12px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.note-feed-image img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  display: block;
}

.note-feed-more {
  display: block;
  font-size: 14px;
  font-style: italic;
  color: var(--accent-mauve);
  padding-top: 4px;
}

/* Crush banner inside note feed cards */
.note-crush-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(201, 160, 160, 0.08), rgba(183, 148, 192, 0.08));
  border-radius: var(--radius-md);
  border: 1px solid rgba(201, 160, 160, 0.15);
}

.note-crush-banner-img {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.note-crush-banner-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.note-crush-banner-info {
  flex: 1;
  min-width: 0;
}

.note-crush-banner-name {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.note-crush-banner-bio {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notes-feed .empty-state {
  padding: 40px 20px;
}

/* ---- Note Detail View ---- */
.note-detail-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 100px 20px 60px;
  position: relative;
}

.note-detail-topbar {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
}

.note-detail-menu-wrap {
  position: absolute;
  right: 20px;
  top: 196px;
}

.note-detail-menu-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.note-detail-menu-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.note-detail-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
}

.note-detail-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.note-detail-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.note-detail-dropdown-danger:hover {
  color: var(--accent-rose);
}

/* Pinterest-style author card in note detail */
.note-detail-author {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 20px;
  margin-bottom: 20px;
}

.note-detail-author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 12px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.note-detail-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.note-detail-author-name {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.note-detail-author-bio {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 320px;
}

.note-detail-date {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 12px;
}

/* Pinterest-style centered author card at bottom of browse notes */
.browse-note-author-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px;
  margin-top: 32px;
}

.browse-note-author-avatar-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.browse-note-author-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.browse-note-author-initial-lg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-style: italic;
  color: var(--text-secondary);
  background: var(--bg-secondary);
}

.browse-note-author-name-centered {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.browse-note-author-bio {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 280px;
  margin-bottom: 8px;
}

.browse-note-author-stats {
  display: flex;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.browse-note-author-stats span + span::before {
  content: '·';
  margin-right: 6px;
}

.note-detail-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.note-detail-crush-tag {
  display: inline-block;
  font-size: 13px;
  color: var(--accent-lavender);
  margin-bottom: 20px;
}

.note-detail-blocks {
  margin-top: 16px;
}

.note-detail-text {
  font-size: 17px;
  line-height: 1.9;
  color: var(--text-secondary);
  white-space: pre-wrap;
  margin-bottom: 16px;
}

.note-detail-image {
  margin: 20px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.note-detail-image img {
  width: 100%;
  max-height: 600px;
  object-fit: cover;
  display: block;
}

.btn-new-crush .plus {
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 18px;
  color: var(--text-faint);
}

/* ============================================
   CRUSH DETAIL
   ============================================ */
#view-crush {
  padding-top: 70px;
}

.crush-detail-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Hero */
.crush-hero {
  position: relative;
  text-align: center;
  padding: 60px 20px 48px;
  margin-bottom: 32px;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.crush-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: blur(40px) saturate(1.2);
  opacity: 0.25;
  transform: scale(1.2);
}

.crush-hero-content {
  position: relative;
  z-index: 1;
}

.crush-portrait-frame {
  width: 180px;
  height: 220px;
  margin: 0 auto 24px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 3px solid rgba(255,255,255,0.5);
}

.crush-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.crush-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.crush-tagline {
  font-size: 18px;
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* Notes Section */
#notes-section {
  margin-top: 32px;
}

.chapters-header, .comic-header {
  margin-bottom: 32px;
}

.chapters-title, .comic-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 4px;
}

.chapters-subtitle, .comic-subtitle {
  font-size: 16px;
  color: var(--text-muted);
}

/* Notes (chapters) */
#new-chapter-btn {
  margin-bottom: 24px;
}

.chapter-editor {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 32px;
  animation: fadeInUp 0.4s ease;
}

.chapter-editor .text-input {
  margin-bottom: 16px;
}

.chapter-editor-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.chapters-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chapter-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  animation: fadeInUp 0.4s ease;
  cursor: pointer;
  transition: all var(--transition);
}

.chapter-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-lavender);
}

.chapter-item-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chapter-number {
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-mauve);
}

.chapter-item-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 400;
  font-style: italic;
  margin-top: 4px;
}

.chapter-item-date {
  font-size: 12px;
  color: var(--text-faint);
}

.chapter-item-body {
  padding: 0 24px 20px;
  display: block;
}

.chapter-item-text {
  font-size: 17px;
  line-height: 1.9;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.chapter-delete {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  opacity: 0;
  transition: opacity var(--transition);
}

.chapter-item:hover .chapter-delete {
  opacity: 1;
}

.chapter-delete:hover {
  color: var(--accent-rose);
}

/* Block Editor */
.block-editor {
  position: relative;
  margin: 20px 0;
  min-height: 120px;
  border: 2px dashed transparent;
  border-radius: var(--radius-md);
  padding: 4px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.block-editor.drag-active {
  border-color: var(--accent-lavender);
  background: rgba(155, 138, 168, 0.03);
}

.block {
  position: relative;
}

/* Drop indicator line shown during drag */
.drop-indicator-line {
  height: 3px;
  background: var(--accent-mauve);
  border-radius: 2px;
  margin: 2px 0;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(155, 138, 168, 0.5);
  animation: dropPulse 1s ease infinite;
}

@keyframes dropPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Drop indicator inside a text block (splits text) */
.block-text {
  position: relative;
}

.block-text .drop-indicator-inline {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-mauve);
  border-radius: 2px;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 10px rgba(155, 138, 168, 0.5);
  animation: dropPulse 1s ease infinite;
}

/* Chapter read-mode drag support */
.chapter-blocks.drag-active {
  background: rgba(155, 138, 168, 0.03);
  border-radius: var(--radius-md);
  border: 2px dashed var(--accent-lavender);
  padding: 8px;
}

.block-text textarea {
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  overflow: hidden;
  padding: 8px 0;
  min-height: 48px;
}

.block-text textarea::placeholder {
  color: #a39890;
  font-style: italic;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.block-image {
  position: relative;
  margin: 8px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: fadeInScale 0.5s ease;
  cursor: grab;
}

.block-image:active {
  cursor: grabbing;
}

.block-image[style*="opacity: 0.4"] {
  outline: 2px dashed var(--accent-mauve);
  outline-offset: 2px;
}

.block-image img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  display: block;
}

.block-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity var(--transition);
}

.block-image:hover .block-image-overlay {
  opacity: 1;
}

.block-image-overlay .btn {
  font-size: 12px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.9);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}

.block-image-overlay .btn:hover {
  background: white;
}

.block-image-overlay .btn-remove {
  background: rgba(184, 138, 138, 0.9);
  color: white;
}

/* Inserter — the "+" that appears between blocks */
.block-inserter {
  position: relative;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.inserter-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--accent-lavender);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.block-inserter:hover .inserter-line,
.block-inserter.active .inserter-line {
  opacity: 0.6;
}

.inserter-btn {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-faint);
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  opacity: 0.4;
}

.block-inserter:hover .inserter-btn,
.block-inserter.active .inserter-btn {
  opacity: 1;
  border-color: var(--accent-lavender);
  color: var(--accent-mauve);
}

.inserter-btn:hover {
  background: var(--accent-mauve);
  color: white;
  border-color: var(--accent-mauve);
  transform: scale(1.1);
}

/* Image generation panel */
.image-gen-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 8px 0;
  animation: fadeInScale 0.3s ease;
  box-shadow: var(--shadow-md);
}

.image-gen-label {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.image-gen-prompt {
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  outline: none;
  margin-bottom: 12px;
  transition: border-color var(--transition);
  resize: vertical;
  line-height: 1.7;
  min-height: 140px;
}

.image-gen-prompt::placeholder {
  color: #a39890;
  font-style: italic;
  font-size: 15px;
  line-height: 1.7;
}

.image-gen-prompt:focus {
  border-color: var(--accent-mauve);
}

.image-gen-choice {
  display: flex;
  gap: 10px;
}

.image-gen-choice .btn {
  flex: 1;
  justify-content: center;
}

.image-gen-actions {
  display: flex;
  gap: 8px;
}

/* Image generation loading */
.image-gen-loading {
  text-align: center;
  padding: 32px 0;
  animation: fadeIn 0.3s ease;
}

.image-gen-loading p {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* Image generation preview (confirm/retry) */
.image-gen-preview {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 8px 0;
  animation: fadeInScale 0.4s ease;
  box-shadow: var(--shadow-md);
}

.image-gen-preview img {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  display: block;
}

.image-gen-preview-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
}

/* Retry prompt in image gen preview */
.image-gen-retry-prompt {
  padding: 12px 16px;
  background: var(--bg-card);
}

.image-gen-retry-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.image-gen-retry-prompt .image-gen-prompt {
  margin-bottom: 0;
}

/* Chapter blocks in read mode */
.chapter-blocks {
  margin-top: 12px;
}

.chapter-block-text {
  font-size: 17px;
  line-height: 1.9;
  color: var(--text-secondary);
  white-space: pre-wrap;
  padding: 4px 0;
}

.chapter-block-image {
  margin: 16px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.chapter-block-image img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  display: block;
}

/* Inserters in read-mode chapters */
.chapter-item .block-inserter {
  height: 24px;
}

.chapter-item .inserter-btn {
  width: 24px;
  height: 24px;
  font-size: 16px;
}

/* ============================================
   BROWSE
   ============================================ */
#view-browse {
  padding: 120px 40px 80px;
}

.browse-container {
  max-width: 1200px;
  margin: 0 auto;
}

.browse-header {
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.browse-header-content {
  flex: 1;
}

.browse-auth-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
}

.browse-auth-buttons.hidden {
  display: none;
}

.browse-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: var(--accent-mauve);
  color: var(--accent-mauve);
}

.filter-btn.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.filter-divider {
  width: 1px;
  height: 20px;
  background: var(--border-light);
  margin: 0 4px;
}

/* Masonry Grid (Pinterest-style) */
.browse-grid {
  columns: 3;
  column-gap: 24px;
}

.browse-loading,
.browse-empty,
.browse-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 16px;
}

.browse-loading {
  color: var(--text-secondary);
}

.browse-load-more {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 14px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  break-inside: avoid;
  width: 100%;
}

.browse-card-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #c9a0a0, #e8c4a0);
}

.browse-card-placeholder span {
  font-family: 'Playfair Display', serif;
  font-size: 64px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.browse-card-name {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.browse-card {
  break-inside: avoid;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  animation: fadeInUp 0.5s ease;
}

.browse-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-lavender);
}

.browse-card-img {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.browse-card-img img {
  width: 100%;
  height: auto;
  min-height: 260px;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}

.browse-card:hover .browse-card-img img {
  transform: scale(1.05);
}

.story-type-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 4px 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 100px;
  z-index: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.story-type-tag.true-story {
  background: rgba(245, 200, 200, 0.9);
  color: #8b4a4a;
}

.story-type-tag.semi-fiction {
  background: rgba(214, 200, 245, 0.9);
  color: #5e4a8b;
}

.story-type-tag.fiction {
  background: rgba(200, 228, 245, 0.9);
  color: #4a6e8b;
}

.browse-card-body {
  padding: 20px;
}

.browse-card-name {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 500;
  font-style: italic;
  margin-bottom: 8px;
}

.browse-card-snippet {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 10;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.browse-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.browse-card-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.browse-card-date {
  margin-left: auto;
}

.browse-card-author {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.browse-card-date {
  font-size: 12px;
  color: var(--text-faint);
}

.browse-card-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.action-btn:hover {
  color: var(--accent-rose);
}

.action-btn.liked {
  color: var(--accent-rose);
}

.action-btn.liked svg {
  fill: var(--accent-rose);
}

/* Text-only browse cards — literary treatment for poetry/prose */
.browse-card--text-only .browse-card-body {
  padding: 28px 26px;
}

.browse-card-prose {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  line-height: 2;
  color: var(--text-primary);
  white-space: pre-line;
  border-left: 2px solid rgba(155, 138, 168, 0.3);
  padding-left: 20px;
  margin-bottom: 16px;
  -webkit-line-clamp: 14;
}


.action-btn.bookmarked svg {
  fill: var(--accent-amber);
  color: var(--accent-amber);
}

.bookmark-btn:hover {
  color: var(--accent-amber);
}

/* ============================================
   PROFILE VIEW
   ============================================ */
#view-profile {
  padding: 100px 40px 80px;
  position: relative;
}

.profile-back-btn {
  margin-bottom: 24px;
}

.profile-container {
  max-width: 680px;
  margin: 0 auto;
}

.profile-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.profile-date {
  font-size: 13px;
  color: var(--text-faint);
}

.profile-meta-top .story-type-tag {
  position: static;
}

.note-detail-content .story-type-tag {
  position: static;
  display: inline-block;
  margin-bottom: 12px;
}

.browse-card-body .story-type-tag {
  position: static;
  display: inline-block;
  margin-bottom: 8px;
}

.profile-hero-img {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.profile-hero-img img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.profile-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 48px 28px 24px;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.25) 60%, transparent 100%);
}

.profile-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  font-style: italic;
  color: rgba(255,255,255,0.8);
}

.profile-name {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 400;
  font-style: italic;
  color: white;
  margin-bottom: 4px;
  line-height: 1.2;
  text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

.profile-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Pinterest-style centered author card */
.profile-author-card-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 20px;
  margin-bottom: 28px;
}

.profile-author-avatar-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 12px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.profile-author-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.profile-author-name {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.profile-author-bio {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 320px;
  margin-bottom: 12px;
}

.profile-author-stats-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.profile-author-stats-row span {
  white-space: nowrap;
}

.profile-author-stats-row span + span::before {
  content: '\00b7';
  margin-right: 6px;
}

.profile-author-stats-row strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* Continuous scroll entries */
.profile-entries {
  margin-bottom: 48px;
}

.profile-entry {
  margin-bottom: 48px;
}

.profile-entry-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.profile-entry-text {
  font-size: 17px;
  line-height: 2;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.profile-entry-image {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: block;
}

/* Story nudge */
.story-nudge {
  padding: 48px 0;
  margin-bottom: 40px;
}

.story-nudge-inner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1118, #1e1520, #1a1118);
  border-radius: 20px;
  padding: 52px 40px;
  text-align: center;
}

.story-nudge-inner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(183, 148, 192, 0.15), transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(201, 160, 160, 0.12), transparent 60%);
  animation: nudgeGlow 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes nudgeGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(5%, -5%); }
}

.story-nudge-text {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
  position: relative;
}

.story-nudge-link {
  position: relative;
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  transition: all 0.3s ease;
}

.story-nudge-link:hover {
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
}

/* Comments */
.comments-section {
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}

.comments-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 20px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.comment-item {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.comment-author {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-mauve);
  margin-bottom: 4px;
}

.comment-text {
  font-size: 16px;
  color: var(--text-secondary);
}

.comment-date {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 6px;
}

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

.comment-form #comment-nickname {
  width: 100%;
}

.comment-form .textarea-sm {
  width: 100%;
}

.comment-form .btn {
  align-self: flex-end;
}

/* ============================================
   SETTINGS
   ============================================ */
#view-settings {
  padding: 120px 40px 80px;
}

.settings-container {
  max-width: 600px;
  margin: 0 auto;
}

.settings-header {
  margin-bottom: 40px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 32px;
  max-width: 480px;
}

.settings-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.settings-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  overflow: hidden;
  flex-shrink: 0;
}

.settings-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-field {
  margin-bottom: 20px;
}

.settings-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

/* ============================================
   AUTH (Sign Up / Sign In / Forgot Password)
   ============================================ */
.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  max-width: 420px;
  margin: 0 auto;
}

.auth-header {
  text-align: center;
  margin-bottom: 40px;
}

.auth-logo {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  margin-bottom: 24px;
  transition: color var(--transition);
}

.auth-logo:hover {
  color: var(--accent-mauve);
}

.auth-eyebrow {
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 12px;
  line-height: 1.6;
}

/* Auth Form */
.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-input-group {
  position: relative;
  width: 100%;
}

.auth-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition);
}

.auth-input {
  width: 100%;
  padding: 16px 16px 16px 52px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.auth-input::placeholder {
  color: var(--text-faint);
  font-style: italic;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent-mauve);
  box-shadow: 0 0 0 3px rgba(155, 138, 168, 0.1);
}

.auth-input:focus + .auth-input-icon,
.auth-input-group:focus-within .auth-input-icon {
  color: var(--accent-mauve);
}

/* Auth Messages */
.auth-error {
  padding: 12px 16px;
  background: rgba(184, 138, 138, 0.1);
  border: 1px solid var(--accent-rose);
  border-radius: var(--radius-sm);
  color: var(--accent-rose);
  font-size: 14px;
  text-align: center;
}

.auth-success {
  padding: 12px 16px;
  background: rgba(127, 149, 176, 0.1);
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius-sm);
  color: var(--accent-blue);
  font-size: 14px;
  text-align: center;
}

/* Forgot Password Link */
.auth-forgot {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  text-align: right;
  transition: color var(--transition);
}

.auth-forgot:hover {
  color: var(--accent-mauve);
}

/* Auth Submit Button */
.auth-submit {
  width: 100%;
  margin-top: 8px;
}

/* Auth Divider */
.auth-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 32px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Social Buttons */
.social-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.social-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
}

.social-btn:hover {
  border-color: var(--accent-mauve);
  background: var(--bg-secondary);
  transform: translateY(-1px);
}

.social-btn svg {
  flex-shrink: 0;
}

/* Provider-specific colors on hover */
.social-btn-google:hover {
  border-color: #4285F4;
}

.social-btn-discord:hover {
  border-color: #5865F2;
}

/* Auth Footer */
.auth-footer {
  margin-top: 32px;
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
}

.auth-footer a {
  color: var(--accent-mauve);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.auth-footer a:hover {
  color: var(--accent-rose);
}

/* ============================================
   MODAL
   ============================================ */
#modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: fadeInScale 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 20px;
}

.modal-comments {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.modal-comment-form {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.modal-comment-form .text-input {
  flex: 1;
}

/* ============================================
   CONFIRM OVERLAY
   ============================================ */
#confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.confirm-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 380px;
  text-align: center;
  animation: fadeInScale 0.2s ease;
  box-shadow: var(--shadow-lg);
}

.confirm-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.confirm-message {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .browse-grid {
    columns: 2;
  }
}

@media (max-width: 768px) {
  #main-nav {
    padding: 16px 20px;
  }

  .nav-links {
    display: none;
  }

  .nav-menu-btn {
    display: flex;
  }

  .landing-content {
    top: 32px;
    left: 24px;
  }

  .landing-poem {
    top: 100px;
    left: 24px;
  }

  .landing-cta {
    top: 24px;
    right: 24px;
  }

  #view-dashboard,
  #view-browse,
  #view-settings {
    padding: 100px 20px 60px;
  }

  .dashboard-tabs {
    gap: 0;
  }

  .dashboard-tab {
    flex: 1;
    text-align: center;
  }

  .crush-grid {
    grid-template-columns: 1fr;
  }

  .browse-grid {
    columns: 1;
  }

  .profile-hero-img img {
    max-height: 320px;
  }

  .profile-name {
    font-size: 26px;
  }

  .nav-dropdown {
    right: 20px;
    top: 56px;
  }

  #mobile-menu {
    padding: 20px 20px;
  }

  /* Onboarding */
  .upload-zone {
    padding: 32px 24px;
  }

  .style-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Crush detail */
  .crush-detail-container {
    padding: 0 20px 60px;
  }

  .crush-hero {
    padding: 40px 16px 32px;
  }

  .crush-portrait-frame {
    width: 140px;
    height: 180px;
  }

  .chapter-editor {
    padding: 20px;
  }

  .chapter-item-header {
    padding: 16px 20px;
  }

  .chapter-item-body {
    padding: 0 20px 16px;
  }

  /* Profile */
  #view-profile {
    padding: 100px 20px 60px;
  }


  .story-nudge {
    padding: 32px 0;
  }

  .story-nudge-inner {
    padding: 40px 28px;
  }

  /* Settings */
  .settings-card {
    padding: 24px;
  }

  .setting-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .comment-form,
  .modal-comment-form {
    flex-direction: column;
  }

  .comic-panel {
    width: 260px;
  }
}

@media (max-width: 480px) {
  /* Nav */
  #main-nav {
    padding: 12px 16px;
  }

  .nav-dropdown {
    right: 16px;
    top: 50px;
  }

  #mobile-menu {
    top: 54px;
    padding: 16px;
  }

  #mobile-menu a {
    font-size: 16px;
  }

  /* Landing */
  .landing-title {
    font-size: 56px;
  }

  .landing-content {
    top: 20px;
    left: 16px;
  }

  .landing-subtitle {
    font-size: 15px;
  }

  .landing-cta {
    top: 16px;
    right: 16px;
  }

  .btn-cta {
    padding: 10px 20px;
    font-size: 14px;
  }

  .landing-poem {
    display: none;
  }

  /* Onboarding */
  #view-onboarding {
    padding: 50px 16px;
  }

  .step-title {
    font-size: 28px;
  }

  .step-desc {
    font-size: 15px;
  }

  .upload-zone {
    padding: 24px 16px;
  }

  .upload-preview img {
    max-width: 100%;
  }

  .style-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .step2-tab {
    padding: 10px 10px;
    font-size: 13px;
  }

  .step2-tabs-or {
    font-size: 11px;
  }

  /* Dashboard */
  .dashboard-tab {
    font-size: 12px;
    padding: 10px 16px;
  }

  .compose-box {
    padding: 16px;
  }

  .compose-title-input {
    font-size: 16px;
  }

  .compose-body-input {
    font-size: 16px;
    min-height: 60px;
  }

  .note-feed-card {
    padding: 16px;
  }

  .note-feed-title {
    font-size: 17px;
  }

  .note-feed-text {
    font-size: 15px;
    line-height: 1.7;
  }

  .note-crush-banner {
    gap: 10px;
    padding: 10px;
    margin-bottom: 12px;
  }

  .note-crush-banner-img {
    width: 60px;
    height: 60px;
  }

  .note-crush-banner-name {
    font-size: 16px;
  }

  .note-crush-banner-bio {
    font-size: 12px;
  }

  /* Crush detail */
  .crush-detail-container {
    padding: 0 16px 40px;
  }

  .crush-hero {
    padding: 32px 12px 24px;
  }

  .crush-portrait-frame {
    width: 120px;
    height: 160px;
    margin-bottom: 16px;
  }

  .crush-name {
    font-size: 36px;
  }

  .crush-tagline {
    font-size: 16px;
  }

  .chapters-title {
    font-size: 22px;
  }

  .chapter-editor {
    padding: 16px;
  }

  .chapter-item-header {
    padding: 14px 16px;
  }

  .chapter-item-body {
    padding: 0 16px 14px;
  }

  .chapter-item-title {
    font-size: 18px;
  }

  .chapter-block-text {
    font-size: 15px;
    line-height: 1.7;
  }

  .block-image img {
    max-height: 300px;
  }

  /* Browse / Feed */
  .section-title {
    font-size: 32px;
  }

  .browse-card-body {
    padding: 16px;
  }

  .browse-card-snippet {
    font-size: 14px;
  }

  /* Profile */
  #view-profile {
    padding: 80px 16px 60px;
  }


  .profile-hero-img img {
    max-height: 240px;
  }

  .profile-name {
    font-size: 22px;
  }

  .profile-entry {
    margin-bottom: 32px;
  }

  .profile-entry-title {
    font-size: 20px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .profile-entry-text {
    font-size: 15px;
    line-height: 1.7;
  }

  .story-nudge {
    padding: 24px 0;
  }

  .story-nudge-inner {
    padding: 32px 20px;
    border-radius: 16px;
  }

  .story-nudge-text {
    font-size: 18px;
  }

  /* Settings */
  .settings-card {
    padding: 20px;
    max-width: 100%;
  }

  .settings-avatar-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .settings-header {
    margin-bottom: 24px;
  }

  /* Modal */
  .modal {
    padding: 20px;
    width: 94%;
  }

  .modal-title {
    font-size: 20px;
  }

  .modal-comments {
    max-height: 200px;
  }

  .modal-comment-form {
    flex-direction: column;
  }

  .comic-panel {
    width: 220px;
  }
}

@media (max-width: 320px) {
  #main-nav {
    padding: 10px 12px;
  }

  .nav-dropdown {
    right: 12px;
    min-width: 140px;
  }

  #view-onboarding {
    padding: 40px 12px;
  }

  .step-title {
    font-size: 24px;
  }

  .style-grid {
    grid-template-columns: 1fr;
  }

  .crush-portrait-frame {
    width: 100px;
    height: 140px;
  }

  .crush-name {
    font-size: 28px;
  }

  .story-nudge-inner {
    padding: 24px 16px;
  }

  .modal {
    padding: 16px;
    width: 96%;
  }
}
