.tsa-tool {
    --tsa-ink: #172033;
    --tsa-muted: #667085;
    --tsa-line: #d9e2ee;
    --tsa-soft: #f5f8fb;
    --tsa-card: #ffffff;
    --tsa-primary: #0f6fb5;
    --tsa-primary-dark: #0a4f82;
    --tsa-accent: #0d9488;
    --tsa-success: #12805c;
    --tsa-warn: #b7791f;
    --tsa-danger: #d64545;
    --tsa-shadow: 0 18px 44px rgba(27, 45, 74, .10);
    color: var(--tsa-ink);
    width: 100%;
}

.tsa-tool * {
    box-sizing: border-box;
}

.tsa-tool button,
.tsa-tool input,
.tsa-tool select {
    font: inherit;
}

.tsa-shell {
    display: grid;
    gap: 16px;
}

.tsa-guide {
    display: grid;
    grid-template-columns: 1fr minmax(250px, .42fr);
    gap: 14px;
}

.tsa-guide-main,
.tsa-guide-side,
.tsa-panel {
    border: 1px solid var(--tsa-line);
    border-radius: 8px;
    background: var(--tsa-card);
    box-shadow: var(--tsa-shadow);
}

.tsa-guide-main {
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(15, 111, 181, .10), rgba(13, 148, 136, .08)),
        #fff;
}

.tsa-guide-main strong {
    display: block;
    margin-bottom: 8px;
    font-size: 20px;
    line-height: 1.35;
}

.tsa-guide-main p {
    margin: 0 0 14px;
    color: var(--tsa-muted);
    line-height: 1.7;
}

.tsa-guide-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.tsa-guide-chips span {
    border: 1px solid rgba(15, 111, 181, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    color: var(--tsa-primary-dark);
    padding: 7px 11px;
    font-size: 13px;
    font-weight: 800;
}

.tsa-guide-side {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
}

.tsa-guide-side div {
    display: grid;
    align-content: center;
    gap: 6px;
    min-height: 118px;
    padding: 16px;
    text-align: center;
    border-left: 1px solid #edf1f6;
}

.tsa-guide-side div:first-child {
    border-left: 0;
}

.tsa-guide-side span {
    color: var(--tsa-muted);
    font-size: 12px;
    font-weight: 700;
}

.tsa-guide-side b {
    color: var(--tsa-primary-dark);
    font-size: 24px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.tsa-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.tsa-tab {
    min-height: 64px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--tsa-line);
    border-radius: 8px;
    background: #fff;
    color: #132f4c;
    text-align: left;
    padding: 12px;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.tsa-tab:hover {
    border-color: rgba(15, 111, 181, .42);
    transform: translateY(-1px);
}

.tsa-tab.is-active {
    border-color: var(--tsa-primary);
    background: linear-gradient(180deg, #fff, #eef7fc);
    box-shadow: 0 10px 24px rgba(15, 111, 181, .14);
}

.tsa-tab-index {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e8f2fb;
    color: var(--tsa-primary-dark);
    font-weight: 900;
}

.tsa-tab.is-active .tsa-tab-index {
    background: var(--tsa-primary);
    color: #fff;
}

.tsa-tab b {
    display: block;
    color: #102a43;
    font-size: 15px;
}

.tsa-tab small {
    display: block;
    margin-top: 3px;
    color: var(--tsa-muted);
    font-size: 12px;
}

.tsa-panel {
    padding: 18px;
}

.tsa-step {
    display: none;
}

.tsa-step.is-active {
    display: grid;
    gap: 16px;
}

.tsa-step-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf1f6;
}

.tsa-step-head h3 {
    margin: 0 0 6px;
    font-size: 18px;
    line-height: 1.3;
}

.tsa-step-head p {
    margin: 0;
    color: var(--tsa-muted);
    font-size: 13px;
    line-height: 1.7;
}

.tsa-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.tsa-field {
    display: grid;
    gap: 6px;
}

.tsa-field-wide {
    grid-column: span 2;
}

.tsa-field span {
    color: #344054;
    font-size: 13px;
    font-weight: 800;
}

.tsa-field input,
.tsa-field select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #d7dfeb;
    border-radius: 7px;
    background: #fff;
    color: var(--tsa-ink);
    padding: 9px 10px;
    outline: none;
}

.tsa-field input:focus,
.tsa-field select:focus {
    border-color: var(--tsa-primary);
    box-shadow: 0 0 0 3px rgba(15, 111, 181, .12);
}

.tsa-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tsa-options label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dfe7f0;
    border-radius: 999px;
    background: #fff;
    color: #344054;
    padding: 8px 11px;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.tsa-options input {
    accent-color: var(--tsa-primary);
}

.tsa-note {
    border: 1px solid #d6ebe8;
    border-radius: 8px;
    background: #f1fbf8;
    color: #245b55;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.7;
}

.tsa-actions,
.tsa-result-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.tsa-actions-right {
    justify-content: flex-end;
}

.tsa-btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #cfd8e6;
    border-radius: 7px;
    background: #fff;
    color: #24364b;
    padding: 9px 13px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.tsa-btn:hover:not(:disabled) {
    border-color: var(--tsa-primary);
    color: var(--tsa-primary-dark);
}

.tsa-btn-primary {
    border-color: var(--tsa-primary);
    background: var(--tsa-primary);
    color: #fff;
}

.tsa-btn-primary:hover:not(:disabled) {
    background: var(--tsa-primary-dark);
    color: #fff;
    transform: translateY(-1px);
}

.tsa-btn:disabled {
    cursor: not-allowed;
    opacity: .56;
}

.tsa-drop {
    min-height: 190px;
    display: grid;
    place-items: center;
    gap: 8px;
    border: 2px dashed #b9c7d8;
    border-radius: 8px;
    background: #f8fbfd;
    padding: 26px;
    text-align: center;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}

.tsa-drop.is-dragover {
    border-color: var(--tsa-primary);
    background: #eef7fc;
}

.tsa-drop input {
    display: none;
}

.tsa-drop-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--tsa-primary);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    font-weight: 500;
}

