:root {
    --bg-start: #f8fbff;
    --bg-mid: #ecf3ff;
    --bg-end: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.98);
    --card-border: rgba(148, 163, 184, 0.25);
    --card-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
    --inner-card-bg: rgba(255, 255, 255, 0.9);
    --inner-card-border: rgba(148, 163, 184, 0.18);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, 0.15);
    --accent-surface: rgba(37, 99, 235, 0.08);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    background: radial-gradient(circle at 0% 0%, rgba(96, 165, 250, 0.08), transparent 45%),
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.1), transparent 40%),
    linear-gradient(140deg, var(--bg-start) 0%, var(--bg-mid) 40%, var(--bg-end) 100%);
    min-height: 100vh;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-strong);
}

a:hover {
    text-decoration: underline;
}

.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;
}

.muted {
    color: var(--text-secondary);
}

.hidden {
    display: none !important;
}

.error {
    color: #dc2626;
    font-weight: 600;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

.app-header__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-header__icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(59, 130, 246, 0.04));
    color: var(--accent);
    display: grid;
    place-items: center;
}

.app-header__icon svg {
    width: 26px;
    height: 26px;
}

.app-header__eyebrow {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-strong);
    margin: 0 0 4px;
}

.app-header__title {
    font-size: clamp(1.8rem, 2vw, 2.2rem);
    font-weight: 700;
    margin: 0;
}

.app-header__subtitle {
    margin: 4px 0 0;
    color: var(--text-secondary);
    max-width: 520px;
}

.calc-section {
    flex: 1;
    background: #fff;
    /*padding: clamp(32px, 8vw, 64px) 16px 72px;*/
}

.calc-container {
    max-width: 100%;
    margin: 0 auto;
}

.panel {
    position: relative;
    padding: 6px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    margin: 0;
}

.calc-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: clamp(640px, 70vh, 880px);
}

.calc-form {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-card {
    background: var(--inner-card-bg);
    border: 1px solid var(--inner-card-border);
    border-radius: var(--radius-md);
    padding: clamp(10px, 5vw, 10px);
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
    margin-bottom: 5px;
}

.form-card__header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.form-card__icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--accent-surface);
    color: var(--accent);
    display: grid;
    place-items: center;
}

.form-card__icon svg {
    width: 22px;
    height: 22px;
}

.form-card__subtitle {
    margin: 4px 0 0;
    color: var(--text-secondary);
}

.section-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.mode-options {
    display: grid;
    gap: 6px 12px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.mode-options button {
    margin-bottom: 5px;
}

.mode-tab {
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-primary);
    padding: 6px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    min-height: 80px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.mode-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.mode-tab.active {
    border-color: rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.04));
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.12);
    color: var(--accent-strong);
}

.mode-tab__title {
    font-size: 1rem;
    font-weight: 600;
}

.mode-tab__subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.score-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.score-grid {
    display: grid;
    gap: 12px;
    row-gap: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.80rem;
}

.form-field input,
.form-field select {
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 0 0 0 12px;
    font-size: .8rem;
    font-weight: 500;
    background: #fff;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    margin-bottom: 5px;
}

.form-field .ms-btn {
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 0 38px 0 14px;
    font-size: .8rem;
    font-weight: 500;
    background: #fff;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    margin-bottom: 5px;
}

.form-field details {
    margin-bottom: 5px;
    width: 100%;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.form-field input::placeholder {
    color: rgba(100, 116, 139, 0.8);
}

.form-field--wide {
    grid-column: 1 / -1;
    width: 100%;
}

.form-field--redacao {
    max-width: none;
    justify-self: stretch;
}

#fieldsetAcertos .form-field--redacao {
    grid-column: 1 / -1;
}

.inline-field {
    display: grid;
    align-items: stretch;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
}

.inline-field > input {
    grid-column: span 3;
    margin-bottom: 0;
    width: 100%;
}

.inline-field .checkbox-toggle {
    grid-column: span 1;
    margin-bottom: 0;
    width: 100%;
    justify-content: center;
}

.checkbox-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(37, 99, 235, 0.22);
    background: rgba(37, 99, 235, 0.06);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    min-height: 40px;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.checkbox-toggle:hover,
