/* Stroytel Разкрой v0.7.1 */
.stroytel-cutting-shell {
    --sc-orange: #e17c30;
    --sc-bg: #f6f6f7;
    --sc-card: #fff;
    --sc-text: #333;
    --sc-muted: #74747c;
    --sc-line: #dedee2;
    --sc-soft: #f0f0f2;
    --sc-danger: #e50000;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--sc-text);
}

.stroytel-cutting-shell * {
    box-sizing: border-box;
}

.stroytel-cutting-app {
    width: 100%;
    max-width: 1640px;
    margin: 0 auto;
}

.sc-loading {
    padding: 40px 0;
    color: var(--sc-muted);
}

.sc-page-head,
.sc-editor-head,
.sc-section-head,
.sc-title-row,
.sc-card-head,
.sc-sheet-head,
.sc-result-toolbar,
.sc-result-material-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sc-editor-head {
    gap: 0px;
}

.sc-result-material-head {
    padding-bottom: 15px;
}

.sc-page-head {
    margin-bottom: 20px;
    margin-top: 20px;
}

.sc-page-head h1,
.sc-section-head h2,
.page .sc-result-material h2 {
    margin: 0 0 5px;
    padding-bottom: 0px;
}

.sc-page-head p,
.sc-section-head p,
.sc-result-material-head p {
    margin: 0;
    color: var(--sc-muted);
    font-size: 15px;
    line-height: 120%;
    padding-bottom: 2px;
}

.sc-section-head p {
    padding-bottom: 5px;
}

.sc-btn,
.sc-icon-btn,
.sc-back,
.sc-tabs button,
.sc-result-tabs button {
    border: 1px solid var(--sc-line);
    background: #fff;
    color: var(--sc-text);
    border-radius: 999px;
    min-height: 44px;
    padding: 0 25px;
    font: inherit;
    font-weight: inherit;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    transition: .18s ease;
    font-size: 15px;
    font-weight: 700;
    text-wrap: nowrap;
    display: flex;
    align-content: center;
    align-items: center;
    justify-content: center;
}

.sc-btn:hover,
.sc-icon-btn:hover,
.sc-back:hover,
.sc-tabs button:hover,
.sc-result-tabs button:hover {
    color: var(--sc-orange);
}

.sc-icon-btn svg path {
    fill: #7a8489;
}

.sc-icon-btn:hover svg path {
    fill: #fff !important;
}

.sc-icon-btn:hover {
    background: #7a8489;
    border-color: #7a8489;
}

.sc-icon-btn.sc-danger:hover svg path {
    fill: #fff !important;

}

.sc-icon-btn.sc-danger:hover {
    background: var(--sc-danger) !important;
    border: var(--sc-danger) 1px solid;

}

.sc-back:hover {
    color: inherit;
}

.btn-editor-undo, .btn-editor-redo {
    font-size: 24px;
    padding: 0 !important;
    aspect-ratio: 1/1;
    display: flex;
    align-content: center;
    align-items: flex-start !important;
    justify-content: center;
}

.sc-btn.add-row-bottom {
    margin-right: 10px;
}

.sc-workspace .sc-btn {
    padding: 0 30px 0 20px;
    background: transparent !important;
    border: #e17c30 2px solid !important;
    color: #e17c30 !important;
    height: 44px;
    box-sizing: border-box;
    display: flex;
    align-content: center;
    align-items: center;
    gap: 5px;
}

.sc-workspace .sc-next-row .sc-btn.sc-btn-primary {
    padding-right: 25px;
    padding-left: 25px;
}

.sc-workspace .sc-btn.sc-cut-order-toggle {
    padding-left: 28px;
    padding-right: 28px;
}

.sc-workspace .sc-btn:hover {
    background: #c96825 !important;
    border-color: #c96825 !important;
    color: #fff !important;
}

.sc-workspace .sc-btn svg path {
    fill: #e17c30;
}

.sc-workspace .sc-btn:hover svg path {
    fill: #fff;
}

.sc-tabs button:hover {
    color: var(--sc-orange);
}

.sc-btn:disabled,
.sc-icon-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    border-color: #999 !important;
    color: #999 !important;
}

.sc-btn:disabled:hover,
.sc-icon-btn:disabled:hover {
    background: #999 !important;
    border-color: #999 !important;

}

.sc-btn.is-busy:disabled,
.sc-icon-btn.is-busy:disabled {
    cursor: wait;
}

.sc-btn-primary {
    background: var(--sc-orange);
    border-color: var(--sc-orange);
    color: #fff;
}

.sc-btn-primary:hover {
    background: #b46529;
    border-color: #b46529;
    color: #fff;
}

.sc-icon-btn {
    width: 38px;
    min-height: 38px;
    padding: 0;
    display: flex;
    align-content: center;
    align-items: center;
    justify-content: center;
}

.sc-danger {
    color: var(--sc-danger);
}

.sc-back {
    border: 0;
    padding-left: 0;
    background: transparent;
    border-radius: 0;
    opacity: .5;
    padding-top: 15px;
    padding-bottom: 15px;
    font-size: 14px;
}

.sc-editor-head {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 15px;
}

.sc-title-row {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    background: #c5cccf;
    box-shadow: none;
    border-radius: 999px;
    padding: 15px;
}

.sc-title-row .sc-btn {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.15);
    font-weight: 500;
}

.sc-title-row .sc-btn:hover {
    color: #333;
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.18);
}

.sc-title-row .sc-btn.sc-btn-primary, .sc-next-row .sc-btn.sc-btn-primary {
    background: var(--sc-orange) !important;
    border-color: var(--sc-orange) !important;
    font-weight: 700;
    padding: 0 35px 0 25px;
    display: flex;
    align-items: center;
    align-content: center;
    gap: 5px;
    color: #fff !important;
}

.sc-title-row .sc-btn.sc-btn-primary:hover, .sc-next-row .sc-btn.sc-btn-primary:hover {
    background: #c96825 !important;
    border-color: #c96825 !important;
    color: #fff !important;

}

.sc-title-row .sc-btn.sc-btn-primary svg path, .sc-next-row .sc-btn.sc-btn-primary svg path {
    fill: #fff;
}

.sc-project-title {
    flex: 1 1 360px;
    min-width: 240px;
    font-size: 18px !important;
    font-weight: 700;
    border: 0;
    border: none;
    padding: 8px 18px;
    background: #fff;
    border-radius: 999px;
    height: 44px;
    box-sizing: border-box;

}

