:root {
    --ink: #17201b;
    --muted: #66706a;
    --paper: #f7f8f4;
    --surface: #ffffff;
    --line: #dde2dc;
    --line-strong: #c8d0c9;
    --green: #285c45;
    --green-dark: #194331;
    --green-soft: #e5efe9;
    --lime: #d7e9a7;
    --amber-soft: #fff4d8;
    --red: #a83d3d;
    --red-soft: #fbe8e6;
    --shadow-sm: 0 1px 2px rgba(23, 32, 27, 0.05);
    --shadow-md: 0 18px 50px rgba(34, 52, 42, 0.09);
    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 28px;
    --page: 1180px;
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
body.modal-open { overflow: hidden; }

:focus-visible {
    outline: 3px solid rgba(40, 92, 69, 0.28);
    outline-offset: 3px;
}

.site-header {
    align-items: center;
    display: flex;
    height: 76px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: calc(var(--page) + 64px);
    padding: 0 32px;
}

.brand { align-items: center; display: flex; font-size: 18px; font-weight: 720; gap: 10px; letter-spacing: -0.02em; }
.brand-mark { align-items: center; background: var(--green); border-radius: 9px; color: white; display: inline-flex; font-size: 14px; height: 30px; justify-content: center; width: 30px; }
.main-nav { align-items: center; display: flex; gap: 28px; }
.main-nav > a:not(.button), .nav-button { color: var(--muted); font-size: 14px; font-weight: 600; transition: color 160ms ease; }
.main-nav > a:not(.button):hover, .nav-button:hover { color: var(--ink); }
.main-nav form { display: flex; margin: 0; }
.nav-button, .text-button { background: none; border: 0; padding: 0; }

.page-shell { margin: 0 auto; max-width: var(--page); min-height: calc(100vh - 156px); padding: 54px 0 84px; }
.site-footer { align-items: center; border-top: 1px solid var(--line); color: var(--muted); display: flex; font-size: 13px; justify-content: space-between; margin: 0 auto; max-width: var(--page); padding: 26px 0 34px; }
.footer-links { align-items: center; display: flex; gap: 18px; }
.footer-links a { color: var(--green); font-weight: 700; }

.cookie-banner { align-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; bottom: 22px; box-shadow: 0 18px 55px rgba(23, 32, 27, .16); display: flex; gap: 32px; justify-content: space-between; left: 50%; max-width: 850px; padding: 20px 22px; position: fixed; transform: translateX(-50%); width: calc(100% - 36px); z-index: 20; }
.cookie-banner > div:first-child { max-width: 560px; }
.cookie-banner strong { display: block; margin-bottom: 4px; }
.cookie-banner p { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.cookie-banner a { color: var(--green); font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.cookie-banner-actions, .consent-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-banner-actions form, .consent-actions form { display: flex; margin: 0; }

.verification-banner { align-items: center; background: var(--amber-soft); border-block: 1px solid #ead8a7; color: #614f21; display: flex; font-size: 13px; gap: 22px; justify-content: center; padding: 10px 24px; }
.verification-banner-action { font-weight: 750; text-decoration: underline; text-underline-offset: 3px; transition: color 160ms ease; }
.verification-banner-action:hover { color: var(--green); }

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(38px, 4.3vw, 60px); letter-spacing: -0.052em; line-height: 1.02; margin-bottom: 18px; }
h2 { font-size: 25px; letter-spacing: -0.035em; line-height: 1.15; }
h3 { font-size: 17px; letter-spacing: -0.02em; }
.eyebrow { color: var(--green); display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.15em; margin-bottom: 17px; text-transform: uppercase; }
.muted, .muted-copy { color: var(--muted); }

.button {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    display: inline-flex;
    font-size: 14px;
    font-weight: 720;
    gap: 8px;
    justify-content: center;
    min-height: 46px;
    padding: 11px 18px;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.button-secondary:hover { border-color: var(--green); color: var(--green); }
.button-danger { background: var(--red); color: white; }
.button-danger:hover { background: #852e2e; }
.button-large { min-height: 52px; padding: 14px 22px; }
.button-small { min-height: 38px; padding: 8px 14px; }
.button-full { width: 100%; }
.button:disabled { cursor: not-allowed; opacity: 0.45; transform: none; }
.text-link, .back-link { color: var(--green); font-size: 14px; font-weight: 700; }
.back-link { display: inline-block; margin-bottom: 28px; }
.text-button { color: var(--green); font-size: 14px; font-weight: 720; }
.danger-link { background: none; border: 0; color: var(--red); font-size: 13px; padding: 0; }

.flash-stack { display: grid; gap: 9px; margin: -24px 0 26px; }
.flash { border: 1px solid var(--line); border-radius: 11px; font-size: 14px; padding: 12px 15px; }
.flash-success { background: var(--green-soft); border-color: #bfd5c6; color: var(--green-dark); }
.flash-error { background: var(--red-soft); border-color: #edc9c5; color: #7c2e2e; }
.flash-warning { background: var(--amber-soft); border-color: #ead8a7; color: #614f21; }
.flash-info { background: #eaf0f5; border-color: #cbd9e4; color: #334e63; }

/* Landing */
.landing-shell { padding-top: 82px; }
.hero { align-items: center; display: grid; gap: 96px; grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr); min-height: 540px; }
.hero-copy { padding-bottom: 26px; }
.hero h1 { max-width: 690px; }
.hero-lead { color: var(--muted); font-size: 19px; line-height: 1.65; max-width: 610px; }
.hero-actions { align-items: center; display: flex; gap: 27px; margin: 34px 0 24px; }
.hero-note { align-items: center; color: var(--muted); display: flex; font-size: 12px; gap: 9px; }
.status-dot { background: #67a66f; border: 3px solid #dcebdc; border-radius: 50%; display: inline-block; height: 11px; width: 11px; }
.hero-demo { background: #eff3e9; border: 1px solid #d9e0d4; border-radius: 32px; box-shadow: var(--shadow-md); padding: 24px; transform: rotate(1.1deg); }
.demo-topline { color: var(--muted); display: flex; font-size: 12px; font-weight: 700; justify-content: space-between; margin: 0 4px 17px; text-transform: uppercase; }
.demo-card { background: var(--surface); border-radius: 23px; box-shadow: 0 14px 36px rgba(25, 54, 39, 0.08); min-height: 330px; padding: 42px 36px; position: relative; }
.card-label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.demo-card strong { display: block; font-family: Georgia, serif; font-size: 29px; font-weight: 500; line-height: 1.25; margin: 58px 0 36px; }
.demo-answer { border-top: 1px solid var(--line); color: var(--green); font-size: 14px; font-weight: 650; padding-top: 18px; }
.demo-progress, .progress-track { background: #d9dfd4; border-radius: 99px; height: 4px; margin: 20px 3px 13px; overflow: hidden; }
.demo-progress span, .progress-track span { background: var(--green); border-radius: inherit; display: block; height: 100%; width: 35%; }
.practice-progress { appearance: none; background: #d9dfd4; border: 0; border-radius: 99px; display: block; height: 5px; margin: 10px 0 26px; overflow: hidden; width: 100%; }
.practice-progress::-webkit-progress-bar { background: #d9dfd4; border-radius: 99px; }
.practice-progress::-webkit-progress-value { background: var(--green); border-radius: 99px; transition: width 240ms ease; }
.practice-progress::-moz-progress-bar { background: var(--green); border-radius: 99px; }
.demo-hint { color: var(--muted); font-size: 11px; text-align: center; }
.principles { border-top: 1px solid var(--line); display: grid; gap: 58px; grid-template-columns: repeat(3, 1fr); margin-top: 90px; padding-top: 58px; }
.principles article > span { color: #8d9890; font-size: 12px; font-weight: 800; }
.principles h2 { font-size: 18px; margin: 18px 0 8px; }
.principles p { color: var(--muted); font-size: 14px; line-height: 1.7; }

/* Shared page components */
.page-heading { align-items: end; display: flex; justify-content: space-between; margin-bottom: 48px; }
.page-heading h1 { font-size: 45px; margin-bottom: 10px; }
.page-heading p { color: var(--muted); margin-bottom: 0; }
.page-heading .eyebrow { margin-bottom: 13px; }
.deck-heading { align-items: center; }
.deck-heading h1 { overflow-wrap: anywhere; }
.deck-heading .back-link { margin-bottom: 24px; }
.primary-actions, .editor-actions { align-items: center; display: flex; gap: 11px; }
.section-block { margin-top: 56px; }
.section-heading { align-items: end; display: flex; justify-content: space-between; margin-bottom: 20px; }
.section-heading h2 { margin: 0; }
.section-heading .eyebrow { margin-bottom: 9px; }
.section-heading > a { color: var(--green); font-size: 13px; font-weight: 700; }
.deck-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
.large-grid { margin-top: -8px; }
.deck-card { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; justify-content: space-between; min-height: 102px; padding: 16px; transition: border 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.deck-card:hover { border-color: #bac8bd; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.deck-card-main { align-items: center; display: flex; flex: 1; gap: 15px; min-width: 0; }
.deck-icon { align-items: center; background: var(--green-soft); border-radius: 13px; color: var(--green); display: flex; flex: 0 0 52px; font-family: Georgia, serif; font-size: 22px; height: 52px; justify-content: center; }
.deck-card h2, .deck-card h3 { margin: 0 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-card h2 { font-size: 17px; }
.deck-card p { color: var(--muted); font-size: 12px; margin: 0; }
.icon-link { align-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--green); display: flex; flex: 0 0 34px; height: 34px; justify-content: center; }
.deck-card-add { border-style: dashed; color: var(--green); gap: 11px; justify-content: center; }
.deck-card-add > span { font-size: 24px; font-weight: 300; }
.resume-card { align-items: center; background: var(--green); border-radius: var(--radius); color: white; display: flex; gap: 15px; margin: 0 0 50px; padding: 17px 20px; }
.resume-icon { align-items: center; background: rgba(255,255,255,.13); border-radius: 10px; display: flex; height: 42px; justify-content: center; width: 42px; }
.resume-card > span:nth-child(2) { display: grid; }
.resume-card small { color: rgba(255,255,255,.7); }
.resume-arrow { font-size: 13px; font-weight: 700; margin-left: auto; }
.empty-state { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column; margin-top: 30px; padding: 76px 32px; text-align: center; }
.empty-state h2 { margin: 25px 0 10px; }
.empty-state p { color: var(--muted); max-width: 470px; }
.empty-illustration { align-items: center; display: flex; gap: 12px; }
.empty-illustration span { background: var(--green-soft); border: 1px solid #cbdccf; border-radius: 9px; color: var(--green); font-size: 12px; font-weight: 700; padding: 13px 17px; }
.empty-illustration i { color: #9aa39d; font-style: normal; }
.error-state { min-height: 470px; }

/* Forms and editors */
.auth-shell { align-items: center; display: flex; justify-content: center; padding-top: 45px; position: relative; }
.auth-shell > .flash-stack { left: 50%; margin: 0; position: absolute; top: -12px; transform: translateX(-50%); width: min(100%, 500px); z-index: 10; }
.auth-card, .editor-card, .setup-card, .section-card, .settings-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.auth-card { padding: 44px; width: min(100%, 480px); }
.compact-card { width: min(100%, 500px); }
.auth-intro { margin-bottom: 30px; }
.auth-intro h1 { font-size: 36px; margin-bottom: 11px; }
.auth-intro p, .editor-card > p { color: var(--muted); font-size: 14px; }
.auth-switch { color: var(--muted); font-size: 13px; margin: 24px 0 0; text-align: center; }
.auth-switch a, .form-meta a { color: var(--green); font-weight: 700; }
.form-stack { display: grid; gap: 19px; }
.form-stack label, .form-grid label, .card-editor label, .answer-form > label, .confirm-box label { color: #3e4942; display: grid; font-size: 13px; font-weight: 700; gap: 7px; }
input, textarea, select { background: #fbfcfa; border: 1px solid var(--line-strong); border-radius: 11px; min-height: 46px; padding: 11px 13px; transition: border 150ms ease, box-shadow 150ms ease; width: 100%; }
textarea { line-height: 1.55; min-height: 130px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(40, 92, 69, .1); outline: 0; }
label small { color: var(--muted); font-size: 11px; font-weight: 500; }
.form-meta { display: flex; font-size: 12px; justify-content: flex-end; margin-top: -8px; }
.code-input { font-size: 23px; font-weight: 700; letter-spacing: .28em; text-align: center; }
.inline-centered { margin-top: 20px; text-align: center; }
.verification-delivery-status { margin-bottom: 20px; }
.narrow-content { margin: 0 auto; max-width: 650px; }
.editor-card { padding: 45px; }
.editor-card h1 { font-size: 38px; }
.editor-card form { margin-top: 31px; }
.editor-layout { display: grid; gap: 85px; grid-template-columns: .78fr 1.22fr; padding-top: 22px; }
.editor-copy { padding-top: 20px; }
.editor-copy h1 { font-size: 46px; }
.editor-copy p { color: var(--muted); font-size: 15px; line-height: 1.7; }
.card-editor { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); display: grid; padding: 33px; }
.card-editor label > span { display: flex; justify-content: space-between; }
.card-editor textarea { font-family: Georgia, serif; font-size: 19px; }
.card-editor > .editor-actions { margin-top: 22px; }
.editor-arrow { align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 50%; color: var(--green); display: flex; height: 32px; justify-content: center; margin: 14px auto; width: 32px; }
.card-list { display: grid; gap: 12px; }
.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 20px 22px 13px; }
.list-card-content { display: grid; gap: 35px; grid-template-columns: 1fr 1fr; }
.list-card-content > div + div { border-left: 1px solid var(--line); padding-left: 35px; }
.list-card-label { align-items: center; display: flex; gap: 6px; }
.list-card-content span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.list-card-content p { font-family: Georgia, serif; font-size: 17px; margin: 8px 0 15px; white-space: pre-wrap; }
.list-card-meta { align-items: center; border-top: 1px solid #edf0ec; color: var(--muted); display: flex; font-size: 12px; gap: 16px; padding-top: 11px; }
.list-card-meta > span { margin-right: auto; }
.list-card-meta a { color: var(--green); font-weight: 700; }
.deck-tools { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; margin-top: 45px; padding-top: 18px; }
.deck-tools summary, .danger-zone summary { cursor: pointer; width: max-content; }
.deck-tools-panel { align-items: start; display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(340px, .9fr); padding: 22px 0 28px; }
.deck-tools-copy { display: grid; gap: 7px; }
.deck-tools-copy strong { color: var(--ink); font-size: 15px; }
.deck-tools-copy p { line-height: 1.65; margin: 0; max-width: 560px; }
.deck-tools-copy code { color: var(--green); }
.deck-tools-actions { align-items: start; display: grid; gap: 16px; }
.csv-import-form { align-items: end; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
.csv-import-form label { color: #3e4942; display: grid; font-size: 12px; font-weight: 700; gap: 6px; }
.csv-import-form input[type="file"] { font-size: 12px; min-height: 38px; padding: 7px 9px; }
.danger-zone { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; margin-top: 45px; padding-top: 18px; }
.deck-tools + .danger-zone { margin-top: 0; }
.danger-zone > div { align-items: center; display: flex; gap: 25px; padding: 20px 0; }
.danger-zone a { color: var(--green); font-weight: 700; }

/* Practice setup and session */
.setup-layout { align-items: start; display: grid; gap: 100px; grid-template-columns: .85fr 1.15fr; padding-top: 20px; }
.setup-copy h1 { font-size: 50px; }
.setup-copy > p { color: var(--muted); font-size: 17px; max-width: 430px; }
.setup-fact { align-items: baseline; border-top: 1px solid var(--line); display: flex; gap: 10px; margin-top: 40px; padding-top: 22px; }
.setup-fact strong { font-family: Georgia, serif; font-size: 35px; font-weight: 500; }
.setup-fact span { color: var(--muted); font-size: 13px; }
.setup-card { padding: 34px; }
fieldset { border: 0; display: grid; gap: 9px; margin: 0; padding: 0; }
legend { font-size: 13px; font-weight: 750; margin-bottom: 9px; }
.radio-card { align-items: center; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; display: flex !important; gap: 12px !important; padding: 13px; }
.radio-card:has(input:checked) { background: var(--green-soft); border-color: #a9c2af; }
.radio-card input { accent-color: var(--green); background: transparent; border: 0; box-shadow: none; flex: 0 0 17px; height: 17px; min-height: 0; padding: 0; width: 17px; }
.radio-card input:focus, .radio-card input:focus-visible { border: 0; box-shadow: none; outline: none; }
.radio-card:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(40, 92, 69, .18); }
.radio-card span { display: grid; }
.radio-card small { margin-top: 2px; }
.weak-threshold { align-items: center; background: #f7f9f6; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 12px; grid-template-columns: 1fr 120px; margin: 0 12px 3px 42px; padding: 11px 13px; }
.weak-threshold[hidden] { display: none; }
.weak-threshold label { font-size: 12px; }
.weak-threshold select { min-height: 40px; padding-block: 8px; }
.session-options { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.active-session-box { align-items: start; background: var(--green-soft); border-radius: 14px; display: flex; gap: 13px; margin-bottom: 25px; padding: 18px; }
.active-session-box p { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.practice-shell { max-width: 940px; padding-top: 25px; }
.practice-topbar { align-items: center; color: var(--muted); display: flex; font-size: 13px; justify-content: space-between; margin-bottom: 25px; }
.practice-topbar .back-link { margin: 0; }
.practice-panel { margin: 0 auto; max-width: 790px; }
.practice-progress-row { color: var(--muted); display: flex; font-size: 11px; font-weight: 750; justify-content: space-between; letter-spacing: .08em; text-transform: uppercase; }
.progress-track { height: 5px; margin: 10px 0 26px; }
.practice-card { height: 360px; perspective: 1200px; }
.practice-card-inner { height: 100%; position: relative; transform-style: preserve-3d; transition: transform 480ms cubic-bezier(.2,.75,.25,1); width: 100%; }
.practice-card.is-revealed .practice-card-inner { transform: rotateX(180deg); }
.practice-face { align-items: center; backface-visibility: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); display: flex; flex-direction: column; inset: 0; justify-content: center; padding: 52px; position: absolute; text-align: center; }
.practice-prompt { align-items: center; display: flex; gap: 14px; justify-content: center; max-width: 720px; width: 100%; }
.speak-button { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 50%; color: var(--green); display: inline-flex; flex: 0 0 42px; height: 42px; justify-content: center; padding: 0; transition: background 160ms ease, border-color 160ms ease, transform 160ms ease; width: 42px; }
.speak-button:hover { background: var(--green-soft); border-color: #a9c2af; transform: translateY(-1px); }
.speak-button:active { transform: translateY(0); }
.speak-button.is-speaking { background: var(--green-soft); border-color: var(--green); }
.speak-button[hidden] { display: none; }
.speak-button svg { fill: currentColor; height: 20px; width: 20px; }
.speak-button-compact { background: transparent; border-color: transparent; flex-basis: 28px; height: 28px; width: 28px; }
.speak-button-compact svg { height: 15px; width: 15px; }
.practice-face h1, .practice-face h2 { font-family: Georgia, serif; font-size: clamp(28px, 4vw, 43px); font-weight: 500; line-height: 1.25; margin: 28px 0; max-width: 650px; white-space: pre-wrap; }
.practice-back { background: #f1f5ec; transform: rotateX(180deg); }
.practice-back h2 { color: var(--green-dark); }
.result-copy { color: var(--muted); font-size: 13px; margin: 0; }
.review-chip { background: var(--amber-soft); border-radius: 99px; color: #775f20; font-size: 11px; font-weight: 700; padding: 6px 10px; }
.answer-form { margin: 28px auto 0; max-width: 680px; }
.answer-row { display: grid; gap: 10px; grid-template-columns: 1fr auto; margin-top: 7px; }
.answer-row input { background: var(--surface); min-height: 52px; }
.reveal-form { margin-top: 18px; text-align: center; }
.practice-actions { display: flex; }
.single-action { justify-content: center; margin-top: 28px; }
.completion-card { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); display: flex; flex-direction: column; padding: 58px; text-align: center; }
.completion-mark { align-items: center; background: var(--green-soft); border-radius: 50%; color: var(--green); display: flex; font-size: 26px; height: 62px; justify-content: center; margin-bottom: 24px; width: 62px; }
.completion-card h1 { font-size: 48px; }
.completion-card > p { color: var(--muted); max-width: 510px; }
.summary-grid { border-block: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); margin: 30px 0; padding: 24px 0; width: 100%; }
.summary-grid div { display: grid; gap: 3px; }
.summary-grid strong { font-family: Georgia, serif; font-size: 26px; font-weight: 500; }
.summary-grid span { color: var(--muted); font-size: 10px; }

/* Statistics and settings */
.stats-overview { display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; }
.stats-overview article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 15px; padding: 23px; }
.stats-overview span { color: var(--muted); font-size: 12px; }
.stats-overview strong { font-family: Georgia, serif; font-size: 32px; font-weight: 500; }
.stats-columns { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; }
.section-card { padding: 28px; }
.stats-list, .weak-list { display: grid; }
.stats-list a, .weak-list > div { align-items: center; border-top: 1px solid #edf0ec; display: flex; justify-content: space-between; padding: 14px 0; }
.stats-list span, .weak-list span { display: grid; min-width: 0; }
.stats-list small, .weak-list small { color: var(--muted); font-size: 11px; }
.stats-list b, .weak-list b { color: var(--green); font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.settings-layout { display: grid; gap: 16px; }
#email-settings { scroll-margin-top: 24px; }
.settings-card { align-items: start; display: grid; gap: 55px; grid-template-columns: .7fr 1.3fr; padding: 30px; }
.settings-card h2 { font-size: 19px; margin-bottom: 7px; }
.settings-card p { color: var(--muted); font-size: 13px; margin-bottom: 0; }
.form-grid { align-items: end; display: grid; gap: 12px; grid-template-columns: 1fr 1fr auto; }
.setting-row { display: grid; gap: 16px; justify-items: start; }
.switch-label { align-items: center; cursor: pointer; display: flex; justify-content: space-between; width: 100%; }
.switch-label > span { display: grid; }
.switch-label input { height: 1px; min-height: 1px; opacity: 0; position: absolute; width: 1px; }
.switch-label i { background: #cbd1cc; border-radius: 99px; height: 26px; position: relative; transition: background 160ms; width: 46px; }
.switch-label i::after { background: white; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.2); content: ""; height: 20px; left: 3px; position: absolute; top: 3px; transition: transform 160ms; width: 20px; }
.switch-label input:checked + i { background: var(--green); }
.switch-label input:checked + i::after { transform: translateX(20px); }
.confirm-box { background: var(--green-soft); border-radius: 13px; display: grid; gap: 11px; grid-column: 1 / -1; margin-top: 15px; padding: 17px; }
.confirm-box .code-input { max-width: 220px; }
.confirm-box .button { justify-self: start; }
.inline-note { background: var(--amber-soft); border-radius: 10px; grid-column: 1 / -1; padding: 11px; }

/* Privacy and cookies */
.legal-page { margin: 0 auto; max-width: 820px; }
.legal-heading { border-bottom: 1px solid var(--line); margin-bottom: 38px; padding-bottom: 34px; }
.legal-heading h1 { font-size: clamp(38px, 5vw, 55px); }
.legal-heading p, .legal-page section p, .cookie-list dd { color: var(--muted); }
.legal-page section { margin-bottom: 34px; }
.legal-page section h2 { font-size: 21px; margin-bottom: 10px; }
.legal-page section a { color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.cookie-list { display: grid; gap: 10px; margin: 0; }
.cookie-list > div { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; display: grid; gap: 10px; grid-template-columns: minmax(170px, .4fr) 1fr; padding: 17px; }
.cookie-list dt { font-weight: 750; }
.cookie-list dd { font-size: 14px; margin: 0; }
.consent-settings { align-items: center; background: var(--green-soft); border-radius: var(--radius); display: flex; gap: 28px; justify-content: space-between; padding: 24px; }
.consent-settings > div:first-child { max-width: 430px; }
.consent-settings p { margin-bottom: 0; }
.settings-card .consent-actions { align-self: center; }

/* Shared confirmation modal */
.confirm-dialog { background: transparent; border: 0; color: var(--ink); max-width: 470px; padding: 18px; width: calc(100% - 32px); }
.confirm-dialog::backdrop { background: rgba(14, 22, 17, .48); backdrop-filter: blur(3px); }
.modal-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 28px 80px rgba(13, 26, 18, .25); display: grid; gap: 20px; padding: 28px; }
.modal-card .eyebrow { margin-bottom: 8px; }
.modal-card h2 { margin-bottom: 7px; }
.modal-card p { color: var(--muted); margin: 0; }
.modal-icon { align-items: center; background: var(--red-soft); border-radius: 50%; color: var(--red); display: flex; font-size: 19px; font-weight: 800; height: 46px; justify-content: center; width: 46px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

@media (max-width: 980px) {
    .page-shell, .site-footer { margin-inline: 28px; }
    .hero { gap: 44px; grid-template-columns: 1fr 390px; }
    .deck-grid { grid-template-columns: repeat(2, 1fr); }
    .editor-layout, .setup-layout { gap: 50px; }
    .settings-card { gap: 25px; grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .site-header { height: auto; min-height: 68px; padding: 14px 18px; }
    .brand > span:last-child { display: none; }
    .main-nav { gap: 14px; }
    .main-nav > a:not(.button) { font-size: 12px; }
    .authenticated-nav > a:nth-child(2) { display: none; }
    .nav-button { font-size: 12px; }
    .page-shell { margin-inline: 16px; min-height: calc(100vh - 145px); padding: 34px 0 60px; }
    .site-footer { align-items: flex-start; margin-inline: 18px; padding-bottom: 24px; }
    .footer-links { align-items: flex-end; flex-direction: column; gap: 7px; }
    .cookie-banner { align-items: stretch; bottom: 10px; flex-direction: column; gap: 16px; padding: 18px; }
    .cookie-banner-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .cookie-banner-actions .button { width: 100%; }
    .verification-banner { align-items: flex-start; font-size: 12px; justify-content: space-between; padding-inline: 17px; }
    h1 { font-size: 38px; }
    .landing-shell { padding-top: 32px; }
    .hero { display: flex; flex-direction: column; gap: 52px; min-height: auto; }
    .hero-copy { padding: 0; }
    .hero-lead { font-size: 17px; }
    .hero-actions { align-items: flex-start; flex-direction: column; gap: 19px; }
    .hero-demo { padding: 17px; transform: none; width: 100%; }
    .demo-card { min-height: 290px; padding: 32px 25px; }
    .demo-card strong { font-size: 25px; }
    .principles { gap: 30px; grid-template-columns: 1fr; margin-top: 64px; padding-top: 38px; }
    .principles article { border-bottom: 1px solid var(--line); padding-bottom: 20px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 23px; margin-bottom: 32px; }
    .page-heading h1 { font-size: 37px; }
    .primary-actions { width: 100%; }
    .primary-actions .button { flex: 1; }
    .deck-grid, .stats-overview, .stats-columns { grid-template-columns: 1fr; }
    .deck-card { min-height: 92px; }
    .resume-arrow { display: none; }
    .empty-state { padding: 52px 20px; }
    .auth-shell { align-items: start; flex-direction: column; padding-top: 20px; }
    .auth-shell > .flash-stack { margin: 0 0 20px; position: static; transform: none; width: 100%; }
    .auth-card, .editor-card, .setup-card, .section-card { border-radius: 20px; padding: 26px 21px; }
    .auth-intro h1 { font-size: 32px; }
    .editor-layout, .setup-layout { display: flex; flex-direction: column; gap: 30px; padding-top: 0; }
    .editor-copy h1, .setup-copy h1 { font-size: 38px; }
    .card-editor { border-radius: 20px; padding: 20px; }
    .card-editor textarea { font-size: 17px; }
    .editor-actions { align-items: stretch; flex-direction: column; width: 100%; }
    .editor-actions .button, .editor-actions form, .editor-actions form .button { width: 100%; }
    .list-card-content { gap: 15px; grid-template-columns: 1fr; }
    .list-card-content > div + div { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 14px; }
    .list-card-meta { flex-wrap: wrap; }
    .deck-tools-panel, .csv-import-form { grid-template-columns: 1fr; }
    .deck-tools-actions, .deck-tools-actions .button, .csv-import-form .button { width: 100%; }
    .practice-topbar > span { display: none; }
    .practice-card { height: 330px; }
    .session-options { grid-template-columns: 1fr; }
    .practice-face { padding: 34px 22px; }
    .practice-face h1, .practice-face h2 { font-size: 29px; }
    .answer-row { grid-template-columns: 1fr; }
    .answer-row .button { width: 100%; }
    .completion-card { padding: 38px 20px; }
    .summary-grid { gap: 20px 8px; grid-template-columns: 1fr 1fr; }
    .settings-card { padding: 24px 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .cookie-list > div { grid-template-columns: 1fr; }
    .consent-settings { align-items: stretch; flex-direction: column; }
    .consent-actions { align-items: stretch; flex-direction: column; }
    .consent-actions form, .consent-actions .button { width: 100%; }
}

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