/* styles.css — Talk Journal Web App */

:root {
  --navy:      #0D1F3C;
  --navy-dark: #091729;
  --blue:      #2E86AB;
  --gold:      #C9A84C;
  --white:     #FFFFFF;
  --light:     #C8D8E8;
  --text-dark: #111111;
  --text-mid:  #444444;
  --text-light: #888888;
  --serif: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  --sans:  'Calibri', 'Segoe UI', Helvetica, Arial, sans-serif;
  --radius: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--serif);
  background: #f5f5f0;
  color: var(--text-dark);
  min-height: 100vh;
}

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

/* ── Header / Nav bar ──────────────────────────────────────────────────── */
.nav-bar {
  background: var(--navy);
  color: var(--white);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 16px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--gold);
}
.nav-bar .nav-title {
  text-align: center;
}
.nav-bar a:last-child,
.nav-bar .nav-auth {
  justify-self: end;
}
.nav-bar .nav-title {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--white);
}
.nav-bar .nav-title span { color: var(--blue); }
.nav-bar .nav-back {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  justify-self: start;
}
.nav-bar .nav-auth,
.home-nav-bar .nav-auth {
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--sans);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.5px;
}
.nav-bar .nav-auth:hover,
.home-nav-bar .nav-auth:hover { background: var(--gold); color: var(--navy); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-user-email {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--light);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 400px) {
  .nav-user-email { display: none; }
}

/* ── Home Screen ───────────────────────────────────────────────────────── */
.home-screen {
  background: var(--navy);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.home-gold-bar {
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 0 auto 28px;
}

.home-title {
  font-family: var(--serif);
  font-size: clamp(72px, 18vw, 110px);
  font-weight: bold;
  color: var(--white);
  line-height: 1;
  letter-spacing: -2px;
}

.home-subtitle-word {
  font-family: var(--serif);
  font-size: clamp(22px, 6vw, 36px);
  color: var(--blue);
  letter-spacing: 8px;
  margin-top: 4px;
}

.home-rule-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 20px auto;
  width: 80%;
  max-width: 320px;
}
.home-rule { height: 2px; background: var(--blue); }

.home-tagline {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--light);
  letter-spacing: 0.5px;
  margin-bottom: 48px;
}

.home-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 300px;
}

.home-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  text-align: center;
}
.home-btn:hover { opacity: 0.88; }
.home-btn-primary   { background: var(--gold);  color: var(--navy); }
.home-btn-secondary { background: var(--blue);  color: var(--white); }
.home-btn-outline   { background: transparent; color: var(--gold); border: 1px solid var(--gold); }

.home-footer {
  margin-top: 48px;
  font-family: var(--sans);
  font-size: 11px;
  color: #3a5070;
  letter-spacing: 1px;
}

/* ── Browse Screen ─────────────────────────────────────────────────────── */
.page-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 0 80px;
}

.section-group { border-bottom: 1px solid #ddd; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--white);
  cursor: pointer;
  user-select: none;
}
.section-header:hover { background: #f8f8f5; }

.section-num {
  font-family: var(--sans);
  font-size: 10px;
  color: var(--text-light);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.section-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: bold;
  color: var(--navy);
}
.section-chevron {
  font-size: 16px;
  color: var(--gold);
  transition: transform 0.2s;
}
.section-header.open .section-chevron { transform: rotate(90deg); }

.topic-list { display: none; background: #fafaf7; }
.topic-list.open { display: block; }

.topic-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px 13px 32px;
  border-top: 1px solid #eee;
  cursor: pointer;
  transition: background 0.1s;
}
.topic-item:hover { background: #f0f0e8; }
.topic-item-title {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--text-dark);
}
.topic-item-arrow { color: var(--blue); font-size: 14px; }

/* ── Search Screen ─────────────────────────────────────────────────────── */
.search-wrap {
  padding: 16px 20px;
  background: var(--white);
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 52px;
  z-index: 90;
}
.search-input {
  width: 100%;
  padding: 10px 16px;
  border: 2px solid var(--light);
  border-radius: 24px;
  font-family: var(--serif);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--blue); }

.search-results { padding: 8px 0; }
.search-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-light);
  font-family: var(--sans);
  font-size: 14px;
}

.search-result-item {
  padding: 14px 20px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.1s;
}
.search-result-item:hover { background: #f8f8f5; }
.search-result-title {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--navy);
  font-weight: bold;
}
.search-result-section {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
  letter-spacing: 0.5px;
}

/* ── Topic Screen ──────────────────────────────────────────────────────── */
.topic-breadcrumb {
  background: var(--navy);
  color: #aaaaaa;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.8px;
  padding: 10px 20px;
  text-transform: uppercase;
}