.sc-project-title:focus, .sc-project-title:hover {
    outline: rgba(0, 0, 0, 0.3);

}

.sc-file-btn {
    position: relative;
    overflow: hidden;
}

.sc-file-btn input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.sc-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--sc-line);
    padding-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    padding-left: 0px;
}

.sc-tabs button.active,
.sc-result-tabs button.active {
    background: #fff;
    color: #e17c30;
    font-weight: 700;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.sc-tabs button span {
    opacity: .72;
    margin-left: 5px;
}

.sc-card {
    background: var(--sc-card);
    box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.13);
    border-radius: 9px;
    padding: 23px;
    margin: 12px 0;
}

.sc-card.sc-material-card {
    margin-top: 0;
}

.sc-card-head h2 {
    margin: 0;
    font-size: 18px;
}

.sc-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.sc-span-2 {
    grid-column: span 2;
}

.sc-span-4 {
    grid-column: 1 / -1;
}

.sc-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sc-field>span {
    font-size: 13px;
    font-weight: 600;
}

.sc-field small {
    color: var(--sc-muted);
    line-height: 1.3;
    font-size: 12px;
}

.sc-field input,
.sc-field select,
.sc-part-row input,
.sc-part-row select {
    width: 100%;
    min-height: 43px;
    border: 1px solid var(--sc-line);
    border-radius: 7px;
    background: #fff;
    padding: 9px 11px;
    font: inherit;
}

.sc-field input:focus,
.sc-field select:focus,
.sc-part-row input:focus,
.sc-part-row select:focus {
    outline: 2px solid rgba(225, 124, 48, .18);
    border-color: var(--sc-orange);
}

.sc-section-label {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding-top: 15px;
    border-top: 1px solid var(--sc-soft);
    margin-top: 4px;
}

.sc-cut-direction {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.sc-direction-option {
    box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.13);
    border-radius: 10px;
    padding: 13px;
    display: grid;
    grid-template-columns: auto 54px 1fr;
    gap: 12px;
    align-items: center;
    cursor: pointer;
}

.sc-direction-option:has(input:checked) {
    border-color: var(--sc-orange);
    box-shadow: 0 0 0 2px rgba(225, 124, 48, .10);
}

.sc-direction-option strong,
.sc-direction-option small {
    display: block;
}

.sc-direction-option small {
    color: var(--sc-muted);
    margin-top: 3px;
    font-size: 14px;
}

.sc-direction-diagram {
    width: 54px;
    height: 34px;
    border: 1px solid #777;
    position: relative;
    display: block;
    background: #fafafa;
}

.sc-direction-diagram i {
    position: absolute;
    background: #aaa;
    display: block;
}

.sc-direction-diagram.is-length i:first-child {
    left: 0;
    right: 0;
    height: 1px;
    top: 11px;
}

.sc-direction-diagram.is-length i:last-child {
    left: 0;
    right: 0;
    height: 1px;
    top: 22px;
}

.sc-direction-diagram.is-width i:first-child {
    top: 0;
    bottom: 0;
    width: 1px;
    left: 18px;
}

.sc-direction-diagram.is-width i:last-child {
    top: 0;
    bottom: 0;
    width: 1px;
    left: 36px;
}

.sc-direction-diagram.is-auto:before,
.sc-direction-diagram.is-auto:after {
    content: "";
    position: absolute;
    background: #aaa;
}

.sc-direction-diagram.is-auto:before {
    left: 0;
    right: 0;
    height: 1px;
    top: 16px;
}

.sc-direction-diagram.is-auto:after {
    top: 0;
    bottom: 0;
    width: 1px;
    left: 27px;
}

.sc-parts-table {
    width: 100%;
    overflow-x: auto;
    padding-top: 18px;
    background: var(--sc-card);
    box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.13);
    border-radius: 9px;
    padding: 18px;

}

.sc-section-head {
    padding-bottom: 20px;
    padding-left: 5px;
}

.sc-part-head,
.sc-part-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.8fr) minmax(160px, 1.4fr) minmax(105px, .8fr) minmax(105px, .8fr) 76px 100px 42px 42px;
    gap: 8px;
    min-width: 980px;
    align-items: center;
}

.sc-part-head {
    color: var(--sc-muted);
    font-size: 12px;
    font-weight: 700;
    padding: 0 4px 8px;
}

.sc-part-row {
    padding: 8px 4px;
    border-top: 1px solid var(--sc-soft);
}

.sc-check {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
}

.sc-check input {
    width: auto;
    min-height: 0;
}

.sc-parts-summary {
    margin-top: 14px;
    color: var(--sc-muted);
    font-size: 13px;
}

.sc-next-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 22px;
}

.sc-empty {
    border: 1px dashed #cfcfd4;
    border-radius: 9px;
    padding: 42px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    color: var(--sc-muted);
}

.sc-empty strong {
    color: var(--sc-text);
    font-size: 18px;
}

.sc-empty span {
    font-size: 14px;
}

.sc-empty .sc-btn {
    margin-top: 10px;
}

.sc-project-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.sc-project-list .sc-project-row {
    box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.13);
    border-radius: 9px;
    background: #fff;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

.sc-project-list .sc-project-row:hover {
    box-shadow: 0px 1px 13px rgba(0, 0, 0, 0.23);
}

.sc-project-list .sc-project-row .sc-project-main:hover strong {
    text-decoration: underline;
}

.sc-project-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px auto;
    gap: 16px;
    align-items: center;
    padding: 23px;

}

.sc-project-row:first-child {
    border-top: 0;
}

.sc-project-main {
    text-align: left;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    color: inherit;
}

.sc-project-main strong, .sc-project-main span {
    display: block;
    font-size: 22px
}

.sc-project-main span, .sc-project-meta {
    color: var(--sc-muted);
    font-size: 14px;
    margin-top: 5px;
}

.sc-row-actions {
    display: flex;
    gap: 6px;
}

.sc-result-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.sc-metric {
    box-shadow: none;
    border-radius: 9px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.6);
}

.sc-metric strong, .sc-metric span {
    display: block;
}

.sc-metric strong {
    font-size: 22px;
}

.sc-metric span {
    font-size: 12px;
    color: var(--sc-muted);
    margin-top: 3px;
}

