/* Worksheet pages (canvases, frameworks, checklists). Loaded only where used. */
.ws {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
    font-family: var(--bt-font);
    color: var(--bt-ink-2);
    line-height: 1.6;
}
body.ws-page { background: var(--bt-bg); margin: 0; }

/* ---- Header ------------------------------------------------------------ */
.ws-eyebrow { margin: 0.5rem 0 0.35rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bt-muted); }
.ws h1 { margin: 0 0 0.5rem; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; letter-spacing: -0.02em; color: var(--bt-ink); }
.ws-tagline { margin: 0 0 1rem; font-size: 1.05rem; max-width: 46rem; }
.ws-facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0 0 1.25rem; padding: 0; list-style: none; font-size: 0.85rem; color: var(--bt-muted); }
.ws-facts strong { color: var(--bt-ink-2); font-weight: 600; }

/* ---- Guide / review / about ------------------------------------------- */
.ws details.ws-guide { margin-bottom: 1.25rem; }
.ws details.ws-guide, .ws details.ws-review {
    margin-top: 1.25rem; background: var(--bt-surface); border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius); padding: 0.75rem 1rem;
}
.ws details > summary { cursor: pointer; font-weight: 600; color: var(--bt-ink); }
.ws details > summary:focus-visible { outline: 2px solid var(--bt-accent); outline-offset: 3px; border-radius: 4px; }
.ws details ol, .ws details ul { margin: 0.75rem 0 0.25rem; padding-left: 1.25rem; }
.ws details li { margin-bottom: 0.35rem; }

/* ---- Toolbar ----------------------------------------------------------- */
.ws-toolbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem;
    margin: 0 -0.25rem 1.25rem; padding: 0.6rem 0.25rem;
    background: color-mix(in srgb, var(--bt-bg) 92%, transparent);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--bt-border);
}
.ws-progress { flex: 1 1 14rem; min-width: 12rem; }
.ws-progress-label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--bt-muted); margin-bottom: 0.25rem; }
.ws-progress-bar { height: 4px; background: var(--bt-border); border-radius: 2px; overflow: hidden; }
.ws-progress-bar > div { height: 100%; width: 0; background: var(--bt-accent); transition: width 0.25s ease; }
.ws-progress[data-complete="true"] .ws-progress-bar > div { background: var(--bt-success); }
.ws-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ws-btn {
    font: 600 0.8125rem var(--bt-font); padding: 0.5rem 0.85rem; border-radius: var(--bt-radius-sm);
    border: 1px solid var(--bt-border-strong); background: var(--bt-surface); color: var(--bt-ink); cursor: pointer; white-space: nowrap;
}
.ws-btn:hover { background: var(--bt-surface-2); }
.ws-btn:focus-visible { outline: 2px solid var(--bt-accent); outline-offset: 2px; }
.ws-btn.primary { background: var(--bt-ink); border-color: var(--bt-ink); color: var(--bt-on-ink); }
.ws-btn.primary:hover { background: var(--bt-ink-strong); }
.ws-menu { position: relative; }
.ws-menu > summary { list-style: none; }
.ws-menu > summary::-webkit-details-marker { display: none; }
.ws-menu-list {
    position: absolute; right: 0; top: calc(100% + 0.35rem); z-index: 30; min-width: 13rem;
    display: flex; flex-direction: column; padding: 0.35rem;
    background: var(--bt-surface); border: 1px solid var(--bt-border); border-radius: var(--bt-radius); box-shadow: var(--bt-shadow-lg);
}
.ws-menu-list button {
    text-align: left; font: 500 0.875rem var(--bt-font); padding: 0.5rem 0.65rem; border: 0; background: transparent;
    color: var(--bt-ink-2); border-radius: var(--bt-radius-sm); cursor: pointer;
}
.ws-menu-list button:hover { background: var(--bt-surface-2); color: var(--bt-ink); }
.ws-menu-list button.danger { color: var(--bt-danger); }
.ws-menu-list hr { border: 0; border-top: 1px solid var(--bt-border); margin: 0.25rem 0; width: 100%; }
.ws-status { font-size: 0.8rem; color: var(--bt-muted); min-width: 7.5rem; }
.ws-status[data-kind="warn"] { color: var(--bt-warning); font-weight: 600; }

