.agrotest-page {
    --agrotest-surface: rgba(255, 255, 255, 0.9);
    --agrotest-surface-strong: #ffffff;
    --agrotest-line: rgba(23, 41, 26, 0.1);
    --agrotest-shadow: 0 18px 42px rgba(24, 52, 26, 0.1);
    --agrotest-muted: #526854;
}

.agrotest-page,
.agrotest-page * {
    box-sizing: border-box;
}

.agrotest-page-hero {
    padding-bottom: 4.5rem;
}

.agrotest-shell {
    display: grid;
    gap: 1.5rem;
}

.agrotest-hero,
.agrotest-quiz-header,
.agrotest-result-hero,
.agrotest-review-block {
    background: var(--agrotest-surface);
    border: 1px solid var(--line, #d8e3c8);
    border-radius: 28px;
    box-shadow: var(--agrotest-shadow);
}

.agrotest-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 1.4rem;
    padding: 2rem;
    align-items: start;
}

.agrotest-hero-copy h1,
.agrotest-quiz-header h1,
.agrotest-result-hero h1 {
    margin-bottom: 0.85rem;
}

.agrotest-summary-card {
    padding: 1.35rem;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(223, 240, 211, 0.85));
    border: 1px solid rgba(35, 134, 59, 0.12);
}

.agrotest-stats-grid,
.agrotest-modes,
.agrotest-tables-grid {
    display: grid;
    gap: 1rem;
}

.agrotest-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}

.agrotest-stat-box {
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--agrotest-line);
}

.agrotest-stat-box strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1.7rem;
    line-height: 1;
}

.agrotest-stat-box span {
    color: var(--agrotest-muted);
}

.agrotest-modes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.agrotest-mode-card,
.agrotest-question-card,
.agrotest-review-card,
.agrotest-table-card {
    background: var(--agrotest-surface);
    border: 1px solid var(--agrotest-line);
    border-radius: 24px;
    box-shadow: var(--agrotest-shadow);
}

.agrotest-mode-card,
.agrotest-table-card,
.agrotest-question-card {
    padding: 1.4rem;
}

.agrotest-mode-card {
    display: grid;
    align-content: start;
}

.agrotest-field-label {
    display: block;
    margin-bottom: 0.55rem;
    font-weight: 700;
}

.agrotest-text-field {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--agrotest-line);
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink, #17291a);
    font: inherit;
}

.agrotest-mode-top,
.agrotest-question-meta,
.agrotest-result-meta,
.agrotest-submit-row,
.agrotest-section-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.agrotest-submit-row {
    justify-content: center;
}

.agrotest-submit,
.agrotest-primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.1rem;
    min-height: 50px;
    padding: 0.85rem 1.2rem;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #1f7f36, #3ea13a 54%, #5bb13b);
    color: #fff;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, filter 200ms ease, box-shadow 200ms ease;
    box-shadow: 0 12px 24px rgba(35, 134, 59, 0.22);
}

.agrotest-submit:hover,
.agrotest-primary-link:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.agrotest-score-card,
.agrotest-review-block,
.agrotest-quiz-header,
.agrotest-result-hero {
    padding: 1.6rem;
}

.agrotest-back-link {
    color: var(--primary-strong, #176a2f);
    font-weight: 800;
    text-decoration: none;
}

.agrotest-quiz-form {
    display: grid;
    gap: 1rem;
}

.agrotest-question-meta {
    margin-bottom: 0.7rem;
    color: var(--agrotest-muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.agrotest-options-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.agrotest-option-item {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: var(--agrotest-surface-strong);
    border: 1px solid var(--agrotest-line);
}

.agrotest-option-item input {
    width: 18px;
    height: 18px;
    margin: 0.18rem 0 0;
}

.agrotest-option-item span {
    display: block;
    line-height: 1.55;
}

.agrotest-result-label {
    margin-bottom: 0.55rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-strong, #176a2f);
}

.agrotest-result-meta {
    margin-top: 1rem;
    color: var(--agrotest-muted);
}

.agrotest-results-table-wrap {
    overflow-x: auto;
}

.agrotest-results-table {
    width: 100%;
    border-collapse: collapse;
}

.agrotest-results-table th,
.agrotest-results-table td {
    padding: 0.9rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--agrotest-line);
}

.agrotest-results-table th {
    color: var(--primary-strong, #176a2f);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.agrotest-result-tables {
    margin-bottom: 0;
}

.agrotest-result-board {
    padding: 1.4rem;
}

.agrotest-mode-board {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--agrotest-line);
}

.agrotest-mode-board-list {
    display: grid;
    gap: 0.55rem;
}

.agrotest-mode-board-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.72rem 0.85rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--agrotest-line);
}

.agrotest-mode-board-name {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.agrotest-mode-board-name span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agrotest-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(231, 169, 58, 0.16);
    color: #8a6110;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.agrotest-rank-badge-top-1 {
    background: linear-gradient(135deg, #fff4b8, #f2c84b);
    color: #7a5600;
}

.agrotest-rank-badge-top-2 {
    background: linear-gradient(135deg, #f5f8fb, #cfd8e3);
    color: #506173;
}

.agrotest-rank-badge-top-3 {
    background: linear-gradient(135deg, #f7dcc7, #d39a72);
    color: #7c4921;
}

.agrotest-rank-badge-top-4 {
    background: linear-gradient(135deg, #dcf8df, #91d78e);
    color: #1f6d27;
}

.agrotest-rank-badge-top-5 {
    background: linear-gradient(135deg, #dceeff, #8cc0ff);
    color: #1d5ea8;
}

.agrotest-rank-badge-muted {
    background: rgba(82, 104, 84, 0.1);
    color: var(--agrotest-muted);
}

.agrotest-empty-note {
    margin: 0;
    color: var(--agrotest-muted);
}

.agrotest-review-card {
    padding: 1.15rem;
    margin-top: 1rem;
}

.agrotest-review-card.ok {
    background: #e7f4e6;
}

.agrotest-review-card.bad {
    background: #fae7e3;
}

@media (max-width: 1100px) {
    .agrotest-modes,
    .agrotest-tables-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .agrotest-hero,
    .agrotest-stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .agrotest-page-hero {
        padding-top: 2.6rem;
        padding-bottom: 3rem;
    }

    .agrotest-shell {
        gap: 1rem;
    }

    .agrotest-hero,
    .agrotest-quiz-header,
    .agrotest-result-hero,
    .agrotest-review-block,
    .agrotest-mode-card,
    .agrotest-table-card,
    .agrotest-question-card {
        padding: 1rem;
        border-radius: 20px;
    }

    .agrotest-mode-board-row {
        align-items: flex-start;
    }
}