.sc-result-toolbar {
    margin: 18px 0;
}

.sc-result-tabs {
    display: flex;
    gap: 7px;
}

.sc-result-material {
    margin: 30px 0 46px;
}

.sc-sheet-card {
    box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.13);
    border-radius: 9px;
    background: #fff;
    padding: 16px;
    margin-top: 16px;
}

.sc-sheet-head {
    padding: 23px 23px 0px 23px;
}

.sc-sheet-head span {
    color: var(--sc-muted);
    font-size: 13px;
}

.sc-sheet-title-group {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.sc-sheet-direction-btn {
    flex: 0 0 auto;
    font-size: 19px;
    line-height: 1;
}

.sc-svg-wrap {
    width: 100%;
    overflow: auto;
    background: #fff;
    border-radius: 0;
    padding: 18px;
}

.sc-sheet-svg {
    width: 100%;
    min-width: 680px;
    display: block;
    max-height: 72vh;
}

.sc-svg-sheet {
    fill: #fff;
    stroke: #2d2d31;
    stroke-width: 4;
    vector-effect: non-scaling-stroke;
}

.sc-svg-usable {
    fill: none;
    stroke: #aaa;
    stroke-width: 1.5;
    stroke-dasharray: 10 8;
    vector-effect: non-scaling-stroke;
}

.sc-svg-part rect {
    fill: #f5d982;
    stroke: #333;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.sc-svg-part text {
    fill: #1f1f22;
    font-weight: 700;
    pointer-events: none;
}

.sc-svg-part .sc-svg-dims {
    font-weight: 500;
    opacity: .75;
}

.sc-svg-offcut rect {
    stroke: #c9b7b7;
    stroke-width: 1.2;
    vector-effect: non-scaling-stroke;
}

.sc-svg-offcut text {
    fill: #a84a4a;
    pointer-events: none;
}

.sc-svg-offcut.is-reusable text {
    fill: #6b6b71;
}

.sc-hatch-line {
    stroke: #e0bebe;
    stroke-width: 9;
}

.sc-svg-primary-cut {
    stroke: var(--sc-orange);
    stroke-width: 2.5;
    stroke-dasharray: 12 10;
    vector-effect: non-scaling-stroke;
    opacity: .9;
}

.sc-result-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sc-cut-order-toggle.is-active {
    border-color: var(--sc-orange);
    color: var(--sc-orange);
    box-shadow: 0 0 0 2px rgba(225, 124, 48, .10);
}

.sc-svg-cut-step {
    pointer-events: none;
}

.sc-svg-cut-step line {
    vector-effect: non-scaling-stroke;
    fill: none;
}

.sc-svg-cut-step.is-primary line {
    stroke: var(--sc-orange);
    stroke-width: 3;
}

.sc-svg-cut-step.is-secondary line {
    stroke: #4d4d53;
    stroke-width: 2;
    stroke-dasharray: 9 7;
}

.sc-svg-cut-step circle {
    fill: #fff;
    stroke-width: 2.5;
    vector-effect: non-scaling-stroke;
}

.sc-svg-cut-step.is-primary circle {
    stroke: var(--sc-orange);
}

.sc-svg-cut-step.is-secondary circle {
    stroke: #4d4d53;
}

.sc-svg-cut-step text {
    fill: #252529;
    font-weight: 800;
    pointer-events: none;
}

.sc-cut-list li.is-primary strong {
    color: var(--sc-orange);
}

.sc-offcut-chips {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    padding: 0px 18px 18px 18px;
    margin-bottom: 18px;
}

.sc-offcut-chips span {
    background: #f4f4f5;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    color: var(--sc-muted);
}

.sc-cut-list {
    margin: 0;
    padding: 15px 23px 23px 23px;
    font-size: 16px;
}

.sc-cut-list li {
    padding: 8px 0;
    border-top: 1px solid var(--sc-soft);
}



.cutting-notice {
    z-index: 100000;
}

/* Semantic hooks: intentionally inherit the existing Stroytel/WP notification design.
   They are separate classes so the background/border can be overridden per type. */
.cutting-notice-success {
    position: fixed;
    top: 0;
    height: 60px;
    text-align: center;
    width: 100%;
    background: #389778;
    color: #fff;
    padding: 20px 0;
    box-sizing: border-box;
    font-size: 16px;
}

.cutting-notice-warning {
    position: fixed;
    top: 0;
    height: 60px;
    text-align: center;
    width: 100%;
    background: #ffc107;
    color: #333;
    padding: 20px 0;
    box-sizing: border-box;
    font-size: 16px;
}

.cutting-notice-error {
    position: fixed;
    top: 0;
    height: 60px;
    text-align: center;
    width: 100%;
    background: #dc3545;
    color: #fff;
    padding: 20px 0;
    box-sizing: border-box;
    font-size: 16px;
}

.cutting-notice-info {
    position: fixed;
    top: 0;
    height: 60px;
    text-align: center;
    width: 100%;
    background: #17a2b8;
}

.sc-mobile-actions {
    display: none;
}

@media (max-width: 1000px) {
    .sc-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sc-span-4 {
        grid-column: 1 / -1;
    }

    .sc-cut-direction {
        grid-template-columns: 1fr;
    }

    .sc-result-summary {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

@media (max-width: 860px) {

    .sc-channel-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)) 40px;
        gap: 8px;
        align-items: end;
        padding: 10px 0;
    }

    .sc-channel-row>.sc-channel-number {
        display: none;
    }

    .sc-channel-row>label {
        grid-column: auto;
        grid-row: auto;
        min-width: 0;
        margin: 0;
    }

    .sc-channel-row>label input,
    .sc-channel-row>label select {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .sc-channel-row>button[data-action="delete-channel"] {
        grid-column: 3;
        grid-row: 1 / span 4;
        align-self: center;
        justify-self: center;
        margin: 0;
    }

    .sc-result-toolbar-actions {
        gap: 18px;
        padding-top: 10px;
    }

    #stroytel-cutting-app .sc-channel-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
        gap: 8px;
    }

    .sc-title-row .sc-btn.sc-btn-primary {
        display: none;
    }

    .sc-project-list .sc-project-row {
        border-radius: 0;
    }

    .page-template-page-cutting .scroll-to-top {
        display: none;
    }

    .sc-project-list {
        margin: 0 -18px;
        border-radius: 0;
    }

    .sc-next-row .sc-btn.sc-btn-primary.sc-btn-large {
        display: none;
    }

    .sc-card,
    .sc-parts-table,
    .sc-sheet-card {
        margin-left: -18px !important;
        margin-right: -18px !important;
        padding: 18px !important;
        border-radius: 0;
    }

    .sc-parts-table {
        width: auto;
    }

    .sc-next-row {
        flex-direction: column;
        gap: 15px;
        padding-bottom: 10px;
    }

    .sc-channels-card .sc-card-head {
        flex-direction: column;
    }

    .sc-sheet-card .sc-svg-wrap {
        padding-left: 0;
        padding-right: 0;
    }

    .stroytel-cutting-app {
        padding-bottom: 72px;
    }

    .sc-page-head, .sc-section-head, .sc-result-toolbar {
        align-items: flex-start;
    }

    .sc-page-head, .sc-section-head, .sc-result-toolbar {
        flex-direction: column;
    }

    .sc-result-tabs {
        width: 100%;
        gap: 0;
    }

    .sc-result-tabs>button {
        flex: 0 0 50%;
        width: 50%;
        min-width: 0;
        box-sizing: border-box;
    }

    .sc-form-grid {
        grid-template-columns: 1fr;
    }

    .sc-span-2, .sc-span-4 {
        grid-column: 1;
    }

    .sc-btn-primary,
    .sc-workspace .sc-btn {
        width: 100%;
    }

    .sc-workspace .sc-btn.btn-editor-undo,
    .sc-workspace .sc-btn.btn-editor-redo {
        width: 47%;
    }

    .sc-editor-history {
        gap: 15px;
    }

    .sc-title-row {
        align-items: stretch;

    }

    .sc-title-row>.sc-btn, .sc-title-row>.sc-file-btn {
        display: none;
    }



    .sc-tabs {
        overflow-x: auto;
    }

    .sc-tabs>button {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .sc-project-row {
        grid-template-columns: 1fr auto;
    }

    .sc-project-meta {
        display: none;
    }

    .sc-result-summary {
        grid-template-columns: 1fr 1fr;
    }

    .sc-sheet-svg {
        min-width: 560px;
    }

    .sc-mobile-actions {
        display: flex;
        gap: 8px;
        position: fixed;
        z-index: 998;
        bottom: 0;
        left: 0;
        right: 0;
        background: #eff1f2;

        padding: 10px 14px max(10px, env(safe-area-inset-bottom));
    }

    .sc-mobile-actions .mobile-nav-bottom-items {
        width: 100%;
    }

    .sc-mobile-actions .sc-btn {
        flex: 1;
    }
}

@media print {

    .sc-editor-head,
    .sc-tabs,
    .sc-result-toolbar,
    .sc-mobile-actions,
    .cutting-notice,
    .sc-next-row {
        display: none !important;
    }

    .stroytel-cutting-shell {
        color: #000;
    }

    .sc-result-summary {
        break-inside: avoid;
    }

    .sc-sheet-card {
        border: 0;
        padding: 0;
        break-after: page;
    }

    .sc-svg-wrap {
        padding: 0;
        background: #fff;
        overflow: visible;
    }

    .sc-sheet-svg {
        min-width: 0;
        max-height: none;
    }
}

/* Manual editor — v0.2.0 */
.sc-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 18px 0;
}