.topic-header {
  padding: 20px 20px 0;
  background: var(--white);
}
.topic-header h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 7vw, 42px);
  color: var(--text-dark);
  font-weight: bold;
  line-height: 1.1;
}
.topic-rule {
  height: 3px;
  background: var(--text-dark);
  margin: 14px 0 0;
}

.topic-body { padding: 0 20px 20px; background: var(--white); }

.ref-section { margin-top: 20px; }

.ref-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: bold;
  color: var(--text-light);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 8px;
}

.ref-link {
  display: block;
  padding: 7px 0 7px 16px;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
  transition: color 0.15s;
}
.ref-link:hover { color: var(--navy); }
.ref-link:last-child { border-bottom: none; }
.ref-text { /* non-linked ref */
  display: block;
  padding: 7px 0 7px 16px;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--text-dark);
}

.gc-block {
  margin-top: 4px;
  padding-left: 16px;
}
.gc-speaker {
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  color: var(--text-mid);
}
.gc-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: bold;
  color: var(--navy);
  margin-top: 2px;
}
.gc-date {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}
.gc-link-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 14px;
  background: var(--blue);
  color: var(--white);
  font-family: var(--sans);
  font-size: 12px;
  border-radius: var(--radius);
  letter-spacing: 0.3px;
}
.gc-link-btn:hover { background: var(--navy); }

.extra-block {
  margin-top: 8px;
  padding: 10px 16px;
  background: #f5f0e8;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.extra-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: bold;
  color: var(--gold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.extra-note {
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  color: var(--text-mid);
  margin-top: 3px;
}

/* ── Floating Notes Button (FAB) ───────────────────────────────────────── */
.notes-fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 200;
  transition: transform 0.15s, box-shadow 0.15s;
}
.notes-fab:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.notes-fab-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2ecc71;
  border: 2px solid var(--gold);
}

/* ── Notes Overlay ─────────────────────────────────────────────────────── */
.notes-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s;
}
.notes-overlay.visible { opacity: 1; }

/* ── Notes Panel (slide-up sheet) ──────────────────────────────────────── */
.notes-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 78vh;
  max-height: 640px;
  background: var(--white);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
.notes-panel.open {
  transform: translateY(0);
}

.notes-panel-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #ddd;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.notes-panel-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 10px 16px 10px;
  border-bottom: 1px solid #eee;
  gap: 12px;
  flex-shrink: 0;
}

.notes-panel-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: bold;
  color: var(--navy);
  text-align: center;
  letter-spacing: 0.5px;
}

.notes-panel-mic {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 20px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.notes-panel-mic:hover  { background: var(--blue); }
.notes-panel-mic.active {
  background: #c0392b;
  animation: pulse-mic 1.2s ease-in-out infinite;
}
@keyframes pulse-mic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(192,57,43,0); }
}

.notes-panel-close {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: color 0.15s;
  line-height: 1;
}
.notes-panel-close:hover { color: var(--navy); }

.notes-panel-textarea {
  flex: 1;
  width: 100%;
  padding: 16px 20px;
  border: none;
  outline: none;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-dark);
  resize: none;
  background: #fdfdf9;
  /* Lined paper effect — offset matches padding-top so text sits on each line */
  background-image: repeating-linear-gradient(
    transparent,
    transparent 27px,
    #e8e8e0 28px
  );
  background-size: 100% 28px;
  background-position: 0 16px;
  background-attachment: local;
}

.notes-panel-footer {
  padding: 8px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid #eee;
  flex-shrink: 0;
  min-height: 36px;
}
.notes-save-status {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-light);
}

/* ── My Additional Scriptures ──────────────────────────────────────────── */
.my-scriptures-section { margin-top: 20px; }

.my-refs-list { margin-bottom: 4px; }

.my-ref-item {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
}
.my-ref-item:last-child { border-bottom: none; }

.my-ref-link {
  flex: 1;
  border-bottom: none !important;
}
.my-ref-item .ref-text { flex: 1; }

