.qto-sheet {
    background: var(--cm-panel);
    color: var(--cm-ivory);
    border-radius: var(--cm-radius-panel);
    padding: 16px;
    margin: 12px 0 20px;
}

.qto-sheet h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    color: var(--cm-ivory);
}

.qto-remind {
    margin: 8px 0;
    padding: 10px 12px;
    background: var(--cm-night);
    color: var(--cm-ivory);
    border-left: 3px solid var(--cm-accent);
    border-radius: 8px;
    line-height: 1.45;
}

.qto-label {
    color: var(--cm-accent);
    font-size: 0.82rem;
}

.qto-muted {
    color: var(--cm-muted);
    font-size: 0.85rem;
}

.qto-money {
    color: var(--money);
    font-variant-numeric: tabular-nums;
}

.qto-status {
    min-height: 1.2em;
    margin: 4px 0;
    color: var(--cm-accent);
}

.qto-toolbar,
.qto-rates,
.qto-ml,
.qto-settle {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin: 12px 0;
}

.qto-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 1 9rem;
    min-width: 0;
}

#qtoBoqSheet input,
#qtoBoqSheet select {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    font-size: 0.95rem;
}

#qtoBoqSheet .qto-check input {
    width: 22px;
    height: 22px;
    min-height: 0;
}

.qto-factor {
    font-style: normal;
    color: var(--cm-muted);
}

.qto-param-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.qto-param-card {
    background: var(--cm-night);
    border-radius: var(--cm-radius-panel);
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.qto-param-card__title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: var(--cm-ivory);
}

.qto-param-card .qto-field {
    flex: 1 1 auto;
    width: 100%;
}

.qto-rates--rebar {
    margin-top: 0;
}

.qto-table .qto-toolbar {
    margin: 0;
    gap: 6px;
}

.qto-table .qto-field {
    flex: 0 1 6.75rem;
}

.qto-table td:nth-child(2) {
    min-width: 5rem;
}

.qto-table td:nth-child(3) {
    min-width: 22rem;
}

.qto-table td:nth-child(9) {
    min-width: 23rem;
}

.qto-table td:first-child .qto-field {
    flex-basis: 5.5rem;
    width: 5.5rem;
}

.qto-field span {
    color: var(--cm-accent);
    font-size: 0.78rem;
}

.qto-sheet input,
.qto-sheet select,
.qto-sheet .qto-input {
    background: #2A2A2E;
    color: var(--cm-ivory);
    border: 1px solid transparent;
    border-radius: 8px;
    min-height: var(--cm-tap-min);
    padding: 8px 10px;
    font: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.qto-sheet input:focus,
.qto-sheet select:focus,
.qto-sheet .qto-input:focus {
    border-color: #0A84FF;
    box-shadow: 0 0 0 1px #0A84FF;
}

.qto-sheet button {
    min-height: var(--cm-tap-min);
    border-radius: var(--cm-radius-panel);
    border: 1px solid var(--cm-accent);
    background: var(--cm-night);
    color: var(--cm-accent);
    padding: 8px 12px;
    font: inherit;
}

.qto-sheet button.qto-primary {
    background: var(--cm-accent);
    color: var(--cm-night);
}

.qto-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: var(--cm-tap-min);
    color: var(--cm-ivory);
}

.qto-scroll {
    overflow-x: auto;
    margin-top: 8px;
}

.qto-table {
    width: 100%;
    min-width: 960px;
    border-collapse: collapse;
}

.qto-table th,
.qto-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

.qto-table th {
    color: #E2E2E6;
    font-weight: 600;
}

.qto-table tbody tr.qto-row:nth-child(odd) {
    background: rgba(0, 0, 0, 0.22);
}

.qto-table tbody tr.qto-row:nth-child(even) {
    background: rgba(0, 0, 0, 0.12);
}

.qto-row--selected,
.qto-table tbody tr.qto-row--selected {
    background: rgba(10, 132, 255, 0.08) !important;
    box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.35);
}

.qto-card--selected {
    box-shadow: 0 0 0 1px rgba(10, 132, 255, 0.45), inset 0 0 0 999px rgba(10, 132, 255, 0.08);
}

.qto-table th:first-child,
.qto-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: inherit;
}

.qto-table thead th:first-child {
    background: var(--cm-panel);
}

.qto-cards {
    display: none;
}

.qto-card {
    background: var(--cm-night);
    border-radius: var(--cm-radius-panel);
    padding: 12px;
    margin: 10px 0;
}

.qto-card__title {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.qto-nums {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.qto-nums div {
    background: var(--cm-panel);
    border-radius: 8px;
    padding: 8px;
}

.qto-totals {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.qto-totals div {
    background: var(--cm-night);
    border-radius: 8px;
    padding: 10px;
}

.qto-ml-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.qto-ml-card {
    background: var(--cm-night);
    border-radius: var(--cm-radius-panel);
    padding: 10px;
}

.qto-sample {
    width: 100%;
    color: var(--cm-muted);
    font-size: 0.85rem;
}

.qto-warn {
    color: var(--cm-accent);
}

.qto-case-learn {
    margin: 12px 0 0;
    padding: 12px;
    background: var(--cm-night);
    border-radius: 10px;
}

.qto-case-learn__list {
    margin: 8px 0;
    padding-left: 1.2em;
    line-height: 1.45;
}

.qto-case-learn__source {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 10px 0 0;
}

.qto-source-picker {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    max-height: 220px;
    overflow: auto;
}

.qto-source-picker__item {
    text-align: left;
    min-height: 40px;
}

@media (min-width: 993px) {
    body[data-work-mode="calc"][data-calc-page="2"] .blueprint-workspace-row > #qtoBoqSheet {
        grid-column: 1 / -1;
        grid-row: 3;
        align-self: start;
        min-width: 0;
        margin: 10px 0 0;
    }
}

@media (max-width: 860px) {
    .qto-scroll {
        display: none;
    }

    .qto-cards {
        display: block;
    }

    .qto-totals,
    .qto-ml-grid,
    .qto-nums,
    .qto-param-cards {
        grid-template-columns: 1fr;
    }
}