.ws-banner {
    display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between;
    margin: 0 0 1.25rem; padding: 0.75rem 1rem; border-radius: var(--bt-radius);
    background: var(--bt-accent-soft); border: 1px solid #c7d7fb; color: var(--bt-accent-ink); font-size: 0.9rem;
}
.ws-banner[hidden] { display: none; }

/* ---- Meta fields -------------------------------------------------------- */
.ws-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.75rem 1rem; margin: 0 0 1.25rem; }
.ws-meta label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--bt-muted); margin-bottom: 0.25rem; }
.ws-meta input, .ws-meta select {
    width: 100%; box-sizing: border-box; font: inherit; padding: 0.55rem 0.75rem; color: var(--bt-ink);
    border: 1px solid var(--bt-border-strong); border-radius: var(--bt-radius-sm); background: var(--bt-surface);
}

/* ---- Sheet and sections ------------------------------------------------- */
.ws-sheet { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
.ws-sheet[data-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ws-sheet[data-columns="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ws-sec {
    display: flex; flex-direction: column; background: var(--bt-surface); border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius); padding: 0.9rem 1rem 0.7rem; min-width: 0;
    transition: border-color var(--bt-transition), box-shadow var(--bt-transition);
}
.ws-sec:focus-within { border-color: var(--bt-accent); box-shadow: 0 0 0 3px var(--bt-accent-soft); }
.ws-sec[data-filled="true"] .ws-num { background: var(--bt-ink); color: var(--bt-on-ink); border-color: var(--bt-ink); }
.ws-sec-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.2rem; }
.ws-num {
    flex: none; width: 1.5rem; height: 1.5rem; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 1px solid var(--bt-border-strong); font-size: 0.75rem; font-weight: 700; color: var(--bt-muted);
}
.ws-sec h2 { margin: 0; font-size: 1rem; line-height: 1.3; color: var(--bt-ink); }
.ws-sec h2 label { cursor: pointer; }
.ws-hint { margin: 0 0 0.5rem 2.1rem; font-size: 0.85rem; color: var(--bt-muted); }
.ws-sec textarea {
    flex: 1 1 auto; width: 100%; box-sizing: border-box; resize: vertical; min-height: 5.5rem;
    font: inherit; font-size: 0.95rem; line-height: 1.55; color: var(--bt-ink);
    padding: 0.6rem 0.7rem; background: var(--bt-bg); border: 1px solid var(--bt-border); border-radius: var(--bt-radius-sm);
}
.ws-sec textarea::placeholder { color: var(--bt-faint); }
.ws-sec textarea:focus { outline: none; background: var(--bt-surface); border-color: var(--bt-accent); }
.ws-sec-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-top: 0.4rem; min-height: 1.5rem; }
.ws-ex { font-size: 0.8rem; flex: 1; }
.ws-ex > summary { color: var(--bt-muted); font-weight: 500; }
.ws-ex[open] > summary { color: var(--bt-ink); }
.ws-ex ul { margin: 0.5rem 0 0.5rem; padding-left: 1.1rem; }
.ws-ex p { margin: 0.4rem 0; white-space: pre-line; color: var(--bt-ink-2); }
.ws-ex .ws-ex-label { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bt-muted); font-weight: 600; margin-top: 0.6rem; }
.ws-ex button { font: 600 0.75rem var(--bt-font); padding: 0.3rem 0.6rem; border: 1px solid var(--bt-border-strong); border-radius: var(--bt-radius-sm); background: var(--bt-surface); cursor: pointer; }
.ws-ex button:hover { background: var(--bt-surface-2); }
.ws-count { flex: none; font-size: 0.75rem; color: var(--bt-muted); font-variant-numeric: tabular-nums; }

/* Canvas layout: named areas on wide screens, single column below */
@media (min-width: 900px) {
    .ws-sheet[data-areas] { grid-template-columns: repeat(var(--ws-cols), minmax(0, 1fr)); grid-template-areas: var(--ws-areas); }
    .ws-sheet[data-areas] .ws-sec { grid-area: var(--ws-area); }
    .ws-sheet[data-areas] .ws-sec textarea { min-height: 7rem; }
}
@media (max-width: 720px) {
    .ws-sheet[data-columns="2"], .ws-sheet[data-columns="3"] { grid-template-columns: 1fr; }
}

