/* =========================================================
   Asesmen Merdeka — tema 3D dengan warna yang bisa diubah
   Semua warna diturunkan dari --h (hue) & --s (saturasi)
   sehingga kombinasi apa pun tetap serasi dan nyaman dilihat.
   ========================================================= */
:root {
  --h: 228; --s: 72; --h2: calc(var(--h) + 38);
  --depth: 1;
  --radius: 18px;
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;

  --bg: hsl(var(--h) 45% 95%);
  --bg2: hsl(var(--h2) 50% 92%);
  --surface: hsl(var(--h) 60% 99% / .78);
  --surface-solid: hsl(var(--h) 50% 99%);
  --surface-2: hsl(var(--h) 40% 93%);
  --border: hsl(var(--h) 35% 85%);
  --text: hsl(var(--h) 35% 16%);
  --muted: hsl(var(--h) 15% 42%);
  --primary: hsl(var(--h) calc(var(--s) * 1%) 52%);
  --primary-strong: hsl(var(--h) calc(var(--s) * 1%) 40%);
  --primary-soft: hsl(var(--h) calc(var(--s) * 1%) 92%);
  --accent: hsl(var(--h2) calc(var(--s) * 1%) 55%);
  --accent-soft: hsl(var(--h2) calc(var(--s) * 1%) 92%);
  --on-primary: #fff;
  --ok: hsl(152 55% 40%); --ok-soft: hsl(152 55% 92%);
  --warn: hsl(36 90% 45%); --warn-soft: hsl(40 95% 91%);
  --bad: hsl(354 70% 52%); --bad-soft: hsl(354 80% 94%);
  --shadow-c: hsl(var(--h) 50% 30% / .18);
  --shadow: 0 calc(2px * var(--depth)) 4px var(--shadow-c), 0 calc(14px * var(--depth)) calc(30px * var(--depth)) var(--shadow-c);
  --shadow-lg: 0 calc(4px * var(--depth)) 8px var(--shadow-c), 0 calc(28px * var(--depth)) calc(60px * var(--depth)) var(--shadow-c);
}
[data-mode="dark"] {
  --bg: hsl(var(--h) 30% 9%);
  --bg2: hsl(var(--h2) 35% 13%);
  --surface: hsl(var(--h) 28% 15% / .78);
  --surface-solid: hsl(var(--h) 28% 15%);
  --surface-2: hsl(var(--h) 25% 20%);
  --border: hsl(var(--h) 22% 26%);
  --text: hsl(var(--h) 30% 93%);
  --muted: hsl(var(--h) 15% 68%);
  --primary: hsl(var(--h) calc(var(--s) * 1%) 64%);
  --primary-strong: hsl(var(--h) calc(var(--s) * 1%) 50%);
  --primary-soft: hsl(var(--h) 35% 24%);
  --accent: hsl(var(--h2) calc(var(--s) * 1%) 65%);
  --accent-soft: hsl(var(--h2) 30% 22%);
  --on-primary: hsl(var(--h) 40% 10%);
  --ok-soft: hsl(152 35% 18%); --warn-soft: hsl(36 40% 18%); --bad-soft: hsl(354 35% 20%);
  --shadow-c: hsl(var(--h) 60% 2% / .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--text); font-size: 15px; line-height: 1.5;
  background: radial-gradient(1200px 700px at 10% -10%, var(--bg2), transparent 60%),
              radial-gradient(900px 600px at 110% 10%, hsl(var(--h) 60% 85% / .35), transparent 60%),
              var(--bg);
  background-attachment: fixed;
  transition: background-color .4s, color .4s;
}
[data-mode="dark"] body { background: radial-gradient(1200px 700px at 10% -10%, var(--bg2), transparent 60%), radial-gradient(900px 600px at 110% 10%, hsl(var(--h) 60% 30% / .25), transparent 60%), var(--bg); background-attachment: fixed; }
a { color: var(--primary); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.08rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* ---------- Latar 3D bergerak ---------- */
.scene { position: fixed; inset: 0; z-index: -1; perspective: 900px; overflow: hidden; pointer-events: none; }
.shape { position: absolute; transform-style: preserve-3d; animation: float 18s ease-in-out infinite; opacity: .55; }
.shape.cube { width: 90px; height: 90px; }
.shape.cube .f { position: absolute; inset: 0; border-radius: 14px; background: linear-gradient(135deg, hsl(var(--h) 80% 70% / .55), hsl(var(--h2) 80% 65% / .35)); border: 1px solid hsl(var(--h) 80% 80% / .5); }
.shape.cube .f:nth-child(1) { transform: translateZ(45px); }
.shape.cube .f:nth-child(2) { transform: rotateY(180deg) translateZ(45px); }
.shape.cube .f:nth-child(3) { transform: rotateY(90deg) translateZ(45px); }
.shape.cube .f:nth-child(4) { transform: rotateY(-90deg) translateZ(45px); }
.shape.cube .f:nth-child(5) { transform: rotateX(90deg) translateZ(45px); }
.shape.cube .f:nth-child(6) { transform: rotateX(-90deg) translateZ(45px); }
.shape.ball { width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, hsl(var(--h2) 90% 85% / .9), hsl(var(--h) 70% 55% / .5) 55%, transparent 72%); filter: blur(1px); }
.shape.ring { width: 220px; height: 220px; border-radius: 50%; border: 18px solid hsl(var(--h) 70% 65% / .25); box-shadow: inset 0 0 30px hsl(var(--h2) 80% 70% / .3); }
.s1 { top: 12%; left: 6%; } .s2 { top: 62%; left: 80%; animation-delay: -6s; animation-duration: 22s; }
.s3 { top: 70%; left: 18%; animation-delay: -3s; } .s4 { top: 8%; left: 72%; animation-delay: -9s; animation-duration: 26s; }
.s5 { top: 40%; left: 48%; animation-delay: -12s; animation-duration: 30s; opacity: .25; }
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) rotateX(15deg) rotateY(0); }
  33% { transform: translate3d(30px, -40px, 80px) rotateX(120deg) rotateY(90deg); }
  66% { transform: translate3d(-30px, 20px, -60px) rotateX(240deg) rotateY(200deg); }
}
[data-motion="off"] .shape, [data-motion="off"] .logo-cube { animation: none; }
@media (prefers-reduced-motion: reduce) { .shape, .logo-cube { animation: none !important; } }

/* ---------- Tata letak ---------- */
.app { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px;
  background: var(--surface); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-right: 1px solid var(--border); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; text-decoration: none; color: inherit; }
.brand b { display: block; font-size: 1.05rem; }
.brand small { color: var(--muted); font-size: .75rem; }
.logo-wrap { width: 42px; height: 42px; perspective: 300px; flex: none; }
.logo-cube { width: 42px; height: 42px; position: relative; transform-style: preserve-3d; animation: spin 12s linear infinite; }
.logo-cube span { position: absolute; inset: 0; border-radius: 8px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 15px;
  background: linear-gradient(135deg, var(--primary), var(--accent)); border: 1px solid hsl(0 0% 100% / .35); }
.logo-cube span:nth-child(1) { transform: translateZ(21px); }
.logo-cube span:nth-child(2) { transform: rotateY(90deg) translateZ(21px); filter: brightness(.85); }
.logo-cube span:nth-child(3) { transform: rotateY(180deg) translateZ(21px); }
.logo-cube span:nth-child(4) { transform: rotateY(-90deg) translateZ(21px); filter: brightness(.85); }
.logo-cube span:nth-child(5) { transform: rotateX(90deg) translateZ(21px); filter: brightness(1.1); }
.logo-cube span:nth-child(6) { transform: rotateX(-90deg) translateZ(21px); filter: brightness(.7); }
@keyframes spin { from { transform: rotateX(-18deg) rotateY(0); } to { transform: rotateX(-18deg) rotateY(360deg); } }

.nav-group { margin: 14px 8px 6px; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 2px 0; border-radius: 12px;
  color: var(--text); text-decoration: none; font-weight: 550; font-size: .92rem;
  transition: transform .18s, background .18s, box-shadow .18s;
}
.nav a .ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); font-size: 15px; flex: none;
  box-shadow: inset 0 -2px 0 hsl(var(--h) 30% 50% / .15); }
.nav a .tag { margin-left: auto; font-size: .68rem; padding: 1px 7px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-strong); font-weight: 700; }
[data-mode="dark"] .nav a .tag { color: var(--primary); }
.nav a:hover { background: var(--primary-soft); transform: translateX(3px); }
.nav a.active { background: linear-gradient(135deg, var(--primary), var(--accent)); color: var(--on-primary); box-shadow: 0 6px 18px hsl(var(--h) 70% 45% / .35); }
.nav a.active .ic { background: hsl(0 0% 100% / .22); }
.nav a.active .tag { background: hsl(0 0% 100% / .25); color: inherit; }

.main { padding: 22px 28px 60px; min-width: 0; }
.topbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.topbar .title { flex: 1; min-width: 200px; }
.topbar .title h1 { margin: 0; }
.btn.menu-btn { display: none; }
.ctx { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.ctx label { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ctx select { min-width: 120px; }

/* ---------- Kartu 3D ---------- */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card {
  background: var(--surface); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  position: relative;
}
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; flex: 1; }
.tilt { transform-style: preserve-3d; transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; will-change: transform; }
.tilt:hover { box-shadow: var(--shadow-lg); }
.tilt .z1 { transform: translateZ(calc(22px * var(--depth))); }
.tilt .z2 { transform: translateZ(calc(42px * var(--depth))); }
.tilt::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), hsl(0 0% 100% / .22), transparent 45%); opacity: 0; transition: opacity .25s; }
.tilt:hover::after { opacity: 1; }

