.wb-tabs {
    display:flex;
    flex-wrap:wrap;
    gap:4px;
    border-bottom:1px solid var(--tg-line);
    margin:0 0 28px}
.wb-tabs button {
    border:0;
    background:none;
    color:var(--tg-muted);
    padding:12px 16px;
    min-height:48px;
    font:inherit;
    border-bottom:3px solid transparent}
.wb-tabs button[aria-pressed=true] {
    border-color:var(--tg-accent);
    color:var(--tg-accent);
    font-weight:600}
.wb-grid {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:40px}
.wb-grid>* {
    min-width:0}
.wb-fields {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:18px}
.wb-fields .tool-field {
    margin:0}
.wb-wide {
    grid-column:1/-1}
.wb-note {
    color:var(--tg-muted);
    font-size:.875rem;
    line-height:1.55}
.wb-actions {
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    align-items:center;
    margin:20px 0}
.wb-primary {
    background:var(--tg-accent)!important;
    color:white!important;
    border-color:var(--tg-accent)!important}
.wb-table-wrap {
    overflow:auto;
    max-width:100%;
    border:1px solid var(--tg-line);
    border-radius:12px}
.wb-table {
    width:100%;
    border-collapse:collapse;
    font-size:.9375rem}
.wb-table th,.wb-table td {
    text-align:left;
    padding:15px 18px;
    border-bottom:1px solid var(--tg-line);
    vertical-align:top}
.wb-table th {
    background:var(--tg-wash);
    font-weight:500}
.wb-table td code {
    overflow-wrap:anywhere}
.wb-table tr:last-child td {
    border:0}
.wb-metric {
    font-size:2.5rem;
    line-height:1.2;
    margin:14px 0;
    font-weight:600;
    font-variant-numeric:tabular-nums}
.wb-stat-list {
    margin:22px 0 0}
.wb-stat-list div {
    display:flex;
    justify-content:space-between;
    gap:24px;
    padding:13px 0;
    border-top:1px solid var(--tg-line)}
.wb-stat-list dt {
    font-weight:400;
    color:var(--tg-muted)}
.wb-stat-list dd {
    margin:0;
    font-weight:600;
    text-align:right}
.wb-status {
    display:inline-flex;
    background:#e6f3ec;
    color:#226547;
    border-radius:6px;
    padding:3px 8px;
    font-size:.8125rem}
