:root {
    --st-red-pen: #c0392b;
    --st-rule: rgba(61, 134, 68, .10);
    --st-margin-ink: rgba(192, 57, 43, .45);
    --st-desk: #eef1ec;
}

[data-theme="dark"] {
    --st-red-pen: #e36b5d;
    --st-rule: rgba(255, 255, 255, .05);
    --st-margin-ink: rgba(227, 107, 93, .45);
    --st-desk: #141414;
}

.st-desk { background: var(--st-desk); padding-block: 40px 72px; }
.st-paper {
  position: relative; max-width: 940px; margin: 0 auto; background: var(--paper); color: var(--fg);
  border: 1px solid var(--border); box-shadow: 0 30px 60px -40px var(--shadow), 0 2px 0 var(--border);
  padding: 44px 48px 36px 104px;
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, var(--st-rule) 31px 32px);
}
.st-paper::before { content: ""; position: absolute; top: 0; bottom: 0; left: 78px; border-left: 1.5px solid var(--st-margin-ink); }
.st-margin-note {
  position: absolute; left: 30px; top: 50%; transform: translateY(-50%) rotate(180deg); writing-mode: vertical-rl;
  font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--fg-2); opacity: .7; white-space: nowrap;
}

.st-paper-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: start; padding-bottom: 22px; border-bottom: 2px solid var(--fg); }
.st-board-line { font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--fg-2); margin: 0 0 14px; }
.st-board-line b { color: var(--fg); font-weight: 700; letter-spacing: .18em; }
.st-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; margin: 0; }
.st-fields div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.st-fields dt { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2); }
.st-fields dd { margin: 0; font-family: var(--mono); font-size: 17px; border-bottom: 1px dashed var(--fg-2); padding-bottom: 2px; overflow-wrap: anywhere; }

.st-title-block { padding: 34px 0 26px; border-bottom: 1px solid var(--border); }
.st-paper-code { font-family: var(--mono); font-size: 14px; color: var(--fg-2); margin: 0 0 12px; }
.st-title-block h1 { font-size: clamp(2.2rem, 1.3rem + 3.4vw, 4rem); line-height: 1.06; }
.st-title-block p.st-lede { margin: 18px 0 0; max-width: 36em; color: var(--fg-2); font-size: 1.07rem; }
.st-title-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 26px; }

.st-instructions { margin: 26px 0 8px; padding: 16px 20px; border: 1.5px solid var(--fg); }
.st-instructions h2 { font-family: var(--body); font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 8px; }
.st-instructions ul { margin: 0; padding-left: 18px; color: var(--fg-2); font-size: 14.5px; display: grid; gap: 4px; }
.st-instructions li::marker { color: var(--green); }

.st-q { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 54px; gap: 0 14px; padding: 34px 0 30px; border-bottom: 1px solid var(--border); }
.st-q-num { font-family: var(--display); font-size: 1.6rem; line-height: 1.2; color: var(--accent-text); }
.st-q-body { min-width: 0; }
.st-q-body h2 { font-size: clamp(1.35rem, 1.1rem + .9vw, 1.85rem); line-height: 1.2; margin-bottom: 10px; }
.st-q-body > p { margin: 0 0 16px; color: var(--fg-2); max-width: 38em; }

.st-scheme { margin: 0; padding: 14px 18px 12px; background: var(--wash-2); border-left: 3px solid var(--green); }
.st-scheme-label { display: block; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text); font-weight: 700; margin-bottom: 8px; }
.st-scheme ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-point { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; }
.st-point-mark { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 14px; color: var(--fg-2); }
.st-tick { width: 22px; height: 18px; color: var(--st-red-pen); }
.st-tick path { stroke-dasharray: 30; stroke-dashoffset: 30; transition: stroke-dashoffset .45s ease .15s; }
.st-point.st-awarded .st-tick path { stroke-dashoffset: 0; }
.st-point.st-awarded .st-point-mark { color: var(--st-red-pen); }
.st-scheme .st-more { margin-top: 12px; }

