/* ═══════════════════════════════════════════════════════════════════════════
   Quillora — Crisp Ivory Theme
   Playfair Display (display) + DM Sans (body) + DM Mono (code/labels)
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

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

:root {
  --bg:       #f8f9fa;
  --surface:  #ffffff;
  --surface2: #f1f3f5;
  --border:   #dee2e6;
  --border2:  #ced4da;
  --text:     #212529;
  --text2:    #6c757d;
  --text3:    #adb5bd;
  --accent:   #2d6a4f;
  --accent2:  #1b4332;
  --green:    #2d6a4f;
  --blue:     #0066cc;
  --red:      #c0392b;
  --purple:   #7b4fa6;
  --yellow:   #d4a017;
  --r:        12px;
  --r-sm:     8px;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

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

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.app-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px; border-bottom: 1px solid var(--border);
  background: rgba(248,249,250,0.92); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 100;
}
.nav-logo { display: flex; align-items: center; gap: 8px; font-family: 'Playfair Display', serif; font-size: 20px; color: var(--accent); letter-spacing: .04em; }
.nav-logo-mark { width: 24px; height: 24px; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-user  { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text2); }
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.nav-logout { font-size: 12px; color: var(--text3); padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; background: none; }
.nav-logout:hover { color: var(--red); border-color: var(--red); }

/* ── Stage breadcrumb ─────────────────────────────────────────────────────── */
.stage-steps {
  display: flex; padding: 10px 32px; background: var(--surface);
  border-bottom: 1px solid var(--border); overflow-x: auto; gap: 0;
}
.step      { display: flex; align-items: center; gap: 6px; padding: 5px 14px; font-size: 11px; color: var(--text3); white-space: nowrap; letter-spacing: .04em; }
.step.done { color: var(--green); }
.step.curr { color: var(--accent); }
.step-sep  { color: var(--border2); font-size: 10px; }

