.tool-section {
    padding: 8px 0 10px;
    background: #f7f7f7;
}

.tool-layout {
    display: grid;
    gap: 28px;
}

.tool-card {
    background: var(--white);
    border: 1px solid var(--black);
    padding: 28px;
    box-shadow: 6px 6px 0 var(--yellow);
}

.tool-card__title {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.25;
}

.tool-card__text {
    margin: 0 0 22px;
    max-width: none;
    width: 100%;
    color: rgba(0, 0, 0, .68);
}

.tool-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 16px;
    align-items: start;
    margin-bottom: 4px;
}

.tool-form .form-group--float {
    margin-bottom: 0;
}

.tool-form .btn {
    min-width: 180px;
    height: 58px;
    margin-top: 0;
}

.tool-form .btn[disabled] {
    opacity: .65;
    pointer-events: none;
}

.tool-hint {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 13px;
    color: rgba(0, 0, 0, .55);
}

.tool-status {
    display: none;
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid var(--black);
    background: #fffdf0;
    font-weight: 600;
}

.tool-status.is-visible {
    display: block;
}

.tool-status.is-error {
    background: #fff5f5;
}

.tool-status.is-ok {
    background: #f4fff4;
}

.tool-progress {
    display: none;
    margin-top: 14px;
}

.tool-progress.is-visible {
    display: block;
}

.tool-progress__bar {
    position: relative;
    height: 14px;
    overflow: hidden;
    border: 1px solid var(--black);
    background: var(--white);
}

.tool-progress__fill {
    display: block;
    width: 0;
    height: 100%;
    background: var(--yellow);
    transition: width .6s ease;
}

.tool-progress.is-indeterminate .tool-progress__fill {
    width: 35% !important;
    transition: none;
    animation: tool-progress-slide 1.2s ease-in-out infinite;
}

.tool-progress__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    font-size: 14px;
    color: rgba(0, 0, 0, .68);
}

.tool-progress__percent {
    flex-shrink: 0;
    margin-left: 16px;
    padding-left: 4px;
    font-weight: 800;
    color: var(--black);
    white-space: nowrap;
}

@keyframes tool-progress-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(300%); }
}

@media (prefers-reduced-motion: reduce) {
    .tool-progress.is-indeterminate .tool-progress__fill {
        animation: none;
        width: 100% !important;
        opacity: .5;
    }
}

.tool-stats {
    display: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.tool-stats.is-visible {
    display: grid;
}

.tool-stat {
    border: 1px solid var(--black);
    padding: 16px;
    background: var(--white);
}

.tool-stat__value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
}

.tool-stat__label {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: rgba(0, 0, 0, .6);
}

.tool-stat--danger .tool-stat__value {
    color: #c1121f;
}

.tool-results {
    display: none;
}

.tool-results.is-visible {
    display: block;
}

.tool-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--black);
}

.tool-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.tool-table th,
.tool-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, .12);
    font-size: 14px;
    vertical-align: top;
}

.tool-table th {
    background: var(--black);
    color: var(--yellow);
    font-weight: 700;
}

.tool-table a {
    color: var(--black);
    word-break: break-all;
}

.tool-found-on__empty {
    color: rgba(0, 0, 0, .55);
}

.tool-found-on__count {
    margin-bottom: 8px;
    font-weight: 700;
}

.tool-found-on__list {
    display: grid;
    gap: 6px;
}

.tool-found-on.is-open .tool-found-on__list {
    max-height: 280px;
    overflow: auto;
}

.tool-found-on__rest {
    display: none;
    gap: 6px;
}

.tool-found-on.is-open .tool-found-on__rest {
    display: grid;
}

.tool-found-on__more {
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--black);
    font: inherit;
    font-weight: 700;
    text-align: left;
    text-decoration: underline;
    cursor: pointer;
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid var(--black);
    font-size: 12px;
    font-weight: 800;
    background: var(--yellow);
}

.tool-badge--danger {
    background: #ffd6d6;
}

.tool-empty {
    margin: 0;
    padding: 18px;
    border: 1px dashed var(--black);
    background: #fafafa;
}

.tool-note {
    margin: 0;
    font-size: 14px;
    color: rgba(0, 0, 0, .62);
}

@media (max-width: 991.98px) {
    .tool-stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767.98px) {
    .tool-card {
        padding: 20px;
        box-shadow: 4px 4px 0 var(--yellow);
    }

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

    .tool-form .btn {
        width: 100%;
    }

    .tool-stats {
        grid-template-columns: 1fr;
    }
}

html[data-theme="dark"] .tool-section {
    background: #111;
}

html[data-theme="dark"] .tool-card,
html[data-theme="dark"] .tool-stat {
    background: #1a1a1a;
    border-color: #3a3a3a;
}

html[data-theme="dark"] .tool-card__text,
html[data-theme="dark"] .tool-hint,
html[data-theme="dark"] .tool-stat__label,
html[data-theme="dark"] .tool-note {
    color: rgba(242, 242, 242, .7);
}

html[data-theme="dark"] .tool-status {
    background: #242018;
    border-color: #3a3a3a;
    color: #f2f2f2;
}

html[data-theme="dark"] .tool-progress__bar {
    background: #111;
    border-color: #3a3a3a;
}

html[data-theme="dark"] .tool-progress__meta {
    color: rgba(242, 242, 242, .7);
}

html[data-theme="dark"] .tool-progress__percent {
    color: #f2f2f2;
}

html[data-theme="dark"] .tool-status.is-error {
    background: #2a1515;
}

html[data-theme="dark"] .tool-status.is-ok {
    background: #142016;
}

html[data-theme="dark"] .tool-table th {
    background: #000;
}

html[data-theme="dark"] .tool-table td {
    border-bottom-color: #2e2e2e;
}

html[data-theme="dark"] .tool-badge {
    background: var(--yellow);
    color: #111;
    border-color: #f2f2f2;
}

html[data-theme="dark"] .tool-badge--danger {
    background: #c1121f;
    color: #fff;
    border-color: #ff8a8a;
}

html[data-theme="dark"] .tool-table a {
    color: #f2f2f2;
}

html[data-theme="dark"] .tool-found-on__empty {
    color: rgba(242, 242, 242, .55);
}

html[data-theme="dark"] .tool-found-on__count {
    color: #f2f2f2;
}

html[data-theme="dark"] .tool-found-on__more {
    color: var(--yellow);
}

html[data-theme="dark"] .tool-empty {
    background: #161616;
    border-color: #3a3a3a;
}