.tsa-drop strong {
    font-size: 16px;
}

.tsa-drop small,
.tsa-file-toolbar,
.tsa-section-title span {
    color: var(--tsa-muted);
    font-size: 13px;
    line-height: 1.6;
}

.tsa-file-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tsa-file-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tsa-file-card,
.tsa-result-card,
.tsa-verifier {
    border: 1px solid #e4eaf3;
    border-radius: 8px;
    background: #fff;
    padding: 14px;
}

.tsa-file-card {
    display: grid;
    gap: 9px;
}

.tsa-file-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.tsa-file-name {
    font-weight: 850;
    color: #102a43;
    word-break: break-word;
}

.tsa-file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--tsa-muted);
    font-size: 12px;
}

.tsa-file-remove {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #efc2c2;
    border-radius: 50%;
    background: #fff7f7;
    color: var(--tsa-danger);
    cursor: pointer;
    font-weight: 900;
}

.tsa-file-status {
    color: var(--tsa-muted);
    font-size: 12px;
}

.tsa-file-status.success {
    color: var(--tsa-success);
}

.tsa-file-status.error {
    color: var(--tsa-danger);
}

.tsa-more {
    grid-column: 1 / -1;
    border: 1px dashed #ccd7e5;
    border-radius: 8px;
    background: #fbfcff;
    color: var(--tsa-muted);
    padding: 16px;
    text-align: center;
}

.tsa-progress {
    display: grid;
    gap: 9px;
}

.tsa-progress-bar {
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef5;
}

.tsa-progress-bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--tsa-primary), var(--tsa-accent));
    transition: width .2s ease;
}

.tsa-progress-text {
    min-height: 22px;
    color: var(--tsa-muted);
    font-size: 13px;
}

.tsa-results {
    display: grid;
    gap: 10px;
}

.tsa-result-card {
    display: grid;
    gap: 10px;
}

.tsa-result-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.tsa-result-head b {
    word-break: break-word;
}

.tsa-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 4px 9px;
    background: #eaf7f2;
    color: var(--tsa-success);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.tsa-badge.error {
    background: #fff1f1;
    color: var(--tsa-danger);
}

.tsa-result-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px 12px;
    font-size: 13px;
}

.tsa-result-grid span:nth-child(odd) {
    color: var(--tsa-muted);
    font-weight: 750;
}

.tsa-mono {
    font-family: Consolas, Monaco, monospace;
    word-break: break-all;
}

.tsa-small-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tsa-small-actions .tsa-btn {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 12px;
}

.tsa-section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.tsa-section-title b {
    font-size: 15px;
}

.tsa-verify-status {
    color: var(--tsa-muted);
    font-size: 13px;
    font-weight: 800;
}

.tsa-verify-status.success {
    color: var(--tsa-success);
}

.tsa-verify-status.error {
    color: var(--tsa-danger);
}

@media (max-width: 980px) {
    .tsa-guide,
    .tsa-grid,
    .tsa-file-list {
        grid-template-columns: 1fr;
    }

    .tsa-field-wide {
        grid-column: auto;
    }

    .tsa-guide-side {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .tsa-tabs,
    .tsa-guide-side {
        grid-template-columns: 1fr;
    }

    .tsa-guide-side div {
        min-height: auto;
        border-left: 0;
        border-top: 1px solid #edf1f6;
    }

    .tsa-guide-side div:first-child {
        border-top: 0;
    }

    .tsa-step-head,
    .tsa-file-toolbar,
    .tsa-result-head,
    .tsa-section-title {
        display: grid;
    }

    .tsa-panel,
    .tsa-guide-main,
    .tsa-drop {
        padding: 14px;
    }

    .tsa-result-grid {
        grid-template-columns: 1fr;
    }
}