.st-mcq-stem { font-size: 1.08rem; margin: 0 0 14px; max-width: 36em; }
.st-mcq-stem var { font-style: italic; font-family: var(--display); }
.st-opts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; max-width: 520px; }
.st-opt {
  position: relative; width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; font: inherit; font-size: 16px; text-align: left;
  color: var(--fg); background: transparent; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; transition: border-color .2s ease, background .2s ease;
}
.st-opt:hover:not([disabled]) { border-color: var(--green); }
.st-opt[disabled] { cursor: default; }
.st-bubble { position: relative; flex: none; width: 30px; height: 20px; border: 1.5px solid var(--fg-2); border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; color: var(--fg-2); overflow: hidden; }
.st-bubble::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: repeating-linear-gradient(-55deg, var(--fg) 0 1.3px, transparent 1.3px 2.6px); transform: scaleX(0); transform-origin: left; transition: transform .35s ease-out; }
.st-opt.st-chosen .st-bubble::after { transform: scaleX(1); }
.st-opt-val { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.st-verdict { position: absolute; right: 8px; top: 50%; width: 34px; height: 30px; transform: translateY(-50%) rotate(-6deg); color: var(--st-red-pen); pointer-events: none; }
.st-verdict path { stroke-dasharray: 60; stroke-dashoffset: 60; transition: stroke-dashoffset .5s ease .1s; }
.st-opt.st-marked .st-verdict path { stroke-dashoffset: 0; }
.st-opt[data-key="C"] .st-verdict { color: var(--green); }

.st-feedback { margin-top: 18px; max-width: 520px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 16px; background: var(--paper); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; box-shadow: 0 14px 30px -18px var(--shadow); }
.st-feedback[hidden] { display: none; }
.st-feedback img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--green); }
.st-fb-name { font-size: 12.5px; font-weight: 700; margin-bottom: 2px; }
.st-fb-name span { font-weight: 400; color: var(--fg-2); margin-left: 6px; }
.st-fb-msg { margin: 0; font-size: 15px; }
.st-fb-msg strong { display: block; }
.st-fb-actions { margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.st-fb-actions button { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.st-formula { font-family: var(--display); white-space: nowrap; }

.st-lazuli-q { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.st-chat { display: grid; gap: 10px; }
.st-bubble-msg { padding: 10px 14px; border-radius: 14px; font-size: 14.5px; max-width: 30em; border: 1px solid var(--border); }
.st-bubble-msg.st-me { justify-self: end; background: var(--wash); border-radius: 14px 14px 4px 14px; }
.st-bubble-msg.st-lz { background: var(--paper); border-radius: 14px 14px 14px 4px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; box-shadow: 0 14px 30px -20px var(--shadow); }
.st-bubble-msg.st-lz img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--green); }
.st-bubble-msg b { display: block; font-size: 12.5px; }

.st-devices { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.st-devices li { font-family: var(--mono); font-size: 13.5px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--fg-2); }

.st-code-demo { display: inline-flex; gap: 4px; margin: 2px 0 16px; }
.st-code-demo span { width: 28px; height: 34px; border: 1.5px solid var(--fg-2); border-radius: 4px; display: grid; place-items: center; font-family: var(--mono); font-size: 18px; color: var(--fg); }

.st-end { text-align: center; padding: 38px 0 6px; }
.st-end-rule { display: flex; align-items: center; gap: 16px; justify-content: center; font-family: var(--mono); font-size: 14px; letter-spacing: .3em; color: var(--fg-2); }
.st-end-rule::before, .st-end-rule::after { content: ""; flex: 1; max-width: 160px; border-top: 1.5px solid var(--fg); }
.st-end h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); margin: 28px auto 12px; max-width: 18em; }
.st-end p { color: var(--fg-2); margin: 0 auto 24px; max-width: 32em; }
.st-end .st-title-actions { justify-content: center; }
.st-paper-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; padding-top: 12px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; color: var(--fg-2); }

@media (max-width: 760px) {
  .st-paper { padding: 28px 18px 26px 46px; }
  .st-paper::before { left: 32px; }
  .st-margin-note { left: 8px; font-size: 9.5px; }
  .st-paper-head { grid-template-columns: minmax(0, 1fr); }
  .st-fields { grid-template-columns: minmax(0, 1fr); }
  .st-q { grid-template-columns: 30px minmax(0, 1fr); }
  .st-q-body { grid-column: 1 / -1; }
  .st-q-num { grid-row: 1; }
  .st-lazuli-q { grid-template-columns: minmax(0, 1fr); }
  .st-opts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .st-desk { padding-block: 16px 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .st-tick path, .st-verdict path, .st-bubble::after { transition: none; }
}

.st-optional { font-family: var(--body); font-size: .6em; color: var(--fg-2); }
