:root {
    --ink: #16312d;
    --muted: #667773;
    --paper: #f7f5ef;
    --card: #fffefa;
    --green: #176b57;
    --green-dark: #0d4c3e;
    --mint: #dcece3;
    --lime: #d9eb92;
    --coral: #df6b55;
    --line: #d9dfd9;
    --shadow: 0 24px 70px rgba(26, 65, 57, .12);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 92% 2%, rgba(217, 235, 146, .35), transparent 23rem),
        radial-gradient(circle at 3% 35%, rgba(220, 236, 227, .75), transparent 26rem),
        var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
}

.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header { border-bottom: 1px solid rgba(22, 49, 45, .1); }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); }
.brand-mark {
    width: 2.75rem; height: 2.75rem; border-radius: .85rem; display: grid; place-items: center;
    color: #fff; background: var(--green); font-family: Georgia, serif; font-size: 1.65rem; font-weight: 700;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12);
}
.brand strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.4rem; line-height: 1; }
.brand small { display: block; color: var(--muted); font-size: .68rem; letter-spacing: .08em; margin-top: .25rem; text-transform: uppercase; }
.header-note { align-items: center; gap: .55rem; color: var(--muted); font-size: .83rem; font-weight: 600; }
.status-dot { width: .52rem; height: .52rem; border-radius: 50%; background: #5aad72; box-shadow: 0 0 0 5px rgba(90, 173, 114, .12); }

.eyebrow { color: var(--green); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { max-width: 800px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.5rem, 6vw, 5rem); line-height: .94; letter-spacing: -.045em; }
.hero h1 span { color: var(--green); font-style: italic; font-weight: 400; }
.hero-copy { max-width: 670px; color: var(--muted); font-size: 1.02rem; line-height: 1.65; margin-top: 1.35rem !important; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.stat { padding: 1rem .6rem; text-align: center; background: rgba(255, 254, 250, .62); border: 1px solid var(--line); border-radius: 1rem; }
.stat strong { display: block; font-family: Georgia, serif; font-size: 1.5rem; line-height: 1.1; }
.stat span { display: block; color: var(--muted); font-size: .68rem; font-weight: 700; margin-top: .25rem; text-transform: uppercase; letter-spacing: .08em; }

.filter-panel { position: sticky; top: 1rem; padding: 1.35rem; border: 1px solid var(--line); border-radius: 1.25rem; background: rgba(255, 254, 250, .72); backdrop-filter: blur(12px); }
.filter-panel h2 { font-weight: 800; }
.form-label { color: var(--muted); font-size: .73rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.form-select { color: var(--ink); background-color: #fffefa; border-color: #cfd8d1; border-radius: .75rem; font-size: .9rem; padding-block: .68rem; box-shadow: none !important; }
.form-select:focus { border-color: var(--green); }
.btn-reset { padding: 0; border: 0; color: var(--green); background: transparent; font-size: .75rem; font-weight: 700; }
.btn-reset:hover { text-decoration: underline; }
.lowercase-note { display: flex; gap: .75rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.lowercase-note > span { flex: 0 0 auto; width: 2.45rem; height: 2.45rem; display: grid; place-items: center; border-radius: .65rem; color: var(--green-dark); background: var(--mint); font-family: Georgia, serif; font-weight: 700; font-size: .8rem; }
.lowercase-note p { color: var(--muted); font-size: .73rem; line-height: 1.35; margin: 0; }
.lowercase-note strong { display: block; color: var(--ink); font-size: .77rem; margin-bottom: .18rem; }

.exercise-card { min-height: 480px; padding: clamp(1.4rem, 4vw, 3.25rem); border: 1px solid rgba(22, 49, 45, .1); border-radius: 1.75rem; background: var(--card); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.exercise-card::after { content: ""; position: absolute; width: 12rem; height: 12rem; right: -6rem; bottom: -7rem; border: 2rem solid rgba(217, 235, 146, .22); border-radius: 50%; pointer-events: none; }
.exercise-topline { min-height: 1.9rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: clamp(2.8rem, 8vw, 5.5rem); }
.topic-badge, .meta-badge { display: inline-flex; align-items: center; padding: .38rem .7rem; border-radius: 99px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.topic-badge { color: #fff; background: var(--green); }
.meta-badge { color: var(--green-dark); background: var(--mint); }
.difficulty-dots { display: flex; gap: .3rem; }
.difficulty-dots i { display: block; width: .45rem; height: .45rem; border-radius: 50%; background: #d7ddd8; }
.difficulty-dots i.active { background: var(--coral); }
.prompt-label { color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; margin-bottom: 1.25rem; }
.sentence { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.85rem, 4vw, 3.2rem); line-height: 1.55; letter-spacing: -.025em; }
.answer-control { display: inline-flex; vertical-align: middle; align-items: stretch; height: 1.32em; margin: 0 .14em; border-bottom: 3px solid var(--green); }
.answer-control input { width: clamp(8rem, 20vw, 13rem); min-width: 0; padding: 0 .25em; border: 0; outline: 0; color: var(--green-dark); background: #f0f5ed; font-family: inherit; font-size: .78em; line-height: 1; text-align: center; border-radius: .2em 0 0 0; }
.answer-control input:focus { background: #e8f0e5; box-shadow: inset 0 0 0 2px rgba(23, 107, 87, .12); }
.answer-control input.is-correct { color: #12613e; background: #e1f2e4; }
.answer-control input.is-wrong { color: #9d3629; background: #f9e3df; }
.answer-control button { width: 1.35em; padding: 0; display: grid; place-items: center; border: 0; border-radius: 0 .22em 0 0; color: #fff; background: var(--green); transition: background .2s, transform .2s; }
.answer-control button:hover { background: var(--green-dark); }
.answer-control button:active { transform: scale(.94); }
.answer-control button:disabled { opacity: .55; }
.answer-control svg { width: .62em; height: .62em; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.translation { color: var(--muted); font-size: .94rem; margin: 1.1rem 0 0; }
.exercise-actions { min-height: 3rem; display: flex; align-items: center; gap: 1rem; margin-top: 2rem; }
.btn-hint { display: inline-flex; align-items: center; gap: .45rem; padding: .48rem .8rem; border: 1px solid var(--line); border-radius: .65rem; color: var(--ink); background: transparent; font-size: .78rem; font-weight: 700; }
.btn-hint:hover { border-color: var(--green); color: var(--green); }
.btn-hint svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hint-text { color: var(--muted); font-size: .84rem; margin: 0; }
.feedback { position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 1rem 1.15rem; margin-top: 1.2rem; border-radius: 1rem; }
.feedback.correct { background: #e4f3e7; color: #174d32; }
.feedback.wrong { background: #fae7e2; color: #7c3027; }
.feedback-icon { width: 2.15rem; height: 2.15rem; display: grid; place-items: center; border: 2px solid currentColor; border-radius: 50%; font-weight: 900; }
.feedback.correct .feedback-icon::before { content: "✓"; }
.feedback.wrong .feedback-icon::before { content: "×"; }
.feedback strong { display: block; font-size: .9rem; }
.feedback p { margin: .12rem 0 0; font-size: .78rem; line-height: 1.4; }
.btn-next { display: inline-flex; align-items: center; gap: .35rem; padding: .55rem .8rem; border: 0; border-radius: .65rem; color: #fff; background: var(--ink); font-size: .78rem; font-weight: 750; white-space: nowrap; }
.btn-next:hover { background: #071f1b; }
.btn-next svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.loading-state, .error-state { min-height: 260px; display: grid; place-items: center; align-content: center; gap: .8rem; text-align: center; color: var(--muted); }
.loading-state .spinner-border { width: 2rem; height: 2rem; color: var(--green); }
.loading-state p, .error-state p { margin: 0; font-size: .88rem; }

.method-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 1.25rem; background: rgba(255, 254, 250, .55); overflow: hidden; }
.method-strip > div { display: flex; align-items: center; gap: 1rem; padding: 1.15rem 1.35rem; }
.method-strip > div + div { border-left: 1px solid var(--line); }
.method-strip span { color: var(--coral); font-family: Georgia, serif; font-size: 1.2rem; font-style: italic; }
.method-strip p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.35; }
.method-strip strong { display: block; color: var(--ink); font-size: .82rem; }
footer { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .7rem; margin-top: auto; }
footer p { margin: 0; }

@media (max-width: 991.98px) {
    .filter-panel { position: static; }
    .exercise-card { min-height: 430px; }
    .exercise-topline { margin-bottom: 3rem; }
}

@media (max-width: 767.98px) {
    .hero h1 { font-size: 2.8rem; }
    .sentence { font-size: 1.9rem; line-height: 1.7; }
    .answer-control input { width: 8.5rem; }
    .feedback { grid-template-columns: auto 1fr; }
    .btn-next { grid-column: 1 / -1; justify-content: center; }
    .method-strip { grid-template-columns: 1fr; }
    .method-strip > div + div { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 420px) {
    .exercise-card { padding: 1.2rem; border-radius: 1.25rem; }
    .sentence { font-size: 1.6rem; }
    .answer-control input { width: 7.2rem; }
    .exercise-topline { align-items: flex-start; }
    .meta-badge { display: none; }
    footer { display: block; }
    footer p + p { margin-top: .35rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

