/**
 * File: lumber_workshop.css
 * Verze a aktuální datum: 17-11-26 v_1.01
 */

/* --- Do skladu / K pile: systémové okno přes celou obrazovku na telefonu --- */
html.th-ws-open,
html.th-ws-open body {
    overflow: hidden;
}

.th-modal-overlay.th-ws-overlay {
    padding: 0;
    align-items: stretch;
    overscroll-behavior: contain;
}

/* vlastní plocha místo .th-modal-box: systémové okno má na telefonu zmenšení na 85 % a odsazení s !important,
   celoobrazovkový list by se nevešel; barvy, okraj a zaoblení jsou stejné jako u .th-modal-box */
.th-ws-box {
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #1a1a1a;
    color: #ffffff;
    text-align: left;
    overflow: hidden;
    box-shadow: 0 10px 100px rgba(0, 0, 0, 0.9);
    animation: th-ws-in 0.25s ease-out;
}

@keyframes th-ws-in {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (min-width: 768px) {
    .th-modal-overlay.th-ws-overlay {
        padding: 24px 0;
        align-items: flex-start;
    }

    .th-ws-box {
        width: 92%;
        max-width: 720px;
        height: calc(100vh - 48px);
        height: calc(100dvh - 48px);
        max-height: 960px;
        margin: auto;
        border: 1px solid #444;
        border-radius: var(--th-radius-lg);
    }
}

.th-ws-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: #1a1a1a;
}

.th-ws-head-text {
    flex: 1 1 auto;
    min-width: 0;
}

.th-ws-kicker {
    margin: 0 0 2px;
    color: #b3b3b3;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.th-dialog-title.th-ws-title {
    margin: 0;
    color: #ffffff;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    outline: none;
}

.th-dialog-title.th-ws-title.is-done {
    color: #4caf50;
}

.th-ws-sub {
    margin: 4px 0 0;
    color: #cccccc;
    font-size: 16px;
    line-height: 1.4;
}

.th-ws-close {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    margin: -6px -8px 0 0;
    border: 0;
    border-radius: var(--th-radius-md);
    background: transparent;
    color: #888;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.th-ws-close:hover {
    color: #ffffff;
}

.th-ws-close:focus-visible {
    outline: 2px solid #f9c343;
    outline-offset: 2px;
}

.th-ws-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px 16px 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.th-ws-foot {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: #1a1a1a;
}

.th-ws-foot > * {
    flex: 1 1 0;
    min-height: 52px;
    margin: 0;
}

.th-ws-foot > .th-modal-btn-secondary:disabled {
    opacity: 0.35;
    cursor: default;
}

/* --- Položky k odškrtnutí: velký dotykový cíl, systémové th-checkbox ve větší velikosti --- */
.th-ws-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.th-ws-item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 10px 14px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--th-radius-md);
    background: rgba(255, 255, 255, 0.03);
    color: #ececec;
    cursor: pointer;
}

.th-ws-item:hover {
    border-color: rgba(249, 195, 67, 0.45);
}

.th-ws-item .th-checkbox {
    width: 32px;
    height: 32px;
    border-radius: var(--th-radius-sm);
}

.th-ws-item .th-checkbox::before {
    width: 8px;
    height: 16px;
    border-width: 0 3px 3px 0;
}

.th-ws-item-text {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    min-width: 0;
    font-size: 20px;
    line-height: 1.3;
}

.th-ws-qty {
    color: #ffffff;
    font-size: 26px;
    font-weight: 800;
}

/* číslo dílu = plný odznak .th-lumber-badge (lumber_style.css), v seznamu větší */
.th-ws-no.th-lumber-badge {
    width: 28px;
    height: 28px;
    font-size: 15px;
}

.th-ws-item-main {
    color: #ececec;
}

.th-ws-item-len {
    color: #ffffff;
    font-weight: 800;
    white-space: nowrap;
}

.th-ws-item-extra {
    flex-basis: 100%;
    color: #b3b3b3;
    font-size: 16px;
}

.th-ws-item.is-rip .th-ws-item-main {
    font-weight: 700;
}

.th-ws-item.is-done {
    background: transparent;
}

.th-ws-item.is-done .th-ws-item-text,
.th-ws-item.is-done .th-ws-item-text * {
    color: #8a8a8a;
    text-decoration: line-through;
}

.th-ws-strip-head {
    margin: 8px 0 0;
    color: #cccccc;
    font-size: 15px;
    font-weight: 700;
}

.th-ws-strip-head span {
    color: #8a8a8a;
    font-weight: 400;
}

