:root {
    --ink: #1e2a3f;
    --muted: #6f7889;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --surface-soft: #edf4ff;
    --line: rgba(77, 108, 173, 0.14);
    --primary: #5b53e8;
    --primary-strong: #4b84f4;
    --accent: #e93f94;
    --success: #2fc86f;
    --success-strong: #22b55a;
    --warning: #ff8e32;
    --danger: #ff4f5c;
    --shadow-lg: 0 26px 60px rgba(67, 92, 144, 0.18);
    --shadow-md: 0 16px 34px rgba(67, 92, 144, 0.14);
    --shadow-button: 0 18px 38px rgba(46, 69, 111, 0.24);
    --radius-xl: 34px;
    --radius-lg: 26px;
    --radius-md: 18px;
    --transition: 180ms ease;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 12%, rgba(255, 230, 136, 0.2), transparent 20%),
        radial-gradient(circle at 88% 72%, rgba(255, 171, 208, 0.16), transparent 24%),
        linear-gradient(180deg, #fdfefe 0%, #eef5ff 100%);
}

body.modal-open,
body.session-active {
    overflow-x: hidden;
    overflow-y: auto;
}

body.textos-fullscreen,
body.session-active.textos-fullscreen {
    overflow: hidden;
}

body.textos-fullscreen .screen--session {
    background:
        radial-gradient(circle at 12% 10%, rgba(75, 132, 244, 0.1), transparent 24%),
        radial-gradient(circle at 88% 86%, rgba(255, 197, 91, 0.12), transparent 22%),
        linear-gradient(145deg, #f8fbff, #eef5ff);
}

button,
a {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

.hidden {
    display: none !important;
}

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

.app-shell {
    width: min(100%, 1260px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px;
    overflow-x: clip;
}

.screen {
    min-height: calc(100vh - 48px);
}

.screen--home,
.screen--selection {
    position: relative;
    display: grid;
    gap: 30px;
}

.screen-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.screen--session {
    position: relative;
    min-height: calc(100vh - 48px);
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 20px;
    padding-bottom: 28px;
}

.home-top-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.brand-link--button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.brand-link__logo {
    display: block;
    width: clamp(160px, 22vw, 240px);
    height: auto;
}

.ghost-button,
.primary-button,
.secondary-button,
.icon-button,
.year-card,
.selection-card,
.control-button,
.step-button {
    border: 0;
    cursor: pointer;
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background var(--transition),
        opacity var(--transition);
}

.ghost-button,
.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 18px;
    font-weight: 700;
    text-decoration: none;
}

.ghost-button {
    background: var(--surface-soft);
    color: var(--ink);
}

.ghost-button--pill {
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(78, 108, 173, 0.12);
}

.ghost-button--small {
    min-height: 40px;
    padding-inline: 14px;
}

.ghost-button--light {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    backdrop-filter: blur(10px);
}

.utility-button {
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 999px;
    font-size: 1.15rem;
    line-height: 1;
}

.utility-button--light {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 1rem;
}

.primary-button {
    background: linear-gradient(135deg, var(--primary-strong) 0%, var(--primary) 100%);
    color: #fff;
}

.secondary-button {
    background: linear-gradient(135deg, var(--warning) 0%, var(--accent) 100%);
    color: #fff;
}

.hero,
.mode-section,
.surface-card,
.modal__panel {
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.74);
    box-shadow: var(--shadow-lg);
    background: var(--surface);
    backdrop-filter: blur(14px);
}

.hero,
.mode-section,
.selection-panel,
.session-summary,
.step-panel,
.modal__panel {
    padding: 28px;
}

.hero {
    text-align: center;
    padding-block: 22px;
}

.brand {
    display: grid;
    justify-items: center;
    gap: 10px;
}

.brand__copy {
    display: grid;
    gap: 10px;
    max-width: 44rem;
}

.eyebrow {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4a73ea;
}

.brand__copy h1,
.selection-panel h2,
.session-summary h2,
.step-title,
.modal__header h2 {
    margin: 0;
    font-family: "Archivo", sans-serif;
    overflow-wrap: anywhere;
}

.brand__copy h1 {
    font-size: clamp(2.1rem, 4vw, 3.4rem);
    line-height: 1;
    background: linear-gradient(90deg, #487de6 0%, #5ac3ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__text,
.section-text,
.step-text,
.warning-box__list,
.modal__content p,
.bullet-list li {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.hero__text,
.section-text {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hero__text:empty,
.section-text:empty {
    display: none;
}

.section-heading {
    display: grid;
    gap: 8px;
    justify-items: center;
    text-align: center;
}

.section-heading h2 {
    margin: 0;
    font-family: "Archivo", sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    overflow-wrap: anywhere;
}

.section-text {
    max-width: 36rem;
}

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

.year-card {
    position: relative;
    min-height: 154px;
    padding: 18px 16px;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    color: #fff;
    text-align: center;
    overflow: hidden;
    justify-items: center;
    align-content: center;
    gap: 12px;
}

.year-card::after {
    content: "";
    position: absolute;
    inset: auto -22% -36% auto;
    width: 150px;
    height: 150px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.year-card--one {
    background: linear-gradient(135deg, #ffa6b7 0%, #f1c0f6 100%);
}

.year-card--two {
    background: linear-gradient(135deg, #9fe6eb 0%, #eac8de 100%);
}

.year-card--three {
    background: linear-gradient(135deg, #d7b4f4 0%, #abc5f1 100%);
}

.year-card--four {
    background: linear-gradient(135deg, #ff9b4f 0%, #ffd462 100%);
}

.year-card__icon,
.selection-card__icon {
    position: relative;
    z-index: 1;
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 1.5rem;
    box-shadow: 0 10px 22px rgba(18, 42, 92, 0.14);
}

.year-card strong,
.selection-card strong {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 0;
    font-family: "Archivo", sans-serif;
    font-size: 1.25rem;
    line-height: 1.1;
}

.credits-strip {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.98rem;
}

.credits-strip img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: var(--shadow-md);
}

.selection-panel {
    width: min(100%, 980px);
    margin: 0 auto;
    text-align: center;
}

.selection-panel h2 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.05;
}

.selection-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.selection-card-grid[data-mode="series"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 560px;
}

.selection-card-grid[data-mode="tests"] {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: min(100%, 620px);
    max-width: 620px;
    height: clamp(320px, 58vh, 520px);
    margin: 24px auto 0;
    padding: 120px 18px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    border-radius: 32px;
    border: 1px solid rgba(85, 112, 191, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(236, 244, 255, 0.96) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 22px 42px rgba(78, 108, 173, 0.12);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 15%, #000 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 15%, #000 85%, transparent 100%);
}

.selection-card-grid[data-mode="tests"]::-webkit-scrollbar {
    width: 10px;
}

.selection-card-grid[data-mode="tests"]::-webkit-scrollbar-track {
    background: rgba(137, 164, 223, 0.18);
    border-radius: 999px;
}

.selection-card-grid[data-mode="tests"]::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7ea2f6 0%, #5b53e8 100%);
    border-radius: 999px;
}

.selection-card-grid[data-mode="tests"] .selection-card--test {
    width: 100%;
    min-height: 104px;
    padding: 22px 24px;
    border-radius: 24px;
    scroll-snap-align: center;
    opacity: 0.42;
    transform: scale(0.9);
    filter: saturate(0.88);
    transition:
        transform 180ms ease,
        opacity 180ms ease,
        filter 180ms ease,
        box-shadow 180ms ease,
        border-color 180ms ease;
}

.selection-card-grid[data-mode="tests"] .selection-card--test:nth-child(odd) {
    background: linear-gradient(135deg, rgba(112, 150, 247, 0.94) 0%, rgba(95, 88, 234, 0.92) 100%);
}

.selection-card-grid[data-mode="tests"] .selection-card--test:nth-child(even) {
    background: linear-gradient(135deg, rgba(255, 159, 179, 0.92) 0%, rgba(255, 199, 126, 0.96) 100%);
}

.selection-card-grid[data-mode="tests"] .selection-card--test strong {
    font-size: clamp(1.12rem, 1.8vw, 1.45rem);
}

.selection-card-grid[data-mode="tests"] .selection-card--test.is-focus-target {
    opacity: 1;
    transform: scale(1);
    filter: saturate(1);
    border-color: rgba(255, 255, 255, 0.88);
    box-shadow:
        0 24px 42px rgba(74, 102, 167, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.selection-card {
    display: grid;
    gap: 8px;
    align-content: center;
    justify-items: center;
    min-height: 120px;
    padding: 18px 14px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(92, 83, 232, 0.96) 0%, rgba(76, 132, 244, 0.94) 100%);
    box-shadow: var(--shadow-md);
    color: #fff;
    text-align: center;
}

.selection-card--test {
    min-height: 132px;
    padding: 16px 14px;
    gap: 10px;
}

.selection-card--test strong {
    margin-top: 0;
    font-size: 1.05rem;
    line-height: 1.18;
}

.selection-card--test .selection-card__badge {
    background: rgba(255, 255, 255, 0.22);
}

.selection-card--series-b {
    background: linear-gradient(135deg, rgba(255, 155, 79, 0.96) 0%, rgba(233, 63, 148, 0.94) 100%);
}

.selection-card__badge {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.credits-strip--selection {
    margin-top: -8px;
}

.session-header {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 18px;
    align-items: start;
    padding: 20px 24px 24px;
    border-radius: var(--radius-xl);
    background: linear-gradient(90deg, var(--primary-strong) 0%, var(--primary) 100%);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.session-center {
    display: grid;
    justify-items: center;
    gap: 6px;
}

.session-tools {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.orientation-button {
    display: none;
}

.session-pill {
    margin: 0;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.session-heading {
    font-family: "Archivo", sans-serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    text-align: center;
    line-height: 1.04;
}

.session-caption {
    margin: 0;
    opacity: 0.92;
}

.icon-button {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 1.6rem;
}

.icon-button--light {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    backdrop-filter: blur(10px);
}

.session-summary,
.step-panel {
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
    min-height: 0;
}

.session-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.text-link-button {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
}

.questions-drawer {
    overflow: hidden;
}

.questions-drawer__summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: "Archivo", sans-serif;
    font-size: 1.35rem;
    cursor: pointer;
}

.questions-drawer__summary::-webkit-details-marker {
    display: none;
}

.questions-drawer__summary::after {
    content: "▾";
    font-size: 1rem;
    color: var(--primary);
    transition: transform var(--transition);
}

.questions-drawer[open] .questions-drawer__summary::after {
    transform: rotate(180deg);
}

.questions-drawer__content {
    display: grid;
    gap: 14px;
    margin-top: 12px;
}

.step-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.step-button {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    background: #d2d7e0;
    color: #445064;
    font-weight: 700;
}

.step-button.is-active {
    background: var(--primary);
    color: #fff;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.stat-card {
    padding: 18px;
    border-radius: 20px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.stat-card strong,
.stat-card span,
.stat-card small {
    display: block;
}

.stat-card strong {
    font-family: "Archivo", sans-serif;
    font-size: 2.7rem;
    line-height: 1;
    color: #2c65ea;
}

.stat-card--danger strong {
    color: #e5342a;
}

.stat-card span {
    margin-top: 6px;
    font-weight: 700;
}

.stat-card small {
    margin-top: 2px;
    color: var(--muted);
}

.step-panel {
    display: grid;
    gap: 18px;
}

.step-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.02;
}

.text-stage {
    padding: 24px;
    border-radius: 22px;
    background: #dce7f7;
}

.text-stage h4 {
    margin: 0 0 18px;
    font-family: "Archivo", sans-serif;
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    text-align: center;
}

.text-stage h4:empty {
    display: none;
}

.reading-text {
    font-size: clamp(1.12rem, 1.35vw, 1.5rem);
    line-height: 1.82;
    letter-spacing: 0.02em;
}

.reading-text.is-bold {
    font-weight: 700;
    letter-spacing: 0.01em;
}

#textTitle.is-bold {
    font-weight: 800;
}

.reading-text p {
    margin: 0 0 18px;
}

.reading-text p:last-child {
    margin-bottom: 0;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 18px;
}

.info-box {
    padding: 18px;
    border-radius: 20px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.info-box--questions {
    background: #edf9ef;
}

.info-box h4,
.warning-box h4 {
    margin: 0 0 10px;
    font-family: "Archivo", sans-serif;
    font-size: 1.22rem;
}

.criteria-list {
    display: grid;
    gap: 6px;
}

.criteria-list p {
    margin: 0;
    line-height: 1.55;
}

.question-list {
    display: grid;
    gap: 14px;
}

.question-item {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(115, 128, 153, 0.12);
}

.question-item h5 {
    margin: 0 0 8px;
    font-size: 1rem;
    line-height: 1.35;
}

.question-options {
    display: grid;
    gap: 10px;
}

.question-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background var(--transition);
}

.question-option:hover {
    background: rgba(76, 83, 239, 0.06);
}

.question-option input {
    margin: 0;
}

.question-check-button {
    width: 100%;
    min-height: 44px;
}

.results-box {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(76, 83, 239, 0.1);
}

.results-box__summary {
    font-family: "Archivo", sans-serif;
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.results-box__summary.is-perfect {
    color: var(--success-strong);
}

.results-box__summary.is-partial {
    color: #2c65ea;
}

.result-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    margin-top: 8px;
}

.result-line--ok {
    background: rgba(47, 200, 111, 0.1);
}

.result-line--error {
    background: rgba(255, 79, 92, 0.1);
}

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

.chip {
    display: grid;
    gap: 8px;
    align-items: center;
    justify-items: center;
    min-height: 92px;
    padding: 14px 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, #d9e8fc 0%, #c7d9f4 100%);
    border: 1px solid #86b1ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
    text-align: center;
    cursor: pointer;
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background var(--transition),
        border-color var(--transition);
}

.chip--pseudo {
    background: linear-gradient(180deg, #fff0b5 0%, #ffe68a 100%);
    border-color: #f0c952;
}

.chip__word {
    font-family: "Archivo", sans-serif;
    font-size: 1.05rem;
    line-height: 1.2;
}

.auto-panel {
    display: grid;
    gap: 18px;
    padding: 20px;
    border-radius: 20px;
    background: rgba(76, 83, 239, 0.04);
    border: 1px solid rgba(76, 83, 239, 0.08);
}

.auto-panel__top {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.auto-progress {
    display: grid;
    gap: 6px;
}

.auto-progress span {
    color: var(--muted);
}

.auto-progress strong {
    font-family: "Archivo", sans-serif;
    font-size: 1.35rem;
}

.auto-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip-grid--auto .chip {
    min-height: 104px;
}

.chip.is-current {
    background: linear-gradient(135deg, #4b84f4 0%, #5b53e8 100%);
    border-color: transparent;
    color: #fff;
    transform: scale(1.04);
}

.chip.is-current .chip__word {
    color: #fff;
}

.chip.is-read {
    background: linear-gradient(135deg, rgba(47, 200, 111, 0.18) 0%, rgba(160, 255, 188, 0.3) 100%);
    border-color: rgba(47, 200, 111, 0.42);
}

.chip.is-missed {
    background: linear-gradient(135deg, rgba(255, 79, 92, 0.24) 0%, rgba(255, 189, 198, 0.36) 100%);
    border-color: rgba(255, 79, 92, 0.36);
}

.chip.is-selected {
    background: linear-gradient(135deg, rgba(255, 199, 208, 0.92) 0%, rgba(255, 223, 228, 0.96) 100%);
    border-color: rgba(233, 63, 148, 0.18);
    color: #8a355e;
    transform: scale(1.02);
    box-shadow: 0 12px 22px rgba(233, 63, 148, 0.12);
}

.chip.is-selected .chip__word {
    color: #8a355e;
}

.warning-box {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 79, 92, 0.08);
    border: 1px solid rgba(255, 79, 92, 0.14);
}

.warning-box p {
    margin: 0 0 8px;
}

.warning-box__list {
    min-height: 20px;
    white-space: normal;
}

.control-dock {
    position: fixed;
    right: max(24px, env(safe-area-inset-right));
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#textStep {
    grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
    align-items: stretch;
}

#textStep .content-grid {
    grid-template-columns: 1fr;
    align-content: start;
}

#wordsStep .auto-panel,
#pseudoStep .auto-panel {
    max-width: none;
}

#wordsStep .chip-grid--auto,
#pseudoStep .chip-grid--auto {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-content: start;
}

.fullscreen-exit,
.fullscreen-timer,
.fullscreen-error {
    position: fixed;
    z-index: 18;
    box-shadow: var(--shadow-button);
}

.fullscreen-exit {
    left: max(24px, env(safe-area-inset-left));
    bottom: max(24px, env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink);
    font-size: 1.35rem;
    cursor: pointer;
}

.fullscreen-timer {
    top: max(20px, env(safe-area-inset-top));
    right: max(138px, calc(env(safe-area-inset-right) + 120px));
    left: auto;
    transform: none;
    min-width: 124px;
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    text-align: center;
}

.fullscreen-timer strong {
    display: block;
    font-family: "Archivo", sans-serif;
    font-size: 2.1rem;
    line-height: 1;
    color: #2c65ea;
}

.fullscreen-error {
    top: max(20px, env(safe-area-inset-top));
    right: max(24px, env(safe-area-inset-right));
    min-width: 96px;
    padding: 14px 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.95);
    text-align: center;
}

.fullscreen-error strong {
    display: block;
    font-family: "Archivo", sans-serif;
    font-size: 1.85rem;
    line-height: 1;
    color: #e5342a;
}

.fullscreen-error span {
    display: block;
    margin-top: 4px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
}

.control-button {
    width: 56px;
    min-width: 56px;
    min-height: 56px;
    padding: 0;
    border-radius: 18px;
    color: #fff;
    font-weight: 800;
    box-shadow: var(--shadow-button);
    font-size: 1.25rem;
}

.control-button[disabled] {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none !important;
}

.control-button--start {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-strong) 100%);
}

.control-button--stop {
    background: linear-gradient(135deg, var(--danger) 0%, #ef4444 100%);
}

.control-button--warn {
    background: linear-gradient(135deg, var(--warning) 0%, #ff6b1a 100%);
}

.control-button--reset {
    background: linear-gradient(135deg, #7a8598 0%, #5f6878 100%);
}

.auto-action-button {
    min-width: 52px;
    min-height: 52px;
    padding: 0;
    border-radius: 16px;
    font-size: 1.15rem;
}

.timer-warning {
    color: #dc2626 !important;
    animation: blink 1s infinite;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 30;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 33, 61, 0.28);
    backdrop-filter: blur(4px);
}

.modal__panel {
    position: relative;
    width: min(100% - 28px, 760px);
    margin: 7vh auto 0;
    background: var(--surface-strong);
}

.modal__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.modal__content {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.bullet-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

@keyframes blink {
    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0.3;
    }
}

@keyframes floatDecor {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulseDecor {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.35;
    }

    50% {
        transform: scale(1.12);
        opacity: 0.56;
    }
}

@media (hover: hover) {
    .ghost-button:hover,
    .year-card:hover,
    .selection-card:hover,
    .control-button:hover,
    .step-button:hover,
    .text-link-button:hover,
    .primary-button:hover,
    .secondary-button:hover {
        transform: translateY(-2px);
    }
}

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

    .selection-card-grid,
    .selection-card-grid[data-mode="series"],
    .selection-card-grid[data-mode="tests"],
    .chip-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .selection-card-grid[data-mode="tests"] {
        display: flex;
    }
}

@media (max-width: 900px) {
    .home-top-actions {
        position: static;
        justify-content: center;
        flex-wrap: wrap;
    }

    .session-header {
        grid-template-columns: 56px 1fr;
    }

    .session-tools {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-items: stretch;
    }

    .session-toolbar,
    .auto-panel__top,
    .content-grid {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: start;
    }

    .content-grid {
        display: grid;
    }

    #textStep {
        grid-template-columns: 1fr;
    }

    #wordsStep .chip-grid--auto,
    #pseudoStep .chip-grid--auto {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .control-dock {
        left: 16px;
        right: 16px;
        bottom: max(16px, env(safe-area-inset-bottom));
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .control-button {
        min-width: 140px;
    }

    .screen--session {
        padding-bottom: 120px;
    }
}

@media (max-width: 680px) {
    .app-shell {
        padding: 12px;
    }

    .screen {
        min-height: calc(100vh - 24px);
    }

    .hero,
    .mode-section,
    .selection-panel,
    .session-summary,
    .step-panel,
    .modal__panel {
        padding: 22px;
        border-radius: 28px;
    }

    .brand__copy h1 {
        font-size: 1.95rem;
        line-height: 1.05;
    }

    .brand__copy {
        max-width: 19rem;
        margin: 0 auto;
    }

    .hero__text {
        font-size: 0.98rem;
    }

    .year-grid,
    .selection-card-grid,
    .selection-card-grid[data-mode="series"],
    .chip-grid,
    .stats-row {
        grid-template-columns: 1fr;
    }

    .selection-card-grid[data-mode="tests"] {
        width: 100%;
        height: clamp(280px, 52vh, 460px);
        padding: 92px 12px;
        gap: 14px;
    }

    .selection-card-grid[data-mode="tests"] .selection-card--test {
        min-height: 92px;
        padding: 18px 18px;
    }

    .section-heading h2,
    .selection-panel h2 {
        font-size: 2rem;
        line-height: 1.08;
    }

    .session-header {
        gap: 12px;
        padding: 16px 16px 18px;
        border-radius: 28px;
    }

    .session-center {
        justify-items: start;
        text-align: left;
        gap: 4px;
    }

    .session-heading {
        font-size: clamp(1.7rem, 8vw, 2.3rem);
        text-align: left;
    }

    .session-caption,
    .session-pill {
        font-size: 0.8rem;
    }

    .session-tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .orientation-button {
        display: inline-flex;
    }

    .session-tools .ghost-button {
        width: 100%;
        min-height: 40px;
        padding-inline: 10px;
        font-size: 0.82rem;
    }

    .session-tools .utility-button {
        min-width: 40px;
        padding: 0;
        font-size: 0.95rem;
    }

    .year-card,
    .selection-card {
        min-height: 0;
    }

    .step-nav {
        display: grid;
        grid-template-columns: 1fr;
    }

    .step-button {
        justify-content: center;
    }

    .reading-text {
        font-size: 1.08rem;
        line-height: 1.72;
    }

    .stats-row {
        gap: 10px;
        margin-top: 14px;
    }

    .stat-card {
        padding: 14px;
        border-radius: 18px;
    }

    .stat-card strong {
        font-size: 2.2rem;
    }

    .session-summary {
        padding: 18px;
        gap: 14px;
    }

    .session-toolbar {
        gap: 10px;
    }

    .text-link-button {
        font-size: 0.95rem;
    }

    .control-dock {
        position: sticky;
        top: calc(env(safe-area-inset-top, 0px) + 10px);
        right: auto;
        left: auto;
        bottom: auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        max-width: 980px;
        margin: -4px auto 0;
        padding: 0;
        gap: 10px;
    }

    .control-button {
        min-width: 0;
        min-height: 52px;
        border-radius: 16px;
        font-size: 0.98rem;
    }

    .screen--session {
        gap: 14px;
        padding-bottom: 26px;
    }

    .step-panel {
        padding: 18px;
        gap: 14px;
    }

    .step-title {
        font-size: 1.42rem;
    }

    .text-stage {
        padding: 16px;
        border-radius: 20px;
    }

    .text-stage h4 {
        margin-bottom: 12px;
        font-size: 1.3rem;
    }

    .content-grid {
        gap: 12px;
    }

    .info-box {
        padding: 16px;
        border-radius: 18px;
    }

    .questions-drawer__summary,
    .info-box h4 {
        font-size: 1.12rem;
    }

    .question-item {
        padding: 12px;
    }

    .question-item h5 {
        font-size: 0.95rem;
    }

    .question-option {
        padding: 8px 10px;
    }

    .chip-grid {
        gap: 10px;
    }

    #wordsStep .chip-grid--auto,
    #pseudoStep .chip-grid--auto {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .chip {
        min-height: 76px;
        padding: 12px 10px;
    }

    .auto-panel {
        padding: 16px;
        gap: 14px;
    }

    .auto-panel__actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .auto-panel__actions .primary-button,
    .auto-panel__actions .secondary-button {
        width: 100%;
        min-height: 46px;
        padding-inline: 10px;
        font-size: 0.9rem;
    }
}

body.textos-fullscreen .session-header,
body.textos-fullscreen .session-toolbar,
body.textos-fullscreen .content-grid,
body.textos-fullscreen .text-link-button,
body.textos-fullscreen .auto-progress span,
body.textos-fullscreen .auto-progress strong,
body.textos-fullscreen .warning-box {
    display: none !important;
}

body.textos-fullscreen .session-summary {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    max-width: none;
}

body.textos-fullscreen .stats-row {
    display: none;
}

body.textos-fullscreen .step-panel,
body.textos-fullscreen .surface-card.step-panel {
    width: 100vw;
    inline-size: 100vw;
    max-width: none;
    max-inline-size: none;
    height: 100dvh;
    min-height: 0;
    margin: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: max(26px, env(safe-area-inset-top)) max(158px, calc(env(safe-area-inset-right) + 124px)) max(20px, env(safe-area-inset-bottom)) max(38px, env(safe-area-inset-left));
    display: grid;
    align-items: center;
    justify-items: start;
    overflow: hidden;
}

body.textos-fullscreen .text-stage {
    width: var(--stage-reading-width, min(calc(100vw - 320px), 1160px));
    inline-size: var(--stage-reading-width, min(calc(100vw - 320px), 1160px));
    max-width: none;
    max-inline-size: none;
    max-height: calc(100dvh - 54px);
    height: calc(100dvh - 54px);
    min-height: 0;
    padding: var(--stage-reading-pad-y, clamp(22px, 2vw, 30px)) var(--stage-reading-pad-x, clamp(42px, 4.8vw, 72px));
    background: #f7fbff;
    overflow: hidden;
    justify-self: start;
}

body.textos-fullscreen .text-stage[data-reading-preset="short"] {
    align-self: center;
}

body.textos-fullscreen .text-stage[data-reading-preset="story"] {
    align-self: center;
}

body.textos-fullscreen .text-stage[data-reading-preset="long"] {
    align-self: center;
}

body.textos-fullscreen .text-stage[data-reading-preset="dense"] {
    align-self: stretch;
}

body.textos-fullscreen .reading-text,
body.textos-fullscreen .reading-text.is-long {
    font-size: var(--reading-fit-size, clamp(1rem, 1.26vw, 1.55rem));
    line-height: var(--reading-fit-leading, 1.48);
    letter-spacing: 0.01em;
}

body.textos-fullscreen .reading-text.is-extra-long {
    font-size: var(--reading-fit-size, clamp(1rem, 1.26vw, 1.55rem));
    line-height: var(--reading-fit-leading, 1.48);
}

body.textos-fullscreen .reading-text p,
body.textos-fullscreen .reading-text.is-long p {
    margin-bottom: var(--reading-fit-gap, 0.45em);
}

body.textos-fullscreen .reading-text.is-extra-long p {
    margin-bottom: var(--reading-fit-gap, 0.45em);
}

body.textos-fullscreen .control-dock {
    right: max(24px, env(safe-area-inset-right));
    bottom: max(24px, env(safe-area-inset-bottom));
}

body.textos-fullscreen .questions-drawer,
body.textos-fullscreen .info-box {
    display: none !important;
}

body.textos-fullscreen #wordsStep,
body.textos-fullscreen #pseudoStep {
    min-height: calc(100vh - 148px);
    align-content: center;
}

body.textos-fullscreen .auto-panel {
    max-width: min(100%, 1080px);
    margin-inline: auto;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    width: 100%;
}

body.textos-fullscreen .auto-panel__top {
    justify-content: flex-end;
}

body.textos-fullscreen .auto-panel__actions {
    justify-content: flex-end;
}

body.textos-fullscreen #wordsStep .chip-grid,
body.textos-fullscreen #pseudoStep .chip-grid,
body.textos-fullscreen #wordsStep .chip-grid--auto,
body.textos-fullscreen #pseudoStep .chip-grid--auto {
    max-width: min(100%, 1080px);
    margin-inline: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

body.textos-fullscreen #wordsStep .chip,
body.textos-fullscreen #pseudoStep .chip {
    min-height: 118px;
    padding: 18px 14px;
}

body.textos-fullscreen #wordsStep .chip__word,
body.textos-fullscreen #pseudoStep .chip__word {
    font-size: 1.18rem;
    line-height: 1.26;
}
