/* panels and cards keep their own light colors even if the (partially built, not enabled) site dark mode is turned
   on, so cards always read as white cards with dark ink */
.st {
    --st-panel: #ffffff;
    --st-panel-alt: #f6f7f9;
    --st-ink: #15181c;
    --st-muted: #4d5560;
    --st-line: #cfd5dc;
    --st-line-strong: #8a96a3;
    --st-accent: #006699;
    --st-accent-dark: #004b70;
    --st-accent-darker: #00354f;
    --st-accent-tint: #dcecf6;
    --st-red: #a1122b;
    --st-black: #0f1114;
    --st-gold: #8a6510;
    --st-gold-bg: #fdf3cc;
    --st-good: #17703a;
    --st-good-dark: #0f5229;
    --st-good-bg: #e2f3e7;
    --st-bad: #b42318;
    --st-bad-bg: #fdeceb;
    --st-before: #5b2386;
    --st-after: #006699;
    --st-focus: #0f1114;
    --st-radius: var(--border-radius, 6px);
    --st-shadow: none;
    clear: both;
    color: var(--st-ink);
    margin: 0 0 30px;
    font-family: var(--body-font);
    font-size: 16px;
    line-height: 1.5;
}

.st [hidden] {
    display: none !important;
}

.st h1,
.st h2,
.st h3 {
    color: var(--st-ink);
}

.st p {
    margin: 0 0 10px;
}

.st strong {
    font-weight: 700;
}