/* ── Page wrapper ─────────────────────────────────────────────────────────── */
.page { max-width: 1100px; margin: 0 auto; padding: 40px 24px 100px; animation: fadeUp .4s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── Stage header ─────────────────────────────────────────────────────────── */
.stage-header { margin-bottom: 32px; }
.stage-num { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--accent); letter-spacing: .14em; display: block; margin-bottom: 6px; }
.stage-header h2 { font-family: 'Playfair Display', serif; font-size: 30px; font-weight: 900; margin-bottom: 8px; }
.stage-header p  { color: var(--text2); font-size: 14px; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent); color: var(--bg); border: none;
  padding: 13px 26px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: all .2s; display: inline-block;
}
.btn-primary:hover { background: #1b5e42; transform: translateY(-1px); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border2); padding: 11px 20px;
  border-radius: var(--r-sm); font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all .2s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-secondary:disabled { opacity: .3; cursor: not-allowed; }

.btn-purchase {
  background: linear-gradient(135deg, #2d6a4f, #1b4332); color: #ffffff;
  border: none; padding: 15px 28px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: all .2s;
}
.btn-purchase:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-purchase:disabled { opacity: .5; cursor: not-allowed; }
.btn-purchase.full { width: 100%; }

.btn-google {
  background: var(--surface2); border: 1px solid var(--border2); color: var(--text);
  padding: 11px 20px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 10px; width: 100%; font-family: 'DM Sans', sans-serif; transition: all .2s;
}
.btn-google:hover { border-color: var(--blue); color: var(--blue); }

.btn-sm { background: var(--accent); color: var(--bg); border: none; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; }
.btn-sm.ghost { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-remove { background: transparent; border: none; color: var(--text3); cursor: pointer; font-size: 14px; padding: 4px 8px; border-radius: 4px; transition: all .15s; }
.btn-remove:hover { color: var(--red); background: rgba(252,165,165,.08); }
.btn-add {
  background: transparent; border: 1px dashed var(--border2); color: var(--text2);
  padding: 9px 18px; border-radius: var(--r-sm); font-size: 13px;
  cursor: pointer; margin: 10px 0; font-family: 'DM Sans', sans-serif; transition: all .2s;
}
.btn-add:hover { border-color: var(--accent); color: var(--accent); }
.btn-dl {
  background: var(--accent); color: var(--bg); border: none; padding: 8px 18px;
  border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif;
}
.btn-dl:hover { background: #1b5e42; }
.btn-dl:disabled { background: var(--surface2); color: var(--text3); cursor: not-allowed; }

.action-row { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-card  { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; max-width: 660px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 7px; letter-spacing: .04em; text-transform: uppercase; }
.req { color: var(--accent); }
.form-input, .form-select, .form-textarea {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 11px 13px; border-radius: var(--r-sm); font-size: 14px;
  font-family: 'DM Sans', sans-serif; outline: none; width: 100%; transition: border-color .2s;
}
.form-input:focus, .form-textarea:focus { border-color: var(--accent); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text3); }
.form-textarea { resize: vertical; }
.hint { font-size: 11px; color: var(--text3); margin-top: 5px; display: block; }

.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-pill {
  background: var(--bg); border: 1px solid var(--border); padding: 8px 16px;
  border-radius: 40px; font-size: 13px; cursor: pointer; transition: all .2s; color: var(--text2); user-select: none;
}
.radio-pill.selected { background: rgba(45,106,79,.1); border-color: var(--accent); color: var(--accent); }
.radio-pill input { display: none; }

/* ── Auth ─────────────────────────────────────────────────────────────────── */
.auth-wrap { display: flex; justify-content: center; padding-top: 20px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 36px; width: 100%; max-width: 420px; }
.auth-logo { font-family: 'Playfair Display', serif; font-size: 22px; color: var(--accent); text-align: center; margin-bottom: 24px; }
.auth-tabs { display: flex; background: var(--bg); border-radius: 8px; padding: 4px; margin-bottom: 24px; }
.auth-tabs a { flex: 1; text-align: center; padding: 8px; border-radius: 6px; font-size: 14px; color: var(--text2); transition: all .2s; }
.auth-tabs a.active { background: var(--surface2); color: var(--text); }
.auth-divider { text-align: center; color: var(--text3); font-size: 12px; margin: 16px 0; position: relative; }
.auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.auth-divider span { background: var(--surface); padding: 0 12px; position: relative; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }

/* ── Flash messages ───────────────────────────────────────────────────────── */
.flash { padding: 12px 16px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 16px; }
.flash.error { background: rgba(252,165,165,.07); border: 1px solid rgba(252,165,165,.3); color: var(--red); }
.flash.info  { background: rgba(147,197,253,.07); border: 1px solid rgba(147,197,253,.3); color: var(--blue); }

/* ── Disclaimer box ───────────────────────────────────────────────────────── */
.disclaimer {
  background: rgba(45,106,79,.06); border: 1px solid rgba(45,106,79,.2);
  border-radius: var(--r); padding: 14px 18px; color: var(--text2); font-size: 13px;
  line-height: 1.65; display: flex; gap: 12px; max-width: 620px; margin: 0 auto 28px;
}
.disclaimer.wide  { max-width: 100%; margin: 0 0 24px; }
.disclaimer.small { max-width: 100%; margin: 14px 0; }
.disc-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; }

/* ── Loading / spinner ────────────────────────────────────────────────────── */
.loading-block { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 56px 0; color: var(--text2); font-size: 14px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin-inline { display: inline-block; animation: spin .8s linear infinite; }

/* ── Error box ────────────────────────────────────────────────────────────── */
.error-box { background: rgba(252,165,165,.06); border: 1px solid rgba(252,165,165,.3); border-radius: var(--r); padding: 14px; color: var(--red); font-size: 13px; margin-bottom: 14px; }

/* ── Landing ──────────────────────────────────────────────────────────────── */
.landing { text-align: center; padding: 60px 20px; }
.hero-glyph { font-size: 60px; display: block; margin-bottom: 22px; }
.hero-title { font-family: 'Playfair Display', serif; font-size: 54px; font-weight: 900; color: var(--accent); margin-bottom: 14px; }
.hero-sub   { font-size: 17px; color: var(--text2); margin-bottom: 32px; }
.hero-features { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 36px; }
.feature-pill { background: var(--surface2); border: 1px solid var(--border); padding: 7px 15px; border-radius: 40px; font-size: 13px; color: var(--text2); }

/* ── Chapters ─────────────────────────────────────────────────────────────── */
.chapter-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.chapter-card { display: flex; align-items: flex-start; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 18px; transition: border-color .2s; }
.chapter-card:hover { border-color: var(--border2); }
.ch-num  { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--accent); background: rgba(45,106,79,.1); padding: 3px 7px; border-radius: 4px; flex-shrink: 0; margin-top: 2px; }
.ch-body { flex: 1; }
.ch-title { font-size: 14px; font-weight: 600; cursor: pointer; color: var(--text); transition: color .15s; }
.ch-title:hover { color: var(--accent); }
.edit-hint { font-size: 11px; color: var(--text3); margin-left: 6px; }
.ch-desc  { font-size: 13px; color: var(--text2); margin-top: 4px; line-height: 1.5; }
.edit-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.inline-edit { background: var(--bg); border: 1px solid var(--accent); color: var(--text); padding: 5px 9px; border-radius: 5px; font-size: 14px; font-family: 'DM Sans', sans-serif; flex: 1; outline: none; }

/* ── Sections accordion ───────────────────────────────────────────────────── */
.accordion     { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.acc-item      { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.acc-header    { display: flex; align-items: center; gap: 12px; padding: 13px 18px; cursor: pointer; transition: background .15s; }
.acc-header:hover { background: var(--surface2); }
.acc-num       { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--accent); background: rgba(45,106,79,.1); padding: 3px 7px; border-radius: 4px; flex-shrink: 0; }
.acc-title     { flex: 1; font-size: 14px; font-weight: 600; }
.acc-count     { font-size: 12px; color: var(--text3); }
.acc-chevron   { font-size: 10px; color: var(--text3); transition: transform .2s; }
.acc-item.open .acc-chevron { transform: rotate(180deg); }
.acc-body      { border-top: 1px solid var(--border); padding: 10px 18px 14px; background: var(--bg); display: none; }
.acc-item.open .acc-body { display: block; }
.sec-row       { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.sec-row:last-of-type { border-bottom: none; }
.sec-num       { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text3); flex-shrink: 0; margin-top: 2px; min-width: 30px; }
.sec-body      { flex: 1; }
.sec-title     { font-size: 13px; font-weight: 500; }
.sec-desc      { font-size: 12px; color: var(--text2); margin-top: 3px; }
.btn-remove-sm { background: transparent; border: none; color: var(--text3); cursor: pointer; font-size: 11px; padding: 2px 5px; }
.btn-remove-sm:hover { color: var(--red); }

/* ── Generating / Agents ──────────────────────────────────────────────────── */
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 26px; }
.agent-badge { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 13px 14px; display: flex; align-items: center; gap: 11px; transition: all .3s; }
.agent-badge.active { border-color: var(--accent); background: rgba(45,106,79,.05); }
.agent-badge.done   { border-color: var(--green); background: rgba(110,231,183,.04); }
.agent-icon  { font-size: 20px; }
.agent-info  { flex: 1; }
.agent-label { font-size: 12px; font-weight: 600; }
.agent-desc  { font-size: 11px; color: var(--text3); margin-top: 2px; }
.agent-status { font-size: 13px; font-weight: 700; color: var(--text3); }
.agent-badge.active .agent-status { color: var(--accent); }
.agent-badge.done   .agent-status { color: var(--green); }

.progress-wrap  { margin-bottom: 22px; }
.progress-label { font-size: 12px; color: var(--text2); margin-bottom: 7px; }
.progress-track { background: var(--surface); border-radius: 4px; height: 8px; overflow: hidden; }
.progress-fill  { background: linear-gradient(90deg, var(--green), var(--accent)); height: 100%; border-radius: 4px; transition: width .45s ease; width: 0%; }
.progress-pct   { font-size: 11px; color: var(--accent); margin-top: 5px; font-family: 'DM Mono', monospace; }

.log-panel  { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; height: 260px; overflow-y: auto; font-family: 'DM Mono', monospace; font-size: 11px; }
.log-entry  { display: flex; gap: 10px; padding: 2px 0; border-bottom: 1px solid rgba(0,0,0,.06); }
.log-time   { color: var(--text3); flex-shrink: 0; }
.log-msg    { color: var(--text2); }
.blink      { animation: blink .8s step-end infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

/* ── Review layout ────────────────────────────────────────────────────────── */
.review-header { margin-bottom: 22px; }
.copyright-banner {
  background: rgba(252,165,165,.06); border: 1px solid rgba(252,165,165,.2);
  border-radius: var(--r-sm); padding: 11px 15px; font-size: 12px; color: var(--text2); line-height: 1.6;
}
.review-layout { display: grid; grid-template-columns: 250px 1fr; gap: 22px; min-height: 600px; }
.toc-sidebar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; overflow-y: auto; max-height: 700px; position: sticky; top: 76px; }
.toc-heading { font-size: 10px; letter-spacing: .12em; color: var(--text3); text-transform: uppercase; margin-bottom: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.toc-ch { margin-bottom: 3px; }
.toc-ch-title { padding: 7px 9px; border-radius: 5px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text2); line-height: 1.4; transition: all .15s; }
.toc-ch-title:hover { background: var(--surface2); color: var(--text); }
.toc-ch-title.active { background: rgba(45,106,79,.1); color: var(--accent); }
.toc-sec-title { padding: 4px 9px 4px 22px; font-size: 11px; color: var(--text3); cursor: pointer; border-radius: 4px; transition: all .15s; line-height: 1.4; }
.toc-sec-title:hover { color: var(--text2); }
.toc-sec-title.active { color: var(--accent); }
.toc-refs { padding: 9px; font-size: 13px; color: var(--text2); cursor: pointer; border-top: 1px solid var(--border); margin-top: 10px; }
.toc-refs:hover { color: var(--text); }

.book-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 34px 38px; overflow-y: auto; }
.ch-breadcrumb { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--text3); margin-bottom: 14px; letter-spacing: .1em; text-transform: uppercase; }
.section-heading { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; margin-bottom: 22px; line-height: 1.3; }
.chapter-title { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; margin-bottom: 20px; line-height: 1.3; }
.chapter-intro-text { font-style: italic; font-size: 13px; color: var(--text2); border-left: 2px solid var(--accent); padding-left: 16px; margin-bottom: 28px; line-height: 1.75; }
.section-sep { text-align: center; color: var(--text3); margin: 34px 0; font-size: 16px; letter-spacing: 8px; }
.section-body p { font-size: 14px; line-height: 1.8; color: var(--text2); margin-bottom: 15px; }
.references-view h2 { font-family: 'Playfair Display', serif; font-size: 22px; margin-bottom: 18px; }
.ref-list { padding-left: 18px; }
.ref-item { font-size: 13px; color: var(--text2); margin-bottom: 11px; line-height: 1.6; }
.nav-arrows { display: flex; gap: 10px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); }
.review-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }

/* ── Payment ──────────────────────────────────────────────────────────────── */
.payment-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.order-summary  { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 26px; }
.order-summary h3 { font-size: 15px; font-weight: 700; margin-bottom: 18px; }
.order-item   { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.order-item.sub { font-size: 12px; color: var(--text2); }
.order-item.sub span:last-child { color: var(--green); }
.order-total  { display: flex; justify-content: space-between; padding: 13px 0 0; font-size: 16px; font-weight: 700; color: var(--accent); }
.copyright-transfer { display: flex; gap: 10px; background: rgba(110,231,183,.05); border: 1px solid rgba(110,231,183,.15); border-radius: var(--r-sm); padding: 12px; margin-top: 14px; font-size: 12px; color: var(--text2); line-height: 1.6; }
.ct-icon { font-size: 16px; }
.payment-form { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 26px; }
.payment-form h3 { font-size: 15px; font-weight: 700; margin-bottom: 18px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Download ─────────────────────────────────────────────────────────────── */
.dl-hero { text-align: center; margin-bottom: 28px; }
.dl-icon { font-size: 52px; display: block; margin-bottom: 14px; }
.dl-hero h2 { font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 900; margin-bottom: 8px; }
.dl-hero p  { color: var(--text2); font-size: 14px; }
.dl-meta { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 32px; }
.dl-meta-item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text2); background: var(--surface); border: 1px solid var(--border); padding: 7px 14px; border-radius: 40px; }
.dl-formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 640px; margin: 0 auto 28px; }
.dl-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; transition: all .2s; text-align: center; }
.dl-card:hover:not(.coming) { border-color: var(--accent); cursor: pointer; }
.dl-card.coming { opacity: .5; }
.dl-fmt-icon  { font-size: 30px; margin-bottom: 10px; }
.dl-fmt-label { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.dl-fmt-desc  { font-size: 11px; color: var(--text3); margin-bottom: 14px; }

/* ── Stripe card element ──────────────────────────────────────────────────── */
.stripe-card-element {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 12px 13px; transition: border-color .2s;
}
.stripe-card-element:focus-within { border-color: var(--accent); }

/* ── Nav additions ────────────────────────────────────────────────────────── */
.nav-link {
  font-size: 13px; color: var(--text2); padding: 5px 10px; border-radius: 6px;
  transition: all .15s;
}
.nav-link:hover { color: var(--text); background: var(--surface2); }
.nav-admin { color: var(--yellow) !important; }
.remember-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* ── Google OAuth button ──────────────────────────────────────────────────── */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 20px; margin-bottom: 4px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text);
  font-size: 14px; font-weight: 500; cursor: pointer;
  text-decoration: none; transition: background 0.15s, border-color 0.15s;
}
.btn-google:hover { background: var(--surface); border-color: var(--border2); color: var(--text); }
.btn-google svg { flex-shrink: 0; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--text3);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Flash success ────────────────────────────────────────────────────────── */
.flash.success { background: rgba(110,231,183,.07); border: 1px solid rgba(110,231,183,.3); color: var(--green); }

