:root {
    --primary-color: #dc2626;
    --primary-dark: #b91c1c;
    --secondary-color: #1e293b;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #dc2626;
    --gray-400: #9ca3af;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --surface-muted: #f1f5f9;
    --ring: rgba(220, 38, 38, 0.16);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.16);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --sticky-offset: 210px;
    --sticky-header-h: 132px;
    --thead-h: 52px;
    --sticky-thead-h: 48px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(220, 38, 38, 0.08), transparent 32rem),
        linear-gradient(180deg, #ffffff 0%, var(--light-bg) 34rem);
    color: var(--secondary-color);
    line-height: 1.5;
    font-size: 14px;
    min-width: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
select {
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
}

:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Compact Header */
.header {
    padding: 20px 0 15px;
    text-align: left;
    background: var(--card-bg);
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.header-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.header-text p {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.header-stats {
    background: #f1f5f9;
    padding: 10px 14px 12px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 6px; /* КЛЮЧ */
}

.stats-row {
    display: flex;
    gap: 20px;
    justify-content: space-between;
}


.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Version Selector - Compact */
.version-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    background: var(--card-bg);
    padding: 12px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.version-btn {
    flex: 1;
    padding: 12px 20px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}

.version-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.version-btn i {
    font-size: 14px;
}

/* Progress Bar - Compact */
.progress-section {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-percent {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-color);
}

.progress-bar {
    height: 12px;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
    border-radius: 6px;
    transition: width 0.3s ease;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--gray-600);
}

/* Checklist Container */
.checklist-container {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: visible;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.checklist-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.checklist-table th:first-child {
    border-top-left-radius: var(--radius-md);
}

.checklist-table th:last-child {
    border-top-right-radius: var(--radius-md);
}

.checklist-table tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-md);
}

.checklist-table tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-md);
}

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

.checklist-table thead {
    background: var(--secondary-color);
}

.checklist-table th {
    padding: 14px 12px;
    text-align: left;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 2px solid var(--border-color);
}

.checklist-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.checklist-table td > .item-description {
    display: none;
}