.sc-editor-history {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sc-editor-current {
    color: var(--sc-muted);
    font-size: 13px;
}

.sc-manual-editor {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.sc-editor-sidebar {
    box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.13);
    background: #fff;
    border-radius: 9px;
    padding: 14px;
    position: sticky;
    top: 18px;
    max-height: 78vh;
    overflow: auto;
}

.sc-editor-material-group+.sc-editor-material-group {
    border-top: 1px solid var(--sc-soft);
    padding-top: 14px;
    margin-top: 14px;
}

.sc-editor-material-group>strong {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
}

.sc-editor-sheet-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sc-editor-sheet-item {
    width: 100%;
    background: #fff;
    border-radius: 7px;
    padding: 9px 10px;
    text-align: left;
    cursor: pointer;
    color: var(--sc-text);
    border: 1px solid #999;
    box-shadow: none !important;
}

.sc-editor-sheet-item span,
.sc-editor-sheet-item small {
    display: block;
}

.sc-editor-sheet-item span {
    font-weight: 700;
}

.sc-editor-sheet-item small {
    color: var(--sc-muted);
    margin-top: 2px;
}

.sc-editor-sheet-item.active {
    border-color: var(--sc-orange);
    box-shadow: 0 0 0 2px rgba(225, 124, 48, .10);
}

.sc-editor-canvas-panel {
    min-width: 0;
    box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.13);
    background: #fff;
    border-radius: 9px;
    padding: 18px;
}

.sc-editor-part-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 44px;
    margin-bottom: 12px;
}

.sc-editor-part-tools .sc-btn {
    padding-left: 25px;
    padding-right: 25px;
}

.sc-selected-part-info {
    margin-right: auto;
    min-width: 180px;
}

.sc-selected-part-info strong,
.sc-selected-part-info span {
    display: block;
}

.sc-selected-part-info span {
    color: var(--sc-muted);
    font-size: 12px;
    margin-top: 2px;
}

.sc-editor-target-select {
    min-height: 42px;
    box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.13);
    border-radius: 7px;
    background: #fff;
    padding: 8px 10px;
    font: inherit;
}

.sc-editor-hint,
.sc-editor-note {
    color: var(--sc-muted);
    font-size: 13px;
}

.sc-editor-note {
    margin-top: 10px;
    line-height: 1.45;
}

.sc-editor-rotation-note {
    color: var(--sc-muted);
    font-size: 12px;
    line-height: 1.35;
    max-width: 330px;
}

.sc-editor-svg-wrap {
    background: #f7f7f8;
}

.sc-editor-part {
    cursor: pointer;
}

.sc-editor-part rect {
    transition: stroke .15s ease, stroke-width .15s ease, filter .15s ease;
}

.sc-editor-part:hover rect {
    stroke: var(--sc-orange);
    stroke-width: 3;
}

.sc-editor-part.is-selected rect {
    stroke: var(--sc-orange);
    stroke-width: 5;
    filter: drop-shadow(0 0 5px rgba(225, 124, 48, .28));
}