/* ── Dashboard ────────────────────────────────────────────────────────────── */
.dash-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-bottom: 28px;
}
.dash-title { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 900; margin: 4px 0 4px; }

.dash-empty { text-align: center; padding: 80px 20px; }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

.book-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color .2s;
}
.book-card:hover { border-color: var(--border2); }
.book-active { border-left: 3px solid var(--green); }
.book-expired { border-left: 3px solid var(--red); }
.book-draft  { border-left: 3px solid var(--border2); }

.book-status-badge {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 3px 9px;
  border-radius: 4px; display: inline-flex; align-items: center; gap: 5px; width: fit-content;
}
.status-active   { background: rgba(110,231,183,.1); color: var(--green); }
.status-expired  { background: rgba(252,165,165,.1); color: var(--red); }
.status-unpurchased { background: rgba(90,95,120,.15); color: var(--text3); }

.book-title { font-size: 15px; font-weight: 700; line-height: 1.4; }

.book-meta-row { display: flex; gap: 6px; flex-wrap: wrap; }
.book-meta-pill {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text3);
  padding: 2px 8px; border-radius: 20px; font-size: 11px;
}

.book-dates { display: flex; flex-direction: column; gap: 5px; }
.book-date-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text2); }
.book-date-label { color: var(--text3); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }

.book-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

/* ── Book Detail ──────────────────────────────────────────────────────────── */
.detail-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}
.detail-header-left { flex: 1; min-width: 0; }

.detail-status-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 16px 20px; text-align: center; min-width: 180px;
}
.detail-status-card.status-active  { border-color: rgba(110,231,183,.4); background: rgba(110,231,183,.04); }
.detail-status-card.status-expired { border-color: rgba(252,165,165,.4); background: rgba(252,165,165,.04); }
.status-icon  { font-size: 28px; margin-bottom: 6px; }
.status-label { font-size: 13px; font-weight: 700; }
.status-sub   { font-size: 12px; color: var(--text3); margin-top: 4px; }

.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.detail-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 12px 16px;
}
.detail-box-warn { border-color: rgba(252,165,165,.3); }
.detail-box-label { font-size: 11px; color: var(--text3); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.detail-box-value { font-size: 14px; font-weight: 600; }

.detail-section { margin-top: 28px; }
.detail-section-title {
  font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

.renewal-box {
  background: rgba(45,106,79,.05); border: 1px solid rgba(45,106,79,.25);
  border-radius: var(--r); padding: 20px 24px; margin-top: 24px;
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.renewal-icon { font-size: 36px; flex-shrink: 0; }
.renewal-body { flex: 1; min-width: 200px; }
.renewal-body h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.renewal-body p { font-size: 13px; color: var(--text2); line-height: 1.6; }
.renewal-price { font-size: 28px; font-weight: 900; color: var(--accent); margin-top: 8px; }
.renewal-action { flex-shrink: 0; }

/* ── Payment table ────────────────────────────────────────────────────────── */
.payment-table-wrap { overflow-x: auto; }
.payment-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.payment-table th { color: var(--text3); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.payment-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text2); }
.pay-status-completed { color: var(--green); }
.pay-status-pending   { color: var(--yellow); }
.pay-status-failed    { color: var(--red); }
.pay-status-refunded  { color: var(--blue); }

/* ── Admin tabs ───────────────────────────────────────────────────────────── */
.admin-tabs { display: flex; gap: 4px; margin-bottom: 28px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.admin-tab  { font-size: 13px; font-weight: 500; color: var(--text2); padding: 9px 16px; border-radius: var(--r-sm) var(--r-sm) 0 0; border: 1px solid transparent; border-bottom: none; text-decoration: none; transition: all .15s; margin-bottom: -1px; }
.admin-tab:hover { color: var(--accent); background: var(--surface2); }
.admin-tab.active { color: var(--accent); background: var(--surface); border-color: var(--border); font-weight: 600; }

/* ── Admin testimonial cards ─────────────────────────────────────────────── */
.testi-admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; margin-bottom: 12px; }
.testi-admin-card.testi-inactive { opacity: .55; }
.testi-admin-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.testi-admin-stars { color: var(--yellow); font-size: 13px; margin-right: 6px; }
.testi-admin-name { font-size: 13px; font-weight: 600; }
.testi-admin-role { font-size: 12px; color: var(--text3); margin-left: 4px; }
.testi-admin-hidden { background: var(--surface2); border: 1px solid var(--border2); color: var(--text3); font-size: 10px; padding: 2px 7px; border-radius: 10px; margin-left: 8px; letter-spacing: .04em; text-transform: uppercase; }
.testi-admin-quote { font-size: 13px; color: var(--text2); line-height: 1.6; font-style: italic; }

/* ── Landing page ─────────────────────────────────────────────────────────── */

/* Hero */
.lp-hero { text-align: center; padding: 72px 0 52px; }
.lp-eyebrow { font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.lp-hero-title { font-family: 'Playfair Display', serif; font-size: 52px; font-weight: 900; line-height: 1.15; margin-bottom: 22px; color: var(--text); }
.lp-hero-accent { color: var(--accent); }
.lp-hero-sub { font-size: 17px; color: var(--text2); line-height: 1.7; max-width: 620px; margin: 0 auto 36px; }
.lp-hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.lp-hero-btn { font-size: 16px; padding: 16px 32px; }
.lp-hero-btn-sec { font-size: 15px; padding: 14px 26px; }
.lp-trust-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 4px; }
.lp-trust-badge { font-size: 12px; color: var(--text3); }
.lp-trust-sep { color: var(--border2); margin: 0 4px; }

/* Stats bar */
.lp-stats { display: flex; align-items: center; justify-content: center; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 28px 20px; margin-bottom: 56px; }
.lp-stat { text-align: center; padding: 0 32px; }
.lp-stat-num { display: block; font-family: 'Playfair Display', serif; font-size: 36px; font-weight: 900; color: var(--accent); line-height: 1; margin-bottom: 6px; }
.lp-stat-label { font-size: 12px; color: var(--text2); line-height: 1.4; }
.lp-stat-div { width: 1px; height: 48px; background: var(--border); flex-shrink: 0; }

/* Sections */
.lp-section { padding: 56px 0; border-top: 1px solid var(--border); }
.lp-section-tinted { background: var(--surface2); margin: 0 -24px; padding: 56px 24px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lp-section-title { font-family: 'Playfair Display', serif; font-size: 34px; font-weight: 900; margin-bottom: 14px; line-height: 1.25; }
.lp-section-sub { font-size: 15px; color: var(--text2); line-height: 1.7; max-width: 640px; margin-bottom: 40px; }

/* Pricing comparison */
.lp-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 780px; }
.lp-compare-col { border: 1px solid var(--border); border-radius: var(--r); padding: 28px; }
.lp-compare-us { border-color: var(--accent); background: rgba(45,106,79,.04); }
.lp-compare-header { font-size: 15px; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lp-compare-price { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 900; color: var(--accent); }
.lp-compare-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.lp-compare-list li { font-size: 14px; padding-left: 22px; position: relative; line-height: 1.4; }
.lp-compare-list li::before { position: absolute; left: 0; font-weight: 700; }
.lp-compare-yes::before { content: '✓'; color: var(--green); }
.lp-compare-no::before  { content: '✕'; color: var(--text3); }
.lp-compare-no { color: var(--text2); }

/* AI agents grid */
.lp-agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.lp-agent-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 22px 18px; }
.lp-agent-icon { font-size: 26px; margin-bottom: 10px; }
.lp-agent-name { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.lp-agent-desc { font-size: 12px; color: var(--text2); line-height: 1.55; }
.lp-llm-note { display: flex; align-items: flex-start; gap: 10px; background: rgba(45,106,79,.06); border: 1px solid rgba(45,106,79,.2); border-radius: var(--r-sm); padding: 14px 16px; font-size: 13px; color: var(--text2); line-height: 1.55; }
.lp-llm-note-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* How it works steps */
.lp-steps { display: flex; flex-direction: column; gap: 0; max-width: 680px; }
.lp-step { display: flex; gap: 24px; align-items: flex-start; padding: 24px 0; border-bottom: 1px solid var(--border); }
.lp-step:last-child { border-bottom: none; }
.lp-step-num { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 500; color: var(--accent); width: 28px; flex-shrink: 0; padding-top: 2px; }
.lp-step-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.lp-step-desc { font-size: 13px; color: var(--text2); line-height: 1.6; }

/* Testimonials */
.lp-testi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.lp-testi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.lp-testi-stars { color: var(--yellow); font-size: 14px; letter-spacing: 2px; }
.lp-testi-quote { font-size: 14px; color: var(--text); line-height: 1.7; font-style: italic; flex: 1; }
.lp-testi-author { display: flex; align-items: center; gap: 12px; }
.lp-testi-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.lp-testi-name { font-size: 13px; font-weight: 600; }
.lp-testi-role { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* Final CTA */
.lp-cta-section { text-align: center; background: var(--accent); border-radius: var(--r); padding: 64px 40px; margin: 48px 0 32px; }
.lp-cta-title { font-family: 'Playfair Display', serif; font-size: 34px; font-weight: 900; color: #fff; margin-bottom: 14px; }
.lp-cta-sub { font-size: 16px; color: rgba(255,255,255,.82); line-height: 1.7; max-width: 520px; margin: 0 auto 28px; }
.lp-cta-note { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 14px; }
.lp-cta-section .btn-purchase { background: #fff; color: var(--accent); }
.lp-cta-section .btn-purchase:hover { background: #f0f0f0; filter: none; transform: translateY(-1px); }

/* AI disclaimer */
.lp-ai-disclaimer { font-size: 12px; color: var(--text3); line-height: 1.6; padding: 20px 0 8px; border-top: 1px solid var(--border); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .review-layout    { grid-template-columns: 1fr; }
  .toc-sidebar      { position: static; max-height: 220px; }
  .payment-layout   { grid-template-columns: 1fr; }
  .dl-formats       { grid-template-columns: 1fr; }
  .book-content     { padding: 18px; }
  .agents-grid      { grid-template-columns: 1fr; }
  .app-nav          { padding: 14px 16px; }
  .page             { padding: 28px 16px 80px; }
  .book-grid        { grid-template-columns: 1fr; }
  .detail-header    { flex-direction: column; }
  .renewal-box      { flex-direction: column; }
  .dash-header      { flex-direction: column; align-items: stretch; }
  .lp-hero-title    { font-size: 34px; }
  .lp-section-title { font-size: 26px; }
  .lp-stats         { flex-wrap: wrap; }
  .lp-stat          { padding: 12px 20px; }
  .lp-stat-div      { display: none; }
  .lp-compare       { grid-template-columns: 1fr; }
  .lp-cta-section   { padding: 40px 20px; }
  .lp-cta-title     { font-size: 26px; }
  .lp-section-tinted { margin: 0 -16px; padding: 40px 16px; }
}
