/* Pomodoro, countdown, notepad, math worksheets and flashcards (only loaded on those pages). */
.sp-chip { padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); color: var(--ink); font: 600 0.82rem var(--text); cursor: pointer; }
.sp-chip:hover { border-color: var(--signal); background: var(--signal-soft); }
.sp-chip:focus-visible, .pm-modes button:focus-visible, .np-list button:focus-visible, .fc-tabs button:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.sp-empty { padding: 26px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-panel); color: var(--slate); text-align: center; }
.cd-danger { color: var(--bad); }

/* Pomodoro */
.pm { --pm: var(--signal); --pm-soft: var(--signal-soft); text-align: center; }
.pm[data-mode="short"] { --pm: #0E9F6E; --pm-soft: #DEF7EC; }
.pm[data-mode="long"] { --pm: #3F6FD8; --pm-soft: #E1EAFD; }
.pm-modes { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--mist); }
.pm-modes button { padding: 8px 16px; border: 0; border-radius: 999px; background: none; color: var(--slate); font: 600 0.92rem var(--text); cursor: pointer; }
.pm-modes button[aria-selected="true"] { background: var(--pm); color: #fff; }
.pm-dial { position: relative; width: min(300px, 78vw); aspect-ratio: 1; margin: 22px auto 10px; }
.pm-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.pm-ring circle { fill: none; stroke-width: 10; }
.pm-track { stroke: var(--pm-soft); }
.pm-progress { stroke: var(--pm); stroke-linecap: round; transition: stroke-dashoffset 0.25s linear, stroke 0.3s; }
.pm-center { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; padding: 0 16%; }
.pm-time { font-family: var(--display); font-size: clamp(3rem, 15vw, 4.4rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; color: var(--ink); line-height: 1; }
.pm-label { color: var(--slate); font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pm-controls { display: flex; justify-content: center; align-items: center; gap: 14px; }
.pm-start { min-width: 160px; min-height: 52px; font-size: 1.1rem; background: var(--pm); border-color: var(--pm); }
.pm-start:hover { filter: brightness(0.95); background: var(--pm); border-color: var(--pm); }
.pm-small { width: 46px; height: 46px; padding: 0; border-radius: 50%; justify-content: center; }
.pm-count { margin: 12px 0 0; color: var(--slate); font-size: 0.9rem; }
.pm-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); text-align: left; align-items: start; }
.pm-add { display: flex; gap: 8px; }
.pm-add #pm-task { flex: 1; min-width: 0; }
.pm-add #pm-est { width: 70px; }
.pm-task-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.pm-task-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--paper); }
.pm-task-list li.is-current { border-color: var(--pm); box-shadow: inset 4px 0 0 var(--pm); }
.pm-task-list li.is-done .pm-task-text { color: var(--slate); text-decoration: line-through; }
.pm-task-list input { width: 18px; height: 18px; flex: none; }
.pm-task-text { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); font: 500 0.95rem var(--text); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.pm-task-count { flex: none; color: var(--slate); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.pm-x { flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--slate); font-size: 1.2rem; cursor: pointer; }
.pm-x:hover { background: var(--mist); color: var(--bad); }
.pm-settings { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-panel); }
.pm-settings summary { font-weight: 600; cursor: pointer; }
.pm-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.pm-settings-grid label { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 600; color: var(--slate); }
.pm-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pm-settings .checkbox { display: flex; margin: 6px 0; }
.pm-settings #pm-notify { margin-top: 8px; }