.my-ref-remove {
  background: none;
  border: none;
  color: #ccc;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 8px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.my-ref-remove:hover { color: #c0392b; }

.my-refs-add {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #ddd;
}
.my-refs-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font-family: var(--serif);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.my-refs-input:focus { border-color: var(--blue); }
.my-refs-btn {
  padding: 8px 14px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.my-refs-btn:hover { background: var(--blue); }

/* ── Print button in notes panel ───────────────────────────────────────── */
.notes-panel-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.notes-panel-print {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.notes-panel-print:hover { color: var(--navy); }

/* ── Print View (screen: hidden; print: shown) ─────────────────────────── */
#print-view { display: none; }

@media print {
  /* Hide everything except the print view */
  body > *:not(#print-view) { display: none !important; }
  #print-view {
    display: block !important;
    font-family: Georgia, 'Times New Roman', serif;
    color: #111;
    padding: 0;
    margin: 0;
  }

  .pv-header {
    border-bottom: 3px solid #111;
    padding-bottom: 12px;
    margin-bottom: 18px;
  }
  .pv-brand {
    font-size: 10px;
    letter-spacing: 3px;
    color: #888;
    margin-bottom: 6px;
  }
  .pv-breadcrumb {
    font-size: 10px;
    letter-spacing: 1px;
    color: #888;
    font-family: Arial, sans-serif;
    margin-bottom: 4px;
  }
  .pv-title {
    font-size: 28px;
    font-weight: bold;
    line-height: 1.1;
  }

  .pv-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 28px;
  }
  .pv-notes-section {
    grid-column: 1 / -1;  /* full width */
    border-top: 2px solid #111;
    padding-top: 14px;
    margin-top: 6px;
  }

  .pv-section { break-inside: avoid; }
  .pv-label {
    font-family: Arial, sans-serif;
    font-size: 8px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #888;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
    margin-bottom: 6px;
  }
  .pv-refs { display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .pv-ref {
    font-size: 13px;
    color: #111;
  }
  .pv-ref-custom { font-style: italic; }

  .pv-gc-speaker { font-size: 12px; font-style: italic; color: #555; }
  .pv-gc-title   { font-size: 13px; font-weight: bold; margin-top: 2px; }
  .pv-gc-date    { font-size: 11px; color: #888; font-family: Arial, sans-serif; margin-top: 2px; }
  .pv-extra      { font-size: 13px; font-style: italic; color: #555; }

  .pv-notes-text {
    font-size: 13px;
    line-height: 1.9;
    min-height: 200px;
    /* lined guide */
    background-image: repeating-linear-gradient(transparent, transparent 24px, #ddd 25px);
    padding-bottom: 8px;
  }

  .pv-footer {
    margin-top: 16px;
    font-family: Arial, sans-serif;
    font-size: 9px;
    color: #aaa;
    text-align: right;
    border-top: 1px solid #eee;
    padding-top: 6px;
  }
}

/* Keep old .save-btn and .save-status for any lingering references */
.save-btn {
  padding: 8px 20px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.15s;
}
.save-btn:hover { opacity: 0.85; }
.save-status {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-light);
}

/* ── Login Screen ──────────────────────────────────────────────────────── */
.auth-container {
  max-width: 380px;
  margin: 40px auto;
  padding: 32px 28px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}
.auth-title {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--navy);
  text-align: center;
  margin-bottom: 6px;
}
.auth-subtitle {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 24px;
}
.auth-field {
  margin-bottom: 14px;
}
.auth-field label {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-mid);
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}
.auth-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font-family: var(--serif);
  font-size: 15px;
  outline: none;
}
.auth-field input:focus { border-color: var(--blue); }

.auth-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 6px;
  transition: opacity 0.15s;
}
.auth-btn:hover { opacity: 0.88; }
.auth-btn-primary { background: var(--gold);  color: var(--navy);  }
.auth-btn-google  { background: var(--navy);  color: var(--white); margin-top: 10px; }

.auth-divider {
  text-align: center;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-light);
  margin: 14px 0;
}
.auth-toggle {
  text-align: center;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-mid);
  margin-top: 16px;
}
.auth-toggle a {
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
}
.auth-error {
  color: #c0392b;
  font-family: var(--sans);
  font-size: 13px;
  margin-bottom: 10px;
  text-align: center;
}

/* ── My Topics section (Browse) ────────────────────────────────────────── */
.my-topics-group .section-header {
  border-top: 2px solid var(--gold);
}
.my-topics-eyebrow {
  color: var(--gold) !important;
  letter-spacing: 1px;
  font-weight: bold;
}
.my-topics-group .section-name {
  color: var(--gold);
}
.my-topics-loading {
  padding: 20px;
  text-align: center;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-light);
}
.my-topics-signin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 20px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
}
.my-topics-lock { font-size: 22px; }
.my-topics-signin-link {
  color: var(--blue);
  font-weight: bold;
  margin-top: 4px;
}
.my-topics-add-btn { border-top: none; }
.my-topics-empty {
  padding: 16px 32px 20px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-light);
  font-style: italic;
}

/* ── Custom Topic view page ─────────────────────────────────────────────── */
.ct-header { position: relative; }
.ct-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.ct-header-row h1 { flex: 1; }
.ct-edit-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 5px 14px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  color: var(--gold);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.ct-edit-btn:hover { background: var(--gold); color: var(--navy); }

/* ── Custom Topic Form ──────────────────────────────────────────────────── */
.ctf-auth-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.ctf-auth-message {
  text-align: center;
  font-family: var(--sans);
  color: var(--text-mid);
}
.ctf-auth-icon { font-size: 40px; margin-bottom: 12px; }

