/* Student exam app — mobile-first, builds on ../guru/app.css tokens (Atkinson Hyperlegible, folder blue, Tab Yellow).
   One column, thumb-reachable controls, 56px+ answer targets. Yellow = the one next action. */
body.sw-body { background: var(--paper); min-height: 100vh; }
.sx-main { max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; display: grid; gap: 18px; }
.sx-main h1 { font-size: clamp(26px, 6vw, 32px); }
.sx-main h2 { font-size: 22px; }
.sx-wide { width: 100%; }
.sx-sec { display: grid; gap: 12px; }
.sx-card { display: grid; gap: 14px; }
.sx-card > * + * { margin-top: 0; }
.sx-link { background: none; border: 0; font: inherit; font-weight: 700; color: var(--white); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px 0; }
svg { flex: none; }

/* top bar */
.sx-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--folder-blue-deep); color: var(--white); border-bottom: 4px solid var(--action-yellow); }
.sx-top .brand { font-size: 20px; padding: 0; display: inline-block !important; }
.sx-who { margin-left: auto; font-size: 15px; color: var(--on-blue-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* login */
.sx-login { max-width: 440px; margin: 0 auto; padding: 32px 16px; display: grid; gap: 20px; }
.sx-login__brand { text-align: center; }
.sx-login__brand .brand { display: inline-block !important; font-size: 34px; color: var(--ink); padding: 0; }
.sx-login__brand .brand span { color: var(--folder-blue); }
.sx-login__brand p { color: var(--pencil); }
.sx-login h1 { font-size: 26px; }
.sx-pin { letter-spacing: .4em; font-size: 24px !important; }
.sx-err { color: var(--red); font-weight: 700; }
.sx-demo-note { padding: 12px 14px; border: 2px dashed var(--folder-blue); background: #eef3fc; font-size: 16px; }
.sx-demo-note code { font-family: ui-monospace, Menlo, monospace; background: var(--white); padding: 1px 6px; border: 1px solid var(--ruled); }

/* home test cards */
.sx-test { display: grid; gap: 10px; padding: 18px; background: var(--white); border: 1px solid var(--ruled); box-shadow: var(--shadow-sheet); }
.sx-test[data-state="open"] { border: 2px solid var(--ink); border-left: 8px solid var(--action-yellow); }
.sx-test[data-state="later"] { background: var(--paper); box-shadow: none; border-style: dashed; }
.sx-test h3 { font-size: 21px; }
.sx-test p { color: var(--pencil); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sx-test p svg, .sx-list svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.sx-test .tag { justify-self: start; }
.sx-meta { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border: 1px solid var(--ruled); }
.sx-meta div { padding: 8px 10px; border-left: 1px solid var(--ruled); }
.sx-meta div:first-child { border-left: 0; }
.sx-meta dt { font-size: 13px; color: var(--pencil); }
.sx-meta dd { margin: 0; font-weight: 700; }

/* rules */
.sx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.sx-list li { display: flex; gap: 12px; align-items: flex-start; }
.sx-list li svg { width: 24px; height: 24px; margin-top: 2px; color: var(--folder-blue); }

/* exam bar */
.sx-exam { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.sx-ebar { position: sticky; top: 0; z-index: 10; background: var(--folder-blue-deep); color: var(--white); padding: 10px 16px 0; }
.sx-ebar__row { max-width: 560px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sx-ebar__title { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-ebar__sub { font-size: 14px; color: var(--on-blue-soft); padding: 4px 0 8px; }
.sx-timer { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: rgba(255,255,255,.12); font-size: 22px; }
.sx-timer svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.sx-timer[data-level="warn"] { background: var(--action-yellow); color: var(--ink); }
.sx-timer[data-level="crit"] { background: var(--red); color: var(--white); }
@media (prefers-reduced-motion: no-preference) { .sx-timer[data-level="crit"] { animation: pulse 1s ease-in-out infinite; } @keyframes pulse { 50% { opacity: .65; } } }
.sx-save span { display: inline-flex; align-items: center; gap: 6px; }
.sx-save svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.sx-save .is-ok { color: #a8e3bd; }
.sx-save .is-off { color: var(--action-yellow); font-weight: 700; }
.sx-progress { height: 4px; background: rgba(255,255,255,.2); margin: 0 -16px; }
.sx-progress span { display: block; height: 100%; background: var(--action-yellow); }

/* question */
.sx-qwrap { padding-bottom: 24px; align-content: start; }
.sx-qhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sx-qno { font-weight: 700; font-size: 18px; }
.sx-qno small { font-weight: 400; color: var(--pencil); font-size: 15px; }
.sx-flag { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 2px solid var(--ruled); background: var(--white); font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); cursor: pointer; }
.sx-flag svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.sx-flag.is-on { background: var(--action-yellow); border-color: var(--ink); }
.sx-flag.is-on svg { fill: var(--ink); }
.sx-stem { font-size: 20px; line-height: 1.5; }
.sx-instr { font-size: 16px; color: var(--folder-blue-deep); font-weight: 700; }
.sx-opts { display: grid; gap: 10px; }
.sx-opt { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 14px; text-align: left; background: var(--white); border: 2px solid var(--ruled); font: inherit; font-size: 19px; color: var(--ink); cursor: pointer; }
.sx-opt:hover { border-color: var(--ink); }
.sx-opt:focus-visible { outline: 3px solid var(--folder-blue); outline-offset: 2px; }
.sx-opt__l { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 2px solid var(--ink); border-radius: 50%; font-weight: 700; }
.sx-opt__l.is-box { border-radius: 0; }
.sx-opt__l svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 3; }
.sx-opt.is-on { background: #fffbea; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sx-opt.is-on .sx-opt__l { background: var(--ink); color: var(--paper); }
.sx-essay { min-height: 220px; font-size: 19px !important; }

.sx-passage { background: var(--white); border: 1px solid var(--ruled); border-left: 6px solid var(--folder-blue); }
.sx-passage summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; cursor: pointer; list-style: none; }
.sx-passage summary::after { content: "Tutup"; margin-left: auto; font-size: 14px; color: var(--folder-blue); }
.sx-passage:not([open]) summary::after { content: "Baca"; }
.sx-passage summary svg { width: 20px; height: 20px; fill: none; stroke: var(--folder-blue); stroke-width: 2; }
.sx-passage p { padding: 0 14px 14px; font-size: 19px; line-height: 1.65; }

/* bottom nav */
.sx-nav { position: sticky; bottom: 0; z-index: 10; display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 2px solid var(--ink); }
.sx-nav .btn { min-height: 56px; padding-inline: 8px; font-size: 16px; }
.sx-nav .btn[data-variant="action"] { font-size: 18px; min-height: 56px; }
.sx-nav .btn svg { width: 20px; height: 20px; }
@media (min-width: 600px) { .sx-nav { grid-template-columns: repeat(3, 180px); justify-content: center; } }
@media (max-width: 380px) { .sx-nav .btn span { font-size: 14px; } }

/* bottom sheet (question grid / submit) */
dialog.sx-sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 88vh; background: var(--paper); color: var(--ink); box-shadow: 0 -12px 40px -12px rgba(0,0,0,.4); }
dialog.sx-sheet::backdrop { background: rgba(18, 58, 133, .55); }
.sx-sheet__body { display: grid; gap: 14px; padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); border-top: 6px solid var(--action-yellow); }
.sx-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sx-cell { min-height: 52px; font: inherit; font-size: 19px; font-weight: 700; border: 2px solid var(--ruled); background: var(--white); color: var(--ink); cursor: pointer; }
.sx-cell[data-st="ans"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.sx-cell[data-st="flag"] { background: var(--action-yellow); border-color: var(--ink); }
.sx-cell[aria-current="true"] { outline: 3px solid var(--folder-blue); outline-offset: 2px; }
.sx-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 15px; }
.sx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sx-legend i { width: 18px; height: 18px; border: 2px solid var(--ruled); display: inline-block; }
.sx-legend .g-ans { background: var(--ink); border-color: var(--ink); }
.sx-legend .g-flag { background: var(--action-yellow); border-color: var(--ink); }
.sx-legend .g-empty { background: var(--white); }
.sx-sum { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 18px; }
.sx-sum .is-warn { color: #8a5a00; font-weight: 700; }

/* submitted */
.sx-center { text-align: center; justify-items: center; }
.sx-center .sx-card, .sx-center .btn { text-align: left; width: 100%; }
.sx-done-ic { width: 84px; height: 84px; display: grid; place-items: center; background: var(--student-green); color: var(--white); }
.sx-done-ic svg { width: 52px; height: 52px; fill: none; stroke: currentColor; stroke-width: 3; }

/* results */
.sx-score { display: grid; gap: 4px; padding: 22px; background: var(--white); border: 2px solid var(--ink); }
.sx-score span { color: var(--pencil); font-weight: 700; }
.sx-score strong { font-size: 76px; line-height: .95; }
.sx-score em { font-style: normal; font-weight: 700; font-size: 18px; color: #8a5a00; display: inline-flex; gap: 6px; align-items: center; }
.sx-score.is-pass em { color: var(--student-green); }
.sx-score em svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; }
.sx-score small { color: var(--pencil); font-size: 16px; }
.sx-rev { display: grid; gap: 6px; padding: 14px 16px; background: var(--white); border: 1px solid var(--ruled); border-left: 6px solid var(--red); }
.sx-rev.is-ok { border-left-color: var(--student-green); }
.sx-rev__head { display: flex; justify-content: space-between; }
.sx-mark { display: inline-flex; gap: 4px; align-items: center; font-weight: 700; color: var(--red); }
.sx-rev.is-ok .sx-mark { color: var(--student-green); }
.sx-mark svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; }
.sx-rev .sx-stem { font-size: 18px; }
.sx-line { font-size: 17px; }
.sx-explain { font-size: 17px; background: #eef3fc; padding: 8px 10px; }

/* demo panel */
.sx-demo { max-width: 560px; margin: 8px auto 0; border: 2px dashed var(--folder-blue); background: #eef3fc; font-size: 16px; width: 100%; box-sizing: border-box; }
.sx-exam .sx-demo { margin: 0 auto 12px; width: calc(100% - 32px); }
.sx-demo summary { padding: 10px 14px; font-weight: 700; color: var(--folder-blue); cursor: pointer; }
.sx-demo__body { display: grid; gap: 10px; padding: 0 14px 14px; justify-items: start; }
.sx-demo__row { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.sx-demo__row input { width: 22px; height: 22px; accent-color: var(--ink); }
.toast { bottom: 96px; }
.sx-pin:placeholder-shown { letter-spacing: 0; font-size: 18px !important; }
.sx-test p { flex-wrap: nowrap; align-items: flex-start; } .sx-test p svg { margin-top: 3px; }
.sx-exam { grid-template-columns: minmax(0, 1fr); } .sx-exam > * { min-width: 0; } .sx-main { width: 100%; box-sizing: border-box; }
.sx-nav { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); }
.sx-nav .btn { min-width: 0; }
@media (max-width: 480px) {
  .sx-nav .btn { flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.1; white-space: normal; text-align: center; }
  .sx-nav .btn[data-variant="action"] { flex-direction: row; font-size: 17px; }
}