.phase-row {
    background: linear-gradient(90deg, #eff6ff, #dbeafe);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.phase-row td {
    padding: 14px 16px;
    border-bottom: 2px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--secondary-color);
    background: linear-gradient(90deg, #f8fafc 0%, #eff6ff 100%);
}

@media (min-width: 1201px) {
    .checklist-table th {
        position: sticky;
        top: var(--sticky-header-h);
        z-index: 50;
        background: var(--secondary-color);
    }

    .phase-row td {
        position: sticky;
        top: calc(var(--sticky-header-h) + var(--sticky-thead-h));
        z-index: 40;
        background: linear-gradient(90deg, #f8fafc 0%, #eff6ff 100%);
    }
}

.phase-row i {
    margin-right: 8px;
    opacity: 0.8;
}

/* Column widths */
.col-item { width: 22%; }
.col-desc { width: 20%; }
.col-tools { width: 12%; }
.col-risk { width: 18%; }
.col-comment { width: 28%; }

.item-title {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.item-description {
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.4;
}

.tools-list {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-style: italic;
    line-height: 1.4;
}

/* Risk Selector - Compact */
.risk-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.risk-select {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.risk-select:focus,
.risk-select:focus-visible {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.risk-select.green { 
    background: #f0fdf4; 
    color: #166534; 
    border-color: #bbf7d0;
}

.risk-select.yellow { 
    background: #fefce8; 
    color: #854d0e; 
    border-color: #fef08a;
}

.risk-select.red { 
    background: #fef2f2; 
    color: #991b1b; 
    border-color: #fecaca;
}

.score-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    min-width: 40px;
}

.score-input {
    width: 65px;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    background: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.score-input:focus,
.score-input:focus-visible {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.score-range {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 2px;
}

/* Comment Input - Wider */
.comment-container {
    position: relative;
    height: 100%;
}

.comment-input {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 120px;
    max-height: 200px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.comment-input:focus,
.comment-input:focus-visible {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.comment-count {
    position: absolute;
    bottom: 6px;
    right: 6px;
    font-size: 0.7rem;
    color: var(--gray-400);
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
}

/* Actions - Compact */
.actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.action-btn {
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    min-width: 180px;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.secondary-btn {
    background: var(--secondary-color);
    color: white;
}

.secondary-btn:hover {
    background: #0f172a;
    transform: translateY(-2px);
}

.export-btn {
    background: linear-gradient(135deg, var(--success), #0da271);
    color: white;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Report Section */
.report-section {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 30px;
    display: none;
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--primary-color);
}

.report-header {
    margin-bottom: 20px;
}

.report-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-header p {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.report-summary {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border-left: 4px solid var(--primary-color);
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.summary-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.summary-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.summary-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--gray-700);
    margin-bottom: 16px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.stat-box {
    background: white;
    padding: 12px;
    border-radius: var(--radius-sm);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-breakdown {
    margin-bottom: 24px;
}

.risk-breakdown h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.risk-list {
    list-style: none;
}

.risk-item {
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border-left: 4px solid;
    background: white;
    box-shadow: var(--shadow-sm);
}

.risk-item.green {
    border-left-color: var(--success);
    background: linear-gradient(90deg, #f0fdf4 0%, white 100%);
}

.risk-item.yellow {
    border-left-color: var(--warning);
    background: linear-gradient(90deg, #fefce8 0%, white 100%);
}

.risk-item.red {
    border-left-color: var(--danger);
    background: linear-gradient(90deg, #fef2f2 0%, white 100%);
}

.risk-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 10px;
}

.risk-title {
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
}

.risk-score {
    background: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

.risk-comment {
    color: var(--gray-700);
    font-size: 0.85rem;
    line-height: 1.5;
    padding-top: 8px;
    border-top: 1px dashed #f1f5f9;
}


.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;

    /* КЛЮЧ */
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

#order-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#order-form label {
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#order-form input {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

#order-form input:focus {
    outline: none;
    border-color: #dc2626;
}

.submit-btn {
    margin-top: 10px;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: white;
    font-weight: 700;
    cursor: pointer;
}



.pdf-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.pdf-option:hover {
    border-color: var(--primary-color);
    background: #fef2f2;
    transform: translateX(4px);
}

.pdf-option i {
    font-size: 1.5rem;
    color: var(--primary-color);
    min-width: 32px;
}

.pdf-option h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--secondary-color);
}

.pdf-option p {
    color: var(--gray-600);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    color: var(--gray-600);
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    font-size: 0.8rem;
}

.footer p:first-child {
    margin-bottom: 4px;
}

/* Responsive */
@media (max-width: 1200px) {
    .container {
        padding: 0 12px;
    }
    
    .checklist-container {
        overflow-x: auto;
    }
    
    .checklist-table {
        min-width: 1000px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
    }
    .header-cta {
        justify-content: center;
    }
    .stats-row {
        justify-content: space-around;
    }

    .stats-cta {
        flex-wrap: wrap;
    }
    .header-left {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        text-align: left;
        width: 100%;
    }

    .header-text h1 {
        font-size: 1.25rem;
    }

    .header-text p {
        font-size: 0.8rem;
    }
    
    .header-stats {
        width: 100%;
        justify-content: space-around;
    }
    
    .version-selector {
        flex-direction: column;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .col-item, .col-desc, .col-tools, .col-risk, .col-comment {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-box {
        min-width: 100%;
    }
    
    .risk-header {
        flex-direction: column;
        gap: 6px;
    }
    
    .risk-score {
        align-self: flex-start;
    }
}

/* Utility Classes */
.badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--border-color);
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-600);
}

.hidden {
    display: none !important;
}
.top-bar {
    background: #0f172a;
    padding: 6px 16px;
    font-size: 0.8rem;
}

.top-bar-links {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.top-bar a {
    color: #e5e7eb;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.top-bar a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.top-bar i {
    margin-right: 6px;
}
.brand-block {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 80px;
    width: auto;
    border-radius: 6px;
}
.header-text p {
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.3;
}

.header-subline {
    font-size: 0.75rem;
    color: var(--gray-400);
}
.pricing-cta {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.pricing-btn {
    border: none;
    border-radius: var(--radius-lg);
    padding: 20px 28px;
    min-width: 260px;
    cursor: pointer;
    text-align: left;
    font-weight: 700;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-btn .price {
    font-size: 1.4rem;
}

.pricing-btn .desc {
    font-size: 0.85rem;
    opacity: 0.9;
}

.pricing-btn.light {
    background: linear-gradient(135deg, #334155, #1e293b);
}

.pricing-btn.deep {
    background: linear-gradient(135deg, #dc2626, #7f1d1d);
}

.pricing-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.header-cta {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.header-cta-btn {
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header-cta-btn.light {
    color: var(--secondary-color);
}

.header-cta-btn.deep {
    color: var(--primary-color);
    border-color: rgba(220,38,38,0.4);
}

.header-cta-btn:hover {
    background: var(--light-bg);
    transform: translateY(-1px);
}

.stats-cta {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.stats-cta-btn {
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.stats-cta-btn.light {
    color: var(--secondary-color);
}

.stats-cta-btn.deep {
    color: var(--primary-color);
    border-color: rgba(220,38,38,0.4);
}

.stats-cta-btn:hover {
    background: var(--light-bg);
    transform: translateY(-1px);
}

/* Design and responsive polish */
.top-bar,
.header,
.version-selector,
.progress-section,
.checklist-container,
.report-section,
.pricing-btn,
.modal-content {
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.top-bar {
    border: none;
}

.header {
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.94);
}

.header-content {
    gap: 24px;
}

.header-text h1 {
    letter-spacing: 0;
}

.logo-img {
    object-fit: contain;
}

.header-stats,
.version-selector,
.progress-section {
    background: rgba(255, 255, 255, 0.92);
}

.stat-item {
    min-width: 76px;
}

.version-btn,
.action-btn,
.stats-cta-btn,
.pricing-btn,
.submit-btn,
.pdf-option {
    touch-action: manipulation;
}

.version-btn:hover {
    border-color: rgba(220, 38, 38, 0.35);
    background: #fff7f7;
}

.version-btn.active:hover {
    background: var(--primary-color);
}

.checklist-table tbody tr:not(.phase-row) {
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.checklist-table tbody tr:not(.phase-row):hover {
    background: #f8fafc;
}

.risk-select,
.score-input,
.comment-input,
#order-form input {
    min-height: 42px;
}

.risk-select,
.score-input,
.comment-input {
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.03);
}

.stats-cta-btn,
.header-cta-btn {
    min-height: 32px;
}

.modal {
    padding: 16px;
}

.modal-content {
    max-height: calc(100dvh - 32px);
    overflow: auto;
}

@media (max-width: 1024px) {
    :root {
        --sticky-header-h: 188px;
    }

    .header-content {
        align-items: stretch;
    }

    .header-stats {
        min-width: 320px;
    }

    .col-item { width: 24%; }
    .col-desc { width: 20%; }
    .col-tools { width: 14%; }
    .col-risk { width: 18%; }
    .col-comment { width: 24%; }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
        background: var(--light-bg);
    }

    .container {
        padding: 0 12px;
    }

    .top-bar {
        padding: 8px 12px;
    }

    .top-bar-links {
        justify-content: center;
        gap: 10px;
    }

    .top-bar a {
        font-size: 0.75rem;
        white-space: normal;
    }

    .header {
        position: static;
        padding: 14px 0;
        margin: 0 -12px 14px;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    .header-content {
        padding: 0 12px;
        gap: 14px;
    }

    .header-left {
        align-items: flex-start;
    }

    .logo-img {
        height: 52px;
    }

    .header-text h1 {
        font-size: 1.18rem;
        line-height: 1.15;
    }

    .header-text p {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .header-stats {
        min-width: 0;
        padding: 12px;
        gap: 10px;
    }

    .stats-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .stat-item {
        min-width: 0;
        background: #ffffff;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        padding: 8px 6px;
    }

    .stat-value {
        font-size: 1.05rem;
    }

    .stat-label {
        font-size: 0.62rem;
        line-height: 1.2;
    }

    .stats-cta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stats-cta-btn {
        width: 100%;
        border-radius: var(--radius-sm);
        padding: 8px 6px;
        white-space: normal;
        line-height: 1.2;
    }

    .version-selector,
    .progress-section,
    .report-section {
        margin-bottom: 14px;
        padding: 12px;
        border-radius: var(--radius-md);
    }

    .version-selector {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .version-btn {
        flex-direction: column;
        min-height: 68px;
        padding: 10px 8px;
        gap: 4px;
        line-height: 1.2;
    }

    .badge {
        font-size: 0.64rem;
        padding: 2px 6px;
    }

    .progress-header {
        align-items: flex-start;
        gap: 10px;
    }

    .progress-details {
        gap: 8px;
        flex-wrap: wrap;
    }

    .checklist-container {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow: visible;
        margin-bottom: 18px;
    }

    .checklist-table,
    .checklist-table tbody,
    .checklist-table tr,
    .checklist-table td {
        display: block;
        width: 100%;
    }

    .checklist-table {
        border-collapse: separate;
        table-layout: auto;
        overflow: visible;
    }

    .checklist-table thead {
        display: none;
    }

    .checklist-table tbody {
        display: grid;
        gap: 12px;
    }

    .checklist-table tr:not(.phase-row) {
        background: #ffffff;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
        overflow: hidden;
    }

    .checklist-table td {
        min-width: 0;
        padding: 12px 14px;
        border-bottom: 1px solid #eef2f7;
    }

    .checklist-table td.item-description {
        display: none !important;
    }

    .checklist-table tr:not(.phase-row) td:last-child {
        border-bottom: 0;
    }

    .checklist-table tr:not(.phase-row) td::before {
        display: block;
        margin-bottom: 6px;
        color: var(--gray-600);
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .checklist-table tr:not(.phase-row) td:nth-child(1)::before {
        content: "Item";
    }

    .checklist-table tr:not(.phase-row) td:nth-child(3)::before {
        content: "Tools";
    }

    .checklist-table tr:not(.phase-row) td:nth-child(4)::before {
        content: "Risk";
    }

    .checklist-table tr:not(.phase-row) td:nth-child(5)::before {
        content: "Notes";
    }

    .phase-row {
        position: static;
        display: block;
        border-radius: var(--radius-lg);
        background: #0f172a;
        color: #ffffff;
        box-shadow: var(--shadow-sm);
        overflow: hidden;
    }

    .phase-row td {
        border: 0;
        padding: 11px 14px;
        font-size: 0.84rem;
        position: static;
    }

    .item-title {
        font-size: 1rem;
        line-height: 1.3;
    }

    td > .item-description {
        display: block;
        font-size: 0.88rem;
    }

    .tools-list {
        font-size: 0.88rem;
    }

    .risk-selector {
        gap: 10px;
    }

    .risk-select,
    .score-input,
    .comment-input {
        width: 100%;
        font-size: 0.95rem;
    }

    .score-input-container {
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
    }

    .score-input {
        max-width: 110px;
    }

    .comment-input {
        min-height: 96px;
        max-height: none;
        resize: vertical;
    }

    .actions {
        position: sticky;
        bottom: 0;
        z-index: 80;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 18px -12px 22px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        background: rgba(248, 250, 252, 0.96);
        border-top: 1px solid var(--border-color);
        backdrop-filter: blur(12px);
    }

    .actions .primary-btn {
        grid-column: 1 / -1;
    }

    .action-btn {
        min-width: 0;
        width: 100%;
        min-height: 46px;
        padding: 12px 16px;
        border-radius: var(--radius-sm);
    }

    .report-section {
        padding: 16px;
    }

    .report-header h2 {
        font-size: 1.22rem;
        line-height: 1.25;
    }

    .report-summary {
        padding: 16px;
    }

    .summary-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .risk-item {
        padding: 14px;
    }

    .pricing-cta {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 28px 0;
    }

    .pricing-btn {
        min-width: 0;
        width: 100%;
        padding: 18px;
    }

    .modal {
        align-items: flex-end;
        padding: 10px;
    }

    .modal-content {
        max-width: none;
        width: 100%;
        max-height: calc(100dvh - 20px);
        border-radius: 14px 14px 10px 10px;
    }

    .modal-header,
    .modal-body {
        padding: 16px;
    }

    .pdf-option {
        align-items: flex-start;
        padding: 14px;
    }
}

@media (max-width: 420px) {
    .container {
        padding: 0 10px;
    }

    .header {
        margin-left: -10px;
        margin-right: -10px;
    }

    .header-content {
        padding: 0 10px;
    }

    .header-left {
        gap: 10px;
    }

    .logo-img {
        height: 44px;
    }

    .header-text h1 {
        font-size: 1.06rem;
    }

    .header-subline {
        display: inline-block;
        margin-top: 2px;
    }

    .stats-row,
    .summary-stats {
        grid-template-columns: 1fr;
    }

    .stat-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        gap: 10px;
    }

    .version-selector {
        grid-template-columns: 1fr;
    }

    .version-btn {
        min-height: 54px;
        flex-direction: row;
    }

    .progress-header {
        flex-direction: column;
        align-items: stretch;
    }

    .progress-percent {
        align-self: flex-start;
    }
}
