/* Laporan A4: 794 x 1123 px (210 x 297 mm pada 96 dpi) */
:root {
  --paper: #FBF6EE;
  --card: #FFFDF9;
  --tint: #F3EADF;
  --ink: #2A2340;
  --ink-2: #5B5470;
  --plum: #3E3368;
  --plum-soft: #E9E4F4;
  --coral: #E46F4E;
  --coral-soft: #F8E1D8;
  --sage: #6E9C7C;
  --line: #E6D9C7;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --hand: "Caveat", cursive;
}
* { box-sizing: border-box; }
/* HP tidak boleh memperbesar huruf sendiri: teks harus tetap muat di kotak dan lingkaran */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: #D9D2C7; font-family: var(--sans); color: var(--ink); -webkit-print-color-adjust: exact; print-color-adjust: exact; }

.toolbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: var(--ink); color: #fff; }
.tb-logo { font-family: var(--serif); font-weight: 700; font-size: 20px; text-decoration: none; color: #fff; }
.tb-logo span { color: var(--coral); }
.tb-info { font-size: 13px; opacity: .75; }
.toolbar button { margin-left: auto; background: var(--coral); color: #fff; border: 0; border-radius: 99px; padding: 9px 18px; font: 600 14px var(--sans); cursor: pointer; }

#doc { padding: 24px 0 60px; zoom: var(--s, 1); }
.page {
  width: 794px; height: 1123px; margin: 0 auto 24px; position: relative; overflow: hidden;
  background: var(--paper); padding: 34px 40px 0; box-shadow: 0 6px 24px rgba(0,0,0,.12);
  display: flex; flex-direction: column;
}

/* Header berjalan */
.run { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--ink-2); letter-spacing: .12em; text-transform: uppercase; }
.run .brand { font-family: var(--serif); font-size: 20px; color: var(--plum); text-transform: none; letter-spacing: 0; font-weight: 600; }
.run .rule { flex: 1; height: 1px; background: var(--line); position: relative; }
.run .rule::after { content: ""; position: absolute; left: 50%; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--coral); }
.run .no { font-family: var(--serif); font-size: 26px; color: var(--plum); letter-spacing: 0; }
.run .no small { font-size: 13px; color: var(--ink-2); }
.ghost { position: absolute; right: 36px; top: 64px; font-family: var(--serif); font-size: 120px; line-height: 1; color: transparent; -webkit-text-stroke: 1px #EDE3D5; pointer-events: none; z-index: 0; }
.page > *:not(.ghost) { position: relative; z-index: 1; }
/* Isi halaman tidak boleh menyusut lalu saling menimpa; kelebihan isi ditangani tighten() di laporan.js */
.page > * { flex-shrink: 0; }

/* Judul */
.kicker { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--coral); font-weight: 700; margin: 18px 0 6px; }
.title { font-family: var(--serif); font-weight: 400; color: var(--plum); font-size: 56px; line-height: 1.02; letter-spacing: -.02em; margin: 6px 0 8px; position: relative; }
.title em { font-style: italic; color: var(--coral); }
.subtitle { color: var(--ink-2); font-size: 15px; margin: 0 0 18px; }

