/* Report, its status pages and the legal pages (src/worker/report, src/worker/legal.tsx).
   Phone first, from the R-Laporan, R-Siswa, R-TesUlang, L-Hapus and L-Privasi boards; /contoh prints as A4 pages (R-Contoh).
   Tokens come from minat.css. */

.rpt { max-width: 440px; margin: 0 auto; padding: 20px 16px 32px; display: flex; flex-direction: column; gap: 16px; }
.sheet { display: flex; flex-direction: column; gap: 16px; }
.rpt-top { display: flex; justify-content: space-between; align-items: center; }
.chip-mint { background: var(--mint); color: var(--teal-text); font-size: 12px; padding: 4px 10px; }
.chip-amber { font-size: 12px; padding: 4px 10px; }
.chip-grey { background: var(--bg); color: var(--muted); font-size: 12px; padding: 4px 10px; border: 1px solid var(--line); }
.muted { font-size: 14px; color: var(--muted); font-weight: 600; }

.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.actions > :only-child, .actions > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.btn-small { min-height: 44px; padding: 10px 12px; font-size: 14px; border-radius: 12px; }
.btn-danger { background: #b42318; color: #fff; }
.btn-danger:hover { background: #912018; color: #fff; }
.btn-link { text-align: center; padding: 12px; font-weight: 700; font-size: 15px; }
[data-copy][data-done]::after { content: " ✓"; }

.sec { background: var(--card); border-radius: var(--radius-card); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.sec h2 { font-size: 19px; }
.sec h3 { font-size: 16px; }
.sec > .chip { align-self: flex-start; }
.sec-amber { background: #fff8ec; border: 1.5px solid var(--amber); }
.sec-mint { background: var(--mint); }
.sec-soft { background: #f7f9fb; border: 1px solid var(--line); }
.lead { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.body { font-size: 15px; line-height: 1.6; }
.small { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.next-bab { display: flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 8px; border-radius: 12px; background: var(--bg); color: var(--navy); font-weight: 800; font-size: 15px; text-decoration: none; }
.next-bab::after { content: "↓"; margin-left: 8px; color: var(--teal-text); }
.box { background: var(--cream); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.55; }
.box-mint { background: var(--mint); color: var(--teal-text); font-weight: 700; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar { display: grid; grid-template-columns: 32px 92px minmax(0, 1fr) 30px; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.bar img { width: 32px; height: 32px; }
.bar .track { height: 10px; background: var(--track); border-radius: 5px; overflow: hidden; }
.bar .track span { display: block; height: 10px; background: #9aa8b8; border-radius: 5px; }
.bar .num { text-align: right; }
.bar-strong { color: var(--ink); font-weight: 600; }
.bar-strong .track span { background: var(--teal); }

/* The top 2 types: the scene floats beside the description, so a phone still reads the text at full size. */
.strong { display: flow-root; }
.strong .scene { float: right; width: 44%; max-width: 240px; height: auto; aspect-ratio: 3 / 2; object-fit: contain; margin: 0 0 6px 12px; border-radius: 12px; background: var(--mint); }

/* "Bidang yang paling cocok": one card per field, scene on the left, counts and major names as chips. */
.field { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: start; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; }
.field:first-of-type { border-color: #b7e0d9; background: #f6fbfa; }
.field img { width: 72px; height: 72px; object-fit: contain; border-radius: 12px; background: var(--mint); }
.field > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-n { font-size: 13px; font-weight: 700; color: var(--muted); }

.field-art { flex: none; object-fit: contain; border-radius: 8px; background: var(--mint); }

.band { display: flex; flex-direction: column; gap: 8px; }
.band-h { font-size: 13px !important; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; margin-top: 4px; }
.band-sangat .band-h { color: var(--teal-text); }
.band-cukup .band-h { color: var(--amber-ink); }
.band-kurang .band-h { color: var(--muted); }
details.row { border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; font-size: 14px; line-height: 1.55; }
details.row[open] { padding-bottom: 12px; }
details.row > summary { list-style: none; font-weight: 700; font-size: 15px; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 0; }
details.row > summary::-webkit-details-marker { display: none; }
details.row > summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 800; }
details.row[open] > summary::after { content: "–"; }
details.row .field-art { width: 28px; height: 28px; border-radius: 6px; }
details.row[open] > summary { margin-bottom: 4px; }
/* The row that holds the ranked list of every major: its bands sit inside with room between them. */
details.band-all > summary { font-size: 16px; color: var(--teal-text); }
details.band-all[open] > .band + .band { margin-top: 16px; }
details.row p + p { margin-top: 6px; }
.band-sangat details.row { border-color: #b7e0d9; }

.major { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.55; }
.major h3 { font-size: 17px !important; display: flex; gap: 6px 10px; align-items: center; }
.major h3 > span:not(.chip) { flex: 1 1 auto; min-width: 0; }
.major h3 > .chip { flex: none; }
.major .field-art { width: 48px; height: 48px; }
.kampus { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.55; }
.kampus + .kampus { margin-top: 12px; }
.world + .world { margin-top: 8px; }
.world ol { margin-top: 6px; }
.kampus h3 { font-size: 17px !important; }
.world ol { padding-left: 22px; display: grid; gap: 2px; }
details.unggul summary { cursor: pointer; font-weight: 700; color: var(--teal-text); min-height: 44px; display: flex; align-items: center; }
details.unggul summary { list-style: none; }
details.unggul summary::-webkit-details-marker { display: none; }
details.unggul summary::after { content: "+"; margin-left: 8px; font-weight: 800; }
details.unggul[open] summary::after { content: "–"; }
.ptn-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ptn-list li { display: flex; align-items: center; gap: 10px; }
.ptn-badge { flex: none; min-width: 52px; height: 32px; padding: 0 8px; border: 1.5px solid var(--teal); border-radius: 8px; color: var(--teal-text); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.ptn-name { display: block; font-weight: 700; }
.ptn-prov { display: block; font-size: 13px; color: var(--muted); }
.next-step { margin-top: 12px; font-weight: 400; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.jump a { text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; }
.region + .region { margin-top: 10px; }
details.unggul > .small + .region { margin-top: 10px; }
.region-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.region-jump a { text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; }
.region { scroll-margin-top: 64px; }
.region-h { font-weight: 800; font-size: 14px; margin: 0; }
.region-list { list-style: none; padding: 0; margin: 2px 0 0; font-size: 14px; line-height: 1.45; }
.region-list li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.region-list li:last-child { border-bottom: 0; }
.kampus-back { align-self: flex-start; color: var(--teal-text); font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.ptn-unggul { margin-left: 6px; font-size: 11px; padding: 1px 8px; vertical-align: 2px; }
.kampus { scroll-margin-top: 64px; }
details.unggul[open] summary { margin-bottom: 6px; }
details.unggul p + p { margin-top: 6px; }
.pay ul { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.major-fold summary { list-style: none; font-weight: 800; font-size: 17px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.major-fold summary::-webkit-details-marker { display: none; }
.major-fold summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 800; }
.major-fold[open] summary::after { content: "–"; }
.major-fold summary > span { flex: 1 1 auto; min-width: 0; }
.major-fold[open] summary { margin-bottom: 8px; }
/* A <details> body is not a flex box, so its lines get the card's gap as margins. */
.major-fold p + p { margin-top: 8px; }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pair > div { background: #f7f9fb; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pair h3 { font-size: 13px !important; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { background: var(--mint); font-size: 13px; }

.list { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.55; }
.steps li.passed { color: var(--muted); }
.cases { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.cases > div { background: #f7f9fb; border-radius: 12px; padding: 12px 14px; }
.cases dt { font-weight: 800; font-size: 14px; }
.cases dd { margin: 4px 0 0; font-size: 14px; line-height: 1.55; }

.tip { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.55; }
.tip-h { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }

.cal { width: 100%; border-collapse: collapse; font-size: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal th, .cal td { text-align: left; vertical-align: top; padding: 10px 12px; }
.cal th { width: 45%; }
.cal tr:nth-child(odd) { background: #f7f9fb; }
.sec .btn-outline.btn-small { align-self: flex-start; }

.rpt-links, .legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 14px; }
.foot { text-align: center; font-size: 12px; color: var(--muted); }

/* Status, retest and delete screens. */
.status { align-items: center; justify-content: center; text-align: center; }
.status-text { font-size: 17px; line-height: 1.55; font-weight: 600; max-width: 320px; }
.back { width: 44px; height: 44px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; }
.h-page { font-size: 26px; }
.h-card { font-size: 15px; }
.facts { margin: 0; background: #fff; border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.facts > div { display: flex; justify-content: space-between; gap: 10px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 700; text-align: right; }
.bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.card .list { font-size: 14px; gap: 6px; }

/* Legal pages (L-Privasi, L-Syarat). */
body:has(.legal) { background: #fff; }
.legal { max-width: 680px; margin: 0 auto; padding: 20px 20px 32px; display: flex; flex-direction: column; gap: 16px; font-size: 15px; line-height: 1.65; }
.legal h1 { font-size: 28px; }
.legal-logo { align-self: flex-start; }
.legal-intro { display: flex; flex-direction: column; gap: 12px; }
.legal p + p, .legal ul + p, .legal p + ul, .legal .table + p, .legal p + .table { margin-top: 10px; }
.legal ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.legal-card { background: #fff8ec; border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.legal-card.legal-teen { background: #eef7f5; }
.legal-card h2 { font-size: 17px; }
.legal-sec { border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; font-size: 14px; }
.legal-sec[open] { padding-bottom: 14px; }
.legal-sec summary { font-size: 15px; font-weight: 700; cursor: pointer; min-height: 48px; padding: 12px 0; display: flex; align-items: center; }
.legal-sec[open] summary { margin-bottom: 4px; }
.legal-next { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.legal .table { overflow-x: auto; }
.legal table { border-collapse: collapse; width: 100%; font-size: 13px; line-height: 1.5; }
.legal th, .legal td { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.legal th { background: #f7f9fb; }
.legal blockquote { margin: 0; padding: 12px 14px; background: #f7f9fb; border-left: 3px solid var(--teal); border-radius: 8px; font-size: 13px; }
.legal code { font-size: 0.92em; background: var(--bg); padding: 1px 4px; border-radius: 4px; }

/* Cover summary, badge and chapters (5 Nov 2026). The bar sits between the cover and the chapter sheets, so it stays
   on screen down the whole report; the page script marks the chapter in view with aria-current. */
.toc { position: sticky; top: 0; z-index: 10; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.toc::-webkit-scrollbar { display: none; }
.toc a { flex: none; white-space: nowrap; font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--navy); text-decoration: none; background: #fff; }
.toc a[aria-current] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chapter { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; color: var(--teal-text); scroll-margin-top: 64px; }
.sec { scroll-margin-top: 64px; }
/* The badge is one compact row everywhere (8 Nov 2026 judged rounds: a large scene pushed the answer off the first screen). */
.badge { display: flex; align-items: center; overflow: hidden; background: var(--cream); }
.badge[data-type="I"], .badge[data-type="S"] { background: var(--mint); }
.badge[data-type="A"] { background: #fce4de; }
.badge[data-type="C"] { background: #e8eef6; }
.badge img { width: 132px; height: auto; flex: none; aspect-ratio: 3 / 2; object-fit: cover; }
.badge > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; min-width: 0; }
.badge-k { font-size: 13px; font-weight: 700; color: var(--muted); }
.badge-n { font-size: 22px; line-height: 1.15; color: var(--navy); overflow-wrap: anywhere; }
.badge-t { font-size: 14px; font-weight: 600; color: var(--teal-text); }
@media screen and (max-width: 600px) {
	.badge img { width: 104px; }
	.badge-n { font-size: 20px; }
}
.thin-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 12px; font-weight: 700; white-space: nowrap; vertical-align: middle; }
/* The cover as a consultant's summary (8 Nov 2026): a navy title band, then the finding, the best majors, numbered
   findings beside the six scores with their source, and the next steps with who does them. Flat, square, hairlines. */
.cover { background: var(--navy); color: #fff; padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; }
.cover h1 { font-size: 24px; line-height: 1.2; color: #fff; overflow-wrap: anywhere; }
.cover-meta { font-size: 14px; color: #c9d3e0; }
.sum-sec { gap: 14px; }
.sum-sec .action { font-size: 21px; line-height: 1.3; }
.top-majors { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.top-majors span { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.top-majors b { font-size: 14px; font-weight: 700; border: 1px solid var(--navy); padding: 3px 9px; color: var(--navy); }
/* The three questions the report answers (8 Nov 2026 tone rounds): a hairline box on the cover. */
.frame3 { border: 1px solid var(--navy); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; }
.frame3-t { font-weight: 700; }
.frame3 ol { margin: 0; padding-left: 20px; display: grid; gap: 3px; }
.frame3 b { color: var(--navy); }
.note { background: var(--cream); padding: 12px 14px; font-size: 14px; line-height: 1.55; }
.sum-grid { display: flex; flex-direction: column; gap: 16px; }
.finds { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.finds li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.finds-n { font-size: 20px; font-weight: 800; line-height: 1.1; color: var(--navy); }
.finds h3 { font-size: 15px !important; line-height: 1.35; }
.finds p { font-size: 14px; line-height: 1.5; color: var(--ink-2); margin-top: 2px; }
.ex { margin: 0; border-top: 2px solid var(--navy); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.ex-h { font-size: 14px; font-weight: 700; color: var(--ink); }
.ex-bars { display: flex; flex-direction: column; gap: 7px; }
.ex-bar { display: grid; grid-template-columns: 98px minmax(0, 1fr) 30px; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.ex-bar .track { height: 12px; background: var(--bg); }
.ex-bar .track span { display: block; height: 12px; background: #a9b4c2; }
.ex-bar .num { text-align: right; font-weight: 600; }
.ex-bar-top { color: var(--ink); font-weight: 700; }
.ex-bar-top .track span { background: var(--navy); }
.src { font-size: 13px; line-height: 1.45; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
table.next { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
table.next th, table.next td { text-align: left; vertical-align: top; padding: 9px 8px 9px 0; border-bottom: 1px solid var(--line); }
table.next thead th { font-size: 13px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--navy); padding-top: 0; }
table.next tbody th { font-weight: 700; width: 28%; }
table.next td:last-child { width: 26%; color: var(--ink-2); }
table.next tr.now th, table.next tr.now td { background: #eef3f2; }
/* Field cards: a dot per major, the key first, the child's picks marked. */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); align-items: center; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.pick-key { background: #eef3f2; color: var(--ink); font-weight: 700; padding: 1px 6px; }
.dot { display: inline-block; flex: none; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--navy); }
.dot-sangat { background: var(--navy); }
.dot-cukup { background: linear-gradient(90deg, var(--navy) 50%, #fff 50%); }
.dots { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.4; }
.dots li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dots li .dot { align-self: center; }
.dots li.pick { background: #eef3f2; padding: 2px 6px; }
.pick-tag { font-weight: 700; color: var(--ink); }
details.band-fold > summary { cursor: pointer; }

/* /contoh on a wide screen: A4 sheets like the R-Contoh board. */
@media (min-width: 900px) {
	body.report:has(.rpt-sample) { background: var(--track); }
	.rpt-sample { max-width: 860px; padding: 33px; gap: 33px; }
	.rpt-sample .sheet { width: 794px; min-height: 1123px; margin: 0 auto; background: #fff; padding: 56px; gap: 24px; }
	.rpt-sample .sec { padding: 0; border-radius: 0; background: none; border: 0; }
	.rpt-sample .sec-amber, .rpt-sample .sec-mint, .rpt-sample .sec-soft { padding: 22px; border-radius: 14px; }
	.rpt-sample .sec-amber { background: #fff8ec; border: 1.5px solid var(--amber); }
	.rpt-sample .sec-mint { background: var(--mint); }
	.rpt-sample .sec-soft { background: #f1f4f8; }
	.rpt-sample .sec h2 { font-size: 24px; }
	.rpt-sample .cover { margin: 0 -56px; padding: 28px 56px 24px; }
	.rpt-sample .cover h1 { font-size: 32px; }
	.rpt-sample .sum-sec .action { font-size: 26px; }
	.rpt-sample .sum-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
	.rpt-sample .badge img { width: 168px; }
	.rpt-sample .field { grid-template-columns: 96px minmax(0, 1fr); }
	.rpt-sample .field img { width: 96px; height: 96px; }
}

/* "Simpan PDF": A4, one sheet per page, every part open, no buttons. */
@media print {
	@page { size: A4; margin: 14mm; }
	html, body { background: #fff !important; }
	.noprint, .actions, .rpt-links { display: none !important; }
	.rpt, .rpt-sample { max-width: none; padding: 0; gap: 0; }
	.rpt .sheet, .rpt-sample .sheet { width: auto; min-height: 0; padding: 0; margin: 0; gap: 14px; background: none; }
	.sheet + .sheet, #teratas { break-before: page; }
	details.row > summary::after, .major-fold summary::after { content: none !important; }
	.sec h2, .sec h3, .band-h { break-after: avoid; }
	.sec { padding: 0; border-radius: 0; background: none !important; border: 0 !important; break-inside: auto; }
	.sec-amber, .sec-mint, .sec-soft { padding: 14px !important; border: 1px solid var(--line) !important; border-radius: 12px; }
	.major, .tip, details.row, .cases > div, .box, .pair > div, .field, .strong { break-inside: avoid; }
	/* The ~60 band lines: compact, so the list takes a few pages instead of eight. */
	details.row { border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0; padding: 5px 0; font-size: 11px; line-height: 1.4; }
	details.row > summary { list-style: none; font-size: 12px; }
	details.row[open] > summary { margin-bottom: 2px; }
	.band { gap: 0; }
	details.row > summary::-webkit-details-marker { display: none; }
	.cover, .badge, .note, .ex-bar .track span, table.next tr.now th, table.next tr.now td, .dot, .dots li.pick, .top-majors b { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.bar .track span, .box, .chip, .field, .field img, .field-art, .strong .scene { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	details.row .field-art { width: 18px; height: 18px; border-radius: 4px; }
	details.row > summary { gap: 6px; }
	a { color: inherit; text-decoration: none; }
}