@media (max-width: 900px) {
    .sc-manual-editor {
        grid-template-columns: 1fr;
    }

    .sc-editor-sidebar {
        position: static;
        max-height: none;
    }

    .sc-editor-sheet-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .sc-editor-sheet-item {
        min-width: 155px;
    }
}

@media print {

    .sc-editor-toolbar,
    .sc-manual-editor {
        display: none !important;
    }
}

.sc-editor-current-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Drag & drop editor — v0.3.1 */
.sc-editor-part {
    touch-action: none;
    user-select: none;
}

.sc-editor-part.is-dragging {
    opacity: .34;
}

.sc-editor-part.is-dragging rect {
    stroke-dasharray: 12 8;
}

.sc-drag-snap-line {
    stroke: var(--sc-orange);
    stroke-width: 8;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
    filter: drop-shadow(0 0 3px rgba(225, 124, 48, .35));
}

.sc-drag-ghost {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    max-width: 260px;
    padding: 7px 10px;
    border-radius: 7px;
    background: #141417;
    color: #fff;
    font-size: 12px;
    line-height: 1.25;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .20);
    transform: translateZ(0);
}

.sc-editor-sheet-item.is-drop-target,
.sc-editor-new-sheet-drop.is-drop-target {
    border-color: var(--sc-orange);
    box-shadow: 0 0 0 3px rgba(225, 124, 48, .14);
    background: rgba(225, 124, 48, .06);
}