.ctf-form {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 60px;
}
.ctf-section {
  background: var(--white);
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}
.ctf-label {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: bold;
  color: var(--text-light);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ctf-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font-family: var(--serif);
  font-size: 15px;
  outline: none;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}
.ctf-input:last-child { margin-bottom: 0; }
.ctf-input:focus { border-color: var(--blue); }
.ctf-title-input {
  font-size: 18px;
  font-weight: bold;
  color: var(--navy);
  border: none;
  border-bottom: 2px solid #ddd;
  border-radius: 0;
  padding: 8px 0;
}
.ctf-title-input:focus { border-bottom-color: var(--gold); }

.ctf-toggle-header {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.ctf-optional {
  font-size: 10px;
  color: var(--text-light);
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}
.ctf-gc-fields { padding-top: 12px; }

.ctf-notes-toolbar { margin-bottom: 10px; }

.ctf-notes-textarea {
  width: 100%;
  min-height: 180px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-dark);
  resize: vertical;
  outline: none;
  background: #fdfdf9;
  background-image: repeating-linear-gradient(
    transparent, transparent 27px, #e8e8e0 28px
  );
  background-size: 100% 28px;
  background-position: 0 12px;
  background-attachment: local;
}
.ctf-notes-textarea:focus { border-color: var(--blue); }

.ctf-delete-section { background: transparent; text-align: center; padding: 24px 20px 8px; }
.ctf-delete-btn {
  background: none;
  border: 1px solid #e74c3c;
  color: #e74c3c;
  font-family: var(--sans);
  font-size: 13px;
  padding: 10px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ctf-delete-btn:hover { background: #e74c3c; color: var(--white); }

/* Save button in nav (used on form page) */
.ctf-save-btn {
  background: var(--gold) !important;
  color: var(--navy) !important;
  border: none !important;
  font-weight: bold !important;
  padding: 6px 14px !important;
}
.ctf-save-btn:disabled { opacity: 0.6; cursor: default; }

/* My Topics badge on search results */
.search-result-mytopics { color: var(--gold) !important; }

/* ── My Notes Page ─────────────────────────────────────────────────────── */
.mn-page { background: #f0f0eb; }

.mn-titlebar {
  background: var(--navy);
  padding: 14px 20px 16px;
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.mn-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: bold;
  color: var(--white);
  line-height: 1;
}
.mn-count {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.mn-nudge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 20px;
  background: #faf5e8;
  border-bottom: 1px solid #e8dfc8;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-mid);
  flex-wrap: wrap;
}
.mn-nudge-link { color: var(--blue); font-weight: bold; }

.mn-content { padding: 16px 14px 80px; max-width: 680px; margin: 0 auto; }

.mn-loading {
  text-align: center;
  padding: 48px 20px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-light);
}

/* Section headers */
.mn-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 8px;
  margin-top: 8px;
}
.mn-section-header:first-child { margin-top: 0; }
.mn-section-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: bold;
  color: var(--text-light);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.mn-section-count {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--text-light);
  background: #e0e0d8;
  border-radius: 10px;
  padding: 1px 8px;
}

/* Cards */
.mn-card {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.1s;
}
.mn-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}
.mn-card:active { transform: translateY(0); }

/* Blue left accent for built-in, gold for custom */
.mn-card::before {
  content: '';
  display: block;
  width: 4px;
  align-self: stretch;
  background: var(--blue);
  flex-shrink: 0;
}
.mn-card-custom::before { background: var(--gold); }

.mn-card-inner {
  flex: 1;
  padding: 14px 12px;
  min-width: 0;
}
.mn-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.mn-card-eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-light);
}
.mn-card-custom .mn-card-eyebrow { color: var(--gold); }
.mn-card-date {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--text-light);
}
.mn-card-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: bold;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 5px;
}
.mn-card-preview {
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  color: var(--text-mid);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mn-card-chevron {
  font-size: 22px;
  color: #ccc;
  padding: 0 14px 0 8px;
  flex-shrink: 0;
}

/* Empty state */
.mn-empty {
  text-align: center;
  padding: 60px 24px;
}
.mn-empty-icon { font-size: 44px; margin-bottom: 16px; }
.mn-empty-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: bold;
  color: var(--navy);
  margin-bottom: 10px;
}
.mn-empty-body {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text-light);
  max-width: 260px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Utility ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

.pill-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--navy);
  color: var(--gold);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.5px;
  border-radius: 12px;
  vertical-align: middle;
  margin-left: 6px;
}

@media (min-width: 600px) {
  .home-title { font-size: 120px; }
  .auth-container { margin-top: 80px; }
}