.checkbox-toggle:focus-within {
    background: rgba(37, 99, 235, 0.14);
    border-color: rgba(37, 99, 235, 0.48);
    color: var(--accent-strong);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.checkbox-toggle input[type="checkbox"] {
    appearance: none;
    position: relative;
    width: 18px;
    height: 18px;
    margin: 0;
    border-radius: 6px;
    border: 2px solid rgba(37, 99, 235, 0.5);
    background: #fff;
    box-sizing: border-box;
}

.checkbox-toggle input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.checkbox-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 3px;
    border: 2px solid transparent;
    border-top: 0;
    border-right: 0;
    transform-origin: center;
    transform: translate(-50%, -45%) rotate(-45deg) scale(0);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.checkbox-toggle input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-toggle input[type="checkbox"]:checked::after {
    border-color: #fff;
    transform: translate(-50%, -45%) rotate(-45deg) scale(1);
}

.checkbox-toggle__label {
    white-space: nowrap;
}

.filters-layout {
    display: grid;
    gap: 10px;
}

.filters-layout__panel {
    height: 100%;
}

@media (min-width: 880px) {
    .filters-layout {
        grid-template-columns: minmax(260px, 0.35fr) minmax(320px, 0.65fr);
        align-items: stretch;
    }
}

.filters-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: stretch;
}

.filters-grid--stretch {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-width: 50%;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.filters-grid--courses {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: center;
}

@media (min-width: 880px) {
    .filters-grid--courses {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.filters-grid .form-field {
    min-width: 0;
}

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon svg {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 100%;
    color: var(--text-secondary);
    /*transform: translateY(-50%);*/
}

.input-icon input {
    width: 100%;
    padding-left: 46px;
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    justify-content: center;
}

.form-actions button {
    margin-bottom: 5px;
}

#btnCalcular {
    min-width: 240px;
    padding: 16px 28px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: 0 18px 32px rgba(37, 99, 235, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-transform: none;
}

#btnCalcular:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 36px rgba(37, 99, 235, 0.35);
}

#btnCalcular:active {
    transform: translateY(0);
}

#btnCalcular:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#calcStatus {
    font-size: 0.95rem;
    min-height: 22px;
    padding-left: 4px;
}

.score-estimates {
    margin-top: 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    margin-bottom: 5px;
}

.score-estimates__title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.score-estimates__grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.score-estimates__item {
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.score-estimates__item--wide {
    grid-column: span 2;
}

.score-estimates__label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.score-estimates__value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-strong);
}

.score-estimates__range {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.score-estimates__hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.score-estimates__footnote {
    margin: 14px 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .score-estimates__item--wide {
        grid-column: span 1;
    }
}

.table-filters {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    align-items: end;
}

.table-filters .form-field {
    gap: 4px;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.table-filters .form-field input,
.table-filters .form-field select {
    height: 48px;
    padding: 10px 14px;
}

.table-filters .form-field .ms-btn {
    height: 48px;
    padding: 10px 38px 10px 14px;
}

.table-filters .form-field details,
.table-filters .form-field .ms-btn {
    width: 100%;
}

.table-filters__field {
    align-self: stretch;
    min-width: 100%;
}

.results {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--inner-card-bg);
    border: 1px solid var(--inner-card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.results thead th {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.05));
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.results th,
.results td {
    padding: 14px 16px;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    text-align: left;
}

.results tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, 0.08);
}

.results tbody tr:last-child td {
    border-bottom: none;
}

.results th.sortable {
    cursor: pointer;
}

.results th.sortable::after {
    content: " ⇅";
    color: rgba(71, 85, 105, 0.6);
    font-weight: 400;
}

.results th.sortable.asc::after {
    content: " ↑";
}

.results th.sortable.desc::after {
    content: " ↓";
}

.ok {
    color: #15803d;
    font-weight: 600;
}

.bad {
    color: #dc2626;
    font-weight: 600;
}

.delta-pos {
    color: #15803d;
    font-weight: 600;
}

.delta-neg {
    color: #dc2626;
    font-weight: 600;
}

.delta-zero {
    color: var(--text-secondary);
    font-weight: 600;
}

.ms {
    position: relative;
    width: 100%;
    display: block;
}

.ms summary {
    list-style: none;
    display: block;
}

.ms summary::-webkit-details-marker {
    display: none;
}

.ms-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #fff;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

.ms-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--text-secondary);
    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

.ms[open] .ms-btn::after {
    transform: translateY(-50%) rotate(180deg);
}

.ms-btn > [data-ms-label] {
    flex: 0 1 100%;
    min-width: 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms.has-value .ms-btn {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ms[open] .ms-menu {
    display: block;
}

.ms-menu {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 10;
    margin-top: 6px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    max-height: 240px;
    overflow: auto;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.14);
    display: none;
}

.ms-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    row-gap: 6px;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ms-menu label:hover {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.25);
}

.ms-menu input[type="checkbox"] {
    appearance: none;
    position: relative;
    width: 18px;
    height: 18px;
    margin: 0;
    border-radius: 6px;
    border: 2px solid rgba(37, 99, 235, 0.45);
    background: #fff;
    box-sizing: border-box;
    flex-shrink: 0;
}

.ms-menu input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.65);
    outline-offset: 2px;
}