/* Komponen umum */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.tint { background: var(--tint); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; text-align: center; }
.h3 { font-family: var(--serif); font-size: 20px; color: var(--plum); margin: 0 0 8px; font-weight: 600; }
.small { font-size: 12px; color: var(--ink-2); line-height: 1.5; margin: 0; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.ico { width: 34px; height: 34px; border-radius: 50%; background: var(--plum-soft); color: var(--plum); display: grid; place-items: center; flex: 0 0 34px; }
.ico svg { width: 18px; height: 18px; }
.ico.coral { background: var(--coral-soft); color: var(--coral); }
.bar { height: 6px; border-radius: 9px; background: var(--line); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--plum); border-radius: 9px; }
.bar.coral i { background: var(--coral); }
.illus { border-radius: 16px; background: radial-gradient(circle at 50% 42%, #F2B8A0 0 24%, transparent 25%), radial-gradient(circle at 75% 75%, #BFD3C1 0 16%, transparent 17%), linear-gradient(170deg, #E7D7C3, #D8C2A6); position: relative; overflow: hidden; }
.illus img { width: 100%; height: 100%; object-fit: cover; display: block; }
.illus > svg { position: absolute; inset: 0; }
.illus .tag { position: absolute; left: 10px; top: 10px; font-size: 10px; background: rgba(255,253,249,.85); border: 1px dashed var(--ink-2); padding: 2px 8px; border-radius: 99px; color: var(--ink-2); }
.pill { display: inline-block; background: var(--plum); color: #fff; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 6px; font-weight: 600; }

/* Halaman 1 */
.cover-top { display: grid; grid-template-columns: 1fr 170px; gap: 18px; align-items: start; }
.cover-name { font-family: var(--serif); font-weight: 400; color: var(--plum); font-size: 76px; line-height: .98; letter-spacing: -.02em; margin: 6px 0 0; }
.cover-name span { display: block; font-size: 40px; line-height: 1.1; margin-top: 4px; }
.oval { width: 150px; height: 190px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.oval .tag { display: none; }
.hand { font-family: var(--hand); color: var(--coral); font-size: 28px; transform: rotate(-8deg); margin: -20px 0 0 20px; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 16px; }
.chip { display: flex; align-items: center; gap: 8px; background: var(--tint); border-radius: 10px; padding: 7px 11px; font-size: 11px; color: var(--ink-2); }
.chip b { display: block; color: var(--ink); font-weight: 600; font-size: 12px; }
.chip svg { width: 16px; height: 16px; color: var(--coral); }
.score { font-family: var(--serif); font-size: 46px; color: var(--plum); text-align: center; line-height: 1.1; margin: 4px 0; }
.score small { font-size: 22px; color: var(--ink-2); }
.toc-strip { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 11.5px; }
.toc-strip span { display: flex; align-items: center; gap: 6px; }
.toc-strip b { color: var(--coral); }
.quote { margin-top: auto; margin-bottom: 28px; background: var(--plum); color: #F3EEFF; border-radius: 14px; padding: 16px 22px; display: flex; align-items: center; gap: 16px; font-family: var(--serif); font-size: 18px; }
.quote .mark { font-size: 46px; line-height: .6; color: var(--coral); }
.quote .side { margin-left: auto; font-family: var(--sans); font-size: 12px; opacity: .8; border-left: 1px solid rgba(255,255,255,.25); padding-left: 16px; max-width: 150px; }

/* Lingkaran skor */
.ring { width: 190px; height: 190px; margin: 0 auto; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; box-shadow: 0 0 0 8px var(--tint); }
.ring .score { font-size: 50px; }
.arrow-down { text-align: center; color: var(--coral); margin: 12px 0; font-size: 16px; }
.factor { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; }
.factor b { font-size: 13px; display: block; margin-bottom: 2px; }
.steps { display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.step .n { width: 24px; height: 24px; border-radius: 50%; background: var(--plum); color: #fff; font-size: 12px; display: grid; place-items: center; font-weight: 700; }
.step b { font-size: 13px; }
.timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; position: relative; padding-top: 22px; }
.timeline::before { content: ""; position: absolute; top: 6px; left: 16%; right: 16%; height: 2px; background: var(--coral-soft); }
.tl { text-align: center; position: relative; }
.tl::before { content: ""; position: absolute; top: -21px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--coral); }
.tl b { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; display: block; margin-bottom: 6px; }
.tl p { background: var(--tint); border-radius: 10px; padding: 10px; font-size: 11.5px; color: var(--ink-2); margin: 0; line-height: 1.45; }
.banner { margin-top: auto; margin-bottom: 26px; background: var(--tint); border-radius: 12px; padding: 13px; text-align: center; font-family: var(--serif); font-size: 17px; color: var(--plum); }
.banner.dark { background: var(--plum); color: #F3EEFF; }

/* Peta area */
.area-row { display: grid; grid-template-columns: 42px 1fr 64px; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.area-row .code { font-family: var(--serif); font-size: 34px; color: var(--plum); text-align: center; }
.area-row .pct { font-family: var(--serif); font-size: 26px; color: var(--plum); text-align: right; }
.area-row h4 { margin: 0; font-size: 15px; }
.area-row p { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); }

/* List & tabel */
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 12.5px; }
.ticks li { display: flex; gap: 8px; line-height: 1.45; }
.ticks li::before { content: "✓"; color: var(--sage); font-weight: 800; }
.ticks.warn li::before { content: "•"; color: var(--coral); font-size: 16px; line-height: 1; }
table.tk { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11.5px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tk th { background: var(--tint); text-align: left; padding: 9px 10px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.tk td { padding: 15px 10px; border-top: 1px solid var(--line); vertical-align: top; color: var(--ink-2); line-height: 1.45; }
.tk td:first-child { font-family: var(--serif); font-size: 14px; color: var(--ink); font-weight: 600; width: 130px; }
.routine { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.routine .ticks { font-size: 13.5px; gap: 10px; }
.routine .when { font-family: var(--serif); font-size: 22px; color: var(--plum); }
.routine .when small { display: block; font-family: var(--sans); font-size: 11px; color: var(--ink-2); }
.wk { border-left: 3px solid var(--plum); padding: 4px 0 4px 14px; }
.wk .num { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--coral); font-weight: 700; }
.wk h4 { font-family: var(--serif); font-size: 19px; color: var(--plum); margin: 2px 0 6px; font-weight: 600; }
.days { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 16px; font-size: 13px; color: var(--ink-2); }
.wk { padding-top: 10px !important; padding-bottom: 12px !important; }
.wk h4 { font-size: 22px; }
.days b { color: var(--coral); font-weight: 700; }

/* Bagian 2: analisis mendalam */
.page.deep { padding: 34px 48px 0; }
.deep .run2 { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1.5px solid var(--sage); padding-bottom: 8px; font-size: 10px; letter-spacing: .2em; color: var(--ink-2); }
.deep .run2 b { color: var(--plum); display: block; font-size: 11px; }
.deep .eyebrow { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--coral); font-weight: 700; margin: 22px 0 8px; }
.deep h2 { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.1; letter-spacing: -.015em; color: var(--plum); margin: 0 0 14px; }
.deep .lead { font-size: 13px; line-height: 1.75; color: var(--ink-2); margin: 0 0 18px; }
.box { border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 12px; background: var(--card); box-shadow: 0 1px 2px rgba(42,35,64,.04); }
.box h5 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--plum); }
.box h5::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); flex: 0 0 8px; }
.box.plain { background: var(--tint); }
.box.plain h5::before { background: var(--plum); }
.box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.box li { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.5; }
.box li::before { content: ""; flex: 0 0 14px; height: 14px; margin-top: 2px; border: 1.5px solid var(--coral); border-radius: 4px; background: var(--card); }
.inti { margin-top: auto; margin-bottom: 30px; border-left: 4px solid var(--coral); background: var(--coral-soft); border-radius: 0 10px 10px 0; padding: 14px 18px; }
.inti h5 { margin: 0 0 6px; font-size: 10.5px; letter-spacing: .2em; color: var(--coral); }
.inti p { margin: 0; font-size: 12.5px; line-height: 1.6; }
.disclaimer { font-size: 10.5px; color: var(--ink-2); text-align: center; margin: 0 0 18px; }

/* Kartu area & topik */
table.ans { width: 100%; border-collapse: collapse; font-size: 12px; }
table.ans td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.ans td:nth-child(2) { color: var(--plum); font-weight: 600; white-space: nowrap; max-width: 210px; white-space: normal; width: 190px; }
table.ans td:last-child { width: 54px; text-align: right; }
.dots4 { display: inline-flex; gap: 4px; }
.dots4 i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dots4 i.on { background: var(--coral); }
.qa { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.qa p { margin: 0 0 3px; font-size: 12.5px; color: var(--ink-2); }
.qa span { font-size: 13px; font-weight: 600; color: var(--plum); }
.commit { display: flex; align-items: flex-end; gap: 10px; margin-top: 30px; font-size: 13px; color: var(--ink-2); }
.commit span { white-space: nowrap; }
.commit i { flex: 1; border-bottom: 1.5px dotted var(--ink-2); height: 16px; }
/* Bagian penjelasan */
.box.plain li::before { border-radius: 50%; flex-basis: 7px; height: 7px; margin-top: 6px; background: var(--coral); border: 0; }
.myth { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.myth p { margin: 0; font-size: 12.5px; line-height: 1.55; }
.myth span { display: block; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; margin-bottom: 3px; color: var(--coral); }
.myth p + p span { color: var(--sage); }
.note { margin-bottom: 14px; }
.note b { font-size: 13px; color: var(--plum); }
.note i { display: block; border-bottom: 1.5px dotted var(--ink-2); height: 28px; }

/* Pratinjau di halaman hasil tes */
body.preview { background: transparent; overflow: hidden; }
.preview .toolbar { display: none; }
.preview #doc { padding: 0; }
.preview .page { margin: 0 0 16px; box-shadow: none; }

@media print {
  @page { size: A4; margin: 0; }
  body { background: none; }
  .toolbar { display: none; }
  #doc { padding: 0; zoom: 1; }
  .page { margin: 0; box-shadow: none; break-after: page; }
}

/* Memuat / terkunci (laporan berbayar dibuka lewat link email) */
.loading { text-align: center; padding: 80px 20px; color: var(--ink-2); font-size: 15px; }
.locked { max-width: 460px; margin: 60px auto; padding: 28px 24px; background: var(--card); border-radius: 16px; text-align: center; font-family: inherit; }
.locked h2 { font-family: var(--serif); margin: 0 0 10px; }
.locked p { color: var(--ink-2); line-height: 1.6; font-size: 14px; }
.locked a { display: inline-block; margin-top: 8px; color: var(--plum); font-weight: 700; }

/* ---------- Paket Pro / Lengkap ---------- */
.trk { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 10px; }
.trk th, .trk td { border: 1px solid var(--line); height: 40px; text-align: center; padding: 0; background: var(--card); }
.trk th { background: var(--tint); font-weight: 600; color: var(--ink-2); height: 22px; }
.trk th:first-child, .trk td:first-child { width: 150px; text-align: left; padding: 0 8px; font-size: 11px; color: var(--ink); }
.tk.ck td { padding: 12px 10px; }
.tk.ck td:not(:first-child), .tk.ck th:not(:first-child) { text-align: center; width: 15%; }
.tk.pt td { padding: 6px 10px; font-size: 12px; }
.tk.pt td:not(:first-child), .tk.pt th:not(:first-child) { text-align: center; width: 34px; color: var(--ink-2); }
.tk.pt .pt-h td { background: var(--tint); font-weight: 700; color: var(--plum); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 7px 10px; }
.tk.pt .pt-sum td { font-size: 11px; color: var(--ink-2); text-align: right; }
.tk.pt .pt-sum td:last-child { text-align: left; }
.tk.pt td:first-child { width: auto; font-family: var(--sans); font-size: 12px; font-weight: 400; color: var(--ink); }
.tk.ck td:first-child { width: auto; font-size: 13px; }

/* ---------- Analisis mendalam: judul + ilustrasi ---------- */
.dhead { display: grid; grid-template-columns: 1fr 210px; gap: 22px; align-items: center; margin: 6px 0 6px; }
.dhead.noart { grid-template-columns: 1fr; }
.dhead h2 { margin-bottom: 0; }
.dart { position: relative; height: 158px; border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.dart svg { width: 100%; height: 100%; display: block; }
.dart.hero { height: 300px; margin-top: 22px; }
.dchip { position: absolute; left: 10px; bottom: 10px; background: rgba(255,253,249,.94); border-radius: 12px; padding: 4px 12px; font-family: var(--serif); font-size: 26px; color: var(--plum); line-height: 1.2; box-shadow: 0 2px 8px rgba(42,35,64,.12); }
.dchip small { font-size: 14px; color: var(--ink-2); }
.wkstep { display: flex; gap: 6px; margin: 4px 0 14px; }
.wkstep span { flex: 1; text-align: center; font-size: 10.5px; font-weight: 600; color: var(--ink-2); background: var(--tint); border-radius: 99px; padding: 6px 4px; }
.wkstep span.done { background: var(--coral-soft); color: var(--coral); }
.wkstep span.on { background: var(--plum); color: #fff; }
.deep .lead { margin-top: 10px; }

/* Pengaman isi terlalu panjang (diatur tighten() di laporan.js) */
.page.fit1 .lead { font-size: 12px; line-height: 1.6; margin-bottom: 12px; }
.page.fit1 .box { padding: 10px 14px; margin-bottom: 9px; }
.page.fit1 .box li { font-size: 12px; line-height: 1.45; }
.page.fit1 .dart:not(.hero) { height: 128px; }
.page.fit1 .dart.hero { height: 220px; }
.page.fit1 .tk.pt td { padding: 4px 10px; font-size: 11.5px; }
.page.fit1 .trk td, .page.fit1 .trk th { height: 32px; }
.page.fit2 .dhead { grid-template-columns: 1fr; }
.page.fit2 .dart { display: none; }
.page.fit2 .deep h2, .page.fit2 h2 { font-size: 30px; }
.page.fit2 .box li { font-size: 11.5px; line-height: 1.4; }
.page.fit2 .box ul { gap: 5px; }
.deep table.tk { margin-bottom: 16px; }
.run > span:nth-child(3) { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
