:root {
    --sc-flag: #dc2626; --sc-flag-bg: rgba(220, 38, 38, .12); --sc-fix: #16a34a; --sc-fix-bg: rgba(22, 163, 74, .14);
    --sc-muted: #64748b; --sc-panel: rgba(79, 70, 229, .06);
}
[data-bs-theme="dark"] {
    --sc-flag: #f87171; --sc-flag-bg: rgba(248, 113, 113, .18); --sc-fix: #4ade80; --sc-fix-bg: rgba(74, 222, 128, .16);
    --sc-muted: #9ca3af; --sc-panel: rgba(129, 140, 248, .1);
}

.sc-hero { background: linear-gradient(120deg, #1e3a8a, #4f46e5 55%, #0d9488); }
.sc-input { font-size: 1.3rem; line-height: 1.7; }
.sc-samples { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.sc-sample { font-size: 1rem; }

/* The checked sentence, with the flagged characters marked */
.sc-sentence { font-size: clamp(1.5rem, 5.5vw, 2rem); line-height: 1.9; letter-spacing: .04em; word-break: break-all; }
.sc-flag { position: relative; background: var(--sc-flag-bg); color: inherit; padding: 0 .12em; border-radius: .25em;
           box-shadow: inset 0 -.14em 0 var(--sc-flag); cursor: pointer; }
.sc-flag-no { font-size: .45em; font-weight: 800; color: var(--sc-flag); margin-left: .1em; vertical-align: super; }
.sc-flag.is-linked { outline: 2px solid var(--sc-flag); }

.sc-verdict-clear { color: var(--sc-fix); }

/* The corrected version */
.sc-corrected { background: var(--sc-panel); border-radius: .8rem; padding: .8rem 1rem; }
.sc-corrected-text { font-size: clamp(1.3rem, 5vw, 1.7rem); font-weight: 600; letter-spacing: .04em; margin-right: .5rem; }
.sc-corrected-actions { display: inline-flex; flex-wrap: wrap; gap: .35rem; vertical-align: middle; }
.sc-corrected-text .sc-char { display: inline-block; }

/* Findings */
.sc-finding { padding: .8rem 0; border-top: 1px solid rgba(100, 116, 139, .2); }
.sc-finding:first-child { border-top: 0; padding-top: 0; }
.sc-finding.is-linked { background: var(--sc-flag-bg); border-radius: .6rem; }
.sc-finding-no { flex: 0 0 auto; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--sc-flag); color: #fff;
                 display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem; }
.sc-clause, .sc-fix { font-size: 1.25rem; letter-spacing: .03em; }
.sc-clause .sc-flag { cursor: default; }
.sc-moved { text-decoration: none; background: var(--sc-fix-bg); box-shadow: inset 0 -.14em 0 var(--sc-fix); border-radius: .25em; padding: 0 .12em; }

.sc-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .8rem 1.2rem; }
.sc-group ul { padding-left: 1.1rem; margin-top: .2rem; }
.sc-uncaught { columns: 2 18rem; column-gap: 1.5rem; }
.sc-uncaught li { break-inside: avoid; margin-bottom: .25rem; }

/* Motion: the mistakes shake in one after another, each finding slides in, and the fix settles into place. */
.sc-animate .sc-sentence .sc-flag { animation: sc-shake .55s ease-in-out both; animation-delay: calc(.35s + var(--sc-d, 0s)); }
.sc-animate .sc-finding { animation: sc-rise .45s ease-out both; animation-delay: calc(.25s + var(--sc-i) * .12s); }
.sc-animate .sc-moved { animation: sc-glow 1.6s ease-out .9s both; }
.sc-animate .sc-corrected-text .sc-char { animation: sc-drop .4s cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: calc(.6s + var(--sc-c) * .04s); }
.sc-animate.is-clear .sc-verdict-clear .fa { animation: sc-pop .6s cubic-bezier(.34, 1.56, .64, 1) .2s both; display: inline-block; }
.sc-animate.is-clear .sc-sentence { animation: sc-settle .8s ease-out both; }

@keyframes sc-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px) rotate(-2deg); }
    40% { transform: translateX(4px) rotate(2deg); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}
@keyframes sc-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sc-glow { 0% { background: transparent; box-shadow: none; } 40% { background: var(--sc-fix); } 100% { background: var(--sc-fix-bg); } }
@keyframes sc-drop { from { opacity: 0; transform: translateY(-.6em) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes sc-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes sc-settle { from { opacity: .3; letter-spacing: .3em; } to { opacity: 1; letter-spacing: .04em; } }

@media (prefers-reduced-motion: reduce) {
    .sc-animate *, .sc-animate { animation: none !important; }
}