.sc-editor-new-sheet-drop {
    border: 1px dashed var(--sc-line);
    border-radius: 9px;
    padding: 10px;
    text-align: center;
    color: var(--sc-muted);
    font-size: 12px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.sc-editor-new-sheet-drop {
    display: none;
}

.stroytel-cutting-app.is-editor-dragging .sc-editor-new-sheet-drop {
    display: block;
}

@media (max-width: 700px) {
    .sc-result-toolbar-actions {
        width: 100%;
        justify-content: stretch;
    }

    .sc-result-toolbar-actions .sc-btn {
        flex: 1 1 auto;
    }
}



/* Labels dialog */
.sc-label-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(20, 20, 23, .56);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.sc-label-dialog {
    width: min(620px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #fff;
    border-radius: 9px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
    padding: 24px;
}

.sc-label-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.sc-label-dialog-head h2 {
    margin: 0;
    font-size: 22px;
}

.sc-label-dialog-head p {
    margin: 0;
    color: #6b6b71;
    font-size: 16px;
}

.sc-label-form {
    display: grid;
    gap: 14px;
}

.sc-label-form label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.sc-label-form label>span {
    font-size: 13px;
}

.sc-label-form small {
    color: #777;
    font-weight: 400;
    line-height: 1.35;
}

.sc-label-form input[type="number"], .sc-label-form select {
    width: 100%;
    box-sizing: border-box;
}

.sc-label-size-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sc-label-check {
    display: flex !important;
    align-items: center;
    gap: 9px !important;
    font-weight: 500 !important;
}

.sc-label-check input {
    margin: 0;
}

.sc-label-summary {
    margin-top: 18px;
    border: 1px solid #ddd;
    border-radius: 9px;
    padding: 13px 14px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
}

.sc-label-summary strong {
    font-size: 15px;
}

.sc-label-summary span {
    color: #666;
    text-align: right;
}

.sc-label-summary.is-error {
    border-color: #c44;
}

.sc-label-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.sc-label-print-note {
    margin-top: 14px;
    font-size: 12px;
    color: #777;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .sc-label-modal {
        padding: 10px;
    }

    .sc-label-dialog {
        padding: 18px;
    }

    .sc-label-size-row {
        grid-template-columns: 1fr;
    }

    .sc-label-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .sc-label-summary span {
        text-align: left;
    }
}

/* Production print / PDF report — v0.7.1 */
.sc-print-report {
    display: none;
}

.sc-cutting-print-hidden {
    display: none !important;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 0;
    }

    body.sc-cutting-print-mode * {
        visibility: hidden !important;
    }

    body.sc-cutting-print-mode #stroytel-cutting-app,
    body.sc-cutting-print-mode #stroytel-cutting-app * {
        visibility: visible !important;
    }

    body.sc-cutting-print-mode #stroytel-cutting-app {
        position: absolute;
        inset: 0 auto auto 0;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        background: #fff;
    }

    body.sc-cutting-print-mode .sc-editor-head,
    body.sc-cutting-print-mode .sc-tabs,
    body.sc-cutting-print-mode .sc-workspace,
    body.sc-cutting-print-mode .sc-mobile-actions,
    body.sc-cutting-print-mode .cutting-notice,
    body.sc-cutting-print-mode .sc-label-modal {
        display: none !important;
    }

    body.sc-cutting-print-mode .sc-print-report {
        display: block !important;
    }

    html, body {
        margin: 0 !important;
        padding: 0 !important;
    }

    .sc-print-report {
        --sc-print-content-width: 250mm;
        --sc-print-page-top: 4.8mm;
        --sc-print-page-bottom: 3mm;
        --sc-print-footer-bottom: 1.6mm;
        color: #111;
        font-family: Inter, Arial, sans-serif;
        font-size: 10pt;
        width: 100%;
    }

    /* One generated section = one physical page. Width uses the browser page box
       instead of a hard-coded 297 mm, so Letter preview cannot push the footer sideways. */
    .sc-print-page {
        position: relative;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        height: 210mm;
        padding: var(--sc-print-page-top) 0 var(--sc-print-page-bottom);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: #fff !important;
        break-after: page;
        page-break-after: always;
    }

    .sc-print-page:last-child {
        break-after: auto;
        page-break-after: auto;
    }

    .sc-print-page-content {
        flex: 1 1 auto;
        min-height: 0;
        box-sizing: border-box;
        width: min(var(--sc-print-content-width), calc(100% - 6mm));
        max-width: var(--sc-print-content-width);
        margin-left: auto;
        margin-right: auto;
    }

    .sc-print-page-footer {
        position: absolute !important;
        left: 50% !important;
        right: auto !important;
        bottom: var(--sc-print-footer-bottom) !important;
        top: auto !important;
        transform: translateX(-50%);
        width: min(var(--sc-print-content-width), calc(100% - 6mm)) !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        background-color: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        color: rgba(17, 17, 17, .72) !important;
        font-size: 7.5pt !important;
        font-weight: 400 !important;
        line-height: 1.1 !important;
        text-align: right !important;
        white-space: nowrap;
        overflow: hidden;
        z-index: 5;
    }

    /* Cover: vertically centered so a larger material table simply consumes the
       free space above and below instead of sticking to the top edge. */
    .sc-print-cover-content {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sc-print-cover-inner {
        width: 100%;
        max-width: 100%;
        margin: auto;
    }

    .sc-print-cover h1 {
        display: block !important;
        visibility: visible !important;
        color: #111 !important;
        -webkit-text-fill-color: #111 !important;
        font-size: 27pt !important;
        font-weight: 800 !important;
        line-height: 1.08;
        margin: 0 0 3mm;
    }

    .sc-print-date {
        color: #666;
        margin-bottom: 4.5mm;
    }

    .sc-print-summary-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4mm;
        margin-bottom: 6mm;
    }

    .sc-print-summary-grid>div {
        border: 1px solid #bbb;
        padding: 4mm;
        border-radius: 2mm;
    }

    .sc-print-summary-grid strong {
        display: block;
        font-size: 19pt;
        line-height: 1;
        margin-bottom: 1.5mm;
    }

    .sc-print-summary-grid span {
        color: #555;
        font-size: 9pt;
    }

    .sc-print-cover h2 {
        font-size: 14pt;
        margin: 0 0 3mm;
    }

    /* Robust table grid: separate borders avoid missing edges in Chromium print. */
    .sc-print-table {
        width: 100%;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        table-layout: auto;
        font-size: 8.5pt;
    }

    .sc-print-table th,
    .sc-print-table td {
        border: 0 !important;
        border-right: 1px solid #bbb !important;
        border-bottom: 1px solid #bbb !important;
        padding: 2.2mm 2.5mm;
        text-align: left;
        vertical-align: top;
    }

    .sc-print-table th:first-child,
    .sc-print-table td:first-child {
        border-left: 1px solid #bbb !important;
    }

    .sc-print-table thead th {
        border-top: 1px solid #bbb !important;
        border-bottom: 1px solid #bbb !important;
        background: #f1f1f1;
        font-weight: 750;
    }

    .sc-print-table tbody tr:last-child>td {
        border-bottom: 1px solid #bbb !important;
    }

    /* Map page: keep the heading and sheet drawing together. 244 mm gives a little
       more drawing area while still fitting a standard 2800×2070 sheet on A4 landscape. */
    .sc-print-map-content {
        display: block;
        min-height: 0;
    }

    .sc-print-map-inner {
        width: 100%;
        max-width: 100%;
        min-height: 0;
        display: block;
        margin: 0;
    }

    .sc-print-sheet-head {
        flex: 0 0 auto;
        margin-bottom: .8mm;
    }

    .sc-print-material-name {
        font-size: 9pt;
        color: #666;
        margin-bottom: 0;
        line-height: 1;
    }

    .sc-print-sheet-title-line {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 8mm;
    }

    .sc-print-sheet-head h2 {
        margin: 0;
        font-size: 16pt;
        line-height: 1;
    }

    .sc-print-sheet-meta {
        display: flex;
        gap: 4mm;
        flex-wrap: nowrap;
        justify-content: flex-end;
        align-items: flex-end;
        font-size: 8.5pt;
        line-height: 1;
        margin-bottom: .2mm;
        color: #555;
        white-space: nowrap;
    }

    .sc-print-sheet-svg-wrap {
        width: 100%;
        min-height: 0;
        display: block;
        overflow: hidden;
        padding: 0;
    }

    .sc-print-sheet-svg {
        display: block;
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: none !important;
        min-width: 0;
        margin: 0;
    }

    /* “Само карти” използва същата центрирана content grid като пълния PDF. */
    .sc-print-report.is-maps-only .sc-print-map-content {
        width: min(var(--sc-print-content-width), calc(100% - 6mm));
        max-width: var(--sc-print-content-width);
        margin-left: auto;
        margin-right: auto;
    }

    .sc-print-report.is-maps-only .sc-print-map-inner {
        width: 100%;
        max-width: 100%;
    }

    /* Cuts / offcuts pages */
    .sc-print-cuts-content,
    .sc-print-parts-content {
        padding-top: 4mm;
    }

    .sc-print-cuts-heading {
        margin-bottom: 7mm;
    }

    .sc-print-cuts-title-line {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 10mm;
    }

    .sc-print-cuts-title-line h2 {
        margin: 0;
        font-size: 16pt;
        line-height: 1.08;
    }

    .sc-print-cuts-size {
        color: #555;
        font-size: 8.5pt;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .sc-print-cut-section {
        margin: 0 0 7mm;
    }

    .sc-print-subhead {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 8mm;
        margin: 0 0 2.5mm;
    }

    .sc-print-subhead h3 {
        margin: 0;
        font-size: 12.5pt;
        line-height: 1.1;
        font-weight: 800;
    }

    .sc-print-subhead span {
        color: #555;
        font-size: 8.5pt;
    }

    .sc-print-cut-box {
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #bbb;
        padding: 5mm 6mm;
    }

    .sc-print-cut-list {
        width: 100%;
        columns: 3;
        column-gap: 8mm;
        margin: 0;
        padding-left: 5mm;
        font-size: 8pt;
        line-height: 1.4;
    }

    .sc-print-cut-list li {
        break-inside: avoid;
        margin: 0 0 1mm;
    }

    .sc-print-cut-list li.is-primary {
        font-weight: 650;
    }

    .sc-print-empty-cuts {
        color: #666;
        font-size: 9pt;
    }

    .sc-print-offcuts-section {
        margin-top: 0;
    }

    .sc-print-offcuts-list {
        min-height: 9mm;
        box-sizing: border-box;
        border: 1px solid #bbb;
        padding: 3mm 4mm;
        color: #444;
        font-size: 9pt;
        line-height: 1.35;
    }

    /* Parts list: no decorative black divider, but a complete table grid. */
    .sc-print-section-title {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 10mm;
        border: 0 !important;
        padding: 0 !important;
        margin: 0 0 5mm;
    }

    .sc-print-section-title>span {
        font-size: 17pt;
        font-weight: 800;
    }

    .sc-print-section-title small {
        color: #666;
    }

    .sc-print-parts-table {
        font-size: 8pt;
    }



    /* Labels: physical dimensions are expressed in mm. Print with A4 + 100% scale. */
    .sc-print-label-report .sc-print-label-page {
        padding: 0 !important;
        width: 100% !important;
        height: 210mm !important;
        overflow: hidden !important;
    }

    .sc-print-label-grid {
        box-sizing: border-box;
        width: calc(var(--label-cols) * var(--label-w) + (var(--label-cols) - 1) * var(--label-gap-x));
        height: calc(var(--label-rows) * var(--label-h) + (var(--label-rows) - 1) * var(--label-gap-y));
        display: grid;
        grid-template-columns: repeat(var(--label-cols), var(--label-w));
        grid-template-rows: repeat(var(--label-rows), var(--label-h));
        column-gap: var(--label-gap-x);
        row-gap: var(--label-gap-y);
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .sc-print-label-slot {
        box-sizing: border-box;
        width: var(--label-w);
        height: var(--label-h);
        border: .25mm solid #555;
        padding: 2.3mm 2.6mm;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        color: #111;
        background: #fff;
        break-inside: avoid;
    }

    .sc-print-label-slot.is-empty {
        border-color: transparent !important;
    }

    .sc-print-label-slot.is-borderless {
        border-color: transparent !important;
    }

    .sc-print-label-project {
        flex: 0 0 auto;
        color: #777;
        font-size: 6.8pt;
        line-height: 1.05;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 1.2mm;
    }

    .sc-print-label-name {
        flex: 0 0 auto;
        font-size: 11.5pt;
        font-weight: 800;
        line-height: 1.05;
        max-height: 2.15em;
        overflow: hidden;
        margin-bottom: 1mm;
    }

    .sc-print-label-dims {
        flex: 0 0 auto;
        font-size: 12pt;
        font-weight: 750;
        line-height: 1;
        margin-bottom: 1.2mm;
    }

    .sc-print-label-material {
        flex: 1 1 auto;
        min-height: 0;
        color: #555;
        font-size: 7.2pt;
        line-height: 1.15;
        overflow: hidden;
    }

    .sc-print-label-meta {
        flex: 0 0 auto;
        display: flex;
        justify-content: space-between;
        gap: 3mm;
        color: #333;
        font-size: 7pt;
        font-weight: 650;
        line-height: 1;
        padding-top: 1mm;
        border-top: .2mm solid #ccc;
    }

    /* Preserve SVG colours and hatching in browser PDF/print output. */
    .sc-print-report,
    .sc-print-report * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* v0.7.1 — кантове и канали */
.sc-finishing-layout {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.sc-finishing-sidebar {
    position: sticky;
    top: 18px;
    box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.13);
    border-radius: 9px;
    background: #fff;
    overflow: hidden;
    max-height: 76vh;
    overflow-y: auto;
}

.sc-finishing-sidebar-title {
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--sc-muted);
    border-bottom: 1px solid var(--sc-line);
}

.sc-finishing-part {
    display: block;
    width: 100%;
    border: 0;
    border-top: 1px solid var(--sc-soft);
    background: #fff;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    color: inherit;
}

.sc-finishing-part:first-of-type {
    border-top: 0;
}

.sc-finishing-part strong,
.sc-finishing-part span {
    display: block;
}

.sc-finishing-part span {
    margin-top: 3px;
    color: var(--sc-muted);
    font-size: 12px;
}

.sc-finishing-part.is-active {
    background: #fff8f1;
    box-shadow: inset 3px 0 0 var(--sc-orange);
}

.sc-finishing-main {
    min-width: 0;
}

.sc-edge-types-card {
    margin-top: 0;
}

.sc-edge-type-grid {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.sc-edge-type-row {
    display: grid;
    grid-template-columns: 62px minmax(180px, 1fr) minmax(130px, 180px);
    gap: 12px;
    align-items: end;
}

.sc-edge-type-row>i {
    align-self: center;
    display: block;
    width: 52px;
    height: 0;
    border-top: 3px solid #e17c30;
}

.sc-edge-type-row>i.is-edge-2 {
    border-top-style: dashed;
    border-top-width: 4px;
}

.sc-edge-type-row label,
.sc-channel-row label {
    display: grid;
    gap: 5px;
}

.sc-edge-type-row label>span,
.sc-channel-row label>span {
    font-size: 12px;
    font-weight: 700;
    color: var(--sc-muted);
}

.sc-edge-type-row input,
.sc-channel-row input,
.sc-channel-row select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--sc-line);
    border-radius: 7px;
    background: #fff;
    padding: 8px 10px;
    font: inherit;
}