/* Countdown */
.cd-shared[hidden], .cd-full[hidden] { display: none; }
.cd-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 0.8fr) 90px auto; gap: 10px; align-items: end; }
.cd-form .field { margin: 0; }
.cd-add { min-height: 44px; }
.cd-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 18px; }
.cd-presets span { color: var(--slate); font-size: 0.88rem; font-weight: 600; }
.cd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.cd-card { padding: 18px; border-radius: var(--r-panel); background: linear-gradient(150deg, var(--ink), #24365C); color: #fff; box-shadow: var(--shadow-2); }
.cd-card.is-past { background: linear-gradient(150deg, #4B5568, #6B7488); }
.cd-card-head { display: flex; gap: 12px; align-items: center; }
.cd-card h3 { margin: 0; font-size: 1.1rem; color: #fff; overflow-wrap: anywhere; }
.cd-card-head p { margin: 2px 0 0; color: #B9C4D8; font-size: 0.85rem; }
.cd-emoji { font-size: 2rem; line-height: 1; }
.cd-numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0 4px; }
.cd-unit { display: grid; justify-items: center; padding: 10px 2px; border-radius: 10px; background: rgb(255 255 255 / 0.09); }
.cd-unit b { font-family: var(--display); font-size: clamp(1.5rem, 6vw, 2rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cd-unit small { color: #B9C4D8; font-size: 0.75rem; }
.cd-caption { margin: 4px 0 12px; color: #B9C4D8; font-size: 0.85rem; text-align: center; }
.cd-card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cd-card-actions .btn { background: rgb(255 255 255 / 0.1); border-color: rgb(255 255 255 / 0.25); color: #fff; }
.cd-card-actions .btn:hover { background: rgb(255 255 255 / 0.2); }
.cd-card-actions .cd-danger { color: #FFB4A8; }
.cd-shared-inner, .cd-full-inner { text-align: center; }
.cd-shared { margin-bottom: 20px; padding: 22px; border-radius: var(--r-panel); background: linear-gradient(150deg, var(--ink), #24365C); color: #fff; }
.cd-shared h2, .cd-full h2 { margin: 6px 0 0; color: #fff; }
.cd-shared p, .cd-full p { color: #B9C4D8; }
.cd-shared .cd-numbers { max-width: 520px; margin-inline: auto; }
.cd-full { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 30%, #2A3F6A, var(--ink) 70%); color: #fff; }
.cd-full-inner { width: min(1100px, 100%); }
.cd-full .cd-emoji { font-size: clamp(3rem, 9vw, 6rem); }
.cd-full h2 { font-size: clamp(1.6rem, 5vw, 3.4rem); }
.cd-full .cd-numbers { gap: clamp(8px, 2vw, 20px); margin: 4vh 0 2vh; }
.cd-full .cd-unit { padding: 2vh 4px; }
.cd-full .cd-unit b { font-size: clamp(2.4rem, 11vw, 8rem); }
.cd-full .cd-unit small { font-size: clamp(0.8rem, 1.8vw, 1.3rem); }
.cd-full .btn { margin-top: 2vh; background: rgb(255 255 255 / 0.1); border-color: rgb(255 255 255 / 0.3); color: #fff; }

/* Notepad */
.np-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; min-height: 520px; }
.np-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.np-side-top { display: grid; gap: 8px; }
.np-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; align-content: start; max-height: 560px; overflow-y: auto; }
.np-list button { display: grid; gap: 2px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--r-control); background: none; text-align: left; cursor: pointer; font-family: var(--text); }
.np-list button:hover { background: var(--mist); }
.np-list button.is-active { border-color: var(--line-strong); background: var(--signal-soft); }
.np-list strong { color: var(--ink); font-size: 0.92rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.np-list small { color: var(--slate); font-size: 0.76rem; }
.np-none { padding: 10px; color: var(--slate); font-size: 0.88rem; }
.np-main { display: flex; flex-direction: column; min-width: 0; }
.np-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.np-toolbar .btn[aria-pressed="true"] { border-color: var(--signal); background: var(--signal-soft); }
.np-size { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--slate); }
.np-size input { width: 90px; }
.np-find { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; padding: 8px; border-radius: var(--r-control); background: var(--mist); }
.np-find[hidden] { display: none; }
.np-find input[type="text"] { flex: 1 1 140px; min-width: 0; }
.np-find-count { color: var(--slate); font-size: 0.85rem; }
.np-text { flex: 1; min-height: 440px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: var(--r-panel); background: var(--paper); line-height: 1.65; resize: vertical; }
.np-text.is-mono { font-family: var(--mono); }
.np-status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-top: 6px; color: var(--slate); font-size: 0.82rem; }

@media (max-width: 760px) {
    .pm-grid, .np-layout { grid-template-columns: 1fr; }
    .np-list { max-height: 170px; }
    .np-text { min-height: 340px; }
    .cd-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .cd-form .cd-name, .cd-add { grid-column: 1 / -1; }
}

/* Math worksheet generator */
.mw-grid { display: grid; grid-template-columns: minmax(0, 350px) minmax(0, 1fr); gap: 22px; align-items: start; }
.mw-form .field { margin: 0 0 12px; }
.mw-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.mw-set { margin: 0 0 12px; padding: 0; border: 0; min-width: 0; }
.mw-set legend { margin-bottom: 6px; padding: 0; font-weight: 600; }
.mw-type { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-panel); background: var(--mist); }
.mw-type label { position: relative; flex: 1; padding: 8px 12px; border-radius: var(--r-control); color: var(--slate); font-weight: 600; text-align: center; cursor: pointer; }
.mw-type input { position: absolute; opacity: 0; pointer-events: none; }
.mw-type label:has(input:checked) { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }
.mw-type label:has(input:focus-visible) { outline: 3px solid var(--signal); outline-offset: 1px; }
.mw-ops { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mw-ops label { position: relative; }
.mw-ops input { position: absolute; opacity: 0; pointer-events: none; }
.mw-ops span { display: block; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--paper); font-weight: 600; cursor: pointer; }
.mw-ops input:checked + span { border-color: var(--signal); background: var(--signal-soft); box-shadow: inset 0 0 0 1px var(--signal); }
.mw-ops input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: 2px; }
.mw-range { display: grid; grid-template-columns: minmax(0, 1fr) 82px auto 82px; align-items: center; gap: 8px; margin-bottom: 8px; }
.mw-range > span:first-child { font-size: 0.9rem; font-weight: 600; }
.mw-range > span { color: var(--slate); }
.mw-hint { margin: 0 0 8px; color: var(--slate); font-size: 0.82rem; }
.mw-form .checkbox { display: flex; margin: 6px 0; }
.mw-table-chips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.mw-table-chips .sp-chip { padding: 8px 0; border-radius: var(--r-control); font-size: 0.95rem; }
.mw-table-chips .sp-chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.mw-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; margin-top: 12px; }
.mw-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mw-preview { display: flex; flex-direction: column; gap: 18px; max-height: 88vh; overflow-y: auto; padding: 18px; border-radius: var(--r-panel); background: var(--mist); }

.mw-sheet { --ink-p: #1A2233; position: relative; display: flex; flex-direction: column; width: 100%; flex: none; aspect-ratio: 210 / 297; padding: 7% 7% 4%; background: #fff; color: var(--ink-p); box-shadow: var(--shadow-2); container-type: inline-size; font-family: "Schibsted Grotesk", Arial, sans-serif; overflow: hidden; }
.mw-sheet-head { margin-bottom: 3cqw; padding-bottom: 2cqw; border-bottom: 0.3cqw solid var(--ink-p); }
.mw-sheet-head.is-cont { margin-bottom: 2cqw; padding-bottom: 1cqw; border-bottom-width: 0.15cqw; }
.mw-sheet-title { margin: 0; font-size: 4.2cqw; font-weight: 800; line-height: 1.2; }
.mw-sheet-head.is-cont .mw-sheet-title { font-size: 2.6cqw; }
.mw-sheet-title small { font-weight: 500; font-size: 0.7em; color: #5A6578; }
.mw-lines { display: grid; grid-template-columns: 1.6fr 1fr 0.9fr; gap: 3cqw; margin-top: 2.6cqw; font-size: 2.2cqw; }
.mw-lines span { display: flex; align-items: baseline; gap: 1cqw; white-space: nowrap; }
.mw-lines i { flex: 1; min-width: 4cqw; border-bottom: 0.15cqw solid var(--ink-p); }
.mw-problems { flex: 1; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); column-gap: 2.5cqw; font-size: min(3.6cqw, calc(9.6cqw / var(--cols))); font-variant-numeric: tabular-nums; }
.mw-sheet[data-layout="vertical"] .mw-problems { font-size: min(4.4cqw, calc(15cqw / var(--cols))); }
.mw-cell { display: flex; align-items: center; gap: 0.5em; min-width: 0; }
.mw-sheet[data-layout="vertical"] .mw-cell { align-items: flex-start; padding-top: 0.6em; }
.mw-num { flex: none; min-width: 1.9em; color: #6B7488; font-size: 0.58em; }
.mw-h { white-space: nowrap; }
.mw-blank { display: inline-block; width: 2.6em; height: 1em; border-bottom: 0.08em solid var(--ink-p); vertical-align: baseline; }
.mw-box { display: inline-block; min-width: 1.9em; height: 1.3em; padding: 0 0.15em; border: 0.07em solid var(--ink-p); border-radius: 0.15em; vertical-align: middle; text-align: center; line-height: 1.2; }
.mw-key { color: #C4352B; font-weight: 700; }
.mw-key.mw-box { border-style: dashed; border-color: #C4352B; }
.mw-v { display: inline-grid; grid-template-columns: auto auto; column-gap: 0.35em; justify-items: end; line-height: 1.25; }
.mw-v .mw-res { grid-column: 1 / -1; justify-self: stretch; min-width: 2.4em; min-height: 1.35em; border-top: 0.08em solid var(--ink-p); text-align: right; }
.mw-v .mw-box { height: 1.15em; }
.mw-op { justify-self: start; }
.mw-ld { display: inline-grid; grid-template-columns: auto auto; line-height: 1.3; }
.mw-ld-q { grid-column: 2; grid-row: 1; min-height: 1.3em; text-align: right; padding-right: 0.3em; }
.mw-ld-b { grid-column: 1; grid-row: 2; padding-right: 0.15em; }
.mw-ld-a { grid-column: 2; grid-row: 2; padding: 0 0.3em 0 0.45em; border-top: 0.08em solid var(--ink-p); border-left: 0.08em solid var(--ink-p); border-top-left-radius: 0.45em 1.2em; }
.mw-foot { margin: 2cqw 0 0; color: #8A93A6; font-size: 1.5cqw; text-align: right; }

/* Flashcards */
.fc-top { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; margin-bottom: 16px; }
.fc-deck-field { flex: 1 1 240px; margin: 0; }
.fc-deck-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-tabs { display: flex; gap: 2px; margin-bottom: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.fc-tabs button { flex: none; padding: 10px 16px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--slate); font: 600 0.95rem var(--text); cursor: pointer; margin-bottom: -1px; }
.fc-tabs button[aria-selected="true"] { border-bottom-color: var(--signal); color: var(--ink); }
.fc-panel[hidden] { display: none; }
.fc-edit-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr) 28px; gap: 8px; padding: 0 0 6px; color: var(--slate); font-size: 0.82rem; font-weight: 600; }
.fc-edit-head span:first-child { grid-column: 2; }
.fc-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 560px; overflow-y: auto; }
.fc-rows li { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr) 28px; gap: 8px; align-items: start; }
.fc-rows textarea { min-height: 42px; padding: 9px 11px; resize: none; overflow: hidden; line-height: 1.4; }
.fc-row-num { padding-top: 11px; color: var(--slate); font-size: 0.82rem; text-align: right; font-variant-numeric: tabular-nums; }
.fc-rows .pm-x { margin-top: 7px; }
.fc-edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.fc-bulk { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-panel); }
.fc-bulk summary { font-weight: 600; cursor: pointer; }
.fc-bulk textarea { margin: 6px 0 8px; }
.fc-stage { perspective: 1400px; }
.fc-card { position: relative; display: block; width: 100%; max-width: 560px; aspect-ratio: 5 / 3; margin: 0 auto; padding: 0; border: 0; background: none; cursor: pointer; transform-style: preserve-3d; transition: transform 0.45s cubic-bezier(.3, .7, .3, 1); font: inherit; color: var(--ink); }
.fc-card.is-flipped { transform: rotateY(180deg); }
.fc-card:focus-visible { outline: none; }
.fc-card:focus-visible .fc-face { outline: 3px solid var(--signal); outline-offset: 3px; }
.fc-face { position: absolute; inset: 0; display: grid; place-items: center; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow-2); backface-visibility: hidden; font-family: var(--display); font-size: clamp(1.2rem, 4vw, 2rem); font-weight: 700; line-height: 1.3; text-align: center; overflow-wrap: anywhere; overflow: auto; white-space: pre-wrap; }
.fc-back { transform: rotateY(180deg); background: linear-gradient(160deg, #FFF7F2, var(--paper)); font-family: var(--text); font-size: clamp(1rem, 3vw, 1.45rem); font-weight: 500; }
.fc-nav { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 18px; }
.fc-nav .pm-small { font-size: 1.6rem; line-height: 1; }
.fc-pos { min-width: 70px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.fc-options { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 18px; margin-top: 12px; }
.fc-options .checkbox { display: flex; }
.fc-options .mw-hint, .fc-center { margin: 0; text-align: center; }
.fc-center { margin-top: 14px; }
.fc-link { padding: 0; border: 0; background: none; color: var(--signal-ink, var(--signal)); font: inherit; text-decoration: underline; cursor: pointer; }
.fc-boxes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; max-width: 520px; margin: 0 auto 18px; }
.fc-box { display: grid; justify-items: center; gap: 2px; }
.fc-box-bar { display: flex; align-items: end; width: 100%; height: 44px; border-radius: 8px; background: var(--mist); overflow: hidden; }
.fc-box-bar i { display: block; width: 100%; min-height: 3px; background: var(--signal); transition: height 0.3s; }
.fc-box:nth-child(n+3) .fc-box-bar i { background: #F59E0B; }
.fc-box:nth-child(n+4) .fc-box-bar i { background: #0E9F6E; }
.fc-box b { font-variant-numeric: tabular-nums; }
.fc-box small { color: var(--slate); font-size: 0.72rem; text-align: center; }
.fc-learn-card { position: relative; display: grid; place-content: center; gap: 16px; max-width: 640px; min-height: 220px; margin: 0 auto; padding: 32px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow-2); text-align: center; overflow-wrap: anywhere; white-space: pre-wrap; }
.fc-learn-q { font-family: var(--display); font-size: clamp(1.2rem, 4vw, 1.9rem); font-weight: 700; }
.fc-learn-a { padding-top: 16px; border-top: 1px dashed var(--line-strong); font-size: 1.2rem; }
.fc-learn-box { position: absolute; top: 10px; right: 14px; color: var(--slate); font-size: 0.75rem; }
.fc-learn-actions { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }
.fc-learn-actions .btn { min-width: 150px; justify-content: center; }
.fc-miss { color: var(--bad); }
kbd { padding: 1px 6px; border: 1px solid currentColor; border-radius: 4px; font: 600 0.72em var(--mono); opacity: 0.7; }
.fc-quiz-setup { max-width: 640px; }
.fc-quiz-setup .mw-two { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
.fc-quiz-run { max-width: 680px; margin: 0 auto; }
.fc-quiz-progress { display: flex; justify-content: space-between; color: var(--slate); font-size: 0.88rem; font-weight: 600; }
.fc-quiz-bar { height: 6px; margin: 6px 0 18px; border-radius: 3px; background: var(--mist); overflow: hidden; }
.fc-quiz-bar i { display: block; height: 100%; background: var(--signal); }
.fc-quiz-q { margin-bottom: 16px; padding: 22px; border-radius: var(--r-panel); background: var(--mist); font-family: var(--display); font-size: clamp(1.15rem, 3.6vw, 1.6rem); font-weight: 700; text-align: center; overflow-wrap: anywhere; white-space: pre-wrap; }
.fc-choices { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.fc-choice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--paper); color: var(--ink); font: 500 1rem var(--text); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.fc-choice:hover:not(:disabled) { border-color: var(--signal); background: var(--signal-soft); }
.fc-choice:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.fc-choice:disabled { cursor: default; opacity: 0.75; }
.fc-choice.is-right { border-color: #0E9F6E; background: #DEF7EC; opacity: 1; }
.fc-choice.is-wrong { border-color: var(--bad); background: var(--bad-soft); opacity: 1; }
.fc-typed { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-typed input { flex: 1 1 220px; font-size: 1.05rem; }
.fc-feedback { margin-top: 14px; }
.fc-feedback p { margin: 0 0 10px; font-weight: 600; }
.fc-ok { color: #0B7A55; }
.fc-bad { color: var(--bad); }
.fc-result { padding: 22px; border-radius: var(--r-panel); background: var(--ink); color: #fff; text-align: center; }
.fc-result b { font-family: var(--display); font-size: 3rem; }
.fc-result p { margin: 4px 0 0; color: #C9D2E3; }
.fc-review { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fc-review li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-control); overflow-wrap: anywhere; }
.fc-review small { color: var(--slate); }

.fc-print-page { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, 1fr); width: 210mm; height: 296mm; padding: 10mm; gap: 0; break-after: page; }
.fc-print-page:last-child { break-after: auto; }
.fc-print-card { display: grid; place-items: center; padding: 6mm; border: 0.3mm dashed #999; font: 600 14pt/1.35 Arial, sans-serif; text-align: center; overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; }
.fc-print-page.is-back .fc-print-card { font-weight: 400; font-size: 12pt; }

.mw-print-root { display: none; }
@media print {
    @page { size: A4; margin: 0; }
    body.mw-printing > :not(.mw-print-root) { display: none !important; }
    body.mw-printing { background: #fff; }
    body.mw-printing .mw-print-root { display: block; }
    .mw-print-root .mw-sheet { width: 210mm; height: 296mm; aspect-ratio: auto; box-shadow: none; break-after: page; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .mw-print-root .mw-sheet:last-child { break-after: auto; }
}

@media (max-width: 860px) {
    .mw-grid { grid-template-columns: 1fr; }
    .fc-quiz-setup .mw-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .mw-preview { max-height: none; padding: 10px; }
}
@media (max-width: 560px) {
    .fc-rows li { grid-template-columns: minmax(0, 1fr) 28px; }
    .fc-rows li textarea[data-side="back"] { grid-column: 1; }
    .fc-rows li .pm-x { grid-column: 2; grid-row: 1; }
    .fc-row-num, .fc-edit-head { display: none; }
    .fc-rows li { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
    .fc-choices { grid-template-columns: 1fr; }
    .fc-learn-actions .btn { min-width: 0; flex: 1; }
    .mw-range { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .mw-range > span:first-child { grid-column: 1 / -1; }
    .mw-range > span:not(:first-child) { display: none; }
}