.ms-menu input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 3px;
    border: 2px solid transparent;
    border-top: 0;
    border-right: 0;
    transform-origin: center;
    transform: translate(-50%, -45%) rotate(-45deg) scale(0);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.ms-menu input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.ms-menu input[type="checkbox"]:checked::after {
    border-color: #fff;
    transform: translate(-50%, -45%) rotate(-45deg) scale(1);
}

.ms-menu label:has(input:checked) {
    background: rgba(37, 99, 235, 0.12);
    color: var(--accent-strong);
    font-weight: 600;
    border-color: rgba(37, 99, 235, 0.35);
}

.ms-group {
    display: block;
    margin-bottom: 8px;
}

.ms-group-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 4px 4px 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ms-subrow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modalities .ms-group label {
    padding-left: 8px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(148, 163, 184, 0.6);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.results td:last-child {
    text-align: center;
}

.inspect {
    background: none;
    border: 0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
}

.insp {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: clamp(16px, 4vw, 36px);
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.insp.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.insp__dialog {
    width: min(520px, 92vw);
    max-height: min(85vh, 720px);
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s ease;
}

.insp.open .insp__dialog {
    transform: translateY(0) scale(1);
}

.insp__header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.insp__header h4 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.insp__close {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    background: none;
    border: 0;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.insp__close:hover,
.insp__close:focus-visible {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.08);
    outline: none;
}

.insp__body {
    padding: 16px 18px;
    overflow: auto;
    flex: 1 1 auto;
}

.insp table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.insp th,
.insp td {
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 8px 10px;
    font-size: 0.9rem;
}

.insp-range {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.insp-range__hint {
    display: block;
    margin-top: 2px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.insp tr:last-child td {
    border-bottom: none;
}

.insp .pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pill-ok {
    background: rgba(34, 197, 94, 0.18);
    color: #047857;
}

.pill-bad {
    background: rgba(248, 113, 113, 0.2);
    color: #b91c1c;
}

.insp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.32);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 50;
}

.insp-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.gate-overlay {
    position: absolute;
    inset: 0;
    display: none;
    place-items: start center;
    padding: clamp(24px, 6vw, 36px);
    background: linear-gradient(rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.96));
    backdrop-filter: blur(4px);
    z-index: 70;
}

.gate-overlay.open {
    display: grid;
}

.gate-dialog {
    width: min(960px, 96%);
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    padding: 24px 24px 28px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.grid-responsive {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.36);
}

.app-footer {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.82);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(12px);
}

.app-footer__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 24px 36px;
    text-align: center;
    color: var(--text-secondary);
}

.app-footer__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.app-footer__subtitle {
    margin: 8px auto 0;
    max-width: 540px;
}

@media (max-width: 900px) {
    .panel {
        padding: 6px 6px;
    }

    .form-card {
        padding: 6px;
    }
}

@media (max-width: 720px) {
    .app-header__inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .mode-options {
        grid-template-columns: 1fr;
    }

    .score-grid {
        grid-template-columns: 1fr;
    }

    .form-field--wide {
        grid-column: span 1;
    }

    .inline-field {
        grid-template-columns: 1fr;
    }

    .inline-field > input,
    .inline-field .checkbox-toggle {
        grid-column: 1 / -1;
    }

    #fieldsetAcertos .form-field--redacao {
        grid-column: span 1;
        grid-row: auto;
    }

    #btnCalcular {
        width: 100%;
    }

    .table-filters {
        grid-template-columns: 1fr;
    }
}

.info-line {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 80%;
}

.info-tip {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    font-size: .55rem;
    font-weight: 700;
    cursor: help;
    border: 1px solid rgba(37, 99, 235, 0.28);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.info-tip:hover {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(37, 99, 235, 0.45);
}

.info-pop {
    position: absolute;
    inset-inline-start: 0;
    top: 125%;
    min-width: 280px;
    max-width: 380px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, .4);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: .78rem;
    line-height: 1.35;
    color: #0f172a;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .14);
    z-index: 20;
    display: none;
}

.info-pop--right {
    inset-inline-start: auto;
    right: 0;
}

.info-line:hover .info-pop,
.info-tip:hover + .info-pop,
.checkbox-toggle:hover .info-pop,
.info-tip:focus + .info-pop {
    display: block;
}

h3 {margin-bottom: 0; font-size: .9rem;}
h2 {margin-bottom: 0; font-size: .9rem;}
p {margin: 0; font-size: .75rem;}

.form-field .ms {
    padding: 0;
}

.form-field .ms-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    padding: 0 38px 0 14px;
    line-height: 1;
}

.ms-btn > [data-ms-label] {
    display: block;
    line-height: 1;
}

.form-card--filters {
    padding-bottom: 6px;
}

.form-card--filters .form-field input,
.form-card--filters .form-field select,
.form-card--filters .form-field .ms-btn,
.form-card--filters .input-icon input {
    margin-bottom: 0;
}