.th-ws-progress {
    margin: 0 0 8px;
    color: #cccccc;
    font-size: 16px;
}

.th-ws-progress strong {
    color: #4caf50;
}

.th-ws-note {
    margin: 0 0 10px;
    color: #9a9a9a;
    font-size: 14px;
    line-height: 1.45;
}

/* --- Nákres prkna (SVG v px podle šířky okna) --- */
.th-ws-draw-wrap {
    margin: 0 0 14px;
}

.th-ws-draw {
    display: block;
    max-width: 100%;
    height: auto;
    font-family: inherit;
}

.th-ws-d-waste {
    fill: #1c1c1c;
}

.th-ws-d-hatch {
    stroke: #3a3a3a;
    stroke-width: 2;
}

.th-ws-d-board {
    stroke: #777;
    stroke-width: 1;
}

.th-ws-d-lane {
    fill: none;
    stroke: #555;
    stroke-width: 1;
}

/* dlaždice v odstínu typu dílu (proměnné .th-lw-t1… v lumber_style.css) */
.th-ws-d-part rect {
    fill: var(--lw-tone, rgba(249, 195, 67, 0.2));
    stroke: var(--lw-edge, rgba(249, 195, 67, 0.55));
    stroke-width: 1;
}

.th-ws-d-part text.th-ws-d-len {
    fill: #ffffff;
    font-weight: 700;
}

.th-ws-d-part {
    cursor: pointer;
}

.th-ws-d-part.is-done rect {
    fill: #262626;
    stroke: #666;
}

/* neprůhledný podklad pod tónovanou dlaždicí (šrafa odpadu nepresvítá) */
.th-ws-d-part rect.th-ws-d-under {
    fill: #1c1c1c;
    stroke: none;
}

.th-ws-d-part.is-done text {
    fill: #8a8a8a;
}

.th-ws-d-dim {
    fill: none;
    stroke: #8a8a8a;
    stroke-width: 1;
}

.th-ws-d-dimtext,
.th-ws-d-strip {
    fill: #cccccc;
    font-size: 13px;
}

.th-ws-d-strip {
    font-size: 15px;
    font-weight: 700;
}

/* --- Bez PRO: další položky / prkna rozmazané, systémová výzva PRO --- */
.th-ws-locked {
    filter: blur(3px);
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

.th-ws-lock {
    margin: 4px 0 14px;
}

.th-ws-lock .th-drawings-pro-note {
    min-height: 56px;
    margin: 0;
    font-size: 15px;
}

.th-ws-lock .th-ws-unlock {
    min-height: 48px;
}

/* --- Vynulovat a poznámka o uložení --- */
.th-ws-aside {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.th-ws-aside .th-ws-reset {
    width: auto;
    min-height: 44px;
    margin: 0;
    padding: 10px 20px;
}

.th-ws-aside .th-ws-reset.is-armed {
    border-color: #e57373;
    color: #e57373;
}

@media (max-width: 380px) {
    .th-dialog-title.th-ws-title {
        font-size: 23px;
    }

    .th-ws-item-text {
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .th-modal-overlay.th-ws-overlay,
    .th-ws-box {
        animation: none;
    }

    .th-ws-overlay .th-modal-btn-primary,
    .th-ws-overlay .th-modal-btn-secondary,
    .th-ws-overlay .th-drawings-pro-note,
    .th-ws-overlay .th-checkbox,
    .th-ws-overlay .th-checkbox::before {
        transition: none;
    }

    .th-ws-overlay .th-modal-btn-primary:hover {
        transform: none;
    }
}

/* Nákup bez dílů, které se nevejdou (17-11-26) */
.th-ws-warn {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid rgba(240, 90, 80, .55);
    border-radius: var(--th-radius-md, 8px);
    background: rgba(240, 90, 80, .1);
    font-weight: 700;
    line-height: 1.45;
}

/* Po posledním řezu: nabídka uložit zbytky do Mých zbytků (tónovaný rámeček jako rada) */
.th-ws-keep {
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 1px solid rgba(249, 195, 67, 0.4);
    border-radius: 12px;
    background: rgba(249, 195, 67, 0.07);
    color: #ececec;
    font-size: 15px;
    line-height: 1.45;
}

.th-ws-keep p {
    margin: 0 0 8px;
}

.th-ws-keep .th-ws-keep-title {
    color: #f9c343;
    font-weight: 700;
}

.th-ws-keep.is-saved p {
    margin: 0;
    color: #b3b3b3;
}

.th-ws-keep-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
}