/* Chained sections (e.g. 5 Whys): visual connector between steps */
.ws-sheet[data-chain="true"] .ws-sec + .ws-sec { position: relative; }
.ws-sheet[data-chain="true"] .ws-sec + .ws-sec::before {
    content: ""; position: absolute; left: 1.75rem; top: -0.75rem; height: 0.75rem; border-left: 2px solid var(--bt-border-strong);
}
.ws-sec[data-lead] .ws-lead { margin: 0 0 0.5rem 2.1rem; font-size: 0.85rem; color: var(--bt-accent-ink); background: var(--bt-accent-soft); border-radius: var(--bt-radius-sm); padding: 0.4rem 0.6rem; white-space: pre-line; }
.ws-sec[data-lead] .ws-lead[hidden] { display: none; }

/* ---- Content below the tool --------------------------------------------- */
.ws-about, .ws-reading, .ws-related { margin-top: 2.5rem; }
.ws-about h2, .ws-reading h2, .ws-related h2 { font-size: 1.15rem; color: var(--bt-ink); margin: 0 0 0.75rem; }
.ws-about p { max-width: 46rem; margin: 0 0 0.75rem; }
.ws-books { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.ws-books li { background: var(--bt-surface); border: 1px solid var(--bt-border); border-radius: var(--bt-radius); padding: 0.8rem 1rem; }
.ws-books a { color: var(--bt-ink); font-weight: 600; text-decoration: none; }
.ws-books a:hover { color: var(--bt-accent); text-decoration: underline; }
.ws-books .by { display: block; font-size: 0.8rem; color: var(--bt-muted); }
.ws-books p { margin: 0.35rem 0 0; font-size: 0.85rem; }
.ws-related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ws-related a { display: inline-block; padding: 0.4rem 0.8rem; border: 1px solid var(--bt-border-strong); border-radius: 999px; color: var(--bt-ink-2); font-size: 0.85rem; text-decoration: none; background: var(--bt-surface); }
.ws-related a:hover { border-color: var(--bt-accent); color: var(--bt-accent); }

/* ---- Print / image export mirror ---------------------------------------- */
.ws-print { display: none; }
.ws-print--offscreen { display: block; position: fixed; left: -10000px; top: 0; width: 960px; background: #fff; }
.ws-print { color: #111; font-family: var(--bt-font); padding: 1.5rem; }
.ws-print h1 { font-size: 1.6rem; margin: 0 0 0.25rem; color: #111; }
.ws-print .ws-print-meta { margin: 0 0 1rem; color: #52525b; font-size: 0.9rem; }
.ws-print-grid { display: grid; gap: 0.6rem; }
.ws-print-sec { border: 1px solid #a1a1aa; border-radius: 6px; padding: 0.6rem 0.8rem; break-inside: avoid; min-height: var(--ws-print-min, 5rem); }
.ws-print-sec h3 { margin: 0 0 0.3rem; font-size: 0.9rem; color: #111; }
.ws-print-sec .txt { white-space: pre-wrap; font-size: 0.9rem; line-height: 1.5; overflow-wrap: anywhere; }
.ws-print-foot { margin: 1rem 0 0; font-size: 0.75rem; color: #71717a; }

@media print {
    body.ws-page { background: #fff; }
    .ws > *:not(.ws-print) { display: none !important; }
    .ws { padding: 0; max-width: none; }
    .ws-print { display: block; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ws-progress-bar > div, .ws-sec { transition: none; }
}

.ws-sec[data-accent] { border-left: 4px solid var(--ws-accent); }
.ws-sheet[data-areas] .ws-hint { margin-left: 0; }

/* ---- Wide sections (scale, board, grid) --------------------------------- */
.ws-sec--wide { grid-column: 1 / -1; }
.ws-sec--wide .ws-hint { margin-left: 2.1rem; }

/* ---- Scale ----------------------------------------------------------------- */
.ws-scale-key { display: flex; justify-content: space-between; margin: 0.25rem 0 0.5rem 0; font-size: 0.75rem; color: var(--bt-muted); }
.ws-scale-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.7rem 0; border-top: 1px solid var(--bt-border); }
.ws-scale-label { flex: 1 1 18rem; color: var(--bt-ink); font-size: 0.95rem; }
.ws-scale-opts { display: inline-flex; gap: 0.35rem; }
.ws-scale-opts label { position: relative; }
.ws-scale-opts input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ws-scale-opts span { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border: 1px solid var(--bt-border-strong); border-radius: var(--bt-radius-sm); font-weight: 600; color: var(--bt-ink-2); background: var(--bt-surface); cursor: pointer; }
.ws-scale-opts input:hover + span { border-color: var(--bt-ink); }
.ws-scale-opts input:checked + span { background: var(--bt-ink); border-color: var(--bt-ink); color: var(--bt-on-ink); }
.ws-scale-opts input:focus-visible + span { outline: 2px solid var(--bt-accent); outline-offset: 2px; }

/* ---- Board ------------------------------------------------------------------ */
.ws-board { display: grid; gap: 0.75rem; grid-template-columns: repeat(var(--ws-bcols, 2), minmax(0, 1fr)); margin-top: 0.5rem; }
@media (min-width: 900px) { .ws-board[data-areas] { grid-template-areas: var(--ws-bareas); } .ws-board[data-areas] .ws-col { grid-area: var(--ws-area); } }
@media (max-width: 720px) { .ws-board { grid-template-columns: 1fr; } }
.ws-col { background: var(--bt-bg); border: 1px solid var(--bt-border); border-radius: var(--bt-radius); padding: 0.7rem 0.8rem; min-width: 0; display: flex; flex-direction: column; }
.ws-col[data-accent] { border-top: 3px solid var(--ws-accent); }
.ws-col.is-over { border-color: var(--bt-accent); background: var(--bt-accent-soft); }
.ws-col h3 { margin: 0; font-size: 0.9rem; color: var(--bt-ink); }
.ws-col h3::after { content: " " attr(data-count); color: var(--bt-muted); font-weight: 400; }
.ws-col-hint { margin: 0.15rem 0 0.5rem; font-size: 0.78rem; color: var(--bt-muted); }
.ws-items { list-style: none; margin: 0.4rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; min-height: 1.5rem; flex: 1; }
.ws-item { display: flex; align-items: center; gap: 0.35rem; background: var(--bt-surface); border: 1px solid var(--bt-border); border-radius: var(--bt-radius-sm); padding: 0.25rem 0.35rem; }
.ws-item.is-dragging { opacity: 0.45; }
.ws-item[draggable="true"] { cursor: grab; }
.ws-item-text { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 0.9rem; color: var(--bt-ink); padding: 0.25rem 0.3rem; }
.ws-item-text:focus { outline: 2px solid var(--bt-accent); outline-offset: -1px; border-radius: 4px; background: var(--bt-surface); }
.ws-item select { font: inherit; font-size: 0.78rem; color: var(--bt-ink-2); border: 1px solid var(--bt-border-strong); border-radius: 4px; background: var(--bt-surface); padding: 0.15rem 0.2rem; max-width: 6.5rem; }
.ws-item-tools { display: inline-flex; align-items: center; gap: 0.2rem; opacity: 0.85; }
.ws-item:hover .ws-item-tools, .ws-item:focus-within .ws-item-tools { opacity: 1; }
.ws-icon { font: 600 0.95rem/1 var(--bt-font); width: 1.6rem; height: 1.6rem; border: 0; border-radius: 4px; background: transparent; color: var(--bt-muted); cursor: pointer; }
.ws-icon:hover { background: var(--bt-surface-2); color: var(--bt-ink); }
.ws-icon:focus-visible, .ws-item select:focus-visible { outline: 2px solid var(--bt-accent); outline-offset: 1px; }
.ws-add { display: flex; gap: 0.4rem; }
.ws-add input { flex: 1; min-width: 0; font: inherit; font-size: 0.875rem; padding: 0.4rem 0.6rem; border: 1px solid var(--bt-border-strong); border-radius: var(--bt-radius-sm); background: var(--bt-surface); color: var(--bt-ink); }
.ws-add input:focus { outline: 2px solid var(--bt-accent); outline-offset: -1px; }
.ws-poolwrap { margin-top: 0.75rem; }
.ws-col--pool { background: var(--bt-surface-2); }
.ws-col--pool .ws-items { flex-direction: row; flex-wrap: wrap; }
.ws-col--pool .ws-item { flex: 0 1 auto; }
.ws-col--pool .ws-item-text { width: 9rem; flex: none; }

/* ---- Grid ------------------------------------------------------------------- */
.ws-gridwrap { overflow-x: auto; margin-top: 0.5rem; border: 1px solid var(--bt-border); border-radius: var(--bt-radius); background: var(--bt-surface); }
.ws-gridwrap:focus-visible { outline: 2px solid var(--bt-accent); outline-offset: 2px; }
.ws-grid { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
.ws-grid th, .ws-grid td { border-bottom: 1px solid var(--bt-border); border-right: 1px solid var(--bt-border); padding: 0.4rem; vertical-align: top; text-align: left; }
.ws-grid tr > :last-child { border-right: 0; }
.ws-grid tbody tr:last-child > * { border-bottom: 0; }
.ws-grid thead th { background: var(--bt-surface-2); color: var(--bt-ink); font-weight: 600; white-space: nowrap; }
.ws-grid tbody th { background: var(--bt-surface-2); color: var(--bt-ink); font-weight: 600; min-width: 9rem; position: sticky; left: 0; z-index: 1; }
.ws-grid th small { display: block; font-weight: 400; color: var(--bt-muted); font-size: 0.75rem; white-space: normal; }
.ws-grid td { min-width: 9.5rem; }
.ws-grid textarea, .ws-grid select, .ws-grid th input { width: 100%; box-sizing: border-box; font: inherit; font-size: 0.85rem; color: var(--bt-ink); border: 1px solid transparent; border-radius: 4px; background: transparent; padding: 0.3rem 0.4rem; resize: none; }
.ws-grid textarea { min-height: 3.2rem; }
.ws-grid textarea:hover, .ws-grid select:hover, .ws-grid th input:hover { border-color: var(--bt-border-strong); }
.ws-grid textarea:focus, .ws-grid select:focus, .ws-grid th input:focus { outline: none; border-color: var(--bt-accent); background: var(--bt-surface); }
.ws-grid th .ws-icon { position: absolute; right: 0.15rem; top: 0.15rem; opacity: 0; }
.ws-grid th { position: relative; }
.ws-grid th:hover .ws-icon, .ws-grid th:focus-within .ws-icon { opacity: 1; }
.ws-grid th input { padding-right: 1.6rem; }
.ws-grid select[data-opt="1"] { background: #dcfce7; } .ws-grid select[data-opt="2"] { background: #dbeafe; }
.ws-grid select[data-opt="3"] { background: #fee2e2; } .ws-grid select[data-opt="4"] { background: #fef3c7; } .ws-grid select[data-opt="5"] { background: #ede9fe; }
/* Longer option lists reuse the five tints so dark text always sits on a light fill */
.ws-grid select[data-opt="6"] { background: #dcfce7; } .ws-grid select[data-opt="7"] { background: #dbeafe; } .ws-grid select[data-opt="8"] { background: #fee2e2; } .ws-grid select[data-opt="9"] { background: #fef3c7; } .ws-grid select[data-opt="10"] { background: #ede9fe; } .ws-grid select[data-opt="11"] { background: #dcfce7; } .ws-grid select[data-opt="12"] { background: #dbeafe; } .ws-grid select[data-opt="13"] { background: #fee2e2; } .ws-grid select[data-opt="14"] { background: #fef3c7; } .ws-grid select[data-opt="15"] { background: #ede9fe; }
.ws-grid-actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.ws-grid-actions:empty { display: none; }

/* ---- Summary ----------------------------------------------------------------- */
.ws-summary { margin-top: 1rem; background: var(--bt-surface); border: 1px solid var(--bt-border); border-radius: var(--bt-radius); padding: 1rem 1.1rem; }
.ws-summary h2 { margin: 0 0 0.5rem; font-size: 1rem; color: var(--bt-ink); }
.ws-sum-rows { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1.25rem; margin: 0 0 0.5rem; font-size: 0.9rem; }
.ws-sum-rows dt { color: var(--bt-muted); }
.ws-sum-rows dd { margin: 0; color: var(--bt-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.ws-sum-line { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--bt-warning); }
.ws-sum-bar { height: 6px; background: var(--bt-border); border-radius: 3px; overflow: hidden; margin: 0.4rem 0 0.6rem; }
.ws-sum-bar > div { height: 100%; background: var(--bt-accent); }
.ws-sum-note { margin: 0; font-size: 0.9rem; }

/* ---- Print mirror: composite parts ------------------------------------------- */
.ws-print-list { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; }
.ws-print-cols { display: grid; gap: 0.75rem; }
.ws-print-col h4 { margin: 0 0 0.25rem; font-size: 0.85rem; }
.ws-print-table { border-collapse: collapse; width: 100%; font-size: 0.8rem; }
.ws-print-table th, .ws-print-table td { border: 1px solid #a1a1aa; padding: 0.3rem 0.4rem; vertical-align: top; text-align: left; white-space: pre-wrap; }
.ws-print-table th { background: #f4f4f5; }
.ws-print-summary { margin-top: 0.6rem; }
@media print { .ws-grid-actions { display: none; } }
.ws-col--pool .ws-item { padding: 0.15rem 0.3rem; }
.ws-col--pool .ws-item-text { width: 7.5rem; }
.ws-col--pool .ws-item select { max-width: 5rem; }
.ws-col--pool .ws-item-tools { opacity: 1; }
.ws-quick { font-size: 1.1rem; color: var(--bt-accent); }
@media (max-width: 720px) { .ws-col--pool .ws-item { flex: 1 1 100%; } .ws-col--pool .ws-item-text { width: auto; flex: 1; } .ws-col--pool .ws-item select { max-width: 7rem; } }
.ws-poolwrap, .ws-col--pool, .ws-items { min-width: 0; max-width: 100%; }
.ws-item { min-width: 0; }
@media (max-width: 720px) { .ws-col--pool .ws-item-text { min-width: 0; width: 100%; } .ws-item-text { min-width: 0; } }

/* ---- Inputs (calculators) ------------------------------------------------------ */
.ws-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.9rem 1.25rem; margin-top: 0.4rem; }
.ws-input label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--bt-ink); margin-bottom: 0.25rem; }
.ws-input-box { display: flex; align-items: center; border: 1px solid var(--bt-border-strong); border-radius: var(--bt-radius-sm); background: var(--bt-surface); }
.ws-input-box:focus-within { border-color: var(--bt-accent); outline: 2px solid var(--bt-accent-soft); }
.ws-input-box input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1rem; padding: 0.55rem 0.7rem; color: var(--bt-ink); font-variant-numeric: tabular-nums; }
.ws-input-box input:focus { outline: none; }
.ws-unit { padding: 0 0.7rem; color: var(--bt-muted); font-size: 0.85rem; border-left: 1px solid var(--bt-border); align-self: stretch; display: inline-flex; align-items: center; background: var(--bt-surface-2); border-radius: 0 var(--bt-radius-sm) var(--bt-radius-sm) 0; }
.ws-input small { display: block; margin-top: 0.2rem; font-size: 0.75rem; color: var(--bt-muted); }
.ws-sec--inputs .ws-sec-foot { margin-top: 0.75rem; }

/* ---- Result cards --------------------------------------------------------------- */
.ws-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 0.6rem; margin-bottom: 0.9rem; }
.ws-kpi { background: var(--bt-surface-2); border-radius: var(--bt-radius); padding: 0.7rem 0.9rem; border-left: 3px solid var(--bt-border-strong); }
.ws-kpi-label { display: block; font-size: 0.75rem; color: var(--bt-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ws-kpi strong { display: block; font-size: 1.45rem; color: var(--bt-ink); font-variant-numeric: tabular-nums; line-height: 1.25; }
.ws-kpi small { display: block; font-size: 0.75rem; color: var(--bt-muted); }
.ws-kpi.is-good { border-left-color: var(--bt-success); } .ws-kpi.is-good strong { color: var(--bt-success); }
.ws-kpi.is-bad { border-left-color: var(--bt-danger); } .ws-kpi.is-bad strong { color: var(--bt-danger); }
.ws-kpi.is-warn { border-left-color: var(--bt-warning); } .ws-kpi.is-warn strong { color: var(--bt-warning); }
.ws-sum-note.is-good { color: var(--bt-success); } .ws-sum-note.is-bad { color: var(--bt-danger); } .ws-sum-note.is-warn { color: var(--bt-warning); }
.ws-sum-bars { display: grid; gap: 0.45rem; margin: 0 0 0.8rem; }
.ws-sum-bar-row { display: grid; grid-template-columns: minmax(6rem, 11rem) 1fr max-content; gap: 0.75rem; align-items: center; font-size: 0.875rem; }
.ws-sum-bar-row b { font-variant-numeric: tabular-nums; color: var(--bt-ink); }
.ws-sum-track { height: 10px; background: var(--bt-border); border-radius: 5px; overflow: hidden; }
.ws-sum-track > div { height: 100%; background: var(--bt-accent); }
.ws-sum-track > div.is-good { background: var(--bt-success); } .ws-sum-track > div.is-bad { background: var(--bt-danger); } .ws-sum-track > div.is-warn { background: var(--bt-warning); }
.ws-sum-tablewrap { overflow-x: auto; margin: 0 0 0.8rem; }
.ws-sum-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.ws-sum-table th, .ws-sum-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--bt-border); text-align: right; }
.ws-sum-table th:first-child, .ws-sum-table td:first-child { text-align: left; }
.ws-sum-table thead th { color: var(--bt-muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.ws-sum-table tbody th { font-weight: 500; color: var(--bt-ink); }
.ws-sum-table tr.is-hl th, .ws-sum-table tr.is-hl td { background: var(--bt-accent-soft); }
@media (max-width: 720px) { .ws-sum-bar-row { grid-template-columns: 1fr max-content; } .ws-sum-bar-row .ws-sum-track { grid-column: 1 / -1; order: 3; } }
.ws-sec[data-nonum] .ws-hint { margin-left: 0; }

.ws-chartwrap { margin: 0.4rem 0 1rem; background: #ffffff; border: 1px solid var(--bt-border); border-radius: var(--bt-radius); padding: 0.5rem; }
.ws-chart text { user-select: none; }
.ws-grid td input { width: 100%; box-sizing: border-box; font: inherit; font-size: 0.85rem; color: var(--bt-ink); border: 1px solid transparent; border-radius: 4px; background: transparent; padding: 0.3rem 0.4rem; font-variant-numeric: tabular-nums; }
.ws-grid td input:hover { border-color: var(--bt-border-strong); }
.ws-grid td input:focus { outline: none; border-color: var(--bt-accent); background: var(--bt-surface); }
.ws-grid td input[type="number"] { text-align: right; }
@media (max-width: 720px) { .ws-scale-opts { flex-wrap: wrap; } .ws-scale-opts span { width: 2.1rem; height: 2.1rem; } }

/* Board limits */
.ws-limit { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; color: var(--bt-muted); margin: 0 0 0.35rem; }
.ws-limit input { width: 3.2rem; font: inherit; font-size: 0.8rem; padding: 0.15rem 0.3rem; border: 1px solid var(--bt-border-strong); border-radius: 4px; background: var(--bt-surface); color: var(--bt-ink); }
.ws-col.is-over { border-color: var(--bt-danger); background: var(--bt-danger-soft); }
.ws-col.is-over h3::after { color: var(--bt-danger); font-weight: 700; }
.ws-grid td input[type="date"] { min-width: 8.5rem; }

.ws-grid select[data-opt] { color: #18181b; }
.ws-grid select[data-opt="0"], .ws-grid select:not([data-opt]) { color: var(--bt-ink); }

.ws-grid--compact td { min-width: 0; padding: 0.1rem; text-align: center; }
.ws-grid--compact thead th { padding: 0.3rem 0; text-align: center; font-size: 0.7rem; min-width: 1.5rem; }
.ws-grid--compact tbody th { min-width: 10.5rem; }
.ws-grid--compact tbody th input { padding-right: 1.4rem; }
.ws-grid--compact input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: var(--bt-success); cursor: pointer; }
.ws-grid td.ws-off { background: var(--bt-surface-2); }
