body { font-size: 15px; }
#app { min-height: 100vh; display: flex; flex-direction: column; }

.top { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

.main { flex: 1 1 auto; width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; display: flex; flex-direction: column; gap: 20px; }
.main h1 { font-size: 28px; line-height: 1.2; }
.lead { font-size: 17px; margin: 0; }
.hint { font-size: 14px; color: var(--muted); }
.main .label { display: block; margin-bottom: 6px; }
.narrow, .qwrap { width: 100%; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--field); background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.link { min-height: 40px; }
.input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--field); border-radius: 12px; font: inherit; background: #fff; color: var(--ink); }
.pad { padding: 18px; display: flex; flex-direction: column; gap: 10px; }

/* Start */
.hero { max-width: 820px; display: flex; flex-direction: column; gap: 12px; }
.hero h1 { font-size: 32px; }
.disclaimer { padding: 12px 14px; border: 1px solid #E8C48A; background: var(--stale-bg); color: #4A2B00; border-radius: 10px; }

/* Questions */
.progress-row { display: flex; flex-direction: column; gap: 6px; }
.progress { height: 6px; border-radius: 999px; background: var(--miss-bg); overflow: hidden; }
.progress > div { height: 6px; background: var(--accent); transition: width .2s; }
.qbody { display: flex; flex-direction: column; gap: 12px; }
.q2 { font-size: 18px; margin-top: 12px; }
.qnav { display: flex; justify-content: space-between; gap: 10px; padding-top: 8px; }
.qnav .btn { min-width: 140px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opts.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.opts.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.opt { display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 52px; padding: 13px 14px; border: 1px solid var(--field); border-radius: 12px; background: #fff; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.opt:hover { border-color: var(--accent); }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt.disabled { cursor: not-allowed; opacity: .6; }
.opt .grow { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.opt-title { font-weight: 600; }
.opt-hint { font-size: 13px; color: var(--muted); }
.opt-dot { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--field); }
.opt.on .opt-dot { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.opt.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--accent); }

/* Preview */
.main.preview { max-width: 1240px; }
.preview { display: flex; gap: 24px; align-items: flex-start; }
.side { flex: 0 0 310px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.side .btn { width: 100%; }
.cta { border-color: var(--accent); background: var(--accent-soft); }
.why { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.why li { display: flex; flex-direction: column; }
.why .link { min-height: 0; font-size: 14px; }
.paper-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.paper { padding: 48px 56px; box-shadow: 0 6px 24px rgba(20, 24, 31, .08); }
.doc-section { scroll-margin-top: 80px; }

/* Profile */
.factor-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.row .grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.row .title { font-weight: 600; font-size: 14px; }
.row .sub { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-s { padding: 3px 10px; border-radius: 999px; background: var(--miss-bg); font-size: 12.5px; }
.chip-s.auto { background: var(--pos-bg); color: var(--pos); }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 6; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; }

@media (max-width: 860px) {
  .preview { flex-direction: column; align-items: stretch; }
  .side { position: static; flex-basis: auto; width: 100%; max-height: none; }
  .preview.is-example .side { order: 2; }
  .paper { padding: 24px 18px; }
}
@media (max-width: 560px) {
  .top { padding: 10px 16px; }
  .top > .small, .brand > .muted { display: none; }
  .main { padding: 20px 16px 48px; }
  .hero h1 { font-size: 30px; }
  .main h1 { font-size: 24px; }
  .doc-toc { columns: 1; }
  .paper .doc table.cal td:nth-child(1) { white-space: normal; }
  .paper .doc table.cal td:nth-child(3) { word-break: break-all; }
  .paper .doc table.cal :is(th, td):nth-child(4) { display: none; }
}

/* Printing from the preview prints only the document. */
@media print {
  body { background: #fff; }
  .top, .side, .disclaimer, .toast { display: none !important; }
  .main { padding: 0; max-width: none; }
  .paper { padding: 0; border: 0; box-shadow: none; }
}

/* Free preview: the sections after the first few are listed, not shown. */
.doc-locked { position: relative; margin-top: 18px; padding-top: 56px; }
.doc-locked-fade { position: absolute; left: 0; right: 0; top: -72px; height: 110px; background: linear-gradient(rgba(255, 255, 255, 0), #fff 70%); pointer-events: none; }
.doc-locked-title { position: relative; font-weight: 700; font-size: 16px; }
.doc-locked-list { color: var(--muted); margin: 8px 0; }
.doc-locked-list li::marker { color: var(--muted); }

/* Program sent */
.email { border: 1px solid var(--line-soft); }
.attach { align-self: flex-start; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--page); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.attach:hover { border-color: var(--accent); }
.lead-card { background: var(--panel); border-style: dashed; }
.kv { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 12px; font-size: 14px; }
.perks { margin: 0; padding-left: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.row .btn.sm + .btn.sm { margin-left: -4px; }
.linkbox { padding: 10px 12px; background: var(--page); border-radius: 10px; font-size: 14px; word-break: break-all; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.logo-drop { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; cursor: pointer; }
.logo-drop .btn { pointer-events: none; }
.logo-drop:focus-within .btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.logo-row { display: flex; align-items: center; gap: 12px; }
.logo-thumb { width: 64px; height: 44px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; }
.logo-gc { display: block; max-width: 180px; max-height: 56px; object-fit: contain; }
.example-bar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; border-color: var(--accent); }
.example-bar select { width: auto; flex: 1 1 220px; min-height: 42px; }
.example-bar .small { flex-basis: 100%; }

/* Public mode (prequalifysubs.com) */
.brand-home { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.ts-slot:empty { display: none; }
.form-error { padding: 10px 12px; border-radius: 10px; background: var(--neg-bg); color: var(--neg); font-size: 14px; }
.side a.btn { width: 100%; }
