.page-hero { padding: 20px 0; background: linear-gradient(to bottom, var(--bg-subtle), var(--bg)); border-bottom: 1px solid var(--line); }
.page-title { font-size: 26px; font-weight: 800; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }

.constructor-grid { display: grid; grid-template-columns: 2.3fr 1fr; gap: 24px; align-items: start; }

.c-table { width: 100%; border-collapse: collapse; text-align: center; }
.c-table th { background: var(--bg-subtle); color: var(--tx-muted); font-size: 12px; font-weight: 600; padding: 12px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.c-table td { padding: 8px; border-bottom: 1px solid var(--line-subtle); vertical-align: middle; }
.c-table tr:hover td { background: var(--line-subtle); }
.c-table tr:last-child td { border-bottom: none; }

.s-idx { width: 40px; color: var(--tx-dim); font-weight: 700; }
.s-time { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--tx-muted); white-space: nowrap; }
.s-tour { text-align: left; white-space: nowrap; }
.s-tour a { color: var(--tx-muted); text-decoration: none; }
.s-match { text-align: left; font-weight: 600; font-size: 14px; }
.s-match a { color: var(--tx); text-decoration: none; transition: color 0.15s; }
.s-match a:hover { color: var(--ac); }

.btn-toto {
    width: 100%; border-radius: 6px; border: 1px solid var(--line);
    background: var(--bg); color: var(--tx-dim); font-weight: 700; font-size: 14px;
    cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: all 0.15s; user-select: none; padding: 4px 0;
}
.btn-toto small { font-size: 10px; font-weight: 500; font-family: 'JetBrains Mono', monospace; opacity: 0.8; margin-top: 2px; }

.btn-toto.active[data-val="1"] { background: var(--grn); border-color: var(--grn); color: #fff; box-shadow: 0 4px 12px rgba(16,185,129,0.25); }
.btn-toto.active[data-val="X"] { background: var(--amb); border-color: var(--amb); color: #fff; box-shadow: 0 4px 12px rgba(245,158,11,0.25); }
.btn-toto.active[data-val="2"] { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 4px 12px rgba(239,68,68,0.25); }
.btn-toto.active small { color: #fff; opacity: 0.9; }

.ctrl-panel { background: var(--surf); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--sh-card); position: sticky; top: 80px; }
.ctrl-stat { font-size: 24px; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: var(--tx); line-height: 1.2; }

.stat-row { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line-subtle); margin-bottom: 16px; }

.filter-box { background: var(--bg-subtle); border: 1px solid var(--line-subtle); border-radius: 8px; padding: 14px; margin-bottom: 16px; position: relative; }
.filter-box h4 { font-size: 12px; text-transform: uppercase; color: var(--tx-muted); margin-bottom: 12px; font-weight: 700; }

.limits-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.limit-col { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.limit-col span { font-size: 11px; font-weight: 700; color: var(--tx-muted); text-transform: uppercase; }
.limit-inputs { display: flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px; width: 100%; }

.limit-inputs input { width: 100%; min-width: 0; background: transparent; border: none; color: var(--tx); font-size: 13px; text-align: center; font-family: 'JetBrains Mono', monospace; outline: none; padding: 4px 0; }
.limit-inputs input::-webkit-outer-spin-button, .limit-inputs input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.limit-inputs input[type=number] { -moz-appearance: textfield; }
.limit-sep { color: var(--tx-dim); font-size: 12px; }

.export-area { width: 100%; height: 120px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; color: var(--tx); padding: 10px; font-family: 'JetBrains Mono', monospace; font-size: 11px; resize: none; margin-top: 16px; outline: none; }
.export-area:focus { border-color: var(--ac); }

@media (max-width: 992px) {
    .constructor-grid { grid-template-columns: 1fr; }
    .ctrl-panel { position: static; }
}

@media (max-width: 768px) {
    .c-table, .c-table tbody, .c-table thead, .c-table tr, .c-table th, .c-table td { display: block; width: 100%; }
    .c-table thead { display: none; }
    .c-table tr { 
        display: grid !important; grid-template-columns: 1fr 1fr 1fr; 
        background: var(--surf); border: 1px solid var(--line); border-radius: 12px; 
        margin-bottom: 12px; padding: 12px; box-shadow: var(--sh-card); gap: 6px;
    }
    .c-table td { border: none; padding: 0; text-align: left; }
    
    .s-idx { grid-column: 1 / 2; grid-row: 1; display: flex; align-items: center; }
    .s-idx::before { content: "#"; margin-right: 2px; }

    .s-time { 
        grid-column: 3 / 4; 
        grid-row: 1; 
        display: flex; 
        justify-content: flex-end; 
        align-items: center;
        text-align: right !important;
        font-size: 11px;
        white-space: nowrap;
    }
    
    .s-tour { grid-column: 1 / 4; grid-row: 2; font-size: 11px; padding: 2px 0; }
    
    .s-match { 
        grid-column: 1 / 4; 
        grid-row: 3; 
        text-align: center; 
        font-size: 15px; 
        padding-bottom: 8px; 
        border-bottom: 1px solid var(--line-subtle); 
        margin-bottom: 4px;
    }

    .brif-level-row { flex-direction: column; align-items: stretch; gap: 8px; }
    .brif-level-row select { width: 100%; }    
    
    td[data-btn="1"] { grid-column: 1; grid-row: 4; }
    td[data-btn="X"] { grid-column: 2; grid-row: 4; }
    td[data-btn="2"] { grid-column: 3; grid-row: 4; }
}