.stat { overflow: hidden; }
.stat .num { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat .blob { position: absolute; right: -18px; top: -18px; width: 92px; height: 92px; border-radius: 28px; transform: rotate(18deg);
  background: linear-gradient(135deg, var(--primary), var(--accent)); opacity: .9; display: grid; place-items: center; font-size: 30px;
  box-shadow: inset -6px -8px 0 hsl(0 0% 0% / .12), 0 12px 24px hsl(var(--h) 70% 40% / .35); }
.stat .blob span { transform: rotate(-18deg) translate(-8px, 8px); }

.hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: center; overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border: none;
}
[data-mode="dark"] .hero { color: hsl(var(--h) 40% 8%); }
.hero h1 { font-size: 2rem; }
.hero p { opacity: .92; margin: 0 0 14px; max-width: 620px; }
.hero .stage { height: 210px; perspective: 700px; display: grid; place-items: center; }
.hero .big-cube { width: 120px; height: 120px; position: relative; transform-style: preserve-3d; animation: spin 16s linear infinite; }
.hero .big-cube div { position: absolute; inset: 0; border-radius: 22px; display: grid; place-items: center; font-weight: 800; font-size: 22px;
  background: hsl(0 0% 100% / .18); border: 2px solid hsl(0 0% 100% / .55); backdrop-filter: blur(4px); color: #fff; text-shadow: 0 2px 6px hsl(0 0% 0% / .25); }
.hero .big-cube div:nth-child(1) { transform: translateZ(60px); }
.hero .big-cube div:nth-child(2) { transform: rotateY(90deg) translateZ(60px); }
.hero .big-cube div:nth-child(3) { transform: rotateY(180deg) translateZ(60px); }
.hero .big-cube div:nth-child(4) { transform: rotateY(-90deg) translateZ(60px); }
.hero .big-cube div:nth-child(5) { transform: rotateX(90deg) translateZ(60px); }
.hero .big-cube div:nth-child(6) { transform: rotateX(-90deg) translateZ(60px); }
[data-motion="off"] .big-cube { animation: none; transform: rotateX(-20deg) rotateY(35deg); }

.tile { cursor: pointer; text-decoration: none; color: inherit; display: block; }
.tile .ico3d { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; margin-bottom: 12px;
  background: linear-gradient(145deg, var(--primary-soft), var(--accent-soft));
  box-shadow: 0 calc(6px * var(--depth)) 0 hsl(var(--h) 40% 70% / .55), 0 calc(12px * var(--depth)) 20px var(--shadow-c); }
[data-mode="dark"] .tile .ico3d { box-shadow: 0 calc(6px * var(--depth)) 0 hsl(var(--h) 30% 8%), 0 calc(12px * var(--depth)) 20px var(--shadow-c); }
.tile h3 { margin-bottom: 2px; }
.tile .old { font-size: .76rem; color: var(--muted); }
.tile .old s { opacity: .8; }

/* ---------- Kontrol ---------- */
.btn {
  --b: var(--primary); --bd: var(--primary-strong); --c: var(--on-primary);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 12px; border: none;
  font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; color: var(--c); text-decoration: none; white-space: nowrap;
  background: linear-gradient(180deg, color-mix(in srgb, var(--b) 85%, white), var(--b));
  box-shadow: 0 calc(4px * var(--depth)) 0 var(--bd), 0 calc(8px * var(--depth)) 14px var(--shadow-c);
  transform: translateY(0); transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(calc(3px * var(--depth))); box-shadow: 0 calc(1px * var(--depth)) 0 var(--bd), 0 3px 6px var(--shadow-c); }
.btn.ghost { --b: var(--surface-solid); --bd: var(--border); --c: var(--text); border: 1px solid var(--border); }
.btn.soft { --b: var(--primary-soft); --bd: hsl(var(--h) 40% 78%); --c: var(--primary-strong); }
[data-mode="dark"] .btn.soft { --bd: hsl(var(--h) 30% 12%); --c: var(--primary); }
.btn.danger { --b: var(--bad); --bd: hsl(354 60% 38%); --c: #fff; }
.btn.ok { --b: var(--ok); --bd: hsl(152 55% 28%); --c: #fff; }
.btn.sm { padding: 5px 10px; font-size: .8rem; border-radius: 9px; }
.btn.lg { padding: 13px 22px; font-size: 1rem; border-radius: 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface-solid); border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px;
  box-shadow: inset 0 2px 3px hsl(var(--h) 30% 40% / .08); outline: none; transition: border-color .15s, box-shadow .15s; max-width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px hsl(var(--h) 80% 60% / .25); }
textarea { width: 100%; min-height: 90px; resize: vertical; }
input[type=range] { padding: 0; box-shadow: none; accent-color: var(--primary); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 17px; height: 17px; vertical-align: middle; }
input[type=color] { padding: 2px; width: 44px; height: 36px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: .8rem; font-weight: 700; color: var(--muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1; min-width: 140px; }

/* ---------- Tabel ---------- */
.table-wrap { overflow: auto; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-solid); max-height: 70vh; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .9rem; }
th, td { padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
tbody tr:hover td { background: hsl(var(--h) 60% 60% / .06); }
td.num, th.num { text-align: center; }
td input.score { width: 76px; text-align: center; font-weight: 700; padding: 6px; }
td input.score.low { border-color: var(--bad); background: var(--bad-soft); }
td input.score.high { border-color: var(--ok); }
tfoot td { font-weight: 700; background: var(--surface-2); }
.sticky-col { position: sticky; left: 0; background: var(--surface-solid); z-index: 1; }
th.sticky-col { z-index: 3; background: var(--surface-2); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.pri { background: var(--primary-soft); color: var(--primary-strong); }
[data-mode="dark"] .pill.pri { color: var(--primary); }
.grade { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-weight: 800; color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--accent)); box-shadow: 0 3px 0 var(--primary-strong); }
.grade.D { background: linear-gradient(145deg, hsl(354 70% 60%), hsl(354 70% 48%)); box-shadow: 0 3px 0 hsl(354 60% 35%); }
.grade.C { background: linear-gradient(145deg, hsl(36 90% 58%), hsl(30 90% 48%)); box-shadow: 0 3px 0 hsl(30 80% 35%); }

.bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); }

/* Grafik batang 3D sederhana */
.chart3d { display: flex; gap: 14px; align-items: flex-end; height: 200px; padding: 10px 6px 0; perspective: 600px; }
.chart3d .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.chart3d .barz { width: 70%; max-width: 56px; position: relative; transform-style: preserve-3d; transform: rotateX(-12deg) rotateY(-22deg);
  background: linear-gradient(180deg, var(--accent), var(--primary)); border-radius: 6px 6px 2px 2px; transition: height .6s cubic-bezier(.2,.8,.2,1); min-height: 2px; }
.chart3d .barz::before { content: ''; position: absolute; top: 0; left: 100%; width: 14px; height: 100%; background: var(--primary-strong); transform-origin: left; transform: rotateY(90deg); filter: brightness(.85); }
.chart3d .barz::after { content: ''; position: absolute; bottom: 100%; left: 0; width: 100%; height: 14px; background: var(--accent); transform-origin: bottom; transform: rotateX(90deg); filter: brightness(1.15); border-radius: 6px 6px 0 0; }
.chart3d .v { font-weight: 800; font-size: .85rem; }
.chart3d .l { font-size: .72rem; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- Tab ---------- */
.tabs { display: flex; gap: 6px; padding: 5px; border-radius: 14px; background: var(--surface-2); width: fit-content; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: none; background: transparent; font: inherit; font-weight: 700; font-size: .88rem; padding: 7px 14px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--surface-solid); color: var(--text); box-shadow: 0 2px 0 var(--border), 0 4px 10px var(--shadow-c); }

/* ---------- Unggah PDF ---------- */
.drop {
  border: 2.5px dashed hsl(var(--h) 50% 70%); border-radius: 20px; padding: 34px 20px; text-align: center; cursor: pointer;
  background: linear-gradient(145deg, var(--primary-soft), var(--accent-soft)); transition: transform .2s, border-color .2s;
}
.drop:hover, .drop.over { transform: translateY(-3px) scale(1.01); border-color: var(--primary); }
.drop .pdf3d { width: 70px; height: 86px; margin: 0 auto 12px; position: relative; transform: perspective(300px) rotateY(-22deg) rotateX(8deg);
  background: var(--surface-solid); border-radius: 8px; box-shadow: 8px 10px 0 hsl(var(--h) 40% 70% / .6), 0 18px 30px var(--shadow-c); display: grid; place-items: center; font-weight: 900; color: var(--bad); }
.drop .pdf3d::before { content: ''; position: absolute; top: 0; right: 0; border-width: 0 18px 18px 0; border-style: solid; border-color: var(--bg) var(--bg) var(--surface-2) var(--surface-2); border-radius: 0 0 0 5px; }

/* ---------- Soal ---------- */
.q-card { border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: var(--surface-solid); margin-bottom: 12px; box-shadow: 0 3px 0 var(--border); }
.q-card .q-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.q-card .qn { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: linear-gradient(145deg, var(--primary), var(--accent)); color: #fff; flex: none; }
.q-card textarea { min-height: 54px; }
.opt-row { display: flex; gap: 8px; align-items: center; margin: 5px 0; }
.opt-row .lab { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); cursor: pointer; flex: none; border: 2px solid transparent; }
.opt-row .lab.key { background: var(--ok); color: #fff; }
.opt-row input[type=text] { flex: 1; }
.q-text { white-space: pre-wrap; font-size: 1.02rem; }

.exam-opt { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-radius: 14px; border: 2px solid var(--border); margin: 8px 0; cursor: pointer;
  background: var(--surface-solid); transition: transform .12s, border-color .12s, box-shadow .12s; box-shadow: 0 3px 0 var(--border); }
.exam-opt:hover { transform: translateY(-2px); border-color: var(--primary); }
.exam-opt.sel { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 3px 0 var(--primary); }
.exam-opt .lab { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); flex: none; }
.exam-opt.sel .lab { background: var(--primary); color: var(--on-primary); }
.exam-opt.right { border-color: var(--ok); background: var(--ok-soft); }
.exam-opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; }
.qnav button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-solid); font: inherit; font-weight: 700; cursor: pointer; color: var(--text); box-shadow: 0 2px 0 var(--border); }
.qnav button.done { background: var(--primary-soft); border-color: var(--primary); }
.qnav button.cur { background: var(--primary); color: var(--on-primary); }
.score-big { font-size: 4rem; font-weight: 900; letter-spacing: -.04em; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }

/* ---------- Tema ---------- */
.swatches { display: flex; gap: 30px 12px; flex-wrap: wrap; }
.swatch { width: 64px; height: 64px; border-radius: 18px; border: 3px solid transparent; cursor: pointer; position: relative; transform: perspective(200px) rotateX(10deg);
  box-shadow: 0 6px 0 hsl(0 0% 0% / .15), 0 10px 18px hsl(0 0% 0% / .15); transition: transform .15s; }
.swatch:hover { transform: perspective(200px) rotateX(0) translateY(-3px); }
.swatch.on { border-color: var(--text); }
.swatch small { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: .68rem; font-weight: 700; color: var(--muted); }
.hue-slider { width: 100%; height: 16px; border-radius: 99px; -webkit-appearance: none; appearance: none;
  background: linear-gradient(90deg, hsl(0 70% 55%), hsl(60 70% 50%), hsl(120 60% 45%), hsl(180 60% 45%), hsl(240 70% 60%), hsl(300 60% 55%), hsl(360 70% 55%)); }
.hue-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 4px solid var(--primary); box-shadow: 0 3px 8px hsl(0 0% 0% / .3); cursor: pointer; }
.hue-slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 4px solid var(--primary); cursor: pointer; }