.wb-status.warn {
    background:#fff1d3;
    color:#785017}
.wb-status.bad {
    background:#fde8eb;
    color:#a32233}
.wb-issues {
    list-style:none;
    padding:0;
    margin:20px 0}
.wb-issues li {
    padding:16px 0;
    border-top:1px solid var(--tg-line)}
.wb-issues strong {
    display:block;
    margin:5px 0}
.wb-issues p {
    margin:0;
    font-size:.9375rem;
    color:var(--tg-muted)}
.wb-url {
    overflow-wrap:anywhere;
    font-size:.9375rem;
    line-height:1.6;
    background:white;
    border:1px solid var(--tg-line);
    border-radius:8px;
    padding:16px}
.wb-funnel {
    display:grid;
    grid-template-columns:repeat(5,1fr);
    margin:24px 0;
    border-block:1px solid var(--tg-line)}
.wb-funnel div {
    padding:18px 14px}
.wb-funnel span {
    display:block;
    color:var(--tg-muted);
    font-size:.875rem}
.wb-funnel strong {
    display:block;
    font-size:1.5rem;
    font-weight:600;
    margin-top:6px}
.wb-results {
    margin-top:32px}
.wb-results h2 {
    margin-bottom:18px}
.wb-chain {
    list-style:none;
    counter-reset:step;
    padding:0}
.wb-chain li {
    counter-increment:step;
    position:relative;
    padding:0 0 28px 48px;
    overflow-wrap:anywhere}
.wb-chain li:before {
    content:counter(step);
    position:absolute;
    left:0;
    width:30px;
    height:30px;
    display:grid;
    place-items:center;
    background:var(--tg-wash);
    border:1px solid var(--tg-line);
    border-radius:50%;
    font-size:14px}
.wb-chain p {
    margin:8px 0}
.wb-chain small {
    color:var(--tg-muted)}
.wb-compare td:not(:first-child),.wb-compare th:not(:first-child) {
    text-align:right;
    font-variant-numeric:tabular-nums}
.wb-compare th:nth-child(3),.wb-compare td:nth-child(3) {
    background:#eef3fe}

/* Shared workbench extensions keep the established tool shell and tokens. */
.tool-page [hidden]  {
     display: none !important;
     }

.tool-page .wb-section  {
     margin-top: 28px;
     }

.tool-page fieldset.wb-section  {
     border: 0;
     padding: 0;
     }

.tool-page .wb-section legend  {
     float: none;
     width: auto;
     font-size: 1.25rem;
     font-weight: 600;
     margin-bottom: 18px;
     }

.wb-note  {
     max-width: 75ch;
     }

.wb-error  {
     color: #a32233;
     font-size: .875rem;
     line-height: 1.5;
     margin: 8px 0;
     }

.wb-error:empty  {
     display: none;
     }

.wb-url-wrap  {
     overflow-wrap: anywhere;
     min-width: 0;
     }

.wb-check, .wb-check label  {
     display: inline-flex;
     align-items: center;
     gap: 8px;
     min-height: 44px;
     }

.tool-page .wb-check input[type=checkbox], .tool-page .wb-table input[type=checkbox]  {
     width: 18px;
     height: 18px;
     min-height: 18px;
     flex: 0 0 18px;
     accent-color: var(--tg-accent);
     }

.wb-table td:first-child label  {
     display: inline-flex;
     align-items: center;
     justify-content: center;
     min-width: 44px;
     min-height: 44px;
     }

.wb-table caption  {
     caption-side: top;
     padding: 12px 18px;
     color: var(--tg-muted);
     }

.wb-stat-list div  {
     display: grid;
     grid-template-columns: minmax(0,1fr) auto;
     gap: 16px;
     }

.wb-stat-list dd  {
     white-space: nowrap;
     font-variant-numeric: tabular-nums;
     }

.wb-status.neutral  {
     background: #e8edf5;
     color: var(--tg-ink);
     }

.wb-scenario-mobile  {
     display: none;
     }

.wb-tabs button, .wb-actions button  {
     touch-action: manipulation;
     }

.wb-tabs button:focus-visible, .wb-actions button:focus-visible  {
     outline: 3px solid var(--tg-accent);
     outline-offset: 3px;
     }

.wb-tabs button:active  {
     background: var(--tg-wash);
     }

.wb-primary:disabled  {
     opacity: .48;
     }

.wb-tabs  {
     scroll-margin-top: 24px;
     }

@media (hover:hover) and (pointer:fine)  {

 .wb-tabs button:hover  {
     color: var(--tg-accent);
     background: var(--tg-wash);
     }

 .tool-page .wb-primary:hover  {
     background: #1044b0 !important;
     }

}

@media (max-width: 760px)  {

 .wb-grid  {
     grid-template-columns: minmax(0,1fr);
     gap: 28px;
     }

 .wb-fields  {
     grid-template-columns: minmax(0,1fr);
     }

 .wb-funnel  {
     grid-template-columns: repeat(2,minmax(0,1fr));
     }

 .wb-funnel div  {
     padding: 14px 8px;
     }

 .wb-funnel strong  {
     font-size: 1.25rem;
     overflow-wrap: anywhere;
     }

 .wb-metric  {
     font-size: 2rem;
     overflow-wrap: anywhere;
     }

 .wb-tabs button  {
     padding: 11px;
     }

 .wb-stat-list div  {
     gap: 10px;
     }

 .wb-stat-list dd  {
     font-size: .9375rem;
     }

 .wb-compare  {
     display: none;
     }

 .wb-scenario-mobile  {
     display: block;
     padding: 20px;
     }

 .wb-scenario-mobile section + section  {
     border-top: 1px solid var(--tg-line);
     margin-top: 24px;
     padding-top: 24px;
     }

 .wb-scenario-mobile h3  {
     font-size: 1.125rem;
     }

 .wb-batch-table, .wb-batch-table tbody, .wb-batch-table tr  {
     display: block;
     min-width: 0;
     }

 .wb-batch-table thead  {
     display: none;
     }

 .wb-batch-table tr  {
     padding: 14px 16px;
     border-bottom: 1px solid var(--tg-line);
     }

 .wb-batch-table td  {
     display: block;
     padding: 6px 0;
     border: 0;
     overflow-wrap: anywhere;
     }

 .wb-batch-table td:first-child, .wb-batch-table td:nth-child(2)  {
     display: inline-block;
     margin-right: 10px;
     }

 .wb-batch-table td:nth-child(2)::before  {
     content: 'Строка ';
     }

}

@media (max-width: 360px)  {

 .wb-stat-list div  {
     grid-template-columns: minmax(0,1fr);
     gap: 5px;
     }

 .wb-stat-list dd  {
     text-align: left;
     }

}


.wb-chain details > summary  {
     min-height: 44px;
     padding-block: 10px;
     cursor: pointer;
     }

.tool-page [data-wb-policy-form] fieldset  {
     margin: 0 0 20px;
     padding: 0;
     border: 0;
     }

.tool-page [data-wb-policy-form] legend  {
     float: none;
     font-size: .9375rem;
     font-weight: 600;
     margin-bottom: 8px;
     }

.wb-metric.wb-metric--compact {
    font-size: 1.125rem;
    overflow-wrap: normal;
    word-break: normal;
}
.wb-scenario-mobile details > summary {
    min-height: 44px;
    padding-block: 10px;
    cursor: pointer;
}
.wb-grid {
    align-items: start;
}
.tool-page .tool-input-heading .wb-actions {
    margin: 0;
}
.wb-grid > form > .wb-section:first-child {
    margin-top: 0;
}
.tool-page [data-finance-example-note],
.tool-page [data-finance-undo-example] {
    display: inline-block;
    margin: 0 12px 16px 0;
}
.wb-grid details > summary,
[data-finance-calculator] details > summary {
    min-height: 44px;
    padding-block: 10px;
    cursor: pointer;
}