.sc-edge-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.sc-edge-totals>span {
    padding: 7px 10px;
    border-radius: 999px;
    background: #f4f4f5;
    font-size: 12px;
    color: #5f5f66;
}

.sc-processing-card .sc-card-head>span {
    color: var(--sc-muted);
    font-size: 13px;
}

.sc-process-diagram-stage {
    display: grid;
    justify-items: center;
    gap: 16px;
    padding: 24px 12px 4px;
    overflow: auto;
}

.sc-process-diagram {
    position: relative;
    min-width: 230px;
    max-height: 440px;
    border: 1px solid #aaa;
    background: #fafafa;
    box-shadow: 0 0 0 10px #fff;
}

.sc-process-center {
    position: absolute;
    inset: 18%;
    display: grid;
    place-content: center;
    text-align: center;
    pointer-events: none;
}

.sc-process-center strong {
    font-size: 18px;
}

.sc-process-center span {
    margin-top: 4px;
    color: var(--sc-muted);
}

.sc-process-edge {
    position: absolute;
    z-index: 3;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.sc-process-edge-top,
.sc-process-edge-bottom {
    left: -8px;
    right: -8px;
    height: 17px;
}

.sc-process-edge-left,
.sc-process-edge-right {
    top: -8px;
    bottom: -8px;
    width: 17px;
}

.sc-process-edge-top {
    top: -9px;
}

.sc-process-edge-bottom {
    bottom: -9px;
}

.sc-process-edge-left {
    left: -9px;
}

.sc-process-edge-right {
    right: -9px;
}

/* Clean edge selector: mask the diagram border first, then draw exactly one marker line. */
.sc-process-edge::before,
.sc-process-edge::after {
    content: "";
    position: absolute;
    pointer-events: none;
    opacity: 0;
}

.sc-process-edge::before {
    z-index: 1;
    background: #fafafa;
}

.sc-process-edge::after {
    z-index: 2;
}

.sc-process-edge-top::before,
.sc-process-edge-bottom::before {
    left: 6px;
    right: 6px;
    top: 50%;
    height: 7px;
    transform: translateY(-50%);
}

.sc-process-edge-left::before,
.sc-process-edge-right::before {
    top: 6px;
    bottom: 6px;
    left: 50%;
    width: 7px;
    transform: translateX(-50%);
}

.sc-process-edge-top::after,
.sc-process-edge-bottom::after {
    left: 8px;
    right: 8px;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
}

.sc-process-edge-left::after,
.sc-process-edge-right::after {
    top: 8px;
    bottom: 8px;
    left: 50%;
    width: 4px;
    transform: translateX(-50%);
}

.sc-process-edge.is-edge-1::before,
.sc-process-edge.is-edge-1::after,
.sc-process-edge.is-edge-2::before,
.sc-process-edge.is-edge-2::after {
    opacity: 1;
}

.sc-process-edge-top.is-edge-1::after,
.sc-process-edge-bottom.is-edge-1::after {
    background: var(--sc-orange);
}

.sc-process-edge-left.is-edge-1::after,
.sc-process-edge-right.is-edge-1::after {
    background: var(--sc-orange);
}

.sc-process-edge-top.is-edge-2::after,
.sc-process-edge-bottom.is-edge-2::after {
    background: repeating-linear-gradient(to right, var(--sc-orange) 0 10px, transparent 10px 16px);
}

.sc-process-edge-left.is-edge-2::after,
.sc-process-edge-right.is-edge-2::after {
    background: repeating-linear-gradient(to bottom, var(--sc-orange) 0 10px, transparent 10px 16px);
}

.sc-process-edge:hover {
    background: rgba(225, 124, 48, .08);
}

.sc-process-channel {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    opacity: .9;
}

.sc-process-channel.is-horizontal {
    left: 0;
    right: 0;
    border-top: 2px dashed #555;
}

.sc-process-channel.is-vertical {
    top: 0;
    bottom: 0;
    border-left: 2px dashed #555;
}

.sc-edge-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 18px;
    color: var(--sc-muted);
    font-size: 12px;
}