.st a {
    color: var(--st-accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.st a:hover {
    color: var(--st-accent-dark);
    text-decoration-thickness: 2px;
}

.st a:active {
    color: var(--st-accent-darker);
}

.st :focus {
    outline: none;
}

.st :focus-visible {
    outline: 3px solid var(--st-focus);
    outline-offset: 3px;
}

.st-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.st-red {
    color: var(--st-red);
}

.st-black {
    color: var(--st-black);
}

.st-face {
    font-weight: 800;
    white-space: nowrap;
    font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI Symbol", sans-serif;
}

.st-muted {
    color: var(--st-muted);
}

.st-small {
    font-size: 14.5px;
    color: var(--st-muted);
}

.st-center {
    text-align: center;
}

/* hero */

.st-hero {
    margin-bottom: 16px;
}

.st-hero p {
    max-width: 680px;
    font-size: 16px;
    color: var(--post-text-color, #2c3238);
}

.st-hero strong {
    color: var(--title-color);
}

/* panels, labels */

.st-panel {
    background: var(--st-panel);
    border: 1px solid var(--item-contents-border, #ddd);
    border-radius: var(--st-radius);
    box-shadow: var(--st-shadow);
    padding: 18px;
    margin-bottom: 16px;
}

.st .st-label {
    font-size: 12.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--st-muted);
    margin: 0 0 10px;
}

.st .st-label-spaced {
    margin-top: 18px;
}

.st .st-heading {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
}

.st-notice {
    background: #fff8d6;
    border: 1px solid #e3cf74;
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 14px;
    font-size: 15px;
}

.st-empty {
    text-align: center;
    padding: 20px 0;
    color: var(--st-muted);
}

/* stats */

.st-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0 14px;
}

.st-stat {
    background: var(--st-panel-alt);
    border: 1px solid var(--item-contents-border, #ddd);
    border-radius: var(--st-radius);
    padding: 12px 14px;
    box-shadow: var(--st-shadow);
}

.st-stat b {
    display: block;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.st-stat span {
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--st-muted);
    font-weight: 700;
}

.st-stat.is-bumped {
    animation: st-bump .45s ease-out;
}

@keyframes st-bump {
    0% {
        background: var(--st-accent-tint);
        border-color: var(--st-accent);
    }
    100% {
        background: var(--st-panel-alt);
        border-color: var(--item-contents-border, #ddd);
    }
}

/* buttons */

.st button {
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.st-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 2px solid var(--st-accent);
    border-radius: 999px;
    background: var(--st-accent);
    color: #fff;
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .12s, border-color .12s, color .12s;
}

.st-btn:hover {
    background: var(--st-accent-dark);
    border-color: var(--st-accent-dark);
}

.st-btn:active {
    background: var(--st-accent-darker);
    border-color: var(--st-accent-darker);
    transform: translateY(1px);
}

.st-btn-secondary {
    background: #fff;
    color: var(--st-accent);
}

.st-btn-secondary:hover {
    background: var(--st-accent-tint);
    color: var(--st-accent-dark);
}

.st-btn-secondary:active {
    background: #c3dded;
    color: var(--st-accent-darker);
}

.st-btn-ghost {
    background: #fff;
    color: var(--st-ink);
    border-color: var(--st-line);
}

.st-btn-ghost:hover {
    background: var(--st-panel-alt);
    border-color: var(--st-line-strong);
}

.st-btn-ghost:active {
    background: #e4e8ec;
    border-color: var(--st-line-strong);
}

.st-btn-good {
    background: var(--st-good);
    border-color: var(--st-good);
}

.st-btn-good:hover {
    background: var(--st-good-dark);
    border-color: var(--st-good-dark);
}

.st-btn-good:active {
    background: #093a1c;
    border-color: #093a1c;
}

.st-btn:disabled,
.st-btn:disabled:hover,
.st-btn:disabled:active {
    background: #c9d0d7;
    border-color: #c9d0d7;
    color: #4d5560;
    cursor: not-allowed;
    transform: none;
}

.st-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.st-row-center {
    justify-content: center;
}

/* toggle buttons: stacks, quiz modes, flashcard direction */

.st-stack-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.st-stack-btn {
    min-height: 44px;
    border: 2px solid var(--st-line);
    background: var(--st-panel-alt);
    border-radius: 12px;
    padding: 12px;
    text-align: left;
    color: var(--st-ink);
    cursor: pointer;
}

.st-stack-btn strong {
    display: block;
    font-size: 16px;
    line-height: 1.2;
}

.st-stack-btn small {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.3;
    color: var(--st-muted);
}

.st-stack-btn:hover {
    border-color: var(--st-line-strong);
    background: #fff;
}

.st-stack-btn:active {
    background: #e4e8ec;
}

.st-stack-btn[aria-pressed="true"] {
    border-color: var(--st-accent);
    background: var(--st-accent-tint);
    box-shadow: inset 0 0 0 1px var(--st-accent);
}

.st-stack-btn[aria-pressed="true"] small {
    color: var(--st-accent-darker);
}

.st-modes,
.st-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.st-seg {
    justify-content: center;
}

.st-toggle-btn,
.st-tab {
    min-height: 44px;
    padding: 9px 16px;
    border: 2px solid var(--st-line);
    border-radius: 999px;
    background: #fff;
    color: var(--st-ink);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.st-toggle-btn:hover,
.st-tab:hover {
    border-color: var(--st-line-strong);
    background: var(--st-panel-alt);
}

.st-toggle-btn:active,
.st-tab:active {
    background: #e4e8ec;
}

.st-toggle-btn[aria-pressed="true"],
.st-tab[aria-selected="true"] {
    background: var(--st-ink);
    border-color: var(--st-ink);
    color: #fff;
}

.st-toggle-btn[aria-pressed="true"]:hover,
.st-tab[aria-selected="true"]:hover {
    background: #2f353c;
    border-color: #2f353c;
}

html.is-dark .st-tab[aria-selected="true"] {
    border-color: #fff;
}

.st-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 12px;
}

/* form controls */

.st-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.st-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.st-field label {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--st-muted);
}

.st select,
.st input[type="number"],
.st textarea {
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
    min-height: 44px;
    padding: 8px 10px;
    border: 2px solid var(--st-line);
    border-radius: 10px;
    background: #fff;
    color: var(--st-ink);
    font-family: inherit;
    font-size: 16px;
}

.st input[type="number"] {
    width: 96px;
}

.st textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
}

.st select:hover,
.st input[type="number"]:hover,
.st textarea:hover {
    border-color: var(--st-line-strong);
}

.st #st-range-label {
    margin: 10px 0 0;
}

.st-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin-top: 6px;
    padding: 4px 12px 4px 4px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
}

