:root {
  --ink: #13233a;
  --ink-2: #2b3d57;
  --muted: #5f6b7c;
  --paper: #f6f3ec;
  --card: #ffffff;
  --line: #e3ddd0;
  --saffron: #d9771f;
  --saffron-dark: #b55f12;
  --green: #1f6b4f;
  --red: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(19,35,58,.06), 0 6px 20px rgba(19,35,58,.06);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--ink); }
button, input, select { font: inherit; }
code { font-size: .9em; background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.demo-banner {
  background: #fff4d6; color: #6b4a00; font-size: 13px; text-align: center;
  padding: 8px 16px; border-bottom: 1px solid #f0dfa8;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--ink); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--saffron); color: #fff; font-family: var(--serif); font-weight: 700; font-size: 20px;
}
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .nav button {
  white-space: nowrap;
  color: #dfe6f0; text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 8px 10px; border-radius: 8px; background: none; border: 0; cursor: pointer;
}
.nav a:hover, .nav button:hover, .nav a.active { background: rgba(255,255,255,.1); color: #fff; }

.app { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 20px 16px 48px; outline: none; }

/* ---------- Hero ---------- */
.hero { padding: 20px 0 8px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--saffron-dark); background: #fbe9d6; padding: 5px 10px; border-radius: 999px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(28px, 6vw, 44px);
  line-height: 1.12; margin: 14px 0 10px; letter-spacing: -.01em; max-width: 18ch;
}
.hero p { color: var(--ink-2); font-size: 17px; max-width: 60ch; margin: 0; }
.trust {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 22px 0 28px;
}
.trust div {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px;
}
.trust strong { display: block; font-size: 14px; }
.trust span { color: var(--muted); font-size: 13px; }

.section-title { font-family: var(--serif); font-size: 22px; margin: 6px 0 14px; }

/* ---------- Product cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.card-spine { height: 6px; background: var(--ink); }
.card.featured .card-spine { background: var(--saffron); }
.card-body { padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-family: var(--serif); font-size: 20px; line-height: 1.2; margin: 0; }
.card .sub { color: var(--muted); font-size: 14px; margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; background: #eef1f6; color: var(--ink-2); padding: 3px 8px; border-radius: 999px; }
.tag.best { background: #fbe9d6; color: var(--saffron-dark); font-weight: 600; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px 16px; border-top: 1px dashed var(--line);
}
.price { display: flex; align-items: baseline; gap: 8px; }
.price b { font-size: 22px; }
.price s { color: var(--muted); font-size: 14px; }
.price .off { color: var(--green); font-size: 13px; font-weight: 600; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  font-weight: 600; font-size: 15px; padding: 10px 16px; text-decoration: none; min-height: 44px;
  background: var(--ink); color: #fff; transition: transform .05s ease, background .15s ease;
}
.btn:hover { background: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--saffron); }
.btn.primary:hover { background: var(--saffron-dark); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: #fff; }
.btn.small { font-size: 14px; padding: 7px 12px; min-height: 36px; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font-size: 14px; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.narrow { max-width: 460px; margin: 10px auto; }
.panel h2 { font-family: var(--serif); margin: 0 0 6px; font-size: 26px; }
.panel .lead { color: var(--muted); margin: 0 0 16px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.field input, .field select {
  border: 1px solid #cfc8b8; border-radius: 10px; padding: 11px 12px; background: #fff; color: var(--ink);
  min-height: 44px; width: 100%;
}
.field input:focus, .field select:focus { outline: 2px solid var(--saffron); outline-offset: 1px; border-color: transparent; }
.tabs { display: flex; gap: 6px; background: #efeadf; padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.tabs button {
  flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted);
}
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.error { color: var(--red); font-size: 14px; margin: 0 0 12px; }
.note { font-size: 13px; color: var(--muted); }

/* ---------- Product page ---------- */
.back { display: inline-block; margin-bottom: 12px; font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }
.product { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.product > * { min-width: 0; }
@media (min-width: 860px) { .product { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.product h1 { font-family: var(--serif); font-size: clamp(26px, 5vw, 36px); line-height: 1.15; margin: 8px 0; }
.product .desc { color: var(--ink-2); }
.files { list-style: none; padding: 0; margin: 10px 0 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.files li { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 15px; }
.files li:first-child { border-top: 0; }
.files .ico {
  width: 28px; height: 28px; border-radius: 7px; flex: none; display: grid; place-items: center;
  background: #eef1f6; font-size: 11px; font-weight: 700; color: var(--ink-2);
}
.buybox { position: sticky; top: 76px; }
.buybox .price b { font-size: 30px; }
.coupon { display: flex; gap: 8px; margin: 14px 0 6px; }
.coupon input {
  flex: 1; min-width: 0; border: 1px solid #cfc8b8; border-radius: 10px; padding: 9px 12px; text-transform: uppercase;
}
.checks { list-style: none; padding: 0; margin: 14px 0 0; font-size: 14px; color: var(--ink-2); }
.checks li { padding-left: 24px; position: relative; margin: 6px 0; }
.checks li::before { content: "✓"; position: absolute; left: 4px; color: var(--green); font-weight: 700; }

/* ---------- Library ---------- */
.lib-pack { margin-bottom: 18px; }
.lib-pack h3 { font-family: var(--serif); font-size: 20px; margin: 0 0 8px; }
.lib-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty h2 { color: var(--ink); }

/* ---------- Reader ---------- */
body.reading .footer, body.reading .demo-banner { display: none; }
.reader-bar {
  position: sticky; top: 58px; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--paper); padding: 8px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.reader-bar .title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-bar .ctrls { display: flex; gap: 6px; flex: none; }
.reader {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  display: flex; flex-direction: column; align-items: center; gap: 30px;
}
.page-wrap { position: relative; background: #fff; box-shadow: var(--shadow); max-width: 100%; }
.page-wrap canvas { display: block; width: 100%; height: auto; }
.page-wrap .wm {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  display: grid; grid-template-rows: repeat(4, 1fr); align-items: center; justify-items: center;
}
.page-wrap .wm span {
  transform: rotate(-26deg); white-space: nowrap; font-weight: 700; font-size: clamp(11px, 2.4vw, 18px);
  color: rgba(19,35,58,.09);
}
.page-wrap .pno { position: absolute; right: 8px; bottom: -20px; font-size: 12px; color: var(--muted); }
.page-ph { width: 100%; aspect-ratio: 1 / 1.414; background: #fff; display: grid; place-items: center; color: var(--muted); }
.privacy-shield {
  position: fixed; inset: 0; z-index: 100; background: var(--ink); color: #fff;
  display: grid; place-items: center; text-align: center; padding: 24px; font-size: 16px;
}
@media print { body * { display: none !important; } body::after { content: "Printing is disabled for licensed content."; display: block; } }

/* ---------- Misc ---------- */
.spinner {
  width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--saffron);
  animation: spin .8s linear infinite; margin: 30px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200;
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px;
  max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.toast.err { background: var(--red); }
.success-ico {
  width: 56px; height: 56px; border-radius: 50%; background: #e3f2ea; color: var(--green);
  display: grid; place-items: center; font-size: 28px; font-weight: 700; margin: 0 auto 10px;
}
.devices { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; }
.devices li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }

.footer {
  border-top: 1px solid var(--line); padding: 20px 16px 28px; text-align: center; font-size: 13px; color: var(--muted);
}
.footer a { color: var(--muted); margin: 0 6px; }

/* ---------- Policy pages ---------- */
.policy { max-width: 760px; margin: 0 auto; }
.policy h1 { font-family: var(--serif); }
.policy h2 { font-family: var(--serif); font-size: 20px; margin-top: 26px; }

@media (max-width: 520px) {
  .nav .long { display: none; }
  .nav a, .nav button { padding: 8px 8px; }
  .topbar { padding: 10px 12px; }
  .brand-name { font-size: 16px; }
  .hero p { font-size: 16px; }
}

/* ---------- Added Oct 2026: announcements, consent, requests, updates ---------- */
.announce {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  background: #fff8ee; border: 1px solid #f1d5b0; border-left: 4px solid var(--saffron);
  border-radius: 12px; padding: 12px 14px; margin: 4px 0 14px; font-size: 14px;
}
.announce span { color: var(--ink-2); }
.announce-tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #fff !important; background: var(--saffron); padding: 2px 7px; border-radius: 999px; margin-right: 4px;
}
.announce-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 0 0 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--saffron); }
.field textarea {
  border: 1px solid #cfc8b8; border-radius: 10px; padding: 11px 12px; background: #fff; color: var(--ink);
  width: 100%; font: inherit; resize: vertical;
}
.field textarea:focus { outline: 2px solid var(--saffron); outline-offset: 1px; border-color: transparent; }
.field input[readonly] { background: #f3f0e8; color: var(--ink-2); }
.request-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.reqlist { list-style: none; padding: 0; margin: 8px 0 0; }
.reqlist li { border-top: 1px solid var(--line); padding: 12px 0; font-size: 14px; }
.reqlist p { margin: 6px 0; overflow-wrap: anywhere; }
.reqlist .reply { background: #eef6f1; border-radius: 8px; padding: 8px 10px; }
.req-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tag.done { background: #e3f2ea; color: var(--green); }
.lib-name { display: flex; gap: 10px; align-items: center; min-width: 0; }
.badge-upd {
  display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--green);
  background: #e3f2ea; padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}
.upd-note { display: block; font-size: 12px; color: var(--muted); }
.lib-updates { background: #e3f2ea; color: var(--green); border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600; }
.disclaimer { font-size: 12px; color: var(--muted); max-width: 70ch; margin: 10px auto 0; }
.product-disclaimer { margin: 22px 0 0; max-width: none; border-top: 1px dashed var(--line); padding-top: 12px; }
.footer-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-bottom: 10px; }
.footer-cta a { color: var(--ink); font-weight: 600; }