/* ---------- Modal & Toast ---------- */
.modal-bg { position: fixed; inset: 0; background: hsl(var(--h) 40% 8% / .45); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .2s; }
.modal { width: min(720px, 100%); max-height: 90vh; overflow: auto; background: var(--surface-solid); border-radius: 22px; padding: 22px; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  animation: pop .3s cubic-bezier(.2,.9,.3,1.2); transform-origin: center; }
.modal.wide { width: min(1000px, 100%); }
.modal h2 { margin-bottom: 14px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
@keyframes pop { from { transform: perspective(800px) rotateX(-18deg) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { padding: 11px 16px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-weight: 600; animation: pop .3s; max-width: 360px; }
.toast.ok { border-left: 5px solid var(--ok); } .toast.bad { border-left: 5px solid var(--bad); }

.page { animation: enter .45s cubic-bezier(.2,.8,.2,1); }
@keyframes enter { from { opacity: 0; transform: perspective(1200px) rotateY(-6deg) translateX(18px); } }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .big { font-size: 44px; margin-bottom: 6px; }
.note { padding: 11px 14px; border-radius: 12px; background: var(--primary-soft); font-size: .88rem; border-left: 4px solid var(--primary); }
.note.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.list-warn { max-height: 140px; overflow: auto; margin: 6px 0 0; padding-left: 18px; font-size: .84rem; }
.kbd { font-family: ui-monospace, monospace; font-size: .8rem; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.progress-ring { display: inline-block; }

/* ---------- Responsif ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-105%); transition: transform .3s; box-shadow: var(--shadow-lg); background: var(--surface-solid); }
  .sidebar.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .main { padding: 16px 14px 60px; }
  .hero { grid-template-columns: 1fr; } .hero .stage { display: none; }
  .g2, .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: 1fr 1fr; } h1 { font-size: 1.4rem; } .stat .blob { width: 62px; height: 62px; font-size: 20px; border-radius: 18px; } .stat .num { font-size: 1.6rem; } .stat .lbl { font-size: .78rem; } }

/* ---------- Cetak ---------- */
@media print {
  .sidebar, .topbar .ctx, .btns, .btn, .scene, .no-print, .toasts { display: none !important; }
  .app { display: block; } .main { padding: 0; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; backdrop-filter: none; background: #fff; }
  .table-wrap { max-height: none; overflow: visible; border: none; }
  th { position: static; background: #eee; color: #000; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ---------- Akun & sinkronisasi (mode server) ---------- */
.sidebar { display: flex; flex-direction: column; }
.sidebar .nav { flex: 1; }
.user-box { display: flex; align-items: center; gap: 10px; padding: 10px; margin-top: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.user-box .avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 3px 0 var(--primary-strong); }
.ellipsis { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--ok); vertical-align: middle; }
.sync-dot.saving { background: var(--warn); animation: blink 1s infinite; }
.sync-dot.error { background: var(--bad); }
@keyframes blink { 50% { opacity: .3; } }
body.auth-mode .app { display: none; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(440px, 100%); }

/* ---------- Halaman ujian murid ---------- */
.student-wrap { max-width: 860px; margin: 0 auto; padding: 22px 16px 60px; }
.student-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.token-input { font-size: 1.8rem; text-align: center; letter-spacing: .3em; text-transform: uppercase; font-weight: 800; width: 100%; padding: 14px; }
.student-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 50vh; overflow: auto; padding: 2px; }
.student-list button { justify-content: space-between; }
.exam-share { border: 2px solid var(--primary-soft); }
.exam-share.open { border-color: var(--ok); }
.exam-share-grid { display: grid; grid-template-columns: 270px 1fr; gap: 20px; align-items: center; }
.exam-token { text-align: center; padding: 14px; border-radius: 16px; background: linear-gradient(145deg, var(--primary-soft), var(--accent-soft)); }
.token-big { font-size: 2.3rem !important; letter-spacing: .08em; white-space: nowrap; }
.share-link { display: flex; gap: 6px; margin: 6px 0; flex-wrap: wrap; }
.share-link input { flex: 1; min-width: 200px; font-size: .85rem; }
@media (max-width: 700px) { .exam-share-grid { grid-template-columns: 1fr; } }
.brand small.ver { display: block; font-size: .65rem; opacity: .7; }

/* ---------- Langganan (SaaS) ---------- */
.sub-badge { display: inline-block; margin-top: 4px; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; text-decoration: none; background: var(--primary-soft); color: var(--primary-strong); }
.sub-badge.trial { background: var(--warn-soft); color: var(--warn); }
.sub-badge.active, .sub-badge.unlimited { background: var(--ok-soft); color: var(--ok); }
.sub-badge.expired, .sub-badge.suspended { background: var(--bad-soft); color: var(--bad); }
.plan-card { text-align: left; }
.plan-card.featured { border: 2px solid var(--primary); }
.plan-card .price { font-size: 2rem; font-weight: 900; letter-spacing: -.03em; margin: 6px 0 2px; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pay-box { text-align: center; padding: 16px; border-radius: 16px; background: linear-gradient(145deg, var(--primary-soft), var(--accent-soft)); margin-bottom: 14px; }
.bank-info { white-space: pre-wrap; background: var(--surface-2); padding: 12px; border-radius: 12px; font-family: inherit; font-weight: 600; margin: 0 0 14px; }
.pay-row { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; flex-wrap: wrap; background: var(--surface-solid); }
.pay-row img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.pay-row .noimg { width: 84px; height: 84px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); font-size: .7rem; color: var(--muted); }
.plan-row { border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px 0; margin-bottom: 10px; }
.tabs button .pill { margin-left: 4px; }

/* ---------- Gambar soal ---------- */
.q-img { display: block; max-width: 100%; max-height: 55vh; height: auto; width: auto; margin: 0 auto 12px; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
img.zoomable { cursor: zoom-in; }
.q-img-row { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; flex-wrap: wrap; }
.q-img-row img { max-width: min(100%, 420px); max-height: 220px; height: auto; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.img-zoom { position: fixed; inset: 0; z-index: 300; background: hsl(0 0% 0% / .85); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 14px; cursor: zoom-out; animation: fade .2s; }
.img-zoom img { max-width: 100%; max-height: 86vh; object-fit: contain; background: #fff; border-radius: 10px; touch-action: pinch-zoom; }
.crop-stage { position: relative; max-height: 68vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); cursor: crosshair; touch-action: none; user-select: none; }
.crop-stage canvas { display: block; width: 100%; height: auto; }
.crop-sel { position: absolute; border: 2px solid var(--primary); background: hsl(var(--h) 80% 60% / .18); box-shadow: 0 0 0 9999px hsl(0 0% 0% / .25); pointer-events: none; }

/* =========================================================
   v5 — Tampilan "Galaksi": rel ikon bulat + daftar menu bergaya kanal
   ========================================================= */
:root { --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif; --font-display: 'Unbounded', 'Plus Jakarta Sans', sans-serif; }
body { font-family: var(--font); }
.topbar .title h1, .hero h1, .hero h2, .auth-card h2, .host-code, .score-big, .kz-final-score, .kz-count-n, .stat .num, .display { font-family: var(--font-display); letter-spacing: -.02em; }
.topbar .title h1 { font-size: 1.45rem; font-weight: 800; }
.stat .num { font-weight: 800; }

/* Mode gelap = malam galaksi */
[data-mode="dark"] {
  --bg: hsl(var(--h) 48% 9%);
  --bg2: hsl(calc(var(--h) + 20) 55% 16%);
  --surface: hsl(var(--h) 32% 15% / .82);
  --surface-solid: hsl(var(--h) 30% 15%);
  --surface-2: hsl(var(--h) 28% 21%);
  --border: hsl(var(--h) 26% 27%);
  --primary: hsl(var(--h) calc(var(--s) * 1%) 67%);
  --primary-strong: hsl(var(--h) calc(var(--s) * 1%) 52%);
  --on-primary: #fff;
}
[data-mode="dark"] body {
  background: radial-gradient(1100px 650px at 80% -5%, hsl(var(--h) 70% 30% / .75), transparent 60%),
              radial-gradient(900px 600px at 0% 40%, hsl(calc(var(--h) + 25) 60% 22% / .7), transparent 65%), var(--bg);
}
[data-mode="dark"] body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: radial-gradient(1.2px 1.2px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 140px 90px, #fff, transparent), radial-gradient(1.6px 1.6px at 230px 170px, #e3dcff, transparent), radial-gradient(1px 1px at 320px 50px, #fff, transparent);
  background-size: 360px 230px; }
[data-mode="dark"] .scene { opacity: .55; }
[data-mode="dark"] .btn.ghost { --b: hsl(var(--h) 25% 24%); --bd: hsl(var(--h) 30% 12%); --c: var(--text); border-color: hsl(var(--h) 25% 30%); }
[data-mode="dark"] .hero { color: #fff; background: linear-gradient(135deg, hsl(var(--h) 75% 58%), hsl(calc(var(--h) + 30) 70% 42%)); }

/* Tata letak 3 kolom: rel ikon | menu | konten */
.app { grid-template-columns: 76px 248px minmax(0, 1fr); }
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0;
  background: hsl(var(--h) 40% 6% / .92); z-index: 21; scrollbar-width: none; }
[data-mode="light"] .rail { background: hsl(var(--h) 35% 22%); }
.rail a { position: relative; width: 50px; height: 50px; display: grid; place-items: center; text-decoration: none; color: #fff;
  border-radius: 50%; background: hsl(var(--h) 25% 22%); font-size: 22px; transition: border-radius .18s, background .18s, transform .18s; }
.rail a:hover { border-radius: 16px; background: var(--primary); }
.rail a.on { border-radius: 16px; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 6px 18px hsl(var(--h) 80% 40% / .5); }
.rail a::before { content: ''; position: absolute; left: -13px; width: 6px; height: 0; border-radius: 0 6px 6px 0; background: #fff; transition: height .18s; }
.rail a:hover::before { height: 20px; } .rail a.on::before { height: 40px; }
.rail-home span { font-family: var(--font-display); font-weight: 900; font-size: 1.15rem; }
.rail-home { background: linear-gradient(135deg, hsl(var(--h) 75% 62%), hsl(calc(var(--h) + 30) 70% 48%)) !important; }
.rail-sep { width: 32px; height: 2px; border-radius: 2px; background: hsl(var(--h) 20% 30%); margin: 2px 0; }
.rail a[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 64px; white-space: nowrap; background: #111214; color: #fff; font-size: .85rem; font-weight: 700; padding: 7px 12px; border-radius: 8px; box-shadow: 0 8px 20px rgba(0, 0, 0, .35); pointer-events: none; z-index: 50; }

.sidebar { padding: 0 10px 12px; }
.side-head { display: flex; align-items: center; gap: 8px; padding: 18px 8px 14px; margin: 0 -10px 8px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 hsl(0 0% 0% / .15); }
.side-head b { display: block; font-family: var(--font-display); font-size: 1rem; letter-spacing: -.01em; padding-left: 10px; }
.side-head small { display: block; color: var(--muted); font-size: .76rem; padding-left: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.side-head .ver { margin-left: auto; font-size: .66rem; opacity: .6; }
.nav a { border-radius: 8px; padding: 8px 10px; font-weight: 600; color: var(--muted); }
.nav a .ic { background: transparent; box-shadow: none; width: 24px; }
.nav a:hover { background: hsl(var(--h) 25% 50% / .14); color: var(--text); transform: none; }
.nav a.active { background: hsl(var(--h) 30% 55% / .24); color: var(--text); box-shadow: none; }
[data-mode="light"] .nav a.active { background: var(--primary-soft); }
.nav a.active .ic { background: transparent; }
.nav-group { margin: 10px 8px 6px; }
.user-box { margin: 14px -10px -12px; border-radius: 0; border: none; border-top: 1px solid var(--border); background: hsl(var(--h) 35% 8% / .55); }
[data-mode="light"] .user-box { background: var(--surface-2); }
.nav-backdrop { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail, .sidebar { position: fixed; top: 0; height: 100vh; transform: translateX(calc(-100% - 100px)); transition: transform .28s; z-index: 60; }
  .rail { left: 0; width: 76px; }
  .sidebar { left: 76px; width: 260px; background: var(--surface-solid); }
  body.nav-open .rail, body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: hsl(0 0% 0% / .45); z-index: 55; }
  .rail a[data-tip]:hover::after { display: none; }
}

.auth-mascot { width: 120px; margin: -96px auto 4px; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .35)); animation: kubiHop 3s ease-in-out infinite; }
.auth-mascot svg, .kz-mascot svg { width: 100%; height: auto; display: block; }
.auth { padding-top: 90px; }
@keyframes kubiHop { 50% { transform: translateY(-8px) rotate(-2deg); } }

/* =========================================================
   v5.1 — Tampilan HP seperti aplikasi (bilah tab, lembar menu, PWA)
   ========================================================= */
.tabbar { display: none; }
.pwa-bar { position: fixed; left: 10px; right: 10px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 150; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px;
  border-radius: 18px; background: hsl(244 45% 16% / .96); color: #fff; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); border: 1px solid hsl(244 40% 30%); animation: sheetUp .35s cubic-bezier(.2, .9, .3, 1.1); }
body.has-tabbar .pwa-bar { bottom: calc(78px + env(safe-area-inset-bottom)); }
.pwa-bar img { width: 42px; height: 42px; border-radius: 11px; }
.pwa-bar div { flex: 1; min-width: 0; } .pwa-bar b { display: block; font-size: .92rem; } .pwa-bar small { display: block; font-size: .74rem; opacity: .75; }
.pwa-btn { border: none; border-radius: 999px; padding: 9px 16px; font: inherit; font-weight: 800; background: #fff; color: #1b1663; cursor: pointer; }
.pwa-x { border: none; background: transparent; color: #fff; opacity: .7; font-size: 1rem; padding: 6px; cursor: pointer; }
.pwa-sheet-bg, .sheet-bg { position: fixed; inset: 0; z-index: 160; background: hsl(0 0% 0% / .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.pwa-sheet, .sheet { width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto; background: var(--surface-solid); color: var(--text); border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, .35); animation: sheetUp .32s cubic-bezier(.2, .9, .3, 1.05); transition: transform .2s; }
.pwa-sheet { text-align: center; background: #1d1a55; color: #fff; }
.pwa-sheet .pwa-ic { width: 72px; height: 72px; border-radius: 18px; margin: 8px auto 4px; display: block; }
.pwa-sheet ol { text-align: left; line-height: 1.8; } .pwa-share { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: #2f7cf6; font-size: .8rem; }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-grip, .pwa-grip { width: 44px; height: 5px; border-radius: 9px; background: hsl(var(--h) 15% 50% / .5); margin: 4px auto 12px; }
.sheet-title { margin: 2px 4px 10px; font-family: var(--font-display); font-size: 1.05rem; }
.sheet-group { margin: 14px 6px 6px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sheet-list { border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.sheet-item { display: flex; align-items: center; gap: 12px; padding: 14px 14px; color: var(--text); text-decoration: none; font-weight: 700; border-bottom: 1px solid var(--border); min-height: 52px; }
.sheet-item:last-child { border-bottom: none; }
.sheet-item.on { background: hsl(var(--h) 60% 55% / .22); }
.sheet-item .si { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-solid); font-size: 18px; }
.sheet-item .sl { flex: 1; } .sheet-item .chev { color: var(--muted); font-size: 1.4rem; line-height: 1; }
.sheet-item .tag { font-size: .66rem; padding: 2px 7px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.sheet-user { display: flex; align-items: center; gap: 12px; padding: 6px 4px 4px; }
.sheet-user .avatar { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-weight: 900; font-size: 1.2rem; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.sheet-user small { display: block; }

@media (max-width: 860px) {
  html { -webkit-tap-highlight-color: transparent; }
  body { overscroll-behavior-y: none; }
  .rail, .sidebar, .btn.menu-btn, .nav-backdrop { display: none !important; }
  .app { display: block; }
  .main { padding: 0 12px calc(92px + env(safe-area-inset-bottom)); }
  /* Bilah atas ringkas seperti aplikasi */
  .topbar { position: sticky; top: 0; z-index: 30; margin: 0 -12px 14px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; gap: 8px;
    background: hsl(var(--h) 40% 10% / .82); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--border); }
  [data-mode="light"] .topbar { background: hsl(var(--h) 50% 97% / .85); }
  .topbar .title { min-width: 0; }
  .topbar .title h1 { font-size: 1.12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .title .small { display: none; }
  .ctx { width: 100%; padding: 6px 8px; box-shadow: none; border-radius: 12px; overflow-x: auto; flex-wrap: nowrap; }
  .ctx select { min-width: 110px; padding: 7px 8px; }
  .ctx label { display: none; }
  /* Bilah tab bawah */
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: hsl(var(--h) 40% 8% / .92); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
    border-top: 1px solid hsl(var(--h) 30% 22%); }
  [data-mode="light"] .tabbar { background: hsl(var(--h) 50% 98% / .92); border-top-color: var(--border); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 700; transition: color .15s; }
  .tabbar a .ti { font-size: 21px; line-height: 1; width: 48px; height: 30px; display: grid; place-items: center; border-radius: 99px; transition: background .2s, transform .2s; filter: grayscale(.6) opacity(.8); }
  .tabbar a.on { color: var(--text); }
  .tabbar a.on .ti { background: hsl(var(--h) 70% 60% / .28); transform: translateY(-1px); filter: none; }
  .tabbar a:active .ti { transform: scale(.9); }
  /* Isi lebih rapat */
  .card { padding: 14px; border-radius: 18px; }
  .card + .card { margin-top: 12px; }
  .grid { gap: 12px; }
  .hero { padding: 18px; }
  .hero h1 { font-size: 1.4rem; }
  .stat .num { font-size: 1.6rem; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
  input, select, textarea { font-size: 16px; } /* cegah zoom otomatis di iPhone */
  td input.score { font-size: 16px; }
  .table-wrap { max-height: none; border-radius: 12px; }
  /* Jendela muncul dari bawah */
  .modal-bg { align-items: flex-end; padding: 0; }
  .modal { width: 100% !important; max-height: 92vh; border-radius: 24px 24px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); animation: sheetUp .3s cubic-bezier(.2, .9, .3, 1.05); }
  .modal::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 9px; background: hsl(var(--h) 15% 50% / .5); margin: 0 auto 12px; }
  .modal .foot { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); background: var(--surface-solid); padding: 10px 0 4px; margin-bottom: 0; }
  .modal .foot .btn { flex: 1; }
  .toasts { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .scene { display: none; }
  .auth { padding: calc(70px + env(safe-area-inset-top)) 14px 20px; }
}
/* Halaman murid (kuis/ujian) di HP terpasang */
.kz-top { padding-top: calc(10px + env(safe-area-inset-top)); }
.kuis-body .kz-wrap { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
html.standalone body { -webkit-user-select: none; user-select: none; }
html.standalone input, html.standalone textarea, html.standalone [contenteditable] { -webkit-user-select: text; user-select: text; }
@media (max-width: 860px) {
  .card .grid.g3[style*="gap:8px"], .card .grid.g4[style*="gap:8px"], .card .grid.g4[style*="gap:10px"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card .grid.g4[style*="gap:10px"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================================================
   v5.2 — Mode Siang: langit biru, matahari, awan
   ========================================================= */
.mode-toggle { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-solid); cursor: pointer;
  font-size: 19px; line-height: 1; display: inline-grid; place-items: center; box-shadow: 0 3px 0 var(--border), 0 6px 14px var(--shadow-c); transition: transform .2s; }
.mode-toggle:hover { transform: rotate(-18deg) scale(1.06); }
.mode-toggle:active { transform: scale(.92); }
.mode-toggle.sm { width: 36px; height: 36px; font-size: 16px; }
.auth-mode-btn { position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 14px; z-index: 5; }

[data-mode="light"] {
  --bg: hsl(206 90% 93%);
  --bg2: hsl(var(--h) 85% 93%);
  --surface: hsl(0 0% 100% / .86);
  --surface-solid: #ffffff;
  --surface-2: hsl(var(--h) 45% 95%);
  --border: hsl(var(--h) 35% 87%);
  --text: hsl(var(--h) 48% 15%);
  --muted: hsl(var(--h) 16% 42%);
  --shadow-c: hsl(var(--h) 55% 35% / .14);
}
[data-mode="light"] body {
  background: radial-gradient(700px 420px at 92% -8%, hsl(48 100% 82% / .95), transparent 62%),
              linear-gradient(180deg, hsl(205 92% 86%) 0%, hsl(210 90% 92%) 38%, hsl(var(--h) 70% 97%) 100%);
}
[data-mode="light"] body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .95;
  background:
    radial-gradient(60px 34px at 12% 14%, #fff 98%, transparent), radial-gradient(48px 30px at 16% 11%, #fff 98%, transparent), radial-gradient(70px 30px at 9% 16%, #fff 98%, transparent),
    radial-gradient(80px 40px at 62% 9%, #fff 98%, transparent), radial-gradient(56px 34px at 67% 6%, #fff 98%, transparent), radial-gradient(70px 30px at 58% 11%, #fff 98%, transparent),
    radial-gradient(64px 34px at 34% 78%, hsl(0 0% 100% / .8) 98%, transparent), radial-gradient(50px 30px at 38% 75%, hsl(0 0% 100% / .8) 98%, transparent),
    radial-gradient(70px 34px at 88% 62%, hsl(0 0% 100% / .75) 98%, transparent), radial-gradient(52px 30px at 92% 59%, hsl(0 0% 100% / .75) 98%, transparent);
  animation: cloudDrift 60s ease-in-out infinite alternate; }
[data-mode="light"] body::after { content: ''; position: fixed; z-index: -1; pointer-events: none; top: -70px; right: -50px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, hsl(48 100% 70%) 0 38%, hsl(45 100% 72% / .45) 52%, transparent 70%); animation: sunPulse 6s ease-in-out infinite; }
@keyframes cloudDrift { to { transform: translateX(40px); } }
@keyframes sunPulse { 50% { transform: scale(1.06); } }
[data-motion="off"] body::before, [data-motion="off"] body::after { animation: none; }
[data-mode="light"] .scene { opacity: .35; }
[data-mode="light"] .rail { background: hsl(var(--h) 40% 90% / .92); }
[data-mode="light"] .rail a { background: #fff; color: var(--text); box-shadow: 0 2px 0 var(--border); }
[data-mode="light"] .rail a:hover { color: #fff; }
[data-mode="light"] .rail a.on { color: #fff; }
[data-mode="light"] .rail a::before { background: var(--text); }
[data-mode="light"] .rail-sep { background: hsl(var(--h) 25% 78%); }
[data-mode="light"] .sidebar { background: hsl(0 0% 100% / .78); }
[data-mode="light"] .nav a { color: hsl(var(--h) 20% 35%); }
[data-mode="light"] .nav a:hover, [data-mode="light"] .nav a.active { color: var(--text); }
[data-mode="light"] .hero { color: #fff; }
[data-mode="light"] .btn.ghost { --b: #fff; --bd: var(--border); --c: var(--text); }
[data-mode="light"] .card { box-shadow: 0 2px 0 hsl(var(--h) 40% 88%), 0 14px 30px var(--shadow-c); }
[data-mode="light"] .pwa-bar { background: #fff; color: var(--text); border-color: var(--border); }
[data-mode="light"] .pwa-x { color: var(--text); }
[data-mode="light"] .pwa-bar .pwa-btn { background: hsl(var(--h) 70% 55%); color: #fff; }
[data-mode="light"] .sheet-user .avatar, [data-mode="light"] .sheet-item .si { box-shadow: 0 2px 0 var(--border); }
@media (max-width: 860px) {
  .topbar .mode-toggle { width: 38px; height: 38px; font-size: 17px; }
  [data-mode="light"] .tabbar a .ti { filter: grayscale(.3); }
}

/* Musik & suara */
.snd-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; margin: 0 0 8px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface-solid); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .1s; }
.snd-item:active { transform: scale(.98); }
.snd-item.on { border-color: var(--primary); background: var(--primary-soft); }
.snd-e { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--surface-2); flex: none; }
.snd-n { flex: 1; min-width: 0; } .snd-n b { display: block; } .snd-n small { color: var(--muted); }
.snd-k { font-size: .66rem; font-weight: 800; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.snd-k.ujian { background: var(--primary-soft); color: var(--primary); } .snd-k.main { background: var(--ok-soft); color: var(--ok); }
.snd-vol { display: flex; align-items: center; gap: 10px; margin: 12px 4px 6px; } .snd-vol input { flex: 1; }
.snd-fx { display: flex; align-items: center; gap: 8px; margin: 8px 4px; font-weight: 600; }
.snd-list { max-height: 52vh; overflow-y: auto; }
#mute.playing { animation: sndGlow 1.6s ease-in-out infinite; border-color: var(--primary); }
@keyframes sndGlow { 50% { box-shadow: 0 0 0 4px hsl(var(--h) 80% 65% / .35), 0 0 18px hsl(var(--h) 80% 65% / .55); } }

/* Sakelar (switch) */
.music-box { margin-top: 12px; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.switch-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-row .sw { flex: none; position: relative; width: 50px; height: 30px; border-radius: 99px; background: hsl(var(--h) 15% 55% / .45); transition: background .2s; margin-top: 2px; }
.switch-row .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch-row input:checked + .sw { background: var(--ok); }
.switch-row input:checked + .sw::after { transform: translateX(20px); }
.switch-row input:focus-visible + .sw { outline: 3px solid var(--primary); outline-offset: 2px; }
.switch-row b { display: block; } .switch-row small { display: block; color: var(--muted); font-size: .8rem; }

/* ================= Jenis-jenis soal (qtypes.js) ================= */
.qt { display: block; }
.qt-hint { font-size: .86rem; color: var(--muted); margin: 0 0 8px; display: flex; gap: 6px; align-items: center; }
.qt-hint::before { content: '💡'; }
.qt-hint.small::before { content: ''; }
.qt .ex-input { width: 100%; font-size: 1.05rem; padding: 12px; }
.exam-opt.chk .lab { border-radius: 6px; }
.qt-num { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); font-weight: 800; font-size: .85rem; flex: none; }
.qt button { font: inherit; color: inherit; }
/* menjodohkan */
.qt-match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qt-col { display: flex; flex-direction: column; gap: 8px; }
.qt-card { position: relative; display: flex; gap: 8px; align-items: center; text-align: left; padding: 11px 12px; min-height: 52px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; box-shadow: 0 3px 0 var(--border); transition: transform .12s, border-color .12s; }
.qt-card:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }
.qt-card.pick { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 3px 0 var(--primary); transform: translateY(-2px); }
.qt-card.paired { border-style: solid; }
.qt-badge { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%; color: #fff; font-weight: 800; font-size: .8rem; flex: none; }
.qt-card.c0 { border-color: hsl(255 75% 62%); } .qt-card.c0 .qt-badge { background: hsl(255 75% 62%); }
.qt-card.c1 { border-color: hsl(195 80% 45%); } .qt-card.c1 .qt-badge { background: hsl(195 80% 45%); }
.qt-card.c2 { border-color: hsl(330 75% 56%); } .qt-card.c2 .qt-badge { background: hsl(330 75% 56%); }
.qt-card.c3 { border-color: hsl(145 55% 40%); } .qt-card.c3 .qt-badge { background: hsl(145 55% 40%); }
.qt-card.c4 { border-color: hsl(32 90% 52%); } .qt-card.c4 .qt-badge { background: hsl(32 90% 52%); }
.qt-card.c5 { border-color: hsl(0 70% 56%); } .qt-card.c5 .qt-badge { background: hsl(0 70% 56%); }
/* mengurutkan */
.qt-order { display: flex; flex-direction: column; gap: 8px; }
.qt-orow { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); box-shadow: 0 3px 0 var(--border); }
.qt-otext { flex: 1; }
.qt-mv { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 1rem; flex: none; }
.qt-mv:disabled { opacity: .3; cursor: default; }
.qt-mv:not(:disabled):active { background: var(--primary-soft); border-color: var(--primary); }
/* kelompok & seret */
.qt-pool { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border-radius: 14px; background: var(--surface-2); min-height: 54px; margin: 10px 0; align-items: center; }
.qt-chip { padding: 9px 14px; border-radius: 999px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 700; box-shadow: 0 3px 0 var(--border); }
.qt-chip.pick { border-color: var(--primary); background: var(--primary); color: var(--on-primary); box-shadow: 0 3px 0 hsl(var(--h) 60% 35%); transform: translateY(-2px); }
.qt-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.qt-cat { border: 2px dashed var(--border); border-radius: 16px; padding: 10px; min-height: 100px; cursor: pointer; transition: border-color .15s, background .15s; }
.qt-cat > b { display: block; margin-bottom: 8px; }
.qt-cat > div { display: flex; flex-wrap: wrap; gap: 6px; }
.qt-cat.drop { border-color: var(--primary); background: var(--primary-soft); }
.qt-cat .qt-chip { padding: 6px 11px; font-size: .9rem; }
.qt-sentence { font-size: 1.12rem; line-height: 2.4; }
.qt-blank { display: inline-block; min-width: 90px; padding: 2px 12px; margin: 0 3px; border: none; border-bottom: 3px solid var(--primary); border-radius: 8px 8px 2px 2px; background: var(--surface-2); cursor: pointer; font-weight: 700; line-height: 1.7; vertical-align: baseline; }
.qt-blank.filled { background: var(--primary-soft); color: var(--primary); }
.qt-blank.drop { outline: 2px dashed var(--primary); outline-offset: 2px; }
.qt-drop { display: inline-block; width: auto; min-width: 110px; padding: 4px 8px; margin: 0 3px; font: inherit; font-weight: 700; border-radius: 9px; border: 2px solid var(--primary); background: var(--primary-soft); color: var(--text); }
/* gambar: titik & label */
.qt-imgbox { position: relative; display: inline-block; max-width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #fff; line-height: 0; }
.qt-imgbox[data-hot], .qt-imgbox[data-eh], .qt-imgbox[data-el] { cursor: crosshair; }
.qt-imgbox img { max-width: 100%; max-height: 62vh; display: block; }
.qt-imgbox.sm img { max-height: 200px; }
.qt-dot { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: hsl(0 85% 55% / .85); border: 3px solid #fff; box-shadow: 0 0 0 2px hsl(0 85% 45%), 0 4px 12px rgba(0,0,0,.35); pointer-events: none; animation: qtpop .25s; }
.qt-area { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; border: 3px dashed hsl(145 70% 40%); background: hsl(145 70% 45% / .22); pointer-events: none; }
.qt-mark { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: .85rem; line-height: 1; border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.35); pointer-events: none; }
@keyframes qtpop { from { transform: scale(.3); } to { transform: scale(1); } }
.qt-labels { display: grid; gap: 8px; margin-top: 10px; }
.qt-labels label { display: flex; gap: 8px; align-items: center; }
.qt-labels select { flex: 1; }
/* menggambar */
.qt-draw { display: flex; flex-direction: column; gap: 8px; }
.qt-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.qt-pen, .qt-clear { min-width: 44px; height: 40px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; font-size: 1.1rem; padding: 0 10px; }
.qt-pen.on { border-color: var(--primary); background: var(--primary-soft); }
.qt-clear { font-size: .9rem; margin-left: auto; }
.qt-canvas { width: 100%; aspect-ratio: 3 / 2; border-radius: 12px; border: 2px solid var(--border); background: #fff; touch-action: none; cursor: crosshair; }
/* rekam suara */
.qt-rec { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border-radius: 16px; background: var(--surface-2); }
.qt-rec audio { width: 100%; max-width: 420px; }
.qt-recbtn.danger { animation: qtpulse 1.2s infinite; }
@keyframes qtpulse { 50% { box-shadow: 0 0 0 10px hsl(0 80% 55% / .15); } }
/* editor guru */
.qt-ed .opt-row input[type=text] { flex: 1; }
.qt-ecat { padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.qt-ecat textarea { width: 100%; }
.qt-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.qt-pick { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; box-shadow: 0 3px 0 var(--border); transition: transform .12s, border-color .12s; }
.qt-pick:hover { transform: translateY(-2px); border-color: var(--primary); }
.qt-pick small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.qt-pick i { position: absolute; top: 8px; right: 10px; font-style: normal; font-size: .85rem; }
.qt-pi { font-size: 1.6rem; line-height: 1; }
.rv-box { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); margin: 4px 0 6px; }
.rv-box .pill { margin: 2px; }
.pv-mount { margin-top: 6px; }
@media (max-width: 560px) {
  .qt-match { gap: 6px; }
  .qt-card { padding: 9px; font-size: .92rem; }
  .qt-sentence { font-size: 1.02rem; }
}

/* ================= Panduan jenis soal ================= */
.pd-steps { margin: 0; padding-left: 22px; line-height: 1.65; }
.pd-steps li { margin: 4px 0; }
.pd-toc { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.pd-toc > b { margin-right: 4px; font-size: .9rem; }
.pd-toc .chip { display: inline-flex; gap: 6px; align-items: center; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 700; font-size: .88rem; box-shadow: 0 2px 0 var(--border); }
.pd-toc .chip:hover { border-color: var(--primary); color: var(--primary); }
.pd-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.pd-head h3 { margin: 0 0 4px; font-size: 1.2rem; }
.pd-ic { font-size: 2.2rem; line-height: 1; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: var(--primary-soft); flex: none; }
.pd-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pd-grid h4 { margin: 14px 0 4px; font-size: .95rem; }
.pd-grid h4:first-child { margin-top: 0; }
.pd-grid p, .pd-grid ol, .pd-grid ul { margin: 0 0 4px; line-height: 1.6; }
.pd-grid ol, .pd-grid ul { padding-left: 20px; }
.pd-pre { white-space: pre-wrap; font-size: .85rem; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border); margin: 4px 0; }
.pd-demo { position: sticky; top: 12px; border-radius: 16px; border: 2px solid var(--border); background: var(--surface-2); overflow: hidden; }
.pd-demo-h { padding: 8px 12px; font-weight: 800; font-size: .9rem; background: var(--primary-soft); color: var(--primary); }
.pd-demo-body { padding: 12px; background: var(--surface); }
.pd-res { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pd-flash { animation: pdflash 1.6s; }
@keyframes pdflash { 0%, 40% { box-shadow: 0 0 0 4px var(--primary); } 100% { box-shadow: none; } }
.modal .pd-card .pd-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .pd-grid, .modal .pd-card .pd-grid { grid-template-columns: 1fr; } .pd-demo { position: static; } }
@media print { .pd-demo { display: none; } .pd-grid { grid-template-columns: 1fr; } .pd-card { break-inside: avoid; } }
.hero .pd-steps a { color: #fff; font-weight: 800; text-decoration: underline; }
.pd-card { scroll-margin-top: 90px; }
.card:has(> .pd-card) { scroll-margin-top: 90px; }

/* lupa password */
.note.ok { background: var(--ok-soft); border-left-color: var(--ok); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: none; background: transparent; cursor: pointer; font-size: 1.1rem; border-radius: 8px; }
.pw-eye:hover { background: var(--surface-2); }

/* impor murid dari Excel */
#data-grid.drop-on { outline: 3px dashed var(--primary); outline-offset: 6px; border-radius: 18px; }
.rm-targets { display: flex; flex-direction: column; gap: 8px; }
.radio-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: .92rem; }
.radio-row:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio-row input[type=radio] { width: auto; margin: 0; accent-color: var(--primary); }
.card-head { flex-wrap: wrap; gap: 10px; }
.card-head > h3 { min-width: 160px; }
#rm .row { flex-wrap: wrap; }
#rm .row > .field { min-width: 0; flex: 1 1 140px; }
#rm select { max-width: 100%; }
@media (max-width: 760px) {
  #rm .grid.g2 { grid-template-columns: 1fr; }
  #rm .foot { flex-wrap: wrap; }
  #rm .foot .small { flex-basis: 100%; }
}
#rm .grid > div { min-width: 0; }
#rm .radio-row { min-width: 0; overflow-wrap: anywhere; }

/* pecahan bersusun */
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; margin: 0 .12em; font-size: .92em; font-variant-numeric: lining-nums tabular-nums; }
.frac .fn { padding: 0 .2em .06em; border-bottom: .09em solid currentColor; }
.frac .fd { padding: .06em .2em 0; }

/* ================= Klik lebih halus ================= */
a, button, .btn, [data-act], .exam-opt, .kz-opt, .qt-card, .qt-chip, .qt-pick, .swatch, .chip, label, select, input[type=checkbox], input[type=radio] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.btn { transition: transform .12s cubic-bezier(.2,.8,.2,1), box-shadow .12s, filter .15s, background-color .2s; }
.btn:active, .btn.pressing { transform: translateY(calc(3px * var(--depth))) scale(.98); }
.exam-opt, .qt-card, .qt-chip, .qt-pick, .chip, .kz-opt { transition: transform .12s cubic-bezier(.2,.8,.2,1), border-color .15s, background-color .15s, box-shadow .15s; }
.exam-opt:active, .qt-card:active, .qt-chip:active, .qt-pick:active, .chip:active { transform: scale(.975); }
.page-enter { animation: pageIn .26s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ================= Efek membuka menu ================= */
.menu-fx { position: fixed; inset: 0; z-index: 400; pointer-events: none; display: grid; place-items: center; }
.menu-fx::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 46%, hsl(var(--h) 80% 60% / .22), transparent 55%); animation: mfxFade .7s ease both; }
.mfx-card { position: relative; width: 112px; height: 112px; border-radius: 30px; display: grid; place-items: center;
  background: linear-gradient(150deg, hsl(var(--h) 90% 72%), hsl(calc(var(--h) + 40) 80% 55%));
  box-shadow: 0 10px 0 hsl(var(--h) 60% 35%), 0 22px 40px hsl(var(--h) 70% 25% / .45), inset 0 2px 0 hsl(0 0% 100% / .5);
  animation: mfxPop .56s cubic-bezier(.2,1.5,.35,1) both; }
.mfx-ic { font-size: 62px; line-height: 1; filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); animation: mfxSpin .56s cubic-bezier(.2,1.2,.35,1) both; }
.mfx-kubi { position: absolute; left: calc(50% + 46px); top: calc(46% - 20px); width: 86px; animation: mfxKubi .6s cubic-bezier(.2,1.4,.4,1) .05s both; }
.mfx-kubi svg { width: 100%; height: auto; }
.mfx-label { position: absolute; top: calc(50% + 78px); font-family: 'Unbounded', var(--font, sans-serif); font-weight: 800; font-size: 1.05rem; color: var(--text);
  background: var(--surface); padding: 7px 16px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,.18); animation: mfxUp .5s cubic-bezier(.2,1.2,.35,1) .06s both; white-space: nowrap; }
.mfx-burst { position: absolute; left: 50%; top: 50%; }
.mfx-burst i { position: absolute; width: 10px; height: 10px; margin: -5px; border-radius: 3px; background: hsl(calc(var(--h) + var(--a) / 3) 85% 62%);
  transform: rotate(var(--a)) translateY(0) scale(.4); opacity: 0; animation: mfxBurst .6s cubic-bezier(.1,.8,.3,1) var(--d) both; }
.menu-fx.out { animation: mfxOut .26s ease forwards; }
.menu-fx.calm .mfx-card, .menu-fx.calm .mfx-ic, .menu-fx.calm .mfx-kubi, .menu-fx.calm .mfx-label { animation: mfxFade .3s ease both; }
.menu-fx.calm .mfx-burst { display: none; }
@keyframes mfxPop { 0% { transform: scale(.2) rotate(-14deg); opacity: 0; } 60% { transform: scale(1.12) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes mfxSpin { 0% { transform: rotateY(90deg) scale(.6); } 100% { transform: rotateY(0) scale(1); } }
@keyframes mfxKubi { 0% { transform: translate(-40px, 30px) scale(.3) rotate(-20deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes mfxUp { 0% { transform: translateY(14px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes mfxBurst { 0% { transform: rotate(var(--a)) translateY(0) scale(.4); opacity: 0; } 30% { opacity: 1; } 100% { transform: rotate(var(--a)) translateY(-120px) scale(1); opacity: 0; } }
@keyframes mfxFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mfxOut { to { opacity: 0; transform: scale(1.06); } }
@media (max-width: 560px) { .mfx-card { width: 92px; height: 92px; border-radius: 24px; } .mfx-ic { font-size: 50px; } .mfx-kubi { width: 70px; left: calc(50% + 36px); } .mfx-label { top: calc(50% + 66px); font-size: .95rem; } }

/* ================= Teks bacaan (stimulus) ================= */
.passage { border: 2px solid var(--border); border-left: 5px solid var(--primary); border-radius: 14px; background: var(--surface); margin: 0 0 12px; overflow: hidden; }
.passage > summary { list-style: none; cursor: pointer; display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: var(--primary-soft); font-size: .95rem; }
.passage > summary::-webkit-details-marker { display: none; }
.passage .pz-note { font-size: .8rem; color: var(--muted); }
.passage .pz-tog { margin-left: auto; font-size: .8rem; color: var(--muted); }
.passage .pz-tog::after { content: 'Sembunyikan ▲'; }
.passage:not([open]) .pz-tog::after { content: 'Tampilkan ▼'; }
.passage-body { padding: 12px 16px; max-height: 46vh; overflow: auto; }
.pz-text { white-space: pre-line; line-height: 1.7; text-align: justify; hyphens: auto; }
.passage-body .q-img { margin-bottom: 8px; }
.kz-q .passage { color: var(--text); text-align: left; }
.passage-ed { margin: 8px 0; padding: 10px 12px; border-radius: 12px; border: 2px dashed var(--primary); background: var(--primary-soft); }
.passage-ed input, .passage-ed textarea { width: 100%; margin-top: 6px; }
.pz-nums { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pz-num { display: inline-flex; }
.pz-num input { display: none; }
.pz-num span { min-width: 38px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 2px solid var(--border); background: var(--surface); font-weight: 800; cursor: pointer; }
.pz-num input:checked + span { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.pz-num.other span { text-decoration: line-through; opacity: .7; }

/* tabel di soal / teks bacaan */
.qtable-wrap { overflow-x: auto; margin: 8px 0 10px; -webkit-overflow-scrolling: touch; }
.qtable { border-collapse: collapse; min-width: 50%; font-size: .95em; background: var(--surface); border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); white-space: normal; }
.qtable th, .qtable td { border: 1px solid var(--border); padding: 7px 12px; text-align: left; vertical-align: top; }
.qtable th { background: var(--primary-soft); font-weight: 800; }
.qtable td.num { text-align: center; font-variant-numeric: tabular-nums; }
.qtable tr:nth-child(even) td { background: var(--surface-2); }
.kz-q-card .qtable { margin: 0 auto; color: var(--text); }

/* petunjuk sebelum ujian */
.ins-box { border: 2px solid var(--border); border-radius: 16px; padding: 14px 16px; background: var(--surface); margin: 12px 0; text-align: left; }
.ins-box h3 { margin: 0 0 8px; font-size: 1.05rem; }
.ins-box h4 { margin: 14px 0 6px; font-size: .95rem; }
.ins-list, .ins-how { margin: 0; padding-left: 22px; line-height: 1.7; }
.ins-how { list-style: none; padding-left: 0; }
.ins-how li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.ins-how li:last-child { border-bottom: 0; }
.ins-ic { flex: none; }
.ins-text { white-space: pre-line; line-height: 1.7; }
.ins-ok { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 12px auto 4px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--primary); background: var(--primary-soft); font-weight: 700; cursor: pointer; max-width: 460px; }
.ins-ok input { width: 20px; height: 20px; accent-color: var(--primary); }
button:disabled.btn, .btn[disabled] { opacity: .5; cursor: not-allowed; filter: grayscale(.3); }
.ins-ed summary { cursor: pointer; padding: 6px 0; }
.pz-img { display: block; margin: 10px auto; max-height: 340px; }

/* ujian berjalan */
.mon-card .card-head h3 { font-size: 1.05rem; }
.mon-live { animation: monPulse 1.6s ease-in-out infinite; }
@keyframes monPulse { 50% { opacity: .55; } }
.mon-stats { display: flex; flex-wrap: wrap; gap: 14px; }
.mon-stats > div { min-width: 70px; }
.mon-stats b { display: block; font-size: 1.5rem; line-height: 1.1; }
.mon-stats small { color: var(--muted); font-size: .75rem; }
.mon-top .stat { text-align: center; padding: 14px; }
.mon-top .stat .num { font-size: 2rem; font-weight: 900; }
.mon-top .stat .lbl { color: var(--muted); font-size: .85rem; }

/* atasi masalah murid */
.fix-opt { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border: 2px solid var(--border); border-radius: 14px; margin: 10px 0; background: var(--surface); }
.fix-opt > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.fix-opt small { color: var(--muted); line-height: 1.5; }
.fix-opt .btn { flex: none; }
@media (max-width: 560px) { .fix-opt { flex-direction: column; align-items: stretch; } }

/* ================= Menu kecil ================= */
.pop-menu { position: fixed; z-index: 500; min-width: 220px; max-width: 300px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 14px 40px rgba(0,0,0,.28); animation: popIn .14s ease-out; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.pop-menu button { display: grid; grid-template-columns: 26px 1fr; align-items: center; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.pop-menu button small { grid-column: 2; font-weight: 500; color: var(--muted); font-size: .76rem; }
.pop-menu button:hover { background: var(--primary-soft); }
.pop-menu button.danger { color: var(--bad); }
.pop-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* ================= Perpustakaan ================= */
.lib-wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.lib-side { position: sticky; top: 12px; }
.lib-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.lib-nav button { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.lib-nav button span { font-size: .78rem; color: var(--muted); background: var(--surface-2); padding: 1px 8px; border-radius: 999px; }
.lib-nav button:hover { background: var(--surface-2); }
.lib-nav button.on { background: var(--primary-soft); color: var(--primary); }
.lib-nav-h { margin: 12px 10px 4px; font-size: .78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lib-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.lib-tools input { flex: 1; min-width: 200px; }
.lib-tools select { width: auto; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.lib-card { border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 4px 0 var(--border), 0 10px 24px rgba(0,0,0,.08); cursor: pointer; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.lib-card:hover { transform: translateY(-3px); box-shadow: 0 6px 0 var(--border), 0 16px 32px rgba(0,0,0,.14); }
.lib-cover { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, hsl(var(--ch) 75% 62%), hsl(calc(var(--ch) + 50) 70% 45%)); }
.lib-cover img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.lib-em { font-size: 54px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); }
.lib-n { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.62); color: #fff; font-size: .74rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.lib-cover.big { width: 220px; flex: none; border-radius: 16px; }
.lib-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lib-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.lib-meta { display: flex; gap: 4px; font-size: 1rem; }
.lib-sub { font-size: .78rem; color: var(--muted); }
.lib-act { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }
.lib-act .btn:first-child { flex: 1; }
.lib-rows { display: flex; flex-direction: column; }
.lib-row { display: flex; gap: 14px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.lib-row:last-child { border-bottom: 0; }
.lib-row .lib-cover { width: 110px; flex: none; border-radius: 10px; }
.lib-row .lib-em { font-size: 30px; }
.lib-row .lib-act { margin: 0; padding: 0; }
.lib-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.lib-use { display: flex; flex-direction: column; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; border: 1px solid var(--border); margin-bottom: 6px; }
.lib-use:hover { border-color: var(--primary); }
.lib-use span { font-size: .78rem; color: var(--muted); }
.hide-keys .pv-key, .hide-keys .exam-opt.right { color: inherit; }
.hide-keys .pv-key { display: none; }
@media (max-width: 900px) { .lib-wrap { grid-template-columns: 1fr; } .lib-side { position: static; } .lib-nav { flex-direction: row; flex-wrap: wrap; } .lib-nav-h { width: 100%; } .lib-cover.big { width: 100%; } }

/* ================= Hasil ujian ================= */
.rep-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rep-filters input { flex: 1; min-width: 180px; }
.rep-filters select { width: auto; }
.rep-row { display: flex; gap: 14px; align-items: center; padding: 12px 16px; margin-bottom: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; box-shadow: 0 3px 0 var(--border); transition: transform .12s, border-color .12s; }
.rep-row:hover { transform: translateY(-2px); border-color: var(--primary); }
.rep-ring { --c: var(--muted); width: 54px; height: 54px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); }
.rep-ring span { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-weight: 900; font-size: .9rem; }
.rep-ring.ok { --c: var(--ok); } .rep-ring.pri { --c: var(--primary); } .rep-ring.warn { --c: var(--warn); } .rep-ring.bad { --c: var(--bad); }
.rep-cnt { text-align: center; min-width: 74px; }
.rep-cnt b { display: block; font-size: 1.15rem; }
.rep-cnt small { color: var(--muted); font-size: .72rem; }
.rep-go { font-size: 1.6rem; color: var(--muted); }
.rep-tiles { margin-bottom: 14px; }
.rep-tile { text-align: center; padding: 14px; }
.rep-tile .num { font-size: 1.7rem; font-weight: 900; }
.rep-tile .num small { font-size: .9rem; color: var(--muted); }
.rep-tile.ok .num { color: var(--ok); } .rep-tile.bad .num { color: var(--bad); } .rep-tile.warn .num { color: var(--warn); } .rep-tile.pri .num { color: var(--primary); }
.rep-table td { vertical-align: middle; }
.hm-row { display: flex; flex-wrap: wrap; gap: 3px; max-width: 420px; }
.hm { display: inline-block; width: 14px; height: 14px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
.hm.ok { background: var(--ok); border-color: var(--ok); } .hm.bad { background: var(--bad); border-color: var(--bad); } .hm.part { background: var(--warn); border-color: var(--warn); } .hm.man { background: var(--primary); border-color: var(--primary); opacity: .6; } .hm.na { opacity: .3; }
.hm-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.hm-legend span { display: inline-flex; gap: 6px; align-items: center; }
.rep-qs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.rep-q { margin: 0; }
.rep-pct { font-size: 1.3rem; }
.rep-dist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.rep-opt { display: grid; grid-template-columns: 30px minmax(0, 1fr) 90px 28px; gap: 8px; align-items: center; font-size: .86rem; padding: 4px 6px; border-radius: 10px; }
.rep-opt .lab { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); }
.rep-opt.key { background: var(--ok-soft); }
.rep-opt.key .lab { background: var(--ok); color: #fff; }
.rep-ot { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-ob { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.rep-ob i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.rep-opt.key .rep-ob i { background: var(--ok); }
@media print { .rep-filters, .tabs, #rp-actions { display: none !important; } .rep-qs { grid-template-columns: 1fr 1fr; } }
.rep-filters label input[type=checkbox], .lib-tools input[type=checkbox] { width: auto; flex: none; min-width: 0; }
.rep-filters label { white-space: nowrap; }
@media (max-width: 560px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .lib-em { font-size: 38px; } .lib-body { padding: 9px 10px 10px; } .lib-title { font-size: .9rem; } .lib-sub { font-size: .7rem; } .lib-act .btn { padding: 6px 8px; font-size: .8rem; } .lib-act [data-prev] { display: none; } .rep-row { padding: 10px; gap: 10px; } .rep-ring { width: 46px; height: 46px; } .rep-ring span { width: 36px; height: 36px; font-size: .8rem; } .rep-cnt { min-width: 54px; } .rep-go { display: none; } .rep-qs { grid-template-columns: 1fr; } }

/* ---------- Foto murid & kartu ujian ---------- */
.ph-btn { width: 36px; height: 48px; border-radius: 6px; border: 1px dashed var(--border); background: var(--surface-2); cursor: pointer; padding: 0; overflow: hidden; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.ph-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-btn[data-ph] { border-style: solid; }
.ph-bulk { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; max-height: 58vh; overflow: auto; padding: 2px; }
.ph-item { border: 2px solid var(--border); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); }
.ph-item.ok { border-color: #22a06b; }
.ph-item img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; background: #fff; }
.ph-item select { font-size: 12px; padding: 4px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-ruang { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.k-ruang label { display: flex; gap: 6px; align-items: center; }
.k-ruang label b { min-width: 60px; } .k-ruang input { width: 80px; flex: 1; }
#kartu-print { display: flex; flex-direction: column; gap: 18px; align-items: center; }
.kp-page { width: 210mm; min-height: 297mm; padding: 10mm 12mm; box-sizing: border-box; background: #fff; color: #000; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 66mm; gap: 4mm; box-shadow: 0 4px 24px rgba(0,0,0,.15); }
.kp-card { border: 1.2px solid #333; border-radius: 3mm; padding: 2.5mm 3mm; display: flex; flex-direction: column; font-family: Arial, Helvetica, sans-serif; font-size: 8.4pt; overflow: hidden; break-inside: avoid; }
.kp-head { display: flex; gap: 2.5mm; align-items: center; border-bottom: 1.6px double #333; padding-bottom: 1.5mm; margin-bottom: 2mm; }
.kp-logo { width: 11mm; height: 11mm; object-fit: contain; flex: none; }
.kp-logo-ph { display: flex; align-items: center; justify-content: center; font-size: 18pt; }
.kp-ht { display: flex; flex-direction: column; line-height: 1.2; text-align: center; flex: 1; }
.kp-ht b { font-size: 10pt; letter-spacing: .3px; } .kp-ht span { font-size: 8pt; font-weight: 600; } .kp-ht small { font-size: 7.2pt; }
.kp-body { display: flex; gap: 3mm; flex: 1; min-height: 0; }
.kp-left { display: flex; flex-direction: column; gap: 1.5mm; flex: none; width: 21mm; }
.kp-right { flex: 1; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.kp-photo { width: 21mm; height: 28mm; border: 1px solid #555; flex: none; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 7pt; color: #777; overflow: hidden; }
.kp-photo img { width: 100%; height: 100%; object-fit: cover; }
.kp-tab { border-collapse: collapse; font-size: 8.2pt; align-self: flex-start; }
.kp-tab td { padding: .25mm .8mm; line-height: 1.25; border: none; vertical-align: top; background: none; color: #000; }
.kp-tab td:first-child { white-space: nowrap; }
.kp-qr { display: flex; gap: 1.2mm; align-items: flex-end; } .kp-qr svg { width: 13mm; height: 13mm; flex: none; } .kp-qr small { font-size: 5.6pt; line-height: 1.15; color: #333; }
.kp-ttd { font-size: 7.2pt; text-align: center; line-height: 1.2; align-self: flex-end; padding-right: 1mm; } .kp-sign { height: 7mm; }
@media print {
  @page { size: A4; margin: 0; }
  html:has(body.print-cards), body.print-cards { background: #fff !important; margin: 0; padding: 0; }
  body.print-cards > *:not(#print-sheet) { display: none !important; }
  body.print-cards #print-sheet { display: block !important; }
  body.print-cards .kp-page { box-shadow: none; height: 297mm; min-height: 0; overflow: hidden; page-break-after: always; break-after: page; }
  body.print-cards .kp-page:last-child { page-break-after: auto; break-after: auto; }
  .kp-card, .kp-card * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
#print-sheet { display: none; }

/* ---------- Ajakan aplikasi HP di Beranda ---------- */
.app-promo { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.app-promo .ap-ic { font-size: 40px; width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, #3ddc84, #1fa463); display: flex; align-items: center; justify-content: center; flex: none; }
.app-promo .ap-txt { flex: 1 1 320px; } .app-promo h3 { margin: 0 0 4px; } .app-promo .btns { margin-top: 10px; }
.app-promo .ap-qr { background: #fff; border-radius: 14px; padding: 8px; text-align: center; color: #1b1663; font-size: 11px; font-weight: 700; }
.app-promo .ap-qr svg { width: 110px; height: 110px; display: block; }

.cred-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 6px 14px; }
.cred-box > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.cred-box > div:last-child { border-bottom: none; } .cred-box span { color: var(--muted); } .cred-box b { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; text-align: right; }
button.pill { cursor: pointer; border: none; font: inherit; }
.q-card.flash { animation: qflash 1.6s ease; }
@keyframes qflash { 0%, 60% { box-shadow: 0 0 0 4px rgba(255, 176, 46, .85); } 100% { box-shadow: none; } }
.key-pill { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ---------- Klasemen tim (Kuis Seru) ---------- */
.team-board .tb-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; margin-bottom: 8px; background: color-mix(in srgb, var(--tc) 14%, transparent); border-left: 6px solid var(--tc); }
.team-board .tb-rk { font-size: 1.3rem; font-weight: 900; width: 34px; text-align: center; }
.team-board .tb-nm { flex: 0 0 34%; font-weight: 800; display: flex; flex-direction: column; min-width: 0; }
.team-board .tb-nm small { font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-board .tb-bar { flex: 1; height: 14px; border-radius: 99px; background: rgba(127, 127, 127, .18); overflow: hidden; }
.team-board .tb-bar i { display: block; height: 100%; background: var(--tc); border-radius: 99px; transition: width .6s; }
.team-board .tb-sc { font-size: 1.2rem; min-width: 70px; text-align: right; }
/* ---------- Absensi (daftar hadir) ujian ---------- */
#absen-print { display: flex; flex-direction: column; gap: 18px; align-items: center; }
.ab-page { width: 210mm; min-height: 297mm; padding: 12mm 14mm 10mm; box-sizing: border-box; background: #fff; color: #000; font-family: Arial, Helvetica, sans-serif; font-size: 10pt; box-shadow: 0 4px 24px rgba(0,0,0,.15); display: flex; flex-direction: column; }
.ab-kop { display: flex; align-items: center; gap: 4mm; border-bottom: 3px double #000; padding-bottom: 2.5mm; }
.ab-logo { width: 22mm; height: 22mm; object-fit: contain; flex: none; }
.ab-kop-t { flex: 1; text-align: center; line-height: 1.25; }
.ab-ins { font-size: 11pt; font-weight: 700; text-transform: uppercase; } .ab-sch { font-size: 15pt; font-weight: 900; text-transform: uppercase; letter-spacing: .3px; } .ab-addr { font-size: 8.5pt; }
.ab-title { text-align: center; margin: 4mm 0 1.5mm; line-height: 1.35; } .ab-title b { font-size: 12.5pt; letter-spacing: .4px; }
.ab-mapel { text-align: center; font-size: 11.5pt; margin-bottom: 3mm; padding: 1.5mm 0; border-top: 1px solid #000; border-bottom: 1px solid #000; }
.ab-info { border-collapse: collapse; margin-bottom: 3mm; font-size: 10pt; } .ab-info td { padding: .6mm 2mm .6mm 0; border: none; background: none; color: #000; } .ab-info td:nth-child(1), .ab-info td:nth-child(3) { width: 26mm; } .ab-info td:nth-child(2) { width: 62mm; }
.ab-tab { width: 100%; border-collapse: collapse; font-size: 9.6pt; }
.ab-tab th, .ab-tab td { border: 1px solid #000 !important; padding: 0 1.8mm; height: 7mm; color: #000 !important; background: #fff !important; position: static !important; }
.ab-tab th { background: #e8e8e8 !important; font-weight: 700; text-align: center; height: 8mm; }
.ab-tab td.c { text-align: center; } .ab-tab td.sig { width: 22mm; font-size: 8pt; vertical-align: top; padding-top: .6mm; }
.ab-tab tr { break-inside: avoid; }
.ab-rekap { margin-top: 2.5mm; font-size: 9.5pt; } .ab-rekap span { font-size: 8.5pt; }
.ab-sign { display: flex; justify-content: space-between; margin-top: 5mm; font-size: 10pt; line-height: 1.35; }
.ab-sign > div { width: 70mm; } .ab-sign > div:last-child { text-align: left; } .ab-sp { height: 18mm; }
.ab-cont { margin-top: auto; text-align: right; font-style: italic; }
@media print {
  body.print-cards .ab-page { box-shadow: none; width: 210mm; height: 297mm; min-height: 0; overflow: hidden; page-break-after: always; break-after: page; }
  body.print-cards .ab-page:last-child { page-break-after: auto; break-after: auto; }
  .ab-page, .ab-page * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.ab-kop.g-tebal { border-bottom: 3px solid #000; box-shadow: 0 2px 0 #fff, 0 3.2px 0 #000; }
.ab-kop.g-tipis { border-bottom: 1.2px solid #000; } .ab-kop.g-none { border-bottom: none; }
.ab-kop-t > div { line-height: 1.22; }
.kop-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.kop-row input[data-kl] { flex: 1; min-width: 0; } .kop-row select { width: 130px; }
.kop-b { display: flex; align-items: center; gap: 3px; padding: 0 6px; cursor: pointer; }
@media screen {
  .ab-tab td.ket-ed { cursor: pointer; transition: background .15s; }
  .ab-tab td.ket-ed:hover { background: #fff6c8 !important; outline: 2px solid #f5b800; outline-offset: -2px; }
  .ab-tab td.ket-ed:empty::after { content: '＋'; color: #bbb; }
  .ab-tab td.ket-ed.man { background: #fffbe6 !important; }
}
.ab-sign.three { flex-wrap: wrap; }
.ab-sign.three > div { width: 56mm; }
.ab-sign.three > .ab-sign-date { width: 56mm; margin-left: calc(100% - 56mm); text-align: left; margin-bottom: -4.8mm; }

/* ---------- Kartu panitia ---------- */
.pn-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.pn-theme { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface-2); cursor: pointer; color: inherit; font: inherit; font-size: .78rem; }
.pn-theme.on { border-color: var(--primary, #7c5cff); box-shadow: 0 0 0 3px rgba(124, 92, 255, .25); }
.pn-th-img { width: 100%; aspect-ratio: 54/86; border-radius: 8px; overflow: hidden; background: #fff; }
.pn-th-img svg, .pn-svg svg { width: 100%; height: auto; display: block; }
.pn-preview { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; align-items: flex-start; }
.pn-card { display: flex; flex-direction: column; gap: 6px; }
.pn-svg { border-radius: 10px; overflow: hidden; box-shadow: 0 6px 22px rgba(0, 0, 0, .25); background: #fff; }
.pn-card .btns { justify-content: space-between; align-items: center; flex-wrap: nowrap; }
.pn-mem { display: flex; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 6px; background: var(--surface-2); }
.pn-mem-f { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pn-mem-f input { min-width: 0; } .pn-mem-b { display: flex; flex-direction: column; gap: 2px; }
.pn-page { position: relative; width: 210mm; height: 297mm; background: #fff; overflow: hidden; }
.pn-slot { position: absolute; } .pn-slot svg { width: 100%; height: 100%; display: block; }
.pn-slot.cut { outline: 0.3mm dashed #b5b5b5; }
@media (max-width: 1000px) { .pn-grid { grid-template-columns: 1fr !important; } }
@media print {
  body.print-cards .pn-page { page-break-after: always; break-after: page; }
  body.print-cards .pn-page:last-child { page-break-after: auto; break-after: auto; }
  .pn-slot, .pn-slot * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.pn-preview .pn-drag { cursor: grab; touch-action: none; }
.pn-preview .pn-drag:hover { filter: drop-shadow(0 0 3px rgba(255, 214, 0, .95)); }
body.pn-dragging, body.pn-dragging * { cursor: grabbing !important; user-select: none; }
.pn-sel { margin-top: 12px; padding: 10px 14px; }
.pn-preview .pn-drag.sel { filter: drop-shadow(0 0 2px #ffd600) drop-shadow(0 0 4px #ffd600); }
/* pratinjau kartu panitia: grid rapi beberapa kolom */
.pn-preview { display: grid !important; gap: 14px; align-items: start; }
.pn-preview > .card.empty { grid-column: 1 / -1; }
.pn-card { min-width: 0; }
.pn-svg { width: 100%; }
.pn-cap { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.pn-cap .ellipsis { flex: 1; min-width: 0; }