.st-toggle label:hover {
    background: var(--st-panel-alt);
}

.st-toggle label:active {
    background: #e4e8ec;
}

.st-toggle input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 0 0 0 6px;
    flex: none;
    accent-color: var(--st-accent);
    cursor: pointer;
}

.st #st-weak-hint {
    margin: 2px 0 0;
}

.st-msg {
    min-height: 1.5em;
    margin: 10px 0 0;
    font-weight: 600;
}

.st-msg.is-good {
    color: var(--st-good);
}

.st-msg.is-bad {
    color: var(--st-bad);
}

.st-details {
    margin-top: 14px;
}

.st-details summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 8px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

.st-details summary::before {
    content: "\25B8";
    margin-right: 8px;
}

.st-details[open] summary::before {
    content: "\25BE";
}

.st-details summary:hover {
    background: var(--st-panel-alt);
}

.st-details summary:active {
    background: #e4e8ec;
}

.st-builder-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.st-builder-grid select {
    width: 100%;
    font-size: 15px;
}

/* learn */

.st-quarter {
    margin-top: 18px;
}

.st-quarter-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
}

.st-quarter-head h3 {
    margin: 0;
    font-size: 19px;
}

.st-quarter-head span {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--st-muted);
}

.st-learn-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
}

.st .st-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 6px 10px;
    background: #fff;
    border: 1px solid var(--st-line);
    border-radius: 12px;
    text-align: center;
    list-style: none;
}

.st .st-cell.st-landmark {
    border: 2px solid var(--st-gold);
    background: var(--st-gold-bg);
    padding: 23px 5px 9px;
}

.st-cell-pos {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--st-muted);
}

.st-cell .st-face {
    font-size: 26px;
    line-height: 1.15;
}

.st-cell-name {
    font-size: 12.5px;
    color: var(--st-muted);
    line-height: 1.25;
}

.st-anchor {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    background: var(--st-gold);
    color: #fff;
    padding: 1px 6px;
    border-radius: 999px;
}

#st-rule-box .st-face {
    font-size: 17px;
}

/* the playing card used by flashcards and quizzes */

.st-playing-card {
    width: 150px;
    height: 210px;
    margin: 6px auto 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #c9cfd6;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
    text-align: center;
}

.st-big {
    font-size: 58px;
    font-weight: 900;
    line-height: 1;
}

.st-big-pos {
    font-size: 64px;
    color: var(--st-ink);
    font-variant-numeric: tabular-nums;
}

.st-card-caption {
    margin-top: 8px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--st-muted);
    line-height: 1.3;
}

.st .st-question {
    margin: 4px 0 8px;
    font-size: 19px;
    font-weight: 700;
    color: var(--st-ink);
}

.st-flash-stage {
    min-height: 270px;
}

.st-flash-actions {
    min-height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.st #st-flash-msg {
    min-height: 1.5em;
    margin: 8px 0 0;
}

/* before / after label */

.st .st-direction {
    display: inline-block;
    min-width: 200px;
    margin: 0 0 6px;
    padding: 8px 22px;
    border-radius: 999px;
    color: #fff;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: .08em;
    line-height: 1.2;
}

.st-direction-before {
    background: var(--st-before);
}

.st-direction-after {
    background: var(--st-after);
}

.st-wrap-note {
    font-weight: 700;
}

/* quiz options: select first, then Answer grades */

.st-group {
    margin-top: 14px;
}

.st .st-group-label {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--st-muted);
}

.st-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.st-opt {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 92px;
    padding: 24px 6px 10px;
    background: #fff;
    border: 2px solid var(--st-line);
    border-radius: 12px;
    color: var(--st-ink);
    cursor: pointer;
    text-align: center;
    transition: background-color .1s, border-color .1s;
}

.st-opt .st-face,
.st-opt-pos {
    font-size: 30px;
    line-height: 1.05;
    font-weight: 800;
}

.st-opt-pos {
    font-variant-numeric: tabular-nums;
}

.st-opt-name {
    font-size: 13px;
    line-height: 1.2;
    color: var(--st-muted);
}

