/**
 * File: calcwood_nav.css
 * Verze a aktuální datum: 19-11-26 v_1.25
 */

/* ==========================================================================
   Rám stránky: proměnné (bez nového menu se nic z tohoto souboru nenačte)
   ========================================================================== */
html:is(.cw-nav-v2, :has(#cw-tb)) {
    --cw-tb-h: 60px;
    --cw-top: var(--cw-tb-h);
    --cw-dock-open: 300px;
    --cw-dock-rail: 56px;
    --cw-dock-w: 0px;
    --cw-bg: #141311;
    --cw-bg-2: #1b1916;
    --cw-bg-3: #24211d;
    --cw-line: #2c2925;
    --cw-line-2: #3a3631;
    --cw-text: #ece9e4;
    --cw-muted: #a8a29a;
    --cw-accent: #f9c343;
    --cw-accent-ink: #1a1400;
    --cw-accent-soft: #2a2416;
    --cw-admin: #6b5a2a;
    scroll-padding-top: calc(var(--cw-top) + 12px);
}

html:is(.cw-nav-v2, :has(#cw-tb)):is(.cw-has-testbar, :has(.cw-testbar)) {
    --cw-top: calc(var(--cw-tb-h) + 32px);
}

@media (min-width: 1200px) {
    html:is(.cw-nav-v2, :has(#cw-tb)) { --cw-dock-w: var(--cw-dock-rail); }
    html[data-cw-dock="open"]:is(.cw-nav-v2, :has(#cw-tb)) { --cw-dock-w: var(--cw-dock-open); }
}

@media (min-width: 1600px) {
    html:is(.cw-nav-v2, :has(#cw-tb)) { --cw-dock-w: var(--cw-dock-open); }
    html[data-cw-dock="rail"]:is(.cw-nav-v2, :has(#cw-tb)) { --cw-dock-w: var(--cw-dock-rail); }
}

/* Obsah stránky pod lištou a vedle Dílny; samotný obsah kalkulaček se nepřeskládává. */
html:is(.cw-nav-v2, :has(#cw-tb)) body {
    padding-top: var(--cw-top) !important;
    box-sizing: border-box;
}

/* Vedle Dílny: šířka Dílny + původní boční okraj stránky (kalkulačky 20 px, rozcestníky 0) */
@media (min-width: 1200px) {
    html:is(.cw-nav-v2, :has(#cw-tb)) body {
        padding-left: calc(var(--cw-dock-w) + 20px) !important;
        transition: padding-left 0.25s ease;
    }

    html:is(.cw-nav-v2, :has(#cw-tb)) body.hub-body {
        padding-left: var(--cw-dock-w) !important;
    }
}

/* Původní hlavička s logem a vlajkami: v novém menu je obojí v liště. */
html:is(.cw-nav-v2, :has(#cw-tb)) .cw-global-header,
html:is(.cw-nav-v2, :has(#cw-tb)) .hub-flags {
    display: none !important;
}

/* Stránky plánů měly odsazení od starého bočního menu (55 px). */
@media (min-width: 1200px) {
    html:is(.cw-nav-v2, :has(#cw-tb)) .th-shop-wrapper { padding-left: 48px; }
}

/* Celá obrazovka (3D, galerie plánů): lišta ani Dílna nesmí nic zakrýt. */
html.th-vis-max-open .cw-tb,
html.th-vis-max-open .cw-dock,
html.th-vis-max-open .cw-testbar,
html.th-lb-open .cw-tb,
html.th-lb-open .cw-dock,
html.th-lb-open .cw-testbar {
    display: none !important;
}

/* ==========================================================================
   Společné prvky
   ========================================================================== */
.cw-tb,
.cw-pop,
.cw-dock,
.cw-search,
.cw-testbar {
    font-family: 'Roboto', Arial, sans-serif;
    color: var(--cw-text);
    box-sizing: border-box;
}

.cw-tb *,
.cw-pop *,
.cw-dock *,
.cw-search * {
    box-sizing: border-box;
}

.cw-ico {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.cw-ico-chev {
    width: 13px;
    height: 13px;
    color: var(--cw-accent);
    transition: transform 0.2s ease;
}

.cw-ico-crown {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.cw-ico-calc {
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
}

.cw-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--cw-muted);
}

.cw-link-cta {
    font-size: 13px;
    font-weight: 700;
    color: var(--cw-accent);
    text-decoration: none;
    white-space: nowrap;
}

.cw-kbd {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 6px;
    border: 1px solid var(--cw-line-2);
    border-radius: 5px;
    background: transparent;
    color: var(--cw-muted);
    font: 700 11px/1 'Roboto', Arial, sans-serif;
    white-space: nowrap;
}

.cw-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: var(--cw-accent);
    color: var(--cw-accent-ink);
    font: 800 14px/1 'Roboto', Arial, sans-serif;
    text-decoration: none;
    cursor: pointer;
}

.cw-btn-primary:hover {
    background: #ffd56b;
    color: var(--cw-accent-ink);
}

.cw-btn-block {
    width: 100%;
    min-height: 48px;
}

.cw-tb a:focus-visible,
.cw-tb button:focus-visible,
.cw-pop a:focus-visible,
.cw-pop button:focus-visible,
.cw-pop input:focus-visible,
.cw-dock a:focus-visible,
.cw-dock button:focus-visible,
.cw-search a:focus-visible,
.cw-search button:focus-visible {
    outline: 2px solid var(--cw-accent);
    outline-offset: 2px;
}

/* ==========================================================================
   Lišta nahoře
   ========================================================================== */
.cw-tb {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9900;
    height: var(--cw-tb-h);
    padding: 0 12px 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(20, 19, 17, 0.9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--cw-line);
}

.cw-tb-btn,
.cw-tb-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--cw-text);
    font: 600 14px/1 'Roboto', Arial, sans-serif;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.cw-tb-btn:hover,
/* Kde jsem: „Kalkulačky › Schody“ na stránce kalkulačky (na úzké liště jen „Kalkulačky“) */
.cw-tb-crumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin-left: 6px;
    color: #ffffff;
}

.cw-tb-crumb-sep {
    color: var(--cw-muted);
    font-weight: 400;
}

.cw-tb-crumb-name {
    max-width: 210px;
    padding-block: 0.3em;
    margin-block: -0.3em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1439.98px) {
    .cw-tb-crumb {
        display: none;
    }
}

.cw-tb-link:hover {
    background: var(--cw-bg-3);
    color: #ffffff;
}

.cw-tb-icon {
    width: 40px;
    padding: 0;
    justify-content: center;
}

.cw-tb-icon .cw-ico {
    width: 20px;
    height: 20px;
}

.cw-tb-link[aria-current="page"],
.cw-tb-link.is-active {
    color: var(--cw-accent);
}

.cw-tb-link[aria-expanded="true"] {
    background: var(--cw-bg-3);
}

.cw-tb-link[aria-expanded="true"] .cw-ico-chev,
.cw-tb-lang[aria-expanded="true"] .cw-ico-chev {
    transform: rotate(180deg);
}

.cw-tb-logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 14px 0 4px;
    color: #ffffff;
    text-decoration: none;
}

.cw-tb-logo-img {
    width: 30px;
    height: 30px;
}

.cw-tb-logo-text {
    font: 800 18px/1 'Roboto', Arial, sans-serif;
    letter-spacing: 1.5px;
}

.cw-tb-logo-dot {
    color: var(--cw-accent);
}

.cw-tb-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.cw-badge-new {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    background: var(--cw-accent-soft);
    color: var(--cw-accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.cw-tb-grow {
    flex: 1 1 auto;
}

.cw-tb-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 290px;
    height: 36px;
    padding: 0 8px 0 12px;
    border: 1px solid var(--cw-line-2);
    border-radius: 10px;
    background: var(--cw-bg-2);
    color: var(--cw-muted);
    font: 400 13px/1 'Roboto', Arial, sans-serif;
    cursor: pointer;
}

.cw-tb-search:hover {
    border-color: #4a4540;
    color: var(--cw-text);
}

.cw-tb-search-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

/* Vlajky jazyků (lišta, seznam jazyků, telefon) */
.cw-flag {
    width: 20px;
    height: 14px;
    flex: 0 0 auto;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
    object-fit: cover;
}

.cw-pop-lang {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cw-tb-lang {
    font-weight: 700;
    font-size: 13px;
}

.cw-tb-units {
    display: inline-flex;
    align-items: center;
}

.cw-tb .cw-unit-switcher {
    margin-left: 0;
    padding: 3px;
    border-color: var(--cw-line-2);
    background: transparent;
}

.cw-tb .cw-unit-btn,
.cw-pop-mobile .cw-unit-btn {
    min-width: 36px;
    padding: 6px 9px;
    font-size: 12px;
}

.cw-tb-admin {
    border: 1px dashed var(--cw-admin);
    height: 34px;
    color: var(--cw-accent);
    font-size: 13px;
}

.cw-tb-admin .cw-ico {
    width: 16px;
    height: 16px;
}

.cw-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7a766f;
    flex: 0 0 auto;
}

.cw-dot[data-mode="beta"] { background: #4cc38a; }
.cw-dot[data-mode="pro"] { background: #e5534b; }
.cw-dot[data-mode="pro_logged"] { background: var(--cw-accent); }

.cw-tb-account {
    margin-left: 2px;
    padding: 0 12px 0 4px;
    height: 38px;
    border: 1px solid var(--cw-line-2);
    border-radius: 19px;
}

.cw-tb-account[aria-expanded="true"] {
    border-color: #4a3f24;
    background: var(--cw-accent-soft);
}

.cw-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--cw-bg-3);
    color: var(--cw-muted);
}

.cw-avatar .cw-ico {
    width: 16px;
    height: 16px;
}

.cw-avatar.is-pro {
    background: var(--cw-accent);
    color: var(--cw-accent-ink);
}

.cw-tb-search-mobile,
.cw-tb-burger {
    display: none;
}

/* Užší počítač: kratší hledání a účet jen ikonou */
@media (max-width: 1599.98px) {
    .cw-tb-search { width: auto; }
    .cw-tb-search-text { display: none; }
    .cw-tb-logo { margin-right: 8px; }
}

/* Plné popisky účtu a admin tlačítek až na širokém monitoru */
@media (max-width: 1799.98px) {
    .cw-tb-account-text { display: none; }
    .cw-tb-account { padding: 0 4px; }
    .cw-tb-admin span:not(.cw-dot) { display: none; }
}

/* 1200–1299 px: bez nápisu loga a štítku Nové, ať se lišta vejde i v delších jazycích */
@media (min-width: 1200px) and (max-width: 1299.98px) {
    .cw-tb:not(.cw-tb-bo) .cw-tb-logo-text,
    .cw-tb .cw-badge-new {
        display: none;
    }

    .cw-tb-link {
        padding: 0 9px;
    }
}

/* Telefon a tablet: logo, hledání, účet, hamburger */
@media (max-width: 1199.98px) {
    .cw-tb {
        padding: 0 6px 0 8px;
        gap: 2px;
    }

    .cw-tb-nav,
    .cw-tb-search,
    .cw-tb-lang,
    .cw-tb > .cw-tb-units,
    .cw-tb-admin,
    .cw-tb-docktoggle {
        display: none;
    }

    .cw-tb-logo { margin: 0 auto 0 6px; }
    .cw-tb-logo-img { width: 26px; height: 26px; }
    .cw-tb-logo-text { font-size: 16px; }

    .cw-tb-search-mobile,
    .cw-tb-burger {
        display: inline-flex;
        width: 44px;
        height: 44px;
    }

    .cw-tb-account {
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        justify-content: center;
    }

    .cw-tb-burger .cw-ico { color: var(--cw-accent); }
}

/* Pruh testovacího režimu (jen admin) */
.cw-testbar {
    position: fixed;
    top: var(--cw-tb-h);
    left: 0;
    right: 0;
    z-index: 9899;
    height: 32px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #3a2a10;
    border-bottom: 1px solid #6b4a14;
    color: #ffd27a;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
}

.cw-testbar span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.cw-testbar-btn {
    margin-left: auto;
    height: 24px;
    padding: 0 10px;
    border: 1px solid #b07a20;
    border-radius: 6px;
    background: transparent;
    color: #ffd27a;
    font: 700 11px/1 'Roboto', Arial, sans-serif;
    cursor: pointer;
}

/* ==========================================================================
   Rozbalovací okna (Popover API), polohu u tlačítka dopočítá calcwood_nav.js
   ========================================================================== */
.cw-pop {
    position: fixed;
    inset: auto;
    top: calc(var(--cw-tb-h) + 6px);
    left: var(--cw-pop-x, 16px);
    margin: 0;
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - var(--cw-tb-h) - 20px);
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--cw-line-2);
    border-radius: 14px;
    background: var(--cw-bg-2);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    z-index: 9950;
}

/* Vlastní display (grid, flex) by přebil skrytí zavřeného okna z prohlížeče. */
.cw-pop:not(:is(:popover-open, .is-open)) {
    display: none;
}

.cw-pop:is(:popover-open, .is-open) {
    animation: cw-pop-in 0.16s ease-out;
}

@keyframes cw-pop-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.cw-pop-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--cw-text);
    font-size: 14px;
    text-decoration: none;
}

.cw-pop-row:hover {
    background: var(--cw-bg-3);
    color: #ffffff;
}

.cw-pop-row[aria-current="true"] {
    background: var(--cw-accent-soft);
    color: var(--cw-accent);
}

.cw-pop-code {
    color: var(--cw-muted);
    font-size: 12px;
    font-weight: 700;
}

.cw-pop-list {
    width: 260px;
}

.cw-muted {
    color: var(--cw-muted);
}

.cw-pop-sep {
    height: 1px;
    margin: 8px 0;
    background: var(--cw-line-2);
}

/* Kalkulačky */
.cw-pop-mega {
    width: 780px;
    padding: 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 14px;
}

.cw-pop-mega:not(:has(.cw-mega-side)) {
    width: 560px;
    grid-template-columns: minmax(0, 1fr);
}

.cw-mega-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.cw-mega-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--cw-text);
    text-decoration: none;
}

.cw-mega-item:hover,
.cw-mega-item[aria-current="page"] {
    border-color: #4a4234;
    background: var(--cw-bg-3);
}

.cw-mega-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: #26221c;
}

.cw-mega-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.cw-mega-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.cw-mega-desc {
    font-size: 12px;
    line-height: 1.35;
    color: var(--cw-muted);
}

.cw-mega-side {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border-radius: 12px;
    background: #221e18;
    color: var(--cw-text);
    text-decoration: none;
}

.cw-mega-side .cw-eyebrow {
    color: var(--cw-accent);
}

.cw-mega-side-text {
    font-size: 13px;
    line-height: 1.45;
    color: var(--cw-muted);
}

.cw-mega-side .cw-link-cta {
    margin-top: auto;
}

.cw-mega-strip {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--cw-accent-soft);
    color: var(--cw-text);
    font-size: 13px;
    line-height: 1.4;
}

.cw-mega-strip .cw-ico-crown {
    color: var(--cw-accent);
}

.cw-mega-strip .cw-link-cta {
    margin-left: auto;
}

/* Admin */
.cw-pop-admin {
    width: 320px;
    padding: 14px;
    border-style: dashed;
    border-color: var(--cw-admin);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cw-pop-head {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cw-pop-head strong {
    color: var(--cw-accent);
    font-size: 15px;
}

.cw-pop-head span {
    color: var(--cw-muted);
    font-size: 12px;
}

.cw-admin-modes {
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cw-admin-modes legend {
    margin-bottom: 6px;
    padding: 0;
    color: var(--cw-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.cw-admin-mode {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--cw-line);
    border-radius: 8px;
    cursor: pointer;
}

.cw-admin-mode:has(input:checked) {
    border-color: var(--cw-admin);
    background: var(--cw-accent-soft);
}

.cw-admin-mode input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cw-admin-mode:has(input:focus-visible) {
    outline: 2px solid var(--cw-accent);
    outline-offset: 2px;
}

.cw-admin-mode-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
}

.cw-admin-mode-text small {
    color: var(--cw-muted);
    font-size: 12px;
}

/* Po klepnutí na režim se stránka obnovuje: okno ztlumené, další klepnutí nic nepokazí */
.cw-admin-busy .cw-admin-modes,
.cw-admin-busy .cw-admin-toggle {
    opacity: 0.55;
    pointer-events: none;
    cursor: progress;
}

.cw-admin-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 2px;
    font-size: 14px;
    cursor: pointer;
}

/* Menu na telefonu */
.cw-pop-mobile {
    top: var(--cw-tb-h);
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: calc(100dvh - var(--cw-tb-h));
    max-height: none;
    padding: 16px;
    border: 0;
    border-top: 1px solid var(--cw-line);
    border-radius: 0;
    background: var(--cw-bg);
    box-shadow: none;
    flex-direction: column;
    gap: 16px;
    overscroll-behavior: contain;
}

.cw-pop-mobile:is(:popover-open, .is-open) {
    display: flex;
}

.cw-mob-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cw-mob-lang {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--cw-line-2);
    border-radius: 10px;
    background: var(--cw-bg-2);
    color: var(--cw-text);
    font: 600 15px/1 'Roboto', Arial, sans-serif;
    text-align: left;
    cursor: pointer;
}

.cw-mob-lang-label {
    color: var(--cw-muted);
    font-size: 13px;
    font-weight: 400;
}

.cw-mob-lang-value {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Na telefonu je seznam jazyků list zdola */
@media (max-width: 1199.98px) {
    #cw-pop-lang {
        top: auto;
        bottom: 12px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        padding: 8px;
    }

    #cw-pop-lang .cw-pop-row {
        min-height: 48px;
        font-size: 16px;
    }
}

.cw-pop-mobile .cw-unit-switcher {
    display: inline-flex !important;
    margin-left: 0;
}

.cw-mob-calcs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.cw-mob-calcs a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 10px;
    border: 1px solid var(--cw-line);
    border-radius: 12px;
    background: var(--cw-bg-2);
    color: var(--cw-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.cw-mob-calcs a[aria-current="page"] {
    border-color: var(--cw-accent);
}

.cw-mob-calcs span {
    min-width: 0;
    overflow-wrap: anywhere;
    -webkit-hyphens: auto;
    hyphens: auto;
}

.cw-mob-calcs .cw-ico-calc {
    width: 24px;
    height: 24px;
}

.cw-mob-links {
    display: flex;
    flex-direction: column;
}

.cw-mob-links a,
.cw-mob-links button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 4px;
    border: 0;
    border-bottom: 1px solid var(--cw-line);
    background: transparent;
    color: var(--cw-text);
    font: 600 16px/1.2 'Roboto', Arial, sans-serif;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.cw-mob-links > :last-child {
    border-bottom: 0;
}

.cw-mob-links button .cw-ico {
    color: var(--cw-accent);
}

.cw-mob-links a[aria-current="page"] {
    color: var(--cw-accent);
}

.cw-mob-admin {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px dashed var(--cw-admin);
    border-radius: 12px;
    color: var(--cw-accent);
    font-size: 13px;
}

.cw-mob-admin-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.cw-mob-admin-row a,
.cw-mob-admin-row button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 8px;
    border: 1px solid var(--cw-line-2);
    border-radius: 8px;
    background: transparent;
    color: var(--cw-text);
    font: 700 13px/1.2 'Roboto', Arial, sans-serif;
    text-decoration: none;
    cursor: pointer;
}

.cw-mob-donate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    color: var(--cw-muted);
    font-size: 14px;
    text-align: center;
    text-decoration: none;
}

.cw-mob-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    padding-bottom: 12px;
}

.cw-mob-foot a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 4px;
    color: #b3b3b3;
    font-size: 12px;
    text-decoration: none;
}

/* Telefon: ťukací plochy přepínače mm | in aspoň 40 px */
.cw-pop-mobile .cw-unit-btn {
    min-width: 48px;
    min-height: 40px;
}

/* Hamburger se po otevření změní na křížek */
.cw-tb-burger .cw-ico-burger-close,
.cw-tb-burger[aria-expanded="true"] .cw-ico-burger-open {
    display: none;
}

.cw-tb-burger[aria-expanded="true"] .cw-ico-burger-close {
    display: block;
}

/* ==========================================================================
   Hledání (Ctrl K)
   ========================================================================== */
.cw-search {
    width: min(640px, calc(100vw - 24px));
    max-height: min(560px, calc(100dvh - 120px));
    margin: 12vh auto auto;
    padding: 0;
    border: 1px solid var(--cw-line-2);
    border-radius: 16px;
    background: var(--cw-bg-2);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.cw-search[open] {
    display: flex;
    flex-direction: column;
}

.cw-search::backdrop {
    background: rgba(8, 7, 6, 0.6);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.cw-search-head {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 14px;
    border-bottom: 1px solid var(--cw-line);
    flex: 0 0 auto;
}

.cw-search-head .cw-ico {
    color: var(--cw-accent);
}

.cw-search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    border: 0;
    background: transparent;
    color: #ffffff;
    font: 400 16px/1 'Roboto', Arial, sans-serif;
    outline: none;
}

.cw-search-input::-webkit-search-cancel-button {
    display: none;
}

.cw-search-close {
    cursor: pointer;
}

.cw-search-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px 8px 8px;
    overscroll-behavior: contain;
}

.cw-search-group {
    padding: 10px 10px 4px;
    color: var(--cw-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.cw-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--cw-text);
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

.cw-search-item[aria-selected="true"] {
    background: var(--cw-accent-soft);
    color: #ffffff;
}

.cw-search-item-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cw-search-item-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Úryvek odpovědi u častých dotazů (jeden řádek) */
.cw-search-item-sub {
    color: var(--cw-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-search-empty-link {
    display: inline-block;
    margin-top: 8px;
}

.cw-search-item-meta {
    flex: 0 1 auto;
    max-width: 38%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--cw-muted);
    font-size: 12px;
}

.cw-search-empty {
    padding: 22px 10px;
    color: var(--cw-muted);
    font-size: 14px;
    text-align: center;
}

.cw-search-foot {
    display: flex;
    gap: 16px;
    padding: 10px 14px;
    border-top: 1px solid var(--cw-line);
    color: var(--cw-muted);
    font-size: 11px;
    flex: 0 0 auto;
}

.cw-search-foot .cw-kbd {
    height: 18px;
    margin-right: 2px;
}

@media (max-width: 1199.98px) {
    .cw-search {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }

    .cw-search-foot {
        display: none;
    }
}

/* ==========================================================================
   Moje dílna (vlevo na počítači, list zdola na telefonu), markup th_cw_nav_dock()
   ========================================================================== */
.cw-dock {
    position: fixed;
    top: var(--cw-top);
    bottom: 0;
    left: 0;
    z-index: 9890;
    width: var(--cw-dock-w);
    display: flex;
    flex-direction: column;
    background: var(--cw-bg);
    border-right: 1px solid var(--cw-line);
    overflow: hidden;
    container: cwdock / inline-size;
    transition: width 0.25s ease;
}

.cw-dock-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 10px 8px 16px;
    flex: 0 0 auto;
}

.cw-dock-title {
    flex: 1 1 auto;
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

.cw-dock-collapse .cw-ico {
    transition: transform 0.25s ease;
}

.cw-dock-close {
    display: none;
}

.cw-dock-rail {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.cw-dock-rail button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: var(--cw-bg-3);
    color: var(--cw-accent);
    cursor: pointer;
}

.cw-dock-rail .cw-ico {
    width: 19px;
    height: 19px;
}

.cw-continue {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0 12px 10px;
    padding: 12px 14px;
    border: 1px solid #4a3f24;
    border-radius: 12px;
    background: linear-gradient(135deg, #2a2416, #1c1915);
    color: var(--cw-text);
    text-decoration: none;
    flex: 0 0 auto;
}

.cw-continue[hidden] {
    display: none;
}

.cw-continue:hover {
    border-color: var(--cw-accent);
}

.cw-continue .cw-eyebrow {
    color: var(--cw-accent);
}

.cw-continue-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-continue-meta {
    color: var(--cw-muted);
    font-size: 12px;
}

/* Obsah Dílny (th_cw_nav_dock) */
.cw-pill {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 11px;
    background: var(--cw-accent-soft);
    color: var(--cw-accent);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.cw-dock-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 12px 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.cw-dock .cw-continue {
    margin: 0;
}

.cw-dock .cw-seg-full {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 0;
    background: var(--cw-bg-2);
    border-radius: 10px;
    flex: 0 0 auto;
}

.cw-dock .cw-seg-full .cw-seg-btn {
    justify-content: center;
    height: 34px;
    border: 0;
    background: transparent;
    font: 700 12px/1.1 'Roboto', Arial, sans-serif;
    text-align: center;
    cursor: pointer;
}

.cw-dock .cw-seg-full .cw-seg-btn.active {
    background: var(--cw-accent-soft);
    color: var(--cw-accent);
}

/* Tři záložky (s kartou Moje řezivo): delší názvy se zalomí na dva řádky */
.cw-dock .cw-seg-full.cw-seg-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cw-dock .cw-seg-full.cw-seg-3 .cw-seg-btn {
    height: auto;
    min-height: 34px;
    padding: 4px 6px;
    hyphens: auto;
    overflow-wrap: anywhere;
}

.cw-dock-search {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 2px 0 10px;
    border: 1px solid var(--cw-line-2);
    border-radius: 10px;
    flex: 0 0 auto;
}

.cw-dock-search > .cw-ico {
    width: 15px;
    height: 15px;
    color: var(--cw-muted);
}

.cw-dock-search .cw-tb-icon {
    width: 32px;
    height: 32px;
}

.cw-dock-search .cw-tb-icon .cw-ico {
    width: 16px;
    height: 16px;
    color: var(--cw-muted);
}

.cw-dock-search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--cw-text);
    font: 400 13px/1 'Roboto', Arial, sans-serif;
    outline: none;
}

/* Roluje jen seznam projektů a historie; účet, záložky a hledání zůstávají nahoře.
   Na nízké obrazovce (seznam pod 160 px) se jako záloha roluje celá Dílna. */
.cw-dock-body > * {
    flex-shrink: 0;
}

.cw-dock-body > .cw-dock-lists {
    flex: 1 1 auto;
    min-height: 160px;
    margin-right: -8px;
    padding-right: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Vzhled posuvníku je společný pro celý web (shared/calc_theme.css, Posuvníky). */

.cw-dock .cw-dock-list {
    overflow: visible;
    padding: 0;
}

.cw-dock .th-rp-item {
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid #262320;
    border-radius: 10px;
    background: var(--cw-bg-2);
    gap: 6px;
}

.cw-dock .th-rp-item:hover {
    border-color: #4a3f24;
}

.cw-dock .th-rp-item-title {
    font-size: 14px;
    font-weight: 600;
    padding-right: 60px;
}

.cw-dock .th-rp-item-date {
    color: var(--cw-muted);
    font-size: 11px;
}

.cw-dock .th-rp-item-type {
    font-size: 10px;
}

.cw-dock .th-history-empty {
    padding: 16px 4px;
    color: var(--cw-muted);
    font-size: 13px;
    text-align: center;
}

/* Karta Moje řezivo (shared/js/calcwood_my_lumber.js) */
.cw-dock .cw-lumber-rows {
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
    color: var(--cw-text);
    font: 400 13px/1.45 'Roboto', Arial, sans-serif;
    font-variant-numeric: tabular-nums;
}

.cw-dock .cw-lumber-item .cw-lumber-use {
    width: 100%;
    margin-top: 4px;
    box-sizing: border-box;
}

.cw-dock .cw-lumber-empty p {
    margin: 0 0 12px;
    line-height: 1.5;
}

/* Karta Můj účet a licence (nahoře v Dílně, rozbalovací) */
.cw-acc {
    border: 1px solid var(--cw-line-2);
    border-radius: 12px;
    background: var(--cw-bg-2);
    flex: 0 0 auto;
}

.cw-acc[open] {
    border-color: #4a3f24;
}

.cw-acc-sum {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    list-style: none;
}

.cw-acc-sum::-webkit-details-marker {
    display: none;
}

.cw-acc[open] .cw-acc-sum .cw-ico-chev {
    transform: rotate(180deg);
}

.cw-avatar-letter {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 800;
}

.cw-acc-sum-text {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cw-acc-name {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-acc-sub {
    color: var(--cw-muted);
    font-size: 12px;
}

.cw-acc-info {
    margin: 0;
    padding: 4px 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--cw-line);
    padding-top: 12px;
}

.cw-acc-info div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cw-acc-info dt {
    color: var(--cw-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.cw-acc-info dd {
    margin: 0;
    color: var(--cw-text);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.cw-acc-info .cw-key {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 2px 0 0;
    padding: 2px 2px 2px 10px;
    border: 1px solid var(--cw-line);
    border-radius: 10px;
    background: var(--cw-bg-2);
}

.cw-key-val {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--cw-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    letter-spacing: 0.3px;
    overflow-wrap: anywhere;
}

.cw-key.is-shown .cw-key-val {
    color: var(--cw-text);
    -webkit-user-select: all;
    user-select: all;
}

.cw-key-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--cw-muted);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.cw-key-btn .cw-ico {
    width: 16px;
    height: 16px;
}

.cw-key-btn:hover {
    background: var(--cw-bg-3);
    color: var(--cw-text);
}

.cw-key-btn:focus {
    outline: none;
}

.cw-key-btn:focus-visible {
    outline: 2px solid var(--cw-accent);
    outline-offset: -2px;
}

.cw-key-ico-hide,
.cw-key-ico-done,
.cw-key.is-shown .cw-key-ico-show,
.cw-key.is-copied .cw-key-ico-copy {
    display: none;
}

.cw-key.is-shown .cw-key-ico-hide,
.cw-key.is-copied .cw-key-ico-done {
    display: block;
}

.cw-key.is-copied [data-cw-key-copy] {
    color: var(--cw-accent);
}

/* Hlášku „Zkopírováno“ čte jen čtečka obrazovky, vidět je žlutá fajfka */
.cw-key-status,
.cw-copy-buffer {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.cw-acc-hl {
    color: var(--cw-accent) !important;
    font-weight: 700;
}

.cw-acc-calcs {
    margin: 10px 12px 0;
    color: var(--cw-accent);
    font-size: 12px;
}

.cw-acc .cw-dock-actions {
    padding: 12px;
}

.cw-dock-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    flex: 0 0 auto;
}

.cw-dock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--cw-line-2);
    border-radius: 10px;
    background: var(--cw-bg-2);
    color: var(--cw-text);
    font: 600 13px/1.2 'Roboto', Arial, sans-serif;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.cw-dock-btn:hover {
    border-color: #4a4540;
    color: #ffffff;
}

.cw-dock-btn-quiet {
    border-color: transparent;
    background: transparent;
    color: var(--cw-muted);
}

.cw-dock-guest {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 4px;
}

/* Země bez prodeje (pro_purchase_block.php přidá html.th-sales-blocked): bez tlačítka nákupu, licenční klíč zůstává. */
.th-sales-blocked .cw-dock-guest > .cw-btn-primary {
    display: none;
}

.cw-dock-guest-title {
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
}

.cw-dock-benefits {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cw-dock-benefits li {
    position: relative;
    padding-left: 24px;
    color: var(--cw-text);
    font-size: 14px;
    line-height: 1.4;
}

.cw-dock-benefits li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 4px;
    width: 10px;
    height: 6px;
    border-left: 2px solid var(--cw-accent);
    border-bottom: 2px solid var(--cw-accent);
    transform: rotate(-45deg);
}

.cw-dock-key > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    color: var(--cw-muted);
    font-size: 13px;
    cursor: pointer;
    list-style: none;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.cw-dock-key > summary::-webkit-details-marker {
    display: none;
}

.cw-dock-key > summary:hover {
    background: var(--cw-bg-2);
    color: var(--cw-text);
}

/* Bez bílého obrysu prohlížeče po kliknutí; z klávesnice žlutý */
.cw-dock-key > summary:focus {
    outline: none;
}

.cw-dock-key > summary:focus-visible {
    outline: 2px solid var(--cw-accent);
    outline-offset: 2px;
}

.cw-dock-key > summary .cw-ico-chev {
    transition: transform 0.15s ease;
}

.cw-dock-key[open] > summary {
    margin-bottom: 8px;
    color: var(--cw-text);
}

.cw-dock-key[open] > summary .cw-ico-chev {
    transform: rotate(180deg);
}

/* Pole a tlačítko jako jeden prvek (stejně jako hledání v menu) */
.cw-dock-key-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--cw-line-2);
    border-radius: 12px;
    background: var(--cw-bg-2);
    transition: border-color 0.15s ease;
}

.cw-dock-key-row:focus-within {
    border-color: var(--cw-accent);
}

.cw-dock-key-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 36px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: #ffffff;
    font: 400 14px/1 'Roboto', Arial, sans-serif;
}

.cw-dock-key-input::placeholder {
    color: var(--cw-muted);
}

.cw-dock-key-input:focus {
    outline: none;
}

.cw-dock-key-btn {
    flex: 0 0 auto;
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    background: var(--cw-accent-soft);
    color: var(--cw-accent);
    font: 700 13px/1 'Roboto', Arial, sans-serif;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.cw-dock-key-btn:hover,
.cw-dock-key-btn:focus-visible {
    background: var(--cw-accent);
    color: var(--cw-accent-ink);
    outline: none;
}

.cw-dock .license-message,
.th-pro-key .license-message {
    margin-top: 8px;
    font-size: 13px;
}

/* Proužek ikon (sbalená Dílna): řídí šířka Dílny, ne extra třída */
@container cwdock (max-width: 120px) {
    .cw-dock-head {
        justify-content: center;
        padding: 10px 0 6px;
    }

    .cw-dock-title,
    .cw-dock .cw-pill,
    .cw-dock-body {
        display: none;
    }

    .cw-dock-collapse .cw-ico {
        transform: rotate(180deg);
    }

    .cw-dock-rail {
        display: flex;
    }
}

/* Telefon: Dílna jako list zdola (otevírá účet v liště nebo položka v menu) */
@media (max-width: 1199.98px) {
    .cw-dock {
        top: auto;
        bottom: 0;
        width: 100vw;
        height: min(86dvh, 680px);
        border-right: 0;
        border-top: 1px solid var(--cw-line-2);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 0 0 100vmax rgba(8, 7, 6, 0.55);
        transform: translateY(105%);
        visibility: hidden;
        transition: transform 0.25s ease, visibility 0s linear 0.25s;
        z-index: 9960;
    }

    html.cw-dock-sheet .cw-dock {
        transform: none;
        visibility: visible;
        transition: transform 0.25s ease;
    }

    html.cw-dock-sheet {
        overflow: hidden;
    }

    .cw-dock-collapse {
        display: none;
    }

    .cw-dock-close {
        display: inline-flex;
    }

    .cw-dock-head {
        padding-top: 14px;
    }
}

/* Telefon (Krok 16): Dílna přes celou výšku jako spodní panely oken (.th-sheet v calc_theme.css), zavřít 44 × 44 px */
@media (max-width: 600px) {
    .cw-dock {
        height: calc(100dvh - var(--th-space-3));
    }

    .cw-dock-close {
        width: 44px;
        height: 44px;
    }
}

/* ==========================================================================
   Tisk a omezený pohyb
   ========================================================================== */
@media print {
    .cw-tb,
    .cw-dock,
    .cw-testbar,
    .cw-pop,
    .cw-search {
        display: none !important;
    }

    html:is(.cw-nav-v2, :has(#cw-tb)) body {
        padding: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html:is(.cw-nav-v2, :has(#cw-tb)) body,
    .cw-dock,
    .cw-ico-chev,
    .cw-dock-collapse .cw-ico {
        transition: none;
    }

    .cw-pop:is(:popover-open, .is-open) {
        animation: none;
    }
}

/* Otevřené menu na telefonu: stránka pod ním se neposouvá */
html:is(.cw-mob-open, :has(#cw-pop-mobile:popover-open)) {
    overflow: hidden;
}

/* ==========================================================================
   Back office (shared/export/index.php, th_cw_nav_render_backoffice)
   ========================================================================== */
html:is(.cw-nav-v2, :has(#cw-tb)):not(:has(#cw-dock)) {
    --cw-dock-w: 0px;
}

/* Původní logo, záložky a plovoucí Odhlásit back office nahrazuje lišta */
html:has(.cw-tb-bo) .th-dashboard-logo,
html:has(.cw-tb-bo) .th-dash-nav-tabs,
html:has(.cw-tb-bo) body > a[href="?logout=1"] {
    display: none !important;
}

.cw-bo-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    margin-left: 4px;
    padding: 0 8px;
    border-radius: 5px;
    background: var(--cw-accent-soft);
    color: var(--cw-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.6px;
}

.cw-tb-bo .cw-tb-link[aria-current="page"] {
    background: var(--cw-accent-soft);
    color: var(--cw-accent);
}

.cw-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e5534b;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
}

.cw-seg {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px dashed var(--cw-admin);
    border-radius: 9px;
}

.cw-seg-btn {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 6px;
    color: var(--cw-muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.cw-seg-btn:hover {
    color: #ffffff;
}

.cw-seg-btn.is-on {
    background: var(--cw-accent-soft);
    color: var(--cw-accent);
}

.cw-tb-logout {
    border: 1px solid var(--cw-line-2);
    color: var(--cw-muted);
    font-size: 13px;
}

.cw-pop-tools {
    width: 300px;
}

.cw-pop-row-2 {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    padding: 8px 10px;
}

.cw-pop-row-2 small {
    color: var(--cw-muted);
    font-size: 12px;
}

@media (max-width: 1439.98px) {
    .cw-tb-bo .cw-tb-logo-text { display: none; }
}

@media (max-width: 1199.98px) {
    .cw-tb-bo .cw-seg,
    .cw-tb-bo .cw-tb-logout {
        display: none;
    }

    .cw-tb-bo .cw-tb-logo-text { display: inline; }
}

/* ==========================================================================
   CalcWood na ploše: instalace aplikace (karta dole v Dílně, ikona v proužku,
   řádek v menu telefonu, dialog s návodem). Zobrazení řídí calcwood_nav.js.
   ========================================================================== */
.cw-app-card[hidden],
.cw-app-row[hidden],
.cw-app-rail[hidden] {
    display: none;
}

.cw-app-ico {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--cw-accent-soft);
    color: var(--cw-accent);
    flex: 0 0 auto;
}

.cw-app-ico .cw-ico {
    width: 22px;
    height: 22px;
}

/* Jedna ikona podle zařízení: počítač, telefon (is-phone), tablet (is-tablet) */
:is(.cw-app-card, .cw-app-row, .cw-app-rail) .cw-app-i-phone,
:is(.cw-app-card, .cw-app-row, .cw-app-rail) .cw-app-i-tablet,
.is-phone .cw-app-i-pc,
.is-tablet .cw-app-i-pc {
    display: none;
}

.is-phone .cw-app-i-phone,
.is-tablet .cw-app-i-tablet {
    display: block;
}

.cw-app-card {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 4px 12px;
    margin: 0 12px 12px;
    padding: 14px;
    border: 1px solid var(--cw-line-2);
    border-radius: 12px;
    background: var(--cw-bg-2);
    flex: 0 0 auto;
}

.cw-app-card .cw-app-ico {
    grid-row: span 2;
}

.cw-app-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.cw-app-card .cw-app-title {
    padding-right: 24px;
}

.cw-app-desc {
    color: var(--cw-muted);
    font-size: 12.5px;
    line-height: 1.4;
}

.cw-app-go {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    margin-top: 8px;
    padding: 0 12px;
    border: 1px solid var(--cw-accent);
    border-radius: 10px;
    background: transparent;
    color: var(--cw-accent);
    font: 700 13px/1.2 'Roboto', Arial, sans-serif;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.cw-app-go:hover,
.cw-app-go:focus-visible {
    background: var(--cw-accent);
    color: var(--cw-accent-ink);
    outline: none;
}

.cw-app-go .cw-ico {
    width: 16px;
    height: 16px;
}

.cw-app-x {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
}

.cw-app-x .cw-ico {
    width: 14px;
    height: 14px;
}

/* Sbalená Dílna: místo karty jen ikona v proužku */
.cw-dock-rail .cw-app-rail {
    margin-top: 8px;
    border: 1px solid var(--cw-line-2);
    background: var(--cw-accent-soft);
}

@container cwdock (max-width: 120px) {
    .cw-app-card {
        display: none;
    }
}

/* Dílna jako list zdola (telefon, tablet, úzké okno): karta ne, instalace je v menu */
@media (max-width: 1199.98px) {
    .cw-dock .cw-app-card {
        display: none;
    }
}

/* Řádek v menu na telefonu */
.cw-app-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cw-line-2);
    border-radius: 12px;
    background: var(--cw-bg-2);
    color: var(--cw-text);
    font-family: 'Roboto', Arial, sans-serif;
    text-align: left;
    cursor: pointer;
}

.cw-app-row:hover,
.cw-app-row:focus-visible {
    border-color: var(--cw-accent);
    outline: none;
}

.cw-app-row-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cw-app-row .cw-app-title {
    font-size: 15px;
}

.cw-app-chev {
    width: 18px;
    height: 18px;
    color: var(--cw-accent);
    transform: rotate(-90deg);
}

/* Dialog s návodem (iPhone, iPad, Mac Safari) */
.cw-app-help {
    box-sizing: border-box;
    width: min(420px, calc(100vw - 32px));
    max-width: 100%;
    max-height: calc(100dvh - 32px);
    padding: 22px;
    border: 1px solid var(--cw-line-2);
    border-radius: 16px;
    background: var(--cw-bg);
    color: var(--cw-text);
    font-family: 'Roboto', Arial, sans-serif;
}

.cw-app-help[open] {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cw-app-help::backdrop {
    background: rgba(8, 7, 6, 0.6);
}

.cw-app-help.is-sheet {
    width: min(560px, 100%);
    margin: auto auto 0;
    padding-bottom: max(26px, env(safe-area-inset-bottom, 0px));
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
}

.cw-app-help-title {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
}

.cw-app-help-sub,
.cw-app-help-note {
    margin: 0;
    color: var(--cw-muted);
    font-size: 14px;
    line-height: 1.45;
}

.cw-app-help-note {
    padding-top: 10px;
    border-top: 1px solid var(--cw-line);
    font-size: 13px;
}

.cw-app-help-note[hidden] {
    display: none;
}

.cw-app-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: cwstep;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cw-app-steps li {
    counter-increment: cwstep;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    font-size: 15px;
    line-height: 1.45;
}

.cw-app-steps li::before {
    content: counter(cwstep);
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--cw-accent);
    color: var(--cw-accent-ink);
    font-size: 13px;
    font-weight: 900;
}

.cw-app-kbd {
    display: inline-block;
    padding: 1px 7px;
    border: 1px solid var(--cw-line-2);
    border-radius: 6px;
    background: var(--cw-bg-2);
    color: #ffffff;
    font: 600 14px/1.4 'Roboto', Arial, sans-serif;
    white-space: nowrap;
}

/* Obnova zapomenutého klíče v Moje dílně (host): odkaz pod polem pro klíč, vzhled ze .th-key-recover v calc_theme.css */
.cw-dock .th-key-recover-dock,
.th-pro-key .th-key-recover-dock {
    margin-top: 6px;
}

.cw-dock .th-key-recover-dock .th-key-recover-link,
.th-pro-key .th-key-recover-dock .th-key-recover-link {
    color: var(--cw-muted);
}

@media (hover: hover) {
    .cw-dock .th-key-recover-dock .th-key-recover-link:hover,
    .th-pro-key .th-key-recover-dock .th-key-recover-link:hover {
        color: var(--cw-accent);
    }
}

.cw-dock .th-key-recover-dock[open] .th-key-recover-link,
.th-pro-key .th-key-recover-dock[open] .th-key-recover-link {
    color: var(--cw-text);
}

.cw-dock .th-key-recover-dock .th-key-recover-desc,
.th-pro-key .th-key-recover-dock .th-key-recover-desc {
    color: var(--cw-muted);
}

/* Licenční klíč v nákupním bloku PRO (shared/pro_purchase_block.php): stejný prvek jako v Moje dílně, jen šířka podle bloku */
.license-key-wrapper .th-pro-key {
    width: 100%;
    max-width: 300px;
    margin: 6px auto 0;
    text-align: left;
}

.license-key-wrapper .th-pro-key > summary {
    width: max-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.th-pro-key .license-message {
    text-align: center;
}

/* --- Moje dřevo: sekce Moje zbytky / Řezivo, které kupuji a okno úpravy zbytků (calcwood_my_lumber.js) --- */
.cw-dock .cw-ml-sec {
    margin: 14px 0 6px;
    color: #b3b3b3;
    font: 600 12px/1.3 'Roboto', Arial, sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cw-dock .cw-ml-sec:first-child {
    margin-top: 2px;
}

.cw-ml-empty {
    margin: 0 0 10px;
    color: #b3b3b3;
    font-size: 13px;
    line-height: 1.45;
}

.cw-dock .cw-ml-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    margin-top: 8px;
}

.cw-dock .cw-ml-actions .cw-lumber-use {
    margin-top: 0;
}

.cw-ml-modal .cw-ml-box {
    width: min(620px, calc(100vw - 32px));
    box-sizing: border-box;
    padding: 30px 24px 24px;
    position: relative;
}

.cw-ml-hint {
    margin: 6px 0 16px;
    color: #b3b3b3;
    font-size: 14px;
    line-height: 1.45;
}

.cw-ml-row {
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) repeat(3, minmax(0, 1fr)) 40px;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.cw-ml-head {
    margin-bottom: 4px;
    color: #b3b3b3;
    font-size: 12px;
}

.cw-ml-in {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 0 8px;
    border: 1px solid #444;
    border-radius: 10px;
    background: #0d0d0d;
    color: #ffffff;
    font: 600 16px/1.2 'Roboto', Arial, sans-serif;
    text-align: center;
}

.cw-ml-in:focus {
    outline: none;
    border-color: #f9c343;
}

.cw-ml-in.is-bad {
    border-color: #f0a24a;
}

.cw-ml-del {
    width: 40px;
    height: 44px;
    border: 1px solid #444;
    border-radius: 10px;
    background: transparent;
    color: #b3b3b3;
    cursor: pointer;
}

.cw-ml-del svg {
    width: 18px;
    height: 18px;
}

.cw-ml-err {
    margin: 8px 0 0;
    color: #f0a24a;
    font-size: 14px;
}

.cw-ml-err[hidden] {
    display: none;
}

.cw-ml-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    margin-top: 18px;
}

.cw-ml-foot .cw-ml-save {
    min-width: 140px;
    border-color: #f9c343;
    background: #f9c343;
    color: #111111;
}

.cw-ml-foot .cw-ml-save:hover {
    background: #ffd56a;
    color: #111111;
}

@media (max-width: 520px) {
    .cw-ml-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-areas: "t w l" "q q d";
    }

    .cw-ml-row > [data-f="qty"] { grid-area: q; max-width: 120px; }
    .cw-ml-row > [data-f="t"] { grid-area: t; }
    .cw-ml-row > [data-f="w"] { grid-area: w; }
    .cw-ml-row > [data-f="l"] { grid-area: l; }
    .cw-ml-row > .cw-ml-del { grid-area: d; justify-self: end; }
    .cw-ml-row > .cw-ml-note-in { grid-area: n; }
    .cw-ml-rows .cw-ml-row { grid-template-areas: "t w l" "q q d" "n n n"; }
    .cw-ml-head { grid-template-areas: "t w l"; }
    .cw-ml-head > :nth-child(1), .cw-ml-head > :nth-child(5) { display: none; }
    .cw-ml-head > :nth-child(2) { grid-area: t; }
    .cw-ml-head > :nth-child(3) { grid-area: w; }
    .cw-ml-head > :nth-child(4) { grid-area: l; }
}

/* Poznámka ke zbytku: celý řádek pod rozměry, menší a vlevo */
.cw-ml-row > .cw-ml-note-in {
    grid-column: 1 / -1;
    min-height: 38px;
    margin-bottom: 6px;
    font: 400 14px/1.2 'Roboto', Arial, sans-serif;
    text-align: left;
}

.cw-ml-note {
    color: #b3b3b3;
    font-size: 12px;
}

/* Můj materiál: přepínač Řezivo | Deskový materiál a řádek desky v okně (Moje desky, calcwood_my_lumber.js) */
.cw-dock .cw-ml-kinds {
    margin: 0 0 10px;
}

.cw-dock .cw-ml-pane[hidden] {
    display: none;
}

/* Buňka pole v řádku okna Mých zbytků (bez Můj materiál) */
.cw-ml-cell {
    min-width: 0;
}

/* Ikonka položky v seznamu: průřez řeziva, deska v barvě druhu */
.cw-dock .cw-lumber-rows .cw-ml-ico {
    flex: none;
    margin-right: 8px;
    vertical-align: middle;
}

/* Okno Můj materiál (.cw-ml-v2): řádky z kalkulačky dřeva (th-lumber-grid, th-lumber-cell, th-lumber-input, th-lumber-prof-btn,
   th-lumber-del, th-lumber-add; vzhled v lumber/lumber_style.css), Formát desky stejné tlačítko jako Profil, texty
   a tlačítka z okna Uložit projekt (.th-save-project-*). Tady jen sloupce podle režimu okna a rozložení na telefonu. */
.cw-ml-modal.cw-ml-v2 .cw-ml-box {
    max-width: none;
    text-align: left;
}

/* telefon: šířku dává spodní panel .th-sheet (přes celou šířku) */
@media (min-width: 601px) {
    .cw-ml-modal.cw-ml-v2 .cw-ml-box {
        width: min(720px, calc(100vw - 2 * var(--th-space-4)));
    }
}

.cw-ml-modal.cw-ml-v2 .th-dialog-title,
.cw-ml-modal.cw-ml-v2 .th-save-project-modal-desc,
.cw-ml-modal.cw-ml-v2 .cw-ml-err {
    text-align: center;
}

.cw-ml-v2 .cw-ml-list {
    container: cwmllist / inline-size;
}

/* Profil / Formát | Ks (jen zbytky) | Tloušťka | Šířka | Délka | koš; hlavička má stejné sloupce (jako Řezivo k nákupu) */
.cw-ml-v2[data-mode] .cw-ml-line {
    grid-template-columns: 92px repeat(3, minmax(0, 1fr)) 36px;
    gap: var(--th-space-2);
    align-items: start;
}

.cw-ml-v2[data-mode="left"] .cw-ml-line,
.cw-ml-v2[data-mode="shl"] .cw-ml-line {
    grid-template-columns: 92px minmax(62px, 0.8fr) repeat(3, minmax(0, 1fr)) 36px;
}

.cw-ml-v2[data-mode] .cw-ml-line.th-lumber-grid-head {
    align-items: end;
}

/* Druhá drobná řádka: druh desky | vlákna | poznámka (u zbytků řeziva jen poznámka) */
.cw-ml-v2 .cw-ml-more {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr);
    gap: var(--th-space-2);
}

.cw-ml-v2[data-mode="left"] .cw-ml-more {
    grid-template-columns: minmax(0, 1fr);
}

.cw-ml-v2 .cw-ml-more > .th-input-group {
    margin: 0 !important;
}

/* desky mají druhou řádku, položky od sebe oddělí větší mezera */
.cw-ml-v2[data-mode^="sh"] .cw-ml-rows,
.cw-ml-v2[data-mode="left"] .cw-ml-rows {
    gap: var(--th-space-3);
}

.cw-ml-v2 .cw-ml-qlab {
    display: none;
}

.cw-ml-name-row {
    margin: 0 0 var(--th-space-2);
}

/* Telefon (jako Řezivo k nákupu v kalkulačce dřeva): Tloušťka | Šířka | Délka, pod nimi Profil / Formát, Ks a koš, pak druhá řádka */
@container cwmllist (max-width: 559px) {
    .cw-ml-v2[data-mode] .cw-ml-line {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-areas: "t w l" "p p d" "m m m";
    }

    .cw-ml-v2[data-mode="left"] .cw-ml-line,
    .cw-ml-v2[data-mode="shl"] .cw-ml-line {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-areas: "t w l" "p q d" "m m m";
    }

    .cw-ml-v2 .cw-ml-line > .th-lumber-cell-t { grid-area: t; }
    .cw-ml-v2 .cw-ml-line > .th-lumber-cell-w { grid-area: w; }
    .cw-ml-v2 .cw-ml-line > .th-lumber-cell-l { grid-area: l; }
    .cw-ml-v2 .cw-ml-line > .th-lumber-cell-prof { grid-area: p; }
    .cw-ml-v2 .cw-ml-line > .th-lumber-cell-qty { grid-area: q; }
    .cw-ml-v2 .cw-ml-line > .cw-ml-more { grid-area: m; }

    .cw-ml-v2 .cw-ml-line > .th-lumber-actions {
        grid-area: d;
        justify-self: end;
    }

    .cw-ml-v2 .cw-ml-line .th-lumber-del {
        width: 44px;
    }

    .cw-ml-v2[data-mode] .cw-ml-line.th-lumber-grid-head {
        grid-template-areas: "t w l";
    }

    .cw-ml-v2 .th-lumber-grid-head > .cw-ml-h-p,
    .cw-ml-v2 .th-lumber-grid-head > .cw-ml-h-q,
    .cw-ml-v2 .th-lumber-grid-head > :last-child {
        display: none;
    }

    .cw-ml-v2 .th-lumber-grid-head > .cw-ml-h-t { grid-area: t; }
    .cw-ml-v2 .th-lumber-grid-head > .cw-ml-h-w { grid-area: w; }
    .cw-ml-v2 .th-lumber-grid-head > .cw-ml-h-l { grid-area: l; }

    /* Ks bez sloupce v hlavičce: popisek přímo u pole */
    .cw-ml-v2 .th-lumber-cell-qty {
        display: flex;
        align-items: center;
        gap: var(--th-space-2);
    }

    .cw-ml-v2 .cw-ml-qlab {
        display: inline;
        color: #b3b3b3;
        font-size: var(--th-fs-xs);
    }

    /* bez Ks má tlačítko dva sloupce a dlouhý text („Vybrat profil“ jako v kalkulačce dřeva), s Ks krátký */
    .cw-ml-v2[data-mode="buy"] .th-lumber-prof-txt,
    .cw-ml-v2[data-mode="shb"] .th-lumber-prof-txt {
        display: none;
    }

    .cw-ml-v2[data-mode="buy"] .th-lumber-prof-txt-long,
    .cw-ml-v2[data-mode="shb"] .th-lumber-prof-txt-long {
        display: inline;
    }

    .cw-ml-v2 .cw-ml-more {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cw-ml-v2 .cw-ml-more > :nth-child(3) {
        grid-column: 1 / -1;
    }
}