.sc-edge-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sc-edge-legend i,
.sc-label-edge-marks i {
    display: inline-block;
    width: 32px;
    height: 0;
    border-top: 3px solid #333;
}

.sc-edge-legend i.is-edge-2,
.sc-label-edge-marks i.is-edge-2 {
    border-top-style: dashed;
    border-top-width: 4px;
}

.sc-edge-legend small {
    flex-basis: 100%;
    text-align: center;
    color: #888;
}

.sc-channels-card .sc-card-head {
    align-items: flex-start;
}

.sc-channels-card .sc-card-head h2 {
    margin: 0;
    padding-bottom: 5px;
}

.sc-channels-card .sc-card-head p {
    margin: 0;
    color: var(--sc-muted);
    font-size: 13px;
}

.sc-channel-table {
    margin-top: 16px;
}

.sc-channel-row {
    display: grid;
    grid-template-columns: 32px minmax(115px, .9fr) repeat(3, minmax(100px, .8fr)) 42px;
    gap: 9px;
    align-items: end;
    padding: 10px 0;
    border-top: 1px solid var(--sc-soft);
}

.sc-channel-row:first-child {
    border-top: 0;
}

.sc-channel-number {
    align-self: center;
    display: grid;
    place-content: center;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #f0f0f2;
    font-size: 12px;
    font-weight: 800;
}

.sc-finishing-empty-row {
    padding: 18px;
    border: 1px dashed #d4d4d8;
    border-radius: 9px;
    color: var(--sc-muted);
    text-align: center;
}

/* Производствени означения в SVG картите */
.sc-svg-edge-band {
    stroke: #222;
    stroke-width: 2.2;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.sc-svg-edge-band.is-edge-2 {
    stroke-dasharray: none;
}

.sc-svg-channel {
    stroke: #555;
    stroke-width: 2;
    stroke-dasharray: 10 7;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

@media (max-width: 900px) {
    .sc-finishing-layout {
        grid-template-columns: 1fr;
    }

    .sc-finishing-sidebar {
        position: static;
        max-height: 280px;
    }

    .sc-edge-type-row {
        grid-template-columns: 48px 1fr 130px;
    }

    .sc-channel-row {
        grid-template-columns: 28px 1fr 1fr;
    }

    .sc-channel-row label:nth-of-type(3),
    .sc-channel-row label:nth-of-type(4) {
        grid-column: span 1;
    }
}

@media (max-width: 600px) {
    .sc-edge-type-row {
        grid-template-columns: 1fr;
    }

    .sc-edge-type-row>i {
        margin: 5px 0;
    }

    .sc-channel-row {
        grid-template-columns: 1fr;
    }

    .sc-channel-number {
        display: none;
    }
}

.sc-print-label-partno {
    color: #555;
    font-weight: 800;
    margin-right: 1mm;
}

.sc-label-edge-marks {
    display: flex;
    align-items: center;
    gap: 1.2mm;
    min-height: 3mm;
    margin: .1mm 0 .55mm;
}

.sc-label-edge-marks>span {
    display: inline-grid;
    gap: .95mm;
}

.sc-label-edge-marks i {
    width: 12.5mm;
    border-top-width: .42mm;
}

.sc-label-edge-marks i.is-edge-none {
    border-color: transparent;
}

.sc-label-edge-marks b {
    font-size: 7pt;
    font-weight: 500;
    color: #777;
}

/* Total saved cuts, outside the heading and aligned to its right. */
.sc-count-heading-row {
    display: flex;
    flex-direction: row;
    justify-content: left;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.sc-count-heading-row h1 {
    margin: 0;
    text-align: left;
    min-width: 0;
}

.sc-count-heading-row .stroytel-cutting-heading-count {
  position: relative;
  top: -33px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 16px;
  color: #fff;
  display: inline-block;
  font-weight: 500 !important;
  margin-left: 8px;
  height: auto;
  line-height: normal;
  width: auto;
  min-width: auto;
}
@media (max-width: 860px) {
    .sc-count-heading-row .stroytel-cutting-heading-count {
        top: -2px;
    }
    .sc-count-heading-row {
        justify-content: space-between;
    }
}