.st-opt:hover {
    border-color: var(--st-line-strong);
    background: var(--st-panel-alt);
}

.st-opt:active {
    background: #e4e8ec;
    transform: translateY(1px);
}

.st-opt[aria-pressed="true"] {
    border-color: var(--st-accent);
    background: var(--st-accent-tint);
    box-shadow: inset 0 0 0 2px var(--st-accent);
}

.st-opt[aria-pressed="true"]:hover {
    background: #cfe4f1;
}

.st-opt[aria-pressed="true"] .st-opt-name {
    color: var(--st-accent-darker);
    font-weight: 700;
}

.st-opt[aria-pressed="true"] .st-opt-pos {
    color: var(--st-accent-darker);
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
}

.st-opt::before {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1px 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.st-opt[aria-pressed="true"]::before {
    content: "Selected";
    background: var(--st-accent);
}

.st-opt:disabled {
    cursor: default;
    transform: none;
}

.st-opt:disabled:hover {
    border-color: var(--st-line);
    background: #fff;
}

.st-opt:disabled:not(.is-correct):not(.is-wrong) {
    opacity: .72;
}

.st-opt.is-correct,
.st-opt.is-correct:hover {
    border-color: var(--st-good);
    background: var(--st-good-bg);
    box-shadow: inset 0 0 0 2px var(--st-good);
}

.st-opt.is-wrong,
.st-opt.is-wrong:hover {
    border-color: var(--st-bad);
    background: var(--st-bad-bg);
    box-shadow: inset 0 0 0 2px var(--st-bad);
}

.st-opt.is-correct::before {
    content: attr(data-badge);
    background: var(--st-good);
}

.st-opt.is-wrong::before {
    content: attr(data-badge);
    background: var(--st-bad);
}

.st-opt.is-correct .st-opt-pos,
.st-opt.is-wrong .st-opt-pos,
.st-opt.is-correct .st-opt-name,
.st-opt.is-wrong .st-opt-name {
    color: var(--st-ink);
}

.st-quiz-actions {
    margin-top: 16px;
}

.st-btn-answer {
    min-width: 190px;
}

.st-feedback {
    min-height: 62px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 500;
}


.st-feedback.is-good {
    background: var(--st-good-bg);
    border-color: #9fd2ad;
}

.st-feedback.is-bad {
    background: var(--st-bad-bg);
    border-color: #efb3ad;
}

.st-feedback.is-good > strong:first-child {
    color: var(--st-good-dark);
}

.st-feedback.is-bad > strong:first-child {
    color: var(--st-bad);
}

.st .st-keys {
    margin: 10px 0 0;
    font-size: 13px;
}

/* progress */

.st-weak-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.st .st-weak-chip {
    background: #fff;
    border: 1px solid var(--st-line);
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 700;
    font-size: 14.5px;
    list-style: none;
}

.st-table-wrap {
    overflow-x: auto;
    margin-top: 16px;
}

.st-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.st .st-table th,
.st .st-table td {
    padding: 8px;
    border-bottom: 1px solid var(--st-line);
    text-align: left;
}

.st .st-table th {
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--st-muted);
}

.st-table .st-face {
    font-size: 18px;
}

.st .st-tip {
    margin: 14px 0 0;
}

/* credits */

.st-credits {
    font-size: 15px;
    color: #2c3238;
}

.st .st-credits ul {
    margin: 0 0 10px;
    padding-left: 20px;
}

.st .st-credits li {
    list-style: disc outside;
    margin-bottom: 6px;
}

.st-credits p:last-child {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .st-stats,
    .st-stack-grid,
    .st-options,
    .st-builder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .st-learn-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .st-panel {
        padding: 14px;
    }

    .st .st-direction {
        font-size: 26px;
    }
}

@media (max-width: 420px) {
    .st-learn-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .st-stack-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .st-tab,
    .st-toggle-btn {
        padding: 9px 12px;
        font-size: 14.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .st-stat.is-bumped {
        animation: none;
    }

    .st-btn,
    .st-opt {
        transition: none;
    }

    .st-btn:active,
    .st-opt:active {
        transform: none;
    }
}
